> 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/phase37-session01-g8-runtime-fx/code-review.md).

# Code Review and Repair Report

**Session ID**: `phase37-session01-g8-runtime-fx` **Reviewed**: 2026-06-29 **Scope**: All uncommitted changes in the working tree **Result**: RESOLVED

## Review Surface

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

* `.spec_system/CONSIDERATIONS.md` - tracked-modified
* `.spec_system/SECURITY-COMPLIANCE.md` - tracked-modified
* `.spec_system/docs-audit.md` - tracked-modified
* `.spec_system/state.json` - tracked-modified
* `.spec_system/specs/phase35-session01-rebaseline-audit-evidence/` through `.spec_system/specs/phase35-session10-final-release-gate/` - tracked-deleted archive move source paths, 70 files
* `.spec_system/archive/sessions/phase35-session01-rebaseline-audit-evidence/` through `.spec_system/archive/sessions/phase35-session10-final-release-gate/`
  * untracked archive move destination paths, 70 files
* `.spec_system/specs/phase36-session01-current-audio-balance-audit/spec.md` - tracked-modified
* `.spec_system/specs/phase36-session07-adaptive-stinger-pack/security-compliance.md`
  * tracked-modified
* `.spec_system/specs/phase36-session07-adaptive-stinger-pack/validation.md` - tracked-modified
* `.spec_system/specs/phase36-session08-final-audio-validation-and-docs/security-compliance.md`
  * tracked-modified
* `.spec_system/specs/phase36-session08-final-audio-validation-and-docs/validation.md`
  * tracked-modified
* `.spec_system/specs/phase37-session01-g8-runtime-fx/spec.md` - untracked
* `.spec_system/specs/phase37-session01-g8-runtime-fx/tasks.md` - untracked
* `.spec_system/specs/phase37-session01-g8-runtime-fx/implementation-notes.md`
  * untracked
* `README.md` - tracked-modified
* `docs/ARCHITECTURE.md` - tracked-modified
* `docs/docs-audit.md` - tracked-modified
* `docs/extensions/ai-rogue/generated/ai-rogue-production-atlas-preview.png` - tracked-modified binary
* `docs/extensions/ai-rogue/visual-assets.md` - tracked-modified
* `docs/ongoing-projects/generated/ai-rogue-visual-audio-assets/crop-manifest.json`
  * tracked-modified
* `src/assets/ai-rogue/gameplay-atlas.json` - tracked-modified
* `src/assets/ai-rogue/gameplay-atlas.png` - tracked-modified binary
* `src/assets/ai-rogue/ui-atlas.json` - tracked-modified
* `src/assets/ai-rogue/ui-atlas.png` - tracked-modified binary
* `src/extensions/ai-rogue/runtime/__tests__/assets.test.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/__tests__/render-model.test.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/__tests__/status-expanded.test.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/assets.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/effects-transient.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/effects.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/render-hud.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/render-model.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/renderer-layers.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/status.ts` - tracked-modified
* `src/extensions/ai-rogue/runtime/types-assets.ts` - tracked-modified
* `tests/e2e/ai-rogue-runtime.spec.ts` - tracked-modified

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

Additional inventory evidence:

* 101 tracked paths differ from `HEAD`.
* 73 untracked file paths were present before this report.
* All 70 untracked Phase 35 archive files matched their deleted `HEAD` originals byte-for-byte.
* No staged changes were present.
* Binary atlas and preview files were reviewed by metadata, size, packer output, and browser/runtime proof rather than byte-level image decoding in this report.

## Findings by Severity

### Critical

* No findings.

### High

* No findings.

### Medium

* `src/extensions/ai-rogue/runtime/render-model.ts` - Reveal marker z-order used an unbounded `FEEDBACK_Z - 20 + index`, allowing enough visible hazard/objective markers to sort above entities and combat feedback. Fix: added a bounded `REVEAL_MARKER_Z` below entity z and updated render-model coverage to assert reveal markers remain below the player entity. Status: FIXED.
* `src/extensions/ai-rogue/runtime/render-hud.ts` - Large-HUD mode could wrap the second status-pip row into the progression icon row when all ten statuses were active. Fix: large-HUD status pips now use ten columns so all possible status pips stay in one row, with render-model coverage for the all-status case. Status: FIXED.

