Skip to content

RFC: Improve reusable snapshot discovery and inspection in the SDK and CLI #135

Open

Description

@rcyw

Use case

Coding-agent workflows and repeated validation runs can prepare a sandbox once and reuse its memory/filesystem snapshot in later sessions. Users need to discover those saved assets, inspect their restore constraints, and manage their lifecycle without keeping snapshot IDs in a notebook or writing a separate Python listing script.

Please evaluate a small SDK/CLI enhancement around the existing snapshot catalog. This is a feature proposal, not a report that reusable snapshots are missing or that persistence has failed.

Existing capability

Review baseline: develop 82e3b06, after #128.

  • The SDK contract already provides create_snapshot(), get_snapshot(), paginated list_snapshots(), delete_snapshot(), and creation from a snapshot ID. The documented SDK requirement is >=0.2.0rc4; this source review does not establish availability in every installed wheel or deployment.
  • SnapshotInfo exposes an opaque ID and names. Names are labels, not resolvable template aliases. The current descriptor does not expose catalog state; a successful get can include a snapshot pending deletion and does not establish restore readiness.
  • The ak CLI does not currently expose snapshot management commands.

The bundled ADX already owns snapshot catalog, reference, and artifact lifecycle behavior. AKernel should build on that contract through its existing backend boundary.

Proposed scope

  1. CLI discovery and inspection. Evaluate read-only ak snapshot list and ak snapshot get <id> commands (spelling illustrative), with human-readable and JSON output, name filtering, and explicit pagination. Reuse existing connection, authentication, TLS, and error handling. Listing or inspection must not create or restore environments.
  2. Useful, authoritative metadata. Agree on an additive public metadata contract. Candidate fields include catalog state, captured runtime/resources, and storage locality or restore-placement restrictions. Expose fields only when the backend supplies them; preserve explicit unknown/unsupported behavior for older backends. Do not fabricate timestamps, storage sizes, or a guarantee that a listed snapshot can be restored. Keep credentials and private storage paths out of discovery responses.
  3. Document persistence and cleanup. Explain what survives source-sandbox deletion and control-plane restart under a supported durable deployment configuration, which assets are node-local or shared, and how references, deletion acceptance, and physical reclamation differ. Keep backend-owned durability and compatibility requirements explicit.

Acceptance criteria

  • A snapshot created through the SDK can be found and inspected through the CLI with the same ID and names; filtering, pagination, and JSON output are covered.
  • Tenant authorization is preserved for both list and get.
  • Any added metadata has a defined backend source and compatibility behavior; existing SDK callers remain compatible.
  • Listing/inspection performs no environment activation or restore.
  • Under a documented durable configuration, deleting the source sandbox and restarting the control plane preserves discovery and supported restore behavior. Cross-node validation is conditional on shared storage and compatible runtimes.
  • Deleting/in-use snapshots and unavailable or unsupported metadata produce documented results; metadata lookup is never presented as a readiness or physical-deletion check.

Evaluation boundaries

This first issue does not prescribe a new catalog database or storage backend. Versioned environment presets, alias promotion, image-build orchestration, and richer template publishing can be evaluated separately.

Agent DX's Agent Template is an immutable application launch specification; a reusable runtime snapshot is a different object. Any later integration should define their relationship and lifecycle ownership explicitly.

AgentENV's template listing is a useful discovery example, rather than a dependency or an assumption that AKernel should adopt the same template-build/storage model.

This issue is based on source and API-contract review; no runtime experiment or new performance result is claimed.

Activity

  1. added
    enhancement
    on Oct 29, 2026
  2. rcyw commented on Oct 29, 2026

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions