Repository navigation
fix(recording): revert first-part track-offset correction (#578) - #580
Conversation
#569 attempt 6 showed the correction over-corrects: the SRT input's part 0 had a 981 ms late-track offset and came out about 1.1 s early against program, where the uncorrected event receipt was within 0.12 s. In attempt 5 the uncorrected receipt was 1.03 s late. When RecorderFileChanged arrives relative to an input file's t=0 does not follow the track offset, so no correction from the file fixes rule 2. Per @svensson00's 2026-10-26 decision on #569 (options (a) and (b) of #579): rule-2 first parts keep the uncorrected event start, and AC 3 for input parts depends on Eyevinn/strom#1057 (start_utc_us, rule 1) being deployed on the dev Strom. - Revert #578: drop the index-0 rule-2 shift in resolvePartTimings, UploadedSegment.trackStartOffsetMs, and the Mp4DurationScanner first-sample/elst tracking that only fed it, with their tests. - Add tests that a rule-2 part 0 keeps the event start even when a segment carries a track offset, and that chained parts follow it. - Spec §6 and Q8: record the anchor input parts rely on, the decision, and how AC 3 is verified once strom#1057 is on the dev Strom. ADR-011 amendment and a repo-patterns note. Closes #579 Reverts #578 Part of #569 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
PR Review: fix(recording): revert first-part track-offset correction (#578)
Verdict: REQUEST CHANGES
The code revert is exact and well tested. Two small things block it. Closes #579 would close the issue that @svensson00's call, and this PR's own spec, name as the open tracker for AC 3 on input parts. The ADR amendment also cites the wrong Decision number.
Prior findings
There are no earlier reviews or comments on #580. #579 has one comment (birme, 14:40:18Z, "Blocks #569"), which raises no finding. Rows below are #579's acceptance criteria plus @svensson00's product call on #569 (2026-10-26T14:44:45Z).
| # | Finding / AC | Status | Evidence on head 0fa9bac |
|---|---|---|---|
| AC 1a | Rule-2 first parts are no longer shifted by trackStartOffsetMs |
FIXED | 0fa9bac: git diff e421e4b 0fa9bac -- src/lib is empty, so src/lib/recording-parts.ts, recording-uploader.ts and mp4-duration.ts are byte-identical to before #578 |
| AC 1b | Unit test for this; #578's tests updated or removed | FIXED | 0fa9bac: src/__tests__/recording-parts.test.ts:183-223 covers liverecorder part 0 with a 981 ms offset, chaining in one batch and across batches through known, and builtin.recorder with 1717 ms. All 3 tests fail against #578's src/lib (checked locally) and pass on head. #578's scanner and timing tests are removed, and mp4-duration.test.ts matches pre-#578 |
| AC 2a | Spec §6 records which anchor input parts rely on, and how AC 3 is verified once strom#1057 is available | FIXED | 0fa9bac: docs/specs/iso-input-recording.md §6 "Anchor for AC 3" (~l.552-576) has the 5-step verification plan. Also updated: the rule-2 row (l.520), Q8 (~l.798) and the Upstream line (l.7) |
| AC 2b | #569's AC 3 text updated | n/a (not PR content) | This is an edit to the #569 issue, so the orchestrator does it. Nothing in the PR can carry it |
| AC 3 | Next #569 acceptance run reports against the agreed anchor | n/a (post-merge) | This is a later run, not PR content. It is also why #579 must stay open (see Critical 1) |
| P1 | svensson00: revert #578 | FIXED | 0fa9bac: complete. See "What was verified" |
| P2 | svensson00: keep the uncorrected event start for now | FIXED | 0fa9bac: rule 2 is startMs = open.openedAtMs again in src/lib/recording-parts.ts. Tests assert startedAt = event receipt |
| P3 | svensson00: AC 3 for input parts depends on strom#1057, not option (c); "#579 carries it from here", "AC 3 for input parts tracked in #579" | OPEN | The docs match (§6, Q8, §13 "tracked in #579", ADR Amendment 1). But the PR body and the commit message both say Closes #579, so merging closes the tracker the product call designated (see Critical 1) |
Critical issues (must fix before merge)
-
Closes #579contradicts the product call and the PR's own docs. @svensson00 said "#579 carries it from here" and "AC 3 for input parts tracked in #579". The spec this PR adds says the same in §6 ("#579 carries it until then"), Q8 ("#579 tracks it") and §13 ("tracked in #579"). #579's AC 3 is not met yet, because it is the next acceptance run. Merging as-is auto-closes #579, so the docs would point at a closed issue and AC 3 for input parts would have no open tracker. Fix: changeCloses #579toPart of #579(orRefs #579) in the PR body and in the commit message of 0fa9bac (amend it). A keyword in a commit message onmainalso closes the issue when merged with a merge commit or rebase. KeepReverts #578andPart of #569. Opening a follow-up issue would also work, but then the spec, Q8, §13 and the ADR must point to it instead, and that departs from the product call's wording. Keeping #579 open is simpler and matches the call. - The ADR-011 amendment cites the wrong Decision number.
docs/decisions/ADR-011-live-recorder-iso-recording.md:142lists the superseded claim as appearing in "Context, Decision 4, Consequences and the 'Wait for strom#1057' alternative". Decision 4 (l.62) is storage and layout. The claim "Rule 2 meets AC 3 today (tens of ms)" is in Decision 5 (l.69-73). Change it to "Decision 5". Optionally, name the Context constraint it relaxes (l.38: "must hold without strom#1057").
Warnings
- None.
Nits (optional)
- The new tests inject
trackStartOffsetMswith a cast (as UploadedSegment) because the field no longer exists. That is fine as a guard against #578 coming back, and a one-line comment saying so would help the next reader. Thedescribecomment partly covers it already.
What was verified
- The revert is complete and correct. The PR's parent is
eda71bb(the #578 merge, currentmainHEAD), so the branch is current.git diff e421e4b..0fa9bac -- src(pre-#578 to head) shows only the 42 added test lines. All threesrc/libfiles andmp4-duration.test.tsare identical to pre-#578. #578 touched 6 files (iso-input-recording.md, both tests,mp4-duration.ts,recording-parts.ts,recording-uploader.ts), and #580 touches those same 6 plus the ADR andrepo-patterns.md. - Nothing outside #578's scope was removed. On head, grep for
trackStartOffset|firstPartTrackOffset|elst|tfdtinsrcfinds only the new test helper and a pre-existingtfdtfixture inmp4-duration.test.ts:107, which is also present before #578. No commit landed onmainafter #578, so nothing else can depend on the removed symbols.durationMsscanning (§7) is back to pre-#578 code. - Spec §6 matches the decision. The anchor (rule 2, uncorrected, until strom#1057 is on dev Strom
:8082), "not (c)", and AC 3 for input parts being "pending strom#1057" are all recorded. The 5-step verification plan is concrete and testable: Strom version, two or more splits with SRT and WHIP,startedAtSource: "strom"required on every part, within 1 s per part index, and a timeoverlay cross-check. The figures match the evidence in #569 attempts 5 and 6: +1.03 s, +0.08 s uncorrected, -1.10 s corrected, and chaining within 30 ms. - The ADR amendment is accurate apart from the Decision number above. It keeps Status Proposed with an amended note, and states that recording still ships without strom#1057.
- Local checks on head:
pnpm install --frozen-lockfileOK,pnpm run typecheckOK,pnpm run buildOK,npx vitest run: 157 files, 1667 tests passed. - CI:
build-and-testpasses on 0fa9bac. - Rules: the co-author trailer is present, the branch name is
fix/recording/..., and the PR body has the regression linkageReverts #578and the checklist. No secrets, and no new routes or dependencies. - Guesswork: none. All removed symbols are #578's own, and no new API, field or library usage is introduced.
The superseded claim that rule 2 meets AC 3 today is in Decision 5, not Decision 4. Also name the Context constraint the amendment relaxes, and explain the UploadedSegment cast in the revert test. Part of #579 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
daily-backlog-pr Phase 3, 2026-10-26: first re-review of this PR. Head |
There was a problem hiding this comment.
PR Review: fix(recording): revert first-part track-offset correction (#578)
Verdict: APPROVE
Prior findings
Sources: the eyevinn-pr-reviewer REQUEST CHANGES review on 0fa9bac; the re-review comment on #580; #579's ACs and its one comment (no finding); @svensson00's product call on #569 (2026-10-26T14:44:45Z). No inline review comments exist on #580.
| # | Finding / AC | Status | Evidence on head 0a42172 |
|---|---|---|---|
| R1 | Critical: Closes #579 would close the tracker the product call keeps open for AC 3 on input parts |
FIXED | PR body now says Part of #579; closingIssuesReferences is []; 0a42172's message says Part of #579. 0fa9bac's message still has the keyword, so the merge is a squash with an explicit message that has no closing keyword for #579 (repo default COMMIT_MESSAGES would copy it) |
| R2 | Critical: ADR-011 amendment cites Decision 4 instead of Decision 5 | FIXED | 0a42172: docs/decisions/ADR-011-live-recorder-iso-recording.md:143 cites Decision 5 (l.69-73) and the Context constraint (l.38) |
| R3 | Nit: comment the as UploadedSegment cast |
FIXED | 0a42172: src/__tests__/recording-parts.test.ts:194-195 |
| AC 1a (#579) | Rule-2 first parts no longer shifted by trackStartOffsetMs |
FIXED | 0fa9bac: git diff e421e4b 0a42172 -- src touches only src/__tests__/recording-parts.test.ts; src/lib byte-identical to pre-#578 |
| AC 1b (#579) | Unit test added; #578 tests updated or removed | FIXED | src/__tests__/recording-parts.test.ts:183-225; mp4-duration.test.ts matches pre-#578 |
| AC 2a (#579) | Spec §6 records the anchor and AC 3 verification once strom#1057 is available | FIXED | 0fa9bac: docs/specs/iso-input-recording.md §6 "Anchor for AC 3", rule-2 row, Q8, §13 |
| AC 2b (#579) | #569's AC 3 text updated | n/a (issue edit) | Done on the issue by the orchestrator |
| AC 3 (#579) | Next #569 run reports against the agreed anchor | n/a (post-merge) | Why #579 stays open |
| P1 | svensson00: revert #578 | FIXED | complete revert of src/lib |
| P2 | svensson00: keep the uncorrected event start | FIXED | src/lib/recording-parts.ts rule 2; tests assert startedAt = event receipt |
| P3 | svensson00: AC 3 for input parts depends on strom#1057; "#579 carries it from here" | FIXED | Docs match; #579 not closed by the PR (R1) |
Critical issues
- None.
What was verified
- Incremental diff 0fa9bac..0a42172: only ADR Amendment 1 wording and the test-cast comment.
- Revert still exact; branch parent
eda71bbis currentmain. - Local:
pnpm install --frozen-lockfile,pnpm run typecheck,pnpm run buildOK;npx vitest run157 files, 1667 tests passed. - CI
build-and-testgreen on0a4217213eb495bd179ac65409a963c509f569f3. - No secrets, routes or dependencies added; no guesswork (only #578's own symbols removed).
Summary
event) is no longer moved back by the file'strackStartOffsetMs. It keeps the uncorrected event receipt time.RecorderFileChangedarrives relative to an input file's t=0 does not follow the track offset.start_utc_us, rule 1) being on the dev Strom. Spec §6 records the decision and how AC 3 is verified once that is available.Part of #579
Part of #569
Changes
src/lib/recording-parts.ts: removedfirstPartTrackOffsetMsand the index-0 rule-2 shift inresolvePartTimings. Rule 2 isstartMs = open.openedAtMsagain.src/lib/recording-uploader.ts: removedUploadedSegment.trackStartOffsetMsand the call that set it.src/lib/mp4-duration.ts: removedMp4DurationScanner.trackStartOffsetMs()and the per-track first-sample (tfdt+ composition offset) andedts/elsttracking. Only the reverted correction used them. Duration scanning (durationMs, §7) is unchanged and back to its pre-fix(recording): correct first part startedAt by late track offset #578 code.src/__tests__/recording-parts.test.ts: removed fix(recording): correct first part startedAt by late track offset #578's tests. Added "a recorder's first part keeps the uncorrected event start (issue OL-32: rule-2 (event) start times can't meet AC 3 for input recorders, and the #578 track-offset correction over-corrects #579, reverts fix(recording): correct first part startedAt by late track offset #578)", which uses attempt 6's SRT numbers. A part 0 whose segment still carries a track offset (981 ms, or 1717 ms) keepsstartedAt= event receipt on bothliverecorderandrecorder. Chained part 1 follows that start, both within one batch and across batches throughknown.src/__tests__/mp4-duration.test.ts: removed fix(recording): correct first part startedAt by late track offset #578'strackStartOffsetMsscanner tests.docs/specs/iso-input-recording.md:startedAtSource: "strom"on every part, require each input within 1 s of program per part, and cross-check against the SRT timeoverlay.docs/decisions/ADR-011-live-recorder-iso-recording.md: Amendment 1. Its claim that rule 2 meets AC 3 without strom#1057 no longer holds for input parts.docs/repo-patterns.md: a note not to "correct" a first part's event time from file contents, and why.Test Plan
npx vitest run: 157 files, 1667 tests passed)pnpm run typecheck: passespnpm run build: passesRegression linkage
Reverts #578
Checklist
Note for review: #579 AC 2 also asks for #569's AC 3 text to be updated. That is an issue edit, so it is left to the orchestrator. svensson00's call says AC 3 for input parts stays "tracked in #579", so this PR is only
Part of #579and must not close it: #579 stays open until the strom#1057 verification (spec §6 "Anchor for AC 3") is done. The first commit (0fa9bac) message still carries a closing keyword for #579, and this team does not rewrite pushed commits, so merge with squash and an explicit commit message that has no closing keyword for #579 (for examplePart of #579).🤖 Generated with Claude Code