fix: restrict handle table routing to exports interface only#87
Merged
Conversation
Handle table functions should only route [export]exports resource operations — the re-exporter's own exported interface. Other [export] interfaces (like [export]imports or [export]test:resource-floats/test) are for resources the re-exporter CONSUMES from the definer and must use canonical resource types. Also restrict per-component resource type keying to the exports interface, so shared resources (like imports/float) use the same canonical type across all components that reference them. This fixes the resource type identity mismatch for 3-component chains. The 3 resource chain tests now get past type validation (was: "handle used with wrong type", now: unreachable trap in re-exporter slab code). Part of #69. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
[export]exportsresource ops (the re-exporter's own exported interface)[export]interfaces ([export]imports,[export]test:…/test) use canonical resource types — they're for resources the re-exporter consumes from the definerexportsinterface, so shared resources use the same canonical type across componentsThis fully fixes the resource type identity mismatch (H-11.8). The 3 resource chain tests now pass type validation. Remaining failure is an
unreachabletrap in wit-bindgen's ResourceTable slab code inside the re-exporter — the handle table values (memory addresses) reach the slab correctly but trigger an internal assertion.Part of #69.
Test plan
🤖 Generated with Claude Code