Skip to content

Commit 26301bb

Browse files
committed
test(depgraph): compare CLI reachability counts and clarify edges
1 parent 1a85e11 commit 26301bb

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎scripts/depgraph/README.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ Two fields keep an empty or short list from reading as "nothing else is affected
3030
`dependents` keeps its value-only meaning; `beyondValue` lists the files that only a dynamic
3131
import connects. Type-only edges stay out of both.
3232
- `commandAttribution` marks every `commands` and `liveOwners` list as `partial`, with reason
33-
`injected-calls-not-modeled`. These lists follow static import paths. Calls through injected
33+
`injected-calls-not-modeled`. These lists follow value and dynamic import edges. Calls through injected
3434
functions can reach code without an import path from a command handler. An empty list means no
3535
handler import path was found; other commands may still depend on the file.
3636

3737
Use these lists as lower bounds when you plan a change. They do not identify removable imports,
38-
prove test coverage, or name the missing commands. `gates` is unchanged and still selected from
39-
the value dependents.
38+
prove test coverage, or name the missing commands. `gates` comes from the value dependents only.
4039

4140
## When to reach for this
4241

‎scripts/depgraph/affected-run.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export function formatBlastRadius(radius: BlastRadius, limit: number): string {
272272
` run: pnpm check:affected --run`,
273273
`public commands whose handler chain reaches it (${radius.commands.length}): ` +
274274
formatBounded(bound(radius.commands, limit), (chain) => `${chain.command} (${chain.route})`),
275-
' attribution: PARTIAL — static import reachability only; injected calls are not modeled, so command and live-owner lists are lower bounds',
275+
' attribution: PARTIAL — import reachability (value + dynamic) only; injected calls are not modeled, so command and live-owner lists are lower bounds',
276276
];
277277

278278
if (!radius.liveOwners.present) {

‎scripts/depgraph/affected.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,16 @@ test('text and JSON CLI output agree on partial attribution and bounded dynamic
338338
assert.ok(
339339
text.includes(`public commands whose handler chain reaches it (${json.commands.length}):`),
340340
);
341+
assert.ok(
342+
text.includes(
343+
`dependents: ${json.dependents.direct.length} direct, ${json.dependents.transitive.length} transitive`,
344+
),
345+
);
346+
assert.ok(
347+
text.includes(
348+
`executable dependents (value + dynamic edges): ${json.executableDependents.direct.length} direct, ${json.executableDependents.transitive.length} transitive;`,
349+
),
350+
);
341351
const dynamic = json.executableDependents.beyondValue;
342352
assert.ok(dynamic.length > 2, 'the platform route must exercise CLI truncation');
343353
assert.ok(

0 commit comments

Comments
 (0)