Skip to content

feat(spec)!: let a better sidecar outrank an appended trailer - #72

Merged
gregogalante merged 1 commit into
mainfrom
feat/trailer-sidecar-precedence
Oct 3, 2026
Merged

gregogalante merged 1 commit into
mainfrom
feat/trailer-sidecar-precedence

Conversation

@gregogalante

Copy link
Copy Markdown
Member

What

§3.1 extends #71's rule to the trailer, as one rule (A sidecar that does better): when a sidecar differs from the proof the file carries — trailer at step 1, depth-0 manifest proof at step 4 — a verifier judges both over the same canonical bytes (file without trailer at step 1, whole file at step 4) and ranks outcomes: authentic > verified clip > frames not compared > everything else. The sidecar decides only when strictly higher; its verdict carries trailer copy differs (new label) or manifest copy differs, proof_source sidecar, and the active manifest's copy is compared with the sidecar. Tie → file's proof stands with sidecar differs. Ceilings never ranked.

Unchanged: nested trailer (structural), CRC-failing / major≠1 footer (steps 2–3, nothing judged). An appended broken footer still accuses a stripped genuine file — recorded as open in the threat model. Byte-identical sidecar: no change.

Why

A valid-CRC trailer is no more authenticated as the file's than a manifest: anyone can append another capture's proof to a trailer-stripped genuine file and have it read tampered beside its genuine sidecar. Nothing is gained that deleting the trailer would not give.

Vectors (corpus 6.1.0 → 6.2.0, minor: none moved; reading rule breaking)

  • 172 JPEG, foreign valid trailer + genuine sidecar → authentic, trailer copy differs, source sidecar
  • 173 MP4 clip (vector 89), foreign video trailer (frames not compared) + genuine sidecar → verified clip 1–2/3, trailer copy differs
  • 174 JPEG tie (vector 11 + vector 18's sidecar), both tampered → trailer stands, tampered

Generated by generate.ts, byte-stable. CI-equivalent run locally: typecheck, 263 tests, validate, manifest:check, conformance:check (174/174), generate:edge-cases — all green.

🤖 Generated with Claude Code

A valid-CRC trailer proves nothing about which file it was sealed with, so
another capture's proof appended to a trailer-stripped genuine file beside
its genuine sidecar read tampered (frames not compared on a clip). §3.1 now
has one rule, "A sidecar that does better", for the trailer (step 1) and the
depth-0 manifest proof (step 4): both verdicts are computed over the same
canonical bytes and outcomes ranked (authentic > verified clip > frames not
compared > rest); the sidecar decides only when strictly higher, with the new
label "trailer copy differs" (or "manifest copy differs") and proof_source
sidecar. Ties keep the file's proof; ceilings are never ranked. Nested,
corrupted and unsupported footers are unchanged; an appended broken footer
is recorded as open in the threat model.

Vectors 172-174 added, corpus 6.1.0 -> 6.2.0 (174 vectors), none moved.

BREAKING CHANGE: §3.1 step 1 reading rule changed for verifiers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gregogalante
gregogalante merged commit 5e75b4e into main Oct 3, 2026
2 checks passed
@gregogalante
gregogalante deleted the feat/trailer-sidecar-precedence branch October 3, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant