> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/sessions/phase31-session01-demo-mode-foundation/code-review.md).

# Code Review and Repair Report

**Session ID**: `phase31-session01-demo-mode-foundation` **Reviewed**: 2026-06-24 **Scope**: All uncommitted changes in the working tree **Result**: RESOLVED

## Review Surface

**Files reviewed** (all uncommitted changes):

* `.spec_system/PRD/PRD.md` - tracked-modified
* `.spec_system/state.json` - tracked-modified
* AI Rogue Rotten Soup gameplay-depth note, now consolidated into `docs/extensions/ai-rogue/gameplay-depth.md` - tracked-modified
* `docs/ongoing-projects/cloudflare-pages-demo-website-plan.md` - tracked-modified
* `src/extensions/ai-rogue/__tests__/persistence.test.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/__tests__/input.test.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/__tests__/render-model.test.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/__tests__/vault.test.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/effects.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/equipment.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/index.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/input.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/inspect.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/render-model.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/renderer.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/simulation.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/types.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/world.ts` - tracked-modified
* `src/extensions/ai-rogue/save-schema.ts` - tracked-modified
* `src/extensions/ai-rogue/views/play-view.tsx` - tracked-modified
* `src/extensions/ai-rogue/views/runtime-canvas.tsx` - tracked-modified
* `src/extensions/registry.ts` - tracked-modified
* `src/lib/__tests__/extension-registry.test.ts` - tracked-modified
* `src/lib/__tests__/setup-config-extensions.test.ts` - tracked-modified
* `src/lib/setup-config.ts` - tracked-modified
* `src/start.ts` - tracked-modified
* `src/vite-env.d.ts` - tracked-modified
* `vite.config.ts` - tracked-modified
* `.spec_system/PRD/phase_31/PRD_phase_31.md` - untracked
* `.spec_system/PRD/phase_31/session_01_demo_mode_foundation.md` - untracked
* `.spec_system/PRD/phase_31/session_02_snapshot_exporter_and_fixtures.md` - untracked
* `.spec_system/PRD/phase_31/session_03_app_data_and_mutation_boundary.md` - untracked
* `.spec_system/PRD/phase_31/session_04_extensions_and_agent_routes.md` - untracked
* `.spec_system/PRD/phase_31/session_05_pages_build_and_deployment_scaffold.md` - untracked
* `.spec_system/PRD/phase_31/session_06_demo_qa_and_privacy_verification.md` - untracked
* `.spec_system/PRD/phase_31/session_07_release_polish_and_documentation.md` - untracked
* `.spec_system/specs/phase31-session01-demo-mode-foundation/implementation-notes.md` - untracked
* `.spec_system/specs/phase31-session01-demo-mode-foundation/spec.md` - untracked
* `.spec_system/specs/phase31-session01-demo-mode-foundation/tasks.md` - untracked
* `src/extensions/ai-rogue/__tests__/runtime-canvas.test.tsx` - untracked
* `src/extensions/ai-rogue/runtime/__tests__/compile.test.ts` - untracked
* `src/extensions/ai-rogue/runtime/__tests__/crash-dumps.test.ts` - untracked
* `src/extensions/ai-rogue/runtime/__tests__/equipment.test.ts` - untracked
* `src/extensions/ai-rogue/runtime/__tests__/prefabs.test.ts` - untracked
* `src/extensions/ai-rogue/runtime/__tests__/terminals.test.ts` - untracked
* `src/extensions/ai-rogue/runtime/__tests__/themes.test.ts` - untracked
* `src/extensions/ai-rogue/runtime/compile.ts` - untracked
* `src/extensions/ai-rogue/runtime/prefabs.ts` - untracked
* `src/extensions/ai-rogue/runtime/terminals.ts` - untracked
* `src/extensions/ai-rogue/runtime/themes.ts` - untracked
* `src/lib/__tests__/public-demo.test.ts` - untracked
* `src/lib/public-demo.ts` - untracked

**Inventory commands**: `git status`, `git diff HEAD`, `git diff --cached`, `git ls-files --others --exclude-standard`

## Findings by Severity

### Critical

None.

### High

None.

### Medium

None.

### Low

* `src/extensions/ai-rogue/runtime/index.ts:23` - Prettier required the short type re-export to be a single line. | Fix: collapsed the type re-export to the configured style. | Status: FIXED
* `src/extensions/ai-rogue/runtime/compile.ts:6`, `src/extensions/ai-rogue/runtime/compile.ts:31`, `src/extensions/ai-rogue/runtime/prefabs.ts:36`, `src/extensions/ai-rogue/runtime/terminals.ts:7`, `src/extensions/ai-rogue/runtime/themes.ts:29`, `src/extensions/ai-rogue/runtime/effects.ts:286`, `src/extensions/ai-rogue/runtime/effects.ts:329`, `src/extensions/ai-rogue/runtime/simulation.ts:534`, `src/extensions/ai-rogue/runtime/simulation.ts:1606`, `src/extensions/ai-rogue/runtime/world.ts:348`, AI Rogue gameplay-depth note line 15 - Added source/doc lines used non-ASCII punctuation, which violates the session ASCII rule. | Fix: replaced added em dashes, arrows, interpuncts, and en dashes with ASCII equivalents. | Status: FIXED
* `.spec_system/PRD/PRD.md:56`, `docs/ongoing-projects/cloudflare-pages-demo-website-plan.md:1` - Modified Markdown was not Prettier-formatted after the session additions. | Fix: ran Prettier on the two modified Markdown files. | Status: FIXED

## Assumptions and Deliberate Non-Fixes

* `bun run lint` still fails in unchanged, out-of-scope files: `videos/ai-rogue-suno-promo/scripts/build-promo-frames.mjs` has pre-existing Prettier errors, and `src/extensions/use-extension-data.ts` has a pre-existing React hook dependency warning. These files are not uncommitted review-surface changes and were not modified.

## Behavior Changes

* No runtime behavior was intentionally changed by code-review repairs. User-facing separators added by this work now use ASCII hyphens instead of non-ASCII punctuation.

## Verification

* Tests: `bun run test` - PASS - 358 test files, 4111 tests.
* Tests: focused public-demo and AI Rogue suites - PASS - 13 test files, 120 tests.
* Type checker: `bun run typecheck` - PASS.
* Type checker: `bun run typecheck:scripts` - PASS.
* Build: `bun run build` - PASS - normal Worker/client build completed.
* Build shape: `test -d dist/client && test -f dist/server/wrangler.json` - PASS.
* Demo build: `VITE_AI_OS_PUBLIC_DEMO=1 VITE_CLAUDE_OS_ENABLED_EXTENSIONS=all bunx vite build --mode demo-pages` - PASS.
* Demo build shape: `test -f demo-website/dist/client/index.html` - PASS.
* Demo Worker artifact check: `find demo-website/dist -name 'wrangler.json' -o -name '_worker.js'` - PASS - no matches.
* Linter: changed TypeScript/TSX files with `bunx eslint` - PASS.
* Linter: `bun run lint` - FAIL - out-of-scope unchanged files listed above.
* Formatter: changed files with `bunx prettier --check` - PASS.
* Whitespace: `git diff --check` - PASS.
* ASCII: added-line and untracked-file scans - PASS.
* Final diff re-read: no remaining in-scope issues.

## Summary

1. Reviewed all uncommitted changes: 52 files before this report, covering Phase 31 planning/spec artifacts, public-demo build-mode foundation, and concurrent AI Rogue runtime/test/docs changes.
2. Findings: 0 critical, 0 high, 0 medium, 3 low; all in-scope findings fixed.
3. Deliberately not fixed: repo-wide lint drift in unchanged out-of-scope files, recorded above.
4. Verification passed for full tests, type checks, focused lint/format, normal build, demo-pages build, diff whitespace, and ASCII scans.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/sessions/phase31-session01-demo-mode-foundation/code-review.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
