Skip to content

Split the CICS harness's stub translator into a family registry (Part of #5274) - #7436

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
refactor/5274-harness-translate-families
Nov 1, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
refactor/5274-harness-translate-families

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Part of #5274. This is step 1 of the plan in the issue comment.

Why

tests/tools/equivalence_cics.py is the file CICS slices still collide on: 45 commits since 10-24, and it held a #6072 run again this morning. _translate_command took 13 of those commits, because any new command had to edit its if chain. Plan holds work per file, so two slices collide there even when they touch different commands.

What changes

  • _translate_command is now a 15-line loop over _COMMAND_FAMILIES. A new command goes in its family's command and leaves the host alone.
  • Six new family modules, moved verbatim: counters, storage, tdqueue, terminal, program, system.
  • The existing families (filecontrol, taskcontrol, web, tempstorage, conditions, containers) each gain a command holding their dispatch.
  • The host drops from 5,782 to about 5,060 lines.

Separate fix found on the way: equivalence_cics_web.py and equivalence_cics_pointer.py were missing from the evidence and trial input lists, so a change to either did not mark proofs stale. Both are added, and a new test holds every equivalence_cics_*.py to those lists. Adding inputs changes the harness hash, so the scheduled job will re-prove harness staleness, as with earlier family splits.

CI gap closed: cics-crucible.yml's path filter named only equivalence_cics.py, so a slice editing just a family module skipped the crucible gate. This already applied to the existing families, and this PR would have widened it. The filter is now a glob, and a test pins it. This workflow edit falls under the standing workflow grant.

Behaviour is unchanged

The blocks moved by script (from the AST, in their original order), so the only edits are helper prefixes such as ec._call.

I compared the old and new translators on 167,759 EXEC CICS bodies under 3 label settings, 503,277 comparisons in all. That is every distinct body in the local corpora (1,083) plus generated malformed and option-clashing commands, comparing the emitted lines or the refusal's type, message and features.

  • Result: 0 differences.
  • Control: moving counters after containers gave 24 differences, so the check can fail. Those are the only order-sensitive commands, and a test now pins that order.

Tests

  • 101 test files that touch the harness, evidence or trial: 4,027 passed, 0 failed, 79 skipped.
  • Ruff, mypy and dead-key audits: nothing new.
  • Not run locally: cobc is not on this box's path, so tests that compile real COBOL rely on CI.

🤖 Generated with Claude Code

squid-protocol and others added 2 commits November 1, 2026 10:03
… of #5274)

_translate_command was a chain of about 60 if-blocks, so every new command
edited the harness host and plan-held any other CICS slice. It is now a loop
over _COMMAND_FAMILIES, and each family answers through its own `command`.

New families, moved verbatim: counters, storage, tdqueue, terminal, program,
system. The existing families gain a `command` holding their dispatch. The
order is the old chain's; it shows only where a counter and a container share
a verb, which the registry comment and a test pin.

Also adds the web and pointer modules to the evidence and trial inputs: a
change to either did not mark a proof stale. A test now holds every harness
family to those lists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The path filter named only tests/tools/equivalence_cics.py, so a slice that
edited a family module alone skipped the crucible gate. The registry moves
most command edits into those modules, which would have widened the gap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 1, 2026
import equivalence_common as common
import equivalence_cics_conditions as cics_conditions # #5274: the conditions / handlers family
import equivalence_cics_containers as cics_containers # #5274: the channels / containers family
import equivalence_cics_counters as cics_counters # #5274: the named counter family
import equivalence_cics_faults as cics_faults # #5274: the fault-injection planner
import equivalence_cics_filecontrol as cics_filecontrol # #5274: the file control family
import equivalence_cics_pointer # #6839 (X47): the oracle lowering of a POINTER numeric view
import equivalence_cics_program as cics_program # #5274: the program control family
import equivalence_cics_filecontrol as cics_filecontrol # #5274: the file control family
import equivalence_cics_pointer # #6839 (X47): the oracle lowering of a POINTER numeric view
import equivalence_cics_program as cics_program # #5274: the program control family
import equivalence_cics_storage as cics_storage # #5274: the storage family
import equivalence_cics_pointer # #6839 (X47): the oracle lowering of a POINTER numeric view
import equivalence_cics_program as cics_program # #5274: the program control family
import equivalence_cics_storage as cics_storage # #5274: the storage family
import equivalence_cics_system as cics_system # #5274: the remaining services
import equivalence_cics_storage as cics_storage # #5274: the storage family
import equivalence_cics_system as cics_system # #5274: the remaining services
import equivalence_cics_taskcontrol as cics_taskcontrol # #5274: the task / interval control family
import equivalence_cics_tdqueue as cics_tdqueue # #5274: the transient data family
from __future__ import annotations


import equivalence_cics_faults as cics_faults


import equivalence_cics_faults as cics_faults
import equivalence_cics as ec

import re

import equivalence_cics as ec

import re

import equivalence_cics_conditions as cics_conditions
import re

import equivalence_cics_conditions as cics_conditions
import equivalence_cics as ec
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd

squid-shepherd Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 1, 2026 15:15
@squid-shepherd

squid-shepherd Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 390d786 into main Nov 1, 2026
50 checks passed
@squid-shepherd
squid-shepherd Bot deleted the refactor/5274-harness-translate-families branch November 1, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants