test(merger): add LS-A-19 regression for exact resource-import lookup#163
Open
avrabe wants to merge 1 commit into
Open
test(merger): add LS-A-19 regression for exact resource-import lookup#163avrabe wants to merge 1 commit into
avrabe wants to merge 1 commit into
Conversation
PR #156 fixed the `imp.name.ends_with(rn)` suffix-collision bug in `Merger::add_unresolved_imports` (the dedup-skip path propagating `resource_rep_by_component` / `resource_new_by_component` entries) but landed without a regression test. The LS-N verification gate (#161) surfaced this gap as missing coverage on the next-to-last sweep. Extracts the exact-match lookup into a private helper `find_exact_resource_import_idx` and adds three regression tests: - `ls_a_19_exact_match_picks_float_not_bigfloat` — both `float` and `bigfloat` in tracking; asking for `[resource-rep]float` must return float's index, not bigfloat's. The buggy `ends_with` form would match bigfloat under some iteration orders. - `ls_a_19_no_match_returns_none_even_with_suffix_collision` — only bigfloat in tracking, caller asks for plain float. Exact match must return None; the buggy `ends_with` form would return bigfloat's index. - `ls_a_19_resource_new_lookup_is_also_exact` — same suffix- collision case for the `[resource-new]` table. LS-N gate result moves from 15/19 verified (4 missing) to 16/19 verified (3 missing). Remaining missing-bucket entries are LS-CP-4 (likely subsumed by #130 Phase 2), LS-A-8, LS-A-9 — tracked separately as research items. This is also the first real PR exercising the `mythos-auto.yml` workflow added in #162: it touches a Tier-5 file (`merger.rs`) so the auto-runner will fire end-to-end on PR open. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Mythos delta-pass requiredThis PR modifies one or more Tier-5 source files (per Before merge, run the Mythos discover protocol on the
Why this gate exists: LS-A-10 The gate check on this PR will pass once the label is |
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.
Summary
Closes the missing-regression gap for LS-A-19 that the LS-N verification gate (#161) surfaced on its first run. PR #156 fixed the
imp.name.ends_with(rn)suffix-collision bug inMerger::add_unresolved_importsbut landed without a dedicated regression test.Refactors the dedup-skip path's inline
.values().find(...)lookup into a private helperfind_exact_resource_import_idxand adds three regression tests pinning the suffix-collision boundaries.Why this matters
The bug: when two resources shared a suffix (
float/bigfloat), the dedup-skip path'simp.name.ends_with("float")matched both[resource-rep]floatAND[resource-rep]bigfloat..find()returned whichever the HashMap iterated first (also LS-A-15 territory). The wrong import index got stored inresource_rep_by_component, routing subsequentfloatcalls on the second component to thebigfloatimport. Validator passes (both share(i32) -> i32); runtime seesbigfloatrep asfloat— type confusion with no trap (H-10).Tests added
ls_a_19_exact_match_picks_float_not_bigfloatls_a_19_no_match_returns_none_even_with_suffix_collisionbigfloatin tracking, ask forfloat→ must return None (buggyends_withwould have returned bigfloat's index)ls_a_19_resource_new_lookup_is_also_exact[resource-new]tableGate impact
LS-N verification gate verdict moves from 15/19 verified (4 missing) → 16/19 verified (3 missing).
Remaining missing-bucket entries:
End-to-end test for mythos-auto.yml
This is also the first real PR exercising
mythos-auto.yml(added in #162). It touches a Tier-5 file (merger.rs), so the auto-runner should fire end-to-end:Detect Tier-5 changesjob passes the actor gate (avrabe)claude-code-actiononmerger.rswithscripts/mythos/discover.md<!-- mythos-auto-gate -->commentmythos-pass-donelabelWatching for: budget consumption per single-file scan, sticky-comment markdown rendering, label-application timing.
🤖 Generated with Claude Code