Codocia

Documentation that keeps up with fast-moving code.

docs/01-overview.md

Codocia is a notebook, not a writer: it never calls a model. An agent reads the code, answers one question per note, and cites the lines that prove it. Codocia does the parts a model is bad at keeping straight: it pins each citation to a hash, measures budgets and coverage, checks translations and compiles the notes into Markdown. Before commit a7f45d2 Codocia needed a model; since then the agent writes and Codocia only verifies.

Sources:

book.rs:1-6
//! Agent notebook: a source-grounded store of notes that compiles into a
//! small, readable documentation set.
//!
//! Codocia never calls a model. An agent reads the repository, records what
//! it learned as notes with evidence, and Codocia pins that evidence, tracks
//! coverage and budgets, and compiles the notes into Markdown.
Codocia's own docs, built with Codocia. codocia check flags this paragraph if the cited lines change.

Agents write source-grounded docs; Codocia pins the evidence and maps the code. It never calls a model itself. Every paragraph cites the exact line ranges and commits it describes, Codocia compiles the notes into a concise documentation book with a map of the code structure, and codocia check flags any page whose cited code has changed.

Install

  • Homebrew brew install lhwzds/tap/codocia
  • Cargo cargo install codocia
  • npm npm install -g codocia

What it does

  • Evidence pins: claims cite file line ranges and commits, so a reader can check each one.
  • A generated map of the code structure next to the written chapters.
  • codocia check reports pages whose cited lines changed since they were written.
  • Bilingual docs without drift: each translation is pinned to its English source, and check fails when the source changes.
codocia
cat main.rs
fn main() {
    let retries = 5;
    println!("retry {retries} times");
}
codocia init
created book at ~/demo/.codocia for ~/demo @ 2f73540d9d
next: edit book.md (pages, ignore), then run `codocia status`
codocia note add --page overview --id retries --title Retries -e main.rs:2-3 --body 'A request is tried `retries` = 5 times.'
saved overview/retries (7 words; page 7/900)
  main.rs:2-3 (2 lines) | let retries = 5;
codocia check
0 error(s), 0 warning(s)
sed -i.bak 's/= 5/= 3/' main.rs && rm main.rs.bak
codocia check
error: overview/retries: code changed under main.rs:2-3 #68809ccc433c; review the note, then `codocia accept overview/retries`
1 error(s), 0 warning(s)
Error: check failed with 1 error(s)
Real session with codocia 0.2.0; output unedited except for redacted local paths