Skip to content

Move sandbox reset and address bindings into deployment and deploymentpg - #332

Merged
SaladDay merged 1 commit into
mainfrom
refactor/deployment-runtime
Sep 30, 2026
Merged

SaladDay merged 1 commit into
mainfrom
refactor/deployment-runtime

Conversation

@SaladDay

@SaladDay SaladDay commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Sandbox reset and the installation address bindings move out of store into deployment and deploymentpg.

What changes

  • deployment:
    • ResetRequest, ResetAuto/ResetForce, and the deadline bounds MinResetDeadlineSeconds/MaxResetDeadlineSeconds.
    • InUseError, which unwraps to ErrConflict.
    • The reset rules, and the ExecutionOperations use cases StartReset, CancelReset, AdvanceResetDeadline and CompleteReset.
    • Reader.ResetSessions and Reader.AddressBindings.
    • Service.AddressBindings, so the public URL keeps its single home in the Service.
  • deploymentpg:
    • DeploymentTx gains the reset start, force, cancel, complete and audit-source methods. The audit source has one decoder, ResetSource.
    • AddressBindings reads both counts in one snapshot.
  • execution:
    • Every reset write runs on the lease-bound Owner.Deployment.
    • The Dispatcher.DeploymentReader field is required.
  • api:
    • The reset and installation handlers use writeDeploymentError and the deployment rule constants.
    • writeSandboxError maps InUseError to 409 sandbox_in_use.
    • writeStoreError stays as the composite (reset admission → sandbox → sessions) until the error-mapper cleanup.
  • Removed from store: sandbox_reset.go and sandboxResetAudit. Reset admission and the reset's Session archive stay in store until their own PRs.
  • OpenAPI: schemas are renamed to deployment.ResetRequest and deployment.AddressBindings, regenerated with make openapi.

Behavior

The HTTP status, code, message and details of every reset and installation route are unchanged. Reset validation now returns deployment.ErrInvalidInput, which still maps to the same 400 invalid_request. A stored reset source that cannot be decoded is an internal error in the reset loop, including in the archive step. No HTTP caller can reach it.

Checks

  • go build ./... and go vet ./services/core/....
  • deployment and deploymentpg in full (PostgreSQL, no skips), including:
    • a reset race;
    • a closed lease;
    • rollback;
    • the audit actor sequence.
  • execution -run 'TestStartWorker|TestWorkerRunClosesLeaseAfterDrain|Reset'.
  • store -run over the reset, archive and dispatch tests.
  • api -run '^TestSandbox|Installation', and cmd/server.
  • make openapi produces no diff, and scripts/check-names.py passes.

A blind review found no blockers or majors. Its minor findings are fixed in this commit.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@SaladDay
SaladDay merged commit eab95f9 into main Sep 30, 2026
1 check passed
@SaladDay
SaladDay deleted the refactor/deployment-runtime branch September 30, 2026 21:18
The reset becomes deployment use cases on ExecutionOperations: start or
escalate, cancel, advance the auto deadline and complete, each a Load,
Decide and Apply transaction on the execution lease. DeploymentTx gains
the reset writes, the stored starter source and RecordAuditAs, so the
deadline and completion audit as the administrator who started the
reset. Completion in use is deployment.InUseError. The Worker lists the
Sessions a reset still has to archive through the required
Dispatcher.DeploymentReader; the per-Session archive stays in store.

Address bindings are deployment.Service.AddressBindings, read in one
snapshot against the public URL the service was built with, and serve
the installation page. api maps reset and in-use errors in
writeSandboxError, and the OpenAPI schemas become
deployment.ResetRequest and deployment.AddressBindings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant