Repository navigation
#4023 follow-up: prove error paths -- file / CICS fault injection on both sides of the equivalence harness - #4029
Merged
Conversation
… on both sides of the equivalence harness A proof only covered the success path. CardDemo's programs are mostly error handling (file status checks, abends, RESP arms), and the normal run reaches about half their branches. A case's faults now inject the same condition on both sides, at the same statement. Each fault run is proven like the normal run. - GnuCOBOL: tests/equivalence/faults/ggfault.c is preloaded in front of libcob's file I/O (OPEN / CLOSE / READ / WRITE / REWRITE / DELETE / START). A planned statement returns its FILE STATUS and I/O exception instead of running. ggabend.c is CEE3ABD: it records ABEND Unnnn. - Java: the generated batch runtime gains CobolFiles (one call per I/O statement: the status the COBOL would see, plus the same plan and counting) and CobolAbend. CicsTask gains read(file, lookup) and withFaults. The CICS stub's READ reads the same plan. - Porting rules: an abend is CobolAbend.user; every batch I/O statement goes through CobolFiles; a CICS file READ goes through task.read, with every RESP arm ported. - The harness: faults in case.json (batch) or a scenario (CICS), --faults. A run is proven when both sides abend with the same code, or neither does and RETURN-CODE and outputs are equal, and the same faults fired (at least one). - INTCALC: 19 faults, the port rewritten onto CobolFiles. All 20 runs are proven, and COBOL coverage goes from 46/86 to 82/86 branches and 20/22 to 22/22 paragraphs. The 4 outcomes left are data gaps or unreachable. ACCTVIEW: 6 fault scenarios, the port's WHEN OTHER arms ported, all 11 scenarios proven, and 39/71 -> 47/71 branches. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
Contributor
squid-protocol
added a commit
that referenced
this pull request
Sep 30, 2026
…CardDemo, cobol4j) (#4027) * #4023: COBOL paragraph / branch coverage per program, for the CICS crucible, CardDemo and cobol4j A proven port only proves the paths its scenarios run. tests/tools/cobol_coverage.py says which ones those are. The COBOL is compiled with cobc -ftraceall and run with COB_TRACE_FILE. Per program it reports the live paragraphs and sections entered, the IF / EVALUATE outcomes taken, and the HANDLE labels entered. Dead code (the engine's reachability: procedure_units / reachable_units) is listed apart from code no scenario reaches. Branch points come from the original source, and a trace line maps back through a difflib alignment, so the CICS translator's rewritten lines and its own IFs are handled. An IF whose arms cannot be told apart by (line, verb) is listed as unresolvable, not guessed. - CICS crucible: the cobol-stub side is traced. The report has a COBOL coverage section with each ported program's claim ("proven on N scenarios, covering X/Y paragraphs and A/B branches") and the live code no scenario reaches (scenarios to propose). tests/cics_crucible/coverage.json holds what each passing scenario executes, and --ci ratchets it. A port proof (--report-dir) carries its claim. - CardDemo (equivalence.py, batch and CICS): each run writes coverage.json, and the report gives the claim when proven. - cobol4j: `cobol_coverage.py autotest` runs at_extract cases under GnuCOBOL with shims for ${COMPILE} / java. The trace also shows units the engine's unit reader misses: non-ASCII names, and paragraphs named END-... (#4026, field-testing D036). They are reported as "unread", not counted. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4023: freeze cobol_coverage.py with the trial harness; tidy the report section Every equivalence run now goes through tests/tools/cobol_coverage.py, so it belongs in trial.py's HARNESS_PATHS with the rest of the frozen harness. The harness report's coverage section no longer repeats a blank line. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4023 follow-up: prove error paths too -- file / CICS fault injection on both sides of the equivalence harness (#4029) A proof only covered the success path. CardDemo's programs are mostly error handling (file status checks, abends, RESP arms), and the normal run reaches about half their branches. A case's faults now inject the same condition on both sides, at the same statement. Each fault run is proven like the normal run. - GnuCOBOL: tests/equivalence/faults/ggfault.c is preloaded in front of libcob's file I/O (OPEN / CLOSE / READ / WRITE / REWRITE / DELETE / START). A planned statement returns its FILE STATUS and I/O exception instead of running. ggabend.c is CEE3ABD: it records ABEND Unnnn. - Java: the generated batch runtime gains CobolFiles (one call per I/O statement: the status the COBOL would see, plus the same plan and counting) and CobolAbend. CicsTask gains read(file, lookup) and withFaults. The CICS stub's READ reads the same plan. - Porting rules: an abend is CobolAbend.user; every batch I/O statement goes through CobolFiles; a CICS file READ goes through task.read, with every RESP arm ported. - The harness: faults in case.json (batch) or a scenario (CICS), --faults. A run is proven when both sides abend with the same code, or neither does and RETURN-CODE and outputs are equal, and the same faults fired (at least one). - INTCALC: 19 faults, the port rewritten onto CobolFiles. All 20 runs are proven, and COBOL coverage goes from 46/86 to 82/86 branches and 20/22 to 22/22 paragraphs. The 4 outcomes left are data gaps or unreachable. ACCTVIEW: 6 fault scenarios, the port's WHEN OTHER arms ported, all 11 scenarios proven, and 39/71 -> 47/71 branches. Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ Co-authored-by: Claude Opus 5.5 <[email protected]> * #4023: each multi-line report string one parenthesised string (CodeQL implicit concatenation) CodeQL's py/implicit-string-concatenation-in-list flagged four report paragraphs split over several source lines inside a list (alerts 1205-1208). Each is now one parenthesised string, as #3762 did for the porting rules. The generated text is unchanged: the crucible report regenerated from the same results is byte-identical. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Follow-up to #4023. Stacked on #4027, so it targets that branch. Retarget to
mainonce #4027 merges.Why
#4023's coverage showed that a CardDemo proof covered only the success path. Those programs are mostly error handling: file status checks, abends and RESP arms. The normal INTCALC run reached 46 of 86 branch outcomes. This PR injects the same fault on both sides at the same statement, and proves each fault run the same way as the normal run.
How
tests/equivalence/faults/ggfault.c, preloaded in front of libcob's OPEN / CLOSE / READ / WRITE / REWRITE / DELETE / START. A planned statement sets its FILE STATUS and I/O exception, as libcob does for a real failure, and does nothing elseCobolFiles(batch runtime): one call per COBOL I/O statement. It returns the status the COBOL would see (00/23/10/35), with the same plan and the same countingggabend.cisCEE3ABD: it recordsABEND UnnnnCobolAbend.user(abcode, why)ggcics.c) readsfaults.cfg:READ FILE NTH RESP RESP2CicsTask.read(file, lookup)andwithFaultsfaults(batch) or a scenario'sfaults(CICS). The CLI takes--faults all|none|NAME,....CobolAbend.user; every batch I/O statement goes throughCobolFiles, in program order; a CICS file READ goes throughtask.read, with every RESP arm ported.Results
CobolFiles.WHEN OTHERarms (WS-FILE-ERROR-MESSAGE) are now ported.File Error: READ on CXACAIX returned RESP 000000019 ,RESP2 000000000.ABEND: COBOL U0999, Java None).Verification
tests/cobol_mainframe/test_equivalence_faults.py(plan format, selection, run judgement, CICS conditions, generated runtime and rules). WithEQUIVALENCE_E2E=1it also drives the GnuCOBOL shim and abend stub on a small program. The INTCALC e2e test now requires all 19 faults proven.tests/cobol_mainframe+tests/cics_crucible+ the coverage tests: 1170 passed, 9 skipped (plainpytest, outside the repo).--cion this branch: cells (94/37/0) and the coverage ledger unchanged.CicsTaskand the stub changed without effect.audit_check.pyall clear.trial.py checkpasses; the fault stubs joinHARNESS_PATHS.equivalence.py run carddemo-intcalcandrun carddemo-acctviewboth proven, on JDK 17.Not in this PR
CobolAbendinto a step ABEND for COND processing. It fails the job, which it already did for any exception.🤖 Generated with Claude Code
https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