Skip to content

#3934 / #3930: the yml's culture.zone reaches the clock; port tickets reference the COMMAREA class instead of inlining it - #3944

Merged
squid-protocol merged 2 commits into
mainfrom
claude/sleepy-bohr-khp6rj
Sep 28, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
claude/sleepy-bohr-khp6rj

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Fixes #3934
Fixes #3930

#3934: the generated application.yml's zone was dead config

  • What was wrong. _culture_yml writes gitgalaxy.culture.zone, but MainframeClock read only @Value("${gitgalaxy.zone:<baked>}"). So editing the zone in the yml, as the file invites, changed nothing.

  • The fix. The clock now reads:

    @Value("${gitgalaxy.zone:${gitgalaxy.culture.zone:<baked zone>}}")
  • Why this order, and not the brief's ${gitgalaxy.culture.zone:${gitgalaxy.zone:…}}. The equivalence harness pins gitgalaxy.zone per case (equivalence_java.py:120). With the yml key first, any generated project with a non-default culture (so culture.zone in its yml) would silently ignore the harness's per-case zone.

    • This order lets an explicit gitgalaxy.zone win.
    • Otherwise the yml key applies, so editing it moves the clock, which is the issue's acceptance.
    • Otherwise the baked zone stands.
  • Audit of the other keys _culture_yml writes. None of rounding, overflow, format_locale, display_locale, decimal_point, currency, key_collation or db2_date_format has a run-time reader. All are applied when the code is generated. The yml keeps them as the record of what the project was generated with, and a comment in it now says so: only zone is read at run time, and changing the others means regenerating.

  • Tests (test_time_zones.py): the clock's @Value is resolved with Spring's nested ${key:default} rules against the generated yml of a culture.zone: Asia/Kolkata migration.

    properties set clock zone
    the yml as generated Asia/Kolkata
    the yml's key edited to Europe/Berlin Europe/Berlin
    gitgalaxy.zone=UTC also set UTC
    none the baked zone

    The default culture's yml is unchanged. The Cultural Gauntlet's runtime-static oracle now expects the new expression.

#3930: tickets reference what the generated code carries

reference_generated() runs on every ticket, not only over budget, before #3919's trim_ticket.

  • What it replaces. Each facts.interface record layout (the COMMAREA, and each container that has a layout) becomes Reference: <Class> (<n> fields: name, PIC, usage, offset, bytes, copybook) in <path>. The fact's other keys are kept.
  • When it does that. Only after _carrying_class checks the generated dto.contract class field by field.
    • The class is found by its Javadoc (COBOL record <record> (<file>)).
    • Every named field's comment must match the layout: name, PIC, usage, offset, width and copybook, in order, with FILLERs excluded as the generator excludes them.
    • Any difference means the field list stays inline.
  • What the ticket records. referenced lists each replacement with its bytes before and after. Bytes only: a token count depends on whether tiktoken loads, which would make tickets differ by environment.

Section by section:

section outcome why
facts.interface COMMAREA and containers referenced _field_lines renders every named field with name, PIC, usage, offset, width and copybook; the level numbers are in the copybook listings the ticket already attaches
facts.interface unpacked COMMAREA (basis: unpack) inline one DTO per record the program unpacks, not one layout
facts.cics_file_lineage inline the generated entity and repository carry the file name, DSN and verbs, but not the CSD key length (the entity says "no key is known"), the group, or the line of each access
record layouts nothing to do records is a bulk section (_BULK_SECTIONS) that never reaches a ticket; the *Record entities carry it

Measured on a COACTVWC-shaped CICS fixture: an account view with a CardDemo-style 16-field COMMAREA, two CICS file reads and one BMS map. Tokens are tiktoken o200k_base.

bytes tokens
facts.interface 5,055 → 1,087 (−78%) 1,529 → 325 (−79%)
facts.cics_file_lineage 1,226 → 1,226 356 → 356
whole ticket 34,219 → 29,454 (−14%) 8,673 → 7,549 (−13%)

#3863 measured COACTVWC's real facts.interface at 10.9 KB, so its saving should be proportionally larger, but I haven't measured it: the CardDemo corpus isn't in this clone.

Tests (test_port_ticket_references.py, run through the real pipeline):

  • the COMMAREA becomes a reference to the class that carries it, every other key is unchanged, and each dropped field is present in the class;
  • cics_file_lineage stays inline, key lengths included;
  • the section shrinks by more than half, in bytes and in tokens;
  • _carrying_class refuses a class with a moved field, a different usage, a missing field or another program's record, and a layout with an unknown offset.

Refraction snapshots

The pinned mainframe corpora aren't in this clone, so I couldn't regenerate the snapshots here. Two changes will show up once CI has the corpora:

  • a CICS program's ticket whose COMMAREA or container layout its contract class carries will show that layout as a reference, plus a referenced block;
  • the generated MainframeClock will show the new @Value expression.

Type of change

This is COBOL-to-Java generation only, so the engine's golden masters don't move. The branch has origin/main (with #3940) merged in. #3940 had already fixed test_lazy_re's order-dependent fork test, so main's version is kept.

CI checklist

  • python tests/tools/audit_check.py: all clear (ruff, mypy, dead-key, format)
  • python -m pytest tests/: 12,929 passed on the merged branch
  • n/a: crucible / tree-sitter (no parsing change)
  • n/a: output JSON schema

Differential Scan target

n/a

Verification

$ python -m pytest tests/ -n auto -q          -> 12929 passed, 48 skipped
$ python -m pytest tests/cultural_gauntlet -q  -> 103 passed
$ python tests/tools/audit_check.py            -> all clear

🤖 Generated with Claude Code

https://claude.ai/code/session_01X9PBcL8evG7CEzff1zE8v5


Generated by Claude Code

…rence the COMMAREA class

#3934: the generated application.yml wrote gitgalaxy.culture.zone but
MainframeClock read gitgalaxy.zone, so editing the yml's zone changed
nothing. The clock now reads ${gitgalaxy.zone:${gitgalaxy.culture.zone:
<baked>}}: gitgalaxy.zone still wins when set (the equivalence harness pins
it per case), else the yml's key, else the zone baked in at generation.
Audit of the other eight culture keys: none is read at run time (all are
applied at generation), so the yml now says so. The Cultural Gauntlet's
runtime-static oracle expects the new expression.

#3930: port tickets always reference, not inline, a facts.interface record
layout the generated contract class carries: the COMMAREA and each
container layout, once the dto.contract class is checked field by field
(name, PIC, usage, offset, width, copybook). Other keys are kept; the ticket
records `referenced` with bytes before / after. Left inline by design: an
unpacked COMMAREA, cics_file_lineage (its CSD key length, group and access
lines are in no generated class) and record layouts (`records` is a bulk
section that never reaches a ticket). On a COACTVWC-shaped CICS fixture:
facts.interface 5,055 -> 1,087 bytes (1,529 -> 325 tokens), the ticket
34,219 -> 29,454 bytes.

Also: test_lazy_re's fork test builds fresh lazy rules -- deepcopy shares
the registry's patterns, which an earlier test may have compiled (it failed
under xdist).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X9PBcL8evG7CEzff1zE8v5
…p6rj

# Conflicts:
#	tests/core_engine/test_lazy_re.py
@squid-protocol squid-protocol added this to the GitGalaxy Tours the Globe milestone Sep 28, 2026 — with Claude
@squid-protocol squid-protocol added the legacy-modernization COBOL refractor, dead-code extraction, and JCL forging label Sep 28, 2026 — with Claude
@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 ec88ecb into main Sep 28, 2026
46 of 47 checks passed
@squid-protocol
squid-protocol deleted the claude/sleepy-bohr-khp6rj branch September 28, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

legacy-modernization COBOL refractor, dead-code extraction, and JCL forging

Projects

None yet

2 participants