Skip to content

feat(mocactl): sbx --record and run --record, sbx token --renew-every - #768

Merged
pdettori merged 7 commits into
rossoctl:mainfrom
webchang:pr/i14c-record
Nov 13, 2026
Merged

pdettori merged 7 commits into
rossoctl:mainfrom
webchang:pr/i14c-record

Conversation

@webchang

@webchang webchang commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Part of #737. Not stacked: a client-only change on main (d4babb8). Its own change is 4 signed-off commits, plus merges of main.

What it does: mocactl can keep a record of the calls it makes, for whoever needs to show what a session did, and a long session keeps its token fresh. Four commits:

  1. sbx up switches off OpenCode's skill tool too.
  2. sbx token --renew-every S renews the sandbox token on an interval.
  3. sbx --record F appends one NDJSON line per HTTP attempt to F.
  4. mocactl run --record F puts a session's calls in the same record.

What a record holds, and what it never holds:

  • Never a host, URL or token. Token fields, and any string shaped like a JWT or a refresh token, are hashed. URLs are kept only as lengths, and so is a run's free text.
  • The file is created 0600, and each line is written whole.
  • --record is refused on token, login, logout and credentials.
  • Path query strings are kept, since no route puts a secret in one.
  • gRPC exec bytes aren't recorded. claude and codex record only their own calls.

Tests on the tip:

  • mocactl's full suite: 1,720 passed, 4 skipped;
  • tsc and prettier are clean.

13 files, +1,332 / -38.

Assisted-By: Claude Code

`sbx up` switches off OpenCode's local tools in opencode.json, so the
agent works only through the sandbox. One tool stayed on beside the
sandbox's: `skill`, which reads SKILL.md files from the laptop's skill
directories (~/.claude/skills and others) into the session. It runs
nothing, but it puts laptop content into the agent's context.

`skill` joins OPENCODE_OFF, so `up` writes tools.skill: false, `rm`
takes it back, and `sbx doctor` reports tools.skill or permission.skill
switched back on, as it does for the other local tools. The tests that
used `skill` as their example of a key `up` leaves alone now use
`todowrite`, which only keeps a to-do list. The user guide's
opencode.json row and the SBX0 design's section 6.3 list it.

Refs rossoctl#737

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
A client that holds a sandbox connection for longer than one sandbox
token's lifetime (15 minutes by default) has to run `mocactl sbx token`
again before the token expires. `--renew-every S` keeps one process
for that: it prints a fresh token, then a new one every S seconds, one
line each (or one JSON object each with --json), until it is stopped,
so the client reads its next token from a pipe.

S is a whole number of seconds, at least 1; the flag is refused on any
other command, and a malformed value exits 2 before any request. A stop
(the signal) exits 0; a mint that fails exits as `sbx token` does.

Refs rossoctl#737

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
A script that drives `mocactl sbx` has no record of the calls each
command made: which paths, which statuses, which retries and when.
`--record F` on any `mocactl sbx` command that calls the API appends one
JSON line per HTTP attempt to F: the command and an invocation id, `seq`
and `try` (a retry of the same method and path in a row), the method,
the path relative to the control plane's base URL, the status or the
transport error's code, the request and answer bodies, their times
(UTC) and the Retry-After.

No secret, host or free text reaches the file. Token fields and gate
records are kept as their sha256, and so is any string, under any
field, shaped like a JWT or a refresh token, so a token field the API
adds later is caught too. execEndpoint, execCa, any absolute URL and a
reason's message are kept as their length. The base URL is never
written.

A streamed answer (SSE or NDJSON) passes through as it arrives: its line
is written at the headers (`stream: true`), and a `stream_end` line for
the same seq gives its bytes, their sha256 and the frames counted.

F is created 0600 and opened O_APPEND; an existing F wider than 0600,
or not a regular file, is refused (exit 2, before any request). Each
line is one write; a line past PIPE_BUF takes a lock file beside F, so
several processes can share one record.

The flag is refused on `token`, `login`, `logout` and `credentials`,
which handle a secret on purpose. Exec calls are gRPC and not recorded;
the record covers the control-plane calls around them (a token mint, a
sandbox read). A test runs every API command with --record and checks
its lines against the calls the control plane saw.

Refs rossoctl#737

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
`mocactl run "prompt" --record F` appends one NDJSON line per HTTP
attempt the run makes, in the format of `mocactl sbx --record`: the
login's refresh, the credential and model lookups, discovery, the
session's creation and the turn. One record spans both endpoints: each
line names its `endpoint` (control-plane or harness, `other` for a
request under neither) and its path relative to that endpoint's base
URL. The harness's URL is read per request, so one found by discovery
counts (DiscoveringHarness.discoveredUrl()).

A run carries free text the sbx commands do not: the prompt, the reply,
a frame's text, the workspace patch, a transcript, a person's display
name, a credential's hosts and endpoint. These are kept as their length
(RUN_LENGTH_FIELDS); ids, codes, statuses, times, usage, the sandbox
placement, patchSha256 and patchBytes stay. Tokens are hashed as for
sbx.

The turn's stream is never held back: its line is written at the
headers (`stream: true`), the frames reach stdout as they arrive, and a
`stream_end` line gives the bytes, their sha256 and the frames counted,
with the error when the stream failed or was aborted.

`--record` on any other top-level command exits 2, as does a record
file wider than 0600. The CLI reference documents the record's fields
and what is never written.

Refs rossoctl#737

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@webchang
webchang requested a review from pdettori as a code owner November 12, 2026 16:33
@pdettori pdettori added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 12, 2026

@clawgenti clawgenti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Adds --record F (an NDJSON call record) to mocactl sbx and mocactl run, plus sbx token --renew-every S and OpenCode's skill-tool switch-off in sbx up. The redaction design is careful (token-named fields and JWT/refresh-shaped strings hashed, 0600 + O_NOFOLLOW, refused on token/login/logout/credentials) and the PR's tests pass on head. No must-fix issues; one suggestion about URLs inside free text, one nit.

Author: webchang (MEMBER — maintainer)
Areas reviewed: TypeScript (mocactl CLI, call record, token renew), Tests, Docs
Agent/IDE config (.claude/.vscode): none
Commits: 5 commits, all signed-off: yes
CI status: passing (all 17 checks green)

Verified on head: vitest run on sbx-record, run-record, sbx-cli and sbx-agent-config tests (4 files, 187 passed), tsc --noEmit clean, plus a throwaway redact() probe (deleted afterwards).

Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).

/** A refresh token anywhere in a string (its shape: `mrt_` + 43 base64url characters). */
const REFRESH_RE = new RegExp(`${REFRESH_TOKEN_PREFIX}[A-Za-z0-9_-]{43}`);
/** An absolute URL names a host: kept as its length, whatever field it sits under. */
const URL_RE = /^[a-z][a-z0-9+.-]*:\/\/[^\s/]/i;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: URL_RE is anchored at ^, so a URL is only reduced to its length when it is the whole string. A URL or host inside free text passes through as-is. For an sbx record (no RUN_LENGTH_FIELDS), a top-level message is also kept verbatim. A throwaway probe on head:

redact({error:'upstream_unreachable', message:'cannot reach https://registry.corp.example:5000/v2/'})
→ {"error":"upstream_unreachable","message":"cannot reach https://registry.corp.example:5000/v2/"}
redact({note:'see https://internal.example/x'}) → {"note":"see https://internal.example/x"}

That conflicts with the file header's promise that the record never holds a host. Today it depends on the control plane never putting a host in an error message, which nothing enforces.

Suggested fix: match a URL anywhere in a string (drop the ^, e.g. /[a-z][a-z0-9+.-]*:\/\/[^\s/]/i), and/or add message to the shared LENGTH_FIELDS for API error bodies. Then add a test with a URL inside a sentence.

