Skip to content

Crucible ports: run the HANDLE CONDITION / ABEND handlers through the proof (HCQREAD, HCMAIN, HCSUB) - #4325

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

squid-protocol merged 5 commits into
mainfrom
feat/prove-crucible-unproven

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Follow-up to #4316 (evidence records). This covers the crucible lane for the 12 crucible ports that the evidence policy (PORTED_UNPROVEN_POLICY = "block") reports as not proven.

What this does

Three ports each defined their HANDLE CONDITION / HANDLE ABEND handler methods with real bodies. Nothing called them, not the proof and not the app: runTask took the same transfers inline, so the handlers were duplicates. Each transfer that a handler takes now goes through that handler, so the crucible proof runs it:

port handlers now run by the proof
hc-perform-range/HCQREAD onConditionQiderrL25, onConditionItemerrL25, onConditionErrorL25, onConditionItemerrL56 (through a new goTo), and current
hc-abend-link/HCMAIN onConditionQiderrL25, onAbendL26
hc-abend-link/HCSUB onAbendL32
  • The crucible proofs stay green. HCQREAD passes 4/4 scenarios, HCMAIN 5/5 and HCSUB 3/3, at cics-crucible v0.2.0.
  • Every handler actually ran. Each one's log line appears in the Java runs of the crucible scenarios, so these are not handlers that are only reachable on paper.
  • Records: the evidence records and the provenance.json reproven entries were written by evidence.py prove and crucible_port_provenance.py reprove. Nothing was edited by hand.

These three ports are still not proven. Each still has a controller entry that no harness drives: executeHcqread and handleTransaction; executeHcmain, bridgeHcsub and seed; handleLink. The other 9 crucible ports are unchanged; their methods are all of that kind. See "Needs an owner decision" below.

Test changes (please review)

tests/cobol_mainframe/test_proof_reach.py:

  • NAMED no longer lists the 3 handlers that are now reached. A new NOW_REACHED test pins them as reached.
  • test_every_survivor_in_code_no_proof_runs_was_triaged_as_out_of_the_proofs_reach maps Mutation testing of every proven port: measure what "proven" means #4047's survivors onto the port by line number. For a port that has changed since its mutation run, both the line numbers and the triage describe different code.
    • The check now skips a port whose evidence record shows that the port changed since the mutation run (mutation.inputs.port ≠ inputs.port).
    • The count drops from ≥37 to ≥29. The 8 survivors that dropped out are in hc-abend-link and hc-perform-range; those ports' mutation sections already show stale.
    • A mutation run on those two cases would restore the full check.

Needs an owner decision (not changed here)

These are controller-style entry points: Spring façades that build their own CicsTask (or none) and call runTask. The crucible harness drives runTask only, and the task a façade builds internally is invisible to it. None of them can be compared with the COBOL without new harness support. That support would be a hook in the shipped CicsTask runtime, so that a façade's task adopts and reports to the scenario's environment. Options per method: (a) build that hook, (b) revert the method to its generated form, or (c) keep it as a reported exception.

  • executeCalink (CALINK): it only throws UnsupportedOperationException, so there is no COBOL behaviour to compare.
  • executeCasub, handleLink (CASUB): an alternate implementation that writes TS through a repository, not the task.
  • handleLink, handleTransaction, returnedCommarea (CAXB); handleTransaction (PCDETL, PCMENU); handleLink, handleTransaction, returnedCommarea (PCWIZ).
  • executeGtwork (GTWORK), executeHcmain / bridgeHcsub / seed (HCMAIN): mini-runtimes with their own TS seeding.
  • executeHcqread, handleTransaction (HCQREAD); handleLink (HCSUB).
  • Screen REST hooks: renderHxm1, submitHxm1, handleTransaction (HXATTR); submitHxm2, handleTransaction (HXEXT); renderPcm1, renderPcm2, submitPcm1 (PCWIZ).
    • They rebuild screens outside runTask, without the Send's subfields and options.
    • HXEXT handleTransaction returns a fresh WS-CA and never runs the program.

Checks

  • test_proof_reach, test_evidence, tests/cics_crucible, and the mutation suites pass.
  • ruff, mypy and dead_key audits pass with --ci.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo

squid-protocol and others added 5 commits October 4, 2026 11:36
…ports define

HCQREAD, HCMAIN and HCSUB each defined the generated handler methods (onConditionXxxLnn,
onAbendLnn) with bodies, but no code called them. runTask took the same transfers itself. Each
transfer that a handler takes now goes through that handler, so the crucible proof runs the
handlers:
- HCQREAD: QIDERR L25, ITEMERR L25, ERROR L25 and ITEMERR L56, via goTo;
- HCMAIN: QIDERR L25 and the HANDLE ABEND exit of line 26;
- HCSUB: the HANDLE ABEND exit of line 32.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
… survivors are checked only on the ports they were mutated in

- NAMED keeps the #4255 examples that are still unreached. NOW_REACHED pins the handlers
  that the proof now runs.
- A #4047 survivor's line number and triage describe the port as it was mutated. The
  survivor check now skips ports whose evidence record shows the port changed since the
  mutation run (mutation.inputs.port differs from inputs.port). The next mutation run
  judges those ports again.

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 4a00437 into main Oct 4, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the feat/prove-crucible-unproven branch October 4, 2026 16:17
squid-protocol added a commit that referenced this pull request Oct 4, 2026
…io, intcalc key-order fix (#4326)

* Prove the CardDemo ports' unproven methods: entry runs, routed helpers, 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

* Evidence: re-prove intcalc, cardview, useradd, readcard, readcust, readxref

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

* Evidence: re-prove the records this branch's harness change staled (evidence.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

---------

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