Conversation
Add Approved, Deployed and Post-deploy Validation between In Review and Done, for teams whose release process continues after the merge. Gated by `delivery_lanes_enabled` (default off): with it off, the board and the state machine behave exactly as if the lanes did not exist. Every automatic ship path now reads one function, `shippedLane(flags)`, so the no-behaviour-change property is a single tested fact rather than five call sites agreeing by luck. `LANE_RANK` moves to its own module alongside `movesForward`, and two enumerated guards that would have dragged cards backward once the lanes existed (`prs-get`'s merged-PR reconcile and `run-reactions`' delivered-failure relabel) now compare by rank. No migration: `task_board_items.status` is plain text with no CHECK, and the existing `status_changed` activity action is reused. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is this contribution about?
Adds three board lanes — Approved, Deployed, Post-deploy Validation — between In Review and Done, for teams whose release process continues after the merge, gated by a new default-off org flag
delivery_lanes_enabled. Every automatic ship path (thereview-decisionauto-merge, the auto-merge retry, "Ship to production",prs-get's reconcile-on-view, and the merged sweep) now reads one function,shippedLane(flags), so "flag off = zero behaviour change" is a single tested fact rather than five call sites agreeing by luck. Along the way this fixes a latent bug:prs-get'sstatus !== "done" && !== "archived"enumeration would have dragged a card resting in Post-deploy Validation back to Deployed on every PR-modal open, so it andrun-reactions' delivered-failure relabel now compare by rank (LANE_RANK/movesForward, extracted intolanes.ts). Three related holes are closed in the same PR:REVIEW_CLOSING_STATUSESnow covers the new lanes (a run settingdeployedotherwise escapedclosesOwnReviewand dropped the card out oflistItemsPendingReview, so its reviewers never ran),hasHumanRejectedDonetreats leavingdeployedas the same veto as leavingdone, and the web ship-button gate accepts Approved so the lane isn't a UI dead end.Note
approvedis deliberately human-only here — reachable by drag, "Move to" and Jira mapping, never written by automation. Making automation write it requires widening seven sites together (listItemsPendingReview,review-sweeper,advanceToDoneIfMerged,retryAutoMergeIfApproved,claimInReviewSuperAgentSlot,conflict-reaction,isTaskHandedToHuman); any subset strands cards, so that is a follow-up.How did you verify your code works?
New pure unit suites
lanes.test.ts(rank ordering,movesForwardrefusing the backward drag,shippedLaneresolving every falsy flag shape todone), plus new cases inconfig.test.ts(moveTargets,laneVisibilityincl. the "card stuck in a switched-off lane stays reachable" property) andreview-status.test.ts(laneCanShip). Per the repo's inversion rule I inverted the tests that encoded the old behaviour rather than appending:reconcile-merged.test.tsnow asserts both flag-off →doneand flag-on →deployed, andupdate.test.ts'sclosesOwnReview"anywhere but Done/Archived" case now pins the delivery lanes as review-closing. Real-Postgres coverage added toarchive-merged.integration.test.ts(a card parked in a delivery lane is never swept, via both the candidate query and the write path) andhuman-rejected-done.integration.test.ts(leavingdeployedis a veto; leaving a later lane is not). Against real Postgres the touched scope went 880 → 908 passing with the same two pre-existing order-dependent failures (task-filters, which pass standalone) before and after;bun run checkreports 0 type errors,bun run lint18 warnings identical to baseline, andbun run knipis clean.Not verified, flagging honestly:
packages/e2e/tests/task-board-delivery-lanes.spec.tsis written and typechecks but is unrun — its harness spawnsbun run dev, which needs an.envthis environment lacks — and there was no live browser check for the same reason. Both are worth a run before merge.Screenshots/Demonstration
Not captured — see above. The UI change is three additional board columns plus one settings toggle, both invisible until the flag is enabled.
How to Test
main(5 visible columns, Archived hidden) and that "Move to" and the task dialog's status dropdown offer no new lanes.ORGANIZATION_SETTINGS_UPDATE { flags: { delivery_lanes_enabled: true } }, or Settings → Review → "Show delivery lanes".In Review → Approved → Deployed → Post-deploy Validation → Done; each move should persist and write astatus_changedtimeline entry.Migration Notes
None.
task_board_items.statusis plaintextwith no CHECK constraint (migration 126) and the existingstatus_changedactivity action is reused, so no schema change is needed. The generatedpackages/shared/src/tools/tool-io.tsdiff is committed — regenerate withbun run --cwd=apps/api generate:tool-contractsif you touch the status or flags schemas.Review Checklist
🤖 Generated with Claude Code
Summary by cubic
Adds three delivery lanes — Approved, Deployed, Post‑deploy Validation — behind a default‑off org flag. With the flag off, merged PRs still move tasks to Done; with it on, merged PRs land on Deployed and the “Ship to production” button works from In Review and Approved.
shippedLane(flags)and guards all auto-moves with rank (LANE_RANK/movesForward) to prevent backward drags.hasHumanRejectedDone), and excludes delivery lanes from archive sweeps.moveTargets(deliveryEnabled).tool-iotypes; no DB migration.Review/Focus
packages/shared/src/task-board.ts:shippedLane,deliveryLanesEnabled.apps/api/src/tools/task-board/lanes.ts:LANE_RANK,movesForward,SHIP_ELIGIBLE_LANES; rank-based checks inrun-reactionsandprs-get.shippedLane:review-decision,merge-prretry, merged-PR reconcile (reconcile-merged,prs-get), manual ship (promote-to-production).REVIEW_CLOSING_STATUSESwidened; UI gating inlaneVisibility,moveTargets,laneCanShip.Rollout/Testing
delivery_lanes_enabled.packages/e2e/tests/task-board-delivery-lanes.spec.tslocally.Written for commit 816b03e. Summary will update on new commits.