Repository navigation
cobol: semantic-coverage assessment — CICS/SQL/DLI verb and JCL idiom census (#2990) - #3006
Merged
Merged
Conversation
Contributor
squid-protocol
force-pushed
the
fix/2990-cobol-semantic-coverage
branch
2 times, most recently
from
September 14, 2026 03:13
2efdb16 to
8b17b0e
Compare
…idiom census (#2990) An audit of four new CICS sample repos found that reflection_metaprogramming's bare EXEC CICS/SQL catch-all makes every embedded-language statement LOOK covered while seven verb families — most visibly the Async API (RUN TRANSID, FETCH CHILD/ANY) — carried no semantic signal, so a modern async CICS app scored arch_concurrency = 0. This is the systematic pass the issue asked for instead of seven regex additions: a committed harness (tests/tools/embedded_verb_coverage.py) that censuses every CICS/SQL/DLI verb and native-COBOL/JCL idiom the corpus contains, checks each against a hand-maintained ownership table, and exits nonzero on any unrecorded gap — the issue's own acceptance criterion, runnable in CI. cobol.py: 22 rule edits, each tagged `# #2990:` naming the family -- concurrency gains the Async API + interval/task control; io gains the VSAM browse family + named counters; safety gains unit-of-work control (SYNCPOINT/COMMIT/ROLLBACK, matching sqlite's own COMMIT/ROLLBACK classification) + the HANDLE family (moved from events, whose declared contract excludes the receiving side) + the DFHRESP(/SQLCODE value-level check family; safety_bypasses gains NOHANDLE + WHENEVER ... CONTINUE; high_risk_execution gains dynamic SQL (PREPARE/EXECUTE IMMEDIATE/TRUNCATE); ui_framework/listeners/time_date_logic/scientific/explicit_casts/ panics_and_aborts/debug_prints/memory_alloc/cleanup/ipc_rpc_bridges/ ssr_boundaries/serialization_parsing/telemetry/pointers/thread_sleeps each gain one or more real, corpus-observed idioms. Three mis-attributions the census caught and fixed (not additions): high_risk_execution's bare CANCEL token fired on the CICS ABEND/HANDLE ABEND "CANCEL" option and the CANCEL REQID interval-control command (31% of the crucible's ABEND blocks); io's bare START fired on EXEC CICS START TRANSID whenever CICS and START were separated by more than one space (a fixed-width lookbehind alone can't see a variable gap -- real shape, cics-genapp/lgwebst5.cbl); memory_alloc's bare FREE fired on FREE CHILD (an async-token release, cleanup's). tests/tools/embedded_verb_coverage.py + test_embedded_verb_coverage.py: the harness (sibling of rule_probe.py) and its own test suite. Both cobol and jcl pass --check with 0 GAP/MISMATCH against language-crucible + keyword-rosetta + a scratch clone of the three cicsdev CICS-async sample repos the issue named (not yet in the pinned corpus -- see language-crucible#26). docs/cobol_semantic_coverage.md: the generated coverage tables (122 cobol verbs, 61 jcl verbs/operands, all owned/blanket/none) plus the accepted duals, the three corrections, and the findings filed as their own issues (gitgalaxy#3002-#3005, language-crucible#26) rather than fixed here. rosetta_audit: 46/46, 0 regressions -- no keyword-rosetta plant carries any of the newly-owned tokens, so no corpus PR accompanies this one. Golden masters: 402 leaf differences, 3 topological (corpus-wide re-solve) + 399 substantive, all cobol-file-scoped (bless_scope.py: 358 per-file cobol entries, 0 newly-parsed/excluded). Blessed via a scoped diff between an unmodified-engine scan and this branch's scan of the identical corpus checkout, not a raw crucible_check.py --update -- the committed fixtures carry ~8480 pre-existing, unrelated differences from a clean scan (git- history-derived signals for files this PR never touches; filed as gitgalaxy#3005) that a naive full regeneration would have silently baked in. Closes #2990 Co-Authored-By: Claude Sonnet 5 <[email protected]>
squid-protocol
force-pushed
the
fix/2990-cobol-semantic-coverage
branch
from
September 14, 2026 03:15
8b17b0e to
d8418a9
Compare
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.
What
#2990 asked for a systematic CICS/SQL/DLI semantic-coverage assessment — not seven regex additions —
after an audit of four new sample repos found that
reflection_metaprogramming's bareEXEC CICS/SQLcatch-all makes every embedded-language statement look covered while the CICS Async API (
RUN TRANSID,FETCH CHILD/ANY) scoresarch_concurrency = 0. This PR:tests/tools/embedded_verb_coverage.py— parsesevery
EXEC CICS|SQL|DLI ... END-EXECblock (cobol) or//statement/operand (jcl) out of the codestream, runs every non-blanket rule against it, and checks the result against a hand-maintained
ownership table.
--checkexits nonzero on any unowned-and-unrecorded verb — the issue's ownacceptance criterion, runnable in CI.
cobol.py(each tagged# #2990:) for every family the census found with real hitsand no owner: the Async API + interval/task control →
concurrency; the VSAM browse family + namedcounters →
io; unit-of-work control (SYNCPOINT/COMMIT/ROLLBACK) + theHANDLEfamily + theDFHRESP(/IF SQLCODEvalue-level check family →safety(movingHANDLE CONDITIONout ofevents, whose declared contract excludes the receiving side);NOHANDLE/WHENEVER ... CONTINUE→safety_bypasses; dynamic SQL →high_risk_execution; plusui_framework/listeners/time_date_logic/scientific/explicit_casts/panics_and_aborts/debug_prints/memory_alloc/cleanup/ipc_rpc_bridges/ssr_boundaries/serialization_parsing/telemetry/pointers/thread_sleeps. Full table with reasons:docs/cobol_semantic_coverage.md.high_risk_execution's bareCANCELfiredon the CICS
ABEND/HANDLE ABENDoption and theCANCEL REQIDinterval-control command (31% of thecrucible's ABEND blocks);
io's bareSTARTfired onEXEC CICS START TRANSIDwhenever CICS andSTART were separated by more than one space (real shape,
cics-genapp/lgwebst5.cbl— a fixed-widthlookbehind alone can't see a variable gap);
memory_alloc's bareFREEfired onFREE CHILD(anasync-token release,
cleanup's).owned or recorded, closing the issue's request with a table instead of a guess.
Measured
embedded_verb_coverage.py cobol --check --extra <3 cicsdev CICS-async repos>: 0 GAP/MISMATCH on122 verbs (language-crucible + keyword-rosetta + the extras).
embedded_verb_coverage.py jcl --check: 0 GAP/MISMATCH on 61 verbs/operands.pytest tests/(full suite): 8867 passed, 0 failed, 4 skipped, 9 xfailed, 3 xpassed.tests/tools/audit_check.py: ruff/mypy/dead-key/ast-accuracy all clean against baseline.Corpus
rosetta_audit.py --allow-regressions: 46/46, 0 regressions — nokeyword-rosettaplant carriesany of the newly-owned tokens, so no corpus PR accompanies this one.
The three
cicsdevCICS-async sample repos the issue named specifically exercise the Async API rows;they aren't in
language-cruciblev1.2.0 yet (onlyaws-mainframe-modernization-carddemois), so thisPR's
--checkrun feeds them via a scratch clone. Adding them to the pinned corpus is its own follow-up(language-crucible#26) rather than a pin-bump folded into this engine PR.
Golden masters
Blessed both fixtures via a scoped diff, not a raw
crucible_check.py --update: diffed anunmodified-engine scan against this branch's scan of the identical
language-cruciblev1.2.0 checkout(isolating exactly what the cobol.py edit changed, independent of any corpus-side noise), then applied
only those 402 leaf differences onto the currently-committed fixtures.
Why not a plain regeneration: a fresh
crucible_check.pyscan of the exact pinned corpus alreadydisagrees with the committed fixtures at ~8480 locations that have nothing to do with this PR
(git-history-derived signals — Architect/Authorship Centralization/Raw Churn Frequency — for files this
PR never touches, e.g.
css/threejs_app_ui/*,sqlite/flask_tutorial_sqlite/*). Confirmed by diffing anunmodified engine against the same fixtures: the drift is already there on
main. Filed asgitgalaxy#3005 rather than silently baked into this PR's bless.
crucible_check.py's own verify legtherefore fails in this environment regardless of this PR's content;
bless_scope.py --from-head(below)is the check that actually says what moved:
Every substantive leaf key maps to a signal this PR touched (
Time Date Logic,Scientific & Mathematical Operations,Error & Exception Exposure,Defensive Programming Constructs,Testing Exposure,High-Risk Execution Commands,Explicit Type Casts,Fatal Aborts & Exceptions,Resource Deallocation & Cleanup,Emitters,Event Listeners & Subscribers,Safety Bypasses,Structured Telemetry & Logging,Concurrency Exposure,Ipc Rpc Bridges,View Layer Components, plus thecorpus-wide averages/rankings those ripple into) or is one of the 6 new keys a file's high_risk_execution
signal going non-zero adds to its "Contextual Mitigations" section for the first time.
Tests
tests/extraction/languages/test_cobol_strict.py: new positive/negative rows for every widenedalternative, extended
test_cobol_intentional_double_classification_sweepfor the new deliberateduals, a regression case for the two-space
STARTbug, a ReDoS sweep for every widened alternation.tests/tools/test_embedded_verb_coverage.py: the harness's own tests — parsing correctness (thenested-
FUNCTION-call and cross-newline-FUNCTIONbugs found while building it, the JCL in-stream-vs-real-statement anchor), the verdict machinery, and every
EXPECTED_COBOL/EXPECTED_JCLentry'sinternal consistency.
Findings filed, not fixed here (each is its own scope call)
cicsdevCICS-async repos to the pinned corpus.//SYSIN DD *) has noowner; the step-level posture (jcl: high_risk_execution counts every EXEC PGM=, so a compiler step and IEFBR14 score as arbitrary execution (design question) #2751/Extraction hardening: jcl CICS utility execution and resources #2486) argues against a rule, but the surface wasn't documented
until this pass.
curlxallocatorrefactor,
state_memory_alloc−86% in one release). Checked for the COBOL analogue (a copybook-hostedEXEC CICSblock would reproduce the same blindness) — zero of 591 corpus files do this today, so itdoesn't reproduce here, but the cross-cutting engine-design question is real.
SIGNON,VERIFY PASSWORD,EXEC SQL GRANT/REVOKE) has noowner in the base schema; a question for whichever issue governs the appsec pack's
auth_middleware.Closes #2990
🤖 Generated with Claude Code