Repository navigation
feat(archive)!: the archive format ships as version 2, the only one read - #8932
Conversation
Quest-Claim: 7dc3d531ed172890
The reader accepts exactly version 2 and names any other version it finds. The unpublished layouts main called 2, 3, and 4 are gone: no legacy entry form, no version 2 priority byte. Object keys drop the unused timestamp field, `.info` and `end` ignore unknown members, and `Info` loses its version field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 36 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
ℹ️ No critical issues. One small gap in the migration note is flagged inline.
Reviewed changes
I reviewed the whole diff. It collapses moq-archive to one stored format, version 2.
- One version:
VERSION = 2is the only version written or read..info, objects, and resume refuse any other version withError::Version(n).VERSION_MIN, the legacy entry form, the v2 priority byte, andError::Formare gone. - Two-pass
.infodecode:Info::decodereadsversionalone first, so a v1, v3, or v4.infois refused by its number rather than as malformed JSON. Unknown members are then ignored. - Two-field keys: objects are keyed
<group>-<frame>on every track.Startlosespts,Name::parseandindex::listlosetimed, and the producer's duration cut readsObject::timestamp()from the object in memory. Resume and the consumer never used the key'spts, so nothing they look up is lost. - Extensibility:
end's position (At) tolerates unknown members.End's kind stays strict: serde_json's externally tagged enum already rejects extra top-level keys. - API:
Info::versionis removed.put_infoand resume drop their separate version checks becauseInfo::decodecovers them.
claude-opus-5-5 | 𝕏
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed 3bdb445b848eeface1c3e5cc553cf45af2923d0b. The two-field key and timestamp-based cut/resume changes look coherent. I’d keep the chosen release number, but distinguish it from the earlier draft with the same number at the format boundary.
[P2] A draft-v2 datagram can decode as a new-v2 group. The deleted legacy fixture [2, 0, 1, 2, 1, 1, b'x'] uses the first 1 after key 2 as the datagram form byte. New Object::decode instead sees a one-frame untimed group with a one-byte payload, and length/validation both pass. Untimed keys don’t have the removed third component, and earlier v2 .info priorities below 128 overlap the new range. The impact section warns of misreads, but a required layout discriminator in .info would reject old draft prefixes on open/resume without changing the public version number. Add a fixture from the old wire format rather than testing only 1, 3, and 4.
At the cut, also preserve the advice to keep a v1 reader for any retained archives, and mention that Info loses its Serde implementations: callers should switch to Info::encode/decode. Static review only; I did not run the archive tests.
No code change; head stays (Written by Claude Opus 5.5 with low effort) |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
No commits have landed since the prior Pullfrog review. The head is still 3bdb445, so the net diff is unchanged.
- Prior feedback settled: the one finding, that
Infoloses itsSerialize/Deserializederives without a migration note, is closed. The author confirmed the removal is deliberate. The PR's Impact section and its suggestedMIGRATE.mdentry now say to useInfo::encode/Info::decode.
claude-opus-5-5 | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The only commit since the last Pullfrog review merges origin/main into the branch. It doesn't change the PR's archive code.
- Merged
main: the merge only moved surrounding lines inquest/m2/time-addressing/consumers.md. This PR still changes just one line there, removing the link to the deletedarchive-v2quest. Themoq-archiveformat, resume, consumer, and docs changes are identical to3bdb445, which was already reviewed and approved.
claude-opus-5-5 | 𝕏

Finishes quest/m2/archive-v2.md.
Problem
releaseships archive format version 1. Main writes version 4 and still reads 2 and 3, all of them layouts that were never published. moq-dev/moq#8638 also changed what version 4 means without bumping it. The cut would freeze three dead layouts and a version number that counts unpublished drafts.Approach
VERSION = 2. It is the only version written or read..info, every object, and resume refuse any other version withError::Version(found), which reads "archive format version 4 is not supported, only version 2".VERSION_MIN, the legacy entry form, and the version 2 priority byte are gone..infois decoded in two passes: the version first, then the members. A release (v1) or older main.infois refused by its number, never as malformed JSON.<group>-<frame>on every track. The old<pts>field was written and validated but never read. The consumer looks up time by group start, which on a timed track is already the time. Resume already GETs the newest object, and the producer's cut reads the first timestamp from the object in memory (Object::timestamp). Dropping the field costs no request..infoandend's position ignore unknown members, so a later version 2 writer can add one that readers may skip.end's kind stays strict: an unknown kind would misreport how the track ended.Infoloses itsversionfield. With one version it carried nothing, and anInfoholding another version could no longer be built.doc/concept/archives.md, and the tests now describe this single format.Net diff: 209 lines added, 396 removed.
Impact
<track>/<group>-<frame>for timed tracks too. Before, timed tracks had a third<pts>field.moq_archive(breaking):VERSIONis2.Info::versionis removed. Drop it from struct literals and comparisons.Info::decodealready refuses any other version.Error::Formis removed, and onlyError::Versionreports a format mismatch.Error::Version's message names the supported version.Infono longer implementsSerialize/Deserialize, since its JSON carries the version it no longer holds. UseInfo::encode/Info::decode.rs/moq-archive/MIGRATE.mdUnreleased entries "Recording format version 4 drops the datagram form" and "Recording format version 3 replaces version 1" are now wrong. Replace them with: "Recording format version 2 replaces version 1. Release wrote version 1, and a reader accepts only version 2, naming the version it refused. Start a new recording prefix. Main builds' versions 2 to 4 are unsupported.Info::versionandError::Formare removed, andInfono longer implementsSerialize/Deserialize: useInfo::encode/Info::decode. Keep a release build's reader to serve any retained version 1 archive." Keep thei8priority and optional timescale notes. The migrate check blocks this PR from editing that file.Decisions
The maintainer confirmed these decisions as written (2026-11-16, /quest-run). A review can undo each one:
<pts>from the key, rather than keep it and make time lookups use it. Group start already is the time, and resume needs no extra GET (see Approach)..infoandend's position, but keepend's kind strict. The binary object stays unextensible: any change to it is a new version.Info::versionfrom the public struct. The quest expected no API change beyond the constants. This removal is small, and it makes a mismatched version unrepresentable.Alternatives
<pts>and switch the consumer's time lookup to it. That would duplicate what the group start already says.Validation
just checkpasses (2166 Rust tests).cargo nextest -p moq-archive --all-featurespasses 75 tests, including every real backend's byte-identical recording test. The moq-cli and moq-hls archive tests pass 11..infoor object saying 1, 3, or 4 is refused withError::Version(n);Error::Version;a_restart_mid_group_loses_and_duplicates_nothing,a_partial_group_resumes_after_its_last_stored_frame) cover resume finding the last object.ffmpegtestsrc and sine intomoq import fmp4 -- export archive file://…and got.info{"version":2,…}, two-field keys, and objects starting with byte0x02.moq import archiveand recorded it again withexport archive. Every object and.infocame out byte-identical to the original..infoto version 4 and ranmoq import archive. It fails with "no readable recording at … Caused by: archive format version 4 is not supported, only version 2".import … -- export archiverun wrote every track'sendbut no broadcast.end. The process exited when the import's linger ended. That behavior predates this PR.Follow-ups
None.
Models
Size: M
Implementer: Claude Code, claude-opus-5-5, medium effort (arm A)
Implementer: Claude Code, claude-opus-5-5, low effort (iterate, S, arm A)
Implementer: Claude Code, claude-sonnet-5-5, unknown effort (iterate, M, arm A)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: e67cae2
Base: origin/main at 72c57ce
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, high effort
Session:
01a1e8a9-48aa-7391-a6c4-b4d5a79ef1bf, round 1Score: 9/10,
Source review found no actionable regressions in recording, resume, or replay, but builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none