Repository navigation
det: refuse a program whose COPY resolution differs from the engine's (#4467) - #4473
Merged
Merged
Conversation
…#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
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:EngineCopiesholds the engine's resolution of one program's own COPY statements.engine_copies_from_ticket(project, program): the port ticket'ssource.copybooks, which the generator writes from the scan's copy_deps.translate()reads it automatically whenever it is given aproject. That covers det_port, port_runner and det_survey with no caller changes.engine_copies_from_ir(ir, rel, root): GalaxyIR, plus --copy-libraries: copy_member_collisions is only in the run summary; a --db-only scan loses it #4421's collision and gap reports.program_lines(..., engine)raisesCopyDisagrees, a subclass ofCopyNotFound, in these cases:COPY DATEWS: translator resolved apps/PAYR/copybook/DATEWS.cpy, engine resolved shared/copylib/DATEWS.cpyCOPY SHPRATE: translator resolved cbl/SHPRATE.cbl, engine resolved nothingCOPY RPTHDR: engine resolved ..., translator expanded no COPY of itCOPY X: the engine records a collisionCOPY 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.
COPY CUSTCOPY, translatorCOPYBOOK/, enginemultiroot/copybooks/cust/)Equivalence cases: none move.
det_port.py run --all-cases --translate-onlytranslated all 55, and each one's ticket was found.fact_crosscheck.py checkpasses and the ledger is unchanged; its translator adapter passes no engine data.Closes #4467
🤖 Generated with Claude Code
https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz