Repository navigation
Description
Epic: VM demo slice — P6 + P4 on one VM, multi-user mocactl, sandbox research turns
The scenario
One KVM-capable Linux VM runs the whole stack. On it, a minimal but honest end-to-end demo shows:
- P6 and P4 on one VM: the P6 process manager (
sh-supervisor,sh-relay, Redis, container sandboxes onmoca-sandbox) and the P4 Firecrackermicrovm-workerattached to the same relay. - mocactl: users log in (GitHub device flow), create and resume sessions, and stream turns.
- Research from the sandbox: the agent runs
curlandgitin its sandbox to research live internet content, and answers from it. - Multi-user: two users on their own laptops, each seeing only their own sessions, each spending their own inference credential.
Where things stand (main @ 03d2ee8, 2026-10-01)
The whole demo ran end to end on the shared KVM rig on 2026-10-01, and every act held. The run is recorded in docs/demos/vm-multi-user-demo.md (#412); results are in this comment. One person played both users, with two GitHub accounts on one laptop. Two people on two laptops has not been tried.
| Part | State |
|---|---|
| P6 on a VM | Works. deploy/vm/setup-vm.sh installs the supervisor, relay, Redis, container sandboxes and the control plane. |
| Control plane | Installed by deploy/vm (#366): a systemd unit, secrets generated once, SH_REQUIRE_AUTH=true. The GitHub OAuth app settings come in through setup-vm.sh's environment (#403). |
| Login | The real device flow is verified with two GitHub accounts (2026-10-01). Misconfiguration now names the operator's fix (#405, #413). There is still no dev identity provider (#362 item 2). |
| Sessions and ownership | Verified live: disjoint session lists, and another user's session refused like a nonexistent one. #371 is the automated two-subject test. |
| Per-user inference credential | Works for a gateway token and for a raw Anthropic key (#372, x-api-key). The operator-key fallback works and refuses a config that can't (#411). Each turn's credential is audited by name. |
curl/git in container sandboxes |
Verified live. The image guarantees curl, git and a writable HOME (#372). research-smoke.sh passed 13/13 (#411), and two users' research turns matched the world. Egress is open this round. |
| P4 microVM | Serves real, authenticated mocactl turns (#376, #409): installer, rootfs recipe, relay wiring, one VM per Exec, per-session workspaces. One tier per host. The demo switches to it live, once. |
curl/git in P4 |
Impossible: the guest has no network device (#277). Verified live: Could not resolve host. |
Children (dependency order)
-
VM demo A: run the MU1 control plane on deploy/vm (systemd unit, generated secrets) #366 — A: the MU1 control plane on
deploy/vm. A systemd unit, env example, secrets generated once, supervisor wiring,SH_REQUIRE_AUTH=true. Everything else builds on this. -
VM demo B: two users log in with mocactl against the P6 VM (device-flow acceptance, ownership checks) #367 — B: two-user mocactl login.
- the OAuth app on the VM path, and the acceptance runbook (feat(deploy/vm): GitHub OAuth app on the VM path + two-user acceptance runbook (#367 items 1, 2, 4) #403);
- the automated two-subject test (test: automated two-subject test for VM demo B (#367 item 3) #371);
- the live two-account run on 2026-10-01: login,
doctor,run, disjoint lists, and the cross-owner 404 through the token mint.
The API-level
GET/DELETE404s and the harness'ssession_mismatchwere not run live; test: automated two-subject test for VM demo B (#367 item 3) #371 covers them (details). -
VM demo C: per-user inference credentials and a curl/git research turn in the P6 container sandbox #368 — C: per-user inference credentials plus a
curl/gitresearch turn in the container sandbox, with a live smoke. Done in feat: per-user inference credential headers and sandbox research tooling (#368 phase 1) #372 and feat: operator fallback on the VM and a curl/git research-turn smoke (#368 phase 2) #411, and verified live on 2026-10-01: smoke 13/13, and two users on their own keys. -
VM demo D: wire the P4 microVM worker into P6 and run its first real harness turn #369 — D: P4 wired into P6. Installer, rootfs and snapshot recipe, relay wiring, tier pinning, the first real harness turn through microVMs. Its wiring can start in parallel; it needs A for the multi-user demo.
-
Demo runbook:
docs/demos/vm-multi-user-demo.md, merged in docs(demos): the VM multi-user demo runbook (#370) #412 (5cfc2d5), performed end to end on 2026-10-01.
Open issues the demo depends on or found
- VM demo: MI1 S2's first-subject pin will refuse the second user — sequence it against the two-user demo #407: once MI1 S2's first-subject pin lands,
singlerefuses user 2. Re-pin the demo's tenancy then. - deploy/vm: setup-vm.sh re-run recreates sh-redis (no volume) and loses every session #410: a
setup-vm.shre-run recreates Redis and forgets every session. This is why the demo switches tiers only once, to P4. - deploy/vm: setup-vm.sh never pulls the sandbox image, so a host runs a stale :latest #414:
setup-vm.shnever pulls the sandbox image. The demo's prep pulls it by hand. - sandbox image: no git identity, so an agent's first git commit fails #415: no git identity in the sandbox image, so an agent's first commit fails until it sets one.
- mocactl: --profile, so one machine can hold more than one login #404, mocactl: headless 'sessions' (and 'credentials') commands with --json #406:
mocactl --profile, and headlesssessions/credentials.
Each child is written so a planner can start it in a fresh session.
What this demo does NOT claim (say so in the runbook)
- No sandbox isolation between users on the container tier. Every user's turns lease the same shared sandbox containers, which share
/workspace, the Unix user and the process list. That's MI1 S5 (owner binding). - Direct credential mode. With no injector, a user's real inference secret reaches the shared worker. Grants replace this in MI1 S2.
- Open egress. Container sandboxes reach the whole internet, including cloud instance metadata (deploy/vm: sandboxes can reach cloud instance metadata (169.254.169.254) #357). Require IMDSv2 with hop limit 1 on the demo host.
- P4 has no internet (P4.1: implement microVM egress transport (vsock → shared proxy) #277) and no grant binding (MI1 S4). The P4 act runs on local content.
- Plain HTTP. Clients reach the VM by SSH tunnel or a firewall allowlist. There's no TLS.
Interaction with the MI1 roadmap
The multi-user isolation design (docs/specs/2026-09-28-moca-multi-user-isolation-design.md, §10.2) is building S2–S6 in parallel. Two collisions to watch:
- §6.6 first-subject pin: once S2 lands,
MOCA_TENANCY=singlerefuses every subject after the first. A two-user demo then needsMOCA_TENANCY=multi, which needs S5. Pin the demo to a release, or sequence it after S5. - Direct mode retired under
multi(S2) and item C's credential-shape fix: C's plan must say how S2's grants absorb it.
Optional follow-ups (not scheduled here)
- Per-session working directory on the container tier (Container worker: honour workspace_key with a per-session working directory #408).
remote-worker/internal/exec/runner.go:98ignoresWorkspaceKey. Honouring it (/workspace/<key>) removes the "user B sees user A's clone" moment, which the live run showed: both users' clones were in one container. It isn't a security boundary. - Per-session tier selection (worker labels, a session attribute, or a record filter), so both tiers can attach to one host at once.
- Loopback dev identity provider for GitHub-free trials (MU1 follow-ups from #348: VM control plane on Vault, dev identity provider, inference-credential binding #362 item 2, ADR first).
- Vault as the VM credential store (MU1 follow-ups from #348: VM control plane on Vault, dev identity provider, inference-credential binding #362 item 1).
- TLS in front of the control plane and supervisor.
Working conventions
- Plans live in
docs/plans/(gitignored), one per child, written withsuperpowers:writing-plans. - Commits are signed off (
git commit -s) with anAssisted-Bytrailer. - Anyone using the shared KVM rig alerts the owner first.
Activity
docs(demos): the VM multi-user demo runbook (rossoctl#370)
docs(demos): record the VM demo's first live run (rossoctl#370)
pdettori commentedon Oct 1, 2026
The demo ran end to end on the shared KVM rig, 2026-10-01, at
main@ 03d2ee8. The runbook with the run recorded isdocs/demos/vm-multi-user-demo.md, in #412, which is ready for review.Every act held, with two real GitHub accounts and a real model on each user's own Anthropic key. One person played both users, on one laptop; two people on two laptops is the one case not tried.
p4-turn-smoke.sh --auth --failure-pathspassed 34/34. The live switch, removing the containers and starting the worker, attachedmoca_microvm_0alone in 2 s. Nobody had to log in again, and no session was lost.github:6678093,github:228572680).doctorpassed all seven checks for both, and they created and resumed sessions withmocactl run.git cloneandcurl -oin a container sandbox, and answered03d2ee8c067d,v26.10.0,2026-09-21. All three equalgit ls-remoteand nodejs.org's index.research-smoke.shpassed 13/13 in prep.anthropicfor user 1 andanthropic-devfor user 2, with different keys. Each user's session list held only their own sessions. Another user's session id was refused exactly like a made-up one, and its owner resumed it normally.On the P4 tier:
Linux (none) 6.18.44+, against the host's6.18.44-99.149.amzn2023.curlfailed withCould not resolve host(P4.1: implement microVM egress transport (vsock → shared proxy) #277), as the runbook says it will.The "does not claim" list, seen live: both users' research clones landed in the same container's
/workspace(sh-sandbox-1). That's the shared-sandbox limit, MI1 S5 and #408, and the runbook makes it an act of its own.New issues from the run:
setup-vm.shnever pulls the sandbox image. The rig's predated feat: per-user inference credential headers and sandbox research tooling (#368 phase 1) #372 until it was pulled by hand.#412's fix list also records smaller findings:
research-smoke.shleaving an empty subject record;Status of the children:
doctor,run, disjoint lists and the cross-owner 404 via the token mint. The API-levelGET/DELETE404s and the harness'ssession_mismatchweren't run live. They're covered by test: automated two-subject test for VM demo B (#367 item 3) #371's automated test, and by a 10-minute pass throughvm-two-user-acceptance.mdAct 2. Details are on VM demo B: two users log in with mocactl against the P6 VM (device-flow acceptance, ownership checks) #367.Still open and relevant:
setup-vm.shre-run forgets every session, which is why the demo switches tiers only once.The rig afterwards: it's back to how it was found (P4-only, its earlier checkout, config files restored, tunnel accounts and the run's sessions removed). Two exceptions: the post-#372 sandbox image is kept, and the sessions from before the run are gone, lost to the prep step's Redis reset.
Merge pull request #412 from pdettori/docs/370-vm-multi-user-demo
pdettori commentedon Oct 2, 2026
Closing: every child is done and the runbook is merged (#412,
5cfc2d5). The demo was performed end to end on 2026-10-01 (results).The open issues listed above aren't on the demo's critical path, and they stay open on their own:
setup-vm.shre-run loses sessions;setup-vm.shnever pulls the sandbox image;