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(llmcontext): report unresolved/external edges, and stop truncating the quality preface (#87)
The Extraction Quality block guarded the unresolved-edge count on
CoverageGaps > 0, so a snapshot with zero gaps and many unresolved
outbound call sites reported neither. Gaps, unresolved edges and
external edges are independent signals and now render under independent
guards. External edges are reported without a warning and excluded from
the "extraction limits" footer — a hardcoded third-party host is
expected, not a blind spot.
Render() also broke out of the section loop on the first section to
overrun the token budget, and Repository Map emits one uncapped row per
module. On a multi-repo snapshot the map consumed the whole budget and
the Extraction Quality preface was dropped entirely, from exactly the
snapshots whose extraction is least complete. Sections can now reserve
budget ahead of layout; reserving buys survival, not precedence.
Rewriting that loop exposed a third bug: the cut sliced bytes, not
runes, so truncation could emit invalid UTF-8. cutAt backs the cut off
to the nearest rune boundary.
Renderer-only — facts.jsonl and insights.json are byte-identical across
the change, so no cacheVersion bump and no golden regeneration. Adds the
first tests for the Extraction Quality block and for truncation.
// Nothing meaningful to report on an old/auto-loaded snapshot with no receipt.
@@ -589,12 +629,27 @@ func (r *LLMContextRenderer) renderExtractionQuality(snapshot *facts.Snapshot) s
589
629
sb.WriteString("- Parse errors: 0\n")
590
630
}
591
631
592
-
ifm.Coverage!=nil&&m.Coverage.CoverageGaps>0 {
593
-
fmt.Fprintf(&sb, "- ⚠️ Cross-repo coverage gaps: **%d** service(s), %d unresolved outbound edge(s) — some links could not be resolved to a loaded repo\n",
// Gaps and unresolved edges are independent: a connected service has resolved an
633
+
// outbound edge by definition, yet may still have call sites that resolved to no
634
+
// loaded repo. Guarding the count on the gap total hid it on exactly the healthy
635
+
// multi-repo snapshot an agent is most likely to trust. External edges are a third
636
+
// signal — expected, not a blind spot — so they are reported without a warning.
637
+
ifm.Coverage!=nil {
638
+
ifm.Coverage.CoverageGaps>0 {
639
+
fmt.Fprintf(&sb, "- ⚠️ Cross-repo coverage gaps: **%d** service(s) with no resolved outbound edges — their outbound links could not be resolved to a loaded repo\n",
640
+
m.Coverage.CoverageGaps)
641
+
}
642
+
ifm.Coverage.UnresolvedEdges>0 {
643
+
fmt.Fprintf(&sb, "- ⚠️ Unresolved outbound edges: **%d** — call site(s) that did not resolve to a loaded repo (an unloaded repo, or an extractor blind spot)\n",
644
+
m.Coverage.UnresolvedEdges)
645
+
}
646
+
ifm.Coverage.ExternalEdges>0 {
647
+
fmt.Fprintf(&sb, "- Outbound edges to external hosts: **%d** — third-party APIs, expected (not a coverage blind spot)\n",
sb.WriteString("\n_These are extraction limits, not code defects — verify against source, and consider whether an extractor, detection, or ignore glob needs improving._\n")
0 commit comments