Skip to content

feat(director): thread a time-of-day scene into the talk prompt [spec 04] - #39

Merged
wine-fall merged 1 commit into
mainfrom
zachg-0720--time-scene
Jul 20, 2026
Merged

feat(director): thread a time-of-day scene into the talk prompt [spec 04]#39
wine-fall merged 1 commit into
mainfrom
zachg-0720--time-scene

Conversation

@wine-fall

Copy link
Copy Markdown
Owner

The radio's scene was permanently "night" (the persona seed was night-flavored).
This threads the local time of day into the host's talk so the phrasing
varies by hour.

  • scene.scene_for(now) is a pure, clock-free function mapping a datetime to a
    coarse bucket — morning 05:00–11:59, afternoon 12:00–17:59, evening
    18:00–22:59, late-night 23:00–04:59 (midnight wrap). The Director supplies the
    real datetime.now() where it builds the ContextPack; scene_for is the
    tested seam.
  • ContextPack gains an optional scene: str | None (additive). The
    self-initiated talk prompts append a per-scene mood cue keyed by ctx.scene
    (a None / unmapped scene appends nothing). The persona seed is generalized
    off its hard late-night framing so the cue sets the mood.
  • Deterministic parts unit-tested: bucket boundaries + midnight wrap with an
    injected clock (never datetime.now()), and prompt assembly (cue threaded
    in / omitted when unset). Whether the host's phrasing actually reads as
    morning vs. late-night is an eval / by-ear item, not a unit assertion.

Implements specs/spec04/04-no-dead-air.md (new §3.4).

By-ear / eval item owed (not self-declared)

The deterministic seam is proven on fakes (scene reaches the prompt). The
stochastic half — does the real Claude host actually sound like morning vs.
late-night — is owed as a listening pass: run make dev (or make dev-fishaudio)
at two different local hours (or override the clock) and confirm the opening
beats' mood shifts with the scene. Not asserted here on purpose (DESIGN §10.3).

AI coding brief

  • Original request: The radio's scene is always "night." Read the local
    machine time, derive a scene (morning / afternoon / evening / late-night), and
    thread it into the Brain's context so the host's talk varies by time of day.
    The deterministic scene derivation must be unit-tested with an injected clock;
    the phrasing quality is eval-track, not a brittle assert on model text.
  • Manual interventions: The design fork was surfaced as a clarify-gate before
    coding. The user chose (1) spec home = fold into spec04 — chosen with the
    caveat visible that spec04 is about latency, not context content, so §3.4 is
    framed as an adjacent add and the proper spec-07 time home is still flagged as
    owed; and (2) 4 buckets with the hour cuts above.
  • Retro: Surfacing the spec-home + bucketing fork up front (with a recommended
    option + trade-offs per choice) avoided a mid-build rework. For prompt-threading
    features, stating "deterministic (bucketing + prompt assembly) → unit; phrasing
    quality → eval/by-ear" in the plan keeps the test line from drifting into a
    brittle assert on model output.

🤖 Generated with Claude Code

… 04]

The radio was permanently "night" (a night-flavored persona seed). Now the
Director reads the local clock into a coarse scene bucket (morning / afternoon
/ evening / late-night) and threads it into the self-initiated talk prompts, so
the host speaks to the current time of day.

- scene.scene_for(now) is a pure, clock-free bucketing function (the tested
  seam); the Director supplies datetime.now() at runtime. ContextPack gains an
  optional scene field (additive). The persona seed is generalized off its hard
  late-night framing so the per-scene cue sets the mood.
- Deterministic parts are unit-tested with an injected clock (bucket boundaries
  + midnight wrap) and on the prompt strings (scene cue threaded in / omitted
  when unset). Whether the host's phrasing actually reads by time of day is an
  eval / by-ear concern, not a unit assertion.
- Folded into spec 04 §3.4 (adjacent context-enrichment; the spec-07 time home
  is still owed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wine-fall
wine-fall merged commit f2e5f24 into main Jul 20, 2026
4 checks passed
@wine-fall
wine-fall deleted the zachg-0720--time-scene branch July 20, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant