Skip to content

cobol: semantic-coverage assessment — CICS/SQL/DLI verb and JCL idiom census (#2990) - #3006

Merged
squid-protocol merged 1 commit into
mainfrom
fix/2990-cobol-semantic-coverage
Sep 14, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/2990-cobol-semantic-coverage

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

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 bare EXEC CICS/SQL
catch-all makes every embedded-language statement look covered while the CICS Async API (RUN TRANSID,
FETCH CHILD/ANY) scores arch_concurrency = 0. This PR:

  1. Commits the reusable harness the issue asked for: tests/tools/embedded_verb_coverage.py — parses
    every EXEC CICS|SQL|DLI ... END-EXEC block (cobol) or // statement/operand (jcl) out of the code
    stream, runs every non-blanket rule against it, and checks the result against a hand-maintained
    ownership table. --check exits nonzero on any unowned-and-unrecorded verb — the issue's own
    acceptance criterion, runnable in CI.
  2. 22 rule edits in cobol.py (each tagged # #2990:) for every family the census found with real hits
    and no owner: the Async API + interval/task control → concurrency; the VSAM browse family + named
    counters → io; unit-of-work control (SYNCPOINT/COMMIT/ROLLBACK) + the HANDLE family + the
    DFHRESP(/IF SQLCODE value-level check family → safety (moving HANDLE CONDITION out of
    events, whose declared contract excludes the receiving side); NOHANDLE/WHENEVER ... CONTINUE →
    safety_bypasses; dynamic SQL → high_risk_execution; plus 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. Full table with reasons: docs/cobol_semantic_coverage.md.
  3. Three corrections the census caught (not additions): high_risk_execution's bare CANCEL fired
    on the CICS ABEND/HANDLE ABEND 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 (real shape, cics-genapp/lgwebst5.cbl — a fixed-width
    lookbehind alone can't see a variable gap); memory_alloc's bare FREE fired on FREE CHILD (an
    async-token release, cleanup's).
  4. JCL required no rule edit — the sibling pass confirmed every statement/operand the corpus uses is
    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 on
    122 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 — no keyword-rosetta plant carries
any of the newly-owned tokens, so no corpus PR accompanies this one.

The three cicsdev CICS-async sample repos the issue named specifically exercise the Async API rows;
they aren't in language-crucible v1.2.0 yet (only aws-mainframe-modernization-carddemo is), so this
PR's --check run 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 an
unmodified-engine scan against this branch's scan of the identical language-crucible v1.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.py scan of the exact pinned corpus already
disagrees 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 an
unmodified engine against the same fixtures: the drift is already there on main. Filed as
gitgalaxy#3005 rather than silently baked into this PR's bless. crucible_check.py's own verify leg
therefore fails in this environment regardless of this PR's content; bless_scope.py --from-head (below)
is the check that actually says what moved:

402 differences: 3 topological (X/Y/Z re-solve), 399 substantive
by language (per-file entries): 358 cobol
newly parsed (was excluded): none
newly excluded (was parsed): none

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 the
corpus-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 widened
    alternative, extended test_cobol_intentional_double_classification_sweep for the new deliberate
    duals, a regression case for the two-space START bug, a ReDoS sweep for every widened alternation.
  • tests/tools/test_embedded_verb_coverage.py: the harness's own tests — parsing correctness (the
    nested-FUNCTION-call and cross-newline-FUNCTION bugs found while building it, the JCL in-stream-vs-
    real-statement anchor), the verdict machinery, and every EXPECTED_COBOL/EXPECTED_JCL entry's
    internal consistency.

Findings filed, not fixed here (each is its own scope call)

  • language-crucible#26 — add the three cicsdev CICS-async repos to the pinned corpus.
  • gitgalaxy#3002 — JCL in-stream payload grammar (SQL DCL/DDL, IDCAMS/DSN under //SYSIN DD *) has no
    owner; 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.
  • gitgalaxy#3003 — idiom-wrapper tracking (the issue's own follow-up comment: curl's curlx allocator
    refactor, state_memory_alloc −86% in one release). Checked for the COBOL analogue (a copybook-hosted
    EXEC CICS block would reproduce the same blindness) — zero of 591 corpus files do this today, so it
    doesn't reproduce here, but the cross-cutting engine-design question is real.
  • gitgalaxy#3004 — COBOL's auth surface (SIGNON, VERIFY PASSWORD, EXEC SQL GRANT/REVOKE) has no
    owner in the base schema; a question for whichever issue governs the appsec pack's auth_middleware.
  • gitgalaxy#3005 — the pre-existing golden-master environment drift described above.

Closes #2990

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the legacy-modernization COBOL refractor, dead-code extraction, and JCL forging label Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol force-pushed the fix/2990-cobol-semantic-coverage branch 2 times, most recently from 2efdb16 to 8b17b0e Compare September 14, 2026 03:13
…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
squid-protocol force-pushed the fix/2990-cobol-semantic-coverage branch from 8b17b0e to d8418a9 Compare September 14, 2026 03:15
@squid-protocol
squid-protocol merged commit 5b8c132 into main Sep 14, 2026
32 checks passed
@squid-protocol
squid-protocol deleted the fix/2990-cobol-semantic-coverage branch September 14, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

legacy-modernization COBOL refractor, dead-code extraction, and JCL forging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COBOL semantic-coverage assessment: new CICS corpus revealed 7 uncovered verb families (Async API scores zero concurrency)

2 participants