test(77): characterize clock-boundary schedule padding + docs #393

Merged
timothy merged 2 commits from feat/77-clock-align-verify into main 2026-07-17 03:26:50 +02:00
Owner

Closes #77 (scoped to verify + document — its core already exists).

Finding

Clock-boundary schedule padding (snap to :00/:15/:30 via filler) is already implemented — upstream ErsatzTV machinery carried into the fork:

  • Classic: FillerPreset with FillerMode.Pad + PadToNearestMinute snaps content up to the next N-min clock mark (PlayoutModeSchedulerBase.AddFiller). Live SPA editor at /app/filler-presets.
  • Sequential (YAML): pad_to_next / pad_until.
  • Block: inherently clock-anchored via TemplateItem.StartTime.
  • EPG reflects the padded boundary automatically (ChannelGuideProjector coalesces trailing filler into the programme window).

So #77 is scoped to locking the behaviour + documenting it (don't re-implement from scratch).

Changes (no production code)

  • PlayoutBuildGoldenTests.Classic_clock_padded — a PostRoll FillerMode.Pad(15) preset through the real PlayoutBuilder snaps content to :15; golden + an explicit quarter-hour assertion. Splits Verify → CompareGolden so the assertion path reuses the golden mechanics.
  • ChannelGuideProjectorClockPadTests — the guide projection coalesces trailing filler so programmes STOP on the padded boundary (the XMLTV half).
  • docs: decisions.md (2026-07-17 entry), domain-model.md (clock-boundary row), testing.md (test map + count 540→542).

Deferred → #392 (blocked on #388)

One-click per-channel/schedule clock-align toggle + 60-min increment option — mostly SPA work, gated on the #388 design-system sync epic.

Verification

Full ErsatzTV.Core.Tests green under TZ=UTC (542 passed, 1 skipped). Format-clean (pre-commit dotnet format verify passed).

Review note: live-E2E deliberately substituted with the two deterministic tests — this PR changes no production code, so the live-E2E's write-path/500 justification does not apply. Independent (cold) review to follow per the review skip-rubric.

🤖 Generated with Claude Code

Closes #77 (scoped to verify + document — its core already exists). ## Finding Clock-boundary schedule padding (snap to :00/:15/:30 via filler) is **already implemented** — upstream ErsatzTV machinery carried into the fork: - **Classic**: `FillerPreset` with `FillerMode.Pad` + `PadToNearestMinute` snaps content up to the next N-min clock mark (`PlayoutModeSchedulerBase.AddFiller`). Live SPA editor at `/app/filler-presets`. - **Sequential (YAML)**: `pad_to_next` / `pad_until`. - **Block**: inherently clock-anchored via `TemplateItem.StartTime`. - **EPG** reflects the padded boundary automatically (`ChannelGuideProjector` coalesces trailing filler into the programme window). So #77 is scoped to locking the behaviour + documenting it (don't re-implement from scratch). ## Changes (no production code) - **`PlayoutBuildGoldenTests.Classic_clock_padded`** — a PostRoll `FillerMode.Pad(15)` preset through the **real `PlayoutBuilder`** snaps content to `:15`; golden + an explicit quarter-hour assertion. Splits `Verify` → `CompareGolden` so the assertion path reuses the golden mechanics. - **`ChannelGuideProjectorClockPadTests`** — the guide projection coalesces trailing filler so programmes **STOP** on the padded boundary (the XMLTV half). - **docs**: `decisions.md` (2026-07-17 entry), `domain-model.md` (clock-boundary row), `testing.md` (test map + count 540→542). ## Deferred → #392 (blocked on #388) One-click per-channel/schedule clock-align toggle + 60-min increment option — mostly SPA work, gated on the #388 design-system sync epic. ## Verification Full `ErsatzTV.Core.Tests` green under `TZ=UTC` (542 passed, 1 skipped). Format-clean (pre-commit `dotnet format` verify passed). **Review note:** live-E2E deliberately substituted with the two deterministic tests — this PR changes **no production code**, so the live-E2E's write-path/500 justification does not apply. Independent (cold) review to follow per the review skip-rubric. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
timothy force-pushed feat/77-clock-align-verify from b53bc90dc4 to 17746c442e 2026-07-17 01:22:27 +02:00 Compare
Author
Owner

Cold, independent (review-only) pass complete on the full diff. Both new tests confirmed non-vacuous — each genuinely fails if the pad logic breaks (broken pad → content starts at raw finishes 00:22/00:59… which fail % 15; un-coalesced filler → guide Count/stops wrong). Determinism, refactor safety (Verify→CompareGolden), and docs accuracy all verified. No production code touched.

Two nits raised were fixed in the follow-up commit 17746c44:

  • TZ-independence guard comment on the padded fixture (the golden is UTC-stable only because PadToNearestMinute=15 divides every IANA offset; warns against regenerating with a non-15 divisor).
  • decisions.md coalesce list now includes DecoDefault.

Review-verdict: MERGEABLE @ 17746c442e

Cold, independent (review-only) pass complete on the full diff. Both new tests confirmed **non-vacuous** — each genuinely fails if the pad logic breaks (broken pad → content starts at raw finishes 00:22/00:59… which fail `% 15`; un-coalesced filler → guide Count/stops wrong). Determinism, refactor safety (`Verify`→`CompareGolden`), and docs accuracy all verified. No production code touched. Two nits raised were fixed in the follow-up commit `17746c44`: - TZ-independence guard comment on the padded fixture (the golden is UTC-stable only because `PadToNearestMinute=15` divides every IANA offset; warns against regenerating with a non-15 divisor). - `decisions.md` coalesce list now includes `DecoDefault`. Review-verdict: MERGEABLE @ 17746c442e98f28fc88f7d80df0f7bfc5ac3c3b4
timothy merged commit 33d6c6071b into main 2026-07-17 03:26:50 +02:00
timothy deleted branch feat/77-clock-align-verify 2026-07-17 03:26:50 +02:00
Sign in to join this conversation.