Skip to content

Patterns

Pattern: prod-error-sweep

Production errors are the ones that actually cost users something, so this kit checks the logs every 1–6 hours, traces anything actionable to its root…

Production errors are the ones that actually cost users something, so this kit checks the logs every 1–6 hours, traces anything actionable to its root cause, and drafts a verified fix. If nothing actionable turns up, that's a complete, successful beat — not a gap to apologize for. Its one hard rule, carried from the source unchanged: never let a credential, token, or private payload leave the logs into a report, a PR, or a chat message.

Quick facts

FieldValue
CategoryL · Monitoring & incident
Heartbeatschedule
Cadence1–6h
LevelL1 (report-only, drafts-not-opens-PR)
CostMedium
GroupB — Forward Future Loop Library

The six parts

PartThis kit
Heartbeatschedule — every 1–6 hours
Bodyreads production logs and error telemetry; drafts a fix in a throwaway worktree, runs tests there; writes only prod-error-report.md, its own state file, and the run log
Spineprod-error-sweep-state.md — per-error status, root cause, fix draft, verification result
Stopping conditionthe source's own, verbatim: "if no actionable errors are present, stop without making changes" — otherwise, a beat completes when the traced error has a verified-fix entry
Checkerthe test suite re-run against the drafted fix, plus loop-verifier scanning the report for anything that looks like a leaked credential or payload
Human gateyou read the report and apply the fix yourself; nothing is opened or committed until you do

The three valid stops

  • Success — the traced error has a verified-fix entry, or (the source's own explicit case) nothing actionable was present and the mark advanced cleanly.
  • Limit — 24 runs/day or 250k tokens/day.
  • No progress — 3 consecutive beats with nothing actionable → log and stop (different from the source's per-beat "stop without making changes," which is a success).

Source: Loop #4, "The production error sweep," from Forward Future's Loop Library, original prompt by Matthew Berman. The source's own constraint — never copy credentials, tokens, personal information, or private payloads into prompts, PRs, or chat — is carried forward unchanged. Full attribution: resources/sources.md.