Skip to content

#3815 (part 3): the equivalence harness takes a declared encoding for sources and data - #3906

Merged
squid-protocol merged 2 commits into
mainfrom
feat/3815-harness-encodings
Sep 27, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
feat/3815-harness-encodings

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Part 3 of #3815 (epic #3811, plan section 4 "Downstream": equivalence harness: a declared-encoding path for sources and data). Part 1 was #3896; part 2, NFC paths, is in progress.

Problem

The COBOL-vs-Java equivalence harness read COBOL sources and every record byte as Latin-1. A UTF-8 estate's national names (BELØP, नाम) and an EBCDIC record (cp277 æøå, overpunched zoned fields) were compared wrongly or silently mangled.

Change

One declaration with two parts. It comes from a case's source_encoding / data_encoding, or from the --source-encoding / --data-encoding flags:

  • source_encoding: sources are read by the engine's read_source ladder (BOM, UTF-8, the declared page, cp1252, Latin-1). They are staged for GnuCOBOL in the encoding they were read in, or in UTF-8 when that page is not ASCII-family.
  • data_encoding: the code page of the record bytes. It applies to:
    • input files (_fixed) and generated inputs;
    • CICS areas;
    • decode_field and the diff;
    • the Java test's record Charset.

Default is Latin-1, so an undeclared run is byte-identical to before; tests pin this. An EBCDIC data page can be decoded and diffed but not run under GnuCOBOL, and the harness says so rather than running it wrongly.

Files: tests/tools/equivalence.py, equivalence_common.py, equivalence_cics.py, equivalence_inputs.py, equivalence_java.py, and the new tests/cobol_mainframe/test_equivalence_encodings.py. Test tooling only; no engine code.

Checks

CI passes (28 checks, 1 skipped). The subagent's local gate report and my review are still to come before merge.

🤖 Generated with Claude Code

squid-protocol and others added 2 commits September 27, 2026 14:52
… sources and data

The harness read COBOL sources and every record byte as Latin-1. A UTF-8 estate's
national names (BELØP, नाम) and an EBCDIC record (cp277 æøå, overpunched zoned fields)
were compared wrongly or silently mangled.

One declaration, two parts, from a case's "source_encoding" / "data_encoding" or
--source-encoding / --data-encoding:
- source_encoding: sources are read by the engine's read_source ladder (BOM, UTF-8,
  the declared page, cp1252, Latin-1) and staged for GnuCOBOL in the encoding they
  were read in (UTF-8 when that page is not ASCII-family);
- data_encoding: the record bytes' page for input files (_fixed), generated inputs,
  CICS areas, decode_field, the diff and the Java test's record Charset.

Default Latin-1: an undeclared run is byte-identical (pinned by tests). An EBCDIC
data page can be decoded and diffed but not run under GnuCOBOL, and says so.

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

@squid-protocol squid-protocol changed the title Feat/3815 harness encodings #3815 (part 3): the equivalence harness takes a declared encoding for sources and data Sep 27, 2026
@squid-protocol
squid-protocol merged commit 4c6be1b into main Sep 27, 2026
29 checks passed
@squid-protocol
squid-protocol deleted the feat/3815-harness-encodings branch September 27, 2026 19:13
@squid-protocol
squid-protocol restored the feat/3815-harness-encodings branch September 27, 2026 19:18
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.

1 participant