Skip to content

feat(guest_control): grow GuestControl with the V2b exec surface (RIG-2493) - #696

Open
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-runner/rig-2493-u1-guest-control-exec-proto
Open

feat(guest_control): grow GuestControl with the V2b exec surface (RIG-2493)#696
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-runner/rig-2493-u1-guest-control-exec-proto

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 5 PRs:

  1. main
  2. "feat(guest_control): grow GuestControl with the V2b exec surface (RIG-2493)" (this PR)
  3. feat(guestd): replace the Health-only stub with the V2b in-guest supervisor (RIG-2493) #701
  4. feat(runtime): host GuestExec layer + portable exit-signal error type (RIG-2493) #702
  5. feat(runtime): fill MicroVMRuntime lifecycle methods (RIG-2493) #719
  6. test(runtime): shared ContainerRuntime contract suite across both backends (RIG-2493) #720

U1 of the frozen microVM Runner V2b plan (docs/designs/infra/runtime/compass-elastic-session-runtime/microvm-v2b-guest-supervisor-exec.md, §Plan U1). Grows proto/compass/v1/guest_control.proto additively per §(a) with the four exec-surface RPCs and their messages, plus one additive field on the V2a HealthResponse, and regenerates the internal-go lane.

What

  • Exec(ExecRequest) returns (ExecResponse) — one-shot; a non-zero exit rides ExecResponse.exit_code, never a Connect error (the wire mirror of podman.go:310-313).
  • ExecStream(stream ExecStreamRequest) returns (stream ExecStreamResponse) — bidi; direction-specific oneof frames (StartExec|stdin|StdinClose up, ExecStarted|stdout|stderr|ExecExit down). Named ExecStreamRequest/ExecStreamResponse rather than the parent's shared ExecStreamFrame sketch, forced by buf's RPC_REQUEST/RESPONSE_STANDARD_NAME (OQ-B, resolved in-record).
  • Signal(SignalRequest) returns (SignalResponse) — kill an exec by exec_id; empty exec_id targets the guest (Stop, §(d)).
  • Provision(ProvisionRequest) returns (ProvisionResponse) — the ready -> provisioned gate transition; carries default_exec_uid + base_env now, the nft_script branch is V3's.
  • HealthResponse.boot_nonce (field 4, additive) — the host-minted cmdline nonce guestd echoes so Start binds the guest to the VM it launched (§(e), OQ-A resolved).
  • Service-header auth paragraph rewritten to record the (e) structural-identity resolution.

Additive-only (new RPCs, new messages, one new field): buf breaking is satisfied by construction, and the file stays on the internal-only lane (go/internal/gen, no TS, no public go/gen).

Guard for the stacked follow-ups

The generated GuestControlHandler interface widened to all five RPCs, so the V2a Health-only healthService no longer satisfies it. This commit embeds UnimplementedGuestControlHandler in healthService so the four new RPCs answer CodeUnimplemented and the V2a Health path is byte-unchanged; U2 replaces healthService with the real supervisor.

Verification

moon run compass-proto:ci green (gen-fence, drift, lint, breaking); go build ./internal/gen/... ./internal/guestd/... ./internal/runtime/... and go vet ./internal/guestd/... clean.

Ledger-impact: none
Spec-impact: none
Refs RIG-2493

Co-authored-by: Matt Wilkinson matt@rigel.build

@linear-code

linear-code Bot commented Aug 28, 2026

Copy link
Copy Markdown

RIG-2493

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-runner-rig-2493-u1-g.compass-eng-docs.pages.dev

Deployed from compass-runner/rig-2493-u1-guest-control-exec-proto at 1d0d884.

rigel-mintaka and others added 2 commits August 28, 2026 05:13
…-2493)

U1 of the frozen microVM Runner V2b plan (`docs/designs/infra/runtime/compass-elastic-session-runtime/microvm-v2b-guest-supervisor-exec.md`, §Plan U1). Grows `proto/compass/v1/guest_control.proto` additively per §(a) with the four exec-surface RPCs and their messages, plus one additive field on the V2a `HealthResponse`, and regenerates the internal-go lane.

### What

- `Exec(ExecRequest) returns (ExecResponse)` — one-shot; a non-zero exit rides `ExecResponse.exit_code`, never a Connect error (the wire mirror of `podman.go:310-313`).
- `ExecStream(stream ExecStreamRequest) returns (stream ExecStreamResponse)` — bidi; direction-specific `oneof` frames (`StartExec|stdin|StdinClose` up, `ExecStarted|stdout|stderr|ExecExit` down). Named `ExecStreamRequest`/`ExecStreamResponse` rather than the parent's shared `ExecStreamFrame` sketch, forced by buf's RPC_REQUEST/RESPONSE_STANDARD_NAME (OQ-B, resolved in-record).
- `Signal(SignalRequest) returns (SignalResponse)` — kill an exec by `exec_id`; empty `exec_id` targets the guest (Stop, §(d)).
- `Provision(ProvisionRequest) returns (ProvisionResponse)` — the `ready -> provisioned` gate transition; carries `default_exec_uid` + `base_env` now, the `nft_script` branch is V3's.
- `HealthResponse.boot_nonce` (field 4, additive) — the host-minted cmdline nonce guestd echoes so Start binds the guest to the VM it launched (§(e), OQ-A resolved).
- Service-header auth paragraph rewritten to record the (e) structural-identity resolution.

Additive-only (new RPCs, new messages, one new field): `buf breaking` is satisfied by construction, and the file stays on the internal-only lane (`go/internal/gen`, no TS, no public `go/gen`).

### Guard for the stacked follow-ups

The generated `GuestControlHandler` interface widened to all five RPCs, so the V2a Health-only `healthService` no longer satisfies it. This commit embeds `UnimplementedGuestControlHandler` in `healthService` so the four new RPCs answer `CodeUnimplemented` and the V2a Health path is byte-unchanged; U2 replaces `healthService` with the real supervisor.

### Verification

`moon run compass-proto:ci` green (gen-fence, drift, lint, breaking); `go build ./internal/gen/... ./internal/guestd/... ./internal/runtime/...` and `go vet ./internal/guestd/...` clean.

Ledger-impact: none
Spec-impact: none
Refs RIG-2493

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…2493)

Address ReviewU1's two low findings on the `Exec` RPC doc-comment (proto + regenerated connect interface):

- The `(0/caps)` parenthetical implied capabilities are refusable over this proto; they are not — caps are ignored-and-asserted in the guest, never surfaced as a Connect error. Narrowed to `(0)`, since a refused uid is the only wire-refusable case.
- "could not be attempted" excluded the attempted-then-timed-out case. Reworded to "could not be attempted or could not complete" so a spawn failure, a refused uid, a timeout, and an unprovisioned gate all read as covered.

Doc-only; the wire surface is byte-identical. `moon run compass-proto:ci` green (drift confirms generated matches source).

Ledger-impact: none

Spec-impact: none. Refs RIG-2493

Co-authored-by: Matt Wilkinson <matt@rigel.build>
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