Channels list: distinguish auto-tuned from user-created channels (origin marker) #414

Closed
opened 2026-07-17 16:32:47 +02:00 by timothy · 3 comments
Owner

Deferred from #72 (channel health / status UX) — scope item (a). See docs/decisions.md 2026-07-17 "Channel health on the API…" for the full reasoning.

Why it was deferred, not dropped

No honest signal exists today. ErsatzTV.Core/Domain/Channel.cs has no Origin/CreatedBy/IsAutoTuned field. ChannelPlayoutSource (Generated/Mirror) looks like provenance but is a playout-strategy enum — blank channels created from the SPA also default to Generated (ChannelsScreen.tsx), so it would mislabel them.

CreateChannelFromLineupHandler stamps nothing on the channel. The only adjacent provenance is on the playlist side: the system playlist group "Channel Lineups" (SystemPlaylistGroupName).

Options

  1. New Channel column + dual-provider migration (scripts/add-migration.sh) stamped at creation by the auto-tune path. Honest and durable. Preferred.
  2. Join through the "Channel Lineups" playlist group — rejected in the #72 design pass: a heuristic that breaks the moment a user edits the channel away from its generated playlist. Don't revive it without new reasoning.

Why it's blocked

Provenance belongs to the auto-tune arc (#383 umbrella / #384–#386) — that's the code that knows a channel was generated, and it's the right place to stamp it. Doing it from #72's side would have collided with that arc mid-flight. Design it with #383's DetailPanel, which already lets a user override per-channel identity (so "auto-generated" needs a defined meaning after an edit).

Done-when

  • Channel carries an honest origin marker, stamped at creation by the auto-tune path (or a stated better design) — ChannelOrigin { Unknown, UserCreated, AutoTuned } + Channel.Origin, stamped AutoTuned in CreateChannelFromLineupHandler, UserCreated in CreateChannelHandler
  • Dual-provider migration (SQLite + MySql) via scripts/add-migration.sh; CI migrations job green — Add_Channel_Origin (default 0 = Unknown, no back-fill)
  • Surfaced on ChannelResponseModel + rendered in the channels list — raw origin field; SPA badges only AutoTuned
  • Defined semantics for "auto-generated then user-edited" — immutable provenance: origin records how the row was born and never changes on edit, so it stays AutoTuned. A future "diverged from template" signal is a separate auto-tune-arc concern.
  • docs/decisions.md + docs/domain-model.md updated — channel.origin-marker
  • adversarial review passed — independent cold review clean; Review-verdict: MERGEABLE @ 015d4166 on PR feat(414): stamp immutable Channel.Origin (auto-tuned vs user-created) and surface it (#575)

PR: #575

Deferred from **#72** (channel health / status UX) — scope item (a). See `docs/decisions.md` 2026-07-17 "Channel health on the API…" for the full reasoning. ## Why it was deferred, not dropped **No honest signal exists today.** `ErsatzTV.Core/Domain/Channel.cs` has no `Origin`/`CreatedBy`/`IsAutoTuned` field. `ChannelPlayoutSource` (`Generated`/`Mirror`) *looks* like provenance but is a **playout-strategy** enum — blank channels created from the SPA also default to `Generated` (`ChannelsScreen.tsx`), so it would mislabel them. `CreateChannelFromLineupHandler` stamps nothing on the channel. The only adjacent provenance is on the **playlist** side: the system playlist group `"Channel Lineups"` (`SystemPlaylistGroupName`). ## Options 1. **New `Channel` column + dual-provider migration** (`scripts/add-migration.sh`) stamped at creation by the auto-tune path. Honest and durable. **Preferred.** 2. ~~Join through the `"Channel Lineups"` playlist group~~ — **rejected in the #72 design pass**: a heuristic that breaks the moment a user edits the channel away from its generated playlist. Don't revive it without new reasoning. ## Why it's blocked Provenance belongs to the **auto-tune arc** (#383 umbrella / #384–#386) — that's the code that knows a channel was generated, and it's the right place to stamp it. Doing it from #72's side would have collided with that arc mid-flight. Design it **with** #383's DetailPanel, which already lets a user override per-channel identity (so "auto-generated" needs a defined meaning after an edit). ## Done-when - [x] `Channel` carries an honest origin marker, stamped at creation by the auto-tune path (or a stated better design) — `ChannelOrigin { Unknown, UserCreated, AutoTuned }` + `Channel.Origin`, stamped `AutoTuned` in `CreateChannelFromLineupHandler`, `UserCreated` in `CreateChannelHandler` - [x] Dual-provider migration (SQLite + MySql) via `scripts/add-migration.sh`; CI `migrations` job green — `Add_Channel_Origin` (default 0 = Unknown, no back-fill) - [x] Surfaced on `ChannelResponseModel` + rendered in the channels list — raw `origin` field; SPA badges only `AutoTuned` - [x] Defined semantics for "auto-generated then user-edited" — **immutable provenance**: origin records how the row was born and never changes on edit, so it stays `AutoTuned`. A future "diverged from template" signal is a separate auto-tune-arc concern. - [x] `docs/decisions.md` + `docs/domain-model.md` updated — `channel.origin-marker` - [x] adversarial review passed — independent cold review clean; `Review-verdict: MERGEABLE @ 015d4166` on PR #575 **PR:** #575
timothy added the enhancementapipriority: lowfrontend labels 2026-07-17 16:32:47 +02:00
Author
Owner

🔗 Session bundle — channel health / status UX (deferred from #72): #414, #415

The two scope items deferred from #72 (channel health/status UX): #414 (distinguish auto-tuned from user-created channels — needs a real Origin signal) and #415 (per-channel fault detection beyond 'no playout'). Both extend the same channels-list health surface; see docs/decisions.md 2026-07-17.

When you claim any member, check this cluster for co-workable siblings and sweep the disjoint set in one session (per docs/handoffs/chicorytv-issue-queue.md → bundles).

🔗 **Session bundle — channel health / status UX (deferred from #72):** #414, #415 The two scope items deferred from #72 (channel health/status UX): #414 (distinguish auto-tuned from user-created channels — needs a real Origin signal) and #415 (per-channel fault detection beyond 'no playout'). Both extend the same channels-list health surface; see docs/decisions.md 2026-07-17. When you claim any member, check this cluster for co-workable siblings and sweep the disjoint set in one session (per docs/handoffs/chicorytv-issue-queue.md → bundles).
timothy added the in-progress label 2026-07-23 18:45:46 +02:00
Author
Owner

Claiming — working in worktree feat/414-channel-origin off origin/main.

Bundle note (#414/#415 channel-health cluster): taking #414 (origin marker) this session as a contained slice — new Channel origin column + dual-provider migration stamped by the auto-tune path + surfaced on ChannelResponseModel and the channels list. Leaving #415 (per-channel fault taxonomy) for its own session — it's "a project, not a field" (per-kind "empty" across all 5 PlayoutScheduleKind + broken-source attribution with unresolved design questions), not cheaply co-workable here.

Also noting the sibling rulebuilder-bundle worktree is another active session; untouched.

Claiming — working in worktree `feat/414-channel-origin` off `origin/main`. Bundle note (#414/#415 channel-health cluster): taking **#414 (origin marker)** this session as a contained slice — new `Channel` origin column + dual-provider migration stamped by the auto-tune path + surfaced on `ChannelResponseModel` and the channels list. Leaving **#415** (per-channel fault taxonomy) for its own session — it's "a project, not a field" (per-kind "empty" across all 5 `PlayoutScheduleKind` + broken-source attribution with unresolved design questions), not cheaply co-workable here. Also noting the sibling `rulebuilder-bundle` worktree is another active session; untouched.
timothy removed the in-progress label 2026-07-23 20:12:52 +02:00
Author
Owner

Closing record

Outcome: Merged as 8b9a7ed5 (PR #575, squash). Channel now carries an immutable creation-provenance marker (ChannelOrigin { Unknown, UserCreated, AutoTuned }), stamped once at insert and surfaced as origin on ChannelResponseModel; the SPA badges only AutoTuned.
Root cause: N/A (enhancement). #414 wanted an honest auto-tuned-vs-user-created distinction without reviving the fragile "detect when it's been edited away" heuristic the issue rejected.
Decisions/conventions changed: added channel.origin-marker to docs/decisions.md (immutable provenance, not a mutable "still managed" flag; enum over bool for additive future origins; Unknown = 0 honest legacy default, no back-fill).
Reusable knowledge: stamped at the single insert primitive (CreateChannelFromLineupHandler.BuildChannel, which bulk auto-tune delegates to) + CreateChannelHandler; never mutated on edit, so "auto-generated then user-edited" stays AutoTuned. Pre-migration rows read Unknown (unbadged). Mirrors the api.channel-health-signal "raw fact, not a policy enum" reasoning.
Verification: dotnet build clean; 1833 .NET + 939 web tests pass; dual-provider migration integrity green; independent cold-context review MERGEABLE @ 015d4166; live-E2E write→read round-trip + migration-at-boot verified; full CI green.
Deferred: empty-schedule / broken-source fault detection → #415 (sibling in the same bundle, still open). A future "diverged from its auto-tune template" signal belongs to the #383/#384 auto-tune arc, not this column.
Docs updated: docs/decisions.md (channel.origin-marker), docs/domain-model.md.

## Closing record **Outcome:** Merged as `8b9a7ed5` (PR #575, squash). `Channel` now carries an immutable creation-provenance marker (`ChannelOrigin { Unknown, UserCreated, AutoTuned }`), stamped once at insert and surfaced as `origin` on `ChannelResponseModel`; the SPA badges only `AutoTuned`. **Root cause:** N/A (enhancement). #414 wanted an honest auto-tuned-vs-user-created distinction without reviving the fragile "detect when it's been edited away" heuristic the issue rejected. **Decisions/conventions changed:** added `channel.origin-marker` to `docs/decisions.md` (immutable provenance, not a mutable "still managed" flag; enum over `bool` for additive future origins; `Unknown = 0` honest legacy default, no back-fill). **Reusable knowledge:** stamped at the single insert primitive (`CreateChannelFromLineupHandler.BuildChannel`, which bulk auto-tune delegates to) + `CreateChannelHandler`; never mutated on edit, so "auto-generated then user-edited" stays `AutoTuned`. Pre-migration rows read `Unknown` (unbadged). Mirrors the `api.channel-health-signal` "raw fact, not a policy enum" reasoning. **Verification:** `dotnet build` clean; 1833 .NET + 939 web tests pass; dual-provider migration integrity green; independent cold-context review MERGEABLE @ 015d4166; live-E2E write→read round-trip + migration-at-boot verified; full CI green. **Deferred:** empty-schedule / broken-source fault detection → #415 (sibling in the same bundle, still open). A future "diverged from its auto-tune template" signal belongs to the #383/#384 auto-tune arc, not this column. **Docs updated:** `docs/decisions.md` (`channel.origin-marker`), `docs/domain-model.md`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: timothy/ersatztv#414