Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b10434b
feat: add microVM execution environments
JAORMX Sep 9, 2026
2f66f1c
fix: simplify microVM execution experience
JAORMX Sep 11, 2026
9ec6076
fix microVM release workflow invariant
JAORMX Sep 11, 2026
e1ee689
fix: keep server placement validation backend agnostic
JAORMX Sep 14, 2026
6958622
feat(microvm): support schedule placement lifecycle
JAORMX Sep 14, 2026
07e170b
ci: allow cold multi-module builds to finish
JAORMX Sep 14, 2026
9f59a0a
fix(microvm): harden placement and release lifecycle
JAORMX Sep 15, 2026
9da6e5f
fix(microvm): clear guest supplementary groups
JAORMX Sep 15, 2026
4a8b2e7
test(mecated): bound MicroVM placement lifecycle test
JAORMX Sep 15, 2026
9f1e97b
fix(ci): align MicroVM checks with current lint and release workflows
JAORMX Sep 16, 2026
548daf1
refactor(microvm): keep only the repository-scoped lifecycle
JAORMX Sep 16, 2026
bfe0763
docs(microvm): avoid ADR number collision with main
JAORMX Sep 16, 2026
2843c61
fix(microvm): recover persistent placements across daemon restarts
JAORMX Sep 21, 2026
c4da32a
fix(microvm): repair CI portability and daemon restart
JAORMX Sep 21, 2026
a28c874
fix(microvm): preserve atomic Darwin publication
JAORMX Sep 21, 2026
47eba09
build(microvm): qualify v0.0.41 release inputs
JAORMX Sep 23, 2026
e41ed68
fix(store): stabilize concurrent lineage reads
JAORMX Sep 23, 2026
1d97c47
fix(microvm): close Linux launch receipt races
JAORMX Sep 23, 2026
6525ed9
feat(microvm): preserve Darwin repository ownership
JAORMX Sep 23, 2026
34acf1e
feat(microvm): add authenticated Darwin supervision
JAORMX Sep 23, 2026
2a1d575
docs(microvm): define Darwin qualification contract
JAORMX Sep 23, 2026
1b7aa00
merge: integrate main into microvm execution environments
JAORMX Sep 23, 2026
083f2ed
fix(microvm): repair Darwin supervisor shutdown
JAORMX Sep 23, 2026
8b0a4b5
test: isolate host-sensitive adapter fixtures
JAORMX Sep 23, 2026
b0e1c8f
test(microvm): bound fake runner lifetimes
JAORMX Sep 23, 2026
18c4450
test(microvm): make Darwin fixture cleanup cooperative
JAORMX Sep 23, 2026
1a199ef
fix(microvm): make Darwin cleanup descriptor-bound
JAORMX Sep 23, 2026
7e6648c
fix(microvm): repair CI security probes
JAORMX Sep 23, 2026
37ff59a
fix(microvm): stabilize Darwin registry lock creation
JAORMX Sep 23, 2026
74a8ec0
test(microvm): fix restart and cancellation assertions
JAORMX Sep 23, 2026
2b3e7b9
test(microvm): let Unix listener own socket cleanup
JAORMX Sep 23, 2026
cb9bce5
test(microvm): recognize reaped procfs identities
JAORMX Sep 23, 2026
3638bb5
docs(microvm): amend connection-owned acquisition contract
JAORMX Sep 25, 2026
0fc30d9
feat(microvm): bind independent harness context sources
JAORMX Sep 25, 2026
714fa93
feat: retain microvm acquisition ownership
JAORMX Sep 25, 2026
13f6406
fix: serialize microvm acquisition ownership
JAORMX Sep 25, 2026
0bb6a90
test: repair microvm ownership integration boundary
JAORMX Sep 25, 2026
799f2b2
fix: close microvm acquisition authority and cleanup races
JAORMX Sep 25, 2026
c39b598
fix: drain microvm operation pins before cleanup timeout
JAORMX Sep 25, 2026
09082c8
test: close microvm ownership proof gaps
JAORMX Sep 25, 2026
7fca553
chore: address ownership lint findings
JAORMX Sep 25, 2026
c6dd496
docs(microvm): explain local acquisition lifetime and recovery
JAORMX Sep 25, 2026
a0cf02f
docs(microvm): repair acceptance proof references
JAORMX Sep 25, 2026
e26ca76
fix(microvm): preserve captured worktree file permissions
JAORMX Sep 25, 2026
19d0ac6
fix(microvm): ensure readiness when resuming exact placement
JAORMX Sep 25, 2026
4d2ecba
test(microvm): retire live journey acquisitions before restart
JAORMX Sep 25, 2026
7bfd67a
fix(microvm): use caller budget for cold reattachment
JAORMX Sep 25, 2026
b68e5d7
docs(microvm): record real Linux user journey evidence
JAORMX Sep 25, 2026
2d752f6
fix: preserve PR580 final-tree merge resolutions
JAORMX Sep 25, 2026
f92a025
fix: retain governance root on persisted approval
JAORMX Sep 25, 2026
a012760
docs: renumber microVM ADR to 0367
JAORMX Sep 25, 2026
13e0cf3
fix: repair MicroVM Darwin capture and CI gates
JAORMX Sep 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .claude/plans/microvm-execution-environments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# MicroVM execution environments orchestration

