Skip to content

fix(forge): name a LINKed program's COMMAREA DTO after its own DFHCOMMAREA - #4390

Merged
squid-protocol merged 2 commits into
mainfrom
fix/forge-callee-commarea-name
Oct 5, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
fix/forge-callee-commarea-name

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Prepares #4329.

Rule

A program reached by LINK / XCTL gets a COMMAREA contract DTO named after its OWN DFHCOMMAREA (its LINKAGE SECTION), never after the caller's record: CICS hands the callee only its own linkage. A program reached only by RETURN TRANSID (including to itself) keeps the record it carries (HxattrWsCa, PcdetlWsCa, ... which the committed ports reference).

Root cause

program_interfaces (gitgalaxy/tools/cobol_to_cobol/galaxy_ir.py, the elif options: caller_record branch, ~l.2538) sets commarea.record to the caller's record whenever a caller's layout is usable and agrees with the callee's DFHCOMMAREA; CicsForge._plan (cobol_to_java_transaction_forge.py, ~l.1789) then names the DTO from commarea["record"]. Until now a caller record that was unusable (e.g. WS-CA with a leaked USAGE POINTER) fell through to _declared_over_callers, which names it DFHCOMMAREA. With #4329 the leak is gone, WS-CA becomes a usable record, and HCSUB's handleLink took HcsubWsCa, so the 5 hc-abend-link/*/java-ported cells failed mvn compile against the overlay that uses HcsubDfhcommarea.

Fix

The engine adds declared_record (the callee's own DFHCOMMAREA name) to a caller_record commarea when a LINK/XCTL source exists; the forge names the DTO from it, owned by the callee. Layout and field names are unchanged. Tests: new forge and engine tests (caller record WS-CA vs callee DFHCOMMAREA; RETURN-only keeps its name); three existing assertions that pinned the old caller-derived names (AcctCommarea, MenuWsComm) are updated.

Evidence

(a) On plain main, regenerated (refactor + cobol-to-java, h2) CardDemo, CBSA, GenApp and all 10 cics-crucible cases at the pin, before vs after: CardDemo and all 10 crucible cases are byte-identical, so no generated code for any committed crucible port changes. CBSA (52 files) and GenApp (54 files) differ only in contract DTO class names and references to them (Lgacus01CommArea -> Lgacus01Dfhcommarea, etc.); no committed port (crucible overlays, tests/cobol_mainframe/port_invariance) references any renamed class, and the refraction snapshots are unchanged.
(b) With origin/fix/4329-usage-leak merged in a scratch copy: before the fix HCSUB handleLink(HcsubWsCa), hc-abend-link forge-compile pass but java-ported 0/5 (mvn compile error); after, handleLink(HcsubDfhcommarea request) and java-ported 5/5 pass, forge-compile and cobol-stub pass (JDK 17, GITGALAXY_ORACLE_STRICT=1, gitgalaxy-gnucobol:3, cics-crucible v0.2.0). The java cells fail as before, ledgered in the baseline.
Local: ruff/mypy/dead_key audits --ci clean; tests/cobol_mainframe, tests/cics_crucible, tests/tools: 1694 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 5, 2026 01:34
@squid-protocol
squid-protocol merged commit a7c3de5 into main Oct 5, 2026
38 checks passed
@squid-protocol
squid-protocol deleted the fix/forge-callee-commarea-name branch October 5, 2026 01:34
squid-protocol added a commit that referenced this pull request Oct 5, 2026
squid-protocol added a commit that referenced this pull request Oct 5, 2026
)

* test: evidence records for the four Db2 equivalence cases (#4048)

Proven with the real harness against the pinned oracle (GITGALAXY_ORACLE_STRICT=1) and a rebuilt gitgalaxy-gnucobol-db2:3.
Three ports followed #4390's DTO rename (callee's own DFHCOMMAREA): AbndprocDfhcommarea, LgstsqDfhcommarea.
Drops the four cases from the MISSING ratchet.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo

* test: genapp-lgapvs01 port follows #4390's DTO rename; record re-proven

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.

1 participant