Skip to content

det: refuse a program whose COPY resolution differs from the engine's (#4467) - #4473

Merged
squid-protocol merged 2 commits into
mainfrom
fix/4467-copy-refuse
Oct 5, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
fix/4467-copy-refuse

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

What

The det translator resolves COPY with its own first-hit directory search, and that search is independent of the engine's resolver. #4459 / #4460 / #4461 (found by the #4273 cross-check) are three ways the two disagree and the translation silently builds a wrong record.

This is the interim fix, kept small: compare each COPY with the engine's resolution, and refuse by name where they differ. The translator does not take over the engine's resolution here; that belongs with #4461 after #4273's ownership table.

How

det/source.py:

  • EngineCopies holds the engine's resolution of one program's own COPY statements.
  • Where the engine's data comes from:
  • program_lines(..., engine) raises CopyDisagrees, a subclass of CopyNotFound, in these cases:
shape message
#4461: the member exists in two libraries COPY DATEWS: translator resolved apps/PAYR/copybook/DATEWS.cpy, engine resolved shared/copylib/DATEWS.cpy
#4460: a program source is spliced in COPY SHPRATE: translator resolved cbl/SHPRATE.cbl, engine resolved nothing
#4459: a COPY the translator never expands COPY RPTHDR: engine resolved ..., translator expanded no COPY of it
the engine reports a collision COPY X: the engine records a collision
the engine reports a gap, and the translator filled it from the estate COPY X: the engine records a gap ...

Not refused: system or generated members outside the estate, such as DFHAID, SQLCA and symbolic maps built from BMS. The engine has none of these.

Tests (test_det_translate.py, in the #4411 section): one test per shape, plus an agreement case, the system-member case and the ticket reader. 115 pass under tree-sitter-language-pack, none skipped.

Newly refused

Counted per program with GalaxyIR from the scans at a1ec00d. The baseline is the same program expanded without the engine check.

corpus / estate programs newly refused
CardDemo 44 0
CBSA 31 0
GenApp 31 0
MortgageApplication 6 0
DSF 7 0
zECS 5 0
zopeneditor-sample 5 2 (SAM1, SAM2: COPY CUSTCOPY, translator COPYBOOK/, engine multiroot/copybooks/cust/)
estate-crucible v0.4.0 40 19 (9 collisions, 6 COPYs not expanded, 4 other files)

Equivalence cases: none move. det_port.py run --all-cases --translate-only translated all 55, and each one's ticket was found. fact_crosscheck.py check passes and the ledger is unchanged; its translator adapter passes no engine data.

Closes #4467

🤖 Generated with Claude Code

https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz

squid-protocol and others added 2 commits October 5, 2026 11:13
…#4467)

The interim for #4459 / #4460 / #4461 (found by the #4273 cross-check): the
translator resolves COPY by its own first-hit directory search. Each COPY of
the program's own is now checked against the engine's resolution (the port
ticket's copybooks, which the generator writes from the scan; or GalaxyIR via
engine_copies_from_ir, with #4421's collisions and gaps), and the program is
refused by name (source.CopyDisagrees) when:
- the translator found another file than the engine (#4461),
- the translator found an estate file the engine resolved nothing for
  (#4460: a program source spliced in),
- the engine resolved a member the translator never expanded (#4459),
- the engine reports the member as a collision, or as a gap that the
  translator fills from the estate (system members such as DFHAID are not).
The translator does not take the engine's resolution yet (#4461, after
#4273's ownership table).

No equivalence case moves (all 55 translate, each with its ticket found).
Newly refused at a1ec00d: zopeneditor-sample SAM1 / SAM2; estate-crucible
19 of 40 (9 collisions, 6 COPYs not expanded, 4 other files); none in
CardDemo, CBSA, GenApp, MortgageApplication, DSF, zECS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 5, 2026 15:43
@squid-protocol
squid-protocol merged commit dd26924 into main Oct 5, 2026
40 checks passed
@squid-protocol
squid-protocol deleted the fix/4467-copy-refuse branch October 5, 2026 15:43
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.

det translator: refuse a program when its COPY resolution differs from the engine's (interim for #4459–#4461)

1 participant