ADLC
Toolkit

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.

The ADLC lifecycle, with P7 highlighted. Read the theory for P7

What it defends against

F7: Generative bloat (theory ↗)

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]
FlagDescription
--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).
--writeEmit files (default is dry-run, which prints what would be written).
--gateExit 2 if any cluster ≥ --min has no defense file in --out-dir.
--llmRefine cluster wording via one mid-tier LLM call per cluster.
--tier cheap|mid|frontierModel tier for the --llm pass (default mid).
--prompt-onlyPrint the LLM prompts and exit 0 (zero API keys).
--jsonMachine-readable output.

Exit codes

0: gate passes. No recurring unbanked lessons (or --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 2

Go deeper

packages/lesson-foundry. Why recurring findings must be paid for exactly once: Prosecution, Not Code Review.

On this page