Skip to content

det: a CICS read past FROM keeps the items it spans as byte storage; GenApp LGSETUP equal on its case (Part of #6072) - #6954

Closed
squid-protocol wants to merge 1 commit into
mainfrom
credit/lgsetup-past-from-typed
Closed

squid-protocol wants to merge 1 commit into
mainfrom
credit/lgsetup-past-from-typed

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #6072. Row C of #6839. This is also the lgsetup row of #6882 (claimed by melek); a credit session took it, and churn's last GenApp run (6072-20261028T2037Z) reported it blocked.

What was wrong

genapp-lgsetup was in det_sweep_baseline.json under closed #5252. LGSETUP's SEND TEXT FROM(WRITE-MSG-H) LENGTH(24) sends WRITE-MSG-H (X(14)) and the item after it, WRITE-MSG-High PIC 9(10) (IBM: SEND TEXT sends LENGTH bytes from FROM's first; DetCics.withinRecord). The typed translation (B3) held WRITE-MSG-High as a Java BigDecimal, which never reaches the record's bytes, so Java sent HIGH CUSTOMER=0000000000 where GnuCOBOL sent HIGH CUSTOMER=0000000050.

Fix (one class: a CICS command that reads storage past FROM's item)

Cics.past_from(FROM, length) makes every lifted item that the read can span a lift violation, so it stays byte storage. This is the same mechanism a whole-group use already takes (gen.violate). A subscripted or reference-modified FROM, or a LENGTH not known at translation, spans from FROM's item to the record's end. It is applied at every site that reads past FROM:

  • SEND TEXT FROM LENGTH (withinRecord)
  • CONVERSE FROM FROMLENGTH (withinRecord)
  • a file WRITE / REWRITE FROM LENGTH past FROM (record_from)
  • a RETURN / XCTL COMMAREA LENGTH past the area (commareaOut)

The X6 sites, where a WRITEQ past FROM is padded with spaces, don't read past FROM and are unchanged. With nothing lifted, the helper returns at once. The translation of programs without such a read is unchanged.

Ladder evidence

case before after
genapp-lgsetup det port differs on 2/2 scenarios (baselined) equal on 2/2 scenarios (plus the facade run); 1/1 paragraphs, 2/2 branches (100% / 100%); translated whole 91/91

lgsetup was L1 on the published report (no case proved). It is now equal on every scenario with full paragraph and branch coverage; the evidence-refresh bot sets the level.

Full non-Db2 det sweep with this change: 99/99 equal. The ratchet reports "as expected" with the baseline entry removed. No other case's coverage changed (ledger diffed, fingerprint-only entries left to the bot).

Assumptions

None new. The past-FROM bytes follow register X6 as before; the oracle is GnuCOBOL plus our stub.

Checks

  • audit_check.py: all clear.
  • New tests/cobol_mainframe/test_det_past_from_typed_6839.py: past FROM, the next item stays bytes; within FROM, it stays typed.
  • test_det_translate.py and test_cics_family_split.py pass.

Independent of #6952 (the companion credit PR, rows A/B): either can merge first.

🤖 Generated with Claude Code

…GenApp LGSETUP equal on its case (Part of #6072)

#6839 row C (#5252): SEND TEXT FROM(WRITE-MSG-H) LENGTH(24) sends
WRITE-MSG-H and the PIC 9(10) after it. The typed translation (B3) held that
number as a Java field, which never reaches the record's bytes, so Java sent
0000000000. A command that reads LENGTH bytes from FROM's first now makes
every lifted item the read can span a lift violation (it stays byte storage):
SEND TEXT and CONVERSE past FROM, a file command's FROM LENGTH past FROM, and
a RETURN / XCTL COMMAREA LENGTH past the area. Nothing else changes.

genapp-lgsetup: equal on both scenarios (1/1 paragraphs, 2/2 branches), out
of the det-sweep baseline. Non-Db2 det sweep: 99/99 equal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

def int_(self, text: str) -> str: ...
def field(self, text: str) -> str: ...
def read_field(self, text: str) -> str: ...
def past_from(self, text: str, length: int | None) -> None: ...
def int_(self, text: str) -> str: ...
def field(self, text: str) -> str: ...
def read_field(self, text: str) -> str: ...
def past_from(self, text: str, length: int | None) -> None: ...
@squid-protocol

Copy link
Copy Markdown
Owner Author

Superseded by #6962, which fixed the same LGSETUP past-FROM read on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Siblings of #4174: GenApp VSAM programs' COMMAREA (STARTCODE D) path cases

2 participants