> 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/docs/ongoing-projects/ai-rogue-phase-39-asset-generation-plan.md).

# AI Rogue Phase 39 Asset Generation Plan

> Status: Final closeout Captured: 2026-06-30 Closed: 2026-07-01 Source spec: `.spec_system/archive/phases/phase_39/PRD_phase_39.md` Scope: Asset and media generation needed to fully complete Phase 39.

***

## Short Answer

Phase 39 completed with zero new generated runtime assets.

Sessions 01-07 shipped by reusing existing visual and audio assets. Session 04 added the reused-media fourth floor, and Session 07 promoted `insight-beetle` from the prepared atlas/audio inventory. Do not generate new media retroactively for this phase.

Every authored level still needs an explicit soundtrack choice in its level spec. "Zero new assets" means the level can point at an existing music loop and ambience loop; it does not mean the level ships without music.

Session 07 chose the prepared-media path:

* `firewall-gauntlet` guarantees `insight-beetle`.
* `insight-beetle` already had a committed five-frame atlas set.
* The enemy reuses the existing `corruption` audio family.
* No new visual, music, ambience, SFX, terminal, protocol, objective, status, boss, save-schema media, or provenance asset work was required.

Do not generate new bosses, music, ambience, protocol art, status art, or theme art just to extend this completed Phase 39 plan. Those are follow-on assets only if a later implementation deliberately chooses that extra content type.

***

## Per-Level Soundtrack Plan

The Phase 39 registry makes audio explicit per level:

* Each `AiRogueLevelSpec` declares a `musicTrackId`.
* Each `AiRogueLevelSpec` declares an `ambienceId`.
* Those IDs can reuse existing committed Ogg files.
* A unique Ogg soundtrack per level is not required for the baseline phase.

Current committed music IDs are:

| Music ID   | Current file                               | Intended use                   |
| ---------- | ------------------------------------------ | ------------------------------ |
| `sector_1` | `02_sector_1_cold_cache_drift.ogg`         | Early/cold-cache level pacing. |
| `sector_2` | `03_sector_2_firewall_pressure.ogg`        | Mid-run pressure pacing.       |
| `sector_3` | `04_sector_3_kernel_sentinel_ignition.ogg` | Kernel/finale/boss pacing.     |
| `title`    | `01_title_menu_loop.ogg`                   | Title/menu.                    |
| `victory`  | `05_victory_shard_crown_resolution.ogg`    | Win result.                    |
| `defeat`   | `06_defeat_core_dump_after_midnight.ogg`   | Loss result.                   |

Current committed ambience IDs cover the five existing themes: `theme_cold_cache_ambience`, `theme_corrupted_index_ambience`, `theme_firewall_ambience`, `theme_kernel_core_ambience`, and `theme_model_vault_ambience`.

The current reused-media fourth floor, `firewall-gauntlet`, reuses `sector_3` and `theme_firewall_ambience` intentionally. Future reused-media floors should choose one existing music ID and one existing ambience ID, then document the reuse rationale in the level spec or tests so it does not look accidental.

Generate a new music loop only when the implementation chooses a floor identity whose pacing cannot be represented by `sector_1`, `sector_2`, or `sector_3`. Generate a new ambience loop only when a new theme ID is added.

***

## Existing Assets To Reuse First

The current runtime already has enough prepared media to finish the low-risk Phase 39 path.

| Asset area              | Existing coverage                                                                                                                                                            | Phase 39 outcome                                                                                             |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Gameplay atlas          | `src/assets/ai-rogue/gameplay-atlas.png` and `.json`                                                                                                                         | Reused for Sessions 01-07 and the Session 04 fourth floor.                                                   |
| UI atlas                | `src/assets/ai-rogue/ui-atlas.png` and `.json`                                                                                                                               | Reuse unless a route-visible UI/result surface changes.                                                      |
| Standard enemies        | Five-frame sets exist for `cache-wraith`, `packet-thief`, `signal-gnat`, `ping-mosquito`, `index-skink`, `corrupt-newt`, `venom-daemon`, `burst-toad`, and `insight-beetle`. | Session 07 selected `insight-beetle` for the low-risk real-content proof.                                    |
| Legacy standard enemies | `errant-process` and `firewall-sentry` have older frame naming plus attack/hit/shield/guard support.                                                                         | Keep as baseline compatibility; do not use them as proof of the new five-frame path.                         |
| Boss                    | Kernel Sentinel frames and boss/final-defense support already exist.                                                                                                         | Session 06 represented these through reusable boss/finale contracts without generating another boss.         |
| Theme visuals           | Five current sector themes have tile/decal frames and ambience routing.                                                                                                      | Session 04 intentionally reuses `firewall`; future floors can reuse an existing theme such as `model-vault`. |
| Audio                   | Six music tracks, five theme ambience loops, and 64 SFX/stinger files are committed.                                                                                         | Reuse existing music, ambience, enemy-family cues, protocol cues, and boss cues.                             |

Prepared enemy candidates that can satisfy the Session 07 content proof without new generated art:

| Candidate enemy  | Existing frame pattern                          | Why it is useful                                                       |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------- |
| `ping-mosquito`  | `idle_0`, `idle_1`, `attack`, `hit`, `defeated` | Fast shard-drain pressure using an existing behavior and audio family. |
| `index-skink`    | `idle_0`, `idle_1`, `attack`, `hit`, `defeated` | Status pressure through `leak-on-hit` with no new renderer path.       |
| `corrupt-newt`   | `idle_0`, `idle_1`, `attack`, `hit`, `defeated` | Contact-punish enemy that exercises existing effect tags.              |
| `burst-toad`     | `idle_0`, `idle_1`, `attack`, `hit`, `defeated` | High-tempo enemy that exercises self-jam behavior.                     |
| `insight-beetle` | `idle_0`, `idle_1`, `attack`, `hit`, `defeated` | Death-reward path that exercises reward and save coverage.             |

Session 07 selected `insight-beetle` for the first real content expansion. It is activated through the depth-4 `firewall-gauntlet` authored enemy guarantee and reuses the existing `corruption` audio family plus committed five-frame atlas set. No new visual, music, ambience, SFX, terminal, protocol, objective, status, boss, or save-schema media work is required for this selection.

***

## Future Mandatory Generation Only If New Media Is Required

Generate this set only if a future session intentionally needs a new enemy that is not already covered by the current atlas.

| Priority | Asset                                 | Exact deliverables                                                                                               | Runtime destination                                                                 |
| -------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| P0       | One standard enemy visual frame set   | `enemy_<kind>_idle_0`, `enemy_<kind>_idle_1`, `enemy_<kind>_attack`, `enemy_<kind>_hit`, `enemy_<kind>_defeated` | `src/assets/ai-rogue/gameplay-atlas.png` and `.json`                                |
| P0       | Source and alpha files for that enemy | Generated source sheet plus cleaned alpha derivative                                                             | `docs/ongoing-projects/generated/ai-rogue-visual-audio-assets/source/` and `alpha/` |
| P0       | Crop-manifest entries                 | Five accepted frame entries with source rects, target size, anchor, category, notes, and status                  | `docs/ongoing-projects/generated/ai-rogue-visual-audio-assets/crop-manifest.json`   |
| P0       | Provenance and inventory note         | Prompt summary, generation source, cleanup notes, final paths, and validation evidence                           | `docs/extensions/ai-rogue/visual-assets.md`                                         |

Frame constraints for the generated standard enemy:

* Use 16x16 runtime source frames.
* Preserve a stable footprint across idle, attack, hit, and defeated states.
* Use transparent or cleaned alpha; no chroma-key color should leak into the packed atlas.
* Match the current AI Rogue palette and high-contrast board readability.
* Reuse an existing audio family: `fast`, `thief`, `corruption`, `sentry`, or `generic`. Do not add new SFX for the minimum Phase 39 proof.

Implementation follow-up after generating new frames:

* Add frame names to the relevant TypeScript frame contracts, or to the derived content asset declarations once Session 05 lands.
* Add the enemy template/spec row, save-schema parity if the kind can persist, and focused combat, spawn, render-model, asset, audio, and save tests.
* Run `python3 scripts/extensions/ai-rogue/pack-visual-assets.py`.
* Run `bash scripts/check-asset-sizes.sh`.

***

## Conditional Follow-On Assets

These assets are not required for the minimal Phase 39 completion path. Generate them only when a session explicitly chooses that content type after the required registry, validation, enemy metadata, and boss-contract work is stable.

| Asset type            | Generate when                                                                                           | Deliverables                                                                                                                                                                                       |
| --------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| New theme visuals     | Session 07 chooses a genuinely new sector theme instead of reusing an existing one.                     | Wall frame, optional floor reference, accent reference, sparse decal, atmosphere color notes, atlas frames, crop-manifest entries, provenance.                                                     |
| New sector music      | The new floor has distinct pacing that existing `sector_1`, `sector_2`, or `sector_3` cannot represent. | One 48 kHz stereo Ogg Opus loop under the reviewed AI Rogue music cap, `AiRogueMusicId`, basename map entry, provenance, routing, tests.                                                           |
| New theme ambience    | A new theme is added.                                                                                   | One 48 kHz stereo Ogg Opus ambience loop, `AiRogueThemeAmbienceId`, basename map entry, provenance, theme routing, tests.                                                                          |
| New terminal identity | The content proof adds a terminal that needs unique board or UI presentation.                           | Terminal idle/active board frame or compact UI icon only if existing terminal frames cannot be reused.                                                                                             |
| New objective visuals | The content proof adds a visible objective type beyond existing objective/final-defense markers.        | Lock, progress, and unlock markers sized to current board/HUD patterns.                                                                                                                            |
| New protocol          | A new carried protocol is added.                                                                        | Pickup sprite plus effect sprites for cast, impact, trail, beam, or landing; optional SFX only if current protocol cues do not fit.                                                                |
| New status effect     | A new saved or visible status is added.                                                                 | Gameplay overlay, HUD pip, supplemental UI icon if needed, cleanse/readability checks, save-schema parity.                                                                                         |
| New miniboss          | Session 06 boss-spec migration is complete and the phase deliberately validates a second boss path.     | 32x32 or agreed footprint frames: `idle_0`, `idle_1`, `charge_0`, `telegraph_0`, `attack_0`, `hit_0`, optional `shielded_0` or `enraged_0`, `shutdown_0`, optional FX frame, audio mapping, tests. |
| New boss audio        | A miniboss or second boss has a distinct sound identity.                                                | Charge, attack/fire, hit, shutdown/defeat, and optional reveal stinger as 48 kHz mono Ogg Opus files with provenance and cue routing.                                                              |
| UI/result art         | Save/load, reward presentation, wallet, or result stats visibly change.                                 | UI-atlas icons or frame pieces only for the changed surface.                                                                                                                                       |

***

## Phase 39 No-New-Media Closeout

Phase 39 closeout outcome:

* Session 04 proved the fourth floor with existing themes, enemies, prefabs, terminals, protocols, music, ambience, and frames.
* Session 06 represented Kernel Sentinel through a reusable boss spec before any second boss work.
* Session 07 proved the real-content path by activating `insight-beetle` without new media.
* No new music, ambience, protocol art, terminal art, objective art, status art, boss art, boss audio, or theme art was added.
* No remote content loading, third-party runtime asset transfers, hosted writes, collectors, analytics, or unreviewed JSON packs were added.

## Assets Not To Generate For Future Phase 39 Follow-Up

* Do not generate new media to re-document already completed Phase 39 work.
* Do not generate a second boss unless the session deliberately adds another boss spec and validates combat, render, audio, browser, save, and finale behavior.
* Do not generate new music or ambience until the level encounter pacing is stable.
* Do not generate protocol, terminal, objective, or status art before the related simulation and save contracts are stable.
* Do not add remote content loading, third-party runtime asset transfers, hosted writes, collectors, analytics, or unreviewed JSON packs.

***

## Asset Workflow

Use the existing AI Rogue asset workflow for any generated visual asset:

1. Save generated source art under `docs/ongoing-projects/generated/ai-rogue-visual-audio-assets/source/`.
2. Save cleaned alpha derivatives under `docs/ongoing-projects/generated/ai-rogue-visual-audio-assets/alpha/`.
3. Add accepted and rejected crop decisions to `docs/ongoing-projects/generated/ai-rogue-visual-audio-assets/crop-manifest.json`.
4. Run `python3 scripts/extensions/ai-rogue/pack-visual-assets.py`.
5. Update runtime frame contracts or derived content asset declarations.
6. Update `docs/extensions/ai-rogue/visual-assets.md` with inventory, provenance, rejection notes, and validation evidence.
7. Run `bash scripts/check-asset-sizes.sh`.

Use the existing audio workflow for any generated audio asset:

1. Generate audio through the current scripts when possible: `scripts/generate-ai-rogue-audio-sfx.ts`, `scripts/generate-ai-rogue-theme-ambience.ts`, or `scripts/generate-ai-rogue-adaptive-stingers.ts`.
2. Commit final Ogg files under `src/assets/ai-rogue/audio/music/` or `src/assets/ai-rogue/audio/sfx/`.
3. Update the matching `provenance.json`.
4. Add or update audio ID types, basename maps, routing, and tests.
5. Preserve autoplay unlock, lazy decode, mute/volume preferences, silent fallback, and route disposal behavior.

***

## Validation Checklist

Run the relevant subset when generated media lands:

```bash
bun run typecheck
bunx vitest run src/extensions/ai-rogue/runtime/__tests__/assets.test.ts
bunx vitest run src/extensions/ai-rogue/runtime/__tests__/audio.test.ts
bunx vitest run src/extensions/ai-rogue/runtime/__tests__/render-model.test.ts
bunx vitest run src/extensions/ai-rogue/__tests__/save-schema.test.ts
bash scripts/check-asset-sizes.sh
```

Run `bun run build` and `bun run budget:check` if route imports, atlas import shape, or lazy-loading boundaries change.


---

# 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/docs/ongoing-projects/ai-rogue-phase-39-asset-generation-plan.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.
