Submit an issue View all issues Source
MIR-2086

Add RPCs for sandbox lifecycle and app exec selection

Done public
evan evan Opened Oct 15, 2026 Updated Oct 16, 2026

Implement sandbox stop/delete and app/service exec selection RPC servers, and migrate the corresponding CLI operations to these safe APIs without an EntityAccess fallback. See api/compute/client.go and cli/commands/sandbox_select.go. Stop must preserve stopped/dead idempotence; delete requires dead status. Selection must preserve pool-backed app ownership, exclusion of ephemeral app-run sandboxes, explicit-service hard filtering, default web preference, active-version preference with old-version fallback, and running/scheduled eligibility. Existing Sandboxes.List already covers safe inventory; extend its interface without returning Sandbox/SandboxSpec. Legacy sandbox-list fallback is CLI compatibility work, not a missing server RPC. Authorize sandbox operations using resolved ownership; define policy for unowned/operator sandboxes consistently with repo patterns.

Follow-up to MIR-2084 (audit thread). Scope: implement operation-specific RPC schemas, server handlers, registration, authorization policy and contract/regression tests, plus CLI migration for sandbox stop/delete and app/service exec selection and its consumers. Preserve CLI output, flags, validation, diagnostics and selection semantics; remove replaced raw-access helpers. Pool CLI migration belongs to MIR-2087. Pushing and PR creation are not requested. Keep this issue In Progress until merged. Reuse existing APIs and authorization patterns; do not expose arbitrary entities, execution specs or resolved credentials. Verify app ownership on every app-scoped operation and preserve cluster-admin/runner boundaries. Coordinate overlapping schema/generated/registration files at integration. Run focused tests and required lint before committing.

Acceptance: public handlers and the migrated sandbox stop/delete and app/service exec CLI paths implement the listed behavior without giving callers EntityAccess or falling back to raw access. Test allowed and denied/cross-app cases, unavailable API behavior, CLI output/diagnostics and the area's meaningful edge cases. Existing behavior remains unchanged outside the requested sandbox paths.