MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-402

6.11.5 Triage actions service — accept / promote / decline / mark-duplicate-merge / snooze

Done
Description

Estimate: 70m · Depends on: 6.11.3

The service + APIs an admin uses to clear the queue, implementing the 6.11.2 action taxonomy (the verified Linear set). Every action mutates through workItemsService and honours 6.4 permissions + the kind-parent matrix:

  • Accept → backlog: clear the triage marker, place the item in the backlog at the team default status, optional comment. (Linear: accept "move[s] the issue to your team’s default status".)
  • Promote → sprint / epic / story: clear the triage marker + set parent + set position/backlogRank via workItemsService (re-parent honouring the kind-parent matrix). The same item now appears in the tree with its full thread.
  • Decline: move to a canceled terminal status + optional comment; it leaves the queue. (Linear: decline → Canceled.)
  • Mark-duplicate / merge: pick a canonical item; cancel the duplicate and fold its comments + attachments into the canonical item (mirror Linear moving attachments/customer-requests to the canonical issue), recording the duplicate-of link.
  • Snooze / unsnooze: set snoozedUntil; the item drops out of the active queue until that time OR new activity (a comment / edit) returns it, whichever first.

One service method = one transaction; reads that gate a write take tx + SELECT FOR UPDATE where a concurrent triage action could race the same item (lock-before-read-derived-update). Routes are thin; typed errors map to status codes.

Acceptance criteria

  • Accept places the item in the backlog at the default status; promote sets parent + position via workItemsService respecting the kind-parent matrix; both clear the triage marker so the item enters the tree.
  • Decline cancels + optionally comments; the item leaves the queue.
  • Mark-duplicate/merge cancels the duplicate, folds its comments + attachments into the canonical item, and records the duplicate-of link.
  • Snooze removes the item from the active queue until the chosen time or new activity; each action is permission-checked (6.4) and transactional (FOR UPDATE where it gates a write).

Context refs

  • 6.11.2 — the action taxonomy + semantics.
  • 6.11.3 — the triage marker + snooze columns the actions mutate.
  • motir-core/lib/services/workItemsService.ts — the re-parent / rank / status write authority.
  • Linear Triage (https://linear.app/docs/triage) — accept/decline/merge/snooze behaviour.
  • motir-core/CLAUDE.md § 4-layer + one-method-one-transaction; the lock-before-read-derived-update rule.