wrap(fetchImpl, baseUrl) {
const basePath = new URL(baseUrl).pathname.replace(/\/+$/, '');
return wrapWith(fetchImpl, (u) => ({
path: u.pathname.startsWith(basePath) ? u.pathname.slice(basePath.length) : u.pathname,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: u.pathname.startsWith(basePath) has no segment boundary. With a base path of /api, a request to /apix/v1/... is recorded as x/v1/.... wrapEndpoints already checks `${base}/`, so the same check here would keep the two consistent.

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds --record F for mocactl run and the API-calling mocactl sbx commands (one redacted NDJSON line per HTTP attempt), sbx token --renew-every S, and switches off OpenCode's skill tool in sbx up. I checked the record for secret leakage and found none: headers (Authorization) are never read, query strings only ever carry sessionId/cursor/credential/limit/all, token fields and JWT/mrt_-shaped strings are hashed, and the file is opened O_APPEND|O_CREAT|O_NOFOLLOW 0600 with a mode check on fstat. The skill key is correct for OpenCode 1.18.35 (Tool.define("skill", …), permission: "skill"). The comments below cover --renew-every robustness, how a failed record write interacts with a non-idempotent call, and a couple of smaller edges.

Author: webchang (MEMBER — maintainer)
Areas reviewed: mocactl sbx up OpenCode skill tool; sbx token --renew-every; sbx --record F (call-record.ts redaction, file open/mode, append/lock, stream pass-through); mocactl run --record F (endpoint split, harness discovery); docs and tests
Agent/IDE config: none
Commits: 4, all signed-off: yes
CI status: passing

Verdict: APPROVE. Nothing here blocks the merge. The inline suggestions are robustness fixes for the long-running --renew-every loop and for a failed record write that hides a successful non-idempotent call.

Checked with no finding:

  • Secret leakage. Only init.body and the URL path and query are recorded, never headers. Every query in src/api and src/sbx/api.ts is checked. refresh_token, token, refreshToken, the sandbox token, the session token and secret are hashed. wsk is the sandbox id (public).
  • File handling. Created 0600; an existing file with group or other bits is refused via fstat (no TOCTOU); O_NOFOLLOW is set. Writes are synchronous writeSync, so lines don't interleave within a process; lines over 4 KiB take a lock file.
  • Retries. Each 401→refresh→retry attempt gets its own line with a try count.

function wholeSeconds(io: Io, flag: string, raw: string | undefined): number | undefined | null {
if (raw === undefined) return undefined;
const n = /^\d+$/.test(raw.trim()) ? Number(raw.trim()) : Number.NaN;
if (!Number.isSafeInteger(n) || n < 1) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: --renew-every has no upper bound, and it isn't checked against the token's lifetime:

  • Any S > 2147483 (about 24.8 days) overflows setTimeout. Node clamps the delay to 1 ms (TimeoutOverflowWarning), so --renew-every 9999999 mints a token about every millisecond until it's stopped. That floods the control plane and the pipe. Checked locally: setTimeout(f, 2147484*1000) fires after 2 ms.
  • Any S at or above the token's TTL (15 minutes by default, so --renew-every 900 or 3600) means the client reading the pipe holds an expired token for part of each period. Nothing warns about this, and the user guide's own example (600) only works because it happens to be under 900.

Fix: reject values over the setTimeout limit. Better still, sleep min(S, expiresAt - now - margin) per iteration, or warn when S*1000 >= (t.expiresAt*1000 - Date.now()).

);
return SBX_EXIT.ok;
for (;;) {
const t = await c.api.mintSandboxToken(id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: In the --renew-every loop, a single failed mint ends the long-lived renewer for good. Any thrown error (a 503, a network blip, a refused login refresh) falls through to failed(c, err) and the process exits. The client reading the pipe gets EOF while its current token still has up to expiresAt - now left, and nothing restarts the renewer. That is the opposite of what a "renewer for a long-lived client" should do. A terminated sandbox should still stop the loop.

Fix: once the first token has been printed, retry transient failures (network errors, 5xx, 429 with Retry-After) with backoff until the last printed token is about to expire. Only fail on permanent errors (404/terminated, 401 after a refused refresh). Add a test with a 503 between two good mints.

.clone()
.text()
.catch(() => undefined);
write({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: A record write failure is thrown from inside the wrapped fetch after the request has already succeeded. ControlPlaneClient.request / HarnessClient catch whatever fetchImpl throws and turn it into networkError(...). So if the disk is full or F sits on a quota'd FS, mocactl sbx create --record F creates the sandbox on the server and then reports the control plane as unreachable. The user retries and ends up with a second, orphaned sandbox. run --record does the same with POST /v1/sessions. The same applies to the stream_end write inside passThrough, which is raised into the stream consumer.

Fix: don't let a record write fail the call. Catch it in write(), keep the first error, stop writing, and have main/sbxMain print it and exit non-zero once the command has finished, so the result is still reported. Alternatively, write the request line before sending.

const more = opts.lengthFields ?? NONE;
let fd: number;
try {
fd = openSync(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: openSync(path, O_WRONLY|O_APPEND|O_CREAT|O_NOFOLLOW) blocks forever when F is an existing FIFO with no reader. The !st.isFile() refusal only runs after the open returns, so --record /some/fifo hangs the command instead of exiting 2 as the docs promise ("not a regular file, exits 2 before any request"). Checked locally: the same open on a mkfifo path hangs. Add O_NONBLOCK to the open flags. A FIFO with no reader then fails with ENXIO, and regular files are unaffected because appends to them don't block.

mocactl sbx doctor [--sandbox ID] [--json] check login, sandbox, agent config, exec and recent
calls (exit 0 when every check passes, else 1)
--record F (every command that calls the API but token, login, logout and credentials): one
NDJSON line per HTTP attempt appended to F (0600), with no token, host or free text in it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The usage line says the sbx record has "no token, host or free text in it". But RUN_LENGTH_FIELDS only applies to run, so sbx records keep the sandbox's name and labels, the template's description (sbx templates), and the login's displayName from a refresh answer, all verbatim. docs/reference/cli-mocactl.md describes this correctly. Either drop "free text" here, or add displayName/description to the shared LENGTH_FIELDS. A person's name is the one item a user is likely to expect to be redacted.

Conflicts and resolutions (packages/mocactl/src/sbx/cli.ts):
- The imports: kept this branch's call-record import and main's
  templates.js imports.
- Kept this branch's NO_RECORD set and main's TEMPLATE_SUBS,
  TAKES_BUILD and TAKES_TIMEOUT.
- SYNC_FLAGS' flag type: both 'renew-every' and 'seed'.
- The parse options: this branch's renew-every and record, and main's
  template create options.
- The command context: kept main's now beside the sleep both sides
  pass.

Follow-ups in the merge (no conflict marker; typecheck found them):
- SbxDeps in cli.ts declared sleep and now twice, once for each side:
  one of each now, the comments naming both users (the template
  commands' waits and token --renew-every; the template commands' clock
  and --record's).
- SbxCtx in packages/mocactl/src/sbx/commands.ts declared sleep twice:
  one now, its comment naming the template commands and
  token --renew-every.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@webchang

Copy link
Copy Markdown
Member Author

Merged main (d4babb8). Tests ran locally on the existing node_modules, since a fresh install is held by the new hono pin's release-age window; CI is the full check.

Assisted-By: Claude Code

@pdettori

Copy link
Copy Markdown
Member

need rebase & resolve conflicts

Upstream main (f60db30) adds mocactl's retry for run and put (rossoctl#761).
No API version change: this branch claims none.

Conflicted:
- packages/mocactl/src/sbx/cli.ts: SbxDeps keeps main's random (run's
  jitter) and its sleep doc for run's retry wait, joined with this
  branch's mentions of token --renew-every's waits and --record's clock.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@pdettori
pdettori merged commit 1016d26 into rossoctl:main Nov 13, 2026
17 checks passed
webchang added a commit to webchang/moca that referenced this pull request Nov 13, 2026
Upstream main (949dc5f) adds template tags, edits and owner transfer
(rossoctl#774) as API 1.8.0, so this branch's section moves to 1.9.0.

Conflicted:
- docs/api/CHANGELOG.md: main's 1.8.0 (template tags, edits and owner
  transfer), 1.7.0 and 1.6.0 kept as main has them; this branch's
  session-templates section is now 1.9.0, above them.
- docs/reference/change-policy.md: main's list kept, with this
  branch's "then session sandbox templates" after it; both version
  mentions say 1.9.0.

Also changed in the merge:
- docs/api/openapi.yaml: info.version 1.9.0.
- packages/mocactl/test/run-record.test.ts (from rossoctl#768): mocactl run
  now reads discovery twice before it creates the session, once for
  the sandbox tier and once for this branch's sandbox template field,
  so the recorded call list gains a line and the later indices and
  sequence numbers move by one.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
webchang added a commit to webchang/moca that referenced this pull request Nov 16, 2026
…te lifecycle stack

Upstream main 0dc3d01 (API 1.21.0) carries the reviewed, final form of
the features this branch held in early, integrated versions, through the
PRs filed from this fork (rossoctl#755-rossoctl#776, rossoctl#781, rossoctl#782, rossoctl#784-rossoctl#786, rossoctl#789-rossoctl#794,
rossoctl#798-rossoctl#800) and the maintainer's lease mode, grants and lease clients
(rossoctl#763, rossoctl#802, rossoctl#807, rossoctl#808, rossoctl#810, rossoctl#812, rossoctl#814). Where upstream has a feature,
upstream's version wins: its code, tests, openapi, CHANGELOG (byte
identical), docs and specs.

The fork was 736 commits behind and 390 ahead (merge base dd0ce71).

Conflict resolution (148 files, 82 both-modified, 66 both-added): every
conflicted file is upstream's side as is (byte identical to 0dc3d01).
No conflicted file differs from 0dc3d01 in this commit.

One file merged without a conflict and was set back to upstream's:
- packages/mocactl/src/sbx/push.ts: the auto-merge added the fork's
  baselineAtHead a second time beside upstream's own (fb28e06's
  function, already upstream); upstream's file as is.

With that, this commit's tree is 0dc3d01's plus the 18 files only the
fork has (below). Every other file the fork changed is upstream's.

Conflicted files, all resolved to upstream's side (0dc3d01):
- deploy/k8s/overlays/ocp-combined/kustomization.yaml (AA)
- deploy/k8s/overlays/ocp-combined/patch-addressing.yaml (AA)
- deploy/k8s/overlays/ocp-combined/patch-relay.yaml (AA)
- deploy/microvm/P4-ON-P6.md (UU)
- deploy/microvm/build-rootfs.sh (UU)
- deploy/microvm/build-snapshot.sh (UU)
- deploy/microvm/setup-microvm.sh (UU)
- deploy/microvm/tests/build-rootfs.test.sh (UU)
- deploy/microvm/tests/build-snapshot.test.sh (UU)
- deploy/microvm/tests/setup-microvm.test.sh (UU)
- deploy/sbx/README.md (UU)
- deploy/sbx/RUNBOOK.md (UU)
- deploy/sbx/host-agent.sh (AA)
- deploy/sbx/install-host.sh (UU)
- deploy/sbx/sbx-host-agent-wanted.service (AA)
- deploy/sbx/sbx-host-agent-wanted.timer (AA)
- deploy/sbx/sbx-host-agent.service (AA)
- deploy/sbx/[email protected] (UU)
- deploy/sbx/setup.sh (UU)
- deploy/sbx/template-onboarding/GUIDE.md (AA)
- deploy/sbx/template-onboarding/ONBOARDING.md (AA)
- deploy/sbx/template-onboarding/README.md (AA)
- deploy/sbx/template-onboarding/examples/django__django-11133.gate-record.json (AA)
- deploy/sbx/template-onboarding/examples/django__django-11133.json (AA)
- deploy/sbx/template-onboarding/governance/GATING-RULES.md (AA)
- deploy/sbx/template-onboarding/governance/PROCESS.md (AA)
- deploy/sbx/template-onboarding/governance/README.md (AA)
- deploy/sbx/template-onboarding/template-build.sh (AA)
- deploy/sbx/template-onboarding/template-register.sh (AA)
- deploy/sbx/template-onboarding/tests/examples.test.sh (AA)
- deploy/sbx/template-onboarding/tests/template-build.test.sh (AA)
- deploy/sbx/template-onboarding/tests/template-register.test.sh (AA)
- deploy/sbx/template-onboarding/verify-provenance.py (AA)
- deploy/sbx/templates-check.sh (AA)
- deploy/sbx/tests/host-agent.test.sh (AA)
- deploy/sbx/tests/install-host.test.sh (UU)
- deploy/sbx/tests/overlay-combined.test.sh (AA)
- deploy/sbx/tests/setup.test.sh (UU)
- deploy/sbx/tests/templates-check.test.sh (AA)
- deploy/vm/tests/setup-vm.test.sh (UU)
- docs/api/CHANGELOG.md (UU)
- docs/api/harness-openapi.yaml (UU)
- docs/api/openapi.yaml (UU)
- docs/concepts/sandboxes-and-tiers.md (UU)
- docs/reference/change-policy.md (UU)
- docs/reference/cli-mocactl.md (UU)
- docs/reference/configuration.md (UU)
- docs/reference/http-api.md (UU)
- docs/sbx/user-guide.md (UU)
- docs/specs/2026-10-15-sbx0-internal-sandbox-service-design.md (UU)
- docs/specs/2026-10-30-session-sandbox-templates-design.md (AA)
- docs/specs/2026-11-03-template-lifecycle-and-provenance-design.md (AA)
- docs/specs/2026-11-05-combined-control-plane-design.md (AA)
- docs/specs/2026-11-08-enrollment-and-roles-api-design.md (AA)
- docs/specs/2026-11-08-sandbox-egress-records-design.md (AA)
- docs/specs/2026-11-08-subject-trust-gate-records-design.md (AA)
- docs/specs/README.md (UU)
- harness/src/run-turn.ts (UU)
- harness/src/sandbox-affinity.ts (UU)
- harness/src/select-sandbox.ts (UU)
- harness/test/select-sandbox-templates.test.ts (AA)
- harness/test/turn-seed.test.ts (AA)
- harness/test/turn-stream.test.ts (UU)
- packages/control-plane/src/activation-lock.ts (AA)
- packages/control-plane/src/activation.ts (AA)
- packages/control-plane/src/egress-handlers.ts (UU)
- packages/control-plane/src/egress-log.ts (AA)
- packages/control-plane/src/errors.ts (UU)
- packages/control-plane/src/exchange.ts (UU)
- packages/control-plane/src/handler-util.ts (UU)
- packages/control-plane/src/handlers.ts (UU)
- packages/control-plane/src/host-handlers.ts (AA)
- packages/control-plane/src/identity.ts (UU)
- packages/control-plane/src/index.ts (UU)
- packages/control-plane/src/main.ts (UU)
- packages/control-plane/src/member-handlers.ts (AA)
- packages/control-plane/src/members.ts (AA)
- packages/control-plane/src/ownership.ts (UU)
- packages/control-plane/src/provenance.ts (AA)
- packages/control-plane/src/routes.ts (UU)
- packages/control-plane/src/sandbox-config.ts (UU)
- packages/control-plane/src/sandbox-handlers.ts (UU)
- packages/control-plane/src/server.ts (UU)
- packages/control-plane/src/template-catalog.ts (AA)
- packages/control-plane/src/template-policy.ts (AA)
- packages/control-plane/src/token.ts (UU)
- packages/control-plane/test/activation.test.ts (AA)
- packages/control-plane/test/egress-redis.test.ts (AA)
- packages/control-plane/test/errors.test.ts (UU)
- packages/control-plane/test/host-flow.test.ts (AA)
- packages/control-plane/test/members.test.ts (AA)
- packages/control-plane/test/openapi-contract.test.ts (UU)
- packages/control-plane/test/provenance.test.ts (AA)
- packages/control-plane/test/repository-allowlist.test.ts (AA)
- packages/control-plane/test/route-authz-enumeration.test.ts (UU)
- packages/control-plane/test/route-profile.test.ts (UU)
- packages/control-plane/test/routes.test.ts (UU)
- packages/control-plane/test/sandbox-egress.test.ts (AA)
- packages/control-plane/test/sandbox-handlers.test.ts (UU)
- packages/control-plane/test/session-templates.test.ts (AA)
- packages/control-plane/test/subject-trust.test.ts (AA)
- packages/control-plane/test/template-admin.test.ts (AA)
- packages/control-plane/test/template-catalog.test.ts (AA)
- packages/control-plane/test/template-create.test.ts (AA)
- packages/knative-server/src/server.ts (UU)
- packages/knative-server/src/turn-auth.ts (UU)
- packages/knative-server/test/turn-auth.test.ts (UU)
- packages/mocactl/src/api/errors.ts (UU)
- packages/mocactl/src/api/frames.ts (UU)
- packages/mocactl/src/cli.ts (UU)
- packages/mocactl/src/core/session-manager.ts (UU)
- packages/mocactl/src/core/session-options.ts (UU)
- packages/mocactl/src/headless.ts (UU)
- packages/mocactl/src/sbx/api.ts (UU)
- packages/mocactl/src/sbx/call-record.ts (AA)
- packages/mocactl/src/sbx/cli.ts (UU)
- packages/mocactl/src/sbx/commands.ts (UU)
- packages/mocactl/src/sbx/dry-run.ts (AA)
- packages/mocactl/src/sbx/exec.ts (UU)
- packages/mocactl/src/sbx/run.ts (UU)
- packages/mocactl/src/sbx/templates.ts (AA)
- packages/mocactl/test/contract.test.ts (UU)
- packages/mocactl/test/harness.test.ts (UU)
- packages/mocactl/test/headless.test.ts (UU)
- packages/mocactl/test/helpers/sbx.ts (UU)
- packages/mocactl/test/run-record.test.ts (AA)
- packages/mocactl/test/sbx-admin-subjects.test.ts (AA)
- packages/mocactl/test/sbx-cli.test.ts (UU)
- packages/mocactl/test/sbx-egress.test.ts (AA)
- packages/mocactl/test/sbx-exec.test.ts (UU)
- packages/mocactl/test/sbx-templates.test.ts (AA)
- packages/mocactl/test/session-manager.test.ts (UU)
- packages/mocactl/test/session-options.test.ts (UU)
- remote-worker/cmd/microvm-worker/main.go (UU)
- remote-worker/cmd/microvm-worker/template_record.go (AA)
- remote-worker/cmd/microvm-worker/template_record_test.go (AA)
- remote-worker/cmd/microvm-worker/verify_cache.go (AA)
- remote-worker/cmd/microvm-worker/verify_cache_test.go (AA)
- remote-worker/internal/egress/audit_test.go (UU)
- remote-worker/internal/session/labels.go (UU)
- remote-worker/internal/vmpool/errors.go (UU)
- remote-worker/internal/vmpool/guestconn.go (UU)
- remote-worker/internal/vmpool/guestconn_test.go (UU)
- remote-worker/internal/vmpool/launcher_firecracker.go (UU)
- remote-worker/internal/vmpool/launcher_firecracker_egress_unix_test.go (UU)
- remote-worker/internal/vmpool/snapshot.go (UU)
- remote-worker/internal/vmpool/snapshot_test.go (UU)
- remote-worker/internal/vmpool/verifycache.go (AA)

Fork-only files, kept as they are (upstream has no such file):
- deploy/sbx/mint-login.sh, deploy/sbx/tests/mint-login.test.sh: a test
  login minted with the deployment's signing key. Checked against
  upstream: makeSigner/mint, SANDBOX_API_ISSUER, the moca-mu1 Secret and
  its label, the env keys it reads and mocactl's sbx-auth.json shape are
  all still upstream's.
- deploy/sbx/template-onboarding/deck/ (README, requirements, the two
  generators, deck_kit.py, the two PDFs, .gitignore): the fork's decks.
- deploy/sbx/template-onboarding/GUIDE.pdf: regenerated from upstream's
  GUIDE.md in a later commit.
- deploy/sbx/template-onboarding/governance/GAPS-AND-ASSUMPTIONS.md and
  INVENTORY-2026-11-02.md: the fork's register and inventory.
- docs/specs/2026-11-09-cold-start-pacing-design.md,
  2026-11-09-memory-aware-placement-design.md and
  2026-11-10-mocactl-template-commands-design.md: the fork's design
  notes; upstream folded their content into its lifecycle spec
  (§6.4 memory, §6.5 pacing) and the user guide (mocactl).
- docs/tools/gen_pdf.py, docs/tools/gen_toc.py: the PDF and TOC tools.

Fork-only behaviour, decided one by one (from git log 0dc3d01..f125c02
--no-merges, checked against 0dc3d01):

Ported onto upstream's code, each in its own commit after this one:
- The pinned-session retire guard (c571226): a retire is refused
  (409 build_in_use) while an active Moca Pi session is pinned to the
  build. Upstream's buildsInUse checks live sandboxes only and its
  comment says pinned sessions are still to be checked.
- Reuse only while a host holds the snapshot (G29, 521efe5): upstream
  reuses any registered build with the same inputs; its own lifecycle
  spec (§4, Reuse) says a registered build is reused only while a host
  reports holding its snapshot.
- install-host.sh --uninstall-shared and the mounted legacy jail guard
  (5e66397): upstream has neither.
- GUIDE §4b.4's base example without skip_git_identity_check
  (f125c02): upstream applies X12 under every profile, so its example
  create would be refused.
- Links from upstream's READMEs to the fork-only files above.

Dropped, because upstream's design replaces them on purpose:
- Removal of admin-rejected builds: upstream stops them and never
  removes them (the user's decision in rossoctl#786).
- The harness-profile catalog's fallback to SH_SESSION_TEMPLATES
  (902255b): upstream serves the harness profile the store's templates
  only (its test was renamed so); a combined plane is unaffected.
- The fork's register ids (G-numbers), window dates and results
  pointers inside the documents upstream now has (RUNBOOK, README,
  GUIDE, ONBOARDING, PROCESS, GATING-RULES, P4-ON-P6, the specs):
  upstream's text wins; the fork's own documents above keep them.
- The fork's image-builder-specific wording in GATING-RULES.md:
  upstream's generic wording (the image builder) is taken as is.

Dropped, could be re-proposed (no upstream equivalent, but the port is
an API change or its intent upstream is unclear):
- TurnPlacement.template, a turn result naming the session's sandbox
  template (9d6004d): a harness API field; upstream's CHANGELOG is kept
  byte identical.
- An imported build's catalog entry and create record carrying the
  declared seed (20d0995): sessions are seeded the same (upstream falls
  back to the declared seed); only the field in the catalog API goes.
- mocactl: sbx create --seed checking the seeded HEAD against the spec's
  baseline_commit; activate --wait stopping at once on not_held or
  memfile_mismatch; ApiError's readiness, readinessReason and
  queuePosition in refusals; an admin write refused when the control
  plane URL came only from the login; the admin-write issuer check for
  the combined profile; the dry run's X1.offline check and its guest_mb
  and git-less advice; the quota, policy and build lines' extra fields
  (quotaSource, selfAttest, allowedRepositories, heldBy, attestation).
  Upstream's reviewed client (rossoctl#767, rossoctl#768) left them out; the server
  still enforces every rule.

Already upstream (not lost): build reuse (G21), the verify cache, the
host agent's --keep-shared removals, read-ahead, the hash_version 2
check in the microVM worker, M7, G39, G42, G43, G48, G49, G50, mocactl
--record, --version, the minted login's own control plane, activate
--wait sizing, and every other fork feature listed in the task.

The relay's per-client tokens: not on this branch (the fork's
sandbox-relay main.ts is older upstream code), so nothing to resolve.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@pdettori pdettori added this to the v0.11.0 milestone Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants