> 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-session03-registry-validation-and-save-parity/tasks.md).

# Task Checklist

**Session ID**: `phase39-session03-registry-validation-and-save-parity` **Total Tasks**: 16 **Estimated Duration**: 3-4 hours **Created**: 2026-06-30

***

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

***

## Progress Summary

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

***

## Setup (2 tasks)

* [x] T001 \[S3903] Verify Session 01 and Session 02 artifacts, current registry validator behavior, save-schema enum shape, and focused test commands (`.spec_system/PRD/phase_39/session_03_registry_validation_and_save_parity.md`)
* [x] T002 \[S3903] Confirm active runtime ID sources for enemies, themes, protocols, terminals, prefabs, pickups, music, ambience, objectives, and finale ownership without route, renderer, bridge, generated-data, or PixiJS imports (`src/extensions/ai-rogue/runtime/content/validate.ts`)

***

## Foundation (4 tasks)

* [x] T003 \[S3903] \[P] Add exported persisted and compatibility ID arrays for protocols, enemies, terminals, and themes while preserving current zod parser behavior and schema version (`src/extensions/ai-rogue/save-schema.ts`)
* [x] T004 \[S3903] \[P] Add missing validation issue codes for objective or finale ownership with types matching declared contract; exhaustive enum handling (`src/extensions/ai-rogue/runtime/content/types.ts`)
* [x] T005 \[S3903] \[P] Create save-schema parity tests that compare runtime active IDs against persisted and compatibility ID arrays with deterministic ordering (`src/extensions/ai-rogue/__tests__/save-schema-parity.test.ts`)
* [x] T006 \[S3903] \[P] Extend registry malformed-reference test helpers for nested generation, placement, enemy table, guarantee, objective, music, ambience, pickup, boss, and finale cases (`src/extensions/ai-rogue/runtime/content/__tests__/levels.test.ts`)

***

## Implementation (6 tasks)

* [x] T007 \[S3903] Harden generation reference validation for theme, baseline protocol, music, and ambience with explicit error mapping and sanitized issue output (`src/extensions/ai-rogue/runtime/content/validate.ts`)
* [x] T008 \[S3903] Harden placement and enemy reference validation for exit guards, terminals, prefabs, enemy tables, and guaranteed enemies with explicit error mapping and sanitized issue output (`src/extensions/ai-rogue/runtime/content/validate.ts`)
* [x] T009 \[S3903] Harden pickup, objective, boss, and finale ownership validation with schema-validated input and explicit error mapping (`src/extensions/ai-rogue/runtime/content/validate.ts`)
* [x] T010 \[S3903] Update registry tests so every invalid reference named in the session stub fails with the expected issue code, path, and no unsafe value echoing (`src/extensions/ai-rogue/runtime/content/__tests__/levels.test.ts`)
* [x] T011 \[S3903] Update authoring-path assertions to prefer `AI_ROGUE_LEVEL_SPECS` and `levelSpecForDepth()` while leaving legacy rotating wrappers available during migration (`src/extensions/ai-rogue/runtime/content/__tests__/levels.test.ts`)
* [x] T012 \[S3903] Extend import-boundary coverage if new exports or imports could pull route, renderer, bridge, generated-data, public-demo, or PixiJS modules into registry or save-schema paths (`src/extensions/ai-rogue/runtime/__tests__/runtime-boundary.test.ts`)

***

## Testing (4 tasks)

* [x] T013 \[S3903] \[P] Run focused registry validation and save-schema parity suites (`src/extensions/ai-rogue/runtime/content/__tests__/levels.test.ts`, `src/extensions/ai-rogue/__tests__/save-schema-parity.test.ts`)
* [x] T014 \[S3903] \[P] Run existing save-schema parser tests to prove browser-local parse behavior remains stable (`src/extensions/ai-rogue/__tests__/save-schema.test.ts`)
* [x] T015 \[S3903] Run typecheck and AI Rogue boundary tests for import purity and runtime contract safety (`bun run typecheck`, `src/extensions/ai-rogue/runtime/__tests__/runtime-boundary.test.ts`)
* [x] T016 \[S3903] Validate ASCII and LF requirements for new spec, task checklist, and touched AI Rogue source and test files (`.spec_system/specs/phase39-session03-registry-validation-and-save-parity/tasks.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 `implement` to hand off to the implement -> creview -> validate sequence

***

## Next Steps

Run the `implement` 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-session03-registry-validation-and-save-parity/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.
