The coverage feedback loop is a synthetic, deterministic regression harness for Gaze recognizer coverage. It exists for axes 1 and 4: reliability and trust.
It does not train models, does not call an LLM, and does not expand production rulepacks by itself. It measures the current rule floor against a committed oracle so rule gaps can be fixed deliberately.
The loop is:
xtask templates + generators
-> committed corpus fixtures
-> core + core-extended pipeline
-> emitted manifest
-> labels.json span diff
-> coverage-report.md/json
-> baseline trend gate
The oracle is the committed labels.json span set under
crates/gaze-recognizers/testdata/coverage-loop/corpus/. Each span records byte
boundaries, audit-form class id, generator id, generator seed, and
license_origin.
The test classifies each labeled span:
Covered: manifest has same-class coverage for the full label span.Uncovered: no manifest span overlaps the label span.PartialBleed: same-class overlap exists but does not cover the full label.ClassMismatch: overlap exists, but with a different class.
Trend gating only compares Uncovered: current must be less than or equal to
baseline for each (class_id, locale) bucket. PartialBleed and
ClassMismatch remain reported but not gated because they usually require
separate class-priority or resolver analysis.
All fixtures are synthetic. Current accepted origin:
synthetic-rust-generator
Deferred origin:
synthetic-vendored-kiji
Kiji snippets are intentionally out of this PR. Any future vendored snippet work
must extend the origin enum, document provenance, and keep fixture bytes out of
production src/ paths.
The ignored integration test is:
cargo test -p gaze-recognizers --test coverage_loop -- --ignored --nocaptureDefault mode is informational. GAZE_COVERAGE_LOOP_INFO_ONLY unset or set to
1 prints and writes the report without failing on baseline regressions.
Blocking mode:
GAZE_COVERAGE_LOOP_INFO_ONLY=0 cargo test -p gaze-recognizers --test coverage_loop -- --ignored --nocaptureBlocking mode loads
crates/gaze-recognizers/testdata/coverage-loop/baseline.json and fails if any
current Uncovered count exceeds baseline for the same class and locale.
- Add a generator under
crates/xtask/src/coverage_corpus/generators/. - Register it in
GeneratorRegistry::default_phase_1(). - Add a cheap unit test over at least 100 seeds.
- Add templates under
crates/xtask/src/coverage_corpus/templates/<context>/. - Include the templates in
templates/mod.rs. - Regenerate with
cargo run -p xtask -- coverage-corpus --regenerate --seed 0. - Run the ignored coverage-loop test and inspect
target/coverage-report.md. - Commit the corpus and update
baseline.jsononly after deciding the current leak set is the accepted baseline.
This loop complements existing gates rather than replacing them:
fixture-citation-lintprotects production source from uncited fixture-like literals.bundle-tokenization-driftguards recognizer bundle activation drift.- Safety-net tests guard leak-report correlation and fail-closed behavior.
The coverage loop is narrower: committed synthetic labels versus emitted manifest spans.