lesson-foundry
Clusters recurring prosecution findings and routes each to its cheapest permanent defense (lint, skill, or spec gap).
lesson-foundry
ADLC phase: P7 Compound · Gate: with --gate, every recurring finding cluster has a banked defense file, so no lesson is re-bought.
What it defends against
Without a compounding step the lifecycle never gets cheaper: the same finding is
re-discovered by probabilistic review every run. lesson-foundry reads the
prosecution findings ledger, clusters findings by semantic similarity, and
routes each recurring cluster to its cheapest permanent defense: a grep-gate
LINT, a SKILL.md stub, or a SPEC-GAP question for P1. That demotes a
dollars-per-catch LLM finding into a free-forever deterministic one.
Usage
adlc lesson-foundry [--ledger <name>] [--min <n>] [--out-dir <path>] [--write] [--gate] [--llm] [--prompt-only] [--json]| Flag | Description |
|---|---|
--ledger <name> | Ledger name under .adlc/ to read findings from (default findings). |
--min <n> | Minimum cluster size to surface (default 2). |
--out-dir <path> | Output directory for defense files (default .adlc/lessons). |
--write | Emit files (default is dry-run, which prints what would be written). |
--gate | Exit 2 if any cluster ≥ --min has no defense file in --out-dir. |
--llm | Refine cluster wording via one mid-tier LLM call per cluster. |
--tier cheap|mid|frontier | Model tier for the --llm pass (default mid). |
--prompt-only | Print the LLM prompts and exit 0 (zero API keys). |
--json | Machine-readable output. |
Exit codes
--gate not set).1: operational error. Bad input, unreadable ledger, or a write failure.2: gate fails. One or more clusters have no defense file in --out-dir.Example
$ adlc lesson-foundry --ledger findings --min 2 --gate
cluster "raw-error-to-client" (4 findings) → LINT [no defense file]
cluster "missing-null-check" (3 findings) → SKILL [no defense file]
✗ lesson-foundry: 2 recurring lesson(s) unbanked: raw-error-to-client, missing-null-check
exit 2Go deeper
packages/lesson-foundry. Why recurring findings must be paid for exactly once: Prosecution, Not Code Review.