Sign in to create and edit playbooks. Sign In Register

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

  1. For each Log Story Script row, a test asserts the where + beat + must_include fragments appear in captured logs at the declared level (default INFO; WARNING/ERROR when the script says so).
  2. Cover happy and reject paths when the scenario has both (test_*_log_story_happy / test_*_log_story_reject).
  3. Use the shared helper from skill Pytest Log Story Assertions (tests/support/log_story.pyassert_log_story(...)) once TFK-02 has bootstrapped it.
  4. Log-story tests ship in the same commit as behavior green — never a deferred logging slice.
  5. 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.log inspection as the only DoD for observability
  • Skipping checkpoint.log_story_command when the manifest lists log_tests
  • Passing log-story tests while skipping declared agent_proof_command on the same slice
Details
Slug:
assert-log-story
Always apply:
Yes
Created:
Jul 24, 2026
Updated:
Aug 21, 2026
Playbook
Junior Edda

v73.0

View Playbook
Activities 3