Repository navigation
Add cancel-work --obsolete with a read-only dry-run preview - #76180
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills... |
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
❌ Design Decision Gate 🏗️ failed to deliver outputs during design decision gate check.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🔎 PR Code Quality Reviewer is reviewing code quality for this pull request... |
|
Warning The 🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (558 added lines under 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. ❓ Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
There was a problem hiding this comment.
🟡 Changes recommended
Cancellation publication discards the original ledger snapshot, allowing concurrent ledger replacement to cancel replacement Work and legacy recovery to cancel claimed or pinned Work.
4 open issues
What changed in this PR
Adds a native Go CLI path for retiring obsolete worker-contract backlog without clearing the work queue or manually collecting Work IDs.
Changes:
- Add the
cancelalias, bounded--obsoleteselection, and read-only--dry-runpreviews. - Reuse administrator-authorized cancellation and stable-request receipt recovery.
- Add regression tests, operator documentation, specification requirements, and a release changeset.
| File | Description |
|---|---|
pkg/workqueue/obsolete_selection_test.go |
Tests eligibility, ordering, limits, and non-mutating selection. |
pkg/workqueue/deployment.go |
Adds bounded obsolete Work selection. |
pkg/cli/work_command_operations.go |
Adds the alias, flags, help text, and command routing. |
pkg/cli/work_command_obsolete.go |
Implements previews, receipt recovery, publication, and output. |
pkg/cli/work_command_obsolete_test.go |
Exercises previews, authorization, retries, stale batches, and flag validation. |
docs/src/content/docs/specs/work-queue-specification.md |
Defines selection, preview, and retry requirements. |
docs/src/content/docs/reference/work-queue.md |
Documents usage, eligibility, statuses, and recovery. |
.changeset/patch-cli-obsolete-work-cancellation.md |
Records the CLI addition for release. |
Review effort: Max (auto)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Reply to comment 6740233765: This announces a review without an actionable finding, so no code change is warranted. |
|
Reply to comment 6740235100: No actionable test finding is included, so no change is warranted. I am not treating reported_no_action as exhaustive validation or proof of live publication. |
|
Reply to comment 6740236674: This is a workflow output failure, not a code finding. The missing ADR is now documented and linked in the PR body; no workflow protections or credentials were changed. |
|
Reply to comment 6740237111: No actionable finding is included, so no change is warranted. Successful reviewer completion does not establish live selection, which remains unverified as documented in the PR. |
|
Reply to comment 6740238348: No specification finding is included, so no corrective change is warranted. The Go spec regressions remain the validation evidence; reported_no_action is not exhaustive conformance proof. |
|
Reply to comment 6740245834: This announces a review without a code quality finding, so no change is warranted. |
|
Reply to comment 6740372931: Accepted the ADR requirement: added the complete ADR-76180 and linked it in the PR body, covering pure-Go selection, guarded publication, authority, preview limits, retry receipts and preservation. The reported automation push failed, so no committed draft was assumed; this update uses the existing branch access without changing credentials or bypassing workflow protections. |
…retries Isolate ownership races and classify the operator mode as a minor feature. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Reply to comment 6740233765: This reviewer-start notification was already answered in comment 6740713757. It contains no actionable finding, so no further code change is needed. |
|
Reply to comment 6740235100: This report was already answered in comment 6740714109. It contains no test finding; reported_no_action is not exhaustive validation. |
|
Reply to comment 6740236674: This workflow output failure was already answered in comment 6740714496. The ADR is committed and linked; no credential or protection changes are needed. |
|
Reply to comment 6740237111: This no-action report was already answered in comment 6740714883. It supplies no finding and does not verify live selection. |
|
Reply to comment 6740238348: This no-action report was already answered in comment 6740715236. It supplies no specification finding; regression evidence remains distinct from reviewer status. |
|
Reply to comment 6740245834: This reviewing notification was already answered in comment 6740715623. It contains no actionable code-quality finding. |
|
Reply to comment 6740372931: The ADR requirement was already satisfied in commit 422b13b and answered in comment 6740716085. The complete ADR is linked in the PR body; the failed workflow push was not treated as an applied draft. |
|
Reply to comment 6740713757: This prior response already addresses the status-only notification. It contains no new request, so no additional change is needed. |
|
Reply to comment 6740714109: This prior response already distinguishes the absence of a test finding from exhaustive validation. It contains no new request. |
|
Reply to comment 6740714496: This prior response already addresses the design failure and linked ADR without changing credentials or protections. It contains no new request. |
|
Reply to comment 6740714883: This prior response already records the absence of a finding and the live-selection limitation. It contains no new request. |
|
Reply to comment 6740715236: This prior response already distinguishes Go regression evidence from reviewer no-op status. It contains no new request. |
|
Reply to comment 6740715623: This prior response already addresses the absence of a code-quality finding. It contains no new request. |
|
Reply to comment 6740716085: This prior response already confirms the complete linked ADR without assuming the failed workflow push applied its draft. It contains no new request. |
|
🎉 This pull request is included in a new release. Release: |



Operators need a bounded way to retire obsolete worker-contract backlog without clearing the queue, dispatching workers, or manually collecting Work IDs. This adds
gh aw work cancel-work --obsoletein pure Go, using the existing work-queue specification and maintenance eligibility rules. The existing command name is retained; no new aliases are added.ADR: ADR-76180: Add bounded obsolete Work cancellation
Behavior and safety
--limit(default 256, range 1..256) and the installed Policy operation limit.worker_contract_obsoleteand operationversion: 1. Reject replacement ledgers, including hard-clear/readmission of the same Work IDs; allow verified same-ledger appends and checkpoints. Current-prefix checks reject an entire batch if a target becomes ineligible.--request-idretries recover the original receipt, never newly obsolete Work. A later lower Policy operation limit cannot block accepted receipt recovery; an insufficient caller limit reports the required numeric minimum.--dry-runis a read-only ledger selection preview: it does not check administrator publication authority, reserve a request ID, publish a cancellation, or synchronize Issues. No eligible Work is a no-op without a recorded request. The command does not change worker routes, stop native runs, release reservations, or reset the queue.Remove
--dry-runto request authenticated publication.--obsoletecannot be combined with--work-idor--reason;--limitand--dry-runrequire--obsolete.The checked cancellation prerequisite already landed in #76126; no prerequisite commits are imported. Includes a minor feature changeset, reference/spec documentation, and the ADR.
Validation
cancelalias.make fmtand focused Go tests passed. Existing cancellation contract regressions and JavaScript maintenance suites passed independently; neither the command nor the new Go tests shells out to JavaScript.make agent-report-progress. After fixing initial lint findings,make agent-report-progress-no-testpassed the final lint/build/schema/workflow-drift gates, including 365 compiled workflows. Each review update passed focused tests and the no-test publication gate.Live validation limitation
The live read-only preview against
github/gh-awstalled during the Git ledger read and was stopped. REST reads confirmed the queue reference stayed unchanged. Live selection remains unverified; no live cancellation or workflow dispatch was performed.