Skip to content

feat(#1820): every host uses runtime.wasm's compatible lifecycle - #1824

Merged
enricopiovesan merged 6 commits into
mainfrom
claude/issue-1820-hosts-compatible
Nov 7, 2026
Merged

enricopiovesan merged 6 commits into
mainfrom
claude/issue-1820-hosts-compatible

Conversation

@enricopiovesan

@enricopiovesan enricopiovesan commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Swift, Kotlin, .NET and web now run the compatible-capability lifecycle in runtime.wasm (Decisions 127 and 128) instead of tracking instances themselves.

#1822 (merged) implemented the runtime side, so this PR changes no runtime code and needs no re-pin.

  • Native (Swift, Kotlin, .NET):
    • RuntimeTraverseEmbedder.compatibleStart passes the caller's input bytes into {capability_id, input} unchanged, as submit does (Decision 126). This resolves Native compatibleStart re-serializes capability input #1811.
    • Each host keeps the runtime's canonical_input per instance.
    • subscribe() publishes compatible_started, compatible_stopped and compatible_killed as embedder-api state_changed. The started event gets that canonical text as input, spliced in unchanged.
  • Web:
    • BundleEmbedder runs one compatible-mode runtime.wasm per compatible capability, initialized with platforms[] and the host platform. The runtime owns instance ids, the allowlist and canonical input.
    • RuntimeWasmHost gains initCompatible and compatible(operation, request).
    • Shutdown reports the runtime's killed_compatible_instances.
  • Breaking (web): one instance at a time, and the runtime's codes. compatible_instance_not_active replaces instance_not_found and instance_not_running, and compatible_instance_active, input_not_canonicalizable and invalid_input are new. The web test double follows the same rules.
  • Docs: Decision 128, the web README error list, the CHANGELOG and next.md.
  • Follow-up: the Rust traverse-embedder crate runs on the natively linked runtime and is out of scope. Rust traverse-embedder still runs its own compatible lifecycle (Decision 127/128) #1823 tracks it.

Governing Spec

  • 072-native-bridge-compatible-lifecycle
  • 057-embeddable-runtime-host
  • 1722-canonical-guest-input-bytes
  • 071-native-runtime-wasm-bridge
  • 1402-runtime-wasm-orchestrator-convergence

Project Item

Closes #1820 (Project 1, In Progress)

Validation

All runs below used the real runtime.wasm (TRAVERSE_NATIVE_ARTIFACT_ROOT set to this checkout).

  • Web npm test: 193 passed, 1 skipped. New tests cover:
    • the canonical-input vectors through compatible("start")
    • the bundle lifecycle with the runtime's codes and the started event's canonical input
  • .NET dotnet test: 51 passed
  • Kotlin testDebugUnitTest: 0 failures
  • Swift swift test, with the host xcframework built from source: 53 passed
  • Each native host adds canonicalInputVectorsReachTheWrapperThroughCompatibleStart, which runs every vector including the bytes-only duplicate-member one, and compatibleLifecycleUsesTheRuntimeRules

🤖 Generated with Claude Code

enricopiovesan and others added 6 commits November 6, 2026 12:04
Implements Spec 072 (amended to 1.1.0, Decision 127): runtime-owned
instance ids, ordered events, platform allowlist, canonical start input,
and shutdown cleanup. The bridge stays 1.1.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts-compatible

# Conflicts:
#	CHANGELOG.md
#	docs/releases/next.md
@enricopiovesan
enricopiovesan merged commit 4f6f07e into main Nov 7, 2026
52 of 56 checks passed
@enricopiovesan
enricopiovesan deleted the claude/issue-1820-hosts-compatible branch November 7, 2026 02:34
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.

All hosts use runtime.wasm's compatible lifecycle (Decision 127) Native compatibleStart re-serializes capability input

1 participant