Skip to content

feat(char): centralize default playback content to .env (CHAR_CONTENT)#846

Merged
jonathaneoliver merged 1 commit into
devfrom
feat/env-default-content
Jun 23, 2026
Merged

feat(char): centralize default playback content to .env (CHAR_CONTENT)#846
jonathaneoliver merged 1 commit into
devfrom
feat/env-default-content

Conversation

@jonathaneoliver

Copy link
Copy Markdown
Owner

What

Make the default characterization/sweep playback clip come from one place — CHAR_CONTENT in .env — instead of being hardcoded in ~25 spots.

Why

insane_new_p200_h264 was hardcoded across ~12 matrices, the sweep seed constant, and qe-offhours.sh — and it's a dead clip (404). The iOS app silently substitutes the first catalogue entry (bucks_bunny) for an unknown clip, so the typo never errored; runs just measured the wrong content. Root cause: no single source of truth for the default.

How

All consumers resolve through sweep.ContentOrDefault: explicit spec content:CHAR_CONTENT (.env, already -included + exported by the Makefile) → a valid built-in default (insane_newer_p200_h264), so an unset value can never 404.

  • sweep/seed.go: SeedContent const → env-driven ContentOrDefault("").
  • cmd/harness/char.go: both matrix clip-resolution sites use it.
  • qe-offhours.sh: QE_CONTENT → CHAR_CONTENT → default.
  • .env.example: documents CHAR_CONTENT as the single source.
  • matrices: dropped the hardcoded content: from all 24 specs (they all used the default clip) so they inherit; pin content: only to override.
  • TEST-PLAN.md: content is now optional.

Verified

make harness-cli builds; go test ./internal/sweep ./internal/charmatrix pass; stripped matrices dry-run clean and resolve to the built-in default (no "no content" error).

Follow-up (separate PR)

The deeper bug is the silent app substitution (HomeScreen.swift:211) — making the player loud about a 404'd clip is an iOS change worth its own issue.

🤖 Generated with Claude Code

Root-cause fix for the dead-clip bug: the default content was hardcoded
in ~25 places, one of them an invalid name (insane_new_p200_h264, 404)
that silently fell back to bucks_bunny on-device. There was no single
source of truth.

Now there is one: CHAR_CONTENT in .env (the Makefile already
-includes + exports it). All consumers resolve through
sweep.ContentOrDefault: an explicit spec content: wins, else
CHAR_CONTENT, else a valid built-in default (insane_newer_p200_h264) so
an unset value can never 404.

- sweep/seed.go: SeedContent const → ContentOrDefault("") (env-driven).
- cmd/harness/char.go: both matrix clip-resolution sites use
  ContentOrDefault(e.Content).
- qe-offhours.sh: QE_CONTENT → CHAR_CONTENT → valid default.
- .env.example: document CHAR_CONTENT as the single source.
- matrices: drop the hardcoded content: from all 24 specs (they used
  the default clip) so they inherit; pin content: only to override.
- TEST-PLAN.md: content is now optional (inherit from CHAR_CONTENT).

Verified: harness builds, sweep + charmatrix tests pass, stripped
matrices dry-run clean and resolve to the built-in default.

Follow-up (separate, app-side): make the player LOUD when a requested
clip 404s instead of silently substituting the first catalogue entry —
that silent fallback is what hid the typo (HomeScreen.swift:211).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Jun 23, 2026
@jonathaneoliver jonathaneoliver merged commit 9d04965 into dev Jun 23, 2026
1 check passed
@jonathaneoliver jonathaneoliver deleted the feat/env-default-content branch June 23, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant