Documentation Process
This page documents the documentation itself: the tooling, the publish pipeline, and the discipline that keeps it from rotting.
Tooling
Section titled “Tooling”- Astro + Starlight —
the narrative site (everything in
docs-site/src/content/docs/), authored in Markdown/MDX. Mirrors the sister repoembodied-ai-architect. - Doxygen — the C++ API reference, generated from the
///comments inmath/,sdk/, andcv/headers intopublic/api/, served at<base>api/next to the prose site.
Local development
Section titled “Local development”cd docs-sitenpm install # first timenpm run gen:benchmarks # extract benchmark gates into src/data/benchmarks.jsonnpm run api # generate the Doxygen API into public/api/npm run dev # live-reloading Starlight (runs gen:benchmarks first)npm run build # production build into dist/ (runs gen:benchmarks first)npm run build:full # gen + api + build, the full local equivalent of CIgen:benchmarks runs automatically before dev and build (via the predev /
prebuild hooks). The Doxygen output (public/api/), the generated
src/data/benchmarks.json, node_modules/, dist/, and .astro/ are gitignored —
all generated, never committed.
Publishing
Section titled “Publishing”.github/workflows/deploy-docs.yml builds and deploys to GitHub Pages at
https://branes-ai.github.io/cortex/ on every push to main that touches
docs-site/** or the documented headers (math|sdk|cv/include/**). It runs
npm ci → npm run api (Doxygen) → npm run build (with DEPLOY_TARGET=github-pages)
→ actions/deploy-pages.
One-time setup (a repo admin must do this once): Settings → Pages → Build and deployment → Source = GitHub Actions. Until that is set, the workflow runs but the deploy step has nowhere to publish.
The maintenance discipline
Section titled “The maintenance discipline”Documentation stays accurate only if updating it is part of shipping code, not a separate chore:
- Per-PR docs rule. A PR that adds or changes a subsystem updates its page here (algorithm description, and any benchmark number it moves). The PR template carries a checkbox for it. This is the single most important habit — it’s why the site reflects the code instead of drifting from it.
- Single source of truth for numbers — pinned, not copied. The benchmark
gates (latency budget, EuRoC ATE gate, coverage floor) live in the code
(
FrameLatencyBudget, the EuRoC test threshold, the CI--fail-under-linesvalue).docs-site/scripts/gen-benchmarks.mjsextracts them intosrc/data/benchmarks.jsonon every build (via theprebuild/predevhooks), and the Benchmarks pages (.mdx) render from that JSON — so the gate numbers on the site cannot drift from the code, and the generator hard-fails the build if a constant is renamed. (Observed measurements like “~38 ms median” are reference numbers, not gates, and stay as labeled prose.) - Per-phase retrospective. At each epic’s close, add or finalize its
phases/phase-Npage (paired with thedocs/sessions/log and the project-memory entry). Phases 0–3 are done; Phase 4 (SLAM) gets a page when it closes. - API reference is automatic. Because Doxygen reads the headers, the C++ API page
stays current for free — the maintenance cost is keeping the header
///comments good, which review already enforces.
Adding a page
Section titled “Adding a page”- Create
docs-site/src/content/docs/<section>/<slug>.mdwithtitle+descriptionfrontmatter. - Add it to the
sidebarinastro.config.mjs(or use anautogeneratedirectory for a fast-growing section like future tutorials). - Use root-absolute internal links (
/vio/overview/); the base-path rewrite makes them resolve under/cortex/on Pages and/locally.