# Next phase: media storage and generation interface unification

Requested 2026-10-16. Active after dashboard reconstruction delivery `6cfaebbd`.
Contract: [media unification design](media-unification-design.md). The preceding
dashboard receipt does not count as verification of this phase.

## Storage contract

- [x] Trace browser, TUI, tool and session generation/output paths for image,
  video, audio and music before choosing a migration strategy.
- [x] Share model weights across Omnius sessions and project locations through
  one configured model store; expose its actual path consistently.
- [x] Scope generated outputs to the directory/project where generation was
  invoked. Browser and TUI sessions in that same location must discover the same
  artifacts, without copying them into divergent galleries.
- [x] Carry explicit project identity through browser generation, jobs, gallery,
  preview, download and deletion. Preserve authenticated validation receipts.
- [x] Define compatibility/discovery for existing project outputs and global
  gallery copies; never silently move or delete existing user artifacts.
- [x] Show the output directory and exact artifact location in both interfaces.
- [x] Test two sessions sharing one project and two separate projects sharing
  weights but keeping generated artifacts scoped.

## Uniform generation modules

- [x] Use one deliberate interaction pattern for LLM and media model selection,
  download, readiness/deployment, generation, stop, failure and output actions.
- [x] Replace transcript floods with a single updating generation module tied to
  its parent turn. Keep raw diagnostics and warnings in an explicit expansion.
- [x] Parse progress semantically: download bytes, model loading, inference
  steps, saving and completion. Do not label deprecation warnings or inference
  progress bars as model downloads.
- [x] Keep download-only and GPU deployment separate, with truthful status and
  existing broker coordination and live inference hardware gates.
- [x] Provide responsive media previews sized from available content width,
  including after terminal resize and sidebar dragging; retain aspect ratio.
- [x] Support click/Open actions and a subtle hover Open affordance, plus
  keyboard access and clear local file handling.
- [x] Investigate OpenTUI audio streaming APIs for generated audio playback and
  visualization: https://opentui.com/docs/application-apis/audio-streaming/.
- [x] Implement video playback via updating frames using the same media module,
  with bounded work, explicit play/pause and cleanup when hidden or closed.
- [x] Match browser preview sizing and media controls to these same artifact and
  lifecycle semantics; avoid tiny fixed-size centered output previews.

## Verification and delivery

- [x] Update the design contract before edits, recording ownership, migration,
  progress, preview and playback semantics.
- [x] Test storage identity, legacy discovery, concurrency, cancellation,
  authorization, deletion scope and failure recovery with isolated fixtures.
- [x] Exercise TUI progress and resize/playback live without allocating models.
- [x] Exercise browser project switching, responsive output, playback and file
  actions using isolated media fixtures and the mandatory transport tests.
- [x] Keep real inference behind the existing endpoint/model/GPU gate. This
  phase used isolated media and subprocess fixtures; no inference or model loads ran.
- [x] Make scoped verified commits and push the tracked branch. Leave publishing
  to the user unless subsequently instructed otherwise.

## Progress log

- Dashboard source delivery completed first through `6cfaebbd` on `origin/main`.
- `0a6e9ada`: shared incremental media progress framing and owned image-worker
  cancellation pushed. 67 tests across eight execution suites passed, including
  real disposable Node subprocess Stop/timeout checks. No inference ran.
- Current backend work replaces browser global work/copy behavior with explicit
  registered-project identity and a labeled legacy gallery scope. Shared weights
  stay in their configured store. Alias canonicalization is being repaired so
  configured symlink roots share one lease.
- Current terminal work retains one invocation module with bounded diagnostics,
  responsive previews and local playback. Native model modules separate selection,
  file-only download and preparation; their six isolated control tests pass.
- Media artifact persistence round-trip: five disk-state tests pass. This is
  media-block compatibility, not a claim that the queued full session-restoration
  overhaul is complete.
- Include the newly reported disconnected sidebar rule through suggestions,
  scrolling and enabled Voice rows in this phase's terminal validation.
- Queued after this phase: [update and session restoration](update-session-restoration-TODO.md).

## Delivery

- Source commits pushed to `origin/main`: backend `8bb0be44`, browser
  `e7a7bd64`, invocation cancellation `faa21628`, native modules `2fe72f09`.
- Browser: 171 live isolated-fixture checks, dark/light at 360/768/1440px;
  project-switch ownership, stopping until daemon settlement, separate legacy
  archive, scrolling detail modal and full-width output verified.
  [Browser report](../work-orders/evidence/project-media-browser-20261016/report.json).
  One expected HTTP 502 console entry is the deliberately cancelled generation;
  no page exceptions or external requests.
- Backend: 122 tests across 11 suites including the mandatory transport gate;
  [receipt](../work-orders/evidence/project-media-unification-20261016.json).
- Native media: 13 tests across 5 suites, plus 12 genuine VTE checks with CPU
  fixture files, silent audio mixing and bounded video frames;
  [receipt](../work-orders/evidence/instrument-media-verification-20261016.json).
- Additional root integration: model controls + disk persistence 11 tests;
  invocation cancellation 6; adapter context/lifecycle/receipt 8. Counts overlap
  other receipts and must not be summed as a unique total. Private CLI and
  execution typechecks passed.
- Source only: no shared build, package publication, live daemon restart, real
  model download, inference, or deletion of user media was performed.
- Follow-up user request: browser session transcript media previews, scoped code
  highlighting, and clearer action-chain working states tracked in
  [session presentation TODO](session-presentation-TODO.md).
