Skip to content

carddemo-cbstm03b case: call harness datasets, a called program's files, open-state statuses (Part of #5561) - #5589

Merged
squid-protocol merged 1 commit into
mainfrom
churn/5561-20261019T0804Z
Oct 19, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/5561-20261019T0804Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5561 (slice 2 of 2)

What

  • tests/tools/equivalence_call.py: a kind: call case may carry datasets (indexed and sequential inputs staged, DD env bound on the COBOL run, entity repositories loaded on the Java side), on the text and the DTO path. compare datasets stay unsupported (raises Unsupported).
  • det/program.py: a CALLed program's file handles are built once in its constructor. They were only built in runBatch, so a called program's files were null.
  • DetFiles.Indexed tracks its open state: 41 (OPEN of an open file), 42 (CLOSE of a closed one), 46 (sequential READ after end of file), 47 (READ of a file not open).
  • New case carddemo-cbstm03b (CardDemo, burned; Apache-2.0 LICENSE/NOTICE copied): each of the four files x OPEN/READ/CLOSE, end of file, a missing record (23), a short key, misuse statuses, an unknown DD.

Evidence (level L2, calls driven through LINKAGE)

  • Translated: whole, 53/53 statements, no holes.
  • Executed-equivalent: 33 calls, 0 diffs.
  • Coverage: 14/14 paragraphs, 29/29 branches.
  • Assumptions: oracle is GnuCOBOL + our stub, not z/OS. 41/42/46/47 are the ISO/IBM statuses; GnuCOBOL agrees on every call. KEY-LN is spelled in overpunch form (000I) because GnuCOBOL -fsign=EBCDIC rewrites an unsigned digit read as S9(4) in place.
  • Re-proof after the runtime change: det_port.py check listed 84 ports; re-proved 77 PROVED, 5 DIFFERS (cbsa-bnk1ccs, bnk1tfn, bnk1uac, bnk1uac-generated, crecust), all already in det_sweep_baseline.json. Existing call cases carddemo-dateutil, mortgage-nbrvl still PROVED; mortgage-mpmt unchanged (named hole, C6).
  • Gates: pr_gates --fast 6/6, --ratchets 8/8, related cobol_mainframe tests pass. No parsing change, no golden bless.

Plan changed

The request block is a group USING item, so the det service takes the forged DTO, not CobolRef<String>: the datasets hooks went into the DTO template too. Two runtime gaps (files only built in runBatch, no open state) were found only when the Java side ran, so program.py and DetFiles.java changed too. That used the five-file budget, so the planned test_equivalence_call_datasets.py is a remaining slice.

Cross-repo

None. Companions: PR #5579 (equivalence_cics.py) and #5587 (test_mutation_tooling.py) do not touch these files; origin/main merged cleanly.

Remaining slices

  • Unit test for the datasets hooks (script and Java text generation, no-datasets output unchanged).
  • compare datasets for call cases (unload after the calls).
  • Sequential files in a called program: handles are built with no DD list, so a sequential file has no path to resolve.

Sibling gaps

  • DetFiles.Sequential / VarSequential have no open-state statuses (41/42/46/47); write/rewrite on a closed indexed file (48/49) not modelled.

Lessons for agents

  • A CALLed program's file handles were only built in runBatch: the first symptom is an NPE on <FD>_FILE, not a status.
  • A change to DetFiles.java is part of every port's runtime: det_port.py check then lists ~80 ports to re-prove; compare any DIFFERS against det_sweep_baseline.json before treating it as a regression.
  • GnuCOBOL with -fsign=EBCDIC rewrites an unsigned S9(4) argument in place on read; spell it in overpunch form in call args.

🤖 Generated with Claude Code

…ram's files live in its service (Part of #5561)

- equivalence_call.py: datasets (indexed / sequential inputs staged, DD env bound on the COBOL run, entity
  repositories loaded on the Java side), text and DTO paths; compare datasets stay unsupported.
- det program.py: a CALLed program's file handles are built once in the constructor (they were only built in runBatch).
- DetFiles.Indexed tracks its open state: 41 / 42 / 46 / 47.
- case: 33 calls, every file x OPEN / READ / CLOSE, end of file, a missing record, misuse statuses.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 19, 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 19, 2026 08:54

def stage_inputs(case: dict[str, Any], corpus: Path, dest: Path) -> None:
"""Each dataset's input as fixed-length records in `dest/<DD>.in` (as a batch case stages them)."""
import equivalence_inputs # `@generate` inputs, from their record layouts

def cobol_datasets(case: dict[str, Any], src: Path, flags: str) -> tuple[list[str], str]:
"""(script lines that build and run the loaders, the run's DD environment) for the case's datasets."""
import equivalence # lazy: equivalence dispatches to this module
@squid-protocol
squid-protocol enabled auto-merge (squash) October 19, 2026 09:00
@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 48f6868 into main Oct 19, 2026
92 checks passed
@squid-protocol
squid-protocol deleted the churn/5561-20261019T0804Z branch October 19, 2026 09:21
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.

2 participants