Skip to content

docs: add per-package module maps and fix three stale facts#33

Merged
sturlese merged 1 commit into
mainfrom
docs/module-maps
Jul 18, 2026
Merged

docs: add per-package module maps and fix three stale facts#33
sturlese merged 1 commit into
mainfrom
docs/module-maps

Conversation

@sturlese

Copy link
Copy Markdown
Owner

Summary

docs/ explains how the system works; what was missing was the code map — where things live, what to reuse, what not to do — sitting next to the code. This adds an index.md to every package (nine: the pipeline stack + its five packages, answer, evals, benchmark), indexed from docs/README.md. Written by the documentator agent; every factual claim in this PR was verified against the code before merging.

Changes

  • Nine module maps, each covering: purpose · entry points · module map · use these (the shared primitives, so the next contributor doesn't write a second one) · anti-patterns with the ADR that motivates them · data contracts · tests · common-tasks table.
  • Three factual drifts between docs and code, fixed (the repo's own rule: when they disagree, the code wins — then fix the doc):
    • README claimed ~390 tests; the suite is 421 (fetch 29, clean 248, corpus 48, graph 38, slack 13, answer 42, benchmark 3) → ~420.
    • docs/architecture.md's stage table omitted slack, though the README and docs/pipeline/slack.md both cover it.
    • The README's "5 minutes" table displayed paths like clean/src/verify.py that don't exist — the hrefs were correct, the visible text wasn't, so anyone copying them got nothing.
  • One non-obvious behavior now recorded: the golden scorecard is 24 metrics offline but 23 with a live modeleval_clean_and_trust swaps its two seeded-defect metrics for one when CLEAN_LLM isn't fake-flawed, since there's nothing seeded to catch. Whoever first evals a real model would otherwise think a metric vanished.

Testing

Docs only — no code touched. Claims spot-verified against the source: the make evalrun-evals.shevals/.venv chain, service.refresh() being called per ask_brain/search_brain request, index.superseded_paths existing, and the per-package test counts (run locally, all suites green).

Notes

Deliberately not done, flagged for your call:

  • A root CLAUDE.md — the biggest remaining gap for agent onboarding (package layout, make targets, per-package venvs, the bare-pytest pythonpath gotcha, single-writer-per-artifact, never read .env). It's agent configuration rather than project documentation, so it shouldn't land without you deciding you want it.
  • make test-pkg PKG=... shortcut target — a Makefile change, not a docs one.
  • Documenting the facts.db schema in one place — currently implicit in clean/factstore.py and re-read by answer/metrics.py, with parity enforced only by eval_contract_parity.

The docs/ tree explains how the system works; what was missing was the
code map — where things live, what to reuse, what not to do — next to
the code itself. Adds an index.md to every package (nine: the pipeline
stack and its five packages, answer, evals, benchmark), indexed from
docs/README.md.

Each map covers: purpose, entry points, module map, "use these"
(the shared primitives, so the next contributor doesn't write a second
one), anti-patterns with the ADR that motivates them, data contracts,
where the tests are, and a common-tasks table.

Three factual drifts between docs and code, fixed:
- README claimed ~390 tests; the suite is 421 (fetch 29, clean 248,
  corpus 48, graph 38, slack 13, answer 42, benchmark 3) -> ~420.
- docs/architecture.md's stage table omitted slack, though the README
  and docs/pipeline/slack.md both cover it.
- The README's "5 minutes" table displayed paths like
  `clean/src/verify.py` that do not exist (the hrefs were right, the
  visible text wasn't) — a reader copying them gets nothing.

Also recorded, because it will bite whoever first evals a real model:
the golden scorecard is 24 metrics offline but 23 with a live backend —
eval_clean_and_trust swaps its two seeded-defect metrics for one when
CLEAN_LLM is not fake-flawed, since there is nothing seeded to catch.

Docs only; no code touched.
@sturlese
sturlese merged commit 3da5198 into main Jul 18, 2026
10 checks passed
@sturlese
sturlese deleted the docs/module-maps branch July 18, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant