Skip to content

Switch pid0 from bare Host to Membrane bootstrap#30

Merged
mikelsr merged 2 commits intofeat/membranefrom
feat/pid0-membrane
Feb 20, 2026
Merged

Switch pid0 from bare Host to Membrane bootstrap#30
mikelsr merged 2 commits intofeat/membranefrom
feat/pid0-membrane

Conversation

@lthibault
Copy link
Copy Markdown
Contributor

@lthibault lthibault commented Feb 13, 2026

Depends on: #29#28

Summary

  • pid0 now bootstraps via Membrane(WetwareSession) instead of a bare Host capability
  • Guest calls graft() to receive an epoch-scoped Session with Host + Executor via the WetwareSession extension
  • Host side creates a static epoch channel (never advances for now) and uses build_membrane_rpc() instead of build_peer_rpc()

Changes

File What changed
guests/pid0/build.rs Compile all three schemas (peer, membrane, stem) with src_prefix
guests/pid0/src/lib.rs Switch bootstrap type to Membrane(WetwareSession), call graft(), extract executor from session extension
src/cell/executor.rs Create local watch::channel::<Epoch>(), switch to build_membrane_rpc()

Notes

  • ⚠️ Heads-up: Build fixes, tests, and dev ergonomics for pid0 #31 renames Command/CommandBuilderCell/CellBuilder and unifies the CLI. This branch will need a rebase once Build fixes, tests, and dev ergonomics for pid0 #31 lands.
  • Static epoch — real epoch advancement is a future concern
  • The _epoch_tx sender is intentionally unused for now; it gets promoted to a Command field when real epoch wiring lands
  • Pre-existing WIT package name conflict (cell.wit vs streams.wit) blocks full cargo check but is unrelated

Test plan

  • cargo check -p pid0 --target wasm32-wasip2 passes (modulo pre-existing WIT conflict)
  • cargo check --lib -p ww passes
  • Full e2e test after all membrane PRs land

pid0 now bootstraps via Membrane(WetwareSession) instead of a bare
Host capability. On graft(), it receives an epoch-scoped Session
containing Host + Executor through the WetwareSession extension.

Host side: spawn_with_streams_rpc() creates a static epoch channel
and uses build_membrane_rpc() instead of build_peer_rpc().

Guest side: build.rs compiles all three schemas (peer, membrane, stem)
with src_prefix for clean output paths. lib.rs switches the bootstrap
type and calls graft() to obtain the session.
@lthibault
Copy link
Copy Markdown
Contributor Author

Heads up — #31 (fix/pid0-cleanup) introduces a couple of changes that'll affect this branch when you rebase:

  • CommandCell, CommandBuilderCellBuilder in src/cell/executor.rs and src/cell/mod.rs
  • ww-cli is gone — merged into ww exec subcommand in src/cli/main.rs (client.rs deleted)
  • Makefile rewritten — staged guest builds with --target-dir target, image assembly under examples/images/

Should be straightforward to resolve — the rename is mechanical and the CLI change doesn't touch any of the membrane/RPC code.

@lthibault lthibault marked this pull request as ready for review February 14, 2026 04:34
@lthibault lthibault requested a review from mikelsr February 14, 2026 04:35
@lthibault lthibault self-assigned this Feb 14, 2026
@lthibault lthibault added the enhancement New feature or request label Feb 14, 2026
@lthibault lthibault added this to the Membrane milestone Feb 16, 2026
@mikelsr mikelsr merged commit 81c284b into feat/membrane Feb 20, 2026
@mikelsr mikelsr deleted the feat/pid0-membrane branch February 20, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants