# M11-13 Status status: done task: verify AudioContext suspend, resume, missing-device, and mute recovery updated: 2026-08-17 America/New_York ## Scope Schema 1 audio-session reports separate context state (`UNAVAILABLE/SUSPENDED/RUNNING/CLOSED`) from output state (`BLOCKED/SILENT/ENABLED`). Every initialize, resume, suspend, mute, device-recovery, and close operation advances a monotonic revision. Reports bind the mute flag, effective gain, and a stable issue code, and reject contradictory states such as enabled output from a suspended or muted context. The production `SequencerAudioSession` owns one `AudioContext` and master `GainNode`. Mute schedules gain zero; unmute restores the configured nominal gain. Suspend and resume must reach the corresponding real context state before output can be enabled. Missing API, constructor failure, and resume/suspend failure remain silent with structured errors. Closing first zeros and disconnects the gain node, closes the context, drops all references, and reports `CLOSED/SILENT`. This task does not claim waveform generation, A/V sync, multi-strip mixing, output-device selection, or encoded audio export. ## Evidence - `WEB_TEST_PORT=5586 npm --prefix web run test:sequencer-audio-recovery`: unit 3/3 and Chromium 1/1 passed on the first complete run. - The Chromium case creates a real `AudioContext` inside a trusted click handler, then verifies suspend, mute, resume-while-muted, unmute, second suspend/resume, and close. Muted output remains `RUNNING/SILENT` at gain 0; unmute restores `RUNNING/ENABLED` at gain 0.75; close reports `CLOSED/SILENT` at gain 0. - A scope without `AudioContext` returns `UNAVAILABLE/BLOCKED/SEQUENCER_AUDIO_DEVICE_UNAVAILABLE`. The deterministic unit path then makes a constructor available and verifies `recoverDevice()` plus resume. Constructor and resume failures stay silent; malformed state reports return `SEQUENCER_AUDIO_CONTEXT_INVALID`. - Regression passed: M11-09 unit 3/3 plus Chromium 1/1, M11-10 unit 3/3 plus Chromium 1/1, M11-11 unit 4/4 plus Chromium 1/1, M11-12 unit 4/4 plus Chromium 1/1, one-million-frame long-media 1/1, Sequencer Main reader, full Node 190/190, typecheck, lint, and production build (75 modules). ## Artifact Hashes - protocol: `0b1b75c7630b599723914bbced9ee0a107bd8c0ac4382ced1f1c5114dac8fd01` - production controller: `c09914d2581ee454e042ed6a9ef5b8c0f6f7b0688eadb1deff45163263742109` - app protocol exports: `e630f647ddd3680a04e07ce7388cf03f54268d4e2d839aa5991cb9ceb6a53bda` - error contract: `6589f712058a39a2177cb174cc355c01777a549d254c4b9eac2301a344c619f2` - unit: `1a888d1b19a3d12091e6edd05287a5bcc19912415cf7f2ed73a028d12846a298` - Chromium spec: `1b94ea07ab5fafb0b06fbd73742c77d6b69d745a546fc60def85857844afc719` - golden: `584aea46687fd5cec8d89e8fac51314acc9a8d05af2a8d762e8d6a74483e0940` - package: `8d87390f9b1b7382bf9c0ba189f7a9d95daa3ee15d1d422a8d856fa4eb6d3cca` ## Rollback Remove the audio-session protocol/controller/tests/golden and package command, remove the four audio error codes and SequencerTimeline exports, restore M11 to 12/14, and remove the N-021 audio-recovery completed slice. Keep M11-09 offline audio decoding and M11-12 final export routing unchanged.