Skip to content

det CICS: shared helpers in a leaf cics_common.py; cics_taskcontrol cycle-free (Part of #7153) - #7249

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/7153-20261031T0359Z
Oct 31, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/7153-20261031T0359Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #7153. Next slice after #7239 / #7231: the py/cyclic-import alerts (79 open on main), starting with the det CICS mixin cycle.

Class

py/cyclic-import: a det CICS mixin (cics_taskcontrol, ...) imports shared helpers (CicsError, _arg, _msg, G_jstr, ...) back from det/cics.py inside its methods, and G_jstr imports det/gen.py, which imports cics.py. CodeQL counts function-level imports, so every method import was an alert (11 in cics_taskcontrol.py, plus the cics.py line importing it).

Change

  • New leaf det/cics_common.py: CicsError, KeylengthInvreq, region_page, _msg, _requires, _arg, _option, _one_of, _SEND_CONTROL, jstr (moved verbatim). It imports only gitgalaxy.standards.
  • cics.py re-exports them (G_jstr = jstr), so every existing importer is unchanged; gen.py imports jstr from the leaf.
  • cics_taskcontrol.py takes its helpers from cics_common.
  • Tests: test_cics_spec.py gets an AST check that cics_common / cics_taskcontrol import neither det.cics nor det.gen (any depth), and cics_common joins the spec-importer list.
  • Golden-neutral: no generated output changes.

Sibling gaps (same mechanism, not here: 5-file cap)

  • cics_filecontrol, cics_conditions, cics_containers, cics_faults mixins: same fix (import from cics_common). No burned-estate program needs them; alert cleanup only.
  • dli.py, dyncall.py, gen.py <-> cics.py/dli/dyncall cycles (needs Untranslatable in a leaf).
  • tests/tools/equivalence* and doom_speedrun cycles.

Remaining slices

  1. The four mixins above (4 files + test). 2. Untranslatable leaf for dli/dyncall/gen. 3. tests/tools cycles.

Facts checked: test_cics_spec, test_cics_family_split, test_det_translate pass; 4193 tests in tests/cobol_mainframe + tests/cics_crucible (-k "det or cics") pass; audit_check.py all clear. CodeQL itself was not run locally (it runs on main daily); the AST test stands in.

🤖 Generated with Claude Code

…o longer imports cics/gen (Part of #7153)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 31, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 31, 2026 04:14
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Oct 31, 2026
Comment on lines +28 to +40
from gitgalaxy.tools.cobol_to_java.det.cics_common import ( # noqa: F401 -- re-exported for the mixins' old importers
_SEND_CONTROL,
REGION_PAGE,
CicsError,
KeylengthInvreq,
_arg,
_msg,
_one_of,
_option,
_requires,
jstr,
region_page,
)
from gitgalaxy.standards.cics.commands.terminal import SEND_CONTROL_OPTIONS
from gitgalaxy.standards.cics.model import GroupKind

_SEND_CONTROL = frozenset(SEND_CONTROL_OPTIONS) # #4413: its device controls
try:
if " ".encode(declared) == b"\x40":
page = declared
except (LookupError, UnicodeError):
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 31, 2026 04:23
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 1238b44 into main Oct 31, 2026
94 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/7153-20261031T0359Z branch October 31, 2026 04:58
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