Skip to content

fix: train -- #4305, #4351, #4353, #4355 - #4383

Merged
squid-protocol merged 9 commits into
mainfrom
train/train-b
Oct 5, 2026
Merged

squid-protocol merged 9 commits into
mainfrom
train/train-b

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Train of four engine fixes: one golden regeneration, one ledger run, one CI run. Each fix branch is code + regression tests, reproduced on main and audited with the kit. #4306 and #4329 were in earlier builds of this train and have been taken out; see the end.

#4305: inline PERFORM forms draw no callee (fix/4305-inline-perform-callees)

  • Broken: calls_out took the word after any PERFORM as a callee:
    • PERFORM TEST AFTER|BEFORE ... → TEST
    • PERFORM FOREVER → FOREVER
    • PERFORM WS-N TIMES / PERFORM 3 TIMES → WS-N / 3
    • EXIT PERFORM [CYCLE] → the next word (END-IF, CYCLE)
  • Fix (cobol.py calls_out / _calls_out_ignore; the detector drops an empty callee):
    • TEST and FOREVER are ignored;
    • a name followed by TIMES is the loop count, while out-of-line PERFORM PARA-X 3 TIMES keeps PARA-X;
    • EXIT PERFORM [CYCLE] is consumed by its own capture-less alternative.
  • Golden effect: Calls Out To in 3 files: CBSA BANKDATA.cbl, zopeneditor SAM1.cbl, gnucobol CBL_OC_DUMP.cob. In each, the phantom TEST callee is gone.
  • Ledger: 4 intra-program-edge false positives fixed, <para> -> PERFORM TEST (CBSA BANKDATA, zopeneditor SAM1 / SAM1LIB / multiroot SAM1).
  • Estate: H-0006 FAIL → PASS.

#4351: a short member with stray NULs stays source (fix/4351-stray-nuls)

  • Broken: aperture Gate 3.1 blocked more than 1 NUL per 1000 characters as binary. A 168-byte PL/I member with 2 NULs at the end of a comment was dropped (NULREST.pli).
  • Fix: at most 4 NULs, and at most 4 other C0 control characters, counts as transfer damage in text, whatever the size. A binary carries control bytes beyond its NULs and is still blocked. The old 16-character "binary" test fixture now carries 5 NULs.
  • Golden effect: none; no crucible member has a handful of NULs.
  • Estate: H-0037 now has 1 check not passing, down from 5: the member is scanned. The one left is a unit-extent convention question, not this issue. The key's NULREST end_line is 5 (the RETURN), and the engine gives 6 (END NULREST;). For CLMPROC, whose nested procedures follow its last statement, the engine and the key agree. For INIT_CLAIM, the key's own end_line includes its END line. Worth a look at the key.

#4353: national / CJK / full-width names in data_moves (fix/4353-data-moves-national)

  • Broken: data_moves' word class was ASCII-only, and a name needed an ASCII letter. MOVE '000001' TO 社員コード gave no row, and MOVE SPACE TO X項目 was recorded into X.
  • Fix: the word class takes the record reader's NATIONAL / WIDE_DIGITS / WIDE_HYPHENS characters, and a national letter counts as a letter.
  • Golden effect: Data Moves in 3 CICS-Cobol files. Names with _ (in NATIONAL's ID_START, and in the record reader's class) are now whole:
    • WS_NAME was recorded as the two operands WS + NAME;
    • STRING WS-STR_IN1 ... INTO WS-STR_OUT was WS-STR, IN1, ....
  • Estate: H-0040, H-0041 and H-0046 FAIL → PASS; H-0042 → PASS together with train A's COBOL engine: a DBCS literal VALUE G'…' is recorded as the value G #4354.

#4355: decimal-comma literal in a MOVE (fix/4355-decimal-comma-move, built on #4353)

  • Broken: MOVE 0,5 TO T-WERT (2) under DECIMAL-POINT IS COMMA gave no row, because 0,5 was tokenized as 0 , 5.
  • Fix: in such a program a digit-comma-digit run is one numeric literal. A separator comma is followed by a space, and a program without the clause is unchanged.
  • Golden effect: none.
  • Estate: H-0043 FAIL → PASS.

Taken out: #4306 (fix/4306-idms-phantom-units)

In the first build of this train its step moved 38 golden channels across 515 files. The unit diff shows why:

  • Correct removals: the 12 IDMS phantoms (IDMS-CONTROL / PROTOCOL in 6 lsp files), plus USER2 Program1-id and RES FILE-CONTROsL.
  • Wrong removals: every real paragraph of NIST NC1134.2.cbl (29 units: OPEN-FILES, MAR-TEST-1..15, PASS, FAIL, ...). That source writes PROCEDURE / DIVISION / . on three lines (116-118), so the branch's "outside the PROCEDURE DIVISION" filter never sees the header.

The branch needs the header matched across line breaks, plus a test with the NC1134 shape, before it goes into a train.

Taken out: #4329 (fix/4329-usage-leak)

The second build of this train went red on CICS Crucible: 5 new hc-abend-link/*/java-ported cells failed mvn compile.

This needs a forge-side decision: name the callee's contract DTO after its own DFHCOMMAREA, or re-key the overlay. Blessing the CICS baseline would only hide the failures. The branch is unchanged and ready to rejoin a train once that is settled.

Golden masters (vs a42fc11fe4a1)

full-precision (tests/golden_master_audit): 5 fixture file(s), 5 channel(s), 6 scanned file(s) moved (cobol 6).

channel files changed +added -removed leaves sample
10. Mainframe System Facts / Data Moves 3 0 0 12 cobol/CICS-Cobol/CBL0104v01ProcedureDivision.cbl, cobol/CICS-Cobol/CBL0105v01DeclararElementoGrupo.cbl, cobol/CICS-Cobol/CBL0703v01StatementString.cbl
11. Scan DB Snapshot / Calls Out To 3 0 0 6 cobol/cics-banking-sample-application-cbsa/BANKDATA.cbl, cobol/gnucobol/CBL_OC_DUMP.cob, cobol/zopeneditor-sample/SAM1.cbl
12. Scan Output Snapshots / Graph SQLite 0 0 0 4
7. Mainframe Skeleton Completeness / Channels 0 0 0 4
12. Scan Output Snapshots / LLM Brief 0 0 0 2

Most-moved scanned files (channels): cobol/CICS-Cobol/CBL0703v01StatementString.cbl (1), cobol/CICS-Cobol/CBL0104v01ProcedureDivision.cbl (1), cobol/CICS-Cobol/CBL0105v01DeclararElementoGrupo.cbl (1), cobol/zopeneditor-sample/SAM1.cbl (1), cobol/cics-banking-sample-application-cbsa/BANKDATA.cbl (1)

zero-dependency (tests/golden_master_zero_dep_audit): 5 fixture file(s), 5 channel(s), 6 scanned file(s) moved (cobol 6).

channel files changed +added -removed leaves sample
10. Mainframe System Facts / Data Moves 3 0 0 12 cobol/CICS-Cobol/CBL0104v01ProcedureDivision.cbl, cobol/CICS-Cobol/CBL0105v01DeclararElementoGrupo.cbl, cobol/CICS-Cobol/CBL0703v01StatementString.cbl
11. Scan DB Snapshot / Calls Out To 3 0 0 6 cobol/cics-banking-sample-application-cbsa/BANKDATA.cbl, cobol/gnucobol/CBL_OC_DUMP.cob, cobol/zopeneditor-sample/SAM1.cbl
12. Scan Output Snapshots / Graph SQLite 0 0 0 4
7. Mainframe Skeleton Completeness / Channels 0 0 0 4
12. Scan Output Snapshots / LLM Brief 0 0 0 2

Most-moved scanned files (channels): cobol/CICS-Cobol/CBL0703v01StatementString.cbl (1), cobol/CICS-Cobol/CBL0104v01ProcedureDivision.cbl (1), cobol/CICS-Cobol/CBL0105v01DeclararElementoGrupo.cbl (1), cobol/zopeneditor-sample/SAM1.cbl (1), cobol/cics-banking-sample-application-cbsa/BANKDATA.cbl (1)

Ground-truth ledger

Ground-truth ledger: 4 mismatch(es) fixed, 0 introduced.

corpus fixed introduced scoreboard
cics-banking-sample-application-cbsa 1 0 intra-program edges [engine] tp 373/got 374/truth 373 -> tp 373/got 373/truth 373
zopeneditor-sample 3 0 intra-program edges [engine] tp 93/got 96/truth 93 -> tp 93/got 93/truth 93
  • fixed: cics-banking-sample-application-cbsa :: engine | intra-program edges | src/base/cobol_src/BANKDATA.cbl | A010 -> PERFORM TEST | fp
  • fixed: zopeneditor-sample :: engine | intra-program edges | COBOL/SAM1.cbl | 210-PROCESS-ADD-TRAN -> PERFORM TEST | fp
  • fixed: zopeneditor-sample :: engine | intra-program edges | COBOL/SAM1LIB.cbl | 210-PROCESS-ADD-TRAN -> PERFORM TEST | fp
  • fixed: zopeneditor-sample :: engine | intra-program edges | multiroot/sam/SAM1.cbl | 210-PROCESS-ADD-TRAN -> PERFORM TEST | fp

Estate-crucible horrors

Estate-crucible (a42fc11fe4a1 -> 27eff08c95d9): horrors passing 37/49 -> 43/49; checks pass 835->855, fail 17->18, missing 14->0, phantom 16->8.

horror issue before after title
H-0006 #4305 FAIL (7 not passing) PASS Inline PERFORM headers and EXIT PERFORM read as PERFORM targets
H-0037 #3534 FAIL (5 not passing) FAIL (1 not passing) Stray NUL bytes in a source member (a transfer artifact)
H-0040 #3955 FAIL (4 not passing) PASS Japanese user-defined words: PROGRAM-ID, data names (leading and trailing Japanese), sections, paragraphs, _ in names
H-0041 #3991 FAIL (2 not passing) PASS Full-width hyphens and digits in names; names that must not collide
H-0042 #3816 FAIL (2 not passing) PASS DBCS in EBCDIC: SO/SI-delimited words, mixed and G literals, unbalanced and nested shift codes in comments
H-0043 #3942 FAIL (1 not passing) PASS DECIMAL-POINT IS COMMA, with VALUE 1,50 in a copybook
H-0046 #3878 FAIL (1 not passing) PASS A member downloaded to a PC in Shift-JIS
channel before (pass/fail/missing/phantom) after
data_items 280/6/1/0 281/6/0/0
data_moves 80/0/10/4 91/0/0/3
edges 73/0/0/7 79/0/0/0
entry_points 27/0/1/0 28/0/0/0
programs 27/0/1/0 28/0/0/0
units 91/0/1/3 91/1/0/3

Fixes #4305
Fixes #4351
Fixes #4353
Fixes #4355

🤖 Generated with Claude Code

https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo

squid-protocol and others added 4 commits October 4, 2026 19:40
Gate 3.1 blocked a member as binary at more than 1 NUL per 1000 characters
(#3491). A 168-byte PL/I member with 2 NULs at the end of a comment is 12 per
1000, so it vanished from every fact channel (estate-crucible NULREST.pli,
H-0037). At most 4 NULs, with at most 4 other C0 control characters, is now
transfer damage in text, whatever the size. A binary carries control bytes
beyond its NULs, so it is still blocked. The old 16-character "binary" fixture
(2 NULs) now carries 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
)

data_moves' word class was ASCII-only, and a name needed an ASCII letter.
`MOVE '000001' TO 社員コード` and `MOVE 'Z' TO F02` drew no row, and `MOVE
SPACE TO X項目` was recorded into `X`. The word class now takes the record
reader's NATIONAL / WIDE_DIGITS / WIDE_HYPHENS characters (#3955 / #3991), and a
national letter counts as a letter. estate-crucible H-0040, H-0041 and H-0046
now pass, and H-0042's two missing moves are found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
calls_out took the word after any PERFORM as a callee, and only VARYING / UNTIL /
WITH were ignored. These inline forms name no paragraph:
- `PERFORM TEST BEFORE|AFTER` (WITH omitted) and `PERFORM FOREVER`: TEST and
  FOREVER join `_calls_out_ignore`.
- `PERFORM WS-N TIMES` / `PERFORM 3 TIMES`: a name followed by TIMES is the
  loop count. `PERFORM PARA-X 3 TIMES` keeps PARA-X, and the name must end at a
  word end, so backtracking cannot dodge the check.
- `EXIT PERFORM [CYCLE]`: consumed by its own alternative, which captures
  nothing. The detector drops an empty callee.

estate-crucible H-0006 now passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
… IS COMMA (#4355)

`MOVE 0,5 TO T-WERT (2)` in a program with DECIMAL-POINT IS COMMA drew no row:
the tokenizer split `0,5` into `0` `,` `5`. In such a program a digit-comma-digit
run is now one numeric literal. A separator comma is followed by a space, so it
still separates, and a program without the clause is read as before.
estate-crucible H-0043 now passes. Built on fix/4353 (same tokenizer lines).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol changed the title fix: train -- #4305, #4329, #4351, #4353, #4355 fix: train -- #4305, #4351, #4353, #4355 Oct 5, 2026
@squid-protocol
squid-protocol marked this pull request as ready for review October 5, 2026 01:01
@squid-protocol
squid-protocol merged commit 1a0045a into main Oct 5, 2026
39 checks passed
@squid-protocol
squid-protocol deleted the train/train-b branch October 5, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment