Skip to content

fix: train -- #4307, #4331, #4352, #4354 - #4379

Merged
squid-protocol merged 10 commits into
mainfrom
train/train-a
Oct 5, 2026
Merged

squid-protocol merged 10 commits into
mainfrom
train/train-a

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Train of four independent engine fixes: one golden regeneration, one ledger run, one CI run. The fix branches are code + regression tests only; each was reproduced on main and verified with a real scan (by the second coder agent).

#4307: PROGRAM-ID with no separator period (fix/4307-program-id-no-period)

  • Broken: class_start needed [ \t]*\. after the name, so these got no class_data row:
    • PROGRAM-ID. CBLDB22 padded with blanks to column 72;
    • PROGRAM-ID TEST16., with no period after the keyword.
  • Fix: in cobol.py class_start, the keyword's period is optional, and the name may be followed by trailing blanks and the line end.
  • Golden effect:
    • class declarations +4 (CBLDB22, lsp TEST16 / TEST51 / TEST61);
    • batch entry total 266 → 270, of which 9 are now resolved instead of 8: CBLDB22 is run by CBLDB22R.jcl, which gives the one new import edge and CBLDB22's popularity / blast radius;
    • one more program call resolves (gap 223 → 222);
    • the rest is the downstream fingerprint / centroid / composition / LLM-brief / graph numbers of those 5 files.
  • Estate: H-0008 FAIL → PASS.

#4331: JCL GDG relative generation (fix/4331-jcl-gdg-import)

  • Broken: a GDG reference DSN=X.Y(+1) was captured truncated in raw_imports.
  • Fix: in jcl.py, (0) / (+n) / (-n) are stripped to the base DSN.
  • Golden effect: none; the crucible has no GDG reference.
  • Estate: H-0011 FAIL → PASS.

#4352: COPY separated by an ideographic space (fix/4352-copy-ideographic-space)

  • Broken: COPY / EXEC SQL INCLUDE followed by U+3000 (full-width space) drew no import.
  • Fix: in cobol.py, the import rule and _dependency_capture accept U+3000 as a separator.
  • Golden effect: none.
  • Estate: H-0038 FAIL → PASS.

#4354: prefixed VALUE literals (fix/4354-dbcs-value-literal)

  • Broken: in mainframe_boundary._VALUE_CLAUSE, a G'...', N'...', NX, X, B or Z literal was recorded as its bare prefix letter. For example, VALUE X'25' was recorded as X.
  • Fix: the prefix and quotes are kept.
  • Golden effect: Record Layout only. 76 values in 9 files change from X to X'..': 66 with upper-case X' and 10 with lower-case x". Examples: Z-SMS-Gateway WS-NL X → X'25', carddemo DFHAID.cpy / DFHBMSCA.cpy, CBSA PROCTRAN.cpy. No B or Z literal occurs in the crucible.
  • Estate: H-0042 goes from 3 failing checks to 2: the G'漢字欄名' value now passes. The 2 data moves left are COBOL engine: data_moves drops moves whose operands are Japanese / full-width names, and truncates mixed names #4353's.

Golden masters (vs 417b0a794fe6)

full-precision (tests/golden_master_audit): 15 fixture file(s), 15 channel(s), 14 scanned file(s) moved (cobol 13, jcl 1).

channel files changed +added -removed leaves sample
10. Mainframe System Facts / Record Layout 9 0 0 76 cobol/Z-SMS-Gateway/BALANCE.cbl, cobol/Z-SMS-Gateway/HISTORY.cbl, cobol/Z-SMS-Gateway/MESSAGES.cbl (+6)
3. Architectural Profile / Repository Fingerprint 5 0 0 88 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+2)
3. Architectural Profile / Repository Drift (Centroid Distance) 5 0 0 5 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+2)
3. Architectural Profile / Composition Fit (Z-Score) 4 0 0 4 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+1)
7. Structural Signatures (Net Mitigated Signals) / Class/Entity Declarations 4 0 0 4 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+1)
11. Scan DB Snapshot / Import Edges 0 1 0 1 jcl/cobol-programming-course/CBLDB22R.jcl
3. Architectural Profile / Popularity Rank 1 0 0 1 cobol/cobol-programming-course/CBLDB22.cbl
8. Dependency Network / Direct Downstream (Dependency Blast Radius) 1 0 0 1 cobol/cobol-programming-course/CBLDB22.cbl
12. Scan Output Snapshots / LLM Brief 0 0 0 26
12. Scan Output Snapshots / Graph SQLite 0 0 0 12
4. High-Value Forensic Report / systemic_bottlenecks 0 0 0 10
12. Scan Output Snapshots / GPU JSON 0 0 0 9
7. Mainframe Skeleton Completeness / Channels 0 0 0 7
2. Global Ecosystem Summary / network_macro 0 0 0 2
7. Mainframe Skeleton Completeness / Missing Inputs 0 0 0 2

