Skip to content

Equivalence harness: prove CICS ports through their deployed entry points (java-facade side) (#4449) - #4455

Merged
squid-protocol merged 5 commits into
mainfrom
feat/4449-equivalence-facade
Oct 5, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
feat/4449-equivalence-facade

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Draft. Part 1 of #4449. Files #4464 and #4465 for what the façade proofs found. Part 2 (layout conversion in returned()) is not implemented here. The evidence for it is at the end.

Problem

The equivalence harness proved CICS ports through runTask only. A deployment enters them through their Spring façades (handleTransaction / handleLink). On the crucible, proving through the façade (#4343) caught ports that would crash in deployment while their runTask proofs passed.

The java-facade side (equivalence_cics.py)

  • equivalence.py run on a CICS case with a port runs the same project a second time with -Dequivalence.facades=true.
  • Each scenario's task is entered through the program's deployed entry point:
    • handleTransaction, or handleLink for a case marked "linked": true;
    • each LINK target the case runs goes through its own handleLink.
  • A FacadeRegion is joined (CicsTask.join). It hands the façade the very task the scenario built (COMMAREA, key, screen input, files, faults) and refuses anything else. A refusal fails its scenario with the reason:
    • a façade that builds its own task, or never runs its task in the region;
    • one that runs another program;
    • a COMMAREA it cannot take;
    • a non-void façade answering something other than the RETURN's COMMAREA (or, for handleLink, the request it was passed).
  • The second run is compared with the same COBOL tasks as the runTask side, exactly the same way: events, files, Db2 tables, faults fired.
  • The runTask side is unchanged: same test, same outputs, same comparison. report.json gains facade. proven = runTask AND java-facade. --no-facades leaves the side out, and is refused together with --record.
  • Negative control (E2E test): COMEN01C with a handleTransaction that runs runTask on a task of its own. runTask passes 16/16 and java-facade refuses 16/16.

Evidence (evidence.py)

  • proof.facade keeps: runs, passed, the methods entered, and each failing scenario with its reason.
  • The façade methods entered count as reach roots.
  • A CICS port that declares a façade but whose proof has no java-facade side is not proven ("the proof predates the java-facade side; re-prove it"), as Prove crucible ports through their deployed entry points (Spring façades), not only runTask #4343 did for the crucible.
  • tests/equivalence/facade_baseline.json ledgers the failing façade scenarios, each with the issue that owns it. test_evidence checks that the ledger, the records and the provenance stale marks agree.
  • docs/language_status/evidence_records.md says what "proven" covers.

Results (evidence.py prove, on merged main, JDK 17)

app port runTask java-facade entered by
CardDemo acctview, adminmenu, billpay, cardlist, cardview, menu, report, tranadd, tranlist, tranview, useradd, userdel, userlist, userupd (14) pass pass handleTransaction
CardDemo signon 12/12 1/12, fail (#4464) handleTransaction
CBSA updacc 10/10 pass handleLink
CBSA inqacc 14/14 13/14, fail (#4465) handleLink
GenApp lgapvs01, lgicdb01 pass pass handleLink
GenApp lgupdb01 5/5 1/5, fail (#4465) handleLink
CardDemo dailyval, intcalc, posttran, readcard, readcust, readxref, trnrpt (batch), dateutil (CALL) not re-run n.a. (no façade)

The 3 failing ports are not proven. Their failing scenarios are ledgered, and their provenance.json carries a stale mark citing the issue. Nothing is fixed here.

Evidence for part 2 (layout conversion)

#4464 is a second case beyond #4445's: the contract at COSGN00C's boundary is bytes with no record of its own, so no DTO type is honest there. Object would carry the flow. Conversion by layout would let the next task read its own record.

Notes

Checks

  • ruff_audit and mypy_audit --ci are clean. evidence.py render --check and status --ci pass.
  • test_evidence, test_equivalence_cics (new façade unit tests; the E2E tests need Docker), test_port_surface, test_proof_reach, test_porting_loop_tooling, test_equivalence: pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz

Each CICS case's port is proven once more through its deployed entry point: the same
project runs every scenario again with -Dequivalence.facades=true, the task entered
through the program's Spring facade (handleTransaction, or handleLink for a LINKed
program; a LINK target the case runs through its handleLink) with a FacadeRegion
joined (CicsTask.join) that hands the facade the scenario's own task and refuses any
other. Compared with the same COBOL tasks exactly as the runTask side is; the case is
proven only when both are. The runTask side is unchanged. --no-facades leaves the
side out (never with --record).

evidence.py: the proof keeps a `facade` summary, its entry points are reach roots, and
a CICS port with facades whose proof has no java-facade side is not proven.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
Comment on lines +2543 to +2544
"Every scenario once more, entered through the program's Spring facade with the scenario's task "
"handed to it through the joined region.", ""] # fmt: skip

def _java_events(case: dict[str, Any], out: Path, shape: dict[str, Any]) -> dict[str, list[dict[str, Any]]]:
"""{scenario: the events the Java run wrote to out/<scenario>.json}, each COMMAREA by COBOL field names."""
import json
@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 and others added 3 commits October 5, 2026 10:50
#4449)

evidence.py prove on every committed CICS equivalence port except genapp-lgupdb01
(its runTask side is blocked by #4436, in progress). 17 are proven through runTask and
their deployed entry points. Two fail on the java-facade side and are ledgered in
tests/equivalence/facade_baseline.json, with their provenance marked stale:
- carddemo-signon 1/12 (#4464: COSGN00C's facade takes no COMMAREA, but its
  RETURN TRANSID(CC00) COMMAREA(...) re-enters it with one);
- cbsa-inqacc 13/14 (#4465: the det port ABNDPROC's handleLink is a throwing stub).
runTask passes on all of them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
…ncluded (#4449)

After #4436 (#4453) merged, genapp-lgupdb01's runTask side passes, so it is proven with
the java-facade side too. java-facade passes 1/5: the det port LGUPVS01's handleLink is
a throwing stub (#4465, the same root cause as cbsa-inqacc / ABNDPROC). Ledgered in
facade_baseline.json and its provenance marked stale. The other 19 were re-proven on the
merged harness. Results are unchanged: 17 proven; signon (#4464) and inqacc (#4465) fail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
@squid-protocol squid-protocol changed the title WIP: Equivalence harness: prove CICS ports through their deployed entry points (java-facade side) (#4449) Equivalence harness: prove CICS ports through their deployed entry points (java-facade side) (#4449) Oct 5, 2026
@squid-protocol
squid-protocol marked this pull request as ready for review October 5, 2026 15:13
@squid-protocol
squid-protocol merged commit 745c4ff into main Oct 5, 2026
31 checks passed
@squid-protocol
squid-protocol deleted the feat/4449-equivalence-facade branch October 5, 2026 15:13
squid-protocol added a commit that referenced this pull request Oct 5, 2026
…InqaccDfhcommarea); record re-proven

#4457 materializes INQACC's section-level COPY ... REPLACING, so the record is
DFHCOMMAREA and the generated DTO is InqaccDfhcommarea. Pure rename in the
model-written port (5 occurrences, no logic change), approved by the owner as
the precedent cb9408f did for lgapvs01: the sanctioned regeneration path is
blocked by #4476 (porting_loop --reuse). Re-proven with evidence.py prove:
runTask passes; java-facade 13/14 is the failure baselined in #4455 for #4465
(ABNDPROC is a det stub). All 45 committed ports compile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
squid-protocol added a commit that referenced this pull request Oct 5, 2026
* COBOL engine: entries continuing a COPYed record are not children of the 01 before the COPY (#4458)

A COPY after the last entry of a nested group whose member opens its own 01 was moved to
section_copies (#4330), which the leaf-closing check in _expanded_children did not read, so the
continuation was counted under the preceding 01 as well as the copied record.

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

* COBOL engine: apply a section-level COPY ... REPLACING to the copied 01 records (#4457)

The extractor now records the COPY ... REPLACING statements no entry carries (copy_statement_data);
GalaxyIR materializes the replaced records of those, and of the ones an entry carried that open their
own 01 (#4330), as program records (EngineFile.records, with copied_items), and hides the unreplaced
copybook records from that program.

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

* train: regenerate golden channel 7, assign ledger entries (#4470), re-pin completeness (#4457)

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

* train: lower the fact cross-check ledger (#4458 entries no longer reproduce)

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

* test: cbsa-inqacc port follows #4457's DTO rename (InqaccCommarea -> InqaccDfhcommarea); record re-proven

#4457 materializes INQACC's section-level COPY ... REPLACING, so the record is
DFHCOMMAREA and the generated DTO is InqaccDfhcommarea. Pure rename in the
model-written port (5 occurrences, no logic change), approved by the owner as
the precedent cb9408f did for lgapvs01: the sanctioned regeneration path is
blocked by #4476 (porting_loop --reuse). Re-proven with evidence.py prove:
runTask passes; java-facade 13/14 is the failure baselined in #4455 for #4465
(ABNDPROC is a det stub). All 45 committed ports compile.

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

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
squid-protocol added a commit that referenced this pull request Oct 5, 2026
… REPLACING; update drops stale entries (#4472) (#4481)

* COBOL engine: entries continuing a COPYed record are not children of the 01 before the COPY (#4458)

A COPY after the last entry of a nested group whose member opens its own 01 was moved to
section_copies (#4330), which the leaf-closing check in _expanded_children did not read, so the
continuation was counted under the preceding 01 as well as the copied record.

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

* COBOL engine: apply a section-level COPY ... REPLACING to the copied 01 records (#4457)

The extractor now records the COPY ... REPLACING statements no entry carries (copy_statement_data);
GalaxyIR materializes the replaced records of those, and of the ones an entry carried that open their
own 01 (#4330), as program records (EngineFile.records, with copied_items), and hides the unreplaced
copybook records from that program.

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

* train: regenerate golden channel 7, assign ledger entries (#4470), re-pin completeness (#4457)

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

* train: lower the fact cross-check ledger (#4458 entries no longer reproduce)

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

* test: cbsa-inqacc port follows #4457's DTO rename (InqaccCommarea -> InqaccDfhcommarea); record re-proven

#4457 materializes INQACC's section-level COPY ... REPLACING, so the record is
DFHCOMMAREA and the generated DTO is InqaccDfhcommarea. Pure rename in the
model-written port (5 occurrences, no logic change), approved by the owner as
the precedent cb9408f did for lgapvs01: the sanctioned regeneration path is
blocked by #4476 (porting_loop --reuse). Re-proven with evidence.py prove:
runTask passes; java-facade 13/14 is the failure baselined in #4455 for #4465
(ABNDPROC is a det stub). All 45 committed ports compile.

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

* fix(crosscheck): lay out a section COPY ... REPLACING's replaced records; update drops stale entries (#4472)

The engine adapter read the copybook's own item from data_items; GalaxyIR (#4457) builds the replaced
records into ef.records / copied_items, so use those. update kept every ledger entry on a full run
(inverted --corpus condition); now a full run re-judges all. Ledger lowered by 364 entries.

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

---------

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.

2 participants