Skip to content

Resurface the 14 CardDemo equivalence ports' facades after #4427; keep Object for cross-program COMMAREAs (#4441) - #4445

Merged
squid-protocol merged 4 commits into
mainfrom
fix/4441-gen-4441
Oct 5, 2026
Merged

squid-protocol merged 4 commits into
mainfrom
fix/4441-gen-4441

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Fixes #4441.

Decision: the cross-program side of handleTransaction stays Object. No sealed or common supertype.

A sealed interface (or a generated common supertype) over the DTOs a flow can return is allowed by the #4342/#4349 rule. That rule forbids generated methods with no COBOL behaviour behind them, and an interface with no members adds no method for a proof to miss. It still does not fit the facts, for three reasons:

  1. The set is not closed on the reference estate. All 20 CardDemo façades that now return Object have at least one flow whose class the generator cannot name. One example is COSGN00C's RETURN TRANSID(CC00) COMMAREA(CARDDEMO-COMMAREA) (COSGN00C.cbl:98), which every menu program reaches by XCTL. COSGN00C has no COMMAREA DTO of its own, and CARDDEMO-COMMAREA (COCOM01Y) has one DTO per program that copies it. The skeleton also leaves the callee of that flow unresolved, and of COPAUS1C's CPVD. The façade Javadoc lists these as (no DTO besides X). So the permits list would either claim a closed set the facts do not close, or the generator would fall back to Object on all 20 and the typed form would appear nowhere in CardDemo. Only the crucible's PC cases have closed sets (PCMENU: PcmenuWsCa, PcdetlWsCa).
  2. It changes the DTOs, not the façade. Java requires each permitted class to name the interface and be final or non-sealed. CarddemoCommarea sits in 20 flows. It would need one interface per façade side, or one shared interface whose list is wider than any one façade's real set. Either way, the DTO declarations depend on other programs' navigation facts. In the 4th-estate one-shot that is a new compile risk that adds no behaviour.
  3. COBOL's contract at this boundary is a layout, not a class. Each program reads the same bytes through its own record. The honest typed option is a conversion by layout: task.returned(Class) converting the bytes the way CicsTask.link(..., byte[]) does for LINK (det port: LINK COMMAREA(ERROR-MSG) to LGSTSQ marshals past the 71-byte record (GenApp error paths) #4181), so a caller asks for the record it reads. That is a runtime behaviour change and is left as a follow-up.

The generated Javadoc already says why the façade is Object and lists every crossing flow. No generator change in this PR.

Tooling

  • tests/tools/port_surface.py equivalence --work DIR [--cases ...] [--check] resurfaces the equivalence ports (tests/equivalence/<case>/port). It generates each corpus once, the same way the harness does (ports_compile_check.generate, factored out of estate()), and applies resurface to each port file against the generated file at the same path. Ports with a provenance.json get a resurfaced history event. carddemo-acctview is a Equivalence harness: CICS online programs (EXEC CICS stub runtime on the COBOL side) #3754 hand port with no provenance, so it is resurfaced but not recorded.
  • resurface now adds only the imports a written façade uses. Before, it added every generated import the port lacked, which would have put List/Optional/BigDecimal into 9 batch ports with no façade change. The import regex no longer matches the newline, so identical import lines compare equal.
  • Tests in tests/cics_crucible/test_port_surface.py cover the import rule and the equivalence command (check, apply, provenance, idempotence).

Ports regenerated: 14 equivalence, 0 crucible

CardDemo acctview, adminmenu, billpay, cardlist, cardview, menu, report, tranadd, tranlist, tranview, useradd, userdel, userlist, userupd. Each one got handleTransaction replaced, and nothing else changed. Their façades now return Object / task.returned(Object.class), so the returned() throw on a cross-program RETURN (the PCMENU bug) is gone.

Unchanged, because the surface already matches the generator: signon (no COMMAREA), dateutil, trnrpt, the batch ports, cbsa-inqacc/updacc, genapp. The 17 crucible ports were not touched: port_surface.py crucible --check reports every surface as the generator's.

Proof

  • evidence.py prove on the 14: all proven, unapproved. The run counts are unchanged; the port hash, generator hash and reach line numbers moved. The proof goes through runTask: the equivalence harness (equivalence_cics.py) has no façade side (only the CICS crucible has java-facade), and handleTransaction stays left_as_generated in each reach section.
  • ports_compile_check.py --only equivalence: all 28 equivalence ports compile against HEAD (the Ports Compile job's check).
  • CICS crucible java-ported (from the crucible --check run): 44/44 pass. No generator change, so the java-facade cells were not re-run.
  • test_port_surface, test_proof_reach, test_evidence: pass.
  • pr_gates.py: lint, audits, secrets, xray and gauntlet pass. The golden gate was refused because the local language-crucible checkout is on v1.4.0 and the pin is v1.7.0; this PR changes no engine code. In the suite, 11 test_security_auditor tests failed because pandas and xgboost are missing from the local venv; nothing else failed (14628 passed).
  • Merged origin/main (det: SYNCPOINT [ROLLBACK] RESP / RESP2 are written, not ignored (#4437) #4442: CicsTask runtime only, no façade change). Surfaces were re-checked (clean) and the 14 were re-proven on that generator: all proven.

Stale after this PR (mutation not re-run)

  • mutation_scores.json: carddemo-acctview and carddemo-menu (seed 0, commit 9c21df6). Their port text changed: the façade body, plus a longer Javadoc that moves every later line, by 22 lines in menu. Survivor line numbers recorded for those two no longer point at the same Java lines, and any sampled mutant inside the old handleTransaction was mutating code that is gone. runTask is unchanged, so the kill and survive verdicts on ported logic still hold. The other 12 have no mutation entry.
  • No crucible mutation entry is affected, because no crucible port changed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz

squid-protocol and others added 2 commits October 5, 2026 09:04
…#4441)

port_surface.py equivalence: resurface tests/equivalence/<case>/port against
the corpus's fresh generation (ports_compile_check.generate). Only the
imports a written facade uses are added.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
evidence.py prove: all 14 proven, unapproved (runTask path; the equivalence
harness has no facade side).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
@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 changed the title WIP: Resurface the 14 CardDemo equivalence ports' facades after #4427 (#4441) Resurface the 14 CardDemo equivalence ports' facades after #4427; keep Object for cross-program COMMAREAs (#4441) Oct 5, 2026
@squid-protocol
squid-protocol marked this pull request as ready for review October 5, 2026 13:38
@squid-protocol
squid-protocol merged commit ca63a69 into main Oct 5, 2026
31 checks passed
@squid-protocol
squid-protocol deleted the fix/4441-gen-4441 branch October 5, 2026 13:38
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.

Generator: regenerate the 14 CardDemo equivalence ports' façades after #4427 (still the old typed COMMAREA)

1 participant