> 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/extensions/ai-rogue/content-polish-mobile-notes.md).

# AI Rogue Content Polish And Mobile Notes

Historical Phase 30 Session 09 kept AI Rogue browser-local and env-gated while improving seed replay, compact controls, mobile framing, and runtime readability.

## Current Supersession Note

This file preserves historical Phase 30 Session 09 evidence. Its env-gated, no-audio, and no-preference statements describe that slice only. Current AI Rogue is production-enabled by default with `VITE_CLAUDE_OS_ENABLED_EXTENSIONS=none` as the explicit hide-all opt-out, and it uses direct Web Audio with committed local Ogg music and SFX, mute/music/SFX preferences, browser-autoplay unlock, lazy decode, low-HP heartbeat, and silent fallback. Current behavior is documented in [Game Feel And Audio Baseline](/ai-os-and-trend-finder-docs/docs/extensions/ai-rogue/game-feel.md) and the reviewed music cap is documented in [`docs/media-policy.md`](/ai-os-and-trend-finder-docs/docs/media-policy.md).

## Scope

* Play route accepts a bounded `seed` search parameter and exposes a stable seed-only share URL.
* Compact controls use the existing browser-local `inputMode` preference and dispatch through the route-owned runtime controller.
* Responsive Play framing keeps the runtime canvas, controls, seed panel, event summaries, and side panels inside bounded layouts.
* Runtime readability uses the committed gameplay and UI atlases only.
* Audio remained absent for this historical slice; current Web Audio behavior supersedes that decision.

## Mobile Framing

Implementation constraints:

* `PlayView` uses a bounded grid with `minmax(0, 1fr)` for the runtime column and `minmax(280px, 320px)` for the side column.
* Long seed/readiness values use `min-w-0`, `max-w`, and `break-words`.
* `AiRogueRuntimeCanvas` uses responsive canvas aspect ratios:
  * portrait-first `4 / 3`
  * small/tablet `16 / 10`
  * desktop `16 / 9`
* Runtime controls, compact controls, and event summaries wrap and keep overflow hidden at their own container boundary.

Validation planned for browser coverage:

```bash
bunx playwright test tests/e2e/ai-rogue-mobile.spec.ts
```

The mobile tests should assert a 390x844 portrait viewport, a 768x1024 tablet viewport, no horizontal document overflow, visible runtime controls, visible compact controls, and a nonblank canvas.

## Pointer-First Controls

Implementation constraints:

* Compact directional buttons are native buttons with icon-only visuals, `aria-label`s, titles, focus rings, and 48px stable hit targets.
* Buttons dispatch `move-up`, `move-down`, `move-left`, and `move-right` through `controller.dispatchCommand(..., "touch")`.
* Dispatch is disabled unless all of these are true:
  * runtime is available
  * compact input mode is active
  * runtime is not loading, resetting, saving, or loading a save
  * runtime phase is `running`
  * run status is active or not yet known
* Canvas pointer taps in compact mode use bounded edge tolerance and the same renderer command dispatch path.

Focused evidence already run:

```bash
bun run test -- src/extensions/ai-rogue/runtime/__tests__/input.test.ts
```

Result recorded during implementation: PASS, 10 tests.

## Seed Sharing

Seed handling uses `src/extensions/ai-rogue/seed-share.ts`.

Rules:

* Empty or unavailable seed values fall back to `ai-rogue-playable-run`.
* Private-looking text is rejected before normalization.
* Normalized seeds are lowercase, URL-safe, and bounded to 60 characters.
* Share URLs strip unrelated query parameters and hashes, leaving only `?seed=<bounded-seed>`.
* Clipboard failures surface a visible fallback status and keep the readonly share URL available.

Focused evidence already run:

```bash
bun run test -- src/extensions/ai-rogue/__tests__/seed-share.test.ts
```

Result recorded during implementation: PASS, 6 tests.

## Runtime Readability

Render descriptors now include:

* run status
* latest readable combat signal
* visible hazard count
* visible reward count
* objective state
* input mode
* seed status

The descriptor frame mapping uses only existing UI atlas frames and exhaustive handling for AI Rogue run statuses and simulation event types.

Focused evidence already run:

```bash
bun run test -- src/extensions/ai-rogue/runtime/__tests__/render-model.test.ts
```

Result recorded during implementation: PASS, 3 tests.

## Asset Validation

Session 09 adds no new media files.

Existing runtime assets remain:

| File                                      | Recorded Size |
| ----------------------------------------- | ------------- |
| `src/assets/ai-rogue/gameplay-atlas.png`  | 11,446 bytes  |
| `src/assets/ai-rogue/gameplay-atlas.json` | 19,521 bytes  |
| `src/assets/ai-rogue/ui-atlas.png`        | 3,339 bytes   |
| `src/assets/ai-rogue/ui-atlas.json`       | 8,583 bytes   |

Validation command:

```bash
bash scripts/check-asset-sizes.sh
```

## No-Audio Decision

Historical Session 09 intentionally shipped without sound effects, music, Web Audio API use, audio assets, or audio wrapper dependencies.

Historical reason:

* That slice had no mute/autoplay/audio preference contract.
* Adding direct Web Audio or a wrapper before that contract would widen runtime ownership and validation scope before Session 10 quality gates.

Current supersession:

* Later implementation added direct Web Audio with generated local music and SFX assets, persisted mute/music/SFX preferences, autoplay unlock, lazy decode, low-HP heartbeat, and silent fallback.
* The current runtime still does not implement sidechain or event-based music ducking.

Evidence already run:

```bash
rg -n "AudioContext|new Audio|HTMLAudioElement|Howler|tone\\.js|@pixi/sound|audio/|\\.mp3|\\.wav|\\.ogg" src/extensions/ai-rogue package.json bun.lock docs/extensions/ai-rogue || true
```

Historical result recorded during implementation: PASS, no matches. Current source is expected to match local `.ogg` assets and Web Audio runtime code.

## Quality Commands

Focused implementation commands already passed:

```bash
bun run typecheck
bun run test -- src/extensions/ai-rogue/__tests__/seed-share.test.ts
bun run test -- src/extensions/ai-rogue/runtime/__tests__/input.test.ts
bun run test -- src/extensions/ai-rogue/runtime/__tests__/render-model.test.ts
```

Final Session 09 validation should also run:

```bash
bun run test -- $(rg --files src/extensions/ai-rogue | rg '(__tests__/.+\\.(test|spec)\\.(ts|tsx)$)' | sort)
bunx playwright test $(rg --files tests/e2e | rg 'ai-rogue-.*\\.spec\\.ts$' | sort)
bun run runtime:check-private
bash scripts/check-asset-sizes.sh
```


---

# 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/extensions/ai-rogue/content-polish-mobile-notes.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.
