Assert Log Story
assert-log-story · always_apply: yes
Content
Mimir metadata: slug do-assert-log-story; always_apply: false (link to BPE-02 / MIN-04 / TFK-02).
When a plan or iteration manifest declares a Log Story Script (or log_story_script[] / log_tests[]), you MUST prove those beats with pytest caplog (or equivalent log capture) — not by grepping logs/app.log alone, and not by "logging statements exist" checklists.
Requirements
- For each Log Story Script row, a test asserts the
where+beat+must_includefragments appear in captured logs at the declared level (default INFO; WARNING/ERROR when the script says so). - Cover happy and reject paths when the scenario has both (
test_*_log_story_happy/test_*_log_story_reject). - Use the shared helper from skill Pytest Log Story Assertions (
tests/support/log_story.py→assert_log_story(...)) once TFK-02 has bootstrapped it. - Log-story tests ship in the same commit as behavior green — never a deferred logging slice.
- Never assert on raw secrets, tokens, or passwords in log lines.
Relationship to agent story
When the same slice also declares Agent proof scenarios (BPE-01 Section G, agent_proof_command, or SAO §17 PRF rows), apply rule do-assert-agent-story in the same commit. Log story proves logging beats (caplog); agent story proves control-plane trace beats (ScriptedLLM + assert_agent_story). Both gates apply independently — neither substitutes for the other.
Anti-patterns
- Behavior test green while log story absent or weakened to
logger.info("done") - Manual
logs/app.loginspection as the only DoD for observability - Skipping
checkpoint.log_story_commandwhen the manifest listslog_tests - Passing log-story tests while skipping declared
agent_proof_commandon the same slice
Details
- Slug:
assert-log-story- Always apply:
- Yes
- Created:
- Jul 24, 2026
- Updated:
- Aug 21, 2026
Playbook
Activities 3
- Implement Backend Build Feature
- TL Dispatches Workers to Build Manage Iteration
- Bootstrap Test Harness Test Automation Framework