Most-moved scanned files (channels): cobol/cobol-programming-course/CBLDB22.cbl (6), cobol/che-che4z_lsp_project_fixtures/TEST16.CBL (4), cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (4), cobol/che-che4z_lsp_project_fixtures/TEST51.CBL (4), jcl/cobol-programming-course/CBLDB22R.jcl (3)

zero-dependency (tests/golden_master_zero_dep_audit): 15 fixture file(s), 15 channel(s), 14 scanned file(s) moved (cobol 13, jcl 1).

channel files changed +added -removed leaves sample
10. Mainframe System Facts / Record Layout 9 0 0 76 cobol/Z-SMS-Gateway/BALANCE.cbl, cobol/Z-SMS-Gateway/HISTORY.cbl, cobol/Z-SMS-Gateway/MESSAGES.cbl (+6)
3. Architectural Profile / Repository Fingerprint 5 0 0 88 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+2)
3. Architectural Profile / Repository Drift (Centroid Distance) 5 0 0 5 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+2)
3. Architectural Profile / Composition Fit (Z-Score) 4 0 0 4 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+1)
7. Structural Signatures (Net Mitigated Signals) / Class/Entity Declarations 4 0 0 4 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+1)
11. Scan DB Snapshot / Import Edges 0 1 0 1 jcl/cobol-programming-course/CBLDB22R.jcl
3. Architectural Profile / Popularity Rank 1 0 0 1 cobol/cobol-programming-course/CBLDB22.cbl
8. Dependency Network / Direct Downstream (Dependency Blast Radius) 1 0 0 1 cobol/cobol-programming-course/CBLDB22.cbl
12. Scan Output Snapshots / LLM Brief 0 0 0 26
12. Scan Output Snapshots / Graph SQLite 0 0 0 12
4. High-Value Forensic Report / systemic_bottlenecks 0 0 0 10
12. Scan Output Snapshots / GPU JSON 0 0 0 9
7. Mainframe Skeleton Completeness / Channels 0 0 0 7
2. Global Ecosystem Summary / network_macro 0 0 0 2
7. Mainframe Skeleton Completeness / Missing Inputs 0 0 0 2

Most-moved scanned files (channels): cobol/cobol-programming-course/CBLDB22.cbl (6), cobol/che-che4z_lsp_project_fixtures/TEST16.CBL (4), cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (4), cobol/che-che4z_lsp_project_fixtures/TEST51.CBL (4), jcl/cobol-programming-course/CBLDB22R.jcl (3)

Per-fix attribution

Train train/train-a on base 417b0a794fe6 -- each row is the delta that merge alone introduced (full-precision scan vs the previous step).

# branch golden channels scanned files moved estate horrors notes
1 origin/fix/4307-program-id-no-period @ c98b9b0b82 14 5 33->34 (H-0008)
2 origin/fix/4331-jcl-gdg-import @ cea2b235b9 0 0 34->35 (H-0011)
3 origin/fix/4352-copy-ideographic-space @ e1de827010 0 0 35->36 (H-0038)
4 origin/fix/4354-dbcs-value-literal @ bb4af58bcc 1 9 36->36 (H-0042)
1. origin/fix/4307-program-id-no-period

full-precision: 14 fixture file(s), 14 channel(s), 5 scanned file(s) moved (cobol 4, jcl 1).

channel files changed +added -removed leaves sample
3. Architectural Profile / Repository Fingerprint 5 0 0 88 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+2)
3. Architectural Profile / Repository Drift (Centroid Distance) 5 0 0 5 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+2)
3. Architectural Profile / Composition Fit (Z-Score) 4 0 0 4 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+1)
7. Structural Signatures (Net Mitigated Signals) / Class/Entity Declarations 4 0 0 4 cobol/che-che4z_lsp_project_fixtures/TEST16.CBL, cobol/che-che4z_lsp_project_fixtures/TEST51.CBL, cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (+1)
11. Scan DB Snapshot / Import Edges 0 1 0 1 jcl/cobol-programming-course/CBLDB22R.jcl
3. Architectural Profile / Popularity Rank 1 0 0 1 cobol/cobol-programming-course/CBLDB22.cbl
8. Dependency Network / Direct Downstream (Dependency Blast Radius) 1 0 0 1 cobol/cobol-programming-course/CBLDB22.cbl
12. Scan Output Snapshots / LLM Brief 0 0 0 26
12. Scan Output Snapshots / Graph SQLite 0 0 0 12
4. High-Value Forensic Report / systemic_bottlenecks 0 0 0 10
12. Scan Output Snapshots / GPU JSON 0 0 0 9
7. Mainframe Skeleton Completeness / Channels 0 0 0 7
... 2 more channel(s)

