You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(coverage): count coverage gaps by one shared rule
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.
Copy file name to clipboardExpand all lines: internal/facts/model.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -231,7 +231,7 @@ type ParseError struct {
231
231
// without the consumer running coverage_report.
232
232
typeCoverageSummarystruct {
233
233
ServicesTotalint`json:"services_total"`
234
-
CoverageGapsint`json:"coverage_gaps"`// services with unresolved (internal) outbound call sites
234
+
CoverageGapsint`json:"coverage_gaps"`// services classified ServiceCoverageGap: no resolved outbound edge, yet unresolved call sites were detected. A service that resolved some edges is partially covered, not a gap
235
235
UnresolvedEdgesint`json:"unresolved_edges"`// detected outbound edges that did not resolve to a loaded service (internal blind spots; excludes external)
236
236
ExternalEdgesint`json:"external_edges,omitempty"`// detected outbound edges to hardcoded external hosts (third-party APIs) — expected, not a blind spot
0 commit comments