You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename the reusable sandbox base surface away from Snapshot so it no longer conflicts with backup/runtime snapshots.
Use Image for user-facing dashboard copy, BoxTemplate for control-plane metadata, and artifact/artifactRef/cache for runtime and runner ownership.
Split the old SnapshotManager responsibilities across BoxTemplate metadata, RuntimeArtifact orchestration, RunnerArtifactCache state, and the ArtifactRegistry service/config.
Update API, dashboard routes/copy, runner endpoints, SDK/generated TypeScript clients, proxy support, infra config, and the database migration.
Why three layers
The old Snapshot name was doing three jobs at once: the user-selected base, the runtime artifact, and the per-runner cached copy. Splitting those responsibilities makes ownership explicit: the control plane owns metadata and defaults, artifact logic owns build/pull/remove work, and each runner owns local cache state. Backup snapshots remain a separate concept.
User-facing
Image
|
v
Control plane
BoxTemplate
- metadata, defaults, visibility, lifecycle
- stores artifactRef
|
v
Runtime
RuntimeArtifact / artifactRef
- build, pull, remove orchestration
|
v
Runner
RunnerArtifactCache
- per-runner pull/build state
Migration notes
Adds post-deploy migration 1780200000000 to rename snapshot tables, columns, indexes, enums, and permissions to box_template, runner_artifact_cache, artifactRef, template, and template permissions.
The migration uses existence checks for rename paths, but it expects the current main snapshot schema to exist for post-rename defaults and index recreation.
Backup snapshot DTOs/fields are intentionally not renamed.
Test plan
NX_DAEMON=false yarn nx run dashboard:build
NX_DAEMON=false yarn nx run api:test --runInBand box-template.service system-templates artifact-ref sandbox-to-box.mapper
NX_DAEMON=false yarn nx run api-client:build
NX_DAEMON=false yarn nx run runner-api-client:build
NX_DAEMON=false yarn nx run sdk-typescript:build
go test ./... in apps/api-client-go
go build ./... in apps/proxy
go test ./... and go build ./... in apps/artifact-registry
Known verification blockers
make build:apps is blocked by current repo/env issues unrelated to this diff: missing VERSION, missing apps/hack/computer-use/build-computer-use-amd64.sh, and Nx resolving apps/apps/... paths for API/otel builds.
Runner full build/test is blocked in this worktree by missing sdks/go/libboxlite.a; make dev:go and the pre-push changed-test hook are blocked by uninitialized vendored submodules for libkrun/e2fsprogs.
box-template.controller.spec imports modules that hit existing node-forge and Request.user typing issues; the focused service/utils/system-template/mapping tests pass.
This PR contains 298 files, which is 148 over the limit of 150.
To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f113a0be-394c-40fc-a623-698b094cad58
📥 Commits
Reviewing files that changed from the base of the PR and between 71e1754 and dd12512.
⛔ Files ignored due to path filters (2)
apps/artifact-registry/go.sum is excluded by !**/*.sum
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You have signed the CLA already but the status is still pending? Let us recheck it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why three layers
The old Snapshot name was doing three jobs at once: the user-selected base, the runtime artifact, and the per-runner cached copy. Splitting those responsibilities makes ownership explicit: the control plane owns metadata and defaults, artifact logic owns build/pull/remove work, and each runner owns local cache state. Backup snapshots remain a separate concept.
Migration notes
1780200000000to rename snapshot tables, columns, indexes, enums, and permissions tobox_template,runner_artifact_cache,artifactRef,template, and template permissions.Test plan
NX_DAEMON=false yarn nx run dashboard:buildNX_DAEMON=false yarn nx run api:test --runInBand box-template.service system-templates artifact-ref sandbox-to-box.mapperNX_DAEMON=false yarn nx run api-client:buildNX_DAEMON=false yarn nx run runner-api-client:buildNX_DAEMON=false yarn nx run sdk-typescript:buildgo test ./...inapps/api-client-gogo build ./...inapps/proxygo test ./...andgo build ./...inapps/artifact-registryKnown verification blockers
make build:appsis blocked by current repo/env issues unrelated to this diff: missingVERSION, missingapps/hack/computer-use/build-computer-use-amd64.sh, and Nx resolvingapps/apps/...paths for API/otel builds.sdks/go/libboxlite.a;make dev:goand the pre-push changed-test hook are blocked by uninitialized vendored submodules forlibkrun/e2fsprogs.box-template.controller.specimports modules that hit existingnode-forgeandRequest.usertyping issues; the focused service/utils/system-template/mapping tests pass.