ir.coverage¶
Corpus-coverage diagnostic — what’s on disk vs. what’s actually indexed.
Retrieval can only return what was indexed, and an ingestion gap is silent:
a whole folder of reports can be missing from the index with no error (a
non-recursive glob once dropped every doc in a research/ / decisions/
subtree — 29% of the corpus — invisibly). Back-translation evals cannot catch
this: their gold is drawn from what is already indexed, so an un-indexed doc
can never lower a metric. Coverage therefore needs its own check.
reports_coverage() independently walks the reports doc-trees on disk
(the raw */*/docs and */*/misc/docs files, before any filtering),
classifies each file with the same inclusion SSOT the ingestion walk uses
(ir.sources.report_exclude_reason()), and diffs the should-be-indexed
set against the built corpus’s ledger — surfacing exactly the on-disk-but-absent
reports that a search would silently miss.
Functions
|
Diff the reports docs tree on disk against the built |
Classes
|
Disk-vs-index coverage for a filesystem-backed corpus. |
- class ir.coverage.CoverageReport(name, on_disk, indexed, excluded, missing=<factory>)[source]¶
Bases:
objectDisk-vs-index coverage for a filesystem-backed corpus.
- ir.coverage.reports_coverage(name='reports', *, projects_root=None, indexed_ids=None, exclude_dirs=frozenset({'.git', '.hg', '.ipynb_checkpoints', '.obsidian', '.svn', '.tox', '.venv', '__pycache__', 'build', 'dist', 'node_modules', 'site-packages', 'venv'}))[source]¶
Diff the reports docs tree on disk against the built
namecorpus.Walks every
*/*/docsand*/*/misc/docsfolder recursively (raw, no filtering), classifies each*.mdwith the shared inclusion SSOT, and reports how many includable reports are indexed vs. silently missing. Acoverage_ratiobelow 1.0 means on-disk reports are absent from the index — rebuild withir build <name>.indexed_ids(the built corpus’s artifact ids) is read from the registerednamecorpus by default; pass it explicitly (withprojects_root) to diff an arbitrary tree against an arbitrary index without opening a corpus.- Return type: