Skip to content

fix(task-board): sweep a settled delivery-lane card into the archive, not just Done - #6983

Closed
pedrofrxncx wants to merge 1 commit into
mainfrom
fix/archive-sweep-delivery-lanes-w1
Closed

fix(task-board): sweep a settled delivery-lane card into the archive, not just Done#6983
pedrofrxncx wants to merge 1 commit into
mainfrom
fix/archive-sweep-delivery-lanes-w1

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

What: The auto-archive sweep (archive-merged.ts / listItemsAwaitingArchive) still gated on the literal status "done", but shippedLane() sends a delivery-lanes org's shipped cards to "merged"/"post_deploy_validation" instead — they never reach "done" on their own (see packages/shared/src/task-board.ts's shippedLane). The merged-tag sweep hit the exact same gap and was already fixed to gate on the broader TAGGABLE_MERGED_STATUSES/isTaggableMergedStatus set (see the comment on listItemsAwaitingMergedTag), but the archive sweep was left behind on the old literal — so on any org running delivery_lanes_enabled, a shipped card never settles into the archive no matter how old it gets.

Why a maintainer wants this: the archive sweep is the only thing keeping Done from growing unbounded ("a Done column with 77 cards nobody reads" per its own doc comment); for a delivery-lanes org it currently does nothing at all, and nobody would notice until the board is unusable.

Fix: reused the already-established isTaggableMergedStatus (lanes.ts) and TAGGABLE_MERGED_STATUSES (storage/task-board.ts) that tag-merged.ts uses for the identical problem, in both the SQL candidate query and the in-process re-check gate. Also fixed the activity log recording a hardcoded from: "done" on every auto-archive — now records the card's real prior status, which matters once that status can be a delivery lane.

Regression test: inverted the existing integration test "never sweeps a card resting in a delivery lane" (which asserted the bug as intended behavior, with a misleading comment about lane ordering) into "sweeps a settled card resting in a delivery lane, same as Done", mirroring the shape of listItemsAwaitingMergedTag's own coverage.

To verify: bun test apps/api/src/tools/task-board/archive-merged.integration.test.ts (needs the real-Postgres test DB — this worktree has none, so I could not run it locally).

Checked locally: bun test apps/api/src/tools/task-board/archive-merged.test.ts (pure logic, unaffected by this change) passes; tsc --noEmit in apps/api is clean; oxlint on the three touched files is clean; bun run fmt applied. Full CI (including the real-Postgres integration test) validates the rest.


Summary by cubic

The auto-archive sweep now archives settled cards in delivery lanes, not just cards literally in Done.

  • Delivery-lane orgs' shipped cards move to merged/post_deploy_validation and never reach done, so the old gate left them unarchived forever.
  • Reuses the existing isTaggableMergedStatus and TAGGABLE_MERGED_STATUSES checks already used by the merged-tag sweep.
  • The activity log now records the card's real prior status instead of a hardcoded from: "done".
  • Inverts the integration test that previously asserted the buggy behavior.

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

Review in cubic

… not just Done

The auto-archive sweep (archive-merged.ts / listItemsAwaitingArchive) still gated on the literal status "done", but shippedLane() sends a delivery-lanes org's shipped cards to "merged"/"post_deploy_validation" instead — they never reach "done" on their own. The merged-tag sweep hit the exact same problem and was already fixed to use the broader TAGGABLE_MERGED_STATUSES/isTaggableMergedStatus set; the archive sweep was left behind on the old literal, so a delivery-lanes org's shipped cards never settle into the archive no matter how old they get.

Reused the existing isTaggableMergedStatus (lanes.ts) and TAGGABLE_MERGED_STATUSES (storage/task-board.ts) that tag-merged.ts already established as the correct gate, in both the SQL candidate query and the in-process re-check. Also fixed the activity log recording a hardcoded from: "done" on every auto-archive, which was wrong even before this fix whenever "done" itself wasn't the source lane.

Inverted the existing integration test "never sweeps a card resting in a delivery lane" (which encoded the bug as intended behavior) into one asserting a settled delivery-lane card DOES get archived, mirroring the shape of listItemsAwaitingMergedTag's own test.

To verify: bun test apps/api/src/tools/task-board/archive-merged.integration.test.ts (needs the real-Postgres test DB; ran the pure archive-merged.test.ts and tsc --noEmit locally, both clean, since this worktree has no Postgres).
@pedrofrxncx

Copy link
Copy Markdown
Collaborator Author

Closing as stale: this PR sat past the bot's 48h merge window, main has moved on, and its CI results no longer reflect the current base. This is a housekeeping close, not a rejection of the change — if the underlying problem still exists, the bot will find it again and open a fresh, rebased PR.

[studio-bot:stale-close]

@pedrofrxncx pedrofrxncx closed this Sep 8, 2026
@pedrofrxncx
pedrofrxncx deleted the fix/archive-sweep-delivery-lanes-w1 branch September 8, 2026 16:14
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