Skip to content

feat: add ww perform update, fix daemon crash-loop#410

Merged
lthibault merged 3 commits intomasterfrom
feat/perform-update-upgrade
Apr 12, 2026
Merged

feat: add ww perform update, fix daemon crash-loop#410
lthibault merged 3 commits intomasterfrom
feat/perform-update-upgrade

Conversation

@lthibault
Copy link
Copy Markdown
Contributor

Summary

Install/update/upgrade refactor: ww perform install conflated first-time bootstrap with refreshing local state, causing stale WASM images to persist across upgrades.

  • ww perform update (new command) — refreshes WASM images (CID comparison), republishes stdlib to IPFS, regenerates daemon config + service file, restarts daemon if images changed, re-wires Claude Code MCP. Safe to run repeatedly.
  • ww perform install refactored — detects existing ~/.ww and delegates to perform_update. Cold-start bootstrap only runs on first install.
  • ww perform upgrade wired — automatically runs perform_update after binary replacement. No manual restart needed.

Daemon crash-loop fix: The daemon was crash-looping because the MCP cell's bin/main.wasm was mounted as a root layer, clobbering the kernel entry point. Removed MCP from daemon image layers.

Kernel http-client fix: The kernel hard-required http-client from the membrane graft, but the daemon doesn't pass --http-dial. Made the capability optional.

Test Coverage

  • 47 kernel unit tests pass (including Option<http_client> paths)
  • CLI changes are integration-level (filesystem, launchd, IPFS) — verified manually via full install/update cycle
  • Pre-existing discovery integration test timeouts unrelated to this branch

Pre-Landing Review

No issues found. Adversarial review identified 4 fixable issues (all addressed):

  • Replaced expect() panic with graceful continue on optional http-client in graft loop
  • Moved IPNS key creation before perform_update so first install publishes correctly
  • Daemon restart gated on any_images_changed to avoid unnecessary service disruption
  • MCP wiring uses add-first-then-remove pattern to avoid leaving user with no config

Test plan

  • cargo check passes
  • cargo test --lib passes (47 tests)
  • ww perform uninstall → clean slate
  • ww perform install → cold start, daemon healthy
  • ww perform install (re-run) → delegates to update, images unchanged
  • ww perform update → same behavior, daemon not restarted (nothing changed)
  • Daemon logs: kernel stays up, no crash loop

The kernel was hard-requiring 'http-client' from the membrane graft,
but the daemon doesn't pass --http-dial. Session.http_client is now
Option<...>, and make_host_handler returns an error when the cap is
requested but unavailable. The graft loop gracefully skips http-client
if the Session has None instead of panicking.
Extract perform_update() from perform_install(). The update command
refreshes WASM images (CID comparison), republishes stdlib, regenerates
daemon config + service file, restarts the daemon if images changed,
and re-wires MCP.

install now detects ~/.ww and delegates to update if already
bootstrapped. upgrade calls update after binary replacement.

Also fixes: daemon image layers no longer include MCP (its
bin/main.wasm was clobbering the kernel entry point).
@lthibault lthibault merged commit 8a9a1b2 into master Apr 12, 2026
10 checks passed
@lthibault lthibault deleted the feat/perform-update-upgrade branch April 12, 2026 23:46
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