Documentation Architecture#
Decant's documentation is organized around a single canonical source of truth principle: one authoritative document per topic, with all other entry points staying thin and deferring to it.
The Canonical Hub: AGENTS.md / CLAUDE.md#
AGENTS.md is the primary reference for commands, conventions, and project invariants for both human contributors and AI coding agents. CLAUDE.md is a symlink to this file — tool-specific files stay thin and defer here . CONTRIBUTING.md is explicitly the "shorter on-ramp," directing readers to AGENTS.md for the canonical content.
Layout pointers live in AGENTS.md: entry point (src/cli.ts), parsers (src/sources/), and the docs/ subdirectories for the API contract, serve semantics, distribution, and release operations .
Source Parser Contribution Guide#
docs/adding-a-source.md is the canonical checklist for adding a new source parser. It is structured as a top-to-bottom procedural document with privacy rules before any technical steps. CONTRIBUTING.md points contributors there: "New source parser, following Add a source" .
The guide covers:
- Privacy rules — synthetic fixtures only, aggregate shapes only, no real transcript content
- Discovery — file location resolution and sidecar exclusion (
src/ingest.ts: discover()) - Parser —
src/sources/<tool>.tsexporting a pure, print-free parser function - Tool ID — wire string added to
TOOLSinsrc/model.ts(snake_case, stored in SQLite) - Watch root — extend
watchDirs()insrc/watch.tsforservemode - Capability report — a required PR-description table declaring what token/cost data the source exposes
- Parser rules — error accumulation (never throw), unknown-record-type tracking as a format-drift sensor, normalization to
NormalizedSession, MCP tool-name normalization, one session per file - Tests — parser tests, synthetic fixtures, ingest tests, golden updates
- Definition of done —
just checkgreen plus an aggregate-only parity run against a real store
This guide is the single entry point for parser contributions, ensuring privacy rules, capability reporting, and testing standards are visible from the start.
Other docs/ Reference Files#
| File | Purpose |
|---|---|
docs/adding-a-source.md | Canonical checklist for adding a new source parser |
docs/architecture.md | Decant's module structure and data flow |
docs/analytics-methodology.md | Metric semantics and interpretation |
docs/api/openapi.yaml | Local API contract (authoritative; kept in sync with /api/openapi.json at runtime) |
docs/api/routes.md | Serve semantics |
docs/api/recipes.md | Reproducible local API query examples |
docs/data-lifecycle.md | Sync, visibility, deletion, and rebuild behavior |
docs/distribution.md | npm / installer / Docker / source distribution |
docs/logging.md | Log level and format reference |
docs/pricing.md | Model pricing reference |