← Back to Pull requests

Dispatch leading ID3v2 and APEv2 tags as standalone parsers #2976

Closed
unknown closed this pull request without merging on Nov 27, 2026 15:12 UTC
View on GitHub
unknown unknown commented on Nov 26, 2026 19:54 UTC
Author

Register ID3v2 and APEv2 tag parsers alongside the audio parsers. The factory runs the parser for each leading signature against the current tokenizer, then probes the following bytes. Consecutive tags and the audio container contribute to the same metadata result. A complete tag at end of input returns its metadata directly.

Recognize leading tags on streams and random-access inputs, including inputs with MIME or filename hints. Preserve ID3v2.4 plain-integer frame size recovery and consume tag footers before the next probe. Load ID3v2 and FLAC parser implementations on demand.

Probe up to 16 bytes for fixed signatures.

Select the audio parser from the signature for all read entry points. Consult the MIME type and filename extension only when the initial signature is inconclusive, preserving support for MPEG inputs with leading junk.

Use a bounded ISO file-type box probe for writer selection so

a late AVIF compatible brand is recognized before choosing an MP4 writer.

Tolerate undeclared zero bytes after a leading ID3v2 tag and resume detection at the next tag or container.

Resolves #2978

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

Summary by CodeRabbit

New Features
Audio format detection now prioritizes file content, then uses MIME type and filename extension when needed.
Added support for audio files with leading ID3v2 or APEv2 tags, including audio following tag padding.
Bug Fixes
Improved format detection for files with leading metadata, extra zero bytes, or incomplete signatures.
Improved handling of artwork format detection and ID3v2 footer tags.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 220 lines (+165 / -55) across 2 files Reviewer: bardrop Review duration: 1158m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 220 lines diff across 2 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.323
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2976"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.8% (MEDIUM) · Higher = larger blast radius
36.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.5% · Safe to merge
14.5%