Acceptance plan: `docs/acceptance/microvm-execution-environments.md`
Accumulator: `acc/microvm-execution-environments`
Epic: stacklok/mecatl#526

Task files are orchestrator-managed. Git ancestry on the accumulator is authoritative.
Every implementation worker uses an isolated worktree and task branch.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: 01-module-contract
title: Nested module boundary and architecture contract
blocked_by: []
status: done
branch: "plan-microvm-execution-environments/01-module-contract"
worktree: ".scratch/task-microvm-01"
issue: "527"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Establish the nested `environment/microvm` module boundary, keep go-microvm/libkrun out of engine/root default builds, and pin the byte-compatible disabled path. Reconcile the proposed ADR and living architecture/resource inventories where this task owns their structural contract. Do not implement runtime behavior owned by later tasks.

## Acceptance criteria

- AC1.5: With microVM support disabled or no microVM profile selected, existing
default/no-fs session snapshots, catalogs, prompts, and behavior remain byte-compatible.
- verify: `TestInvariant_microvm_disabled_is_byte_compatible`
- AC1.6: The normal engine module and root default build have no go-microvm/libkrun
import or link dependency; only the nested `environment/microvm` module owns the
heavy runtime.
- verify: `TestADR_0108_MicroVMDependenciesStayOutOfEngineAndRoot`
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
id: 02-profile-paths
title: Environment profiles and source/worktree/guest path roles
blocked_by: [01-module-contract]
status: done
branch: "plan-microvm-execution-environments/02-profile-paths"
worktree: ".scratch/task-microvm-02"
issue: "533"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Add the operator-only environment-profile surface and the explicit source checkout, prepared host worktree, guest root, and EnvironmentRef projections. Wire host-side discovery to the correct tier without enabling VM provisioning yet. Project configuration must not control privileged environment policy.

## Acceptance criteria

- AC1.1: Selecting an enabled operator microVM profile creates a session whose source
checkout, prepared host worktree, guest `/workspace`, and EnvironmentRef are four
explicit values with non-overlapping meanings; the response/UI displays the first
three accurately without exposing driver credentials or control endpoints.
- verify: `TestMicroVMEnvironments_Scenario1_PathRolesAreExplicit`
- AC1.2: `environment_profile` selects execution placement independently from the
existing `profile`; default and `no-fs` retain their existing tool-surface meaning.
- verify: `TestADR_0108_EnvironmentProfileIsIndependentOfToolProfile`
- AC1.3: Project-tier configuration and model input cannot set or weaken the driver
endpoint, image, mounts, resources, egress, seccomp, lifecycle, quotas, signer, or
attestation policy; an unknown, disabled, or unavailable alias fails loudly without
local fallback.
- verify: `TestMicroVMEnvironments_Scenario1_OperatorProfilesAreAuthoritative`
- AC1.4: Project AGENTS/CLAUDE instructions, rules, commands, skills, and agent
definitions are resolved from the prepared session worktree, while user-global
settings, soul, memory, skills/agents, MCP configuration, identity, and provider
credentials remain host-side.
- verify: `TestMicroVMEnvironments_Scenario1_DiscoveryUsesCorrectPathTier`
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
id: 03-artifact-verification
title: Runtime, firmware, and execution-image verification
blocked_by: [01-module-contract]
status: done
branch: "plan-microvm-execution-environments/03-artifact-verification"
worktree: ".scratch/task-microvm-03"
issue: "528"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Consume go-microvm's existing runtime/firmware artifacts, add immutable digest resolution, operator trust policy, signature/attestation verification, and atomic cache admission in the nested module. Keep verification offline-testable with fakes; do not require live registries in ordinary tests.

