Files
Dragan Spiridonov 4bd61c27b8 fix(coverage): unify coverage data flow from test execution to quality score (#385)
Coverage data never reached quality assessment because of fragmented key
conventions, fabricated fallback values, and missing --coverage flags in
test commands. This commit fixes the entire coverage data pipeline:

- Remove fabricated coverage (up to 95%) when no real data exists
- Unify 5 orphaned key conventions into consistent coverage:latest,
  coverage:previous, and coverage:file:{path} keys
- Add --coverage flags to vitest/jest test commands
- Read coverage from disk (coverage-summary.json) when not in stdout
- Store per-file coverage via memory.set() (not storeVector) so
  quality-analyzer can read it
- Rotate coverage:previous only in coverage-analyzer (canonical writer)
  to prevent double-rotation race conditions
- Fix defect-predictor and defect-investigation orphaned key reads
- Replace hardcoded fake data in coverage-tracker worker with real reads
- Use safeJsonParse and path sanitization in disk coverage reader
- Report coverage: -1 (not 0) when no data available to avoid
  false 25-point quality score penalty

Closes #385

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:28:46 +00:00
..