Learning & Feedback
How agents accumulate knowledge over time -- from raw signal capture to rule promotion. Fix patterns, review issues, build errors, and execution metrics feed back into future runs.
Existing Feedback Mechanisms
Mechanisms that capture signals during execution. Most are per-session and lose memory between runs.
Self-Healing Loop
Scope: Per-session, per-step. dx-step-fix recovers from failures during execution (targeted fix + root cause escalation). Memory is lost after the session ends — each run starts fresh.
Review-Fix Loop
Scope: Per-session, per-story. dx-step-verify runs up to 3 review-fix cycles. Same issues may recur across stories because findings are not persisted.
Policy Gate
Scope: Global, static.
pipeline-policy.yaml restricts what each agent role can do.
Manually maintained — human updates after incidents.
Shared Rules
Scope: Project-wide, git-tracked.
.ai/rules/ files read by dx skills and automation agents.
Manual only — no automated discovery or suggestion.
Across runs
Only fix patterns carry over between runs — see Fix Pattern Promotion below.
What Gets Recorded
Coordinator skills append one JSON line per event to .ai/learning/raw/. Nothing else reads or writes there.
| File | Written by | Contents |
|---|---|---|
runs.jsonl | dx-step-all, dx-bug-all, dx-estimate | One record per run: ticket, flow, steps completed, fix and heal counts, stop reason |
fixes.jsonl | dx-step-all | One record per fix attempt: error type, fix applied, success or failure |
bugs.jsonl | dx-bug-all | One record per fixed bug: component, root cause, files changed |
Fix Pattern Promotion
A fix that keeps working becomes a rule.
dx-step-all checks after every logged fix attempt, and once more at the end of the run.
How rules are used
Claude Code auto-loads .claude/rules/ on every run. dx-step-all also reads
learned-fix-*.md before its loop and passes the patterns to the step skills, so
Copilot CLI (which does not load .claude/rules/) gets them too.
Bug notes
dx-bug-all prints a note when a component has 3+ entries in bugs.jsonl
(hotspot), or when the root cause matches an error_type already in fixes.jsonl.
Notes only — no files are written.
Review the rules
Promotion is automatic. Rules land in .claude/rules/ like any other file — review them in the
diff before committing, and delete one that turns out wrong.
Consumer Project Layout
.ai/learning/raw/ runs.jsonl fixes.jsonl bugs.jsonl .claude/rules/ learned-fix-<slug>.md -- promoted fix patterns
Not built
An earlier design also had aggregated summaries (fixes.md, metrics.md), a
retrospective skill, review-issue tracking and a learning: config block. None of these exist;
the raw files above and fix promotion are the whole system.