Repository navigation
#3989 phase 2: CICS crucible runner, baseline ratchet and CI - #4000
Merged
Merged
Conversation
tests/tools/cics_crucible.py measures the CICS pipeline against squid-protocol/cics-crucible (pinned to v0.1.0 in tests/_cics_crucible_pin.py; CICS_CRUCIBLE_PATH for local checkouts). Per case: engine-facts (the scan recorded the programs, CSD transactions, BMS maps and every CICS command the expected logs show) and forge-compile (refactor, cobol-to-java h2, mvn compile). Per scenario: cobol-stub (the translated COBOL run task by task on the stub runtime in GnuCOBOL, RETURN TRANSID COMMAREA chained, XCTL run in the same task) and java (the generated services through CicsTask, driven by a generated EquivalenceRunTest). Each is compared with the hand-written expected log exactly, per SPEC section 6 (tests/tools/cics_crucible_compare.py): pass, fail at the first divergence, or unsupported naming the missing feature. The harness's translator now names each command it refuses (Unsupported.features) and refuses an undocumented DFHRESP(x) by name instead of raising KeyError. tests/cics_crucible/baseline.json ledgers the 74 cells that do not pass today (20 pass: every engine-facts and forge-compile cell; cobol-stub 37 unsupported; java 12 fail at the generated runTask stub, 25 unsupported). cics-crucible.yml clones the crucible at the pin (read from the pin file, so fork PRs work), runs the runner's tests with the fixture case end to end, and fails on a cell not ledgered or a ledgered cell that now passes. docs/language_status/cics_crucible.md is the generated report: counts per trap and side, failure reasons, and the harness work ordered by the cells it unlocks. docs/ecosystem.md gains cics-crucible and its release -> pin bump workflow. Part of #3989 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EC8FWfn3aPmsUPnRgKNVup
The repo-wide *.json ignore rule dropped tests/cics_crucible/baseline.json and the fixture case's case.json and expected log from the first commit; un-ignore them beside the other committed ledgers. Part of #3989 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EC8FWfn3aPmsUPnRgKNVup
Comment on lines
+1120
to
+1121
| "Every cell that does not pass is ledgered in `tests/cics_crucible/baseline.json`, and CI " | ||
| "(`cics-crucible.yml`) holds the ledger as a ratchet.", "", |
Comment on lines
+1147
to
+1151
| "Each missing feature belongs to a piece of harness work (below: the features themselves). A cell is " | ||
| "*unlocked* when every piece its features need is done: it then gets a pass or fail verdict rather " | ||
| "than `unsupported`. **needs** counts the cells that do not pass and need the piece, **alone** the " | ||
| "unsupported cells it unlocks by itself, and **cumulative** the unsupported cells unlocked by it and " | ||
| "every row above it (rows are chosen greedily).", ""] # fmt: skip |
Comment on lines
+1163
to
+1165
| "Each feature a cell needs that its side does not model (`translator:` the COBOL translator refuses " | ||
| "the command; `stub:` the stub runtime does not record it; `CicsTask:` the generated Java runtime " | ||
| "does not; `scheduler:` the task driver).", ""] # fmt: skip |
Contributor
tests/test_source_reads.py forbids lossy errors= handlers. Neither was needed: the stub runtime's latin-1 decodes every byte and cp037 encodes every latin-1 character, so the transcoding is strict and would raise rather than hide a byte it cannot map. Part of #3989 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EC8FWfn3aPmsUPnRgKNVup
This was referenced Sep 29, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3989 (phase 2: the measuring instrument, not the fixes).
What this adds
tests/tools/cics_crucible.py(CLI + importable) runs every case of cics-crucible and produces one verdict per cell = (case, scenario, side):engine-facts(per case): the scan recorded the case's programs, CSD transactions, BMS maps, and every CICS command its expected logs show (SEND/RECEIVE MAP, LINK, XCTL, RETURN TRANSID, START, RETRIEVE, CANCEL, READQ/WRITEQ TS, ABEND ABCODE, HANDLE ABEND exits taken).forge-compile(per case): refactor, thencobol-to-java(configh2, the equivalence harness's), thenmvn compile.cobol-stub(per scenario): the translator (equivalence_cics.py) plus the stub runtime (ggcics.c) in GnuCOBOL. It is driven task by task: RETURN TRANSID + COMMAREA chain the terminal steps, and an XCTL runs its target in the same task. It uses one long-lived container per case, run as the caller's uid.java(per scenario): the generated services'runTask(CicsTask), driven the same way by a generatedEquivalenceRunTest(reflection only, so it compiles for cases with no BMS map).tests/tools/cics_crucible_compare.pyis the exact comparison of SPEC §6. Text is EBCDIC and padded to its known length (trailing blanks are optional, embedded ones are not). Hex is compared as exact bytes and numeric fields as numbers. Areas are compared by layout, with DISPLAY bytes transcoded and COMP/COMP-3 bytes kept. Each side declares itsCapabilities. The walk stops at the first decisive point: a modelled divergence is a fail, and an expected event or key the side cannot record is unsupported: . A stub that records nothing therefore fails at its first missing event, unless that event is one the side cannot record at all.tests/_cics_crucible_pin.pyhasPINNED_REF = "v0.1.0"on one line, and the workflow reads it with sed.CICS_CRUCIBLE_PATHpoints at a local checkout, andCICS_CRUCIBLE_ALLOW_UNPINNED=1allows a deliberate off-pin run. This deviates from the plan comment on purpose: there is noCICS_CRUCIBLE_REFrepository variable. The file is the single source, which is fork-safe with no fallback logic.tests/cics_crucible/baseline.jsonholds every cell that does not pass, with its status and reason, one line per cell.--cifails on a cell that isn't ledgered, and on a ledgered cell that now passes (lower it with--update-baseline). On a complete run it also fails on a ledgered cell that was never measured.docs/language_status/cics_crucible.mdis written with the baseline. It gives counts per side and per trap/case, failure reasons grouped, and the harness work ordered greedily by the cells it unlocks, plus the per-feature counts..github/workflows/cics-crucible.ymlclones the crucible at the pin, builds the GnuCOBOL image, and sets up JDK 17 + Maven (cached). It runs the runner's own tests withEQUIVALENCE_E2E=1, then--ci, and publishes the report to the step summary and as an artifact.tests/cics_crucible/test_cics_crucible_runner.py, 28 without Docker/Maven): case.json/CSD parsing and the format guard, COPY-expanded layouts, every comparison rule, the stub-log and Java-output adapters, translator features, the ratchet, the report, and the pin's one-line form. There is also one gated E2E test on a fixture case in crucible format (tests/cics_crucible/fixture/, which the crucible'svalidate.pyaccepts). Its COBOL passes end to end on the stub: 3 tasks, a COMMAREA chain and an XCTL hop. Its Java fails at event 1 on therunTaskstub. This proves the drivers work, since no crucible cell can pass yet.equivalence_cics.Unsupportednow carriesfeatures(LINK,READQ TS,HANDLE CONDITION,RECEIVE, ...). An undocumentedDFHRESP(x)is now refused by name instead of raisingKeyError. Implementing the missing CICS runtime is phase 3.docs/ecosystem.mdadds cics-crucible to the constellation map, plus the release -> pin bump workflow.docs/language_status/README.mdlinks the report.Baseline at v0.1.0 (94 cells)
runTaskrecords no events, because it is the generated stub and the PROCEDURE DIVISION is not ported. They are the map-driven cases (hx-, pc-), whose first event CicsTask can record.stub: SEND-MAP cursor(BMS output resolution isn't modelled). The other 31 cannot be translated (translator: ...).Harness work, ordered by the unsupported cells it unlocks (cumulative):
Found on the way (for phase 3, not fixed here)
equivalence_common.layout_fieldslays out a record as written. A nestedCOPYis dropped silently, and every later field shifts: CALINK'sWS-AFTER-FLAGlands at offset 0 instead of 100. The runner inlines COPY members first (expand_copies).equivalence_cics.dto_shapefinds a class by simple name, and the contract DTOdto/contract/PcwizWsStateshares its name withentity/PcwizWsState, so the mapping came back empty. The runner resolves the DTO by its fully qualified path.handleLinkbut norunTask, so the Java side cannot run it as part of a task.Cross-repo
v0.1.0(0c942cb8). This PR pins that tag.--update-baseline, and commit the pin, baseline and report together (docs/ecosystem.md, "CICS crucible release -> pin bump"). Phase-3 PRs lower the ledger the same way, and CI fails until they do.Verification
pytest tests/cics_cruciblepasses 29 withEQUIVALENCE_E2E=1(Docker GnuCOBOL + JDK 17).tests/cobol_mainframepasses (1077 passed, 33 skipped), and the CardDemo CICS E2E still passes with the translator change.cics_crucible.py --ciis green against the committed baseline (about 1 min locally, offline Maven).tool_regex_redos --ciare clean.ruff format --checkpasses on the touched files with CI's ruff 0.16.0.🤖 Generated with Claude Code
https://claude.ai/code/session_01EC8FWfn3aPmsUPnRgKNVup