feat(director): thread a time-of-day scene into the talk prompt [spec 04] - #39
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 adatetimeto acoarse 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 theContextPack;scene_foris thetested seam.
ContextPackgains an optionalscene: str | None(additive). Theself-initiated talk prompts append a per-scene mood cue keyed by
ctx.scene(a
None/ unmapped scene appends nothing). The persona seed is generalizedoff its hard late-night framing so the cue sets the mood.
injected clock (never
datetime.now()), and prompt assembly (cue threadedin / 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(ormake 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
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.
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.
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