Repository navigation
fix(artifacts): read Ogg Opus channel mapping tables - #14975
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The reviewed changes appear safe to merge. SummaryAdds declared Ogg Opus channel routing to
Review was source-only; tests were not rerun. Whether another PR supersedes this change could not be checked because GitHub authentication was unavailable. Reviews (2) · Last reviewed commit: "fix(artifacts): read Ogg Opus channel ma..." · Reviewed by Greptile |
|
thanks! merged after a clean review and green CI (158 tests passed). |
* commit '4ccc685dd5ed028bc625fdd8760539ce5a492d8d': (228 commits) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168) fix(artifacts): distinguish content from containment changes (morluto#15165) fix(bflt): retain complete text when data is truncated (morluto#15160) refactor(domain): reuse graph projection and validation helpers (morluto#15173) fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801) test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172) test(beam): reuse the CLI Evidence reader (morluto#15171) test(oci): share descriptor budget refusal assertions (morluto#15159) refactor(audit): share byte framing for offline audit logs (morluto#15162) refactor(evidence): reuse observed file reports for binary metadata (morluto#15161) fix(doctor): omit package-runner cache shims from installations (morluto#15059) refactor(packages): share package inspection budget contracts (morluto#15158) refactor(desktop): share completed command answer recovery (morluto#15156) refactor(views): share page byte reservations (morluto#15152) refactor(artifacts): share GPU and media asset layout rules (morluto#15150) fix(setup): name the detected host when Hopper setup does not apply (morluto#14449) fix(iso9660): read a directory record whose identifier padding byte is not zero (morluto#15020) fix(windows): report the ACE count a private DACL check observed (morluto#14450) fix(artifacts): read Ogg Opus channel mapping tables (morluto#14975) ...
Summary
REA can now report how the channels of an Ogg Opus file are routed, using the identification packet already read by
inspect-artifactandinspect_artifact. This extends the static media inventory in #14700 and #14155. The change is scoped to that reader; no separate issue was opened.Problem and expected behavior
On FFmpeg-encoded 5.1 audio, REA reported six channels and mapping family 1 but stopped at byte 19, immediately before the routing table. Deleting the last map entry and repairing the Ogg page framing still produced a complete inventory on the base commit. FFprobe rejected the shortened header. A second packet on the same Ogg page must not supply the missing index.
Change and scope
The existing Ogg reader reads at most the 19-byte fixed header, two counts and 255 channel indices, within the first packet's laced extent. It returns the declared stream count, coupled stream count and output-order indices for mapping families 1, 2 and 255, and reports a malformed header if that table ends early. Family 0 has implicit routing. Family 3 uses a demixing matrix. RFC 7845 §5.1.1 · RFC 8486 §3
Contract and boundary impact
The root
format_metadata.channel_mapping_tablefield is optional. Both adapters consume the file reader's observation. An inventory saved on the base commit was replayed successfully with the field absent. The change reads file headers, does not decode audio or launch a media provider, and adds no dependency, tool, permission or configurable limit.Evidence and regression coverage
On
8ff357043, the new reader regressions had 5 failures and 47 passes. The new code passes all 52 cases in the reader suite. The regression for a short first packet also supplies a plausible final index in a following packet on the same page.Six FFmpeg-generated inputs cover mono, stereo, 5.1, 7.1, family 2 Ambisonics and family 255 discrete stereo. The four explicitly mapped headers match FFprobe's extradata byte for byte. Two controlled shortened files produce a format error. The compiled CLI and one real stdio MCP session agreed on all eight files. For 5.1 both adapters report:
{"channel_count":6,"mapping_family":1,"channel_mapping_table":{"stream_count":4,"coupled_stream_count":2,"output_channel_map":[0,4,1,2,3,5]}}Validation performed
npm run check:fast,npm run docs:check, test discovery, advertised-schema verification, package dry run and installed package verification passed.npm run checkexited 1. Its nine Knip unused or duplicate export diagnostics matched a clean checkout of the exact base commit, line for line; all seven source paths named in those diagnostics matched the base bytes.Compatibility, safety, and release
Existing saved Evidence remains readable. Newly inspecting a shortened explicit routing table now yields a malformed-input result. The reader reports declared indices, including repeats and the value 255 for silence. Target file bytes and existing extraction boundaries remain intact. No release is requested.
Author readiness
Human owner: @xu91102
Author checklist (completed by the PR author before requesting review)
type(scope): outcome.REA_runtime setting with a default, floor, and maximum, unless a fixed ceiling has a stated reason. See Adding a runtime setting.