Repository navigation
CardDemo COACCT01 / CODATE01: coverage reads cobc trace lines past a redundant period; MQ fault arms (Part of #6072) - #6828
Merged
Conversation
…iod (Part of #6072) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ledgers re-measured (Part of #6072) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… cite it; ledgers re-measured (Part of #6072) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…urns (Part of #6072) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
4 of 8 tasks
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 #6072.
What
CardDemo COACCT01 and CODATE01 showed every
WHEN MQCC-OK/ IF success arm after an MQ call as uncovered, althoughthe GnuCOBOL traces run them. The cause is trace-line drift in
tests/tools/cobol_coverage.py's reading of-ftracealloutput, not the programs.gitgalaxy-gnucobol:3): cobc does not count the newlines between a separator periodand a following redundant period (a line whose code area is only
.). Every later trace line reads that many linesearly, until the end of a COPY statement resyncs the count. COACCT01 224-226 (
PERFORM 8000-TERMINATION., blank,.) is the first occurrence, so every EVALUATE / IF after it landed on the wrong line and was never credited._traced_lines(compiled)builds the trace-line -> compiled-line map from the measured rule.LineMap.gettranslates a trace line through it first. Every caller goes through
LineMap, so no caller changes.tests/tools/test_cobol_coverage.pyfailed before the fix and pass after it. Theycover blank / comment / adjacent / same-line / repeated / COPY-resync shapes, the negatives (a normal period, a
.in a literal), and an end-to-end
hits()case.close-input-fails(MQCLOSE nth 1, 2009)error-put-fails(MQPUT nth 1, 2051)The case notes' wrong "unterminated CALL" explanation is replaced.
c20-recursive-perform-returns(new, indocs/language_status/zos_probes.json): a recursivePERFORM that ends, in CardDemo's shape. Its expected output is measured in
gitgalaxy-gnucobol:3: control returnsto each PERFORM in turn. IBM leaves the result unpredictable, so a z/OS run that prints those lines MATCHES C20 and
anything else DIFFERS.
8000-TERMINATIONwhile it is active, which is a recursive PERFORM.IBM says it "can cause unpredictable results". The oracle runs the nested range and returns, and the det runtime
matches it.
Net branches (ladder_refresh, before = origin/main)
Both cases are proven, on every scenario.
Facts checked
"A PERFORM statement must not cause itself to be executed. This constitutes a recursive PERFORM, which can cause
unpredictable results."
cobc -x -std=ibm -ftraceallingitgalaxy-gnucobol:3and reading the trace lines. The variants were blank lines, comment lines, adjacent lines,the same line, several occurrences and a COPY resync.
equivalence_mq.FAULT_REASONS(IBM MQ reason codes)._traced_lineswas run over every compiled program in the mainframe corpora, cics-crucible andestate-crucible. Only COACCT01.cbl and CODATE01.cbl have a non-empty correction, and every crucible file gives an
empty one, so no other ledger and no
cics_cruciblebaseline moves.Sibling gaps
Remaining slices
585:OTHER,608:OTHER; CODATE01489:OTHER,512:OTHER: the WHEN OTHER arms of a failed close of thereply or error queue.
re-closes it, gets 2019, takes WHEN OTHER again and recurses without end. cobc dies with rc=11 (SIGSEGV) and Java
with StackOverflowError.
close of a given queue and not the re-close.
Plan changes
_traced_linesis empty for all four programs, so none moves.reason above. The error-put arm was added. Register C20 was added as the 5th hand-written file, and its z/OS probe (needed by
test_zos_probesfor any ASSUMED entry) is a 6th, one over the brief's cap of 5.Lessons for agents
-ftracealldoes not count the newlines between a separator period and a redundant.. Trace lines driftearly until a COPY end, and
cobol_coverage._traced_linescorrects for it.audit_check.py's format check scans onlygitgalaxy/(SCAN_ROOT). Runruff format --checkon changedtests/files directly.test_*module, as a word, in atests/toolsmodule makestest_ground_truth_plan's closure "reach" itand fail. Keep test-module names out of tool docstrings.
scenario for it.
Gates
pr_gates --ratchets: 9 pass, 0 fail.pr_gates --fast: 9/9. The first run failedaffectedin two places, both fixed now:test_ground_truth_plan: a tool docstring named a test module.test_zos_probes: C20 lacked an IBM document number and a z/OS probe.audit_check.py's format check scans onlygitgalaxy/(SCAN_ROOT). Runruff format --checkon changedtests/files directly.test_*module, as a word, in atests/toolsmodule makestest_ground_truth_plan's closure "reach" itand fail. Keep test-module names out of tool docstrings.
scenario for it.
Gates
pr_gates --ratchets: 9 pass, 0 fail.pr_gates --fast: 8/9.affectedfailed ontest_ground_truth_plan, because a tool docstring named a testmodule. I fixed that, and the test file now passes (96 passed together with
test_cobol_coverage).audit_check.py: all clear.ruff format --checkon the changedtests/files: clean.register.py --check: OK.ladder_refresh.py carddemo-coacct01 carddemo-codate01: 2/2 proven (16 and 15 scenarios). The pin testspassed: 284 passed, 114 skipped.
Cross-repo: none.
🤖 Generated with Claude Code