feat(scripts): blast-radius query — dependents, owning gates, live-coverage owners (#1425) - #1470
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Size Report
Startup median (7 runs, lower is better):
Top changed chunks: no changes in the largest emitted chunks. |
|
P1 — the documented --limit 25 form is broken. parseInvocation splits args by whether they start with a dash, so the value 25 becomes a second positional while parseScriptArgs receives --limit with no value. The common invocation depgraph affected path --json --limit 25 therefore fails before it can render bounded output. Preserve flag/value association when parsing argv and add CLI coverage for --limit 25 in both supported orderings. |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Correct, and broken exactly as described. Fixed in 61488f7: |
|
Re-reviewed at 61488f7. The --limit regression is fixed: option values stay attached whether flags come before or after , and --limit=25 is covered. The parser now also covers invalid limits and multiple/missing paths. I ran the targeted exact-head commands with bounded output in both flag orders; all lists remained bounded and disclosed hidden entries. GitHub checks are green. Ready for human review. |
Summary
Closes #1425 (Track C, #1412). "Who depends on this and which tests own it" was four lookups
(depgraph, check-affected, iOS coverage manifest, ADR 0011 matrix); it is now one, and every part
of the answer is read from the existing source of truth rather than a second copy of it.
pnpm depgraph affected src/utils/exec.ts # bounded text, ~0.5s pnpm depgraph affected src/daemon/ref-frame.ts --json --limit 25Wiring, and the judgement calls that are not obvious from the code:
scripts/depgraph/model.ts's value edges.Type-only and dynamic dependents are excluded from the counts (a type-only edge is free at
runtime) but reported separately as
weakDirect, because a pure vocabulary module(
src/contracts/*) otherwise prints "0 dependents", which is the opposite of true.selectChecks({ changedFiles: [file, ...dependents.all] }), i.e. check-affected'sown model. The two cannot contradict each other by construction; the cross-check below confirms
it on real diffs.
src/daemon/request-handler-chain.ts(parseRouteEntries) and joined withDAEMON_COMMAND_DESCRIPTORS×PUBLIC_COMMANDS; the chain closure follows value and dynamicedges, because every handler is loaded through
import(). A route the table stops declaringthrows and names the file to fix — a silently empty command list would read as "nothing owns
this".
IOS_SIMULATOR_E2E_COVERAGEis consumed through the narrowestshape this lane needs (command → level/owner/assertion), loaded only if the manifest exists. It
is not in main yet, so the query says so instead of implying no live coverage; verified against
the test(ios): expand simulator e2e coverage #1408 branch's manifest, where the same run reports 49 owners for
ref-frame.ts.viamodule path equals the file (prosedelegatedcells name no module by construction).
src/selectors/resolve.ts→ 5 rows across three paths.Bounded by default (
--limit, default 10, every list discloses+N more);--jsonis unbounded.scripts/depgraph/load.tsis the now-shared graph read used by both the report and the query.CI scope
No CI work added. The only gate change is that
depgraph:testalso runsscripts/depgraph/affected.test.tsinside the existingLayering Guardjob: +0.7s(
depgraph:test0.24s → 0.95s locally, 20 tests). No new workflow, job, permission, or lane.Validation
pnpm format:check && pnpm lint && pnpm typecheck— cleanpnpm test:unit(524 files / 4671 tests),pnpm check:layering,pnpm test:output-economy,pnpm check:fallow,pnpm depgraph:test— all greensrc/utils/exec.ts0.53s,src/daemon/ref-frame.ts0.5s wall clock (budget10s); asserted in-test at <10s.
Cross-check against
check:affected(no contradictions)For each sample diff:
selectChecksover that diff's production files vs. the union of the blastradius gate plans for the same files. Blast radius may be wider (it also plans for dependents);
it must never be narrower.
check:affected(prod files)depgraph affectedunioncoverage,provider-integrationThe fourth diff is the informative one: dependents of the moved contracts reach
src/platforms/**,so the blast radius correctly adds the two platform-owned gates that a file-local plan misses.
Scope
One issue per PR: nothing from #1423 (repo-health snapshot) or #1424 (delta comment) is
implemented here, and #1408's manifest is consumed, not vendored.
Link to Devin session: https://app.devin.ai/sessions/0d8e3e21666746dd828556a1c4646008
Requested by: @thymikee