> 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/phase39-session02-depth-resolver-migration/tasks.md).

# Task Checklist

**Session ID**: `phase39-session02-depth-resolver-migration` **Total Tasks**: 20 **Estimated Duration**: 3-4 hours **Created**: 2026-06-30

***

## Progress Summary

| Metric              | Value     |
| ------------------- | --------- |
| Tasks Completed     | 20 / 20   |
| Estimated Remaining | 0 minutes |
| Blockers            | 0         |

***

Legend: `[x]` completed; `[ ]` pending; `[P]` parallelizable; `[SNNMM]` session ref; `TNNN` task ID.

***

## Setup (2 tasks)

* [x] T001 \[S3902] Verify Session 01 registry, baseline, and golden tests are present before migration (`src/extensions/ai-rogue/runtime/content/index.ts`)
* [x] T002 \[S3902] Audit depth resolver call sites and confirm protocol baseline versus guarantee ownership (`src/extensions/ai-rogue/runtime/world-generator.ts`)

***

## Foundation (5 tasks)

* [x] T003 \[S3902] \[P] Export any needed registry projection helpers without adding route, renderer, bridge, generated-data, or PixiJS imports (`src/extensions/ai-rogue/runtime/content/index.ts`)
* [x] T004 \[S3902] \[P] Add helper projection types if implementation needs level guarantee or resolved generation shapes (`src/extensions/ai-rogue/runtime/content/types.ts`)
* [x] T005 \[S3902] Derive `AI_ROGUE_MAX_DEPTH` from authored level specs while preserving the public export (`src/extensions/ai-rogue/runtime/run-factory.ts`)
* [x] T006 \[S3902] Add `applyLevelGuarantees()` and keep `applyFloorArc()` as a compatibility shim with unchanged free-tile ordering (`src/extensions/ai-rogue/runtime/floor-arc.ts`)
* [x] T007 \[S3902] Update compatibility helpers to project authored depth 1-3 values from level specs with explicit legacy fallback where still required (`src/extensions/ai-rogue/runtime/themes.ts`)

***

## Implementation (7 tasks)

* [x] T008 \[S3902] Migrate prefab, terminal, baseline protocol, and music helpers to read authored level specs for depths 1-3 (`src/extensions/ai-rogue/runtime/prefabs.ts`, `src/extensions/ai-rogue/runtime/terminals.ts`, `src/extensions/ai-rogue/runtime/protocols.ts`, `src/extensions/ai-rogue/runtime/audio.ts`)
* [x] T009 \[S3902] Change exit guard placement to accept a resolved guard kind instead of deriving it from depth (`src/extensions/ai-rogue/runtime/world-placement.ts`)
* [x] T010 \[S3902] Extend world generation options with an optional resolved level spec and resolve one spec per generated authored floor with schema-aligned error handling (`src/extensions/ai-rogue/runtime/world-generator.ts`)
* [x] T011 \[S3902] Route world-generation theme, enemy table, room modifier, exit guard, prefab, terminal, and baseline protocol decisions through the resolved level spec (`src/extensions/ai-rogue/runtime/world-generator.ts`)
* [x] T012 \[S3902] Use `applyLevelGuarantees()` during run creation while keeping handcrafted worlds unchanged (`src/extensions/ai-rogue/runtime/run-factory.ts`)
* [x] T013 \[S3902] Use `applyLevelGuarantees()` during descent to the next floor with unchanged event sequencing and floor objective state (`src/extensions/ai-rogue/runtime/simulation.ts`)
* [x] T014 \[S3902] Preserve depth 1-3 baseline and golden determinism expectations after resolver migration (`src/extensions/ai-rogue/runtime/__tests__/golden-determinism.test.ts`)

***

## Testing (6 tasks)

* [x] T015 \[S3902] \[P] Add resolver tests for authored helper projections, max depth, protocol separation, and explicit legacy fallback (`src/extensions/ai-rogue/runtime/__tests__/depth-resolver.test.ts`)
* [x] T016 \[S3902] \[P] Extend floor-arc tests for `applyLevelGuarantees()` and `applyFloorArc()` shim parity (`src/extensions/ai-rogue/runtime/__tests__/floor-arc.test.ts`)
* [x] T017 \[S3902] \[P] Extend helper tests for themes, prefabs, protocols, terminals, and audio registry-backed outputs (`src/extensions/ai-rogue/runtime/__tests__/themes.test.ts`, `src/extensions/ai-rogue/runtime/__tests__/prefabs.test.ts`, `src/extensions/ai-rogue/runtime/__tests__/protocols.test.ts`, `src/extensions/ai-rogue/runtime/__tests__/terminals.test.ts`, `src/extensions/ai-rogue/runtime/__tests__/audio.test.ts`)
* [x] T018 \[S3902] Add deterministic route-safety tests for reachable exits, adjacent guards, connected prefabs, and non-blocking terminals or vaults (`src/extensions/ai-rogue/runtime/__tests__/world.test.ts`)
* [x] T019 \[S3902] Run focused resolver gate and `bun run typecheck` (`bunx vitest run src/extensions/ai-rogue/runtime/__tests__/world.test.ts src/extensions/ai-rogue/runtime/__tests__/simulation.test.ts src/extensions/ai-rogue/runtime/__tests__/floor-arc.test.ts src/extensions/ai-rogue/runtime/__tests__/themes.test.ts src/extensions/ai-rogue/runtime/__tests__/prefabs.test.ts src/extensions/ai-rogue/runtime/__tests__/protocols.test.ts src/extensions/ai-rogue/runtime/__tests__/terminals.test.ts src/extensions/ai-rogue/runtime/__tests__/audio.test.ts`)
* [x] T020 \[S3902] Validate ASCII and LF requirements for session artifacts and touched runtime files (`.spec_system/specs/phase39-session02-depth-resolver-migration/spec.md`)

***

## Completion Checklist

* [x] All tasks marked `[x]`
* [x] All tests and checks passing
* [x] All files ASCII-encoded with LF line endings
* [x] implementation-notes.md updated
* [x] Ready for `creview` to continue the implement -> creview -> validate sequence

***

## Next Steps

Run the `creview` workflow step.


---

# 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/phase39-session02-depth-resolver-migration/tasks.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.
