Skip to content

fix(task-board): close a rerun's inherited review cycle - #6706

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/rerun-close-review-cycle
Aug 28, 2026
Merged

fix(task-board): close a rerun's inherited review cycle#6706
pedrofrxncx merged 1 commit into
mainfrom
fix/rerun-close-review-cycle

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Follows #6689 (migration 190's review_cycle_started_at).

TASK_BOARD_ITEM_RERUN moves a card back to In Progress but never called closeReviewCycle — 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. reopenLinkedTasksOnThreadRun does; the rerun tool didn't.

Failure scenario: a card's reviewer is running (In Progress with review_cycle_started_at stamped) or the card is parked In Review, and someone re-runs it. openReviewCycleIfInProgress only 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 (via inReviewPhase, 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 sequence reopenLinkedTasksOnThreadRun already 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 asserts openReviewCycleIfInProgress can 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 oxlint on 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_RERUN now calls closeReviewCycle before moving the card back to In Progress, matching what reopenLinkedTasksOnThreadRun already does; previously the stale review_cycle_started_at stamp blocked a fresh cycle from opening and let the auto-merge gate and review checks treat old verdicts as valid for the new run.

  • Adds a real-Postgres regression test that reproduces the close-then-update sequence and asserts a fresh cycle opens afterward.

Written for commit faf4980. Summary will update on new commits.

Review in cubic

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
pedrofrxncx enabled auto-merge (squash) August 28, 2026 17:25
@pedrofrxncx
pedrofrxncx merged commit bff8d3c into main Aug 28, 2026
33 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/rerun-close-review-cycle branch August 28, 2026 17:36
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
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