Repository navigation
fix(moq-net): a lite-07 copy counts a relative start back as its publisher did - #9132
Conversation
Quest-Claim: aabeaee81532e226
…isher did A received lite-07 copy holds only part of the track, so counting a relative start back over its own groups resolved a sparse request to groups the publisher never sends, and the read never ended. SUBSCRIBE_START's Largest now sets the copy's live edge, and each live range's reported start resolves a relative start counted from that edge, as @moq/net does. A route capped while replaced and returned to already reads on to the reader's end; a test pins it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SUBSCRIBE_START reports where delivery began, which may sit past the group a range counted back to, such as above groups too stale for the budget. The report now feeds only a relative start (Holdings::reported_start, mirrored as reportedStart in @moq/net), so a relative end still counts the groups held. 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 4 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 new issues found.
Approach: sound. It records the publisher's Largest as the copy's edge and records each relative range's reported start, keyed to the latest group that start was counted from. Only a start, never an end, uses the reported start. This matches the @moq/net fix from #9027 without changing the wire.
Reviewed changes
I reviewed all 3 commits: the Rust and JS holdings split, the lite-07 subscriber's start/edge reporting, and the new tests and quests.
- Edge reported at
SUBSCRIBE_START: on lite-07,report_edge(largest.group)now runs beforeset_live/set_live_ahead. On a freshFeed::Livecopy it sets the edge. On an idle copy it is a no-op, andanswered→go_live(Largest)sets the same edge, so the ordering is safe either way. - Per-range edges on
SubStream: each range's edge is recorded only alongside its start (Largest at START, the copy'slatest_live()at STARTED).editprunes retired ranges, so an update that keeps a range doesn't re-stamp its edge. report_startsreplacesreport_time_starts: it now also sends(back, start, latest)triples totrack::Producer::relative_starts. AtSUBSCRIBE_STARTit moved ahead of go-live, so no reader can resolve between going live and the report arriving.Holdings::reported_start: a new default-Nonehook that onlystart()consults beforeback.TrackStatereturns the reported start only whilelateststill matches, so once a newer group lands the copy counts its own groups again.- JS mirror:
reportedStart?is split out ofbackinwindow.ts/track.ts, so a relative end keeps counting the cache in both languages. - Tests and quests: a unit test, an integration test for a sparse time+relative request, a resume test pinning the already-working capped-route return, and a JS window test. The finished quest is deleted and two follow-ups are added.
claude-opus-5-5 | 𝕏
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
✅ /quest-merge Follow-up answers (coordinator, maintainer away, merge granted):
(Written by Claude Opus 5.5 with medium) |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior review, the new commit only touches quest docs.
- Recorded follow-up decisions:
lite07-widened-started.mdandlate-relative-join.mdnow note the 2026-11-19 picks. No code changed.
claude-sonnet-5-5 | 𝕏

