fix(task-board): close a rerun's inherited review cycle - #6706
Merged
Conversation
TASK_BOARD_ITEM_RERUN moves a card back to In Progress but never called closeReviewCycle, despite that storage method's own doc comment claiming every path that sends a card back to work (a rerun included) calls it. Left stamped, openReviewCycleIfInProgress only re-stamps a fresh boundary when the column is null, so a re-run fired on a card whose reviewer was already running (In Progress with an open cycle) or parked In Review never gets a fresh review-cycle boundary for its own attempt — the new run's review dispatch inherits verdicts recorded against the superseded attempt instead.
pedrofrxncx
enabled auto-merge (squash)
August 28, 2026 17:25
decocms Bot
pushed a commit
that referenced
this pull request
Aug 28, 2026
PR: #6706 fix(task-board): close a rerun's inherited review cycle Bump type: patch - decocms (apps/api/package.json): 4.297.0 -> 4.297.1 - @decocms/native (apps/native/package.json): 4.297.0 -> 4.297.1 Deploy-Scope: server
pedrofrxncx
added a commit
that referenced
this pull request
Aug 31, 2026
TASK_BOARD_ITEM_RERUN moves a card back to In Progress but never called closeReviewCycle, despite that storage method's own doc comment claiming every path that sends a card back to work (a rerun included) calls it. Left stamped, openReviewCycleIfInProgress only re-stamps a fresh boundary when the column is null, so a re-run fired on a card whose reviewer was already running (In Progress with an open cycle) or parked In Review never gets a fresh review-cycle boundary for its own attempt — the new run's review dispatch inherits verdicts recorded against the superseded attempt instead.
pedrofrxncx
pushed a commit
that referenced
this pull request
Aug 31, 2026
PR: #6706 fix(task-board): close a rerun's inherited review cycle Bump type: patch - decocms (apps/api/package.json): 4.297.0 -> 4.297.1 - @decocms/native (apps/native/package.json): 4.297.0 -> 4.297.1 Deploy-Scope: server
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.
Follows #6689 (migration 190's
review_cycle_started_at).TASK_BOARD_ITEM_RERUNmoves a card back to In Progress but never calledcloseReviewCycle— the storage method whose own doc comment says every path that sends a card back to work ("a rerun, a conflict-resolution claim, a human re-engaging the thread") calls it.reopenLinkedTasksOnThreadRundoes; the rerun tool didn't.Failure scenario: a card's reviewer is running (In Progress with
review_cycle_started_atstamped) or the card is parked In Review, and someone re-runs it.openReviewCycleIfInProgressonly stamps a fresh boundary when that column is null — so with the stale stamp left in place, the new attempt's own review dispatch never opens its own cycle. Verdicts recorded against the superseded attempt keep counting (viainReviewPhase, the auto-merge gate, the review-token cycle check) as if they applied to the new run's work, which they never saw.Fix: call
ctx.storage.taskBoard.closeReviewCycle(id, organizationId)before moving the card to In Progress, mirroring the exact sequencereopenLinkedTasksOnThreadRunalready uses for the same reason.Regression test:
apps/api/src/tools/task-board/rerun-closes-review-cycle.integration.test.ts(real Postgres) opens a cycle, runs the same close-then-update sequence rerun.ts now runs, and assertsopenReviewCycleIfInProgresscan stamp a fresh boundary afterward — it would return null (no-op) without the fix.Reviewer:
bun test apps/api/src/tools/task-board/rerun-closes-review-cycle.integration.test.ts(needs Postgres — CI runs it; not runnable in this sandbox).Locally verified:
bun run fmt,cd apps/api && bunx tsc --noEmit(clean),bunx oxlinton both changed files (0 warnings/errors). Full integration/e2e suite left to CI.Summary by cubic
Fixes a task-board rerun carrying over its old card's review cycle, so verdicts recorded against the superseded attempt no longer count toward the new run.
TASK_BOARD_ITEM_RERUNnow callscloseReviewCyclebefore moving the card back to In Progress, matching whatreopenLinkedTasksOnThreadRunalready does; previously the stalereview_cycle_started_atstamp blocked a fresh cycle from opening and let the auto-merge gate and review checks treat old verdicts as valid for the new run.Written for commit faf4980. Summary will update on new commits.