fix(dataflow): connect the L4 SDG port layer to the statement ddg - #116
Merged
Conversation
The SDG assembler wires the binding edges — def stmt → actual_in, actual_out → callsite, formal_in → first use, return → formal_out — into the IR's extra_edges, and the old v1 program_graphs projection emitted them; the v2 emission dropped them, leaving the port lattice an island no end-to-end flows_to walk could cross. emit_l4 now emits the DDG-typed extra edges onto each callable's ddg tagged prov=['reaching-defs'] (the label codeanalyzer-typescript ships for its port-routing edges, keeping the prov vocabulary keystone-shared), deduplicated, deterministically ordered, endpoint-guarded, and idempotent under cache reuse. CDG-typed extras stay unemitted — actual vertices already carry that containment in parent. Nested call vertices (y = f(x)) are likewise anchored: from L3 they carry parent = the enclosing statement's local id, a sanctioned null → value refinement at L2→L3 mirroring callee null → id at L1→L2. Bare-call statements share their key with the CFG node and are untouched. Conformance now admits the third L4 prov value; both decisions are recorded in .claude/SCHEMA_DECISIONS.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #115.
Part 1 — port wiring. The SDG assembler builds the statement ↔ port binding edges (
def stmt → actual_in,actual_out → callsite,formal_in → first use,return → formal_out) into the IR'sextra_edges, and the old v1program_graphsprojection emitted them — the v2 emission dropped them, so the port lattice was an island and no end-to-endflows_towalk could cross a call.emit_l4now emits them on each callable'sddgwithprov:["reaching-defs"]— the label codeanalyzer-typescript already ships, keeping the prov vocabulary keystone-shared (ssa= L3 syntactic,points-to= L4 alias delta,reaching-defs= L4 port bindings). Deduplicated, deterministic, endpoint-guarded, idempotent under cache reuse; strictly additive soL3 ⊆ L4holds.Part 2 — call anchoring. Nested call vertices (
y = f(x)) stay off the CFG spine by design (dataflow satellites); from L3 they carryparent= the enclosing statement's local — the same anchoringactual_in/actual_outuse. Sanctionednull → valuerefinement at L2→L3 (mirrorscallee: null → id); bare-call statements share their key with the CFG node and are untouched. Both decisions recorded in.claude/SCHEMA_DECISIONS.md.Tests: 9 new regression tests (
test/test_v2_l4_ports.py) covering all four binding classes, additivity vs the ssa set, endpoint hygiene, idempotency, and both parent cases; the conformance validator's L4 prov set gainsreaching-defs.Gate: full suite green — 198 passed, 6 skipped in 6m13s.
Propagation: same bug (3 of 4 classes) filed against the TS analyzer as codellm-devkit/codeanalyzer-typescript#81; python-sdk pin bump +
py-a4.jsongolden regeneration tracked via codellm-devkit/python-sdk#276.