Skip to content

fix(recording): revert first-part track-offset correction (#578) - #580

Merged
birme merged 2 commits into
mainfrom
fix/recording/revert-first-part-track-offset
Oct 26, 2026
Merged

birme merged 2 commits into
mainfrom
fix/recording/revert-first-part-track-offset

Conversation

@eyevinn-developer

@eyevinn-developer eyevinn-developer Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of #579
Part of #569

Changes

Test Plan

Regression linkage

Reverts #578

Checklist

  • Code-quality checks passed (typecheck, build, vitest; open-live has no lint config)
  • No hardcoded SRT ports (n/a)
  • GStreamer pipelines have watchdogs (n/a)
  • EFP sequence validation present (n/a)
  • docs/repo-patterns.md updated (track-offset correction note)

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 #579 and 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 example Part of #579).

🤖 Generated with Claude Code

#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>

@eyevinn-pr-reviewer eyevinn-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 #579 contradicts 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: change Closes #579 to Part of #579 (or Refs #579) in the PR body and in the commit message of 0fa9bac (amend it). A keyword in a commit message on main also closes the issue when merged with a merge commit or rebase. Keep Reverts #578 and Part 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:142 lists 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 trackStartOffsetMs with 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. The describe comment partly covers it already.

What was verified

  • The revert is complete and correct. The PR's parent is eda71bb (the #578 merge, current main HEAD), so the branch is current. git diff e421e4b..0fa9bac -- src (pre-#578 to head) shows only the 42 added test lines. All three src/lib files and mp4-duration.test.ts are 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 and repo-patterns.md.
  • Nothing outside #578's scope was removed. On head, grep for trackStartOffset|firstPartTrackOffset|elst|tfdt in src finds only the new test helper and a pre-existing tfdt fixture in mp4-duration.test.ts:107, which is also present before #578. No commit landed on main after #578, so nothing else can depend on the removed symbols. durationMs scanning (§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-lockfile OK, pnpm run typecheck OK, pnpm run build OK, npx vitest run: 157 files, 1667 tests passed.
  • CI: build-and-test passes on 0fa9bac.
  • Rules: the co-author trailer is present, the branch name is fix/recording/..., and the PR body has the regression linkage Reverts #578 and 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>
@birme

birme commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

daily-backlog-pr Phase 3, 2026-10-26: first re-review of this PR. Head 0a42172 addresses the two critical findings of the REQUEST CHANGES review on 0fa9bac: the PR body now says Part of #579 instead of closing it, and ADR-011 Amendment 1 cites Decision 5. The squash merge will use an explicit commit message with no closing keyword for #579, so #579 stays open as the AC 3 tracker.

@eyevinn-pr-reviewer eyevinn-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 eda71bb is current main.
  • Local: pnpm install --frozen-lockfile, pnpm run typecheck, pnpm run build OK; npx vitest run 157 files, 1667 tests passed.
  • CI build-and-test green on 0a4217213eb495bd179ac65409a963c509f569f3.
  • No secrets, routes or dependencies added; no guesswork (only #578's own symbols removed).

@birme
birme merged commit 5a38ba4 into main Oct 26, 2026
1 check passed
@birme
birme deleted the fix/recording/revert-first-part-track-offset branch October 26, 2026 16:23
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