feat(journal): closeout system prompt with structured-field guard
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -51,3 +51,14 @@ def test_build_transcript_keeps_only_last_20_messages():
|
||||
# Newest 20 means msg-10 through msg-29
|
||||
assert lines[0] == "USER: msg-10"
|
||||
assert lines[-1] == "USER: msg-29"
|
||||
|
||||
|
||||
def test_system_prompt_lists_structured_fields_to_exclude():
|
||||
"""The prompt must explicitly tell the LLM not to restate structured
|
||||
fields, so the freeform learned_summary stays a narrow lane."""
|
||||
from fabledassistant.services.journal_closeout import SYSTEM_PROMPT
|
||||
|
||||
text = SYSTEM_PROMPT.lower()
|
||||
for field in ("name", "job title", "industry", "expertise", "response style", "tone", "interests"):
|
||||
assert field in text, f"system prompt should mention '{field}'"
|
||||
assert "(nothing to note)" in SYSTEM_PROMPT
|
||||
|
||||
Reference in New Issue
Block a user