Skip to content

Graph: resolved mainframe call/exec edges join the dependency graph (#3237) - #3790

Merged
squid-protocol merged 2 commits into
mainfrom
feat/call-edges-graph-3237
Sep 26, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
feat/call-edges-graph-3237

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Closes #3237, implementing the approved proposal as written.

What changes

Every resolved invocation edge from invocation_resolver joins the dependency graph: a COBOL CALL (static, or resolved through a VALUE), a CICS LINK/XCTL, and a JCL EXEC PGM=. It goes in at CALL_EDGE_WEIGHT (1.0), only where no import or function call already joins the pair; that's #3333's rule. PageRank, popularity, internal_dependency_links, betweenness and blast radius now count runtime invocation for mainframe code, as they already do for every other language.

  • Scope: unresolved targets add nothing. Error-path LINKs count like any other call, since no language's graph knows which calls are error paths.
  • edge_data: unchanged in shape. The invocation rows are still written once, from the resolver's own list, and are not re-published through dependency_edges.
  • Persist the dependency graph edge list (enables neighborhood/interaction-level risk hypotheses) #2992 invariant: now "distinct neighbours over every kind == internal_dependency_links / popularity", with no carve-out. test_edge_data.py asserts it, and a new test covers the fold-in: a new edge only where nothing else joins the pair, and no double counting.
  • Docs: the invocation_resolver.py header records the decision instead of the deferral.

Before / after (six pinned corpora, main vs this branch)

corpus headline files whose degree changed
CBSA ABNDPROC popularity 0 → 23, PageRank 0.0014 → 0.0080; INQCUST 0 → 4 32
GenApp lgstsq 0 → 20; lgapol01/lgdpol01/lgipol01 0 → 4 26
CardDemo CBTRN03C 0 → 2; COMEN01C 1 → 3 43
DSF (PL/I) R0010301.pli 0 → 59; R0019906.pli 0 → 47 834
zopeneditor SAM2.cbl 0 → 2 10
zECS ZECS003 / ZECS002.asm 1 → 2 3
  • No archetype and no risk score moves on any corpus.
  • The other changes are closeness, producer ratio and ecosystem role on the same mainframe files, plus PageRank everywhere (it's normalized over the whole graph).
  • One cross-language change: two CBSA Java REST resources (CompanyNameResource, SortCodeResource) gain an edge to the COBOL program they CICS-LINK (GETCOMPY, GETSCODE). The engine already extracted these call sites; they now count like any other LINK.

Golden masters: re-blessed, both modes (scoped review)

205 leaf changes in each fixture:

  • Per-file, mainframe: 54 files × Popularity Rank and Direct Downstream, plus Composition Fit (Z-Score) on 65 mainframe files.
  • Outside mainframe: only Composition Fit (Z-Score), on 13 files, by at most 0.031 (e.g. doom m_fixed.h 0.476 → 0.445). That's a shift in the population statistic, not a change to those files.
  • Summary sections: the network macros (modularity, articulation points, assortativity, cyclic density, average path length), the repo composition z, and the PageRank scores of the undocumented-critical-path list. The same files remain in that list.

Checks

  • ground_truth_ledger.py check: ledger clean. Nothing moved, and no new defect to log in field_testing.json.
  • rosetta_audit.py (head vs main, both through shims so each checkout's own engine ran): exit 0. Every failure is pre-existing drift, none new, so no rosetta:rebless-owed.
  • tests/tools_recorders/test_edge_data.py: 9 passed.

Follow-up

Porting tickets in port order (most-depended-on programs first) landed separately, after this merged.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

squid-protocol and others added 2 commits September 26, 2026 15:04
…3237)

The approved #3237 proposal: every RESOLVED invocation edge from
invocation_resolver (COBOL CALL, CICS LINK/XCTL, JCL EXEC PGM=) joins the
dependency graph at CALL_EDGE_WEIGHT wherever no import or function call
already joins the pair -- the #3333 rule -- so pagerank, popularity,
internal_dependency_links, betweenness and blast radius count runtime
invocation for mainframe code as they do for every other language.
Unresolved targets add nothing; error-path LINKs count like any call.

- NetworkRiskSensor.build_dependency_graph takes `invocation_edges`; they are
  not re-published on dependency_edges, since the recorder writes every
  invocation edge from the resolver's own list (one edge_data row per kind).
- galaxyscope resolves invocations before the graph build (full and delta).
- #2992's reconciliation is now "distinct neighbours over every kind ==
  internal_dependency_links / popularity" (test_edge_data.py, + a fold-in test).
- invocation_resolver.py's header records the decision, not the deferral.

Before/after (six pinned corpora): CBSA ABNDPROC popularity 0 -> 23, genapp
lgstsq 0 -> 20, DSF R0010301.pli 0 -> 59; no archetype or risk score moves.
Golden masters re-blessed (both modes): popularity / direct downstream on 54
mainframe files, their composition z, the network macros; outside mainframe
only Composition Fit (Z-Score), 13 files, max 0.031 (population shift).
Ground-truth ledger clean; rosetta audit: no new failure.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
function_call_graph.md documents the 'call'/'exec' edge_data rows as graph edges
(the fcall rule, distinct-neighbour reconciliation); the differential's dated
#3200 entry gets a since-#3237 note rather than a rewrite.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 36e6f14 into main Sep 26, 2026
31 checks passed
@squid-protocol
squid-protocol deleted the feat/call-edges-graph-3237 branch September 26, 2026 19:11
@squid-protocol squid-protocol changed the title Graph: resolved mainframe call/exec edges join the dependency graph (#3237) Graph: mainframe call/exec edges join the dependency graph; porting tickets in port order (#3237) Sep 26, 2026
@squid-protocol squid-protocol changed the title Graph: mainframe call/exec edges join the dependency graph; porting tickets in port order (#3237) Graph: resolved mainframe call/exec edges join the dependency graph (#3237) Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decide whether call/exec edges should feed the dependency graph (pagerank, popularity, blast radius)

1 participant