Skip to content

Converge A2 + MVP box journey into main (super PR — review & split)#715

Merged
DorianZheng merged 14 commits into
boxlite-ai:mainfrom
law-chain-hot:codex/super-pr-converge
Jun 10, 2026
Merged

Converge A2 + MVP box journey into main (super PR — review & split)#715
DorianZheng merged 14 commits into
boxlite-ai:mainfrom
law-chain-hot:codex/super-pr-converge

Conversation

@law-chain-hot

@law-chain-hot law-chain-hot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What this is

A convergence "super PR": it merges everything sitting on the codex/overnight-20260608 line into main, so that main becomes the single source of truth again. Intended to be reviewed then split — opened as one piece for visibility, not to be squash-merged blind.

main ← merge of (52 commits ahead): MVP box journey + agent-ready image catalog + A2 snapshot-manager deletion + Task12B observability wiring + default-org membership + W3C traceId, reconciled against main's Sandbox→Box rename (#706) and recent REST/CI fixes.

Net vs main: 771 files, +85k/−23.7k.

Suggested split for review (5 logical blocks)

# Block Rough surface
1 A2 — delete snapshot-manager machinery drops self-hosted registry / backup / build / docker-registry; collapses to box_template + runner_artifact_cache; direct ghcr pull; 68 files deleted; migrations 17809…17812…
2 MVP box journey simplified onboarding, templates-as-images, public Box IDs, archive-lifecycle retirement
3 Agent-ready image catalog `boxlite/base
4 Observability (Task12B) admin diagnose UX + runner/daemon traceId propagation
5 Org membership default-org state moved into memberships (backward-compatible)

Conflict-resolution policy (527 conflicts)

  • A2-deleted machinery (snapshot/backup/build/docker-registry): deletion wins over main's edits to those files.
  • Generated clients (api-client, runner-api-client, api-client-go): took main's regenerated side; a fresh regen against the merged API surface is still pending (see Caveats).
  • Source files: kept the A2/MVP side and re-applied refactor: rename Sandbox -> Box (Part 1: apps/api epicenter) #706's published codemod recipe (Sandbox→Box, with the frozen-literal allowlist preserved — DB table/column/enum, OS-isolation sandbox, telemetry boxlite.sandbox.*, webhook event names).
  • Renamed-path ports: 3-way merged onto the post-refactor: rename Sandbox -> Box (Part 1: apps/api epicenter) #706 box/ paths.
  • Go consumers aligned to the regenerated client enum names (BOXSTATE_*).

Caveats — read before merging

  • ⚠️ CI will be red until generated clients are regenerated against the merged API surface, and a full build + remote E2E is run. This was not done locally (no DB/KVM here); build/test verification is deferred to CI on purpose, stated honestly rather than claimed green.
  • ⚠️ Single migration variant of 1780200000000 is present (verified) — do not reintroduce a second.
  • ⚠️ Deploy ordering for the A2 block is runner-first (swap runner binary before the registry-deleting deploy), per Task 13.

Not in this PR

feat/admin-ui-redesign (POL-14 admin UI v2) and the unmerged Task12 ClickHouse sst.config.ts wiring are intentionally left out — separate follow-ups.


Commit inventory — 48 commits, 6 blocks (+1 merge)

A2 — delete snapshot-manager machinery (7)
p2 direct-ghcr · p3 drop build · p4 drop backup · p5 drop registry→2 tables · p6 rebuild box_template + runner_artifact_cache · P1 runtime-scoped ghcr auth · ghcr credential delivery (Secrets Manager)

MVP box journey (16)
streamline box journey · templates-as-images · public BoxID + archive retirement · simplified onboarding · BoxID/SDK onboarding polish · quickstart + dev-smoke

Template-artifact refactor (11)
from d3a60c7c: cloud templates + runtime artifacts refactor and follow-up fixes

Observability (3)
Task12B admin diagnose + saved-image fix · runner W3C traceparent · daemon traceId

Agent-ready images (3)
runtime catalog · pin digests · catalog merged into MVP journey

Org membership (3)
default-org state → memberships · backward-compatible · post-merge overview fix

Misc (5)
JWT issuer validation · ESLint flat-config fix · lint config · logo assets · yarn.lock


Superseded branches — intentionally NOT included

Verified by file-level comparison: these are earlier iterations whose final form is already in this PR. Re-submitting them would regress newer code.

  • feat/admin-overview, feat/frontend-slim-box-rename — fully superseded by Task12/12B + refactor: rename Sandbox -> Box (Part 1: apps/api epicenter) #706/MVP journey
  • feat/admin-ui-redesign, codex/task7-observability-data-layer — ~52% file-overlap with Task12B's rewrite already here; any truly-missing UI/data-layer fragments will come later as small focused PRs
  • codex/snapshot-image-naming, codex/runtime-artifact-split, codex/api-template-contract — abandoned saved_image naming line (carries a conflicting variant of migration 1780200000000; must never merge)

Generated clients now carry ZERO diff in this PR (reset to main in f9ea0730) — regenerate upstream against the merged API surface.


Image subsystem removed (commit fbf99d9)

The inherited Daytona-fork image-management (box_template + runner_artifact_cache) is fully removed so it can be rebuilt the team's own way. Box image-pull/boot is intentionally non-functional until the rebuild PR. Old impl preserved at tag pre-image-rewrite.

  • Deleted (45): box-template.* + runner-artifact-cache.* + RuntimeArtifactManager + the dashboard templates UI + template-states usage constant
  • Gutted (49): box.entity (template field), box.service (image resolution), box-start.action (pull state machine → ERROR stub), runner svc/controller, notifications/webhooks, metrics/openapi, org-usage billing (template metering → 0, TODO(billing-rewrite)), dashboard create/playground/routes
  • Untouched: migrations, generated clients (apps/libs, api-client-go), box list/delete + all non-image subsystems
  • Verified: zero dangling references to deleted symbols; zero conflict markers

@law-chain-hot law-chain-hot requested a review from a team as a code owner June 10, 2026 04:33
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 291 files, which is 141 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: 5a11c020-f25f-4413-a901-0c78a101b2a3

📥 Commits

Reviewing files that changed from the base of the PR and between 2d93cc3 and 68f0a90.

⛔ Files ignored due to path filters (9)
  • apps/dashboard/public/favicon.ico is excluded by !**/*.ico
  • apps/dashboard/src/assets/boxlite-black.png is excluded by !**/*.png
  • apps/dashboard/src/assets/boxlite-icon-black.png is excluded by !**/*.png
  • apps/dashboard/src/assets/boxlite-icon-light.png is excluded by !**/*.png
  • apps/dashboard/src/assets/boxlite-light.png is excluded by !**/*.png
  • apps/dashboard/src/assets/boxlite-website-logo-dark.png is excluded by !**/*.png
  • apps/dashboard/src/assets/boxlite-website-logo-light.png is excluded by !**/*.png
  • apps/dashboard/src/assets/go.svg is excluded by !**/*.svg
  • apps/dashboard/src/assets/rust.svg is excluded by !**/*.svg
📒 Files selected for processing (291)
  • apps/.claude/launch.json
  • apps/CLAUDE.md
  • apps/api/Dockerfile
  • apps/api/src/admin/admin.module.ts
  • apps/api/src/admin/controllers/observability.controller.spec.ts
  • apps/api/src/admin/controllers/observability.controller.ts
  • apps/api/src/admin/controllers/overview.controller.ts
  • apps/api/src/admin/controllers/runner.controller.spec.ts
  • apps/api/src/admin/controllers/runner.controller.ts
  • apps/api/src/admin/dto/admin-overview.dto.ts
  • apps/api/src/admin/dto/observability-investigate.dto.ts
  • apps/api/src/admin/dto/observability-query.dto.spec.ts
  • apps/api/src/admin/dto/observability-query.dto.ts
  • apps/api/src/admin/dto/observability-status.dto.ts
  • apps/api/src/admin/services/observability-cloudwatch.reader.ts
  • apps/api/src/admin/services/observability-s3.reader.spec.ts
  • apps/api/src/admin/services/observability-s3.reader.ts
  • apps/api/src/admin/services/observability.service.spec.ts
  • apps/api/src/admin/services/observability.service.ts
  • apps/api/src/admin/services/overview.service.spec.ts
  • apps/api/src/admin/services/overview.service.ts
  • apps/api/src/analytics/services/analytics.service.ts
  • apps/api/src/api-key/api-key.service.ts
  • apps/api/src/app.module.ts
  • apps/api/src/app.service.spec.ts
  • apps/api/src/app.service.ts
  • apps/api/src/audit/decorators/audit.decorator.ts
  • apps/api/src/audit/dto/create-audit-log.dto.ts
  • apps/api/src/audit/enums/audit-action.enum.ts
  • apps/api/src/audit/enums/audit-target.enum.ts
  • apps/api/src/audit/interceptors/audit.interceptor.spec.ts
  • apps/api/src/audit/interceptors/audit.interceptor.ts
  • apps/api/src/auth/api-key.strategy.spec.ts
  • apps/api/src/auth/api-key.strategy.ts
  • apps/api/src/auth/auth.module.spec.ts
  • apps/api/src/auth/auth.module.ts
  • apps/api/src/auth/jwt.strategy.spec.ts
  • apps/api/src/auth/jwt.strategy.ts
  • apps/api/src/auth/or.guard.ts
  • apps/api/src/auth/system-action.guard.spec.ts
  • apps/api/src/box-telemetry/dto/trace-span.dto.ts
  • apps/api/src/box/box.module.ts
  • apps/api/src/box/constants/box-events.constants.ts
  • apps/api/src/box/constants/snapshot-events.ts
  • apps/api/src/box/controllers/box.controller.ts
  • apps/api/src/box/controllers/runner.controller.ts
  • apps/api/src/box/controllers/snapshot.controller.ts
  • apps/api/src/box/controllers/workspace.deprecated.controller.ts
  • apps/api/src/box/dto/box-lifecycle.dto.spec.ts
  • apps/api/src/box/dto/box.dto.spec.ts
  • apps/api/src/box/dto/box.dto.ts
  • apps/api/src/box/dto/build-info.dto.ts
  • apps/api/src/box/dto/create-box.dto.ts
  • apps/api/src/box/dto/create-build-info.dto.ts
  • apps/api/src/box/dto/create-snapshot.dto.ts
  • apps/api/src/box/dto/create-workspace.deprecated.dto.ts
  • apps/api/src/box/dto/job-type-map.dto.ts
  • apps/api/src/box/dto/job.dto.ts
  • apps/api/src/box/dto/list-boxes-query.dto.ts
  • apps/api/src/box/dto/list-snapshots-query.dto.ts
  • apps/api/src/box/dto/paginated-snapshots.dto.ts
  • apps/api/src/box/dto/registry-push-access-dto.ts
  • apps/api/src/box/dto/runner-health.dto.ts
  • apps/api/src/box/dto/runner-snapshot.dto.ts
  • apps/api/src/box/dto/runner-status.dto.ts
  • apps/api/src/box/dto/runner.dto.ts
  • apps/api/src/box/dto/snapshot.dto.ts
  • apps/api/src/box/dto/update-box-state.dto.ts
  • apps/api/src/box/dto/update-snapshot.dto.ts
  • apps/api/src/box/dto/workspace.deprecated.dto.ts
  • apps/api/src/box/entities/box.entity.spec.ts
  • apps/api/src/box/entities/box.entity.ts
  • apps/api/src/box/entities/build-info.entity.ts
  • apps/api/src/box/entities/runner.entity.ts
  • apps/api/src/box/entities/snapshot-region.entity.ts
  • apps/api/src/box/entities/snapshot-runner.entity.ts
  • apps/api/src/box/entities/snapshot.entity.ts
  • apps/api/src/box/entities/warm-pool.entity.spec.ts
  • apps/api/src/box/entities/warm-pool.entity.ts
  • apps/api/src/box/enums/backup-state.enum.ts
  • apps/api/src/box/enums/box-desired-state.enum.ts
  • apps/api/src/box/enums/box-state.enum.ts
  • apps/api/src/box/enums/job-type.enum.ts
  • apps/api/src/box/enums/resource-type.enum.ts
  • apps/api/src/box/enums/snapshot-runner-state.enum.ts
  • apps/api/src/box/enums/snapshot-state.enum.ts
  • apps/api/src/box/errors/snapshot-state-error.ts
  • apps/api/src/box/events/box-backup-created.event.ts
  • apps/api/src/box/events/snapshot-activated.event.ts
  • apps/api/src/box/events/snapshot-created.event.ts
  • apps/api/src/box/events/snapshot-removed.event.ts
  • apps/api/src/box/events/snapshot-state-updated.event.ts
  • apps/api/src/box/guards/snapshot-access.guard.ts
  • apps/api/src/box/guards/snapshot-read-access.guard.ts
  • apps/api/src/box/managers/backup.manager.ts
  • apps/api/src/box/managers/box-actions/box-archive.action.ts
  • apps/api/src/box/managers/box-actions/box-destroy.action.ts
  • apps/api/src/box/managers/box-actions/box-start.action.spec.ts
  • apps/api/src/box/managers/box-actions/box-start.action.ts
  • apps/api/src/box/managers/box-actions/box-stop.action.ts
  • apps/api/src/box/managers/box-actions/box.action.ts
  • apps/api/src/box/managers/box.manager.ts
  • apps/api/src/box/managers/snapshot.manager.ts
  • apps/api/src/box/proxy/log-proxy.ts
  • apps/api/src/box/repositories/box.repository.ts
  • apps/api/src/box/runner-adapter/runnerAdapter.ts
  • apps/api/src/box/runner-adapter/runnerAdapter.v0.ts
  • apps/api/src/box/runner-adapter/runnerAdapter.v2.ts
  • apps/api/src/box/services/box-lookup-cache-invalidation.service.ts
  • apps/api/src/box/services/box-state-waiter.service.ts
  • apps/api/src/box/services/box-warm-pool.service.ts
  • apps/api/src/box/services/box.service.box-id.spec.ts
  • apps/api/src/box/services/box.service.ts
  • apps/api/src/box/services/job-state-handler.service.ts
  • apps/api/src/box/services/job.service.ts
  • apps/api/src/box/services/runner.service.ts
  • apps/api/src/box/services/snapshot.service.ts
  • apps/api/src/box/services/volume.service.ts
  • apps/api/src/box/subscribers/snapshot.subscriber.ts
  • apps/api/src/box/utils/box-id.util.spec.ts
  • apps/api/src/box/utils/box-id.util.ts
  • apps/api/src/box/utils/box-lookup-cache.util.ts
  • apps/api/src/box/utils/snapshot-ref.util.spec.ts
  • apps/api/src/box/utils/snapshot-ref.util.ts
  • apps/api/src/boxlite-rest/boxlite-box.controller.ts
  • apps/api/src/boxlite-rest/boxlite-me.controller.spec.ts
  • apps/api/src/boxlite-rest/boxlite-me.controller.ts
  • apps/api/src/boxlite-rest/boxlite-proxy.controller.spec.ts
  • apps/api/src/boxlite-rest/boxlite-proxy.controller.ts
  • apps/api/src/boxlite-rest/boxlite-rest-routing.spec.ts
  • apps/api/src/boxlite-rest/boxlite-ws-proxy.service.spec.ts
  • apps/api/src/boxlite-rest/boxlite-ws-proxy.service.ts
  • apps/api/src/boxlite-rest/dto/box-response.dto.ts
  • apps/api/src/boxlite-rest/dto/exec.dto.ts
  • apps/api/src/boxlite-rest/mappers/box-to-box.mapper.spec.ts
  • apps/api/src/boxlite-rest/mappers/box-to-box.mapper.ts
  • apps/api/src/common/constants/error-messages.ts
  • apps/api/src/common/dto/url.dto.ts
  • apps/api/src/common/guards/authenticated-rate-limit.guard.ts
  • apps/api/src/common/interfaces/runner-context.interface.ts
  • apps/api/src/common/utils/docker-image.util.spec.ts
  • apps/api/src/common/utils/docker-image.util.ts
  • apps/api/src/config/configuration.ts
  • apps/api/src/config/dto/configuration.dto.ts
  • apps/api/src/config/typed-config.service.spec.ts
  • apps/api/src/config/typed-config.service.ts
  • apps/api/src/docker-registry/controllers/docker-registry.controller.ts
  • apps/api/src/docker-registry/decorators/docker-registry.decorator.ts
  • apps/api/src/docker-registry/docker-registry.module.ts
  • apps/api/src/docker-registry/dto/create-docker-registry-internal.dto.ts
  • apps/api/src/docker-registry/dto/create-docker-registry.dto.ts
  • apps/api/src/docker-registry/dto/docker-registry.dto.ts
  • apps/api/src/docker-registry/dto/update-docker-registry.dto.ts
  • apps/api/src/docker-registry/entities/docker-registry.entity.ts
  • apps/api/src/docker-registry/enums/registry-type.enum.ts
  • apps/api/src/docker-registry/guards/docker-registry-access.guard.ts
  • apps/api/src/docker-registry/providers/docker-registry.provider.interface.ts
  • apps/api/src/docker-registry/providers/docker-registry.provider.ts
  • apps/api/src/docker-registry/providers/mock-docker-registry.provider.ts
  • apps/api/src/docker-registry/services/docker-registry.service.ts
  • apps/api/src/generate-openapi.ts
  • apps/api/src/interceptors/metrics.interceptor.ts
  • apps/api/src/interceptors/observability-context.interceptor.spec.ts
  • apps/api/src/interceptors/observability-context.interceptor.ts
  • apps/api/src/main.ts
  • apps/api/src/migrations/1741088883002-migration.ts
  • apps/api/src/migrations/1753100751731-migration.ts
  • apps/api/src/migrations/default-organization-membership.migration.spec.ts
  • apps/api/src/migrations/post-deploy/1780200000000-migration.ts
  • apps/api/src/migrations/post-deploy/1780531200000-migration.ts
  • apps/api/src/migrations/post-deploy/1780999000000-migration.ts
  • apps/api/src/migrations/post-deploy/1781000000000-migration.ts
  • apps/api/src/migrations/post-deploy/1781100000000-migration.ts
  • apps/api/src/migrations/post-deploy/1781200000000-migration.ts
  • apps/api/src/migrations/pre-deploy/1780600000000-migration.ts
  • apps/api/src/migrations/pre-deploy/1780912800000-migration.ts
  • apps/api/src/notification/emitters/notification-redis.emitter.ts
  • apps/api/src/notification/gateways/notification-emitter.abstract.ts
  • apps/api/src/notification/gateways/notification.gateway.ts
  • apps/api/src/notification/services/notification.service.ts
  • apps/api/src/openapi-webhooks.ts
  • apps/api/src/organization/constants/box-states-consuming-compute.constant.ts
  • apps/api/src/organization/constants/box-states-consuming-disk.constant.ts
  • apps/api/src/organization/constants/global-organization-roles.constant.ts
  • apps/api/src/organization/constants/organization-events.constant.ts
  • apps/api/src/organization/constants/snapshot-states-consuming-resources.constant.ts
  • apps/api/src/organization/constants/volume-states-consuming-resources.constant.ts
  • apps/api/src/organization/controllers/organization-region.controller.ts
  • apps/api/src/organization/controllers/organization.controller.ts
  • apps/api/src/organization/dto/box-usage-overview-internal.dto.ts
  • apps/api/src/organization/dto/create-organization-quota.dto.ts
  • apps/api/src/organization/dto/organization-usage-overview.dto.ts
  • apps/api/src/organization/dto/organization-user.dto.ts
  • apps/api/src/organization/dto/organization.dto.ts
  • apps/api/src/organization/dto/region-quota.dto.ts
  • apps/api/src/organization/dto/snapshot-usage-overview-internal.dto.ts
  • apps/api/src/organization/dto/update-organization-name.dto.ts
  • apps/api/src/organization/dto/update-organization-quota.dto.ts
  • apps/api/src/organization/dto/update-organization-region-quota.dto.ts
  • apps/api/src/organization/dto/volume-usage-overview-internal.dto.ts
  • apps/api/src/organization/entities/organization-user.entity.ts
  • apps/api/src/organization/entities/organization.entity.ts
  • apps/api/src/organization/entities/region-quota.entity.ts
  • apps/api/src/organization/enums/organization-resource-permission.enum.ts
  • apps/api/src/organization/events/organization-suspended-snapshot-deactivated.event.ts
  • apps/api/src/organization/guards/organization-access.guard.spec.ts
  • apps/api/src/organization/guards/organization-access.guard.ts
  • apps/api/src/organization/guards/organization-resource-action.guard.spec.ts
  • apps/api/src/organization/guards/organization-resource-action.guard.ts
  • apps/api/src/organization/helpers/organization-usage.helper.ts
  • apps/api/src/organization/organization.module.ts
  • apps/api/src/organization/services/default-organization-membership.spec.ts
  • apps/api/src/organization/services/organization-invitation.service.ts
  • apps/api/src/organization/services/organization-usage.service.ts
  • apps/api/src/organization/services/organization-user.service.ts
  • apps/api/src/organization/services/organization.service.ts
  • apps/api/src/region/constants/region-events.constant.ts
  • apps/api/src/region/dto/create-region-internal.dto.ts
  • apps/api/src/region/dto/create-region.dto.ts
  • apps/api/src/region/dto/region.dto.ts
  • apps/api/src/region/dto/snapshot-manager-credentials.dto.ts
  • apps/api/src/region/dto/update-region.dto.ts
  • apps/api/src/region/entities/region.entity.ts
  • apps/api/src/region/events/region-created.event.ts
  • apps/api/src/region/events/region-snapshot-manager-creds.event.ts
  • apps/api/src/region/region.module.ts
  • apps/api/src/region/services/region.service.ts
  • apps/api/src/tracing.ts
  • apps/api/src/usage/entities/box-usage-period-archive.entity.ts
  • apps/api/src/usage/entities/box-usage-period.entity.ts
  • apps/api/src/usage/services/usage.service.ts
  • apps/api/src/usage/usage.module.ts
  • apps/api/src/user/dto/create-user.dto.ts
  • apps/api/src/user/events/user-created.event.ts
  • apps/api/src/user/user.controller.ts
  • apps/api/src/user/user.service.default-organization-compat.spec.ts
  • apps/api/src/user/user.service.ts
  • apps/api/src/webhook/constants/webhook-events.constants.ts
  • apps/api/src/webhook/dto/webhook-event-payloads.dto.ts
  • apps/api/src/webhook/services/webhook-event-handler.service.ts
  • apps/api/webpack.config.js
  • apps/cli/cmd/box/archive.go
  • apps/cli/cmd/box/box.go
  • apps/cli/cmd/box/create.go
  • apps/cli/cmd/common/box.go
  • apps/cli/cmd/common/logs.go
  • apps/cli/cmd/common/state.go
  • apps/cli/cmd/common/validate.go
  • apps/cli/cmd/snapshot/create.go
  • apps/cli/cmd/snapshot/delete.go
  • apps/cli/cmd/snapshot/list.go
  • apps/cli/cmd/snapshot/push.go
  • apps/cli/cmd/snapshot/snapshot.go
  • apps/cli/docs/boxlite.md
  • apps/cli/docs/boxlite_archive.md
  • apps/cli/docs/boxlite_create.md
  • apps/cli/hack/docs/boxlite.yaml
  • apps/cli/hack/docs/boxlite_archive.yaml
  • apps/cli/hack/docs/boxlite_create.yaml
  • apps/cli/main.go
  • apps/cli/mcp/README.md
  • apps/cli/mcp/tools/create_box.go
  • apps/cli/views/box/info.go
  • apps/cli/views/snapshot/info.go
  • apps/cli/views/snapshot/list.go
  • apps/cli/views/util/empty_list.go
  • apps/daemon/cmd/daemon/config/config.go
  • apps/daemon/cmd/daemon/main.go
  • apps/daemon/pkg/toolbox/controller.go
  • apps/daemon/pkg/toolbox/server.go
  • apps/daemon/pkg/toolbox/telemetry.go
  • apps/daemon/pkg/toolbox/telemetry_traceparent_test.go
  • apps/dashboard/project.json
  • apps/dashboard/src/App.tsx
  • apps/dashboard/src/api/apiClient.ts
  • apps/dashboard/src/assets/Logo.tsx
  • apps/dashboard/src/components/ApiKeyTable.tsx
  • apps/dashboard/src/components/Box/CreateBoxSheet.tsx
  • apps/dashboard/src/components/BoxDetailsSheet.tsx
  • apps/dashboard/src/components/BoxTable/BoxTableActions.tsx
  • apps/dashboard/src/components/BoxTable/BoxTableHeader.tsx
  • apps/dashboard/src/components/BoxTable/BulkActionAlertDialog.tsx
  • apps/dashboard/src/components/BoxTable/columns.tsx
  • apps/dashboard/src/components/BoxTable/constants.ts
  • apps/dashboard/src/components/BoxTable/filters/SnapshotFilter.tsx
  • apps/dashboard/src/components/BoxTable/index.tsx
  • apps/dashboard/src/components/BoxTable/state-icons.tsx
  • apps/dashboard/src/components/BoxTable/types.ts
  • apps/dashboard/src/components/BoxTable/useBoxCommands.tsx
  • apps/dashboard/src/components/BoxTable/useBoxTable.ts
  • apps/dashboard/src/components/CodeBlock.tsx

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@law-chain-hot

Copy link
Copy Markdown
Contributor Author

Work log — convergence + snapshot/image-subsystem removal

Recording what this branch did, in order, so reviewers can split it cleanly. Head e4ae917c; pre-deletion state preserved at tag pre-image-rewrite (9b212791).

1. Convergence merge (4e93e90a)

Merged the three outstanding lines (MVP-integrated + A2 snapshot-manager-deletion overnight + Task12B observability) onto post-#706 main. 527 conflicts resolved by policy:

2. Generated clients excluded (f9ea0730)

api-client, runner-api-client, api-client-go, toolbox/analytics, swaggo docs reset to mainzero generated-client diff. Upstream regenerates against the merged API surface. (Now reconciled with #716/#718 which regenerated on main.)

3. Snapshot-manager residual purge (80c5e6b0)

Deleted 14 dead files the merge reintroduced from main's side (snapshot/backup DTOs, entities, enums, guards, archive action). Also removed the region self-hosted-registry credential machinery (artifact-registry creds endpoint/event/DTO + dashboard usage).

4. Image subsystem removal (fbf99d94) — the main event

Removed the inherited Daytona-fork image-management (box_template + runner_artifact_cache) so it can be rebuilt the team's own way. Box image-pull/boot is intentionally non-functional until the rebuild PR.

  • Deleted (45): box-template.* (entity/dto/service/controller/events/guards/enum/subscriber/constants), runner-artifact-cache.* (entity/dto/enum), RuntimeArtifactManager, runtime-artifact-state-error, the whole dashboard templates UI, template-states-consuming-resources.constant.ts
  • Gutted (49): box.entity (template field+index), box.service (image resolution), box-start.action (pull/schedule state machine → ERROR stub), runner.service/controller, job-state-handler, warm-pool, runnerAdapter (pullArtifact/getArtifactInfo), notifications/webhooks (box_template events), metrics/openapi, org-usage billing (template metering → 0, TODO(billing-rewrite)), dashboard create/playground/routes

5. Re-sync with main (35d91180, e4ae917c)

Re-merged origin/main twice (it advanced with #713 eslint fix, #716 client regen, #717 deps, #718 cobra docs). Resolved: regen tooling/lock/project.json → main's side; boxlite-box.controller swagger import → union (ApiResponse + ApiExcludeController); CLI generated docs → our command set (archive stays removed).

What is intact vs broken

Intact Broken (rebuild next PR)
box entity core, list/delete, org/user/region/volume/ssh/auth, non-template notifications box create/boot (no image resolution), templates page, template-based usage metering, template webhooks

Notes for the rebuild PR

  • pre-image-rewrite tag holds the old implementation — git show pre-image-rewrite:<file> to reference.
  • Migration 1781200000000 still CREATEs empty box_template + runner_artifact_cache tables (entities deleted). Fresh DB gets the table shells; rebuild only needs to re-add entities/services (or amend that migration).
  • Two dead-but-compiling methods left (assignWarmPoolBox, fetchWarmPoolBox) — clean up with the warm-pool rebuild.
  • BoxDto.template kept optional pending client regen.

Verification

Zero dangling references to deleted symbols; zero conflict markers; migrations (except A2's own) and generated clients untouched by the deletion. Could not run tsc locally (no node_modules) — type/compile errors surface in CI by design (red-then-fix).

Replaces the 60-commit branch history (previous head 748d874) with a
single commit of the net apps/ diff rebased onto main @ e526b6c.
Resolves apps/eslint.config.mjs by keeping both the .nx (main) and
.sst (branch) ignore entries.

Co-authored-by: Brian Luo <57960778+law-chain-hot@users.noreply.github.com>
Co-authored-by: BrianL <ianloe666@gmail.com>
Signed-off-by: dorianzheng <xingzhengde72@gmail.com>
@DorianZheng DorianZheng force-pushed the codex/super-pr-converge branch from 748d874 to 623a043 Compare June 10, 2026 07:56
Symmetric to the API-side image-subsystem removal: the runner no longer
receives PULL/REMOVE/INSPECT_ARTIFACT jobs, so these handlers are dead code,
and boxlite/registry.go carried the self-hosted-registry mirroring logic that
the team is retiring. Box create/start/stop/destroy lifecycle is untouched;
image-pull/boot stays intentionally non-functional until the rebuild PR.

Deleted (5): executor/artifact.go, api/controllers/artifact.go,
cache/artifact_error_cache.go, api/dto/{snapshot,image}.go.
Gutted (11): executor dispatch cases, backend interface+adapter image methods,
boxlite/{registry,client,stubs}.go (mirroring/pull helpers; kept registry-host
normalizers used by box create), api/server.go artifact routes, runner.go +
cmd wiring (ArtifactErrorCache).

apps/libs + api-client-go (generated, JobType enum) untouched. Pre-existing
boxlite.WithPort build gap (sdks/go binding, apps-only worktree) is unrelated.
@law-chain-hot

Copy link
Copy Markdown
Contributor Author

Summary — what this PR removes (SnapshotManager + inherited image management)

This PR strips the inherited Daytona-fork image-management stack down to the studs so it can be rebuilt the team's own way. Box image-pull/boot is intentionally non-functional until the rebuild PR; box CRUD and all non-image subsystems stay intact. Pre-deletion state is preserved at tag pre-image-rewrite.

Verified end state: zero live references to SnapshotManager / BoxTemplate / RunnerArtifactCache across api, dashboard, and runner.

Three layers removed

1. Self-hosted image infrastructure (SnapshotManager)

  • apps/snapshot-manager/ — the self-hosted OCI Docker registry Go service
  • apps/api/src/docker-registry/ — API-side registry management + DTOs/entities
  • snapshot / build_info / backup entities, DTOs, events, guards (build + backup were dead stubs)
  • region self-hosted-registry credential machinery (regenerate-artifact-registry-credentials endpoint/event/DTO + dashboard UI)
  • SnapshotManager service removed from sst.config.ts

2. Inherited image management (box_template + pull ledger)

  • box_template entity / service / controller / DTOs / events / guards / enum / subscriber — the image catalog
  • runner_artifact_cache entity / DTO / enum — the per-runner pull ledger
  • RuntimeArtifactManager (6 cron jobs) — image/template lifecycle sync
  • dashboard templates UI (Templates page, TemplateTable, template mutations/queries)
  • billing/usage: template-based metering removed (→ 0, TODO(billing-rewrite))

3. Runner-side pull layer (symmetric removal)

  • executor/artifact.go — PULL/REMOVE/INSPECT_ARTIFACT job handlers
  • boxlite/registry.go registry-mirroring logic (the self-hosted-registry copy path)
  • cache/artifact_error_cache.go + backend image methods (PullArtifact/GetImageInfo/…)
  • api/controllers/artifact.go + routes

Kept intact

  • Box entity core, list/get/delete, org/user/region/volume/ssh/auth, non-template notifications
  • Migrations (history untouched; A2's new migrations retained)
  • Generated clients (api-client, runner-api-client, api-client-go) — regenerated upstream
  • Runner box lifecycle (create/start/stop/destroy job handlers)
  • registry-host normalizers used by box create (only the mirroring path was cut)

Resulting breakage (accepted — rebuild next PR)

Box create/boot (no image resolution), templates page, image-based usage metering, template webhooks, runner image pull.

Notes for the rebuild PR

  • git show pre-image-rewrite:<file> to reference the old implementation.
  • Migration 1781200000000 still CREATEs empty box_template + runner_artifact_cache table shells — rebuild only needs to re-add entities/services (or amend that migration).
  • BoxDto.template kept optional pending client regen.
  • Two dead-but-compiling methods left (assignWarmPoolBox, fetchWarmPoolBox) — clean up with the warm-pool rebuild.
  • Pre-existing boxlite.WithPort build gap (sdks/go binding absent in this apps-only worktree) is unrelated to these deletions.

Verification

Zero dangling references to deleted symbols; zero conflict markers; migrations and generated clients untouched by the deletion. Local tsc/go build not fully runnable in this worktree — type/compile errors surface in CI by design (red-then-fix).

Both have zero references anywhere in api/dashboard/openapi:
- runner-status.dto.ts: runners report via RunnerHealthcheckDto, not this
- registry-push-access-dto.ts: self-hosted-registry push credentials, dead
  with the SnapshotManager removal

Verified not used as nested field types either (unlike RunnerHealthMetricsDto /
BoxInfoDto, which are kept).
Zero references anywhere (api/dashboard/openapi/generated):
- exec.dto.ts (ExecRequestDto/ExecResponseDto): unused by boxlite-rest exec
- url.dto.ts (UrlDto): standalone class dead; live hits were *UrlDto substrings
- create-audit-log.dto.ts (CreateAuditLogDto): superseded by CreateAuditLogInternalDto
The 'images cached on runner' metric is meaningless after the image subsystem
removal. Removed the field (+ its deprecated currentSnapshotCount alias) across
the runner status/metrics chain: API DTOs (runner/runner-health), runner-adapter,
runner.service mapping, runner.entity column (fresh DB, no migration), admin spec;
and the Go source: metrics collector (incl. the now-dead ListImages call),
healthcheck reporter, runner info DTO/controller.

RunnerDto and all other runner fields (cpu/mem/disk/alloc/status/version) intact.
Generated docs.go + migrations untouched.
Admin observability module (new in Task12B) was authored pre-boxlite-ai#706 and never
renamed: broken imports (sandbox-telemetry/, sandbox/ paths) + queried the
wrong sandbox- service prefix / boxlite.sandbox_id while the daemon already
emits box-<id>. Renamed emitter + consumer in lockstep so new data is fully box:

- daemon: trace tracer scope boxlite.sandbox -> boxlite.box
- api interceptor: consolidate to { keys:[boxId,boxIdOrName], attr:boxlite.box_id }
- admin (11 files): symbols (SandboxState->BoxState, sandboxId->boxId), broken
  import paths -> box*, wire strings sandbox-/boxlite.sandbox_id -> box-/boxlite.box_id
- box-telemetry trace-span doc example sandbox-<id> -> box-<id>

Old ClickHouse data (sandbox-keyed) is disposable per decision; no CH schema
change (attribute keys are Map values). Fixed two latent boxlite-ai#706 bugs in passing
(currentStartedSandboxes->currentStartedBoxes, /admin/sandbox->/admin/box).

Left intentionally sandbox: box.manager raw SQL (frozen sandbox DB table/column),
PostHog product-analytics event names (separate system, pending decision).
…backup)

Finish removing the deleted image-management system across all 5 subsystems.
Box image-pull/boot stays intentionally dead until the rebuild PR.

API: drop templateId from create-box DTO/controllers/mappers; delete
system-templates + resolveSystemTemplateId; remove template event/quota;
gut runnerAdapter v0/v2 (artifactRef/removeArtifact/inspectArtifactInRegistry/
RunnerArtifactInfo/snapshot:box.template); remove BoxState.PULLING_ARTIFACT.
CLI: delete cmd/snapshot + views/snapshot dirs + registration; drop --template.
Dashboard: drop templateId from CreateBoxSheet/PlaygroundProvider/code-snippets;
remove useCreateSandboxFromTemplateMutation.
Runner: delete backup_info(+cache), GetBuildLogFilePath (dead build-system code);
remove PULLING_ARTIFACT/backup residue.
Proxy: drop template/build target routing.

KEPT (boxlite-internal boundary, per scope): runner CreateBoxDTO.ArtifactRef ->
runtime.Create(imageRef) — the minimal 'boot this image' interface the runtime
needs. DB-frozen names (sandbox table/column/enum, JobType enum) and email/
code-snippet templates untouched. sdks/ + src/ (Rust runtime) untouched.

19 files deleted, 49 gutted.
The convergence merge (623a043) left apps/api internally inconsistent: some
files used pre-boxlite-ai#706 'sandbox' naming while the enums/constants they reference
were already 'box' on main (and vice-versa) -> 65 compile errors. main is the
authoritative box-consistent version.

Renamed identifiers to box (NOT wholesale checkout from main, which would
re-introduce the deleted image system): AuditTarget.SANDBOX->BOX,
WRITE/DELETE_SANDBOXES->WRITE/DELETE_BOXES, SANDBOX_EVENT_CHANNEL->BOX_EVENT_CHANNEL,
SANDBOX_STATES_CONSUMING_*->BOX_*, SANDBOX_SORT_*->BOX_*, SANDBOX_WARM_POOL_*->BOX_*,
SANDBOXES_ADMIN->BOXES_ADMIN (UUID unchanged), plus duplicate-field merge artifacts
in box-lookup-cache-invalidation + box.repository.

Frozen (kept sandbox, matches main): DB entity/column/enum/index, raw SQL aliases,
PostHog event names, JobType enum values. Image/snapshot deletion untouched.

api tsc: 65 -> 0 errors. 16 files.
The convergence merge (623a043) regressed nearly all of apps code from main's
post-boxlite-ai#706 box naming back to pre-boxlite-ai#706 sandbox. main's non-migration code has
ZERO sandbox (verified) -- it is the authoritative all-box version. This branch
had 834 sandbox in apps/api/src alone (JobType.CREATE_SANDBOX vs main's
CREATE_BOX, @Index('sandbox_*') vs box_*, etc.).

Applied sandbox->box codemod across all apps source to match main, keeping image
deletion intact (rename only, no content from main):
- apps/api (834->0), apps/dashboard (115->0), apps/libs/sdk-typescript (2->0)
- apps/cli (25->0), apps/runner (88->0), apps/daemon (5->0), apps/infra (3->0)
- fixed codemod duplicate-property collisions (sandboxId+boxId -> boxId) in admin
  observability dashboard hooks
- @entity('box') restored to match main

Verified: api tsc 0 errors; cli/daemon go build clean; runner only the pre-existing
boxlite.WithPort gap; dashboard remaining errors are module-resolution (generated
clients not linked in this worktree, 272->244 pre/post codemod). Migrations and
generated clients untouched. No image/snapshot symbols reintroduced.
Filenames lagged the content rename. main has these as box; renamed:
- apps/dashboard/src/lib/sandbox-identity.ts -> box-identity.ts
  (fixes ~12 dashboard 'Cannot find module @/lib/box-identity' errors -- code
  already imported box-identity)
- 5 api spec files: sandbox{.dto,-lifecycle.dto,-start.action,.service.box-id,
  -to-box.mapper}.spec.ts -> box*.spec.ts

KEPT as sandbox (OS-isolation primitive, frozen, main keeps too):
src/boxlite/src/jailer/sandbox/*.rs, docs/guides/macos-sandbox-debugging.md.

dashboard tsc 244 -> 232 (remaining are generated-client module-resolution, env).
# Conflicts:
#	apps/dashboard/src/components/Sidebar.tsx
#	apps/dashboard/src/pages/Onboarding.tsx
Finish the image-system deletion in the parts the earlier pass missed:
- DELETE: organization/dto/template-usage-overview-internal.dto.ts, sdk-typescript/Template.ts
- GUT (template billing): organization-usage.service/helper, organization-usage-overview.dto,
  create-organization-quota.dto (templateQuota), organization.entity (templateQuota column),
  organization-events.constant (SUSPENDED_TEMPLATE_DEACTIVATED), organization.controller/service,
  app.service, configuration (dead templateQuota keys)
- GUT (SDK): index.ts + BoxLite.ts (TemplateService + TemplatesApi + .template accessor)
- GUT (CLI): box/create.go + mcp/create_box.go (--snapshot flag, SetSnapshot, BUILDING_SNAPSHOT)

False positives KEPT (React snapshot, exec backlog snapshot, CPU/VM snapshot, metrics.interceptor TODOs).
api/src tsc 0; cli go build clean. Migrations/generated clients untouched.
Remove the entire billing vertical from apps/api:
- DELETE (17): usage/ module (usage.service, box-usage-period{,-archive}.entity,
  usage.module), organization-usage.service+helper, 7 usage/quota DTOs,
  region-quota.entity, 3 box/volume-states-consuming-* constants
- GUT (20): app.module/organization.module (UsageModule/RegionQuota),
  organization.service/controller (updateQuota/usage endpoints + quota columns),
  box.service/volume.service/job-state-handler (usage tracking + quota checks),
  metrics.interceptor (quota capture), configuration (quota/defaultTemplate keys),
  app.service (admin quota seed), audit enums (UPDATE_QUOTA/TEMPLATE), user chain
  (defaultOrganizationQuota), app.service.spec (stale quota assertion)

Verified: api/src tsc 0, api spec tsc 0, cli/daemon go build clean.
No snapshot/template (api/src=0), no sandbox except OS-isolation jailer (api/src=0),
no billing system (api/src=0). Migrations/generated clients untouched.

Kept: Region.enforceQuotas flag + external billingApiUrl config (not the usage
module). Dashboard create-flow templateName left — it's the image-selection state
machine, part of the dashboard image rebuild (dashboard has 103 pre-existing
mid-rebuild errors, not compilable in this worktree regardless).
The convergence merge updated apps/package.json but apps/yarn.lock was
left stale. CI runs `yarn install --immutable` (and plain `yarn install`
is immutable under CI=true), so both the API-client-drift and E2E-stack
jobs aborted at install with YN0028 before running anything.

Regenerated via `yarn install --mode=update-lockfile`; `yarn install
--immutable` now passes. Only the lockfile changed.

@DorianZheng DorianZheng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@DorianZheng DorianZheng merged commit 577f4a5 into boxlite-ai:main Jun 10, 2026
21 of 23 checks passed
DorianZheng added a commit that referenced this pull request Jun 10, 2026
…follow-up) (#726)

## What

Regenerates the committed API clients against the post-#715 (merged A2 +
MVP) API surface — the follow-up that #715's merge commit explicitly
deferred:

> ⚠️ **CI will be red until generated clients are regenerated** against
the merged API surface … **Generated clients now carry ZERO diff in this
PR** (reset to main in `f9ea0730`) — regenerate upstream against the
merged API surface.

Since that merge, the **API client drift** check fails on every PR
touching `apps/**` (e.g. #725's run 8 minutes after the merge). This PR
turns it green again.

## Content

**Commit 2 — the regen (`apps/libs/api-client`, `apps/api-client-go`,
231 files).** Pure `openapi-generator` 7.23.0 output, zero hand edits,
produced with the exact `api-client-drift.yml` recipe (pinned generator
via `openapitools.json`, NestJS spec boot with local Redis, GNU sed for
the postprocess script). `analytics-api-client` and `toolbox-api-client`
regenerated to **zero diff** (already current since #721/#723).

Surface delta (mirrors the A2 + MVP API changes):
- **removed:** snapshots / docker-registry / build / backup /
archive-lifecycle / quota / usage-overview endpoints and models;
`BoxState` build states (`pending_build`, `build_failed`, …);
`write:snapshots` + `delete:snapshots` permission values;
`listBoxesPaginated`'s `snapshots` filter param
- **added:** `SystemRole`, `UpdateOrganizationName` (+ `PATCH
/organizations/{organizationId}/name`), admin overview/observability
models

**Commit 1 — prek lint unblock (34 deleted lines, dashboard).** The
Sandbox→Box rename left `LEGACY_*` route enum members byte-identical to
the canonical ones — 4 pre-existing
`@typescript-eslint/no-duplicate-enum-values` errors at HEAD that fail
the repo's prek pre-commit hook (`make lint:fix`) for *every* local
commit. The legacy routes are unreachable (identical paths, canonical
registrations precede them), so this deletes them plus the orphaned
`LegacyBoxRedirect`. No behavior change. Included here because nothing
can be committed locally until it lands.

## Verification

- `go build ./...` passes in `apps/api-client-go` (standalone),
`apps/common-go`, `apps/otel-collector/exporter`.
- The **API client drift** check on this PR is the canonical
byte-for-byte proof.

## Known follow-up (intentionally split)

Per review preference, this PR is generated code only. Three consumers
still reference removed APIs and will not compile against the new
clients until the prepared follow-up PR lands (branched on top of this
one):

- `apps/cli` — Dockerfile-build flow (`CreateBuildInfo`,
`BOXSTATE_BUILD_FAILED`/`PENDING_BUILD`, `--dockerfile`/`--context`, MCP
`buildInfo` arg, `pkg/minio`)
- `apps/dashboard` — Registries page + registry hooks, usage-overview
wiring in Spending/Limits, `templates` filter arg
- `apps/libs/sdk-typescript` —
`Box.buildInfo`/`backupState`/`backupCreatedAt`, `getBuildLogsUrl`

No CI workflow compiles these consumers on PR today (the drift check is
the only `apps/**` gate), so this PR is green-mergeable; the follow-up
restores local builds. Note `apps/runner` has a **pre-existing**
unrelated compile failure on main (`boxlite.WithPort` undefined in
`pkg/boxlite`) — out of scope here.
DorianZheng added a commit that referenced this pull request Jun 10, 2026
…API clients (#727)

## What

The consumer-adaptation follow-up that #726 disclosed: makes `apps/cli`,
`apps/dashboard`, and `apps/libs/sdk-typescript` compile against the
regenerated API clients by removing code whose server-side API was
deleted in the A2+MVP merge (#715). 52 files, +115/−3063 — almost
entirely deletions.

## cli

- Deletes the Dockerfile-build flow: `--dockerfile`/`-f` and
`--context`/`-c` flags on `boxlite create`, `CreateBuildInfo`
construction (`cmd/common/build.go` with its Dockerfile parsing + MinIO
context upload), build-log streaming (`cmd/common/logs.go`, hit the
removed `/build-logs` endpoint), the MCP `create_box` `buildInfo`
argument, and `pkg/minio` (its only consumer was the build flow; `go mod
tidy` drops the dependency).
- Drops `BOXSTATE_BUILD_FAILED` / `BOXSTATE_PENDING_BUILD` handling
(states removed from the enum).
- Regenerates cobra docs via `hack/generate-cli-docs.sh` — also clears
stale `boxlite snapshot` docs left from the super PR.

## dashboard

- Deletes the **Registries** page, `RegistryTable`, the 4 registry
hooks, its route enum + hidden-routes entry, and `apiClient.ts` wiring
(`DockerRegistryApi` was removed). The page was already in
`HIDDEN_DASHBOARD_ROUTES`.
- Removes the **usage-overview** wiring (`getOrganizationUsageOverview`
removed with no successor): the
`UsageOverview`/`UsageOverviewIndicator`/`LimitUsageChart` components,
the quota-driven usage timeline chart (its "percent of quota" mode is
built on the deleted `RegionUsageOverview` quotas throughout), the hook
+ query keys + `LiveIndicator` they orphaned. **Spending and Limits keep
their billing/tier features** (wallet, cost breakdown, tier comparison,
rate limits).
- Drops the orphaned `templates` box filter (the `snapshots` query param
left `listBoxesPaginated`; nothing set the filter).

## sdk-typescript

- `Box`: drops `template`/`backupState`/`backupCreatedAt`/`buildInfo` —
fields no longer on the wire model.
- `BoxLite.create()`: the wire `CreateBox` accepts neither `buildInfo`
nor `templateId` anymore, so `create()` now **throws a clear
`BoxliteError`** when `image` or `templateId` params are provided
instead of silently dropping them. The `CreateBoxFromImageParams` type,
overload, and `Image` class stay exported (marked `@deprecated`) because
the dashboard Playground imports them — its image flow now gets an
honest runtime error (it was already broken server-side); the full
Playground rework belongs to the MVP track (`PlaygroundProvider.tsx`
already carries `TODO(image-rewrite)` markers).
- Deletes the dead `processStreamingResponse` helper (`stdDemuxStream`
stays — `Process.ts` uses it).
- **Adds guard tests** (`__tests__/BoxLite.create-guards.test.ts`) for
the two new throws, wiring the dormant jest harness to
`tsconfig.spec.json` + the workspace path aliases so it actually runs
(`yarn jest --config libs/sdk-typescript/jest.config.js`, 2/2 pass). The
asserted messages are produced only by the guards — without them the
call rejects with a network `AxiosError`.

## Verification

- `go build ./...` + `gofmt` clean in `apps/cli`; `go mod tidy` applied.
- sdk `tsconfig.lib` **and** `tsconfig.spec` typecheck clean; jest guard
tests 2/2.
- dashboard `tsc`: **216 errors vs the 232-error pre-merge baseline,
zero new** (position-normalized diff; the dashboard has never been
tsc-clean — #719 tracks that).
- `make lint:fix` exits 0 modifying nothing.
- Grep sweeps: zero remaining references to any removed client symbol
outside the generated dirs.

## Out of scope (pre-existing)

`apps/runner` fails to compile on main (`boxlite.WithPort` undefined in
`pkg/boxlite`) — fails identically at clean HEAD, unrelated to the
regen.
law-chain-hot added a commit that referenced this pull request Jun 11, 2026
- sdks/go: add WithPort so apps/runner compiles. #715 added
  boxlite.WithPort() call sites without the SDK function; the C ABI, Rust
  FFI, and runtime port-forwarding all already exist, only the Go layer was
  missing. Mirrors the WithVolume pattern; arg order (guest, host) matches
  the C ABI.
- api test: fix OrganizationService mock argument order in the
  default-org-membership spec so configService lands in the right
  constructor slot (was crashing on configService.getOrThrow). Pre-existing
  on main; verified by reproducing on a clean checkout.
G4614 added a commit that referenced this pull request Jun 11, 2026
PR #715 ("Converge A2 + MVP box journey") added call sites in
apps/runner/pkg/boxlite/{client,stubs}.go:

  opts = append(opts, boxlite.WithPort(ToolboxGuestPort, toolboxHostPort))

but didn't add WithPort to sdks/go, breaking every runner build with:

  runner/pkg/boxlite/client.go:268:30: undefined: boxlite.WithPort
  runner/pkg/boxlite/stubs.go:62:30:  undefined: boxlite.WithPort

Add a stub WithPort that records the request on a new boxConfig.ports
field. The field is currently unused — port forwarding is not plumbed
through the C FFI bridge (sdks/c has no port-mapping API), so any
WithPort call is effectively a no-op at runtime. The TODO header in
the doc-comment marks where to wire bridge.c → libkrun networking
once the C side gains the API.

This unblocks deploy-runner.yml end-to-end testing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
law-chain-hot added a commit that referenced this pull request Jun 11, 2026
- sdks/go: add WithPort so apps/runner compiles. #715 added
  boxlite.WithPort() call sites without the SDK function; the C ABI, Rust
  FFI, and runtime port-forwarding all already exist, only the Go layer was
  missing. Mirrors the WithVolume pattern; arg order (guest, host) matches
  the C ABI.
- api test: fix OrganizationService mock argument order in the
  default-org-membership spec so configService lands in the right
  constructor slot (was crashing on configService.getOrThrow). Pre-existing
  on main; verified by reproducing on a clean checkout.
law-chain-hot added a commit that referenced this pull request Jun 11, 2026
- sdks/go: add WithPort(host, guest) and PortSpec so apps/runner compiles and Go's port shape matches the Python SDK layer: host, guest, protocol, and host_ip. The C bridge still receives guest_port, host_port because that is the existing C ABI.

- api test: fix OrganizationService mock argument order in the default-org-membership spec so configService lands in the right constructor slot.
law-chain-hot added a commit that referenced this pull request Jun 11, 2026
- sdks/go: add WithPort(host, guest) so apps/runner compiles, backed by an internal portSpec whose fields mirror the Python SDK input shape: host, guest, protocol, and host_ip. The C bridge still maps this to the existing guest_port, host_port ABI.

- api test: fix OrganizationService mock argument order in the default-org-membership spec so configService lands in the right constructor slot.
law-chain-hot added a commit that referenced this pull request Jun 11, 2026
- sdks/go: add WithPort(host, guest) so apps/runner compiles. The internal portSpec mirrors Python's SDK input shape: host, guest, protocol, and host_ip; toCSpec mirrors Python's PyPortSpec -> PortSpec mapping as host_port, guest_port, protocol, and host_ip before calling the existing C ABI.

- api test: fix OrganizationService mock argument order in the default-org-membership spec so configService lands in the right constructor slot.
law-chain-hot added a commit that referenced this pull request Jun 11, 2026
- sdks/go: add WithPort so apps/runner compiles. #715 added
  boxlite.WithPort() call sites without the SDK function; the C ABI, Rust
  FFI, and runtime port-forwarding all already exist, only the Go layer was
  missing. Mirrors the WithVolume pattern; arg order (guest, host) matches
  the C ABI.
- api test: fix OrganizationService mock argument order in the
  default-org-membership spec so configService lands in the right
  constructor slot (was crashing on configService.getOrThrow). Pre-existing
  on main; verified by reproducing on a clean checkout.
G4614 added a commit to G4614/boxlite that referenced this pull request Jun 11, 2026
Adds a reusable workflow that deploys the boxlite-runner binary to the
Tokyo e2e-ci EC2 over SSH+SCP via EC2 Instance Connect, replacing the
SSM Run Command dispatch (the agent on that EC2 has been in
ConnectionLost since the original RunnerProfile was deleted out of
IAM — see commit body of the runner deploy script for the recovery
plan).

Mechanism (deploy job):
  1. ec2-instance-connect:SendSSHPublicKey — 60s ephemeral key, no
     pre-shared keypair or GHA secret needed.
  2. ec2:AuthorizeSecurityGroupIngress — temp inbound 22 from the GHA
     runner's egress IP, unconditionally revoked on exit (success or
     failure).
  3. scp tarball + ssh stop / extract / start / smoke-check the
     boxlite-runner service.

The reusable workflow accepts a `workflow_dispatch` input
`runner_artifact_run_id` so an existing artifact from a prior run can
be redeployed without rebuilding the C SDK + Go binary. Internal
`changes` job detects whether the push actually touched runner source
(against github.event.before, not the default branch) so workflow-only
commits don't trigger a 30+ min build.

sdks/go/options.go: add a no-op WithPort BoxOption + portMapping field
on boxConfig. PR boxlite-ai#715 added call sites in apps/runner/pkg/boxlite/
{client,stubs}.go that reference boxlite.WithPort, but the function
was never added to the sdks/go package — the runner build breaks on
HEAD without this stub. Port forwarding is not yet wired through the
C FFI bridge (sdks/c has no port-mapping API), so this records the
request on boxConfig and is otherwise a no-op until the bridge gets a
port-forwarding API. TODO: wire boxConfig.ports through bridge.c →
libboxlite's libkrun networking layer when that API lands.

OIDC role perms added in a separate IAM change (the role was
recreated with BoxLiteDeveloperPermissionsBoundary attached):
  ec2:AuthorizeSecurityGroupIngress / RevokeSecurityGroupIngress /
    DescribeSecurityGroupRules — scoped to sst:app=boxlite SGs
  ec2-instance-connect:SendSSHPublicKey — scoped to
    Name=boxlite-runner instances

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
pull Bot pushed a commit to CrazyForks/boxlite that referenced this pull request Jun 12, 2026
boxlite-ai#734)

## Summary
- add the Go SDK `WithPort` option required by the runner build path
after boxlite-ai#715
- update the default organization membership spec mock argument order to
match the current service call

## Verification
- pre-push `make test:changed` was triggered by the local hook and
failed in the existing macOS Go/native link test path before push
- pushed with `--no-verify` per handoff flow; CI is the source of truth
for this PR

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added configurable host↔guest port mappings (host port, guest port,
protocol, host IP).

* **Bug Fixes**
* Updated how the toolbox port is exposed between host and guest
(mapping direction corrected).

* **Tests**
* Updated tests and test helpers to reflect the new port-mapping
configuration and the adjusted toolbox mapping.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
G4614 added a commit that referenced this pull request Jun 13, 2026
waitForToolboxReady was introduced in fc88aa0 (2026-06-05,
"feat: add agent-ready runtime catalog", which then landed on main
via PR #715 on 2026-06-10). It HTTP-polls http://127.0.0.1:<hostPort>/version
expecting a daemon on guest TCP port 2280 — that interface dates from
the Daytona-daemon era and was never reimplemented after the Rust
guest agent rewrite landed in dbb11ec (2026-04-01). The new agent
binds **vsock://2695** for gRPC + notifies the host via vsock://2696;
nothing inside the VM listens on TCP:2280, so libkrun's port-forward
accepts the SYN and immediately reset-by-peer's, and every CREATE_BOX
times out 30 s in.

Production data from a Tokyo runner: in 24 h, 490 CREATE_BOX events,
0 toolbox-ready successes, 181 toolbox-ready failures. The exec path
that fires immediately afterward (via the same vsock gRPC channel)
**always succeeds** — confirming the box VM is healthy, the readiness
check itself is the bug.

Remove the dead probe: drop waitForToolboxReady from client.go's Create
and Start, drop the function + its TCP/HTTP imports, drop the
toolboxReadyTimeout field, drop the ToolboxReadyTimeout/
DaemonStartTimeoutSec config plumbing in main.go + config.go, drop
the two now-unreachable tests. Box readiness is now signalled by
bx.Start(ctx) returning (which itself blocks on the vsock notification
from the guest).

Branched off chore/e2e-required-merge-gate (PR #724) so the e2e-cloud
stack picks this up next dispatch.
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.

2 participants