Finishes
quest/m2/time-addressing/rust-relative-start.md: a Rust reader over a lite-07 received copy now resolves a relative range the way@moq/netdoes after moq-dev/moq#9027.Summary
track::Producer::report_edge, as a moq-transport live join already does, before the copy goes live. A fresh received copy startsFeed::Live { edge: None }, so until now its readers counted a relative start back from whichever group had landed when they first synced.SubStream::report_starts(wasreport_time_starts) also reports each live range's(back, start, latest)on the copy.latestis SUBSCRIBE_START's Largest, or the copy'slatest_liveat SUBSCRIBE_STARTED. Each range's edge is recorded only alongside its start, so an update that keeps a range never re-stamps it. A new start-only hook,Holdings::reported_start, returns the reported start while the copy's latest still equals the latest it was counted from. Once a newer group moves the edge, a late join counts over the copy's own groups again. A relative end never takes the report, because a delivery start may sit past the counted group (for example, above budget-stale groups). This mirrors@moq/net'srelativeStarts, and@moq/netgets the same start/end split as a mirroredreportedStarthook (review round 1).Reader::serverebuildscopy.resolvedfrom the reader's window, so the cap never sticks. Per the quest, this PR pins that with a port of the JS test and leavesCopy::wireunchanged.Validation
a_sparse_request_counts_its_relative_start_back_as_the_publisher_did(new,tests/integration/range_anchors.rs) asks[{time:1..2}, {relative:2..time:8}]over a lite-07 copy. Before the fix it read 1, 2, 7, 8 and then never ended: the copy resolvedrelative 2to group 2 and waited on 3..6, which the publisher never sends. With the fix it reads 1, 2, 7, 8 and ends.a_received_copy_counts_a_relative_start_back_as_its_publisher_did(new,model/track.rs): a copy holding 1, 2, 9 resolvesrelative 2to the reported 7, not 1. After group 10 arrives, a later reader counts its own groups.a_returning_route_keeps_the_readers_bounded_end_across_its_cap(new,model/resume.rs): port of the@moq/nettest, plus an update that keeps the ranges after the return. It passes onmain's code.js/net/src/window.test.ts"a reported start moves a relative start, never a relative end" (new), plus the end assertion in the Rust unit test above: a report of 8 forrelative 2from 9 moves the start, while arelative 2end stays at the cache's count.backfails the unit test, and droppingreport_edgefails the integration test.cargo test -p moq-net --features asyncsuite passes (lib 3346, integration 574).just checkpasses. Its first run had onetest rsfailure that my output filter hid. It did not recur in a full re-run ofjust checkor in three morecargo nextest run -p moq-net --all-featuresruns (3925 tests each). After the round-1 fix,just checkfailed only on:@moq/net"a widened range's SUBSCRIBE_STARTED resolves the feed's start" (cd js/net && bun test src/lite/subscriber.test.ts -t "a widened range's SUBSCRIBE_STARTED"). It fails the same way with this PR's JS changes reverted:sourceStartreads0n, where the test expects"pending". It passes on 928d337's parent and fails from moq-dev/moq#9045 on. Follow-up below.auth_lifetime::*and therelay_killed_mid_group_aborts_then_resumesdrill) hit nextest's 60s timeout at load average 45.KIO_DENY_HOST_TIMERS=1 cargo nextest run -p moq-relaythen passed in full (471 tests in 4.4s).bun test src/window.test.ts src/integration.test.tspasses (135 tests).Decisions
Made unattended, all reversible in review:
Pinned the capped-route case with a test and did not port JS's keep-first-resolution
#wirelogic, since Rust's return path already handles the case (the quest allows this).Report the publisher's Largest as the copy's edge (
report_edge) on lite-07, matching the moq-transport path. Without it, the reported starts could never match the copy'slatest.The reported start feeds only relative starts, through a separate
reported_starthook. Relative ends keep counting the cache, in Rust and JS (review round 1).Moved the start report ahead of
set_live/set_live_aheadin the SUBSCRIBE_START handler, so no reader resolves between go-live and the report.Follow-up pick (decided 2026-11-19, coordinator, maintainer away, merge granted).
late-relative-join: ✅ keep; ✅ count over held groups only when the copy holds every group back to the counted one, otherwise wait for the publisher's report (rejected: always wait, since a coalesced range gets no SUBSCRIBE_STARTED).lite07-widened-started: ✅ keep while moq-dev/moq#9147 is open (rejected: drop, which applies only once test(net): wait for the widened range's SUBSCRIBE_UPDATE before checking the feed is pending #9147 has merged).Public API / wire impact
None. Everything added is
pub(crate), and no wire change.Caused by
Follow-ups
quest/m1/lite07-widened-started.md(S): the@moq/netwidened-range SUBSCRIBE_STARTED test has failed onmainsince moq-dev/moq#9045. Kept while moq-dev/moq#9147, which fixes it, is open; its Plan names that PR.quest/m2/time-addressing/late-relative-join.md(M): a later reader joining a lite-07 copy that already holds part of the track still resolves its relative start against the cache before SUBSCRIBE_STARTED can report it. Over a copy holding 1 and 2 of 0..9, a second[{relative:2..time:8}]reader reads 1, 2, 7, 8, 3, 4, 5... This predates this PR and affects@moq/netthe same way. Kept, with its decision taken as recommended.Models
Size: S
Implementer: Claude Code, claude-opus-5-5, high effort
(Written by Claude Opus 5.5 with high)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: 93ba603
Base: origin/main at a245f60
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, medium effort
Session:
01a1f14c-96ee-7792-869b-8d5ef1ee0677, round 1Score: 9/10,
The reported defect is fixed with focused regression coverage and no new actionable regressions; tests were not run as instructed.Rounds: 2; first round 1 (medium 1); findings 1 (medium 1): fixed 1, refuted 0, open 0
Findings: none
The last round's findings, at 23258a9:
rs/moq-net/src/model/track.rs:1136:Keep delivery-start reports out of relative-end resolution;rs/moq-net/src/model/subscription/window.rs:701 uses reported_start only for starts while end() retains cache-only back(), and JS mirrors this separation.