Skip to content

Make queued admission cancellation deterministic - #15

Open
omry wants to merge 1 commit into
pr14from
pr15
Open

Make queued admission cancellation deterministic#15
omry wants to merge 1 commit into
pr14from
pr15

Conversation

Copilot AI 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.

Pull request overview

This PR makes cancellation at the queued admission boundary deterministic by introducing an internal ready reservation state and requiring the owning caller to explicitly “claim” that reservation as the admission linearization point.

Changes:

  • Introduce/extend ready semantics in the live-run queue and add an explicit ActivateReadyLiveRunV1 transition.
  • Update admission loops (live runs and control markers) to claim ready under the operation lock, ensuring cancellation before/after the claim has deterministic outcomes.
  • Hide internal ready from user-facing reporting (runs list, stop results) and expand unit tests + docs to match the new behavior.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/dockerdeploy/live_runs.go Remaps internal ready to public waiting for list/stop results.
internal/dockerdeploy/live_runs_test.go Updates expectations and adds coverage for stopping a ready reservation.
internal/dockerdeploy/live_run_container_test.go Adjusts promotion assertions to reflect ready reservation behavior.
internal/dockerdeploy/live_run_admission.go Claims ready as the admission point and updates wait notices to describe queued blockers.
internal/dockerdeploy/live_run_admission_test.go Adds deterministic cancellation race tests and wait-notice coverage for ready predecessors.
internal/dockerdeploy/current_workload_run_test.go Updates queue status expectations to ready after lifecycle phases.
internal/dockerdeploy/control_admission.go Claims ready for control marker admission and makes cancellation deterministic around the claim.
internal/dockerdeploy/control_admission_test.go Adds deterministic cancellation race tests for control admissions and updates expectations.
internal/dockerdeploy/control_admission_modes.go Counts ready alongside waiting for disruption accounting.
internal/deploy/live_run_queue.go Reworks queue validation/promotion around a single ready reservation and adds activation API.
internal/deploy/live_run_queue_test.go Updates FIFO/promotion tests and adds coverage for canceling unclaimed ready runs.
internal/deploy/live_run_queue_file.go Adds OperationLock.ActivateReadyLiveRunV1 to persistently claim reservations.
internal/deploy/live_run_queue_file_test.go Updates atomic transition tests to account for ready then explicit activation.
docs/CONTROLLED_SESSION_DESIGN.md Documents ready as the authoritative admission point and its cancellation semantics.
docs/BLUEPRINT_ENVIRONMENT_MODEL.md Documents internal ready reservation while keeping public waiting/active model.
docs/BACKLOG.md Removes the backlog item now implemented by this PR.
docs/APT_PROVIDER_DETAIL_DESIGN.md Updates queue model documentation to include internal ready reservation.
.changes/unreleased/+deterministic-admission-cancellation.yaml Adds a release-note fragment describing the behavioral fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 188 to 193
ahead := queue.Runs[:candidateIndex]
active := deploy.LiveRunV1{}
blocker := ahead[0]
for _, entry := range ahead {
if entry.Status == deploy.LiveRunStatusActiveV1 {
active = entry
if entry.Status == deploy.LiveRunStatusReadyV1 {
blocker = entry
break

omry commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: a7262e9b3e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@omry

omry commented Aug 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb91025497

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/deploy/live_run_queue.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR reviewed and approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants