Skip to content

Add shared cloud snapshot contracts - #1296

Draft
toksdotdev wants to merge 10 commits into
mainfrom
toks/cloud-snapshot-contracts
Draft

Add shared cloud snapshot contracts#1296
toksdotdev wants to merge 10 commits into
mainfrom
toks/cloud-snapshot-contracts

Conversation

@toksdotdev

Copy link
Copy Markdown
Member

What changed

  • moved the canonical snapshot manifest schema into microsandbox-types
  • added cloud snapshot create, resource, operation, location, and restore-reference wire types
  • added CloudSandboxSpec.from_snapshot with exactly-one origin validation
  • generated and exported the snapshot TypeScript contract
  • updated first-party snapshot consumers to import the manifest schema directly from microsandbox-types
  • removed the obsolete microsandbox-image manifest re-export shim

Why

msb-cloud needs one shared, dependency-safe snapshot contract for API types, SDKs, OpenAPI, and generated TypeScript. The manifest cannot remain owned by microsandbox-image because the shared types package must not depend upward on the image implementation.

Public behavior

Snapshot operation status exposes the stable public states queued, in_progress, succeeded, and failed. Sandbox creation requires exactly one of image or from_snapshot, and snapshot restores reject an explicit disk-size override.

This PR establishes contracts only; cloud snapshot HTTP operations and backend dispatch land in follow-up work.

Validation

  • cargo test -p microsandbox-types --features ts,utoipa — 61 passed
  • snapshot-focused Rust SDK and image tests — 20 passed
  • workspace pre-commit hooks passed, including Clippy, rustdoc, and the msb build
  • TypeScript typecheck passed
  • generated-binding drift test passed

@toksdotdev
toksdotdev force-pushed the toks/cloud-snapshot-contracts branch from d0e5335 to 6cee1f5 Compare August 14, 2026 23:41
@mintlify

mintlify Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
microsandbox-staging 🟢 Ready View Preview Aug 21, 2026, 10:05 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown

Reviews (2): Last reviewed commit: "feat(snapshot): add backend-neutral clou..." | Re-trigger Greptile

Comment thread sdk/rust/lib/backend/cloud/snapshot.rs
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Types["microsandbox-types<br/>canonical snapshot contracts"]
  Image["microsandbox-image"]
  RustSDK["Rust SDK"]
  OtherSDKs["Go / Python / Node SDKs"]
  TS["Generated TypeScript contracts"]
  Cloud["Cloud snapshot API contract"]

  Types --> Image
  Types --> RustSDK
  Types --> TS
  RustSDK --> OtherSDKs
  Types --> Cloud
Loading

Reviews (3): Last reviewed commit: "fix(snapshot): restore fallible artifact..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Types[microsandbox-types]
  Manifest[Shared snapshot manifest]
  Cloud[Cloud snapshot wire contracts]
  Rust[Rust SDK and cloud backend]
  Bindings[Go, Node, and Python bindings]
  TS[Generated TypeScript contracts]
  Image[microsandbox-image consumers]

  Types --> Manifest
  Types --> Cloud
  Manifest --> Rust
  Manifest --> Image
  Cloud --> Rust
  Cloud --> Bindings
  Cloud --> TS
Loading

Reviews (4): Last reviewed commit: "fix(snapshot): restore fallible artifact..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Types[microsandbox-types snapshot contracts]
    RustSDK[Rust SDK]
    Cloud[Cloud snapshot API]
    Local[Local snapshot artifacts]
    Bindings[Python / Node / Go bindings]
    Apps[SDK and CLI callers]

    Types --> RustSDK
    RustSDK --> Cloud
    RustSDK --> Local
    RustSDK --> Bindings
    Bindings --> Apps
    RustSDK --> Apps
Loading

Reviews (5): Last reviewed commit: "fix(snapshot): restore fallible artifact..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Types[microsandbox-types snapshot contracts]
  Rust[Rust SDK]
  Cloud[Cloud snapshot API]
  Bindings[Python, Node, and Go bindings]
  TS[Generated TypeScript contracts]
  Image[Image and local snapshot consumers]
  Types --> Rust
  Types --> TS
  Types --> Image
  Rust --> Cloud
  Rust --> Bindings
Loading

Reviews (6): Last reviewed commit: "feat(snapshot): distinguish cloud snapsh..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Reviews (7): Last reviewed commit: "fix(snapshot): align backend-neutral con..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Reviews (8): Last reviewed commit: "refactor(snapshot): defer cloud checkpoi..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Reviews (9): Last reviewed commit: "refactor(snapshot): simplify sandbox ide..." | Re-trigger Greptile

Route snapshot lifecycle through backend-specific implementations and add cloud snapshot contracts and restore support.

Preserve typed snapshot references across SDKs, add instance archive export parity, and update tests and documentation.
Retain local artifact path access on backend-neutral snapshot types while returning a typed unsupported error for cloud snapshots. Preserve indexed handle identity separately from its local path and format the Ruby extension for CI.
Model disk snapshots and future checkpoints as tagged cloud request and resource variants. Carry the same kind on operations and keep the Rust SDK builder backend-neutral.
Remove stale snapshot builder compatibility code after the config overlay refactor. Update the MCP submodule to serialize snapshot references while retaining path for path-backed compatibility.
Keep the cloud snapshot request and resource as tagged enums while exposing only the disk variant. Reject future resumable capture in the SDK until checkpoint support is implemented, and align generated bindings and documentation.
Use sandbox_id consistently in cloud snapshot creation and resource details. Align the Rust SDK, serialization coverage, and generated TypeScript contract.
@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Reviews (10): Last reviewed commit: "refactor(snapshot): simplify sandbox ide..." | Re-trigger Greptile

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