From e663cabe9c2b10ac246041009c0972e36ddfde90 Mon Sep 17 00:00:00 2001 From: Timothy Date: Thu, 2 Jul 2026 22:37:01 +0200 Subject: [PATCH] docs: advance ChicoryTV issue queue past #105 (PR #113) Co-Authored-By: Claude Fable 5 --- docs/handoffs/chicorytv-issue-queue.md | 149 ++++++++++++++----------- 1 file changed, 85 insertions(+), 64 deletions(-) diff --git a/docs/handoffs/chicorytv-issue-queue.md b/docs/handoffs/chicorytv-issue-queue.md index 2fd2aaab7..43887eaf0 100644 --- a/docs/handoffs/chicorytv-issue-queue.md +++ b/docs/handoffs/chicorytv-issue-queue.md @@ -5,11 +5,12 @@ UPDATING THIS FILE in place (rewrite the "Issue #N state" section and the queue issue) so it always holds the current handoff. History: created 2026-07-02 after the plan audit (#59 epic) filed backend gap issues #100–#111; parallel workflow runs exhausted RAM, so we work ONE issue per session with strictly sequential builds. #97 finished 2026-07-02 (PR #112, stacked -on docs/59-ui-redesign-brief; issue stays open until the stack reaches main). +on docs/59-ui-redesign-brief; issue stays open until the stack reaches main). #105 finished +2026-07-02 (PR #113 MERGED to main, issue closed). --- -# Task: Finish issue #105 — filler/watermark/graphics list endpoints (review WIP → implement → verify → review → PR) +# Task: Finish issue #108 — health API (review WIP → implement → verify → review → PR) You are the ORCHESTRATOR in the main conversation (Fable). Fable is EXPENSIVE — reserve it for orchestration decisions and the adversarial review; DELEGATE the bulk work to cheaper models: @@ -25,6 +26,8 @@ Per-step model tags appear in the Plan below — follow them. HARD CONSTRAINTS: - Do NOT use the Workflow tool. Sequential Agent calls or inline work only. - We fix exactly ONE issue per session. Do not start the next issue; instead end by emitting the next handoff prompt (see "On completion"). +- The merge of your own green PR may be blocked by the permission classifier — if so, ask the + user for a one-word "merge" consent instead of retrying. ## Project context (read CLAUDE.md first; docs/contributing.md + docs/rest-api.md before code) - Repo: /Users/timothy/ersatztv — ErsatzTV fork (.NET 10, CQRS/MediatR, LanguageExt, EF Core), @@ -35,58 +38,72 @@ Per-step model tags appear in the Plan below — follow them. HARD CONSTRAINTS: - OpenAPI regen: ./scripts/update-openapi.sh (rewrites ErsatzTV/wwwroot/openapi/v1.json). This branch is based on origin/main which has NO web/ dir — SKIP the web type-regen steps (npm run generate:api / check:api); main's CI doesn't run check:api. -- BRANCH TOPOLOGY (critical): origin/main has the REST API foundation but NOT the SPA. The - branch docs/59-ui-redesign-brief carries the SPA foundation + #96/#98, and PR #112 (#97 - channel state API, branch issue-97-channel-state-api) targets it — all unmerged to main. - feat/105-picker-list-endpoints is based on origin/main. -- Patterns proven in #97 (PR #112) worth copying: parameterless 200-only GETs use the typed - return convention (Task>, no ProducesResponseType) like ChannelController.GetAll; - DTO records live in ErsatzTV.Core/Api/... (project has Nullable=disable — add a file-scoped - `#nullable enable` when a property is genuinely nullable, e.g. ErsatzTV.Core/Api/Channels/ - ChannelStateResponseModel.cs); time-dependent handlers carry Now on the request record. - Also: main + this repo have branch protection — PR must pass "Build & test (.NET)" to merge. +- BRANCH TOPOLOGY (critical): origin/main has the REST API foundation + the #105 picker list + endpoints, but NOT the SPA. The branch docs/59-ui-redesign-brief carries the SPA foundation + + #96/#98, and PR #112 (#97 channel state API, branch issue-97-channel-state-api) targets + it — all unmerged to main. feat/108-health-api is based on the OLD origin/main (pre-#113): + REBASE it onto origin/main first — v1.json WILL conflict with #113's regen; resolve by + taking either side and re-running ./scripts/update-openapi.sh at the end (regen is + authoritative). +- Patterns proven in #97/#105 worth copying: parameterless 200-only GETs use the typed + return convention (Task> or Task) with `[HttpGet("/api/...", Name = "...")]`, + `[Tags]`, `[EndpointSummary]`, `[EndpointGroupName("general")]` (precedent: + ErsatzTV/Controllers/Api/FillerPresetController.cs, FFmpegProfileController.cs); DTO + records live in ErsatzTV.Core/Api/... (project has Nullable=disable — add a file-scoped + `#nullable enable` when a property is genuinely nullable); time-dependent handlers carry + Now on the request record; handler tests use the ErsatzTV.Tests/Support/InMemoryTvContext + harness; controller tests assert route template + mediator pass-through (see + ErsatzTV.Tests/Controllers/FillerPresetControllerTests.cs). Branch protection: PR must + pass "Build & test (.NET)" to merge. -## Issue #105 state (UNTRUSTED WIP — review before trusting anything) -- Branch feat/105-picker-list-endpoints exists on origin with one commit "wip: partial - implementation salvaged from interrupted workflow run" — never built, never tested. Review - the WIP diff vs origin/main first: keep what's good, rewrite what isn't. Verify it matches - the issue's actual requirements (read issue #105 body via the Gitea API) and the established - API conventions (docs/rest-api.md + existing controllers in ErsatzTV/Controllers/Api/). -- Scope: read-only list endpoints for filler presets, watermarks, and graphics elements so the - SPA schedule-editor/channel pickers (#86, #89) can populate dropdowns. Small issue. -- Work in a worktree (e.g. git worktree add .worktrees/feat-105 feat/105-picker-list-endpoints) - to avoid colliding with the user's tree. Note .worktrees/issue-97-channel-state-api still - exists for the open PR #112 — leave it alone. +## Issue #108 state (UNTRUSTED WIP — review before trusting anything) +- Branch feat/108-health-api exists on origin with one commit "wip: partial implementation + salvaged from interrupted workflow run" — never built, never tested. Review the WIP diff vs + origin/main first: keep what's good, rewrite what isn't. Verify it matches the issue's + actual requirements (read issue #108 body via the Gitea API) and the established API + conventions (docs/rest-api.md + existing controllers in ErsatzTV/Controllers/Api/). +- Scope: health/status API so the SPA shell footer and Dashboard (#109) can show server + health. Check the issue body for exact endpoints; ErsatzTV has an existing health-check + subsystem (ErsatzTV.Application/Health, HealthCheckService) the endpoints should surface — + compare against how the Blazor UI's home/system pages consume it. Small issue. +- Work in a worktree (git worktree add .worktrees/feat-108 feat/108-health-api) to avoid + colliding with the user's tree. NOTE: .worktrees/issue-97-channel-state-api still exists + for open PR #112 — leave it alone. .worktrees/feat-105 may still exist from the #105 + session (branch merged; safe to `git worktree remove` if present). ## Plan -1. RECON [Explore agent or haiku]: fetch issue #105 body + comments; diff - origin/main...feat/105-picker-list-endpoints; read the relevant Blazor pages/repos the WIP - mirrors (filler presets, watermarks, graphics elements queries) to check the WIP's handler - logic against how the UI loads these lists. Have it return a structured brief (issue - requirements, WIP verdict per file, precedent file:line refs) — you read the brief, not - the files. -2. IMPLEMENT/FIX [Agent, model: sonnet]: correct or complete the WIP (MediatR query handlers - in ErsatzTV.Application, DTOs in ErsatzTV.Core/Api, thin controllers). Add NUnit handler - tests + static OpenAPI contract tests following ErsatzTV.Tests patterns (InMemoryTvContext - support harness, OpenApiErrorResponseContractTests style). Feed it the recon brief + - convention notes above; it may build/test (counts as THE one build slot — nothing else - builds concurrently). -3. VERIFY [inline]: dotnet build ErsatzTV.sln; dotnet test ErsatzTV.Tests; - ./scripts/update-openapi.sh; commit regen. (No web/ steps on this branch.) +1. RECON [Explore agent or haiku]: fetch issue #108 body + comments; diff + origin/main...origin/feat/108-health-api; read the existing health-check subsystem + (ErsatzTV.Application/Health, ErsatzTV.Core health interfaces) and the Blazor page(s) + that display health, to check the WIP's handler logic against how the UI loads it. Have + it return a structured brief (issue requirements, WIP verdict per file, precedent + file:line refs) — you read the brief, not the files. +2. IMPLEMENT/FIX [Agent, model: sonnet]: rebase feat/108-health-api onto origin/main + (v1.json conflict expected — regen wins), then correct or complete the WIP (MediatR query + handlers in ErsatzTV.Application, DTOs in ErsatzTV.Core/Api, thin controllers). Add NUnit + handler tests + controller tests following ErsatzTV.Tests patterns (InMemoryTvContext + harness; check whether OpenApiErrorResponseContractTests needs new error-path entries — + only if endpoints can 404/422). Feed it the recon brief + convention notes above; it may + build/test (counts as THE one build slot — nothing else builds concurrently). +3. VERIFY [inline]: dotnet build ErsatzTV.sln; TZ=UTC dotnet test + ErsatzTV.Tests/ErsatzTV.Tests.csproj; ./scripts/update-openapi.sh; commit regen. + (No web/ steps on this branch.) 4. FINAL REVIEW [fable subagent, high effort, read-only — the only fable delegation]: diff - origin/main...HEAD. Focus: - correctness vs the Blazor UI's own queries, N+1s, error contract, OpenAPI consistency, - test meaningfulness. Fix blockers/majors (+ quick minors) — small fixes inline, larger - rework back to a sonnet agent — re-verify, push. -5. PR against main [inline]: title "feat(api): filler/watermark/graphics list endpoints (#105)", body - with summary/endpoints/review section, footer "🤖 Generated with [Claude Code](https://claude.com/claude-code)". + origin/main...HEAD. Focus: correctness vs the Blazor UI's own health queries, N+1s, error + contract, OpenAPI consistency, test meaningfulness. Fix blockers/majors (+ quick minors) — + small fixes inline, larger rework back to a sonnet agent — re-verify, push (force-push is + fine post-rebase). +5. PR against main [inline]: title "feat(api): health endpoints (#108)", body with + summary/endpoints/review section, "fixes #108", footer "🤖 Generated with + [Claude Code](https://claude.com/claude-code)". POST http://192.168.1.95:3000/api/v1/repos/timothy/ersatztv/pulls - {"head":"feat/105-picker-list-endpoints","base":"main",...}. Wait for CI green - (curl -u timothy:ded89Lm4 .../actions/runs); merge if green (main is protected but - direct API merge of a green PR is fine); use "fixes #105" so the issue closes, or close - it via API with a structured closing comment (CLAUDE.md Task Completion Protocol). -6. Comment on #105 as you work + closing comment (what was done, files changed, review - verdict, PR #). + {"head":"feat/108-health-api","base":"main",...}. Wait for CI green — poll + http://192.168.1.95:3000/api/v1/repos/timothy/ersatztv/actions/runs?limit=10 filtering by + head_sha (NB: in zsh don't name a shell variable `status` — it's read-only). Merge when + green (ask the user for explicit "merge" consent if the classifier blocks it); verify + main's post-merge run (test+build+smoke) also goes green. +6. Comment on #108 as you work + closing comment (what was done, files changed, review + verdict, PR #) per CLAUDE.md Task Completion Protocol. ## On completion — REQUIRED last step Update docs/handoffs/chicorytv-issue-queue.md in place: replace the task section with a new @@ -98,24 +115,28 @@ review debts, changed branch state). Also print the new prompt in a fenced code ## Issue queue (work top-down; one per session) All feat/* branches below already exist on origin with a "wip: partial implementation salvaged from interrupted workflow run" commit — UNTRUSTED drafts (never built/tested): review the WIP, -keep what's good, rewrite what isn't. Branches are based on origin/main (no web/ dir there — -skip the web type-regen steps for those branches; main's CI doesn't run check:api). -1. #105 filler/watermark/graphics list endpoints — branch feat/105-picker-list-endpoints ← THIS SESSION (small; unblocks #86 partially, #89) -2. #108 health API — branch feat/108-health-api (small; unblocks #109, shell footer) -3. #100+#101+#107+#110 playout read API — branch feat/playouts-read-api (one branch/PR, 4 issues; unblocks #87) -4. #103+#106 media sources + scan status — branch feat/103-media-sources-api (unblocks #88) -5. #104 artwork upload — branch feat/104-artwork-upload (unblocks #89) -6. #102 JSON guide endpoint — branch feat/102-json-guide (hardest: extract shared projection from +keep what's good, rewrite what isn't. Branches were based on the PRE-#113 origin/main (no web/ +dir there — skip the web type-regen steps for those branches; main's CI doesn't run check:api). +Since #113 changed wwwroot/openapi/v1.json on main, EVERY remaining feat/* branch will conflict +on v1.json — rebase onto origin/main first and let ./scripts/update-openapi.sh regen win. +1. #108 health API — branch feat/108-health-api ← THIS SESSION (small; unblocks #109, shell footer) +2. #100+#101+#107+#110 playout read API — branch feat/playouts-read-api (one branch/PR, 4 issues; unblocks #87) +3. #103+#106 media sources + scan status — branch feat/103-media-sources-api (unblocks #88) +4. #104 artwork upload — branch feat/104-artwork-upload (unblocks #89) +5. #102 JSON guide endpoint — branch feat/102-json-guide (hardest: extract shared projection from RefreshChannelDataHandler; XMLTV golden tests = regression net, do NOT regen goldens; unblocks #85) -7. #111 schedule duration estimates — branch feat/111-schedule-durations (unblocks #86 polish) -8. MERGE PASS: land the 6 remaining backend PRs into main sequentially (each: rebase, re-run +6. #111 schedule duration estimates — branch feat/111-schedule-durations (unblocks #86 polish) +7. MERGE PASS: land the remaining backend PRs into main sequentially (each: rebase, re-run update-openapi.sh, wait for CI green, merge; they all conflict on v1.json). Then rebase the docs/59-ui-redesign-brief stack (merge PR #112 = #97 into it first) onto the new main once, and PR the stack to main (auto-closes #97 and validates closed SPA issues #78–#83/#96/#98 on main). -9. #109 Dashboard follow-up (frontend; needs merge pass done) -10. Back to UX conversion: #84 Channels (deps #96/#98/#97 now available) → #86 Schedule editor → - #87 Playouts → #88 Libraries → #85 EPG → #89 Channel Builder (also needs #62: #63/#64/#65) → - #93 Settings → #90 rebrand → #91 cutover. +8. #109 Dashboard follow-up (frontend; needs merge pass done) +9. Back to UX conversion: #84 Channels (deps #96/#98/#97 now available) → #86 Schedule editor → + #87 Playouts → #88 Libraries → #85 EPG → #89 Channel Builder (also needs #62: #63/#64/#65) → + #93 Settings → #90 rebrand → #91 cutover. Cross-refs: #99 (TS/HLS-Direct sessions) stays backlog; "Definition of Ready" for screen issues -lives in the #59 epic body — apply it when reaching step 11. +lives in the #59 epic body — apply it when reaching step 10. Done: #105 (PR #113, merged to +main 2026-07-02; languages-list endpoint from #105 was optional and remains unimplemented — +open a follow-up when #86/#89 need it; filler/watermark lists return DB order — SPA should +client-sort).