feat(persona): demote stale 'Right now' out of the always-on core

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G796GsLCvJQKVN7hwV2cDx
This commit is contained in:
2026-07-11 17:51:42 +00:00
parent 48da8d019c
commit 073ec0d6d6
3 changed files with 34 additions and 5 deletions
+27
View File
@@ -0,0 +1,27 @@
"""Persona composition + voice guards. Run via `uv run pytest` FROM the worktree."""
from __future__ import annotations
from lyra import persona
# core_prompt() char length on the pre-rewrite persona (measured 2026-07-08).
# The rewrite must not bloat the always-on hot path past this.
BASELINE_CORE_CHARS = 2878
def _core() -> str:
persona._sections.cache_clear() # file changed on disk since import
return persona.core_prompt()
def test_right_now_is_not_in_the_always_on_core():
# Demoted out of _CORE: its content must no longer ride every turn.
assert "Right now" not in persona._CORE
assert "are coming" not in _core() # the stale promise is gone from core
assert "player content library" not in _core()
def test_right_now_section_still_exists_and_is_accurate():
rn = persona.section("Right now")
assert rn # still a loadable situational section
assert "are coming" not in rn # stats/profiling are SHIPPED — no stale promise
assert "analyze_spot" in rn # names a real, current capability