Establish the learning-loop & audit architecture
0002-learning-loop-and-audit-architecture
- Reversibility
- two-way door
DEC-0002 — Learning-loop & audit architecture
Context
Dossier's thesis is a compounding learning loop (knowledge base + private evals + private RL on real traces). We must capture decisions and traces from day one, and dogfood the loop on this project itself.
Options considered
- Manual notes / commit messages only.
- A single big log file.
- Two-layer capture — automatic raw traces (machine) + curated atomic decision records (human/agent), built on Claude primitives.
Decision
Adopt the two-layer model, built on Claude primitives (Claude-primitives-first build strategy):
- Raw layer — a PostToolUse hook (
.claude/hooks/capture-trace.mjs) appends every tool call tojournal/traces/(ephemeral, gitignored). - Curated layer — the log-auditor subagent distills signal into atomic OKF
decisionrecords (knowledge/decisions/) + the runningknowledge/log.md.
Rationale
- Traces are the eval/RL substrate Nadella names; curated decisions are the durable IP.
- Hook = deterministic, zero-effort capture; subagent = judgment + curation. Right tool per layer.
- Dogfooding makes Dossier its own first learning loop — proof and product in one.
Consequences
capture-trace.mjs+.claude/settings.json(PostToolUse, matcher*); raw traces gitignored.log-auditoragent owns curation discipline; never fabricates rationale.- Capture activates immediately on settings write (no restart).