Skip to content

det: continued hex literals, IDMS refused by name, multi-program sources as units, ENTRY / FUNCTION refmod (#4462 slice 2) - #4535

Merged
squid-protocol merged 4 commits into
mainfrom
fix/4462-det-refuse-slice2
Oct 6, 2026
Merged

squid-protocol merged 4 commits into
mainfrom
fix/4462-det-refuse-slice2

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4462 (slice 2). Slices 1a (#4522) and 1b (#4526) are merged.

What changes

  1. A hex literal continued onto a second row (X'...' or X"...") failed to parse in both quote styles because the grammar does not continue hex literals. On a re-wrapped line the grammar now gets an alphanumeric stand-in, "<U+001F>C1C2...", which it can continue. unwrap turns it back into X"C1C2...". A source that contains U+001F is refused by name. A lower-case x'00' is handed to the grammar as X'00' (GenApp lgtestc1). MOVE ALL X'00' is now read (KØBREG).
  2. IDMS is refused by name with "IDMS DML not supported" (source.unmodelled: an IDMS-CONTROL SECTION, a SCHEMA SECTION or MODE IS IDMS). This covers estate-crucible LNIDMS01, now under the new ledger cause translator-refuses-idms. IDMS support is tracked in det translator: IDMS (IDMS-DC / DMLC) programs are refused by name; model IDMS DML and subschema records #4532 (enhancement, legacy-modernization, priority: medium, milestone 28).
  3. Multi-program sources become units. source.program_units splits an expanded source into its programs. A program that begins while another is still open is nested in it. END PROGRAM closes the innermost open program and must name it.
    • layout.parse and stmt.parse refuse a source that holds several programs, by name. Before this, they silently read only the first program's records and paragraphs.
    • program.translate(..., unit=) translates one program as its own class. The default is the first program.
    • A nested program under a container that declares GLOBAL items is refused (UnitRefused).
    • The cross-check adapter reads every unit, and each paragraph's extent now ends with its own program.
    • Tested on a synthetic PAYMAIN-shaped fixture with no COPY collision: unit split, parse, adapter facts, and each unit translated to Java, compiled and run with a JDK.
    • The NIST CCVS85 count stays at 136. Its 7 multi-program sources are read unit by unit.
    • PAYMAIN is still refused first by its COPY DATEWS collision. det translator: translate a SYSLIB collision the engine resolved (first library wins), or mark the refusal policy #4486 is not decided here.
  4. Grammar gaps (the three most frequent, all small):
    • ENTRY 'DLITCBL' USING pcb ... (IMS DL/I) is now a statement. When it is the first statement and the PROCEDURE DIVISION has no USING, it is the program's entry. Anywhere else it translates as a hole.
    • FUNCTION f (1:4) / FUNCTION f(a) (2:3): the grammar gets an argument list of the same length, and expr reads the reference modification. gen used to drop the modification and now takes the substring.
    • lower-case x'..'.
    • Newly read: CardDemo DBUNLDGS, PAUDBLOD, PAUDBUNL and CBIMPORT, GenApp lgtestc1, estate-crucible KØBREG.

Still refused (translator-refuses-grammar, 6 entries after this PR, down from 12), with counts:

gap count programs
SEARCH ALL ... WHEN (the statement builder reads WHEN as EVALUATE's: "no open EVALUATE") 1 CardDemo COPAUS1C
DSF's alphabet without the ALPHABET keyword (C01 IS KANAL-1, IDIOT IS 'ABC...ÆØÅ', COBOL-74 SPECIAL-NAMES) 2 DSF PLUKKFR, PLUKKFRN
LABEL RECORD ARE STANDARD (singular RECORD with ARE; the grammar wants RECORD IS / RECORDS ARE) 1 DSF FO04D1X1
OS/VS COBOL EXHIBIT NAMED (after ENTRY was fixed, the next gap) 1 DSF R001BYDL
a missing period after 03 CA-CUSPOL-REQUEST (a source defect the engine tolerates; refusal is right) 1 GenApp polloo2.cpy (keyed copybook)

Fixed in this slice: ENTRY 'DLITCBL' USING (4: DBUNLDGS, PAUDBLOD, PAUDBUNL, R001BYDL's first gap), a reference modification of an intrinsic function, FUNCTION CURRENT-DATE (1:4) (2: KØBREG, CBIMPORT), lower-case x'00' (1: lgtestc1). KØBREG's next gap, MOVE ALL X'00', is read too.

Ratchets and evidence

  • fact_crosscheck_ledger.json was regenerated with fact_crosscheck.py update / assign after merging COBOL engine: a group's USAGE applies to its elementary items (#4525) #4531. It drops 8 entries, adds 2 (R001BYDL's next gap at line 193, and LNIDMS01's by-name refusal), and adds the cause translator-refuses-idms in place of translator-refuses-estate-shape. check gives 0 new and 0 stale.
  • pr_gates.py --ratchets: 5/5 pass (ports, estate, fact-crosscheck, completeness, ground-truth). It was re-run after merging CICS facades: answer the own COMMAREA DTO where returned() converts by layout without loss (#4449 part 2) #4529.
  • Det sweep (proof_sweep.py --det-only): 55/58 proven, "as expected", so the baseline is unchanged.
  • pr_gates.py: 7/7 pass (lint, audits, secrets, xray, gauntlet, golden, suite).
  • mypy: reproduced CI's mypy-audit.yml install in a fresh py3.12 venv on a clean worktree with an empty env. One error was found and fixed, and the audit then reported no new errors.
  • Det tests ran with the translator extra; none skipped except the Docker-gated ones.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR

squid-protocol and others added 2 commits October 6, 2026 00:26
…ces as units, ENTRY / FUNCTION refmod / x'00' (#4462)

- A hex literal continued onto a second row (either quote style) is handed to the grammar as an alphanumeric
  stand-in ("<U+001F>C1..."), which it continues; unwrap restores X"C1...". A lower-case x'00' is handed over as
  X'00' (GenApp lgtestc1). MOVE ALL X'00' is read (estate-crucible KØBREG).
- IDMS (IDMS-CONTROL / SCHEMA SECTION) is refused by name: "IDMS DML not supported" (LNIDMS01; #4532 tracks support).
- Multi-program sources: source.program_units cuts an expanded source into its programs (nested / batch-compiled);
  layout.parse / stmt.parse refuse several programs by name (they had silently read only the first);
  program.translate(..., unit=) translates one program as its own class; a nested program under GLOBAL data is
  refused (UnitRefused). The cross-check reads every unit, extents ending with their program. PAYMAIN stays refused
  first by its COPY collision (#4486, not decided here).
- ENTRY 'DLITCBL' USING pcb ... is a statement (the program's entry when first); FUNCTION f (1:4) parses (handed to
  the grammar as an argument list of the same length) and gen applies the reference modification (it had dropped it).
- Newly read: CardDemo DBUNLDGS, PAUDBLOD, PAUDBUNL, CBIMPORT; GenApp lgtestc1; estate-crucible KØBREG. Ledger
  updated with fact_crosscheck.py update / assign.

Part of #4462

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
@github-actions

github-actions Bot commented Oct 6, 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 6, 2026 06:14
@squid-protocol
squid-protocol merged commit 36e9aa6 into main Oct 6, 2026
37 checks passed
@squid-protocol
squid-protocol deleted the fix/4462-det-refuse-slice2 branch October 6, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant