Skip to content

B7: cloud and provider adapters — Family 1/2 contract, transport and storage binding (blocked on D6/D12) #554

Closed as not planned

Description

@mengmengmengqiang

Parent: #545 (index). This issue owns the B7 cloud and provider adapters slice and is blocked on D6 / D12. The 2.0.0 StoragePlacement guard is split into its own issue; this issue is only the adapter and transport work.

Summary

#545 B7 is 3/6 done (ssh basics, unchanged Workspace semantics, no serverless backend), 1/6 partial and 2/6 not done. What remains is not a storage question: it is the remote control↔worker transport, the host-key policy, how "guest never reads home" is proven on a remote machine, and the provider contract that keeps a vendor name out of Machine.kind.

The Cloudflare Family 2 section in #545 is evidence for this future contract; it commits to nothing in 2.0.0.

Scope (from #545 B7)

  • PostgreSQL-only Store first on a cloud machine. (B7-222; proven on DOKS ssh machine)
  • state the control↔worker transport (ssh forward or mTLS), the host-key policy and how guest-never-reads-home is proven on the remote machine. (B7-226)

Moved out of this issue:

  • "no SQLite download / push back" (B7-223) is the StoragePlacement guard issue; this issue consumes that guard.
  • Provider matrix, Family 1/2 contract, B11 provider contract + StorageBinding, B12 snapshot manifest/lease are design evidence here, not implementation commitments.

Contract

Transport

  • The control plane reaches a remote worker only through an ssh forward or mTLS; never a public host server in the data path.
  • The secret is shipped per machine by the control plane; the host key is pinned (known_hosts or an equivalent pin).
  • Loopback + secret remains the local-only rule; a remote machine must state its transport and auth explicitly.
  • "Guest never reads home" must be proven on the remote machine with a concrete command and a negative test, not asserted.

Provider boundary

provider = constructor
Machine.kind = isolation class only (process | container | vm | remote)
Machine.provider = implementation (fly | e2b | cloudflare | modal | daytona | k8s | fargate | ssh)
  • A provider never becomes a Machine.kind vendor enum.
  • Core reads isolation_class, exec_mode and the typed capability; there is no if provider == ... branch in core.
  • Adding a provider adds an adapter and a capability declaration with zero core diff.
  • Family 1 (worker + mount + machine-local SQLite) vs Family 2 (remote-exec only, PostgreSQL or snapshot): the family split is the decision; the substrate detail is not.
  • StoragePlacement is consumed, not re-implemented: Family 2 refuses a local SQLite Store; PostgreSQL is the only live remote route; SQLite snapshot is explicit handoff; object storage is backup/transfer only.

Execution

  • The transport and host-key work can start as soon as D6/D12 fixes the provider direction; it does not need a provider adapter to be chosen first.
  • The first end-to-end target is one ssh machine with a real worker and a real workspace.exec; the provider adapters follow.
  • Cloudflare-specific numbers in [B] Sandbox compute plane: machines, backends, observability and lifecycle #545 (inactivity ≤ 6 h, snapshots 20 GB / 30 days, cold start 1–3 s) stay E0 evidence with links, not acceptance criteria, until measured.

Acceptance

  • One ssh machine runs a full create → mount → exec → receipt cycle through the same machine/backend contract as the local backends.
  • The control↔worker transport is documented and tested: ssh forward or mTLS, per-machine secret, pinned host key.
  • "Guest never reads home" has a concrete proof and a negative test on the remote machine.
  • A Family 2 Store is PostgreSQL or a snapshot; a local SQLite Store is refused through the StoragePlacement guard.
  • No serverless execution backend, no core queue or actor.
  • A new provider adapter needs zero core diff.

Non-goals

  • StoragePlacement enforcement itself: its own issue.
  • Snapshot manifest / lease / base revision (B12): future.
  • The step runtime: its own issue, outside the compute plane.

Dependencies

  • D6 / D12: provider direction. Do not start the adapter before the Decision.
  • The StoragePlacement issue for the guard.
  • The B0 contract for the typed capability.

Related

Activity

  1. mengmengmengqiang commented on Nov 4, 2026

    @mengmengmengqiang
    ContributorAuthor

    Maintainer: this sub-issue was created without labels because the available token has no triage permission. Requested labels: future, enhancement (blocked on D6/D12). Please add them (and adjust if the repo's triage rules disagree).

  2. mengmengmengqiang commented on Nov 5, 2026

    @mengmengmengqiang
    ContributorAuthor

    D6/D12 are decided: DigitalOcean Kubernetes + ssh machine, capability-driven storage.

    First ssh smoke passed against a real DOKS pod (layerfs-cloud/layerfs-ssh, x86_64, ext4 PVC, /dev/fuse):

    • machine connect do-pod over ssh -L with pinned known_hosts and per-machine secret;
    • sqlite Store created on native, pushed to do-pod;
    • project init, sandbox create cloud/app test do-pod;
    • workspace mount test agent, workspace exec: uname -a, read README, write out.txt;
    • workspace commit: 129f929d…;
    • guest proof: uid=501, no /Users, no /root/.ssh; close/unmount clean.

    This proves acceptance 1–3 and 5 for the ssh Family 1 route. Not yet done: PostgreSQL-only cloud Store (B7-222 / acceptance 4), a provider adapter with zero core diff (acceptance 6), and mTLS (ssh route used).

    Cross-arch finding: bundle_dir("linux") keys the bundle by the host's std::env::consts::ARCH; on an arm64 Mac it asks for linux-aarch64 even when the ssh host is x86_64. The smoke used an x86_64 bundle placed at that path. This needs a real fix before the route is general.

  3. mengmengmengqiang commented on Nov 5, 2026

    @mengmengmengqiang
    ContributorAuthor

    PostgreSQL-on-cloud smoke passed on the same DOKS ssh machine:

    • store connect pg postgres://layerfs@<node>:30432/layerfs (password via env reference);
    • project init, sandbox create pg/app ptest do-pod;
    • workspace mount ptest agentpg, exec: x86_64, read README, write pg.txt;
    • workspace commit: 1224b0a0…;
    • close/unmount clean.

    This covers B7-222 and acceptance 4: the cloud Store is PostgreSQL, the Sandbox binds no Store file, and SQLite placement is guarded by #552. Only acceptance 6 (a new provider adapter with zero core diff) remains; the current route uses the built-in ssh machine.

  4. mengmengmengqiang commented on Nov 5, 2026

    @mengmengmengqiang
    ContributorAuthor

    Acceptance 6 is proven at the contract level: a new provider adapter (connect/crates/layerfs-provider-doks) adds zero core diff. 901 core files are SHA-256 identical to the base fixture; no core file names doks; cargo test -p layerfs-provider-doks 9/9; boundary PASS.

    Caveat: on this base Machine.provider is the closed Platform enum, so doks is a library adapter used through the public machine API, not a first-class selectable platform (capability.provider still reports ssh). Making it first-class needs a small provider-id/registry extension, which is a core diff and a follow-up; it does not invalidate the zero-core-diff adapter proof.

  5. mengmengmengqiang commented on Nov 5, 2026

    @mengmengmengqiang
    ContributorAuthor

    All acceptance boxes are checked. D6/D12 are decided; ssh Family 1 and PostgreSQL Family 2 were run on DOKS; the DOKS provider adapter proves zero core diff. Follow-up (not a regression): first-class provider-id/registry selection needs a small core extension; the adapter currently uses the public machine API.

  6. mengmengmengqiang commented on Nov 5, 2026

    @mengmengmengqiang
    ContributorAuthor

    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_0 yet.

  7. mengmengmengqiang commented on Nov 6, 2026

    @mengmengmengqiang
    ContributorAuthor

    Boundary note: this is now explicitly next phase work, not part of the 2.0 compute-plane closure.

    Consequences:

  8. added this to the LayerFS v2.0.0 milestone on Nov 6, 2026
  9. added theissue type on Nov 6, 2026
  10. jiangkoumo commented on Nov 8, 2026

    @jiangkoumo
    Collaborator

    SSH machines were removed in 2.0 and parent #545 was closed; this B7 work was moved to the next phase. Closing as obsolete for 2.0; the next phase should re-scope it against the 2.0 platform set (see #568 for the DOKS design input).

    (Reviewed against layerfs_v2_0_0 @ 716197c during the Staging cleanup.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

new featureA new user-facing capability

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions