feat: detect and reject P3 async components (Phase 1)#58
Merged
Conversation
Parse P3 component model constructs (future<T>, stream<T>, async/callback canonical options, task.*/subtask.*/stream.*/future.* built-ins) and reject them with a clear, actionable error message before fusion starts. Previously, these were silently mapped to Other/Unsupported/ignored, which would produce broken fused output. Now: - ParsedComponent.p3_async_features tracks all detected P3 constructs - ComponentTypeKind::P3Async variant for future/stream types - convert_canonical_function detects P3 built-in functions - convert_canonical_options detects async/callback options - Fuser.fuse_with_stats rejects components with P3 features early - Error::P3AsyncNotSupported provides component name + feature list - 7 new unit tests covering detection and error paths P2 components are completely unaffected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
avrabe
added a commit
that referenced
this pull request
Mar 22, 2026
P3 Phase 2: sync-only P3 components work with zero code changes. The canonical ABI is identical for sync operations between P2 and P3. Bumping wit-bindgen to 0.54.0 enables P3 fixture generation. P3 async features (stream, future, task.*) are detected and rejected by Phase 1 (PR #58). Sync-only P3 fixtures will pass transparently. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
avrabe
added a commit
that referenced
this pull request
Mar 22, 2026
P3 Phase 2: sync-only P3 components work with zero code changes. The canonical ABI is identical for sync operations between P2 and P3. Bumping wit-bindgen to 0.54.0 enables P3 fixture generation. P3 async features (stream, future, task.*) are detected and rejected by Phase 1 (PR #58). Sync-only P3 fixtures will pass transparently. 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
P3 Phase 1: detect and reject P3 async component model features with clear error messages instead of silently producing broken fused output.
Parser changes:
Future(ty)andStream(ty)→ComponentTypeKind::P3Async(was silentOther)AsyncandCallbackcanonical options detected and trackedp3_async_features: Vec<String>field onParsedComponentRejection:
Fuser::fuse_with_stats()checks all components before fusion startsError::P3AsyncNotSupported(String)variantTests: 7 new unit tests covering option detection, type detection, feature collection, and error message generation.
No changes to existing P2 behavior — only triggers on actual P3 constructs.
Test plan
cargo +stable clippy --all-targets -- -D warningsclean🤖 Generated with Claude Code