Skip to content

train: #4464 opaque DFHCOMMAREA + #3804 generated inputs - #4524

Merged
squid-protocol merged 5 commits into
mainfrom
train/4464-3804
Oct 6, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
train/4464-3804

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Supersedes #4499 and #4492 (built once on main 5544b8a so generated files regenerate a single time). Closes #4464. Closes #3804.

Note: #4504 makes #4499's own-transaction (CC00) rule redundant but harmless (same facade output).

Regenerated on the combined tree: det sweep 37/40, carddemo-signon dropped from det_sweep_baseline.json and facade_baseline.json; carddemo-signon evidence re-proved. Ratchets 5/5 pass; full pr_gates 7/7 pass.

#4499 (opaque DFHCOMMAREA)

Closes #4464.

Problem

CardDemo's COSGN00C declares an opaque DFHCOMMAREA (LK-COMMAREA PIC X(01) OCCURS 1 TO 32767 DEPENDING ON EIBCALEN) and continues its pseudo-conversation with RETURN TRANSID(CC00) COMMAREA(CARDDEMO-COMMAREA). The engine pairs no COMMAREA with it for two reasons. Every XCTL into it is data-driven (via: moves). Its RETURN's callee is unresolved because the CSD also pairs CC00 with COCRDLIC through DEFINE PROGRAM(COCRDLIC) ... TRANSID(CC00). So the generated façade was handleTransaction(String) / handleLink(), and the java-facade side refused 11 of 12 scenarios.

Change (generator only: cobol_to_java_transaction_forge.py)

  • New CicsForge._plan_opaque_commareas pass. It runs for a program with no COMMAREA, no channel, and a LINKAGE DFHCOMMAREA that is an opaque byte area (one alphanumeric leaf, e.g. ODO PIC X). The program's COMMAREA becomes the record that flows into it pass:

    • its RETURN TRANSID to one of its own transactions (callee unresolved or itself)
    • any resolved LINK / XCTL / RETURN TRANSID reaching it

    That record is given as the estate's one DTO matching it on name, file, width and field count. Extended copies such as Cobil00cCarddemoCommarea do not match.

  • The gap names the reason when it refuses: the flows pass different records, a data-driven site into it passes another record name, or no DTO (or several) carries the record.

  • In the Generator: CICS facades type the COMMAREA per program, but a pseudo-conversation carries it across programs #4427 conversation typing, a RETURN TRANSID to the sender's own transaction counts as a self-RETURN, and the crossing notes name it.

COSGN00C now generates public Object handleTransaction(String transid, CarddemoCommarea request) and public CarddemoCommarea handleLink(CarddemoCommarea request). Its response is Object because the task can XCTL into programs with other DTOs, the same as COMEN01C. Nothing is special-cased for COSGN00C.

Generated-output impact, regenerated before and after:

  • CardDemo: only COSGN00C's service and controller signatures change, plus Javadoc crossing notes in other services.
  • CBSA / GenApp: byte-identical src/.

Evidence

Follow-up owed

#4490 (det façades copy the stub's signature) has not merged. Once it does, merge main and drop carddemo-signon from det_sweep_baseline.json with proof_sweep.py --det-only --skip-db2 --update-baseline. The det port of COSGN00C should then take the COMMAREA with no det change.

Note

The engine's _transaction_program resolves CC00 ambiguously because it treats DEFINE PROGRAM ... TRANSID as a transaction pairing. An explicit DEFINE TRANSACTION ... PROGRAM arguably outranks it. This PR doesn't change the engine; the generator copes either way.

#4492 (generated inputs)

Closes #3804.

