Repository navigation
Conversation
… on every manager dial
Part A — callers of the runtime-manager now send x-lantern-service-token on
every RPC (scheduler GRPCDialer, control-plane managerClient + browser-skill
dial, workflow-engine ExecTool client, CLI `vm exec`). Manager dials use TLS
when LANTERN_RUNTIME_MANAGER_TLS_CA (+ optional _CERT/_KEY) is set, insecure
in dev; in prod (LANTERN_ENV prod/production/staging) missing CA or client
cert is fatal at startup in all three services.
Part B — Wave 2 sandbox lifecycle on the existing manager Snapshot / Spawn
(restore_snapshot_id) / Stop RPCs:
- proto (add-only): VM_STATE_PAUSED=7, RuntimeScheduler.Pause/Resume/Fork,
ListResponse.Item.snapshot_id/parent_vm_id; gen/go regenerated with
protoc v6.33.4 / protoc-gen-go v1.36.11 / protoc-gen-go-grpc v1.5.1.
- scheduler: Pause (snapshot → PAUSED → stop, releases one quota slot,
idempotent), Resume (same vm_id, atomic quota reserve, release on spawn
failure), Fork (1..10, all-or-nothing quota, per-child failure release);
per-VM lifecycle lock; PAUSED holds no node capacity; Terminate of a
paused VM skips Stop and never double-frees; sched_vms gains snapshot_id
and parent_vm_id.
- control-plane: POST /v1/runtime/vms/{id}/{pause,resume,fork}, GET
returns snapshotId/parentVmId, runtime_quotas gate (402) for resume/fork,
migration 0021, stub scheduler support.
- sdk-go PauseVM/ResumeVM/ForkVM; CLI `lantern vm pause|resume|fork`.
…race, orphaned-snapshot logging - Fork: the control-plane mints one agent identity per child via agentidentity.Issue (same path as scheduleAgentSpec) and passes them in the new add-only ForkRequest.identities (ForkChild.agent_instance_id echoes each). The scheduler requires len(identities) == count (fail closed), strips LANTERN_AGENT_INSTANCE_ID/TOKEN from the copied source env and injects the child's own. runtime_vms child rows get their own agent_instance_id, and the spec env id is rewritten. - Reconcile: a resumed VM records RespawnedAt on the PAUSED→running edge. Inventory confirmations from before that edge no longer count, so a stale heartbeat cannot terminate a just-resumed VM inside reconcileGrace. - Snapshots: the manager has no delete RPC. Terminate logs "snapshot orphaned" at info once the last VM that references a snapshot is gone. ADR 0025 gains a Follow-ups bullet for DeleteSnapshot.
…shot logging # Conflicts: # docs/adr/0025-sandbox-spawn-contract-and-manager-authz.md
🔎 Codex cross-audit (agent:audit)Blocking
Findings
Verification
|
🛡️ Vuln scan — ❌ vulnerable dependency found |
🔷 Gemini cross-audit (agent:audit-gemini)Executive SummaryThis PR introduces Wave 2 microVM lifecycle management ( The architecture (ADR 0025, tenant isolation via RLS, non-leaking 404s, and atomic quota reservations) is well-structured. However, the audit identified two correctness/reliability regressions (one blocking metric corruption and one post-restart VM termination bug), along with a token expiration issue on long-paused VMs and a snapshot leak on quota rejection. Blocking Issues1. Metric Underflow & Gauge Corruption on Fork Failure
High Severity Issues2. Resumed VMs Prematurely Terminated by Reconciler Following Scheduler Restart
Medium Severity Issues3. Token Expiry on Resume for VMs Paused > Identity TTL
4. Snapshot Leaked on Quota Denial in
|
|
Superseded: the history rewrite on this stack accidentally re-signed master's commits (base diverged). Replaced by a range-limited rewrite on ga3/* — see the new GA 1/11 PR. |
Part 9 of 11 of the GA next-gen stack. Replaces #264/#255–#263: same changes, history rewritten to drop a 43 MB build binary committed by mistake, plus part 11 fixing every confirmed Codex cross-audit finding. Base:
ga2/08-vm-identity. Merge in order with a merge commit (not squash).Context, verification and needs-human list: #254 and
docs/roadmap/2026-10-nextgen-sandbox-and-harness.md.Commits in this part: