> 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/phase36-session01-current-audio-balance-audit/spec.md).

# Session Specification

**Session ID**: `phase36-session01-current-audio-balance-audit` **Phase**: 36 - AI Rogue Audio Asset Finishing **Status**: Not Started **Created**: 2026-06-28

***

## 1. Session Overview

This session validates the already-implemented AI Rogue audio baseline before the phase adds larger enemy, theme, or adaptive audio packs. It focuses on audible browser evidence for the six music tracks, 45 SFX files, Web Audio unlock behavior, mute and volume preferences, silent fallback, runtime control confirmations, and repeated-combat fatigue.

This is next because every later Phase 36 session either depends directly on Session 01 findings or should consume its pass/fail notes before adding more assets or engine behavior. The output is an evidence ledger and targeted docs updates, not new audio generation.

Product review happens on the AI Rogue Play and Settings surfaces. No dev or debug product surface is required; diagnostics belong in tests, command output, screenshots, and this session's implementation notes.

***

## 2. Objectives

1. Prove desktop and mobile AI Rogue audio unlock, mute, volume, and fallback behavior with browser review evidence.
2. Audit the current cue set for balance, tactical readability, repeated-use fatigue, title-loop suitability, and UI-click restraint.
3. Record cue-level follow-up work for replacements, volume changes, routing fixes, or variants before downstream asset sessions begin.
4. Update Phase 36 and AI Rogue audio documentation so later sessions consume current evidence instead of assumptions.

***

## 3. Prerequisites

### Required Sessions

* [x] `phase35-session10-final-release-gate` - Provides the current AI Rogue Production Go posture, release gate evidence, asset policy, and no-open security/GDPR baseline.

### Required Tools Or Knowledge

* Bun 1.3.14 project scripts from `package.json`.
* Playwright browser checks for desktop and mobile AI Rogue routes.
* Browser audio review with audible output for perceived balance and fatigue.
* Knowledge of `runtime/audio.ts`, `renderer-audio-adapter.ts`, AI Rogue preferences, and committed media provenance.

### Environment Requirements

* Run from the repository root.
* Preserve existing uncommitted Phase 36 setup changes.
* Do not generate or commit new media assets in this session.
* Keep all generated session artifacts ASCII-only with Unix LF line endings.

***

## 4. Scope

### In Scope (MVP)

* Players can start AI Rogue in a desktop browser and hear title music, run-start cues, sector music, common combat cues, objective/protocol cues, runtime control confirmations, and fallback-safe behavior.
* Players can use mobile or emulated mobile AI Rogue flows and confirm compact control SFX, music/SFX balance, mute, and volume behavior remain usable.
* Maintainers can inspect a cue-level balance matrix covering the explicit Session 01 cue list and know which cue IDs need replacement, volume tuning, routing changes, or variants.
* Downstream Phase 36 sessions can consume documented decisions for enemy metadata, enemy/boss packs, theme audio, and adaptive stingers.

### Out Of Scope (Deferred)

* Generating new enemy, theme, ambience, or adaptive audio files - Reason: Sessions 03, 05, and 07 own media generation after this audit.
* Refactoring audio buses, ducking, or theme routing - Reason: Sessions 04 and 06 own runtime contract changes.
* Changing deterministic simulation state, RNG, replay behavior, or save data for audio routing - Reason: Session 01 is evidence and documentation work.

***

## 5. Technical Approach

### Architecture

Use the Phase 36 PRD and Session 01 stub as the planning contract. Inventory the committed audio assets, provenance, audio engine mappings, renderer unlock flow, settings preferences, focused audio tests, and existing desktop/mobile Playwright coverage before manual browser review. Capture the review as a session implementation ledger with cue IDs, source touchpoints, pass/fail status, perceived balance notes, and downstream owner sessions.

The audio runtime remains presentation-only. Session findings may identify future metadata or routing work, but this session must not let sound selection alter deterministic game state, replay behavior, local saves, or hosted/public demo boundaries.

### Design Patterns

* Evidence ledger: Records subjective browser audio findings in a durable, reviewable session artifact.
* Browser-first audio review: Uses automated checks for runtime integrity and manual browser listening for balance, fatigue, and title-loop suitability.
* Narrow documentation correction: Updates Phase 36 and AI Rogue docs only where review evidence changes the current contract or downstream plan.

***

## 6. Deliverables

### Files To Create

| File                                                                                       | Purpose                                                                                                       | Est. Lines |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ---------- |
| `.spec_system/specs/phase36-session01-current-audio-balance-audit/implementation-notes.md` | Desktop/mobile audio review ledger, cue matrix, pass/fail notes, command evidence, and downstream follow-ups. | \~300      |

### Files To Modify

| File                                                                        | Changes                                                                                          | Est. Lines |
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ---------- |
| `.spec_system/PRD/phase_36/PRD_phase_36.md`                                 | Add Session 01 review results, cue follow-ups, and routing guidance for later Phase 36 sessions. | \~80       |
| `.spec_system/PRD/phase_36/session_01_current_audio_balance_audit.md`       | Mark audit findings and concrete follow-up notes against the original session stub.              | \~60       |
| `docs/extensions/ai-rogue/game-feel.md`                                     | Add the browser review result, balance caveats, and current audio baseline evidence.             | \~40       |
| `.spec_system/specs/phase36-session01-current-audio-balance-audit/tasks.md` | Mark task progress during implementation and preserve command evidence references.               | \~30       |

