Establish the learning-loop & audit architecture

0002-learning-loop-and-audit-architecture

decision read as Explain confidence asserted status active 2026-06-14 owner principal-architect
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

  1. Manual notes / commit messages only.
  2. A single big log file.
  3. 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 to journal/traces/ (ephemeral, gitignored).
  • Curated layer — the log-auditor subagent distills signal into atomic OKF decision records (knowledge/decisions/) + the running knowledge/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-auditor agent owns curation discipline; never fabricates rationale.
  • Capture activates immediately on settings write (no restart).