Repository navigation
fix(cobol): link both endpoints of a PERFORM ... THRU range - #3814
abhay-codes07 wants to merge 1 commit into
Conversation
`PERFORM A THRU Z` (and `THROUGH`) runs the whole paragraph range A..Z, but the PERFORM pattern captured only the first name, so a `calls` edge was emitted to A and the range-end Z got none. "What performs Z?" then answered nothing even though this paragraph does, and any reachability walk stopped short of the range's tail. Capture the optional `THRU`/`THROUGH` target and enqueue both endpoints for resolution against the paragraph table. Intermediate paragraphs in the range are not individually linked (that would need paragraph source ordering); the two endpoints are the reliable, common signal and both now resolve. A plain `PERFORM A` is unchanged. Regression test: `PERFORM A-PARA THRU Z-PARA` now links MAIN to both A-PARA and Z-PARA (fails on the old single-capture pattern). Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01JJbLfztSxm2tH5cJwBbe9q
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
Links both endpoints of a PERFORM A THRU Z range as calls edges by extending _PERFORM to capture the optional THRU/THROUGH target and emitting a pending perform for each non-modifier endpoint. Previously only the entry paragraph was linked, so the range-end had no inbound edge; intermediate paragraphs in the range remain unlinked since that would require source ordering.
No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 19 functions depend on the 19 functions this change touches.
Health — this change adds coupling hotspots:
- new:
extract_cobol()— 2 callers, 7 callees
Verification — 19 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 19 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
300 of 300 test file(s) selected (100%) via static blast radius.
Escalated to a full run for safety — the selection is not trustworthy on its own (see below). CI should run the whole suite.
tests/test_affected_cli.py— full-run-safetytests/test_affected_member_seed.py— full-run-safetytests/test_agents_platform.py— full-run-safetytests/test_analyze.py— full-run-safetytests/test_anthropic_custom_endpoint.py— full-run-safetytests/test_antigravity_install.py— full-run-safetytests/test_apm_fallback_version.py— full-run-safetytests/test_architecture_doc.py— full-run-safetytests/test_astro_extraction.py— full-run-safetytests/test_astro_import_ids.py— full-run-safetytests/test_atomic_canvas_export.py— full-run-safetytests/test_atomic_version_stamp.py— full-run-safetytests/test_atomic_writes.py— full-run-safetytests/test_backend_env_isolation.py— full-run-safetytests/test_backend_extras.py— full-run-safetytests/test_benchmark.py— full-run-safetytests/test_benchmark_raw_graph.py— full-run-safetytests/test_build.py— full-run-safetytests/test_build_merge_dedup_scope.py— full-run-safetytests/test_build_merge_hyperedges_and_prune.py— full-run-safetytests/test_build_merge_shrink_guard.py— full-run-safetytests/test_builtin_global_type_refs.py— full-run-safetytests/test_cache.py— full-run-safetytests/test_callflow_html.py— full-run-safetytests/test_cargo_introspect.py— full-run-safetytests/test_cargo_missing_manifest.py— full-run-safetytests/test_carried_hyperedge_remap.py— full-run-safetytests/test_case_sensitive_resolution.py— full-run-safetytests/test_charmap_encoding.py— full-run-safetytests/test_chunking.py— full-run-safetytests/test_cjs_module_extension.py— full-run-safetytests/test_claude_cli_backend.py— full-run-safetytests/test_claude_md.py— full-run-safetytests/test_cli_broken_pipe.py— full-run-safetytests/test_cli_export.py— full-run-safetytests/test_cli_help.py— full-run-safetytests/test_cluster.py— full-run-safetytests/test_cobol_extractor.py— impact, changed-test, full-run-safetytests/test_codebuddy.py— full-run-safetytests/test_community_hub_labels.py— full-run-safetytests/test_community_labels_skill.py— full-run-safetytests/test_confidence.py— full-run-safetytests/test_corrupt_graph_json.py— full-run-safetytests/test_cpp_nested_and_cli.py— full-run-safetytests/test_cpp_objc_cross_file_calls.py— full-run-safetytests/test_cpp_preprocess.py— full-run-safetytests/test_cross_extension_reexport_self_cycle.py— full-run-safetytests/test_cross_language_call_resolution.py— full-run-safetytests/test_cross_repo_external_call_guards.py— full-run-safetytests/test_cross_repo_member_calls.py— full-run-safety- … and 250 more
changed code file(s) with no mapped test (
graphify/extractors/cobol.py) — a coverage gap or a missing link — running the full suite rather than only the selected tests
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
· 1 more finding(s) on lines outside this diff (see the check run).
Windows hash-seed re-exec wait (#3816/#3799), Terraform secret-named variable-default/output redaction (#3817), COBOL fixed-format sequence-number detection (#3813) and PERFORM...THRU both-endpoint linking (#3814), and gate the GRAPH_REPORT undocumented-components reason on a real semantic layer (#3828/#3801). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Shipped in v0.9.68 (now on PyPI) via an authorship-preserving cherry-pick, so your commit keeps contributor-graph credit. Thanks @abhay-codes07! COBOL PERFORM...THRU both-endpoint linking. |
`PERFORM A THRU Z` runs every paragraph written from A to Z, but only the two ends got a `calls` edge (Graphify-Labs#3814). A paragraph in the middle of a range had no inbound edge: "what performs M?" answered nothing, and M looked like dead code unless something else performed it by name. Record each program's paragraphs and sections in the order they are written, and once the program has been read link the performing paragraph to everything between the two ends, tagged `context: "perform_range"`. A range that ends on a section runs to the end of that section, so its paragraphs are included up to the next section header. The range is filled in only when both ends are paragraphs of the same program and the end is written after the start. Otherwise the two endpoint edges stay as they were and nothing is added. Not covered: paragraphs that a COPY statement inside the range brings in from a copybook (the extractor reads one file at a time), and a GO TO that leaves the range early. Regression tests: a range with two paragraphs in the middle, with a reversed and an unresolved range as controls, and a range that ends on a section. Both fail without the change. Co-Authored-By: Claude Fable 5.2 <[email protected]>
`PERFORM A THRU Z` runs every paragraph written from A to Z, but only the two ends got a `calls` edge (Graphify-Labs#3814). A paragraph in the middle of a range had no inbound edge: "what performs M?" answered nothing, and M looked like dead code unless something else performed it by name. Record each program's paragraphs and sections in the order they are written, and once the program has been read link the performing paragraph to everything between the two ends, tagged `context: "perform_range"`. A range that ends on a section runs to the end of that section, so its paragraphs are included up to the next section header. The range is filled in only when both ends are paragraphs of the same program and the end is written after the start. Otherwise the two endpoint edges stay as they were and nothing is added. Not covered: paragraphs that a COPY statement inside the range brings in from a copybook (the extractor reads one file at a time), and a GO TO that leaves the range early. Regression tests: a range with two paragraphs in the middle, with a reversed and an unresolved range as controls, and a range that ends on a section. Both fail without the change. Co-Authored-By: Claude Fable 5.2 <[email protected]>
`PERFORM A THRU Z` runs every paragraph written from A to Z, but only the two ends got a `calls` edge (#3814). A paragraph in the middle of a range had no inbound edge: "what performs M?" answered nothing, and M looked like dead code unless something else performed it by name. Record each program's paragraphs and sections in the order they are written, and once the program has been read link the performing paragraph to everything between the two ends, tagged `context: "perform_range"`. A range that ends on a section runs to the end of that section, so its paragraphs are included up to the next section header. The range is filled in only when both ends are paragraphs of the same program and the end is written after the start. Otherwise the two endpoint edges stay as they were and nothing is added. Not covered: paragraphs that a COPY statement inside the range brings in from a copybook (the extractor reads one file at a time), and a GO TO that leaves the range early. Regression tests: a range with two paragraphs in the middle, with a reversed and an unresolved range as controls, and a range that ends on a section. Both fail without the change. Co-Authored-By: Claude Fable 5.2 <[email protected]> (cherry picked from commit 5da96e8)
What
PERFORM A THRU Z(andTHROUGH) runs the whole paragraph range A..Z, but the PERFORM pattern captured only the first name — so acallsedge was emitted toAand the range-endZgot none. "What performs Z?" then answered nothing even though this paragraph does, and any reachability walk stopped short of the range's tail. THRU-based flow is common in legacy COBOL.Fix
Capture the optional
THRU/THROUGHtarget in the PERFORM pattern and enqueue both endpoints for resolution against the paragraph table. Intermediate paragraphs in the range are not individually linked (that would need paragraph source ordering); the two endpoints are the reliable, common signal and both now resolve. A plainPERFORM Ais unchanged.Verification
Regression test:
PERFORM A-PARA THRU Z-PARAnow linksMAIN-PARAto bothA-PARAandZ-PARA, and fails on the old single-capture pattern. All COBOL extractor tests pass.