***

## 7. Success Criteria

### Functional Requirements

* [ ] Desktop browser review covers audio unlock, title loop, run start, sector music, common SFX, mute, volume, runtime controls, and silent fallback.
* [ ] Mobile browser review covers compact controls, audible cue balance, music/SFX volume interaction, mute, and no horizontal overflow regressions.
* [ ] Repeated-combat review identifies whether high-frequency variants are sufficient and whether hazard/status needs another variant.
* [ ] Every discovered follow-up is documented with affected cue IDs, source touchpoints, severity, and downstream owner session.

### Testing Requirements

* [ ] `bun run test -- src/extensions/ai-rogue/runtime/__tests__/audio.test.ts` passes or records a concrete failure.
* [ ] `bunx playwright test tests/e2e/ai-rogue-runtime.spec.ts` passes or records a concrete failure.
* [ ] `bunx playwright test tests/e2e/ai-rogue-mobile.spec.ts` passes or records a concrete failure.
* [ ] `bash scripts/check-asset-sizes.sh` passes after confirming no new media was added.

### Non-Functional Requirements

* [ ] The audit preserves AI Rogue production default enablement and explicit `VITE_CLAUDE_OS_ENABLED_EXTENSIONS=none` opt-out behavior.
* [ ] No remote game-content loading, hosted writes, collectors, analytics, public-demo bridge calls, or private telemetry exports are introduced.
* [ ] Documentation describes current behavior and does not present planned audio features as implemented.

### Quality Gates

* [ ] All files ASCII-encoded
* [ ] Unix LF line endings
* [ ] Code follows project conventions
* [ ] Primary user-facing surfaces contain product-facing copy only

***

## 8. Implementation Notes

### Working Assumptions

* The current baseline audio pack is available locally: repo evidence shows six music Ogg files under `src/assets/ai-rogue/audio/music/`, 45 SFX Ogg files under `src/assets/ai-rogue/audio/sfx/`, and matching provenance files. It is safe to plan the audit because no downstream asset generation is required.
* Session 01 is the next executable session: the analysis script reports no active session, all Phase 36 sessions are unfinished, and Sessions 02, 04, and 06 require Session 01 balance findings. It is safe to proceed because Session 01 has no unmet completed-session prerequisite beyond Phase 35.
* Browser listening is required for perceived balance and fatigue: current docs and the Session 01 stub state that headless tests cannot validate audible quality. It is safe to include this because automated checks still cover the runtime paths and fallback behavior.

### Key Considerations

* Session 01 must not add new media; later sessions consume its findings.
* Existing dirty Phase 36 setup changes must be preserved.
* Audio findings should be concrete enough to decide whether Session 03 should add enemy-family cues, whether Session 04 should prefer ambience or music, and whether Session 06/07 adaptive stingers are worth pursuing.

### Potential Challenges

* Audio output cannot be judged from command logs alone: record browser review conditions, device/profile, and exact cue observations in implementation notes.
* Some cue paths may be hard to trigger organically: use existing runtime tests, local scenarios, or documented reproduction steps, and record any scenario limitations.
* Silent fallback should remain invisible to gameplay: verify no exception or route failure occurs when Web Audio, fetch, or decode paths fail.

### Relevant Considerations

* \[P34-P35] **AI Rogue is production default-enabled**: Preserve Production Go posture and the explicit `none` disable path during review.
* \[P31-P35] **Public-demo and AI Rogue gates stay bundled**: Keep asset-size, no-remote, privacy, browser, Pages, and playthrough checks connected in release interpretation.
* \[P30/P32/P34-P35] **Visibility gates catch real issues**: Treat focused audio, browser, asset-size, private-runtime, and no-remote checks as part of the evidence set, not optional polish.

***

## 9. Testing Strategy

### Unit Tests

* Run focused audio tests for silent fallback, fetch/decode failure, dispose, explicit cue dispatch, title queueing, and event fallback mapping.

### Integration Tests

* Run desktop AI Rogue Play route tests for runtime mount, movement, pause, save/load, combat feedback, route cleanup, and product-surface checks.
* Run mobile AI Rogue Play/Settings route tests for compact controls, input mode behavior, overflow, and no bridge requests.

### Runtime Verification

* Start the app in a browser and review `/extensions/ai-rogue/play` and `/extensions/ai-rogue/settings` with audible output on desktop and mobile viewport profiles.

### Edge Cases

* AudioContext locked until first gesture.
* Muted, low music volume, low SFX volume, and resumed audio states.
* Repeated hit, enemy defeated, player hurt, shard pickup, UI click, wall bump, hazard, and status cues.
* Audio fetch/decode failure and no-Web-Audio silent fallback.

***

## 10. Dependencies

### Other Sessions

* Depends on: `phase35-session10-final-release-gate`
* Depended by: `phase36-session02-enemy-audio-metadata`, `phase36-session04-theme-audio-routing-contract`, `phase36-session06-adaptive-music-engine-expansion`, and downstream asset sessions that consume balance findings.

***

## Next Steps

Run the `implement` workflow step to begin implementation.


---

# 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/phase36-session01-current-audio-balance-audit/spec.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.
