Skip to content

feat(net): moq-transport tracks get the rewind check - #9028

Open
kixelated wants to merge 6 commits into
mainfrom
quest/m2/ietf-rewind-check
Open

kixelated wants to merge 6 commits into
mainfrom
quest/m2/ietf-rewind-check

Conversation

@kixelated

@kixelated kixelated commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m2/ietf-rewind-check.md and deletes it.

Since moq-dev/moq#8918, a moq-transport frame's time is its Group ID in the track's TIMESCALE, so its timestamps cannot rewind. The exemption that let them skip the rewind check goes, in Rust and JS together.

  • Rust: TrackState::neighbors skips the check only on an unchecked copy (lite-05/06), no longer on one with moq-transport provenance.
  • JS: #unchecked() reads only Info.unchecked. JS also refused a time anchor on a moq-transport copy, since its starts "may rewind"; that refusal goes too, matching Rust, which never had it.
  • Draft: draft-lcurley-moq-ietf's Timestamps section drops the rule that a receiver MUST NOT check a nonzero-Version track (and the sentence contrasting it with an unnegotiated hop). The extension lives only on the unpublished moq-lite-07-wip, so no changelog entry.
  • Docs: doc/concept/moq-lite.md says moq-transport timestamps are checked like any other. The draft's TRACKS_ADD paragraph now gives the reason that survives (a TRACKS_ADD lacks the Version, which says whether Group Streams carry Object Records), and the lite/publisher.test.ts comment calls unchecked the lite-05/06 flag only.
  • Merge with main: moq-dev/moq#9027 already removed both time-anchor refusals in Subscriber's settle and rewrote the Anchor TSDoc, so that conflict takes main's side. "a moq-transport copy resolves a time anchor" is ported to group-by-start keys (0/1000/2000) and a bare-key time anchor (1500n).

Choices for review

  • Info.ietf stays, in both languages. The quest's Goal says it goes, but its Plan says to confirm each reader is only the exemption first, and they are not: Rust's Info::ietf() picks lite-07 object records and the source draft in lite/publisher.rs, lite/track.rs, ietf/publisher.rs and group::Consumer::ietf; JS's Info.ietf sets fillEdge for a FETCH-only moq-transport copy. So only the exemption is removed, and the lite-07 ietf hop provenance stays.
  • JS change kept narrow (four spots in js/net/src/track.ts) so it merges cleanly with the concurrent quest/m2/time-addressing/js.md work in the same file.

Public API and wire impact

Public API: none (Info.ietf and Info.unchecked are @internal / pub(crate)).

Behavior: a timed track with moq-transport provenance now refuses a group that starts before a lower one (TimestampMismatch on that group; the track stays open), and JS accepts a time anchor on such a copy.

Wire: none for published versions. The lite-07-wip ietf extension's receiver rule changes from "MUST NOT check" to the default moq-lite check.

Migration note for the release cut: the Unreleased "A timed track refuses a group that rewinds (#5803)" note in both js/net/MIGRATE.md and rs/moq-net/MIGRATE.md says a track received over moq-transport stays unchecked. It should read: "A group received over moq-transport is checked too, since its time is its Group ID. A track received over moq-lite-05/06 keeps its timestamps unchecked, since they may be an untimed origin's send times. A relay serves it on over every version, ..." (just check forbids a PR from editing MIGRATE.md).

Tests

  • Rust ietf::subscriber a_received_rewind_is_accepted becomes a_received_rewind_is_refused: the group is delivered, its read fails with TimestampMismatch, the track stays open.
  • Rust lite::ietf ietf_timestamps_keep_their_provenance_across_a_hop no longer expects a rewind across a negotiated hop; it now also asserts a rewind on the provenance-bearing origin is refused.
  • Rust model::resume Held used a moq-transport copy only to get an unchecked one; it now sets unchecked: true (a lite-05/06 copy), which keeps the test's intent.
  • JS track.test.ts: "IETF provenance survives normalization and keeps the rewind check" (was "skips"); "an untimed track refuses a time anchor" drops its moq-transport case, and "a moq-transport copy resolves a time anchor" covers what replaces it: a { time } start on an ietf copy reads the group containing it and those after (fails on the old refusal, passes on the head).

Validation

  • cargo nextest run -p moq-net --all-features: 4113 passed, 37 skipped (three tests failed before their update, as expected, confirming the exemption was live).

  • bun test in js/net: 3377 pass.

  • just check: passes (Rust, JS, drafts, docs).

  • just test interop --all: 209 PASS, 1 SKIP (the known Chromium route-key skip). Exercises Rust and JS moq-transport and lite-07 across relays with the check now on.

  • quest check --base origin/main: 482 documents ok.

  • After merging main (d6f22a8 and on): cargo nextest run -p moq-net --all-features 3854 passed; bun test src/track.test.ts 252 pass; just check passes except four moq-relay integration tests that hit 60 s timeouts at load average ~25 (quic_sim::two_relays, three refusals::). They passed in the prior just check run on the same Rust code and pass alone (cargo nextest run -p moq-relay -E 'test(two_relays) | test(refusals::)': 14 passed in 2 s).

Caused by

None: this retires an exemption that was right until moq-dev/moq#8918 changed where moq-transport times come from.

Follow-ups

None.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort (arm A)
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, XS, arm A)
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, XS, arm A)

(Written by Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: 2e01436

  • Base: origin/main at d8ec56d

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1eb1d-99c8-74a2-947f-411c05d35421, round 3

  • Score: 9/10, The incremental changes correctly adapt the regression test to bare time keys and restore release-owned migration notes, with no actionable findings; builds and tests remain unrun as instructed.

  • Rounds: 3; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 2 commits November 17, 2026 11:31
A moq-transport frame's time is its Group ID since #8918, so its
timestamps cannot rewind. Drop the exemption in Rust and JS, and JS's
refusal of time anchors on moq-transport copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title moq-transport tracks get the rewind check feat(net): moq-transport tracks get the rewind check Nov 17, 2026
@kixelated
kixelated marked this pull request as ready for review November 17, 2026 20:06
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

JavaScript and Rust now apply timestamp rewind checks to IETF-provenance tracks unless they are marked unchecked. Tests cover rewound timestamps, timestamp behavior across offer configurations, route-failover fixtures, and time-anchor resolution for moq-transport copies. Documentation and comments were updated to describe timestamp handling.

Merge Risk: Minimal · up to 2e014

Moq-transport timestamps are now checked for rewinds like other tracks. A rewound group is refused with TimestampMismatch while the track and later groups stay usable. Lite-05/06 tracks keep their unchecked behavior. No actionable merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(net): moq-transport tracks get the rewind check" matches the main change. The PR removes the rewind-check exemption for moq-transport tracks in the Rust and JS code, and the changeset …
Description check Passed The description is directly related to the changeset. It explains that moq-transport timestamps are Group IDs and cannot rewind, so the exemption is removed in Rust and JS. It also covers the draft, d…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(net): moq-transport tracks get the rewind check" matches the main change. The PR removes the rewind-check exemption for moq-transport tracks in the Rust and JS code, and the changeset carries that behavior change across the tests, track logic, and docs. It is specific and conveys the primary change. The title does not mention the draft or docs changes, but those are secondary.

Full details: Description check

Explanation

The description is directly related to the changeset. It explains that moq-transport timestamps are Group IDs and cannot rewind, so the exemption is removed in Rust and JS. It also covers the draft, docs, and tests. It lists the specific files touched, the API and wire impact, and the validation runs, which match the raw summary.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 497071b2-09a2-4112-b851-af75102bf32e
Commits

Reviewing files that changed from the base of the PR and between e9af341 and 2e01436.

Files selected for processing: 6

  • drafts/draft-lcurley-moq-ietf.md
  • js/net/src/lite/publisher.test.ts
  • js/net/src/track.test.ts
  • js/net/src/track.ts
  • rs/moq-net/src/ietf/subscriber.rs
  • rs/moq-net/src/model/track.rs
Files skipped from review as they are similar to previous changes: 1

  • drafts/draft-lcurley-moq-ietf.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)
Reviewed commit: fac7d48a36875b98a6841f98ec183d531c1f0185

No blocker found. Rust and JS derive IETF ingress timestamps from Group ID for subgroup, fetch, and datagram delivery, and negotiated lite-07 preserves those timestamps. Reordering arrival therefore does not imply a rewind. Keeping the explicit lite-05/06 exemption and retaining provenance for its other uses are both appropriate.

One coverage improvement: add a positive JS time-anchor test on an IETF copy with out-of-order arrivals. The new test in js/net/src/track.test.ts checks rejection of a synthetic rewind, but not that a valid time anchor now resolves correctly. Static review; I did not rerun interop or unit tests.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one stale public doc left behind.

Approach: sound. Since #8918, both receive paths stamp every moq-transport object with its Group ID in the track's timescale (object_time in rs/moq-net/src/ietf/subscriber.rs, objectTime in js/net/src/ietf/object.ts), so a group's start always follows its key and the exemption no longer protects anything. Removing only the exemption, and keeping Info.ietf for its other readers (lite-07 object records, the publisher's source draft, JS fillEdge), is the right scope.

Reviewed changes — the full diff at fac7d48 (Rust, JS, draft, docs, tests).

  • Rust rewind check: TrackState::neighbors now returns None only on an unchecked (lite-05/06) copy.
  • JS rewind check and anchors: #unchecked() reads only Info.unchecked, and Subscriber no longer refuses a time anchor on an ietf copy, which now matches Rust.
  • Draft and docs: draft-lcurley-moq-ietf drops the "MUST NOT check" rule (lite-07-wip only), and doc/concept/moq-lite.md says moq-transport timestamps are checked.
  • Tests: the Rust ietf subscriber and lite::ietf hop tests now expect TimestampMismatch on a rewind. Resume Held gets its unchecked copy from unchecked: true. JS track.test.ts is parameterized on whether the check applies.

ℹ️ The public Anchor TSDoc still says moq-transport copies refuse time anchors

js/net/src/track.ts:278-279 still says a time anchor is refused "on a moq-transport copy, whose timestamps may rewind". This PR removes that refusal from Subscriber. Anchor is an exported type, so its published docs now describe behavior that no longer exists. The line is outside the diff hunks, so this note can't sit inline.

Technical details
# Stale `Anchor` TSDoc after the moq-transport time-anchor refusal was removed

## Affected sites
- js/net/src/track.ts:278-279 — "A time anchor on an untimed track is refused with {@link TimestampMismatch}, and on a moq-transport copy, whose timestamps may rewind."

## Required outcome
- The sentence names only the untimed-track refusal, e.g. "A time anchor on an untimed track is refused with {@link TimestampMismatch}."

Pullfrog  | Fix it ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated enabled auto-merge November 17, 2026 21:03

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No functional issues with the check itself; a handful of docs still describe the exemption it removes.

Approach: sound — since #8918 a moq-transport frame's time is its Group ID, so a received group's start is object_time(key) and cannot rewind; the exemption, and the JS-only time-anchor refusal it justified, are dead weight.

Reviewed changes

  • Rust check: TrackState::neighbors now exempts only Info::unchecked, so a moq-transport copy's starts are checked and indexed like any timed track; Info::ietf keeps its provenance readers (object records, the lite-07 hop).
  • JS check: Producer.#unchecked() reads Info.unchecked alone, and Subscriber.#settle no longer refuses a time anchor on a moq-transport copy, matching the Rust copy whose anchored() already resolves one.
  • Draft and doc: the ietf extension's Timestamps section drops the receiver's MUST NOT, and doc/concept/moq-lite.md states the group-ID time rule.
  • Tests: the received-rewind, ietf-hop, resume Held, and JS track cases were retargeted to the check; Held switches to a lite-05/06 copy so its out-of-order starts still work. Ran the four targeted Rust rewind tests plus the six a_group_no_route_continues tests, and bun test js/net/src/track.test.ts: all pass.

ℹ️ Docs still describe the removed exemption

Several places still tell readers and spec implementers that a moq-transport track's timestamps go unchecked: both MIGRATE.md notes for the rewind check, the Anchor TSDoc, and the ietf draft's TRACKS_ADD sentence. The MIGRATE notes sit under ## Unreleased, so they ship as written, and the draft sentence now cites a rule its Timestamps section no longer contains.

Technical details
# Stale references to the moq-transport rewind exemption

## Affected sites
- `js/net/MIGRATE.md:353-354` (Unreleased, under "A timed track refuses a group that rewinds (#5803)") — "and so does one received over moq-transport"; "A relay serves both on" still counts the removed case.
- `rs/moq-net/MIGRATE.md:610-611` — same note, same wording.
- `drafts/draft-lcurley-moq-ietf.md:194` — "Lacking the Version, a TRACKS_ADD cannot mark a {{moqt}} track's timestamps as unchecked ({{timestamps}})." That rule is deleted by this PR; only the object-record reason for reading the Track Stream (line 193) survives.
- `js/net/src/track.ts:278-279` — the `Anchor` TSDoc still says a time anchor is refused "on a moq-transport copy, whose timestamps may rewind".
- `js/net/src/lite/publisher.test.ts:612-613` — "An unchecked track's frames … may be moq-transport arrival times"; `unchecked` now means a lite-05/06 copy alone.

## Required outcome
- Every site describes a moq-transport copy as checked, and `unchecked` as the lite-05/06 flag only.
- The draft's `TRACKS_ADD` paragraph either drops that sentence or gives the reason that survives (the Version still gates object records and properties).

## Suggested approach (optional)
- Drop "and so does one received over moq-transport" and change "serves both on" to "serves it on" in both MIGRATE notes.
- Delete the draft's line 194, per the drafts' "prefer deleting a sentence" rule.
- Trim the `Anchor` TSDoc to the untimed-track refusal.
- Reword the publisher test's comment to a lite-05/06 send time.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash | 𝕏

