Repository navigation
feat(artifacts): report declared Ogg Opus, RIFF/XMA2, Bink 2 and Vulkan pipeline-cache headers - #14700
Conversation
Codex Review Summary: ❌ FailedThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; the previous packet-boundary issue is fixed and no new blocking issue was found. SummaryAdds header-only inventory and extraction for Ogg Opus, RIFF/XMA2, Bink 2 and Vulkan pipeline caches. Payloads remain opaque.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["File bytes"] --> B["Signature recognition"]
B --> C["MediaAssetArtifactReader"]
C --> D["MediaAssetLayouts"]
D --> E["Root header facts"]
D --> F["Declared byte regions"]
F --> G["Inventory and extraction"]
Reviews (13) · Last reviewed commit: "fix(artifacts): keep Ogg header reads in..." · Reviewed by Greptile |
…an pipeline-cache headers Recognize the four remaining morluto#14155 media/cache containers by their public header signatures and inventory them as archives. Root format metadata carries the declared header facts; each named byte region is a member that is hashed and extractable. Payloads stay opaque: no audio, video or pipeline-cache body decode. Disagreeing extents stay in extent_check with unknown coverage rather than a refusal. Structural header faults refuse as malformed input with format and offset. Completes the remaining formats from morluto#14155 after morluto#14248.
Stop RIFF inventory from buffering opaque chunks, keep chunk walks inside the declared form, follow spanned OpusTags before audio, preserve first-page truncation, ground the Bink fixture/table split, and document the formats.
Record incomplete RIFF/XMA2 chunk headers in metadata, treat cut-off fmt as truncated rather than missing, and add media-asset-headers to the VitePress sidebar registry.
Short RIFF, Bink 2, and Vulkan pipeline-cache headers that end before the declared header size are truncated inputs, not malformed structure.
1ae1e72 to
fa86ef2
Compare
… Ogg and RIFF facts
# Conflicts: # docs/reference/supported-targets.md # src/artifacts/artifactFormats.ts # src/domain/artifactFormatMetadata.ts
|
Thanks for this. I reviewed the whole PR against reference readers and pushed fixes on top of your branch (no history rewritten): Defects fixed
Brittleness pass
Left as is, and why
Sources
Validation
|
Trailing bytes past the header size field are no longer claimed as frame payload. Tables that do not fit the declared extent stay unlisted.
When header tables end past the declared file size, still measure the frame-offset table against the file so extent_check reports truncated instead of consistent while the tables remain unlisted.
…eport incomplete headers
Growing the read buffer with Buffer.concat left each saved page's packet slice pinning the previous copy, so a long OpusTags continuation retained O(n²) bytes before region_count refused the walk. Page records now store packet offsets and read from the final buffer.
Keep media asset headers from this branch alongside Nintendo 64 ROMs and YARA rule matches from main.
Head branch was pushed to by a user without write access
Refuse to decode track tables past declaredEnd so appended physical bytes are not reported as audio_tracks.
Keep media_asset alongside android_dtbo in reader-limit schemas, CLI descriptions, docs, and regenerated inspect/extract artifact summaries.
Summary
Fixes #14155 by completing the remaining formats after merged #14248 (DDS/GLB/KTX/KTX2): Ogg Opus, RIFF WAVE
fmttag 0x166 (XMA2), Bink 2 (KB2+ revision), and Vulkan pipeline cache (VK_PIPELINE_CACHE_HEADER_VERSION_ONE).inspect-artifact/extract-artifactpreviously returnedfile_format_rejectedfor these files. They are now recognized by header signatures (never by file name) and inventoried as archive containers with declared header facts and extractable byte regions. Payloads stay opaque.Problem and expected behavior
Issue #14155 asks for header-only inventory of six GPU/media asset formats. #14248 landed DDS/GLB/KTX/KTX2. The four remaining formats were still refused. Success: each fixture reports header facts, region extents, and
malformedvsunsupported/truncatedwhen lengths disagree, without decoding audio/video/cache bodies.Change and scope
Same pattern as
src/artifacts/gpuAsset/: amediaAssetowner parses each header once (MediaAssetLayouts.ts), exposes metadata (mediaAssetMetadata.ts), and lists declared regions as members.Intentionally not included: decode/decompress of audio, video, or pipeline-cache bodies; Bink field names beyond the issue's documented leading facts; generic Ogg/WAVE without OpusHead / tag 0x166.
Follow the contribution scope.
Contribution scope fit: ordinary artifact-format inventory within existing archive/evidence boundaries; not applicable for a new provider or execution capability.
Contract and boundary impact
MediaAssetLayouts/MediaAssetArtifactReaderproduce format metadata and regions; inventory, inspect, extract, and target recognition consume them. Recognition is signature-based beside the existing GPU asset recognizers.inspect-artifact/extract-artifactand binary open now admit the four formats as archives; no new tool names.ogg-opus,riff-xma2,bink2,vulkan-pipeline-cache).media-asset-regionmembers; comparison leaves root facts to content comparison (same as DDS/GLB).docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): none authored here; CI regenerates catalogs.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/artifacts/mediaAsset/MediaAssetArtifactReader.test.ts(14): recognition, Opus/XMA2/Bink/VK facts and regions, truncation, non-claims for PCM WAVE and non-Opus Ogg, malformed VK headerSize.tests/boundary/filesystem/binaryTarget.test.ts: all four resolve toarchiveunder a.binname.TargetFormatVocabularies.test.ts/ format-metadata registry wiring for the new kinds.mediaAsset.fixture.ts.compare-artifactsstill does not project root header facts (same as feat(artifacts): report declared DDS, GLB, KTX and KTX2 headers and regions #14248).For evidence-bearing changes:
Validation performed
npx vitest run --maxWorkers=1 --no-file-parallelism src/artifacts/mediaAsset/MediaAssetArtifactReader.test.ts— 14 passed.npx vitest run --maxWorkers=1 --no-file-parallelism src/artifacts/mediaAsset/MediaAssetArtifactReader.test.ts src/application/binary/TargetFormatVocabularies.test.ts src/domain/artifactFormatMetadata.test.ts— 75 passed.npx vitest run --maxWorkers=1 --no-file-parallelism tests/boundary/filesystem/binaryTarget.test.ts -t "Ogg Opus|…|DDS, GLB"— 2 passed (media + existing GPU classification).node scripts/run-typescript.mjs --noEmit --checkers 1 --maxMemory 2G— clean.npx oxlinton new media-asset paths — warnings only (same class asGpuAssetLayouts).npx oxfmton new paths — clean.node scripts/verify/architecture-guards.mjs— passed (3157 files).Compatibility, safety, and release
Author readiness
Human owner: @BeqaKs
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.