## Acceptance criteria

- AC2.1: A correctly signed and attested runtime, firmware, and execution image resolve
to immutable digests, enter the verified cache atomically, and boot a VM whose durable
metadata records those digests and the verification-policy revision.
- verify: `TestMicroVMEnvironments_Scenario2_VerifiedArtifactsBoot`
- AC2.2: A mutable/tag-only input, wrong digest, unsigned artifact, wrong signer,
missing/wrong attestation, revoked identity, corrupted cache entry, or stale policy
fails before VM execution.
- verify: `TestMicroVMEnvironments_Scenario2_UnverifiedArtifactsFailClosed`
- AC2.3: Concurrent sessions requesting the same cold artifact observe one complete
verified cache result; none can execute a partial or pre-verification file.
- verify: `TestMicroVMEnvironments_Scenario2_ConcurrentCacheAdmissionIsAtomic`
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
id: 04-control-protocol
title: Local control socket and guest protocol handshake
blocked_by: [01-module-contract]
status: done
branch: "plan-microvm-execution-environments/04-control-protocol"
worktree: ".scratch/task-microvm-04"
issue: "530"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Define the local microvmd control service, Linux/macOS peer authentication, environment owner/ref/generation binding, and guest protocol handshake over go-microvm's vsock-to-UDS primitive. This task establishes framing/capabilities and test fakes, not full Workspace or exec methods.

## Acceptance criteria

- AC2.4: The local control socket authenticates the configured Unix account using the
platform peer-credential mechanism; possession or guessing of an environment ID,
socket path, or session ID alone authorizes no operation.
- verify: `TestMicroVMEnvironments_Scenario2_LocalPeerCredentialsBindOwner`
- AC2.5: Protocol negotiation rejects a missing required filesystem, streaming,
cancellation, generation-binding, or message-bound capability; it never degrades to
SSH or host-local tool execution.
- verify: `TestMicroVMEnvironments_Scenario2_CapabilityNegotiationFailsClosed`
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
id: 05-worktree-git
title: Exact session worktree capture and guest Git reconstruction
blocked_by: [01-module-contract]
status: done
branch: "plan-microvm-execution-environments/05-worktree-git"
worktree: ".scratch/task-microvm-05"
issue: "529"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Prepare one hardened session branch/worktree and exact source-state capture. Reuse or extract Brood Box's linked-worktree validation and guest-local Git metadata reconstruction, including the common object-store alternates design. This task prepares/mount-describes paths but leaves generic Workspace RPC to task 07.

## Acceptance criteria

- AC3.1: The prepared worktree contains the source's committed files and the full
declared staged/unstaged/untracked content fidelity; a race or unsupported state
that prevents exact capture aborts creation instead of silently starting clean.
- verify: `TestMicroVMEnvironments_Scenario3_SourceStateCaptureIsExactOrFails`
- AC3.3: Guest Git operates with reconstructed local metadata and the common object
store mounted host-enforced read-only; malicious `.git`/`commondir`, symlink, or
escape inputs cannot expose another host path.
- verify: `TestMicroVMEnvironments_Scenario3_WorktreeGitMetadataIsConfined`
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
id: 06-virtiofs-assets
title: RW worktree and read-only asset virtio-fs mounts
blocked_by: [03-artifact-verification, 05-worktree-git]
status: done
branch: "plan-microvm-execution-environments/06-virtiofs-assets"
worktree: ".scratch/task-microvm-06"
issue: "529"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Wire the prepared worktree RW at guest `/workspace`, adopt libkrun's host-enforced read-only virtio-fs API through go-microvm for Git objects and materialized skill assets, and prove bidirectional host/guest visibility. Keep mount inputs explicit and confined.

## Acceptance criteria

- AC3.2: A guest Write/Edit or Bash mutation under `/workspace` is immediately visible
in the prepared host worktree, and a host edit to that worktree is visible to the
guest.
- verify: `TestMicroVMEnvironments_Scenario3_WorktreeIsBidirectionallyVisible`
- AC3.6: An out-of-repository skill asset reaches the guest only through explicit
materialization or a host-enforced read-only mount; Bash cannot discover an arbitrary
user home/config directory through that capability.
- verify: `TestMicroVMEnvironments_Scenario3_SkillAssetsAreExplicitAndReadOnly`
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: 07-workspace-rpc
title: Guest Workspace RPC and version-aware conformance
blocked_by: [04-control-protocol, 06-virtiofs-assets]
status: done
branch: "plan-microvm-execution-environments/07-workspace-rpc"
worktree: ".scratch/task-microvm-07"
issue: "530"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Implement the guest/host Workspace methods and adapter over the authenticated protocol. Preserve all current FileVersion, read-ledger, create-only, conditional-replace, path confinement, Glob/Grep, and bounded-result semantics. Extend the shared filesystem/environment conformance suites rather than inventing parallel rules.

