Skip to content

#3829: the input generator makes dates in any language and shape - #3872

Merged
squid-protocol merged 1 commit into
mainfrom
fleet/3829-input-dates
Sep 27, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fleet/3829-input-dates

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3829 (epic #3819).

tests/tools/equivalence_inputs.py used to write a date only into a field whose name contained DATE and that was 10 bytes wide. Fields named DATUM, FECHA, DATO or DATA, and 8-byte YYYYMMDD / DDMMYYYY fields, got random letters instead. The program then took only its invalid-date path, so the equivalence proof covered less than it appeared to.

What changes

  • Inferred dates. A field gets a valid date when one of its hyphen-separated name parts is a date word: DATE DATUM FECHA DATA DATO TARIKH HIZUKE NGAY. Examples: WS-FECHA-ALTA, DATUM-VON, KTO-DATO. The shape follows the width: 8 bytes gives YYYYMMDD, 6 bytes gives YYMMDD. A date word inside another word does not count, so CANDIDATE, UPDATE-FLAG and KDATO stay text.
  • Declared shape. A case can set a shape per field: "fields": {"KTO-DATUM": {"date": "DD.MM.YYYY"}}. The tokens are YYYY, YY, MM and DD; anything else is written as-is. It works on text fields and on numeric ones (PIC 9(8) holds the digits as a number). A shape that doesn't fit the field's width, or a non-digit shape on a numeric field, raises an error.
  • Existing data unchanged. The old English rule (a 10-byte field with DATE in its name) is kept exactly. The random draws happen in the same order, so every existing seeded dataset is byte-identical; a test pins this.

Tests

  • New tests/cobol_mainframe/test_input_dates.py.
  • EQUIVALENCE_E2E=1 with the equivalence, inputs, CICS and new date tests (Docker GnuCOBOL + JDK 17): 63 passed.
  • pr_gates.py --fast: 5/5 pass.

🤖 Generated with Claude Code

A field whose name has a date word as one of its hyphenated parts (DATE,
DATUM, FECHA, DATA, DATO, TARIKH, HIZUKE, NGAY) and is 8 or 6 bytes gets a
valid YYYYMMDD / YYMMDD; never a substring match (CANDIDATE, UPDATE-FLAG).
A case may declare a shape per field, {"date": "DD.MM.YYYY"}, text or
numeric (PIC 9(8) holds the digits as its number); a shape that does not
fit the field is an error. The English 10-byte *DATE* rule is kept, so
every existing seeded dataset is byte-identical.

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 merged commit 15def11 into main Sep 27, 2026
29 checks passed
@squid-protocol
squid-protocol deleted the fleet/3829-input-dates branch September 27, 2026 13:31
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.

Input generator assumes English field names and ISO dates (DATUM / FECHA / DATO; DDMMYYYY)

1 participant