test(381): Sequential (YAML) playout golden; document Scripted deferral #564

Merged
timothy merged 1 commits from feat/381-scheduler-goldens into main 2026-07-22 19:40:31 +02:00
Owner

Closes #381 — adds golden characterization coverage for the Sequential (YAML) playout builder and documents why Scripted is excluded from the in-memory golden net.

What

  • Sequential_yaml golden in PlayoutBuildGoldenTests — drives SequentialPlayoutBuilder from a committed fixture (Goldens/Fixtures/sequential-schedule.yml: two count: 2 instructions over one chronological collection) over the pinned build window; snapshots raw-UTC PlayoutItem Start/Finish (4 contiguous items, 06:00→08:45).
  • TZ-independent — the count/all/duration handlers do UTC-only arithmetic off the caller start; the test passes (not skips) under a non-UTC TZ, so it needs no Assume guard (unlike Block). PlayoutBuildMode.Reset + null Anchor avoids the one ToLocalTime() path; the fixture avoids wait_until/pad_*/shuffle.
  • Non-vacuity (#12) — a fixture count tweak flips both the golden and the contiguity assertion (verified live).
  • Scripted — documented decision (the Done-when-sanctioned alternative): ScriptedPlayoutBuilder Cli.Wrap-executes an external process that drives SchedulingEngine over HTTP → un-golden-able in-memory. Recorded in docs/decisions.md (testing.scripted-playout-golden-deferred) + docs/testing.md; integration harness tracked as #563.

Verification

  • TZ=UTC dotnet test PlayoutBuildGoldenTests → 6 passed; Sequential passes under TZ=America/New_York too.
  • Format gate (dotnet format whitespace --folder) clean, no BOM, decisions validator OK, catalog regenerated.
  • Cold-context adversarial review (fresh agent, no implementation role): all claims verified against production code, MERGEABLE, no substantive defects.

Docs

docs/testing.md (golden-nets section + test count), docs/decisions.md + generated docs/decisions/README.md.

🤖 Generated with Claude Code

Closes #381 — adds golden characterization coverage for the **Sequential (YAML)** playout builder and documents why **Scripted** is excluded from the in-memory golden net. ## What - **`Sequential_yaml` golden** in `PlayoutBuildGoldenTests` — drives `SequentialPlayoutBuilder` from a committed fixture (`Goldens/Fixtures/sequential-schedule.yml`: two `count: 2` instructions over one `chronological` collection) over the pinned build window; snapshots raw-UTC `PlayoutItem` Start/Finish (4 contiguous items, 06:00→08:45). - **TZ-independent** — the `count`/`all`/`duration` handlers do UTC-only arithmetic off the caller `start`; the test passes (not skips) under a non-UTC `TZ`, so it needs no `Assume` guard (unlike Block). `PlayoutBuildMode.Reset` + null Anchor avoids the one `ToLocalTime()` path; the fixture avoids `wait_until`/`pad_*`/shuffle. - **Non-vacuity (#12)** — a fixture `count` tweak flips both the golden and the contiguity assertion (verified live). - **Scripted** — documented decision (the Done-when-sanctioned alternative): `ScriptedPlayoutBuilder` `Cli.Wrap`-executes an external process that drives `SchedulingEngine` over HTTP → un-golden-able in-memory. Recorded in `docs/decisions.md` (`testing.scripted-playout-golden-deferred`) + `docs/testing.md`; integration harness tracked as **#563**. ## Verification - `TZ=UTC dotnet test` PlayoutBuildGoldenTests → 6 passed; Sequential passes under `TZ=America/New_York` too. - Format gate (`dotnet format whitespace --folder`) clean, no BOM, decisions validator OK, catalog regenerated. - Cold-context adversarial review (fresh agent, no implementation role): all claims verified against production code, **MERGEABLE**, no substantive defects. ## Docs `docs/testing.md` (golden-nets section + test count), `docs/decisions.md` + generated `docs/decisions/README.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
timothy added 1 commit 2026-07-22 19:18:43 +02:00
test(381): golden coverage for Sequential (YAML) playout builder; document Scripted deferral
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 28s
PR Gates / Docs update reminder (pull_request) Successful in 46s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 7m53s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 17s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 18s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 5m29s
PR Gates / decisions lifecycle (pull_request) Successful in 18s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 21m0s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
80a9824a4e
Extends the #163 PlayoutBuildGoldenTests in-memory net to the Sequential (YAML)
builder: a committed fixture (Goldens/Fixtures/sequential-schedule.yml) with two
`count: 2` instructions over one chronological collection, built via
SequentialPlayoutBuilder over the pinned window. The count/all/duration handlers
do UTC-only arithmetic off the caller-supplied start, so the case is
TZ-independent (passes, not skips, under a non-UTC TZ) and needs no Assume guard.
Non-vacuity: a fixture count tweak flips the golden + the contiguity assertion.

Scripted is deliberately excluded from the golden net — ScriptedPlayoutBuilder
shells out via Cli.Wrap to an external process that drives SchedulingEngine over
HTTP, which no in-memory golden can characterize. Recorded as the Done-when
"documented decision" arm in docs/decisions.md
(testing.scripted-playout-golden-deferred) + docs/testing.md; the scripted
integration harness is tracked as follow-up #563.

fixes #381

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
Owner

Review-verdict: MERGEABLE @ 80a9824a4e

Cold-context adversarial review (fresh agent, no implementation role) over the full diff: all five verification targets (determinism/TZ-independence, stub faithfulness, golden item count, harness regression, decision-record accuracy) confirmed against production code. No substantive defects; two non-blocking nits are pre-existing #163 patterns. Tests pass under both UTC and TZ=America/New_York.

Review-verdict: MERGEABLE @ 80a9824a4e89c52624e49ca3014e3e6b3dfe8cde Cold-context adversarial review (fresh agent, no implementation role) over the full diff: all five verification targets (determinism/TZ-independence, stub faithfulness, golden item count, harness regression, decision-record accuracy) confirmed against production code. No substantive defects; two non-blocking nits are pre-existing #163 patterns. Tests pass under both UTC and `TZ=America/New_York`.
timothy merged commit 5c20a98468 into main 2026-07-22 19:40:31 +02:00
timothy deleted branch feat/381-scheduler-goldens 2026-07-22 19:40:32 +02:00
Sign in to join this conversation.