Skip to content

SQL call sites: Db2 CALL leaving the file reaches call_site_data (Part of #5736) - #6080

Merged
squid-protocol merged 3 commits into
mainfrom
churn/5736-20261022T2222Z
Oct 22, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
churn/5736-20261022T2222Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5736
Checklist: partial [c:0755f773] -- Db2 SQL done; PostgreSQL left (see Sibling gaps)

What

call_site_data was empty for SQL. A Db2 SQL CALL name to a routine the file does not itself create is now a call site (verb CALL, form literal, schema qualifier dropped, quoted names unquoted, upper-cased), and resolve_invocations resolves it to the db2_sql file that creates that routine. Same split as PL/I (#3491): a CALL of a routine in the same file stays a function-level edge (calls_out_to); comments and quoted text are skipped; PERFORM f() / SELECT f() are expressions, not sites.

  • db2_sql.py: top-level boundary_extraction: "sql".
  • mainframe_boundary.py: sql_external_calls + sql dialect.
  • invocation_resolver.py: SQL sites resolve against a SQL-only routine index, so a SQL CALL never lands on a COBOL program of the same name (and COBOL CALLs never land on SQL routines).
  • galaxy_ir.py: the mainframe skeleton's "program calls" channel skips db2_sql files. Without this, 27 db2unit CALLs read as "missing program" and moved the completeness ratio 65.3% -> 62.4%.

Class table

Member Status
db2_sql done, tests, real scan
postgresql not done: needs its own boundary_extraction line in postgresql.py (the 6th file, past the 5-file limit); the reader and resolver already take it
sqlite n/a: no stored routines

Evidence

  • Real scan (galaxyscope --db-only, two-file repo): call_site_data row CALL|AUDIT_LOG|line 5, src_file_id caller.sql, dst_file_id audit.sql.
  • Golden drift (both legs), additive only: db2_sql/db2unit/06-AssertsNoMessage.sql gains 27 call sites (call_sites.json); LLM brief coverage 756 -> 757 files with mainframe facts, 867 -> 894 call sites. The skeleton-completeness channels do not move.
  • Tests: tests/extraction/languages/test_sql_call_sites_5736.py (4) plus the db2 strict and COBOL engine: EXEC SQL CALL proc is recorded as a COBOL dynamic CALL (operand = the schema qualifier) #4304 suites. pr_gates --fast 7/7, --ratchets 9/9.

Sibling gaps

Cross-repo: none.

🤖 Generated with Claude Code

squid-protocol and others added 3 commits October 22, 2026 18:24
…ite_data and resolves to its SQL file (Part of #5736)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ut of program-call completeness, re-bless (Part of #5736)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 22, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 22, 2026 22:57
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol enabled auto-merge (squash) October 22, 2026 22:59
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant