Skip to content

Prove 6 CardDemo ports' unproven methods: entry runs, an abend scenario, intcalc key-order fix - #4326

Merged
squid-protocol merged 3 commits into
mainfrom
feat/prove-carddemo-unproven
Oct 4, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
feat/prove-carddemo-unproven

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Follow-up to #4316 (evidence records). This is the CardDemo lane for the 8 CardDemo ports that PORTED_UNPROVEN_POLICY = "block" reports as not proven. 6 of the 8 are now "proven, unapproved". The tools wrote every record (equivalence.py run CASE --record, evidence.py refresh --stale). Every proof used JDK 17 and the pinned oracle in strict mode.

Per port

port method what made the proof reach it record
readcard executeCbact02c new harness support: entry runs (below) proven, unapproved
readcust executeCbcus01c entry run proven, unapproved
readxref executeCbact03c entry run proven, unapproved
intcalc readAllTcatbalFile runBatch now reads TCATBAL through it proven, unapproved
useradd writeUsrsec the USRSEC WRITE now adds the record through it proven, unapproved
cardview onAbendL250 new scenario pf3-xctl-fails-abend-routine (XCTL PGMIDERR, RESP2 3). The abend goes to ABEND-ROUTINE through the line-250 exit still blocked by onAbendL871
cardview onAbendL871 not changed: needs an owner decision not-proven
acctview dispatchCdemoToProgramL349 not changed: needs an owner decision not-proven
dateutil executeCsutldtc not changed: needs an owner decision not-proven

Port bug found

intcalc readAllTcatbalFile returned TCATBAL in no defined order (findAll()), but the KSDS is read in key order. Once runBatch read through the method, the proof failed: TRANSACT 1/53 records equal and ACCTFILE 51/52. The method now sorts by the key (acct id, type, category), which is what runBatch had been doing inline, and the proof passes 52/52, 53/53 and 156/156 SYSOUT lines. Only the method was wrong; runBatch's own results were already right.

Harness: entry runs (equivalence.py, equivalence_java.py, evidence.py)

  • What it does. A batch case may list "entries": [{"method", "why"}]. These are no-argument methods of the service, such as the controller's executeX.
    • For each one, the generated JUnit test runs the step once more with -Dequivalence.entry=<method>. It calls that method instead of runBatch.
    • The run is compared with the same COBOL run by compare_run: the same abend, or every output equal and RETURN-CODE 0. The method returns no code, so the run counts as RETURN-CODE 0 when the method returns normally.
  • What it refuses. A case with a PARM (the method cannot pass one), and a method name that is not a Java identifier.
  • How it counts toward reach. evidence.py adds a method as a proof root only when an entry run actually ran it (report["entries"]). The records' proof.entry_runs and the claim line state this. proof_reach itself is unchanged.
  • Where it shows up. The report markdown and the feedback list entry runs too. The docs are in docs/language_status/evidence_records.md and the equivalence.py docstring.
  • Tests. New tests in test_evidence.py check two things: reach counts an entry only when the run used it, and the generated test drives the entry and refuses a PARM.

Because the harness changed, every equivalence and crucible record went stale on harness. evidence.py refresh --stale --skip-db2 re-proved them all, and every proof is still proven. The 3 hc-* crucible records are left to #4325, which changes those ports.

Needs an owner decision (not changed here)

  • acctview dispatchCdemoToProgramL349.
    • It is the generator's XCTL dispatcher with one change (toUpperCase() without Locale.ROOT), which is why it counts as "ported".
    • runTask performs the XCTL through task.xctl(...), which the harness models. The dispatcher instead calls Comen01cService.handleLink in-process.
    • Driving it would mean proving COMEN01C's Java inside acctview's proof, which no COBOL comparison covers.
    • Options: restore the generated body (it would then count as left-as-generated), route the XCTL through it (this changes what is compared), or keep it as a reported exception.
  • cardview onAbendL871.
    • The generator made a "handler" for HANDLE ABEND CANCEL at line 871. That statement cancels the exit; it does not set one up, so CICS never transfers control to it.
    • ABEND-ROUTINE's cancel is ported inline (task.handleAbendCancel()) and is now covered by the new scenario.
    • Options: revert to the generated stub, or route ABEND-ROUTINE's cancel through it (cosmetic).
  • dateutil executeCsutldtc.
    • It calls handleCall with blank items and only logs the result. It has no output for a call case to compare.
    • Options: revert to the generated stub, or have a call-case entry run compare its log.

Checks

  • These suites pass (288 passed): test_evidence, test_proof_reach, test_equivalence*, tests/cics_crucible and test_mutation_*.
  • The ruff, mypy and dead_key audits pass with --ci.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo

squid-protocol and others added 3 commits October 4, 2026 11:28
…s, an abend scenario

- equivalence.py / equivalence_java.py: a batch case's `entries` run the step once
  more through the service's no-argument method (executeX), compared with the same
  COBOL run; evidence.py counts each method an entry run ran as a proof root.
- readcard / readcust / readxref: an entry run for executeCbact02c / executeCbcus01c /
  executeCbact03c.
- intcalc: runBatch reads TCATBAL through readAllTcatbalFile. The proof then showed
  that the port's readAllTcatbalFile returned rows unsorted (TRANSACT 1/53 equal);
  it now reads in key order, as the KSDS does.
- useradd: the USRSEC WRITE adds the record through writeUsrsec.
- cardview: a new scenario (XCTL PGMIDERR on PF3) reaches ABEND-ROUTINE, through
  onAbendL250, the HANDLE ABEND exit of line 250.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
…vidence.py refresh --stale)

All proofs were rerun with JDK 17, the pinned oracle in strict mode, and cics-crucible v0.2.0.
Every proof is still proven. The three hc-* crucible records are left for #4325, which
re-proves them with their port changes.

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

github-actions Bot commented Oct 4, 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 4, 2026 16:17
@squid-protocol
squid-protocol merged commit 251a8cb into main Oct 4, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the feat/prove-carddemo-unproven branch October 4, 2026 16:17
squid-protocol added a commit that referenced this pull request Oct 5, 2026
…ehind them (#4342) (#4349)

* Generator: no entry points or handlers with no COBOL behaviour behind them (#4342)

The COBOL-to-Java generator wrote methods that correspond to nothing the COBOL program does, so a port
shipped Java no proof could ever run:

- executeX is written only for a program with a batch entry (runBatch), where it runs the step (no DD
  overrides, no PARM) and returns its RETURN-CODE -- comparable with the COBOL through an entry run. A
  CICS program (runTask) or a CALLed one (handleCall) gets none, and no generic controller calling one.
  The det generator follows the same rule.
- HANDLE ABEND CANCEL / RESET, and a HANDLE CONDITION naming a condition with no label, get no handler
  method: CICS never transfers control to them (the port writes them inline through its task).
- A data-driven LINK / XCTL of a CICS program is generated as the command itself through the program's
  task (task.xctl / task.link on the PROGRAM field, trailing blanks stripped): the path the proof drives.
  No switch over the candidates and no case mapping -- CICS resolves the name, and program names are
  case-sensitive -- so the old toUpperCase (Locale.ROOT or not) is gone. A candidate that receives a
  different record than the site passes is still named in the Javadoc.
- render / submit are written only when a screen controller calls them (ui.flavour thymeleaf /
  openapi-only); with ui.flavour none they were entry points no deployment reaches.

The committed ports are regenerated to match, keeping their hand-ported logic: the executeX of every CICS
and CALLed port (CALINK, CASUB, GTWORK, HCMAIN with seed / bridgeHcsub, HCQREAD, dateutil's
executeCsutldtc, ...) and the uncalled render / submit are removed; cardview's onAbendL871 and acctview's
onAbendL930 (HANDLE ABEND CANCEL) are removed; every CardDemo dispatcher is the generated one and runTask's
XCTL goes through it, one per COBOL site; the batch ports' executeX is the generated delegate.

Harness: an entry run of an int entry compares the RETURN-CODE it returns (a void one still counts as 0),
and dailyval / posttran / trnrpt gain an entry run of their executeX.

Regression tests for each shape: test_uow_transactional (CANCEL / RESET / DEFAULT), test_service_calls
(no executeX for CICS / CALLed programs, the task dispatcher), test_bms_screens (render / submit only with
a controller), test_port_tickets (the batch executeX), test_commarea_unpack, test_proof_reach (REMOVED,
NOW_REACHED).

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

* Generator: CICS entry points run the program through the region's task (#4342, #4343)

handleTransaction and handleLink were log-only stubs: REST endpoints that ran nothing. They are now
generated to run the program -- one task of it in the region (CicsTask.region()) -- so their output is
comparable with the COBOL:

- CicsTask gains the region hook: a Region gives a facade its task (transaction(transid, commarea):
  from a cleared screen the input is the transid typed, with a COMMAREA the whole record; linked(program,
  commarea): the LINK / XCTL level) and runs it. A harness joins one on its thread (CicsTask.join), so a
  facade's task is the scenario's; a deployment installs one (CicsTask.deploy); with neither, a region of
  the program alone. returned(type) is the COMMAREA the level-1 RETURN passed on.
- The generated CicsRegion bean deploys the estate's region: one temporary storage, and a LINK / XCTL
  reaching every CICS program through its service's runTask.
- A channel program (no task runtime for containers) keeps the old handlers.

The CardDemo and GenApp ports' handleTransaction / handleLink are regenerated to the new facades. The
crucible ports' are regenerated with their facade proofs (#4343).

Tests: test_cics_runtimes (the region: local, deployed, joined), test_service_calls (the facades and
CicsRegion).

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

* Generator: no executeX for a batch program either (#4342)

A batch program's entry is its JCL step: runBatch with that step's DDs and PARM. The generated
executeX ran it with no DD statements -- runBatch(List.of(), null) -- which is not the step the
COBOL runs: dailyval's entry run showed it (OPEN fails, status 35, ABEND U0999, where the COBOL
step reads its daily transactions). It passed for readcard / readcust / readxref only because those
ports read their files through repositories and ignore the DDs. So executeX (and the generic
controller calling it) is written only for a program no skeleton forge gives an entry to; the batch
ports' executeX and the readcard / readcust / readxref entry runs (#4326) are removed.

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

* WIP #4342: evidence records re-proven by the tools; tests follow the regenerated ports

evidence.py refresh --stale --skip-db2 re-proved every non-Db2 record at ec33bb3 (JDK 17, pinned
oracle strict, cics-crucible v0.2.0). test_proof_reach's survivor floor is lowered to 15 with the
reason (14 survivors left with the code #4342 removed or now runs; acctview/menu/dateutil are skipped
until their mutation re-run) -- needs owner review. WIP: EQUIVALENCE_E2E intcalc/posttran end-to-end
tests fail locally, not yet investigated.

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

* Generator: CicsRegion runs neither of two sources under one program name; its clock is the mainframe's zone (#4342)

dsf has src/R0010101.pli and src/GML/R0010101.pli: the region switch got two
case labels for one name (javac: duplicate case label, compile (dsf)) and
Set.of a duplicate. The CSD installs one of them and the estate does not say
which, so the region refuses that name rather than pick one.

LocalRegion stamped tasks with LocalDateTime.now() -- the JVM's zone (the
cultural gauntlet's rule, #3824). It now takes a clock: the generated
CicsRegion bean honours gitgalaxy.clock / gitgalaxy.zone /
gitgalaxy.culture.zone like MainframeClock; the fallback region uses the
target's culture.zone.

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

* Tests: the CardDemo INTCALC / POSTTRAN end-to-end pins follow the cases #4079 strengthened (#4342)

Both runs are equivalent (every record equal, every injected fault proven);
the EQUIVALENCE_E2E tests (skipped in CI) still pinned the record counts from
before #4079 appended the #4049 loop's records (INTCALC 50 -> 52 accounts / 53
transactions; POSTTRAN TRANFILE 262 -> 264, DALYREJS 38 -> 41). Not caused by
the generator change; stale on main too.

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

* ruff format (#4342)

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

* Mutation: acctview, menu, dateutil judged again on the regenerated ports (#4342)

mutation.py run (seed 0; acctview / menu sampled 150 as before, dateutil
all 211) at 9c21df6; mutation_scores.py build with every survivor
triaged (92 carried from the earlier run where the mutated line is the
same, 32 judged anew), spliced over the three ports' entries; table and
evidence mutation sections refreshed by the tools.

  COACTVWC  killed 105 / survived 24 (case gap 8, equivalent 16)
  COMEN01C  killed 86 / survived 50 (case gap 7, equivalent 36, unreachable 7)
  CSUTLDTC  killed 145 / survived 50 (equivalent 10, unreachable 40)

None of the three ports' survivors sits in code no proof runs any more:
the 14 the proof_reach floor lost were in the dispatchers runTask now
XCTLs through (10) and in executeCsutldtc (4, gone). The floor stays 15
-- every flagged survivor there is -- and the test now also asserts the
three ports contribute none.

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

* Db2 ports from #4416 follow the generator's #4342 rules

cbsa-inqacc, cbsa-updacc, genapp-lgicdb01, genapp-lgupdb01 arrived on main
with the old generated surface. Brought to what the generator now writes
(methods transplanted from a fresh generation, the hand-ported logic kept):
no log-only executeX; handleTransaction / handleLink run the program in the
region (UPDACC's handleLink no longer bypasses runTask); each data-driven
LINK is the command through its dispatcher, and runTask goes through it --
LGUPDB01's LINK PROGRAM(LGUPVS01) at line 209, and INQACC's six LINK
PROGRAM(WS-ABEND-PGM) sites (321, 401, 516, 738, 810, 924) each through
its own dispatcher.

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

* Evidence: every record re-proven by the tools after the merges (#4342)

evidence.py refresh --stale (Db2 included: the four #4416 ports changed
here) at d03da8b, JDK 17, strict pinned oracle, cics-crucible v0.2.0.
All 28 equivalence records proven, unapproved. The 12 crucible records
stay not-proven on their facade methods, which #4343 proves.

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

---------

Co-authored-by: Claude Opus 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