fix(coverage): count coverage gaps by one shared rule - #83
Merged
Conversation
The snapshot receipt classified a service as a coverage gap whenever it had any unresolved outbound call site, while coverage_report and the coverage explainer both required outbound == 0 — no resolved edges at all. Since unresolved is derived as detected - resolved - external, every healthy client service has some, so the receipt's metric saturated: it equalled services_total on healthy input and could not signal ill health. llm_context.md prints that number behind a warning sign, so the file an agent reads without a tool call carried the inflated count. Hoist the rule into facts.ClassifyService, with facts.DependsOnCount replacing the two duplicate outbound counters. coverageSummary, buildCoverageReport and the coverage explainer now all classify through it, so they cannot drift apart again. Also decouple UnresolvedEdges from the gap condition — it accumulates for every service, gapped or not. On a four-service multi-repo snapshot the receipt now agrees with coverage_report; unresolved_edges is unchanged. facts.jsonl and insights.json are byte-identical across the change. No cacheVersion bump: coverageSummary feeds receipt.json only (via both engine.go and global_receipt.go), no extractor output changes, and TestGolden passes without -update. The existing svcCoverage test helper attaches no relations, so every fixture had outbound == 0 and TestCoverageSummary_ExternalBucket returned the same answer under either rule. Add the case that distinguishes them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The snapshot receipt classified a service as a coverage gap whenever it had any unresolved outbound call site, while coverage_report and the coverage explainer both required outbound == 0 — no resolved edges at all. Since unresolved is derived as detected - resolved - external, every healthy client service has some, so the receipt's metric saturated: it equalled services_total on healthy input and could not signal ill health. llm_context.md prints that number behind a warning sign, so the file an agent reads without a tool call carried the inflated count.
Hoist the rule into facts.ClassifyService, with facts.DependsOnCount replacing the two duplicate outbound counters. coverageSummary, buildCoverageReport and the coverage explainer now all classify through it, so they cannot drift apart again. Also decouple UnresolvedEdges from the gap condition — it accumulates for every service, gapped or not.
On a four-service multi-repo snapshot the receipt now agrees with coverage_report; unresolved_edges is unchanged. facts.jsonl and insights.json are byte-identical across the change.
No cacheVersion bump: coverageSummary feeds receipt.json only (via both engine.go and global_receipt.go), no extractor output changes, and TestGolden passes without -update.
The existing svcCoverage test helper attaches no relations, so every fixture had outbound == 0 and TestCoverageSummary_ExternalBucket returned the same answer under either rule. Add the case that distinguishes them.