### Low

* `.spec_system/specs/phase36-session07-adaptive-stinger-pack/validation.md` and `.spec_system/specs/phase36-session08-final-audio-validation-and-docs/validation.md`
  * Historical validation evidence tables were malformed because command strings containing pipe characters had been formatted as table separators. Fix: replaced the malformed tables with bullet evidence ledgers preserving the same validation facts. Status: FIXED.
* Multiple changed text files - Prettier drift remained in session docs and G8 runtime files. Fix: ran Prettier on the reported changed files and reran lint/format checks. Status: FIXED.

## Assumptions and Deliberate Non-Fixes

* The Phase 35 spec deletion plus `.spec_system/archive/sessions/phase35-*` untracked additions were treated as an intentional archive move because every destination file matched its deleted `HEAD` source byte-for-byte and the surrounding state/docs changes describe completed Phase 36 and Phase 37 setup.
* The binary atlas outputs were not manually byte-diffed at image-pixel level in this report because the deterministic packer, atlas metadata validation, asset-size gate, focused runtime tests, and Playwright canvas proof covered the behavioral and policy requirements for generated assets.

## Behavior Changes

* Reveal markers now render in a bounded overlay band below entities instead of climbing with marker count. This preserves intended G8 reveal readability while preventing objective/hazard markers from obscuring actors or combat feedback.
* Large-HUD status pips now fit all ten possible statuses in one row. This preserves the new G8 HUD status surface while avoiding overlap with progression icons.

## Verification

* Project analysis: `bash .spec_system/scripts/analyze-project.sh --json` - PASS - current session resolved to `phase37-session01-g8-runtime-fx`.
* Archive move check: `git show HEAD:<source> | cmp -s - <archive-file>` over Phase 35 archived sessions - PASS - 70/70 archive files matched deleted originals.
* Manifest uniqueness: `jq` frame-name uniqueness check - PASS - 122 total frame names, 122 unique, no duplicates.
* Packer: `python3 scripts/extensions/ai-rogue/pack-visual-assets.py` - PASS - gameplay 197 frames / 58,196 bytes; UI 92 frames / 15,332 bytes; preview 93,231 bytes.
* Focused tests: `bunx vitest run src/extensions/ai-rogue/runtime/__tests__/assets.test.ts src/extensions/ai-rogue/runtime/__tests__/status-expanded.test.ts src/extensions/ai-rogue/runtime/__tests__/render-model.test.ts`
  * PASS - 3 files, 35 tests.
* Full tests: `bun run test` - PASS - 385 files, 4416 tests.
* Type checker: `bun run typecheck` - PASS.
* Linter: `bun run lint` - PASS.
* Formatter: `bun run format:check` - PASS.
* Markdown linter: `bun run lint:md` - PASS.
* Asset sizes: `bash scripts/check-asset-sizes.sh` - PASS - all assets within configured limits, total 15M.
* Browser proof: `PLAYWRIGHT_PORT=5311 PLAYWRIGHT_PUBLIC_DEMO_PORT=5312 bunx playwright test tests/e2e/ai-rogue-runtime.spec.ts tests/e2e/ai-rogue-mobile.spec.ts`
  * PASS - 17 Chromium tests.
* Diff whitespace: `git diff --check` - PASS.
* Final diff re-read: no remaining review issues found.

## Summary

1. Reviewed all uncommitted changes: 101 tracked changed paths and 73 untracked file paths before this report, including generated atlases, runtime code, tests, docs, spec-system state, and the Phase 35 archive move.
2. Findings: 0 critical, 0 high, 2 medium, 2 low; all resolved.
3. Deliberate non-fixes: kept the Phase 35 archive move because it was byte-for-byte exact; reviewed binary assets through generated metadata, packer output, size gates, tests, and browser proof.
4. Verification passed: packer, focused and full Vitest, typecheck, lint, format check, Markdown lint, asset-size validation, Playwright desktop/mobile proof, and diff whitespace check.


---

# 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/phase37-session01-g8-runtime-fx/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.
