Engineering
Test and Logging Coverage
Raise the floor for every future loop by improving the evidence system.
Use when
Important flows are hard to debug or verify, especially auth, payments, data mutation, external APIs, jobs, and error boundaries.
Cadence
Weekly or before release
Verification
Critical flows have useful tests and structured logs for representative success and failure paths.
Structured loop spec
| Field | Value |
|---|---|
| Name | Test and Logging Coverage |
| Category | Engineering |
| Trigger | Weekly or before release |
| Objective | Raise the floor for every future loop by improving the evidence system. |
| Allowed inputs | Relevant files, source notes, logs, tests, screenshots, metrics, or task state for this loop |
| Allowed actions | List critical flows and current test/log coverage.; Choose the riskiest blind spot.; Add the smallest useful test and structured log improvement.; Verify logs do not expose secrets and tests prove the path. |
| Verification | Critical flows have useful tests and structured logs for representative success and failure paths. |
| Stop condition | Stop when the verifier passes, the budget is exhausted, no progress is made, a blocker appears, or approval is required. |
| Budget | Set a time, turn, token, retry, file, or dollar cap before running the loop. |
| Approval boundary | Human approval required before public, destructive, financial, legal, account, or production-impacting actions. |
| Safe output | Pull request, patch, report, or evidence log |
| Works with | Claude Code, OpenAI Codex, Cursor, Gemini CLI, any tool-using coding agent |
Steps
- List critical flows and current test/log coverage.
- Choose the riskiest blind spot.
- Add the smallest useful test and structured log improvement.
- Verify logs do not expose secrets and tests prove the path.
Prompt
Review critical flows and improve tests plus structured logging until important paths have useful coverage. Prioritize auth, payments, data mutation, external calls, queue jobs, cron jobs, and error boundaries. Verify where practical and return coverage evidence.Run in Claude Code
Paste this into Claude Code (or any tool-using agent) to run the loop bounded: one change per round, the same verification every round, durable state files, and explicit stop conditions.
Run the "Test and Logging Coverage" loop from AI Loop Library (https://ailooplibrary.com/loops/test-logging-coverage/) as a bounded loop.
Goal: Raise the floor for every future loop by improving the evidence system.
Rules: one change per round; run the same verification every round (Critical flows have useful tests and structured logs for representative success and failure paths.); append each round to docs/loops/test-logging-coverage/progress.md and update docs/loops/test-logging-coverage/state.json; stop on verifier pass, 8 rounds, 3 consecutive failed verifications, no progress, a blocker, or anything needing human approval (money, production, outbound, deletion). Finish with a proof report: rounds used, changes made, verification output, remaining risk, and the next human decision.