Reads logs, detects patterns, rewrites the playbook. Not passive logging — this ACTS on what it learns.
text
SCAN (read logs) ──► PROPOSE (specific edits) ──► APPLY (low-risk auto, high-risk flag)
SourceWhat It Contains.learnings/ERRORS.mdWhat broke and how it was fixed.learnings/LEARNINGS.mdCorrections, insights, knowledge gaps, batch outcomesworkspace/OUTSTANDING.mdRanked ideas and opportunitiesmemory/permanent/*.mdCurrent knowledge stateworkspace/DELEGATION_PLAN.mdAtom timing data (if delegation was used)
Detect:
For each detected pattern:
text
PROPOSAL: [short title]
EVIDENCE: [file#line references]
CHANGE: [exact edit — old text → new text]
RISK: [low/medium/high]
REVERSIBLE: [yes/no]
Pattern-Key: [hash(error+fix) for dedup]
Pattern TypeActionTarget FileRepeated errorAdd prevention rulerelevant skill's ## Learned sectionRepeated correctionUpdate behavior guidelineSOUL.md or AGENTS.mdEmerging thesisWrite thesis + next stepsOUTSTANDING.mdStale knowledgeUpdate the factmemory/permanent/*.mdUnused winCreate ticket or reminderNEXT_TICKET.md or cron
OUTSTANDING.md and wait for approval.--dry-run): Propose all changes but apply none. Output a report.Use 3-occurrence threshold before proposing pattern-based changes. Track recurrence with Pattern-Key and Recurrence-Count.
After SCAN, for each error in ERRORS.md:
Extract the Context column value
Match against skill names (fuzzy: "SiteBlitz CSS" → webdev-sop)
If match found and skill doesn't already have the fix in ## Learned:
markdown
## Learned
4. Use `Pattern-Key: hash(error+fix)` to prevent duplicates
Skills self-heal: every failure improves the relevant skill.
## Delegation Feedback
After delegation plan completes:
1. Read atom timing data from DELEGATION\_PLAN.md
2. Atom actual time > 2× estimated → flag estimation drift
3. Atom model upgraded (flash→sonnet) → update routing suggestion in MODEL\_ROUTING\_PROTOCOL.md
4. Append summary to `.learnings/LEARNINGS.md`