Repository navigation
Description
Parent: #545 (index). This issue owns the B0 machine/backend contract slice and the B8/B10 read-model and doctor surfaces that depend on it. The state machine (Draining / Lost) is the B5 issue; the StoragePlacement guard is its own issue.
Summary
#545 B0 is 1/15 done; B8 is 1/10 done; B10 is 1/9 done. The contract is the blocker: IsolationClass / SchedulingClass do not exist, kind mixes isolation with execution, capabilities are a flat bool set, there is no default isolation or refusal on mismatch, there is no per-Store quota or queue bound, there is no schema_version, and doctor does not check the declared backend capability.
This issue writes the contract and the read models over it. It does not implement providers.
Scope
Baseline
- Confirm the baseline first: audit LayerFS 2.0: one home, machines and Stores, one SDK #533's machine/backend layering against Sandbox platform: sandbox.create({ platform }) #529/Sandbox platform: sandbox.create({ platform }) on every platform (#529) #530 (both still open). (B0-138)
- Align with LayerFS 2.0: one home, machines and Stores, one SDK #533's G0–G16 gates. (B0-143)
Records and contract
- Fix the boundaries of
MachineRecord,SandboxRecordandBackend. (B0-139) - Add the contract test skeleton. (B0-142)
- Include
IsolationClassandSchedulingClassinMachineRecord/BackendRecord. (B0-144) - Record backend capability: isolation class, kernel, strength, notes. (B0-145)
- Keep
processas a first-class backend. (B0-146) - Default
sandbox.createisolation todockerwhere available;processis opt-in only. (B0-147) - Refuse an unavailable isolation class with
Unavailable { requested, available }; never downgrade. (B0-148) - Record both
requested_isolationandeffective_isolationin the Sandbox record. (B0-149) - One worker serves many Stores: fix the per-Store quota, in-flight limit and queue bound in the contract. (B0-151)
- Add
schema_versionto the record and to the capability. (B0-152)
B8 read models
-
machine list/get: kind, state, worker, lease, health. (B8-156) -
sandbox list/get: state, project, machine, backend, image, capacity. (B8-157) - mounted Workspaces (path + branch), running command, recently closed. (B8-158)
- queries are bounded (2 s / 5 s) and do not hold all 8 control slots. (B8-159)
- report the per-Store in-flight count and queue bound; a full queue is refused with
Capacity. (B8-160) - queue time counts against the 2 s / 5 s budget. (B8-161)
- failures return precise
Unavailable/Capacity, never hang. (B8-163) - return
isolation(class, kernel, strength) frommachine get/sandbox get. (B8-164) - return
scheduling(worker, long-lived Sandbox, lease). (B8-165)
B10 doctor
- Docker engine / socket reachability. (B10-171)
- machine kind / VM provider availability. (B10-172)
- sandbox image existence. (B10-173)
- mount driver (FUSE / NFS / namespaces). (B10-174)
- free disk. (B10-175)
- worker state / lease. (B10-176)
- check backend isolation capability (the declared capability), not "is Docker". (B10-178)
- warn when the backend's isolation class is weaker than the requested one. (B10-179)
(B8-162 and B10-177 are already satisfied by #535/#536; they are not re-opened here. B0-140 is the B5 state enum; B0-150 is the StoragePlacement issue.)
Contract shape
MachineRecord:
isolation_class: process | container | vm | remote
exec_mode: worker | remote-exec
kernel: shared | separate | separate-host
provider: native | docker | fly | e2b | cloudflare | modal | daytona | k8s | fargate | ssh
capabilities: Capability (typed, #[non_exhaustive], schema_version)
kindis the isolation class only.remote-execis anexec_mode;gvisoris a runtime detail behind a provider.- Strength is a total order:
process < container < microvm <= vm; a mismatch is refused, never downgraded. Capabilityis a typed struct withschema_version, not aHashMap<String, bool>:idle_stop: IdleStop { Ours, Provider, None },snapshot: Option<SnapshotCapability>.sandbox.createdefaults todocker;processis opt-in; the record keepsrequested_isolationandeffective_isolation.- One naming convention for every field; provider names never branch in core (
no if provider == ...). - Per-Store quota, in-flight limit and queue bound are part of the contract; overflow is
Capacity, and queue time counts against the read budget. - All read models are bounded (2 s / 5 s), warning-only where diagnostic, and never start a machine or Sandbox or write the home.
Non-goals
- Provider adapters: the B7 issue.
StoragePlacementrefusal: its own issue.Draining/Lost/ generation CAS: the B5 issue.- Scratch cleanup: the B6 issue.
- Choosing D2 defaults: the fields can land first; defaults wait for D2.
Acceptance
- Contract tests:
vmrequested, onlyprocessavailable →Unavailable { requested, available }, never a downgraded Sandbox. -
requested_isolationandeffective_isolationare recorded and returned bysandbox get. -
machine get/sandbox getreturnisolationandscheduling;doctorchecks the declared capability and warns only. - A full per-Store queue is refused with
Capacity; queue time is inside the 2 s / 5 s budget. -
schema_versionis present on the record and the capability; an old record is read with an explicit migration path. - No
if provider == ...in core; one naming convention across the capability struct. -
doctornever starts a machine/Sandbox and never writes the home.
Dependencies
- B0-138 / B0-143 first (confirm the LayerFS 2.0: one home, machines and Stores, one SDK #533 / Sandbox platform: sandbox.create({ platform }) #529 / Sandbox platform: sandbox.create({ platform }) on every platform (#529) #530 baseline and the G0–G16 gates).
- B8 / B10 depend on the record fields defined here.
- Defaults wait for D2; the enum and field shapes do not.
Related
- Parent index: [B] Sandbox compute plane: machines, backends, observability and lifecycle #545
- B0 contract: B0: machine/backend contract — isolation, scheduling, capacity and read models (B8/B10) #551
- B5 lifecycle: B5: Sandbox lifecycle — generation CAS, exec lease, Draining and first-class Lost #548
- B6 scratch: B6: Sandbox scratch lifecycle — owned path, generation check, bounded cleanup #549
- B9 worker health: B9: machine worker health and liveness — a dead worker must never leave a call hanging #550
- StoragePlacement guard: B0: refusal for a misplaced Store — StoragePlacement guard for live SQLite on Family 2 #552
- B4 WSL2: B4: Windows via a WSL2 worker and Docker backend (blocked on D2/O5) #553
- B7 cloud/provider: B7: cloud and provider adapters — Family 1/2 contract, transport and storage binding (blocked on D6/D12) #554
- Step runtime: step-runtime: exec_async / exec_wait / exec_status outside the Sandbox compute plane #555
- daemon: bound an admitted control slot's lifetime and keep recovery admissible when the pool is exhausted (#540 follow-up) #547 is the daemon-admission follow-up: a different custody layer, not this sub-issue.
Activity
mengmengmengqiang commentedon Nov 4, 2026
Maintainer: this sub-issue was created without labels because the available token has no
triagepermission. Requested labels:v2.0.0,enhancement. Please add them (and adjust if the repo's triage rules disagree).mengmengmengqiang commentedon Nov 4, 2026
All #551 checkboxes are now covered by
agent-b0iso+agent-b0ext2.Evidence: contract 4/4, api contract 8/8, typed_records 8/8, doctor 8/8 default/10/10 machine, isolation 4/4, sandbox_machines 4/4, layerfs-sandbox runtime_enum+conformance 11/11.
Evidence-tier caveats (not unchecked boxes):
scheduling.long_livedis currently a contract value,RemoteExecis not returned by a platform,machine.create/connecttake no isolation option, anddocs/versioned/2.0.0/does not yet document isolation.mengmengmengqiang commentedon Nov 5, 2026
All checkboxes are covered by the verified branches/PRs; evidence is recorded in the issue evidence comments and the subagent reports.
mengmengmengqiang commentedon Nov 5, 2026
Reopened: the delivery gate is code on the target branch + PR merged + CI green + traceable evidence. This issue was closed on branch/test evidence only; its PR/branch is not merged to
layerfs_v2_0_0yet.fix(551): clear the base CI failures on the Ephemeral-AI-Lab#551 head
feat(provider): DOKS provider adapter outside core (Ephemeral-AI-Lab#554
fix(551): clear the base CI failures on the Ephemeral-AI-Lab#551 head
fix(552): read the typed direct_store_access and fail closed
fix(551): clear the base CI failures on the Ephemeral-AI-Lab#551 head
fix(552): read the typed direct_store_access and fail closed
yifanxuaaa commentedon Nov 6, 2026
Owner decision: drop
SnapshotCapabilityfrom the B0 capability contract (PR #567). Details: #545 (comment)Record the history of #567 by mengmengmengqiang (rain): feat(machine)…
yifanxuaaa commentedon Nov 7, 2026
Closed by the owner (2026-11-07). PR #567 is shown as merged into
layerfs_v2_0_0, but it was recorded as history only (agit merge -s oursin #601): mengmengmengqiang's commits and credit are kept, but none of its code is on the branch. The control layer split (layerfs-project#101) replaced this area, and the port was cancelled, so this is not delivered.