From aa5edf12ab84af90e2b69335be4e10be8a5f33ee Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Sun, 14 Jun 2026 15:41:34 +0000 Subject: [PATCH] fix(cfg): surface skippedUnsoundFunctions in per-language stats (#2195 U2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit emitFileCdg computes skippedUnsoundFunctions (functions whose CDG is withheld because EXIT isn't reverse-reachable from all blocks) but run.ts dropped it on the floor — only cdgEdges/cdgDropped were aggregated. Add the aggregation + a stats-line segment so CDG coverage gaps are an explicit signal, not silent. Establishes the baseline skip count that makes the U1 synthetic-escape pass's effect (the drop to genuine anomalies only) measurable. Additive; no emit-logic change. The emit-side field is covered by cfg-emit.test.ts (asserts skippedUnsoundFunctions===1 + the warn on a disconnected-block CFG); the run.ts aggregation is a thin pass-through. Co-Authored-By: Claude Opus 4.8 (1M context) --- gitnexus/src/core/ingestion/scope-resolution/pipeline/run.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gitnexus/src/core/ingestion/scope-resolution/pipeline/run.ts b/gitnexus/src/core/ingestion/scope-resolution/pipeline/run.ts index 733f76be3..df768c4d8 100644 --- a/gitnexus/src/core/ingestion/scope-resolution/pipeline/run.ts +++ b/gitnexus/src/core/ingestion/scope-resolution/pipeline/run.ts @@ -778,6 +778,7 @@ export function runScopeResolution( let rdTruncated = 0; let cdgEdges = 0; let cdgDropped = 0; + let cdgSkippedUnsound = 0; // ── M3 taint setup (#2083 U4) ──────────────────────────────────────── // Explicit model-registration seam (idempotent, cheap) — the registry // stays empty on non-pdg runs, preserving default-run parity. The @@ -899,6 +900,7 @@ export function runScopeResolution( if (PROF) pdgMs += performance.now() - tCdg; cdgEdges += cdg.edges; cdgDropped += cdg.droppedEdges; + cdgSkippedUnsound += cdg.skippedUnsoundFunctions; // M3 (#2083 U4): taint over the SAME validated CFGs, inside the SAME // per-file try (a taint throw costs this file's taint layer only — @@ -975,6 +977,9 @@ export function runScopeResolution( (rdTruncated > 0 ? `, ${rdTruncated} function(s) hit the fact limit` : '') + `; ${cdgEdges} CDG edges` + (cdgDropped > 0 ? `, ${cdgDropped} CDG edges dropped (per-function cap)` : '') + + (cdgSkippedUnsound > 0 + ? `, ${cdgSkippedUnsound} function(s) CDG-skipped (EXIT not reachable from all blocks)` + : '') + // M3 volume telemetry — only for languages with a registered model. (taintSpec !== undefined ? `; taint: ${taintTotals.findings} TAINTED, ${taintTotals.kills} SANITIZES ` +