> 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/phases/phase_39/session_01_baseline_and_registry_skeleton.md).

# Session 01: Baseline And Registry Skeleton

**Session ID**: `phase39-session01-baseline-and-registry-skeleton` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Establish behavior-preserving safety tests and add the initial level registry without changing runtime routing.

***

## Scope

### In Scope (MVP)

* Add baseline tests for the current three playable depths: theme, floor arc, exit guard, baseline protocol, guaranteed protocol, terminal, prefab, music, ambience, and objective.
* Add golden determinism coverage for stable depth 1-3 seeds, including public world shape and first-turn state.
* Add Kernel Sentinel boss-presentation baseline coverage for frame selection, reveal, hit, telegraph, attack, shutdown, scale, and audio metadata.
* Create `src/extensions/ai-rogue/runtime/content/` with `types.ts`, `levels.ts`, `validate.ts`, and `index.ts`.
* Author the first three `AiRogueLevelSpec` rows so they reproduce the current shipped floors while remaining dead-but-tested.

### Out of Scope

* Routing runtime callers through the registry.
* Adding a fourth floor.
* Adding new enemies, bosses, music, ambience, assets, protocols, or terminals.

***

## Detailed Plan Notes

* This session combines the former Phase 0 baseline lock and Phase 1 registry skeleton work from the consolidated plan.
* Baseline tests must record the current three playable depths before routing code moves: theme, floor arc label, exit guard kind, baseline protocol, guaranteed protocol, terminal, prefab, music, ambience, and objective.
* Golden determinism coverage should use fixed seeds for each current depth so generated world shape and first-turn state remain byte-identical through the migration.
* World-generation parity checks should prove stable seeds keep the same public world shape before and after compatibility wrappers move.
* Boss-presentation baseline coverage must prove Kernel Sentinel frame selection, reveal, hit, telegraph, attack, shutdown, scale, and audio metadata stay unchanged.
* Registry files should be created under `src/extensions/ai-rogue/runtime/content/`: `types.ts`, `levels.ts`, `validate.ts`, and `index.ts`.
* Initial `validateAiRogueContentRegistry()` checks should include unique IDs, contiguous 1-based depths, non-empty enemy tables, valid local references, no finale before the last authored level, and safe text for labels and lessons.
* `levelSpecForDepth(depth)` must have an explicit authored-main-run out-of-range policy. Endless or looped depth behavior is a separate future helper, not an implicit clamp here.
* Keep tests focused on behavior and safe labels, not raw generated private data.

***

## Prerequisites

* [ ] Phase 39 PRD and session stubs exist.
* [ ] Current AI Rogue runtime tests are understood before adding baseline snapshots.

***

## Deliverables

1. Baseline and golden tests that fail on accidental shipped-run behavior drift.
2. Initial content registry files and focused registry validation tests.
3. Documented initial out-of-range policy assumption for the authored main run.

***

## Success Criteria

* [ ] Existing behavior tests are not edited to make the registry pass.
* [ ] `bun run typecheck` passes.
* [ ] A new `content/__tests__/levels.test.ts` or equivalent registry test is green.
* [ ] The new registry test passes.
* [ ] New content code is not yet required by runtime callers.


---

# 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/phases/phase_39/session_01_baseline_and_registry_skeleton.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.
