Skip to content

det: DFSORT OUTREC FIELDS/BUILD lowered and proven against GnuCOBOL (Part of #4268) - #6983

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
churn/4268-20261029T0511Z
Oct 29, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/4268-20261029T0511Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4268. Next slice after #6975: DFSORT OUTREC FIELDS= / BUILD= is lowered onto the COBOL SORT program and proven byte for byte against GnuCOBOL.

Forge wiring (JclSteps.utility) was first on the handoff list but is not self-contained: no estate fact carries a step's in-stream SYSIN text (galaxy_ir.job_dds holds DD name/dsn/disp only), so the forge cannot parse a card. It needs a SYSIN channel first (see Remaining slices). OUTREC was the first slice that stands alone.

What changed

  • det/dfsort.py: OUTREC items (input field p,m or SYMNAMES field, CH/BI; nX; nZ; C'..'/X'..'; optional o: that must be the next free byte). Applied after sort/merge and after INCLUDE/OMIT; output record length = items. Lowered through a BUILD-OUT paragraph and a W-OUT area on every writer (SORT, COPY, MERGE, carried ZD key).
  • tests/cobol_mainframe/test_dfsort_4268.py: parse + refusal tests; e2e cases OUTRECSORT / OUTRECCOPY / OUTRECMERGE / OUTRECZD (GnuCOBOL vs det-port Java).
  • docs/language_status/register/F4.md: OUTREC entry, refusal list.

Checklist: partial [c:336a82a2] -- SORT/MERGE verbs done earlier; the step model gained OUTREC, forge wiring remains
Checklist: partial [c:ac8b71e6] -- SORT step now covers OUTREC; IEBGENER oracle proof, IDCAMS REPRO/DEFINE and forge wiring left
Checklist: partial [c:9e003ccd] -- F4 updated for OUTREC; update again as slices land

Class / Sibling gaps

Class: DFSORT control statements and operands that a SORT step's SYSIN can carry, beyond SORT/MERGE/INCLUDE/OMIT/OPTION. Members: OUTREC (handled here, same mechanism as the writers); INREC, OUTFIL, SUM, RECORD, ALTSEQ, OPTION operands (SKIPREC, VLSHRT ...), format conversions in OUTREC (ZD/PD, edit masks), OUTREC OVERLAY/PARSE, o: gaps: refused by name, unchanged or newly named. Which burned program needs them: CardDemo's SORT steps (TRANREPT, SORTTEST, COMBTRAN) use none of OUTREC/INREC/SUM; none needed by CBSA/GenApp/zECS/DBB/cicsdev from what the proofs reach.

Sibling gaps

  • INREC (same lowering as OUTREC applied before the sort, keys then name rebuilt positions): needs its own mechanism for key positions; no burned program needs it.
  • OUTFIL, SUM, ALTSEQ, OPTION SKIPREC/STOPAFT: different mechanisms; no burned program needs them.
  • OUTREC gaps/overlaps with o: and ZD/PD conversions: IBM's fill/convert rules not verified here, refused.
  • IEBGENER (Java copy exists, not proven against an oracle), IDCAMS REPRO/DEFINE: separate utilities, no oracle run yet.

Remaining slices (files, order)

  1. SYSIN fact channel: galaxy_ir.py (in-stream SYSIN/SYMNAMES body per step) + skeleton_export.py + a test.
  2. Forge wiring: cobol_to_java_batch_forge.py (steps.utility for a parseable SORT step -> lowered program) + test_batch_jobs.py.
  3. IEBGENER oracle proof; IDCAMS REPRO subset.
  4. Multi-step job case in the harness.

Facts checked

  • job_dds row keys have no SYSIN body (read galaxy_ir.py job_dds).
  • test_dfsort_4268.py unit tests: 24 passed (e2e skipped without EQUIVALENCE_E2E).
  • E2E under EQUIVALENCE_E2E=1 via heavy-run.sh: 34 passed (GnuCOBOL vs det-port Java, OUTREC* included). pr_gates --fast 9/9 after the mypy fix (audits re-run: mypy and audit_check clear); --ratchets 9 pass / 0 fail / 0 skipped; pre-PR guard tests 231 passed. Translator extra: tests ran, none skipped for tree_sitter.

Lessons for agents

  • In dfsort.py, _const() returns a decimal Const("N") for a bare number, so a token loop that tries constants first swallows a p position: test t.isdigit() first.
  • A lowered COBOL record overlay (01 X-R REDEFINES W-REC) must follow W-REC directly: declare extra 01 areas after the overlays are collected (cobc: "REDEFINES must follow the original definition").

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 29, 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 29, 2026 05:50
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 29, 2026 05:50
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

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