Skip to content

Engine scan side: tabs and the REPLACE statement pinned on authored programs (Part of #8412) - #8991

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/8412-20261122T0623Z
Nov 22, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/8412-20261122T0623Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #8412

What

The det reader's side of "do tab characters and the REPLACE statement reach the det path correctly?" landed in #8654. This pins the other side, the engine scan (extract_boundary, which feeds record_data / data_move_data), on authored programs with invented names. Probed first with a real galaxyscope --db-only scan of one program: the same results as the in-process tests.

Findings, each now a test (tests/cobol_mainframe/test_engine_tab_replace_8412.py, test-only, no engine change):

  • A tab in columns 1-7 (\t01 X, \t\t 05 X), a tab between tokens and a tab in a comment line do not hide, merge or rename a declaration; line numbers stay consecutive; a tab-led MOVE is still a data move.
  • A REPLACE statement (==a== BY ==b==., two-line, REPLACE OFF.) is not taken as a data item and hides no neighbour; REPLACE-FLAG / REPLACER are items.
  • The extractor does NOT apply a REPLACE statement: the record and the MOVE target stay FAKEOLD, not FAKENEW. Pinned as the stated boundary (the det reader refuses the same program by name), not as correct behaviour.

Checklist: partial [c:1e95fd31] -- det side (#8654) and engine side (this PR) are pinned; applying the REPLACE statement and tab-stop expansion are left (Sibling gaps).

Class / Sibling gaps

Class: COBOL source-text inputs a reader may mis-cut or pass through silently: tab characters (sequence area, between tokens, in comments) and the REPLACE statement, across the two readers (det logical_lines, extractor extract_boundary). Members: tab in columns 1-7, det (read as today, pinned #8654); tab, extractor (read, pinned here); tab past column 7, both readers (read, pinned); REPLACE statement, det (refused by name, #8654); REPLACE statement, extractor (passed through unapplied, pinned here); COPY ... REPLACING (handled, #4265).

Sibling gaps:

  • Applying the REPLACE statement (scoped rewrite, REPLACE OFF, interaction with COPY REPLACING) in both readers: different mechanism (a pass in core/cobol_preprocessor.expand), and no burned program is known to use it (the grep of burned corpora has not been run). Until then the scan reports unreplaced names for such a program.
  • Tab-stop expansion in the det reader: a tab in columns 1-7 still shifts the column cut; burned CardDemo CSLKPCDY.cpy leads continuation lines with tabs and is proven today, so a change needs a det sweep over its ports. Not done here.

Remaining slices

Unchecked on #8412 after this: COMP items across every data boundary (matrix test; verify existing coverage first), the REPLACE application and tab-stop slices above, and the OWNER licence item (BAQ / HWT / IMS stand-ins). [c:166e4a56] and [c:37025b61] have merged slices (#8656, #8752, #8753, #8766, #8577); what is left on them is in those PRs' Remaining slices.

Gates

  • New file: 7 passed. Tree-wide guards (test_source_reads, test_generated_branch, test_change_classifier) plus the two tab/REPLACE files: 95 passed, 1 skipped.
  • Pinned-version ruff format applied. Not run: pr_gates --fast / --ratchets, golden bless (no engine, detector or language-standards change; test-only).

Co-Authored-By: Claude Sonnet 5.5 [email protected]

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 22, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

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.

1 participant