073ec0d6d6
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G796GsLCvJQKVN7hwV2cDx
28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
"""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
|