Remaining "done when" items of #3804, on top of #3808 (@generate, INTCALC):

  • POSTTRAN (carddemo-posttran-generated, batch CBTRN02C): generated accounts, cross-references, category balances and 100 daily transactions. All four reject reasons (100/101/102/103) and the posting paths run; every output equal, RETURN-CODE 4 on both sides.
  • Account view (carddemo-acctview-generated, CICS COACTVWC): generated files and 24 generated scenarios (below). Proven, runTask and java-facade, on the hand-written port. Hand-written cases are untouched.
  • A no-data estate (mortgage-mlist-generated; the dbb-mortgage-application estate ships no data): the ESDS and 12 COMMAREAs are generated, nothing from @case. No hand port exists, so it is proven through the det port (det_port.py run: runTask 12/12 scenarios equal); the java-facade half fails for the known det-facade stub (det translator: CICS facades are stubs (handleLink throws, void handleTransaction does nothing), not the region-run facade #4465), so it joins that baseline entry.
  • CICS COMMAREA and map input (the issue asks for it): equivalence_inputs.prepare_cics_case. "input": "@generate" works for CICS files (record length and key from the program's file; an ESDS is unkeyed), and a scenario_generate block makes scenarios: a map field is typed as a value on file, one not on file (miss), or not a number (bad: letters, blanks, signs, a decimal point), and COMMAREA fields take values, edge (the PICTURE's edge values) or from.
  • A digits rule (numeric text a PICTURE cannot say) and dotted dataset names as from sources.

Finding, filed as #4491: the acct-view port Long.parseLongs the cross-reference card number, which COBOL's MOVE X(16) TO 9(16) does not; the first generated run failed there. Real data is all digits, so the case steers XREF-CARD-NUM to digits and says so.

Ratchets: det_sweep_baseline.json gets the two CICS cases (#4465, same cause as their hand-written siblings). pr_gates --ratchets: estate, fact-crosscheck, completeness, ground-truth pass; ports could not run (the cics-crucible checkout here is off-pin, not touched). New unit tests in test_equivalence_inputs.py, plus E2E tests (EQUIVALENCE_E2E=1) that passed locally.

Touches equivalence_cics.py in 8 lines only (an import, generated files at load, one call in run_case); equivalence.py is not touched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR

squid-protocol and others added 5 commits October 5, 2026 14:06
… inputs

- carddemo-posttran-generated: CBTRN02C on generated accounts, cross-references, category balances and daily
  transactions (all four reject reasons, the posting paths).
- carddemo-acctview-generated: COACTVWC on generated files and 24 generated COMMAREA / map-input scenarios,
  typed account ids that are on file, not on file, or not numbers.
- mortgage-mlist-generated: EPSMLIST on generated inputs alone (the estate ships no data).
- equivalence_inputs.prepare_cics_case: `@generate` CICS files (key and length from the program's file) and
  `scenario_generate`; a `digits` rule for numeric text; dotted dataset names as join sources.
- det_sweep_baseline: the two CICS cases join the #4465 facade entries.
- Found: the acct-view port throws on non-digit card numbers where COBOL's MOVE does not (#4491).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
)

COSGN00C's LINKAGE DFHCOMMAREA is an opaque ODO byte area, and the engine pairs
no COMMAREA with it (every XCTL into it is data-driven; its RETURN TRANSID(CC00)
to itself is unresolved because the CSD also pairs CC00 with COCRDLIC via a
DEFINE PROGRAM ... TRANSID). Its facade took none, so the equivalence harness's
java-facade side refused 11 of 12 scenarios.

The CICS forge now gives a program with an opaque DFHCOMMAREA the record that
its RETURN TRANSID to its own transactions (and any resolved flow into it)
passes, as the estate's single DTO for that record (name, file, width, field
count). It refuses by name in the commarea gap when the flows disagree, a
data-driven site names another record, or no single DTO carries it. A RETURN
TRANSID to the sender's own transaction counts as a self-RETURN in the #4427
conversation typing.

carddemo-signon resurfaced (port_surface.py equivalence) and re-proven:
runTask 12/12, java-facade 12/12; stale mark cleared, dropped from
facade_baseline.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drop carddemo-signon from det_sweep_baseline and facade_baseline; re-prove its evidence record.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
@squid-protocol squid-protocol added bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist labels Oct 6, 2026
import cobol_coverage as cov # #4023
import equivalence_common as common
import equivalence_db2
import equivalence_inputs # #3804
gen = case.get("scenario_generate")
if not gen:
return case
import equivalence_cics as cx
@github-actions

github-actions Bot commented Oct 6, 2026

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

bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist

Projects

None yet

2 participants