Skip to content

standards/cics: the CICS command spec, with equality tests against every copy (#4270, spec PR 1) - #4589

Merged
squid-protocol merged 2 commits into
mainfrom
feat/4270-cics-spec-pr1
Oct 6, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
feat/4270-cics-spec-pr1

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Part of #4270 (spec PR 1 of docs/language_status/cics_command_spec.md, section 7).

What

  • gitgalaxy/standards/cics/: stdlib-only frozen dataclasses (model.py: Arg, Refusal, RuntimeRefusal, Outcome, Group, Fact, EngineFacts, Impl, Command, a STATES vocabulary), each checked in __post_init__; resp.py (DFHRESP, 104 names + the DSIDERR alias; the 10 default abend codes with verified IBM topics); commands/ with full entries for the 9 slice 1-4 commands: PUT / GET / DELETE CONTAINER, START, RETRIEVE, CANCEL, RUN, ASSIGN, SEND TEXT (options with kinds/widths, 64 refused options with today's reasons word for word, option groups with today's messages, 32 outcomes with RESP2, runtime refusals, ASSIGN's 4 stated facts, engine facts, impl pointers, register, event name). IBM URLs checked by page title.
  • CLI python -m gitgalaxy.standards.cics emit [--json] | check | regen --out DIR (regen renders CicsSpec.java / ggcics_spec.h; both compile with javac 17 / gcc. PR 4 commits them and adds the drift test; PR 1 commits no generated file).
  • Lazily importable, no engine dependency: import gitgalaxy.standards.cics loads only its __init__; entries load on first use; tests prove stdlib-only imports and that nothing in gitgalaxy/ imports the spec yet (an IMPORTERS set each later PR extends). No behaviour change.
  • Transitional equality tests tests/cobol_mainframe/test_cics_spec_equality.py, each docstring naming the PR that deletes it: det/cics.py (DFHRESP, OPTIONS, the three *_REFUSED_WHY tables, TEXT_OPTIONS, check_options messages for every refused option, all together and an unknown one, group messages); equivalence_cics.py (DFHRESP, CICS_RESP, _CONTAINER_OPTIONS, RUN / ASSIGN allow-lists and widths, interval and SEND TEXT deny-lists, Unsupported features per refused option, group messages); the Java switches (DetCics.condition / resp, CicsTask.respName / abcodeFor); ggcics.c (every condition enum, condition_abcode); cics_crucible.CONDITION_ABCODE, REGION_USERID / REGION_SCREEN; runtime refusal texts in each runtime; stated facts (withX, $GGCICS_X); engine verb tables (_CONTAINER_VERBS, _TASK_VERBS, _CHANNEL_VERBS).
  • Oracle guard: crucible_case.py check-hand-derived names gitgalaxy.standards.cics in its denied set, checked before ALLOWED_EXTRA (a test widens the allow-list to gitgalaxy and the spec is still refused, incl. from gitgalaxy.standards import cics); tests that crucible_events.py imports only the stdlib and that no Python file in the cics-crucible checkout imports the spec.
  • Design doc: CODEOWNERS dropped (owner decision) from section 2, the PR 1 row and decision 1; PR 2's count corrected to "the other 34" (43 OPTIONS commands - these 9).

Disagreements found between copies (recorded, not silently resolved)

Each is an expected-difference table in the equality test, asserted exactly (it can neither grow nor be fixed unnoticed):

  1. DFHRESP: the harness's table (101 names) lacks VOLIDERR 71, RESIDERR 75, NOSPOOL 80, which det/cics.py has. The spec keeps them (no case names them). PR 3.
  2. Cross-command refusal reasons in the translator: _REFUSED_WHY is keyed by option alone, so e.g. GET CONTAINER WAIT is refused with RETRIEVE's WAIT reason and RUN SYSID with START's. Per command: PUT 13, GET 10, DELETE CONTAINER 16, START 10, RETRIEVE 14, RUN 16 leaked options. The spec gives these no reason. PR 2 must choose: keep a global fallback or rebaseline (no corpus program hits one).
  3. The harness ignores unknown options on START, RETRIEVE, CANCEL and SEND TEXT (deny-lists), where the translator refuses them (allow-lists). PR 3.
  4. Option rules the harness does not check: LENGTH with FLENGTH (START / RETRIEVE: it takes LENGTH), START LENGTH without FROM.
  5. Group messages worded differently in the harness: CONTAINER missing (... without a name vs the translator's generic EXEC CICS option needs an argument), PUT two data types, START two expiry options / HOURS without AFTER (bare feature, no reason), CANCEL without REQID (no : only CANCEL REQID is modelled). PR 3.
  6. Runtime refusal texts differ between the runtimes, e.g. ASSIGN STARTCODE in a RUN child: Java (IBM lists no code for one) vs C : IBM lists no code for it; unstated facts: Java ASSIGN STARTCODE: how the task was started is not stated (withStartcode) vs C ASSIGN %s: not stated for this task; GET CONTAINER FLENGTH below zero: C refuses it explicitly, Java via DetCics.containerLimit's text. The spec keeps both texts for now (RuntimeRefusal.java / .c). PR 5.
  7. Partial-by-design tables (Java condition 24 arms / resp 19, respName 19, ggcics 19 condition enums spread over 3 enums): every arm equals the spec. The abend table is the same 10 entries in all 3 implementation copies. (crucible_events.ABEND_FOR is the oracle's own 8-entry table, not compared here: section 6, PR 6's report-only cross-check.)

Also noticed, not tested (semantics, not tables): SEND TEXT's stub passes only ERASE / FREEKB / ALARM / WAIT / LAST in GG-FLAGS, while the Java side records every TEXT_OPTIONS flag (CURSOR, PRINT, INVITE ...) in the event.

Checks

  • New tests: tests/core_engine/test_cics_spec.py (22), tests/cobol_mainframe/test_cics_spec_equality.py (72), guard tests in tests/tools/test_crucible_case.py (+7; the crucible scan runs with a checkout, else skips). All pass (translator extra present; no det skip).
  • ruff 0.16.0 check + format clean, mypy clean on the new package.
  • pr_gates.py --ratchets: 6 pass, 0 fail, 0 skipped (with a private cics-crucible clone at the pin v0.5.0; the shared cics-crucible-pin checkout is at v0.3.0, which also makes test_events_table_matches_the_crucible_schema fail locally on main).
  • Full pr_gates.py: 7/7 pass (lint, audits, secrets, xray, gauntlet, golden, suite) after fixing two findings of the first run (a dead-key lead in the CLI's emit summary; a lossy errors= read in the new crucible guard test).

No golden-master, ledger or baseline change: nothing reads the spec.

🤖 Generated with Claude Code

https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6

…ery copy (#4270, spec PR 1)

gitgalaxy/standards/cics/: stdlib-only frozen dataclasses (model.py), DFHRESP and
the default abend codes (resp.py), full entries for the slice 1-4 commands (PUT /
GET / DELETE CONTAINER, START, RETRIEVE, CANCEL, RUN, ASSIGN, SEND TEXT) with
today's refusal texts word for word, and the cics_spec CLI (emit / check / regen,
python -m gitgalaxy.standards.cics). Lazily importable; nothing reads it yet.

Transitional equality tests (tests/cobol_mainframe/test_cics_spec_equality.py)
prove the spec equals det/cics.py, equivalence_cics.py, the Java switches
(CICS_TASK_JAVA, DetCics.java), ggcics.c, cics_crucible.py and the engine verb
tables; each names the spec PR that deletes it. Where copies disagree the
difference is listed with its reason and asserted exactly.

crucible_case.py check-hand-derived names the spec in its denied set ahead of
the allow-list; tests prove crucible_events.py and the crucible's Python never
import it. The design doc drops the CODEOWNERS entry (owner decision).

Part of #4270.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6
@squid-protocol squid-protocol added enhancement New feature, sensor, or structural signature legacy-modernization COBOL refractor, dead-code extraction, and JCL forging labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 6, 2026 23:28
@squid-protocol
squid-protocol merged commit 8fdbe97 into main Oct 6, 2026
26 checks passed
@squid-protocol
squid-protocol deleted the feat/4270-cics-spec-pr1 branch October 6, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, sensor, or structural signature legacy-modernization COBOL refractor, dead-code extraction, and JCL forging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant