Skip to content

fix: resolve imported resource types in resource position lookup#32

Merged
avrabe merged 1 commit intomainfrom
fix/resource-imported-type-fallback
Mar 16, 2026
Merged

fix: resolve imported resource types in resource position lookup#32
avrabe merged 1 commit intomainfrom
fix/resource-imported-type-fallback

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 16, 2026

Summary

  • resolve_resource_positions now falls back to single-candidate matching when exact resource type ID lookup fails
  • Handles the common case where an imported resource type (e.g., Import(15) at type 24) has a different type ID than the canonical ResourceRep/ResourceNew entry (type 25, Defined)
  • Documents the 3-component resource table routing issue for resource_floats

Context

The resource_floats fixture progressed through 3 error states:

  1. "misaligned pointer" (no resource.rep called) → fixed by PR fix: disambiguate adapter matching and populate fallback resource params #30 fallback path
  2. "unknown handle index 2" (resource.rep called, type mismatch) → fixed by PR fix: propagate resource type aliases in resource import map #31 alias propagation
  3. "handle used with wrong type" (resource.rep called with correct type, wrong table) → documented, needs caller-side resource lookup

Test plan

  • 73 tests pass, 0 failures
  • Pre-commit hooks pass

🤖 Generated with Claude Code

When a component imports a resource type (e.g., Import(15) at type 24)
and defines canonical ResourceRep/ResourceNew using a different type ID
(type 25, Defined), resolve_resource_positions now falls back to
single-candidate matching when the exact type ID lookup fails. This
handles the common case where a component has exactly one resource type
with a given canonical prefix.

Also documents the 3-component resource table routing issue: when the
resource is defined by a third component (not caller or callee), the
adapter needs caller-side resource lookup, not callee-side.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 8d89c2e into main Mar 16, 2026
3 checks passed
@avrabe avrabe deleted the fix/resource-imported-type-fallback branch March 16, 2026 16:01
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.

1 participant