Repository navigation
feat: mistake ledger — never make the same mistake twice - #24
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ten tasks in five waves, plus the controller's rollout and backfill. Every code block was run as a prototype first (112 new tests and the existing tools, v1 and api-key tests passing). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and supersede Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and unused-pattern detection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d log each delivery Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d the seed catalogue Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ast two tasks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… reject 4') applied all-or-nothing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # src/middleware/api-key.js
…al numbers, swarm-only routes - Secrets: wider patterns (keys with dashes, tokens by prefix, bearer headers, quoted names, URL passwords, private-key blocks) on every kept field; caught_by is bounded. - The idempotency key is compared exactly and never rewritten; run keys keep their parts apart. - Approval: a pattern keeps its number across pages, a number is never reused, and a decision is refused when the pattern changed after the page was made. - The ledger routes take the swarm key only; that key opens nothing else (not the rest of the API, not MCP). A record sent over HTTP is a swarm record and cannot supersede. Server faults answer with a plain message. - kb_mistake_record is a local tool only. - Pattern notes are read as YAML data; a draft never overwrites an existing note file; a correction stays with the pattern that used the original. - The KB copy of a record is made once and retried on a repeat; imports say how many copies failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the review changes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a local tool Bounded the name and URL-scheme parts of the redaction patterns and cut input past 64 KB (nothing past 4 KB is kept), so one large request cannot stall the server. The MCP pitfalls tool joins the local-only list, matching the swarm-only HTTP route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… itself) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only patterns approved for teaching are indexed, so the held-back half stays unseen by agents and the later experiment that compares them stays fair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ore cleaning Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every mistake a reviewer or test catches in an agent's work is kept with its fix. Mistakes that repeat across tasks become short rules ("patterns"); the operator approves them; agents get the matching ones before they start a task. The first-review pass rate is recorded per run and per model.
~/.knowledge-base/mistakes/ledger.jsonl; secrets removed before anything is kept; corrections supersede, never edit.patterns/<slug>.md, drafted by a model (with every tool off) and gated by code: mistakes from at least 2 tasks, a rule of at most 60 words, real examples. Approved patterns are split into a taught half and a held-back half for a later experiment; only taught patterns are searchable.kb patterns pagewrites a numbered page;kb patterns set-status "approve 1 and 3, edit 2: …, reject 4"applies all-or-nothing. Numbers are permanent, and a decision is refused if the pattern changed after the page was made./api/v1/patterns/for,/mistakes,/runsand/mistakes/metrics, for the swarm key only (that key opens nothing else). Local MCP toolskb_mistake_recordandkb_patterns_for. A Learning panel in the dashboard.kb mistakes …,kb patterns ….Spec:
docs/superpowers/specs/2026-10-13-mistake-ledger-design.md. Plan:docs/superpowers/plans/2026-10-14-mistake-ledger.md(see its amendments). Docs:docs/mistake-ledger.md.Tests: 313 passing (154 new). Reviewed by Opus (whole branch), an automated security pass and Codex. Every finding was fixed with a test seen failing first.
Rollout steps after merge (adding a swarm key, restarting the server, backfill, the first approval page) are separate and need the operator's go-ahead.
🤖 Generated with Claude Code