Skip to content

fix(cobol): link both endpoints of a PERFORM ... THRU range - #3814

Closed
abhay-codes07 wants to merge 1 commit into
Graphify-Labs:v8from
abhay-codes07:fix/cobol-perform-thru
Closed

abhay-codes07 wants to merge 1 commit into
Graphify-Labs:v8from
abhay-codes07:fix/cobol-perform-thru

Conversation

@abhay-codes07

@abhay-codes07 abhay-codes07 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What

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. THRU-based flow is common in legacy COBOL.

PERFORM A-PARA THRU Z-PARA   # before: calls -> A-PARA only
                             # after:  calls -> A-PARA AND Z-PARA

Fix

Capture the optional THRU/THROUGH target 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 plain PERFORM A is unchanged.

Verification

Regression test: PERFORM A-PARA THRU Z-PARA now links MAIN-PARA to both A-PARA and Z-PARA, and fails on the old single-capture pattern. All COBOL extractor tests pass.

`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
Copilot AI lite review requested due to automatic review settings September 24, 2026 17:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-safety
  • tests/test_affected_member_seed.py — full-run-safety
  • tests/test_agents_platform.py — full-run-safety
  • tests/test_analyze.py — full-run-safety
  • tests/test_anthropic_custom_endpoint.py — full-run-safety
  • tests/test_antigravity_install.py — full-run-safety
  • tests/test_apm_fallback_version.py — full-run-safety
  • tests/test_architecture_doc.py — full-run-safety
  • tests/test_astro_extraction.py — full-run-safety
  • tests/test_astro_import_ids.py — full-run-safety
  • tests/test_atomic_canvas_export.py — full-run-safety
  • tests/test_atomic_version_stamp.py — full-run-safety
  • tests/test_atomic_writes.py — full-run-safety
  • tests/test_backend_env_isolation.py — full-run-safety
  • tests/test_backend_extras.py — full-run-safety
  • tests/test_benchmark.py — full-run-safety
  • tests/test_benchmark_raw_graph.py — full-run-safety
  • tests/test_build.py — full-run-safety
  • tests/test_build_merge_dedup_scope.py — full-run-safety
  • tests/test_build_merge_hyperedges_and_prune.py — full-run-safety
  • tests/test_build_merge_shrink_guard.py — full-run-safety
  • tests/test_builtin_global_type_refs.py — full-run-safety
  • tests/test_cache.py — full-run-safety
  • tests/test_callflow_html.py — full-run-safety
  • tests/test_cargo_introspect.py — full-run-safety
  • tests/test_cargo_missing_manifest.py — full-run-safety
  • tests/test_carried_hyperedge_remap.py — full-run-safety
  • tests/test_case_sensitive_resolution.py — full-run-safety
  • tests/test_charmap_encoding.py — full-run-safety
  • tests/test_chunking.py — full-run-safety
  • tests/test_cjs_module_extension.py — full-run-safety
  • tests/test_claude_cli_backend.py — full-run-safety
  • tests/test_claude_md.py — full-run-safety
  • tests/test_cli_broken_pipe.py — full-run-safety
  • tests/test_cli_export.py — full-run-safety
  • tests/test_cli_help.py — full-run-safety
  • tests/test_cluster.py — full-run-safety
  • tests/test_cobol_extractor.py — impact, changed-test, full-run-safety
  • tests/test_codebuddy.py — full-run-safety
  • tests/test_community_hub_labels.py — full-run-safety
  • tests/test_community_labels_skill.py — full-run-safety
  • tests/test_confidence.py — full-run-safety
  • tests/test_corrupt_graph_json.py — full-run-safety
  • tests/test_cpp_nested_and_cli.py — full-run-safety
  • tests/test_cpp_objc_cross_file_calls.py — full-run-safety
  • tests/test_cpp_preprocess.py — full-run-safety
  • tests/test_cross_extension_reexport_self_cycle.py — full-run-safety
  • tests/test_cross_language_call_resolution.py — full-run-safety
  • tests/test_cross_repo_external_call_guards.py — full-run-safety
  • tests/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).

safishamsi added a commit that referenced this pull request Sep 25, 2026
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]>
@safishamsi

Copy link
Copy Markdown
Member

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.

Release: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.68

@safishamsi safishamsi closed this Sep 25, 2026
pavansystems added a commit to pavansystems/graphify that referenced this pull request Nov 24, 2026
`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]>
pavansystems added a commit to pavansystems/graphify that referenced this pull request Nov 25, 2026
`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]>
safishamsi pushed a commit that referenced this pull request Nov 26, 2026
`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)
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.

3 participants