Meta-layer / Governed self-learning

The team improves by earning rules.

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.

Self-learning

evidence → proposal → approval → policy → measured next run

Pattern laboratory

What did the evidence repeat?

Analyze
3+ repeated decisions · consistent rationale · outcomes confirmed

Promote a recurring decision into a principle.

If agents repeatedly reach the same sound decision, stop charging every future run to reason through it again.

Target
Relevant agent definition
Proposal
Exact principle text + destination section
Authority
Human approves selectively

01 / The governance boundary

Self-learning is not self-rewriting.

The system may notice patterns and draft changes. It may not silently alter the rules that will govern future agents.

Deterministic

Evidence store

Preserves typed records, feature IDs, categories, timestamps, and outcomes.

db/agent_log.sqlite3
Probabilistic

Log Analyst

Finds cross-run patterns, calibrates confidence, and writes specific proposals.

docs/agent-analysis/YYYY-MM-DD.md
Human authority

Approval gate

Accepts, rejects, edits, or defers each proposal independently.

no approval · no mutation
Bounded change

Skill Builder

Implements only the approved change, then leaves it reviewable in version control.

agent / skill patch
Hard boundary

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

A rule is a hypothesis with a longer half-life.

The loop closes only when the changed policy runs again and its effects become new observed evidence.

  1. 01

    Run

    Specialists ship features under the current policy.

  2. 02

    Record

    Decisions, findings, gaps, and outcomes accumulate.

  3. 03

    Analyze

    The analyst compares runs, roles, features, and quality.

  4. 04

    Propose

    Each pattern becomes exact text and an explicit destination.

  5. 05

    Approve

    A human chooses which proposals become policy.

  6. 06

    Implement

    The builder changes only the approved agent or skill.

  7. 07

    Observe again

    Future runs test whether the rule reduced effort or failure.

New evidence returns to the same recorder

03 / Six learning signals

Different patterns should change different assets.

The important question is not merely “what repeated?” It is “where should this knowledge live so it prevents the next failure?”

01 · Promotion

Repeated sound decision

A choice made three or more times with consistent rationale and strong outcomes becomes a standing principle.

Change: agent guidance
02 · Anti-pattern

Repeated rejected alternative

An option rejected at least twice for the same reason becomes an explicit anti-pattern.

Change: agent prohibitions
03 · Artifact gap

Repeated upstream silence

Agents keep inventing the same missing fact because a brief or spec template failed to require it.

Change: artifact-format skill
04 · Outcome delta

Prediction did not survive contact

The observed result differs materially from the expected outcome, exposing a faulty assumption.

Change: reasoning guidance
05 · Quality correlator

Practice predicts stronger work

A behavior appears in high-quality runs and is absent from weaker runs.

Change: agent process
06 · Skill candidate

Finding repeats across features

A review category appears across three or more features and can be prevented before implementation.

Change: new or expanded skill

04 / Confidence calibration

Do not promote anecdotes into doctrine.

Thresholds are deterministic filters. Whether the pattern is causally meaningful still requires analysis and human judgment.

EvidenceConfidenceAllowed action
One occurrenceInsufficientRecord under “requires more data.” Do not propose a rule.
Two consistent occurrencesMediumSurface as a candidate. Defer unless the risk justifies earlier action.
3+ consistent occurrencesHighPropose exact policy text, especially when outcomes confirm it.
Finding across 3–4 featuresSkill candidateDefine prevention content; one more feature strengthens the case.
Finding across 5+ featuresHigh-confidence skillRecommend building the prevention skill now.
Clear expected/observed mismatchDirect correctionCorrect the faulty assumption, with evidence attached.

05 / Human approval laboratory

A proposal must be specific enough to reject.

Vague recommendations cannot be governed. A useful proposal names the evidence, exact text, destination, confidence, and expected effect.

Example proposal · medium confidence

Require collection-size expectations in architecture specs.

Evidence
N+1 findings in 4 features; 3 specs omitted expected collection size.
Target
skills/architect-spec-format/SKILL.md · Behavioral Constraints
Exact addition
“For every collection view, state expected cardinality, pagination behavior, and query-count constraint.”
Expected effect
Move performance reasoning before implementation; reduce repeated reviewer catches.

06 / Cadence

Analysis is triggered by evidence volume, not a calendar.

The feature pipeline checks how many completed cycles have accumulated since the last dated analysis report. It nudges; it never launches the analyst automatically.

0–9 cyclesKeep collecting

Too little cross-feature signal for a broad analysis pass.

10–14 cyclesWorth a run

Mention that the Log Analyst has enough new evidence.

15+ cyclesPast the window

Call out that analysis is overdue, without blocking delivery.

Why it is a nudge

Learning is valuable but not a feature-delivery gate. Automatically interrupting every pipeline would turn compounding into friction.

07 / What this system refuses

Guard against performative learning.

A learning loop compounds only when it changes future behavior for a traceable reason.

Not learning

Prompt edits from one bad run

That is reaction without recurrence evidence.

Not learning

An agent rewriting itself

That removes the independent governance boundary.

Not learning

A dashboard of activity counts

Usage is not improvement unless it informs a decision.

Not learning

Adding a skill for every finding

Policy bloat increases context cost and creates contradictions.

Not learning

Applying every analyst proposal

Confidence is evidence quality, not authority.

Not learning

Never recording outcomes

Without observed results, the system cannot test its own expectations.

08 / Build it portably

Preserve the governance loop; replace the domain policy.

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 Analyst
Keep

Evidence grammar

Runs, decisions, findings, reflections, outcomes.

Keep

Pattern thresholds

Minimum recurrence and confidence calibration.

Keep

Human approval

Selective acceptance before mutation.

Replace

Domain doctrine

Rails principles become the target ecosystem’s judgment.