## Acceptance criteria

- AC3.4: Read/Edit/Write/Grep/Glob and Bash observe the same bytes and cwd. A Workspace
read followed by Bash mutation is visible to a later Workspace read, and vice versa.
- verify: `TestInvariant_environment_workspace_runner_affinity`
- AC3.5: Workspace ReadVersion/CreateFile/ReplaceFile preserve opaque versions,
create-only behavior, and backend-atomic conditional replacement; a concurrent host
or guest change yields a model-visible conflict instead of overwriting newer bytes.
- verify: `TestMicroVMEnvironments_Scenario3_RemoteWorkspaceConformance`
30 changes: 30 additions & 0 deletions .claude/plans/microvm-execution-environments/tasks/08-exec-rpc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
id: 08-exec-rpc
title: Structured guest exec streaming and cancellation
blocked_by: [04-control-protocol, 06-virtiofs-assets]
status: done
branch: "plan-microvm-execution-environments/08-exec-rpc"
worktree: ".scratch/task-microvm-08"
issue: "530"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Implement bound CommandRunner/CommandStreamer behavior over the authenticated guest protocol: ordered stdout/stderr, explicit exits, bounds/backpressure, cancellation, and process-group termination. SSH remains bootstrap/debug only and no stale path can run on the host.

## Acceptance criteria

- AC4.1: Exec streams ordered stdout and stderr plus an explicit exit status; a nonzero
guest exit is a completed command result, not a transport failure.
- verify: `TestMicroVMEnvironments_Scenario4_ExecStreamingPreservesChannelsAndExit`
- AC4.2: Cancellation or deadline terminates the entire guest process group within a
bound, returns partial output already produced, and is distinguishable from a
transport fault.
- verify: `TestMicroVMEnvironments_Scenario4_CancelKillsGuestProcessGroup`
- AC4.3: Wrong owner/session/ref/generation, replayed endpoint credentials,
malformed/oversized frames, output overflow, and excessive concurrent execs fail
closed without reaching another environment or the daemon control plane.
- verify: `TestMicroVMEnvironments_Scenario4_GuestProtocolBoundaryIsBounded`
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
id: 09-network-egress
title: Explicit guest networking and egress enforcement
blocked_by: [03-artifact-verification, 04-control-protocol]
status: done
branch: "plan-microvm-execution-environments/09-network-egress"
worktree: ".scratch/task-microvm-09"
issue: "531"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Always configure go-microvm's selected network provider and implement the guest-only deny/allow policy with IPv6 parity or explicit disablement. Surface honest separate guest and host egress status. Ordinary tests use deterministic network fakes; live bypass coverage lands in task 16.

## Acceptance criteria

- AC4.4: VM creation always configures the selected network provider. Failure to start
or enforce it aborts creation and never selects implicit or allow-all networking.
- verify: `TestADR_0108_ExplicitNetworkProviderNeverDegrades`
- AC4.5: Deny-all and configured hostname/port/protocol allowlists work from a real
guest; IPv6 is either equivalently filtered or disabled and demonstrably unavailable.
- verify: `TestMicroVMEnvironments_Scenario4_GuestEgressIsFailClosed`
- AC4.6: Session/UI status and documentation separately report guest-process egress and
host-service egress; guest deny-all never claims to constrain LLM providers,
WebFetch, WebSearch, MCP, hooks, OCI pulls, or telemetry.
- verify: `TestMicroVMEnvironments_Scenario4_EgressScopeIsHonest`
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
id: 10-lifecycle-create
title: Transactional environment provisioning and fail-closed resolution
blocked_by: [02-profile-paths, 03-artifact-verification, 04-control-protocol, 05-worktree-git]
status: done
branch: "plan-microvm-execution-environments/10-lifecycle-create"
worktree: ".scratch/task-microvm-10"
issue: "532"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Add the internal provisioning/lifecycle seam and creation transaction across worktree, artifact, VM, protocol, environment ref/generation, and session persistence. Extend the existing resolver without widening tool.Environment into lifecycle management. Fail closed for every invalid ref.

