Evidence store
Preserves typed records, feature IDs, categories, timestamps, and outcomes.
db/agent_log.sqlite3Meta-layer / Governed self-learning
One run creates an anecdote. Repeated evidence creates a candidate pattern. A human-approved proposal becomes policy. Future outcomes determine whether that policy deserves to stay.
evidence → proposal → approval → policy → measured next run
Pattern laboratory
If agents repeatedly reach the same sound decision, stop charging every future run to reason through it again.
01 / The governance boundary
The system may notice patterns and draft changes. It may not silently alter the rules that will govern future agents.
The Log Analyst cannot modify agent definitions, application code, or the log database. It writes only to docs/agent-analysis/.
02 / The complete learning cycle
The loop closes only when the changed policy runs again and its effects become new observed evidence.
Specialists ship features under the current policy.
Decisions, findings, gaps, and outcomes accumulate.
The analyst compares runs, roles, features, and quality.
Each pattern becomes exact text and an explicit destination.
A human chooses which proposals become policy.
The builder changes only the approved agent or skill.
Future runs test whether the rule reduced effort or failure.
03 / Six learning signals
The important question is not merely “what repeated?” It is “where should this knowledge live so it prevents the next failure?”
A choice made three or more times with consistent rationale and strong outcomes becomes a standing principle.
Change: agent guidanceAn option rejected at least twice for the same reason becomes an explicit anti-pattern.
Change: agent prohibitionsAgents keep inventing the same missing fact because a brief or spec template failed to require it.
Change: artifact-format skillThe observed result differs materially from the expected outcome, exposing a faulty assumption.
Change: reasoning guidanceA behavior appears in high-quality runs and is absent from weaker runs.
Change: agent processA review category appears across three or more features and can be prevented before implementation.
Change: new or expanded skill04 / Confidence calibration
Thresholds are deterministic filters. Whether the pattern is causally meaningful still requires analysis and human judgment.
| Evidence | Confidence | Allowed action |
|---|---|---|
| One occurrence | Insufficient | Record under “requires more data.” Do not propose a rule. |
| Two consistent occurrences | Medium | Surface as a candidate. Defer unless the risk justifies earlier action. |
| 3+ consistent occurrences | High | Propose exact policy text, especially when outcomes confirm it. |
| Finding across 3–4 features | Skill candidate | Define prevention content; one more feature strengthens the case. |
| Finding across 5+ features | High-confidence skill | Recommend building the prevention skill now. |
| Clear expected/observed mismatch | Direct correction | Correct the faulty assumption, with evidence attached. |
05 / Human approval laboratory
Vague recommendations cannot be governed. A useful proposal names the evidence, exact text, destination, confidence, and expected effect.
N+1 findings in 4 features; 3 specs omitted expected collection size.skills/architect-spec-format/SKILL.md · Behavioral Constraints06 / Cadence
The feature pipeline checks how many completed cycles have accumulated since the last dated analysis report. It nudges; it never launches the analyst automatically.
Too little cross-feature signal for a broad analysis pass.
Mention that the Log Analyst has enough new evidence.
Call out that analysis is overdue, without blocking delivery.
Learning is valuable but not a feature-delivery gate. Automatically interrupting every pipeline would turn compounding into friction.
07 / What this system refuses
A learning loop compounds only when it changes future behavior for a traceable reason.
That is reaction without recurrence evidence.
That removes the independent governance boundary.
Usage is not improvement unless it informs a decision.
Policy bloat increases context cost and creates contradictions.
Confidence is evidence quality, not authority.
Without observed results, the system cannot test its own expectations.
08 / Build it portably
The schema, thresholds, analyst constraints, proposal format, and approval gate can travel to any language. The rules being proposed must remain native to that ecosystem.
Inspect the Log AnalystRuns, decisions, findings, reflections, outcomes.
Minimum recurrence and confidence calibration.
Selective acceptance before mutation.
Rails principles become the target ecosystem’s judgment.