Skip to content

fix: restrict handle table routing to exports interface only#87

Merged
avrabe merged 1 commit intomainfrom
fix/handle-table-exports-only-routing
Apr 2, 2026
Merged

fix: restrict handle table routing to exports interface only#87
avrabe merged 1 commit intomainfrom
fix/handle-table-exports-only-routing

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 2, 2026

Summary

  • Handle table functions now only route [export]exports resource ops (the re-exporter's own exported interface)
  • Other [export] interfaces ([export]imports, [export]test:…/test) use canonical resource types — they're for resources the re-exporter consumes from the definer
  • Per-component resource type keying also restricted to exports interface, so shared resources use the same canonical type across components

This fully fixes the resource type identity mismatch (H-11.8). The 3 resource chain tests now pass type validation. Remaining failure is an unreachable trap 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

  • 276 tests pass, 0 failures
  • No regressions — routing filter only affects re-exporter components

🤖 Generated with Claude Code

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>
@avrabe avrabe merged commit f4de6e6 into main Apr 2, 2026
4 checks passed
@avrabe avrabe deleted the fix/handle-table-exports-only-routing branch April 2, 2026 18:47
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