Repository navigation
Fix #4011: dto_shape resolves a class by its package, not an arbitrary simple-name match - #4014
Merged
Merged
Conversation
Contributor
…ary simple-name match equivalence_cics.java_class_file resolves a generated class the way Java does: a qualified name by its path; a simple name from the file that names it (single-type imports, own package, on-demand imports); else the only class of that name. Two candidates with nothing to choose between them raise LookupError instead of quietly picking entity/PcwizWsState over dto/contract/PcwizWsState. dto_shape and its part classes resolve through it, run_java_cics passes the service as context, and the CICS crucible runner drops its own path-based copy. Part of #3989. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EC8FWfn3aPmsUPnRgKNVup
squid-protocol
force-pushed
the
fix/4011-dto-shape-fqn
branch
from
September 29, 2026 18:30
d08735f to
788dfa4
Compare
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.
Fixes #4011
Part of #3989 (phase 3, lane A)
What changed
equivalence_cics.java_class_file(src, name, context=None)is new. It resolves a generated class the way Java does:pkg.dto.contract.PcwizWsState) resolves by its path.context, the file that names the class. It checks that file's single-type imports first, then its own package, then its on-demand (.*) imports.src.LookupErrornaming both paths. Before,next(rglob(...))quietly took whichever came first, soentity/PcwizWsStatewon overdto/contract/PcwizWsStateand the COMMAREA mapping came back empty.dto_shape(src, cls, context=None)resolvesclsthroughjava_class_file. It resolves each part class (a composite COMMAREA's segments) from the DTO that declares it. A missing class raisesLookupErrorinstead ofStopIteration.run_java_cicsnow passes the service file as context. The COMMAREA class is the one the service imports.tests/tools/cics_crucible.pydrops its own path-baseddto_shapecopy (the workaround from #3989 phase 2: CICS crucible runner, baseline ratchet and CI #4000). It callsequivalence_cics.dto_shapewith the fully qualified class name that the generated test reports.Tests
test_a_dto_is_found_by_its_package_not_its_simple_namecovers entity and contract DTOs with the same simple name. It checks:test_a_dtos_shape_is_read_from_its_comments(default package, no context) still passes.Crucible cells
Before and after are identical. The runner already resolved the class by its full path, so this PR moves the fix into the harness and adds no cells. The baseline and report are unchanged.
On the first base (d650001),
results.jsonwas byte-for-byte the same before and after, with 20 pass, 12 fail and 62 unsupported. The branch is now rebased on #4013 (5c6d17f). There--cimeasures 22 pass, 38 fail and 34 unsupported, and the non-passing cells match the committed baseline cell for cell.Verification
cics_crucible.py --ciis green.EQUIVALENCE_E2E=1,tests/cobol_mainframe/test_equivalence_cics.pyandtests/cics_cruciblepass 46 of 46. That includes the CardDemo account-view run end to end, which now goes through the service's import.ruff formatis clean on the touched files. The engine and forge are untouched, so no golden masters change.🤖 Generated with Claude Code