Most-moved scanned files (channels): cobol/cobol-programming-course/CBLDB22.cbl (6), cobol/che-che4z_lsp_project_fixtures/TEST16.CBL (4), cobol/che-che4z_lsp_project_fixtures/TEST61.CBL (4), cobol/che-che4z_lsp_project_fixtures/TEST51.CBL (4), jcl/cobol-programming-course/CBLDB22R.jcl (3)

4. origin/fix/4354-dbcs-value-literal

full-precision: 1 fixture file(s), 1 channel(s), 9 scanned file(s) moved (cobol 9).

channel files changed +added -removed leaves sample
10. Mainframe System Facts / Record Layout 9 0 0 76 cobol/Z-SMS-Gateway/BALANCE.cbl, cobol/Z-SMS-Gateway/HISTORY.cbl, cobol/Z-SMS-Gateway/MESSAGES.cbl (+6)

Most-moved scanned files (channels): cobol/aws-mainframe-modernization-carddemo/CSUTLDTC.cbl (1), cobol/aws-mainframe-modernization-carddemo/DFHAID.cpy (1), cobol/aws-mainframe-modernization-carddemo/DFHBMSCA.cpy (1), cobol/cics-banking-sample-application-cbsa/PROCTRAN.cpy (1), cobol/Z-SMS-Gateway/MESSAGES.cbl (1)

After merging current main (1af1ab20f) into the train, the kit re-blessed both legs: fixture unchanged (main's newer commits move no golden).

Ground-truth ledger

Ground-truth ledger: no change.

Estate-crucible horrors

Estate-crucible (1af1ab20f9d4 -> e6822aa9f426): horrors passing 34/49 -> 37/49; checks pass 822->835, fail 21->17, missing 23->14, phantom 19->16.

horror issue before after title
H-0008 #4307 FAIL (2 not passing) PASS PROGRAM-ID not recorded when its separator period is missing
H-0011 #4331 FAIL (7 not passing) PASS A GDG relative generation (+1) / (-1) is captured as a truncated DSN
H-0038 #3956 FAIL (1 not passing) PASS The full-width space U+3000 as a separator
H-0042 #3816 FAIL (3 not passing) FAIL (2 not passing) DBCS in EBCDIC: SO/SI-delimited words, mixed and G literals, unbalanced and nested shift codes in comments
channel before (pass/fail/missing/phantom) after
call_sites 23/4/0/0 25/2/0/0
copies 32/3/1/2 33/3/0/2
data_items 279/7/1/0 280/6/1/0
file_edges 12/0/2/0 14/0/0/0
jcl_datasets 16/0/4/3 20/0/0/0
layouts 80/7/0/0 81/6/0/0
programs 25/0/3/0 27/0/1/0

Fixes #4307
Fixes #4331
Fixes #4352
Fixes #4354

🤖 Generated with Claude Code

https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo

squid-protocol and others added 10 commits October 4, 2026 19:32
Broken: PROGRAM-ID. NAME padded with blanks to col 72, and PROGRAM-ID NAME. (no keyword period), left class_data empty. Fix: class_start terminator lookahead allows trailing blanks; keyword period optional for PROGRAM-ID/CLASS-ID/INTERFACE-ID (FACTORY/OBJECT keep it).

Evidence: test_cobol.py cases; galaxyscope on CBLDB22/TEST16 repros records class_data CBLDB22 and TEST16 (was empty).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
#4331)

Broken: DSN=X(+1) / X(-1) captured as the truncated 'X(' while X(0) kept whole. Fix: the _dependency_capture DSN group excludes bare parens and strips (0)/(+n)/(-n); a PDS member (MEM) stays whole.

Evidence: test_jcl.py cases; galaxyscope on the issue reproducer gives raw_imports [PROD.ACCT.HIST, PROD.ACCT.MASTER] (was three entries incl. two dangling '(').

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
…4352)

Broken: COPY<U+3000>member. gave no import. Fix: U+3000 added to the blank classes of the import and _dependency_capture rules.

Evidence: test_cobol.py cases + near misses; galaxyscope on a COPY<U+3000>KYUYCPY. repro gives raw_imports [KYUYCPY] (was []).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
…otes (#4354)

Broken: VALUE G'...' recorded value_literal 'G' (bareword alternative). Fix: _VALUE_CLAUSE takes an optional literal-class prefix glued to the quote; the record value is e.g. G'漢字欄名' (matches the H-0042 key).

Evidence: test_dbcs_items.py tests; galaxyscope on the KYUYO01 shape gives record_data value_literal G'漢字欄名' and X'C1C2'.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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 marked this pull request as ready for review October 5, 2026 00:12
@squid-protocol
squid-protocol merged commit a42fc11 into main Oct 5, 2026
38 checks passed
@squid-protocol
squid-protocol deleted the train/train-a branch October 5, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment