feat(browser): expose bounded read-only PCM observation - #439
Conversation
…o codex/dx-pcm-observation
SDK #434 independent Astra medium reviewPASS at The observer shares the existing ring validator and maintains only local cursor, scratch and metadata state. Constructor/pull/counters/close do not store/add any shared word or write shared PCM. Independent cursors begin at the currently live read index and catch up using the existing wrap domain. Candidate attempts, including invalid/stale slots, consume the fixed 1..32 budget. Scratch planes and metadata are constructed once and reused; callback data does not expose shared PCM. Close drops ring/scratch ownership and preserves only the final counter snapshot; closed pulls are zero and callback reentry is refused. The copy admission checks cover sequence, generation/tag, frame bounds and live interval. After copying, the observer rechecks the live interval as well as sequence, seek epoch, tag and copied metadata. This specifically rejects reservation/zeroing of a consumed slot before the writer publishes its new sequence. Full seek generation is checked when the low generation tag repeats. The focused fixture covers mono/stereo and partial tails, independent readers, missed data/wrap, invalid-slot budget, seek/torn candidates, reusable identities, shared-byte preservation, closed no-op and constructor/view allocation traps. The three counter additions read their existing named wire words and correctly disclaim multiword atomicity. Independent validation:
The author's full headless result of 160 passed / 1 existing skip is retained in the issue; this independent proportional review does not claim another full headless run. No concrete bug was found within the source-spectrum observation contract. Checkout remains clean. This PASS covers the SDK observation boundary, not downstream app spectrum integration or issue closure bookkeeping. |
Expose a bounded read-only PCM observer for the app’s existing input-source spectrum. Each observer uses its own cursor and reusable scratch chunk, skips raced/stale data, and leaves every playback shared word unchanged. Existing feed counters gain the already-present fields needed by the app’s diagnostics.
Dedicated Astra medium PASS. Focused/type/package/headless checks pass; the post-copy guard mutant fails at the intended slot-reuse assertion. All six generated artifacts and PCM worklet bytes are unchanged. No new graph tap, FFT, wire layout or render work.
Related:#434; stacked on#432. App adoption remains separate.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.