Replace fixed canonical coverage directories with config-first, analyzer-aware coverage roots
codira currently hard-codes canonical coverage directories as src/, tests/, and scripts/. This is reasonable for many Python repositories, but it is biased toward Python-style layouts and does not
generalize well to Rust, Go, C/C++, JS/TS, mixed-language repositories, or monorepos.
Today there are effectively two different discovery models:
- indexing scope is analyzer-driven via analyzer discovery globs
- coverage scope is hard-coded to
src/tests/scripts
This mismatch makes indexing flexible, but keeps coverage policy tied to a Python-centric layout.
Problem
A repository can be fully indexable by active analyzers while still being treated as non-canonical for coverage purposes simply because its sources live outside src/, tests/, or scripts/.
Examples:
- Rust:
src/, examples/, benches/
- C/C++:
src/, include/, tests/
- Go: packages often live at module root or under custom directories
- monorepos: multiple package roots, not one shared top-level convention
Proposed direction
Adopt a hybrid coverage-root strategy:
- If codira project config declares coverage roots, use that as the source of truth.
- Otherwise, fall back to analyzer-defined default coverage roots.
- For multi-language repos, take the deterministic union of active analyzer defaults.
- Keep build-file inference advisory only; do not silently make it authoritative.
Why
This keeps behavior deterministic and explicit while removing the current Python-centric hard-code.
It also clarifies semantics:
- indexable = analyzers know how to claim the file
- canonical/coverage-required = the project or analyzer defaults explicitly say this path should be covered
Expected changes
- replace fixed
CANONICAL_SOURCE_DIRS coverage policy with config-first resolution
- add analyzer metadata for default coverage roots
- expose resolved coverage roots in CLI JSON output
- preserve deterministic ordering and current strict coverage behavior
- keep uncovered-file auditing, but over resolved coverage roots rather than a fixed tuple
Non-goals
- no fuzzy “guess likely source dirs by name” behavior
- no broad filesystem heuristics replacing explicit policy
Acceptance criteria
- repos can explicitly configure coverage roots
- repos without config use analyzer defaults
- mixed-language repos get deterministic union behavior
codira cov and codira index --require-full-coverage operate on resolved coverage roots
- existing deterministic reporting remains stable
Replace fixed canonical coverage directories with config-first, analyzer-aware coverage roots
codiracurrently hard-codes canonical coverage directories assrc/,tests/, andscripts/. This is reasonable for many Python repositories, but it is biased toward Python-style layouts and does notgeneralize well to Rust, Go, C/C++, JS/TS, mixed-language repositories, or monorepos.
Today there are effectively two different discovery models:
src/tests/scriptsThis mismatch makes indexing flexible, but keeps coverage policy tied to a Python-centric layout.
Problem
A repository can be fully indexable by active analyzers while still being treated as non-canonical for coverage purposes simply because its sources live outside
src/,tests/, orscripts/.Examples:
src/,examples/,benches/src/,include/,tests/Proposed direction
Adopt a hybrid coverage-root strategy:
Why
This keeps behavior deterministic and explicit while removing the current Python-centric hard-code.
It also clarifies semantics:
Expected changes
CANONICAL_SOURCE_DIRScoverage policy with config-first resolutionNon-goals
Acceptance criteria
codira covandcodira index --require-full-coverageoperate on resolved coverage roots