Skip to content

How It Works: The Compounding Loop ​

The compile pipeline turns sources into knowledge. The compounding loop turns experience into rules — and it's the part that makes the fabric more valuable every month you use it.

Step 1: The honest record ​

After real work, you (or the agent) log an experience event:

bash
wf log --project auth-service \
  --problem "Risk agent had redundant checks" \
  --intervention "Consolidated 3 checks into 1 validator" \
  --outcomes "150ms→23ms latency"

Three fields: what went wrong, what you did, what measurably happened. That's the entire ceremony — and it's deliberately cheap, because capture that costs effort doesn't happen.

Step 2: Deterministic mining ​

Chat-mined candidates (second intake, #89): wf mine chats <slug> --propose stages durable pattern/anti-pattern takeaways from captured chat sessions as gated candidates (patterns/_inbox/, provenance-cited to the conversation, idempotent hashed ids). They surface in wf gate; wf promote-patterns --apply <id> --reject <id> --reason is the human decision. Apply moves them to canonical patterns/ — the maturity gates govern from there. Opt-in (#190): promote-patterns --auto bands the inbox through the calibrated judge (confident applies, near-band escalates); auto-applies are stamped + reversible, and the CI pipeline itself never promotes. Mining with thread signals (#103) means clusters are informed by graph structure (shared sessions, file overlap, continuations), not just text overlap.

mine-promotions.py clusters experience events across projects by concept overlap — keyword Jaccard by default; near-miss pairs get judged refinement only when integrations.judgment is enabled (0-LLM otherwise). Protected slow-lane content survives mining: conflicting protected changes propose .revision.md re-review instead of overwriting. When the same pattern of problem → intervention → outcome shows up in two or more independent projects, it stops being one team's anecdote and becomes a candidate rule.

The judged refinement, live (the decision model splits incoherent clusters instead of letting one bad merge reach a dossier):

bash
$ wf mine promotions
Mining promotions (min projects: 2, embeddings: False)...
Found 9 experience events
Judgment tier: active — near-miss pairs will be refined by the decision model
  judged instructions-and-rules+godot-mcp: p=0.030 -> keep-split
  judged instructions-and-rules+nomokailist: p=0.030 -> keep-split
  judged instructions-and-rules+aperiodic: p=0.020 -> keep-split
(no pending candidates — mine with: wf mine chats <project> --propose)

Step 3: The dossier ​

The full mining procedure is on demand: wf skill promote.

Each cluster becomes a promotion dossier: the evidence, the conditions where it held, the boundary where it stopped applying, and the counterexamples. This is the document a human reviews — it must answer seven questions (independence, evidence, applicability, counterexamples, tradeoffs, asset changes, owner review) before anything moves.

Step 4: The human gate ​

Promotion is never automatic. A human approves, and the pattern's status moves candidate → recommended — which lint only allows at maturity ≥ 2 (observations from ≥2 independent codebases). Nothing reaches standard without a named human verifier. The machine proposes; people bless.

Why independence is the whole trick ​

Two projects observing the same failure is evidence. One project's doc copied to another repo is not — it's the same observation wearing a different path. The independence rule is what keeps a plausible-sounding rule from being blessed by a single bad experience echoed twice.

What compounding looks like ​

Session one on project five: bootstrap discovers the overlay, the fabric loads the global fabric plus this project's context — and the agent already knows the three patterns promoted from your other projects. Nobody pasted anything. Session forty on project nine inherits all of it. That's the bet: an LLM is a good compiler but an unreliable memory — so the fabric stores structured, source-anchored claims and spends tokens only where judgment is needed.

Alpha — expect breaking changes.