## Acceptance criteria

- AC5.1: After a successful creation response, the persisted session, driver registry,
prepared worktree, VM, guest endpoint, owner, profile, generation, and artifact
identities agree; a failure before persistence rolls back or durably queues every
provisional resource for cleanup.
- verify: `TestMicroVMEnvironments_Scenario5_CreateTransactionIsAllOrReconciled`
- AC5.4: A nil resolver, unknown, foreign, stale, destroyed, incompatible, or
generation-mismatched ref fails before tool execution with no local fallback.
- verify: `TestInvariant_remote_environment_resolution_fails_closed`
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
id: 11-lifecycle-reconcile
title: Restart reattachment, deletion, and crash reconciliation
blocked_by: [07-workspace-rpc, 08-exec-rpc, 09-network-egress, 10-lifecycle-create]
status: done
branch: "plan-microvm-execution-environments/11-lifecycle-reconcile"
worktree: ".scratch/task-microvm-11"
issue: "532"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Complete the session-lifetime environment lifecycle: harness and daemon restart, exact generation reattachment, detach versus delete, retention destruction, durable cleanup/tombstones, and crash/race reconciliation. Update ADR 0027 resource and rehydration inventories for the real resources introduced.

## Acceptance criteria

- AC5.2: Restarting mecated reattaches the exact environment generation and preserves
its worktree state without rebuilding the per-session engine unless the independent
engine-rehydration rules require it.
- verify: `TestMicroVMEnvironments_Scenario5_HarnessRestartReattachesExactGeneration`
- AC5.3: Restarting microvmd reconstructs or reconciles its durable registry and either
reattaches the exact live environment or returns an actionable failed precondition;
it never mints an empty replacement for the same ref.
- verify: `TestMicroVMEnvironments_Scenario5_DaemonRestartNeverRecreatesEmptyEnvironment`
- AC5.5: CloseSession detaches process-local handles and leaves the environment
reattachable; explicit deletion prevents new runs, destroys the VM/endpoints/children,
and removes or preserves the worktree according to the dirty-state policy.
- verify: `TestMicroVMEnvironments_Scenario5_DetachAndDeleteAreDistinct`
- AC5.6: Crashes at every lifecycle transition, PID reuse, stale sockets, disk-full,
and two daemons racing one ref converge without deleting another environment or
leaking quota indefinitely.
- verify: `TestMicroVMEnvironments_Scenario5_ReconcilerConvergesAcrossCrashPoints`
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
id: 12-multi-session
title: Same-repository concurrency and resource admission
blocked_by: [11-lifecycle-reconcile]
status: done
branch: "plan-microvm-execution-environments/12-multi-session"
worktree: ".scratch/task-microvm-12"
issue: "533"
retries: 0
last_error: ""
accumulator: acc/microvm-execution-environments
---

# Task brief

Prove and harden concurrent local sessions from one repository. Each session gets independent worktree, Git metadata, VM, endpoint, generation, and quotas while sharing only verified immutable caches/object data. Add mecatui projections for each resolved session.

## Acceptance criteria

- AC6.1: Two concurrent session creates from one repository succeed with distinct
worktree roots, branches, indexes, environments, endpoints, and writable files; each
UI displays its own resolved paths.
- verify: `TestMicroVMEnvironments_Scenario6_SameRepoSessionsUseDistinctWorktreesAndVMs`
- AC6.2: File and Git mutations in session A do not alter session B's working files,
index, refs, config, hooks, or guest-local metadata; both can read the shared
host-enforced read-only object store.
- verify: `TestMicroVMEnvironments_Scenario6_SiblingSessionsCannotMutateEachOther`
- AC6.3: VM/worktree/image-pull admission observes per-user and deployment limits for
booting/active VMs, CPU, RAM, disk/inodes, execs, forks, pulls, and boot rate; a
rejection is stable and actionable.
- verify: `TestMicroVMEnvironments_Scenario6_ResourceAdmissionIsBounded`
- AC6.4: Concurrent cache, worktree, endpoint, and cleanup operations do not collide
when session IDs or repository names share prefixes or hostile characters.
- verify: `TestMicroVMEnvironments_Scenario6_ConcurrentResourceNamesAreOpaqueAndConfined`
Loading
Loading