Comment thread js/net/src/track.test.ts Resolved
@moq-bot
moq-bot Bot disabled auto-merge November 17, 2026 23:20
@moq-bot

moq-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

quest land watch: ended this pull request's pick, disarming its auto-merge, since its head fac7d48 is held by finding by pullfrog[bot]: With the moq-transport case gone, nothing covers what replaces it: a time anchor resolving on a moq-transport copy. The (#9028 (comment)). Push a fix, or answer each by a thread reply or a comment linking its review or decision, then land it again.

(written by quest land watch)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in the added test; the doc staleness from the earlier review is the only thing still outstanding.

Reviewed changes — the single commit since the prior pullfrog review (e9af341), a JS test-only addition; the rest of the diff is unchanged from fac7d48.

  • Positive time-anchor coverage: js/net/src/track.test.ts gains "a moq-transport copy resolves a time anchor", subscribing to an ietf: DRAFT_18 producer with a { time: 1500ms } start over groups stamped at 0/1000/2000 ms and expecting groups 1 and 2. That exercises the reader path (anchor resolution over starts held on a moq-transport copy), not just the write-side rewind check the loop test covers.
  • Verified: the file passes at head (252 tests), and re-inserting the removed #settle refusal makes only this new test fail, so it is a real regression test rather than a tautology.

The two MIGRATE.md notes, the draft's TRACKS_ADD sentence, the Anchor TSDoc, and the publisher.test.ts comment called out in the earlier review are untouched by this commit and remain the only outstanding item.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash | 𝕏

@kixelated

Copy link
Copy Markdown
Collaborator Author

Re Pullfrog's stale-docs finding, as of 2e01436:

  • drafts/draft-lcurley-moq-ietf.md TRACKS_ADD: the sentence now gives the reason that survives (lacking the Version, a TRACKS_ADD cannot say whether the track's Group Streams carry Object Records).
  • js/net/src/lite/publisher.test.ts: the comment calls unchecked the lite-05/06 flag only.
  • Anchor TSDoc in js/net/src/track.ts: already rewritten on main by @moq/net addresses groups by start #9027, merged here.
  • js/net/MIGRATE.md and rs/moq-net/MIGRATE.md: just check refuses a PR that edits MIGRATE.md (only the release cut writes it), so the corrected wording is in the PR body's Public API and wire impact section for the cut to apply.

(Written by Opus 5.5)

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — the merge and its follow-ups hold; one release-cut handoff note below.

Approach: unchanged and still sound — a moq-transport group's start is its Group ID, so the rewind check it was exempted from cannot fire on a conforming publisher.

Reviewed changes — the three commits since the prior pullfrog review (e9af341): a merge of main plus two follow-ups. The rest of the diff is unchanged from fac7d48.

  • Merge with main: adopted main's side where #9027 had already removed the Subscriber time-anchor refusals and rewritten the Anchor TSDoc, so the branch keeps only its #unchecked() narrowing and the doc trims, and the PR no longer touches MIGRATE.md.
  • Bare-key time anchor: switched the moq-transport anchor test to { time: 1500n } from Timestamp.fromMillis(1500), matching main's Anchor type.
  • Draft and test comments: gave the ietf draft's TRACKS_ADD sentence the reason that survives (the Version says whether Group Streams carry Object Records), and scoped the lite-06 publisher test comment to lite-05/06.

Verified at 2e014364: bun test src/track.test.ts 252 pass; cargo test -p moq-net --lib --features async -- a_received_rewind_is_refused provenance_across_a_hop 2 pass; the resume Held test passes.

ℹ️ The release-cut correction now lives only in the PR body

2e014364 moving the MIGRATE.md correction out of the PR is right, since the guard refuses that edit outside the cut. But the cut's audit reads migration notes from ! PRs only, and quest/m3/release/migrate-audit.md says a behavior break with no ! "stays with PR review" — this PR's subject is feat(net). Without a Known bullet, both Unreleased notes keep telling integrators that a moq-transport track stays unchecked.

Technical details
# Record the Unreleased MIGRATE.md correction where the cut reads it

## Affected sites
- `quest/m3/release/migrate-audit.md` — no Known bullet for the `#5803` rewind note this PR overturns; the existing `#8947` bullet is the precedent.
- `rs/moq-net/MIGRATE.md:610` — "and so does one received over moq-transport", and "serves both on".
- `js/net/MIGRATE.md:353` — same wording.

## Required outcome
- The cut writes the net behavior without re-deriving it: a group received over moq-transport is checked, since its time is its Group ID, and only a lite-05/06 copy keeps its timestamps unchecked.

## Suggested approach (optional)
- Add the bullet beside the `#8947` one, using the wording already in the PR's "Migration note for the release cut" section.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash | 𝕏

This branch has not been deployed

No deployments
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