feat: record review-gated project learnings

SU
3mo ago
+450-0

Summary

Adds the first mergeable slice of #31: structured project learnings that remain separate from decisions, reflections, and durable project instructions.

  • Adds a typed learning trajectory event with source, affected area, evidence, recurrence key, and promotion status.
  • Adds trail learning for recording one-off learnings or human-review candidates.
  • Adds trail show <id> --learnings for querying them separately.
  • Exposes the new API and schemas from the public package.

Safety boundary

This slice deliberately does not write to AGENTS.md, CLAUDE.md, or skills. One-off learnings are archived; --promotion-candidate records pending_review. There is no approved state in this PR, so a candidate cannot be mistaken for a human-approved durable instruction.

Recurrence aggregation, configurable thresholds, reviewer authentication, and promotion adapters remain follow-up work.

Validation

  • npm test -- --run — 263 tests passed
  • npm run build
  • npm run lint
  • npm run typecheck

AI assistance

Implemented with OpenAI Codex assistance and reviewed by SuhaibAslam before submission.