Skip to content

det: refuse a RECORD KEY outside the file's record (Fixes #4804) - #4984

Merged
squid-protocol merged 1 commit into
mainfrom
churn/4804-record-key-outside-record
Oct 12, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/4804-record-key-outside-record

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #4804

The det translator now refuses a RECORD KEY / ALTERNATE RECORD KEY whose item is not in a record of the file's own FD, by name. IBM Enterprise COBOL Language Reference (RECORD KEY clause) requires the key in a record description entry of that file; GnuCOBOL (the instrument) refuses it too. No translation is invented.

What changed

  • det/program.py: file_control also reads every ALTERNATE RECORD KEY; _keys_outside_record resolves each key and checks its 01 root is one of the FD's records. If not, the file's why is <key> is not defined in a record of file <SELECT> ..., so every statement on the file is a named hole.
  • Register entry F5 (docs/language_status/register/F5.md, page re-rendered).
  • tests/cobol_mainframe/test_det_record_key_4804.py: key-in-FD (whole), key-in-WS (refused), ALTERNATE KEY outside (refused), ALTERNATE KEY in FD (whole), qualified WS key (refused), key in a second 01 of one FD (whole), key in another file's record (refused). A key via COPY inside the FD is the same item layout as the in-FD case (COPY is expanded before layout). No counts asserted.

Evidence (real CardDemo sources, translated with the batch package present): CBIMPORT and CBEXPORT each now carry EXPORT-SEQUENCE-NUM is not defined in a record of file EXPORT-INPUT / EXPORT-OUTPUT holes on OPEN / READ / WRITE / CLOSE, so neither counts whole.

Class: key item placement for indexed files. Siblings: RELATIVE KEY (IBM: not in the file's own record) is already refused as ORGANIZATION RELATIVE.

Gates: pr_gates --fast 5/5 pass; --ratchets 7/7 pass (nothing moved: CBEXPORT/CBIMPORT are in no gated set); det_port.py check: 104/104 ports unchanged.

Cross-repo: none.

🤖 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 12, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 12, 2026 12:56
@squid-protocol
squid-protocol enabled auto-merge (squash) October 12, 2026 12:56
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 47ee520 into main Oct 12, 2026
39 checks passed
@squid-protocol
squid-protocol deleted the churn/4804-record-key-outside-record branch October 12, 2026 13:19
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.

det translator: CardDemo CBEXPORT / CBIMPORT count as whole, but their RECORD KEY is not in the file's record (the oracle does not compile them)

1 participant