diff --git a/coworker/teams/store.py b/coworker/teams/store.py index af0e8b1f..0362688a 100644 --- a/coworker/teams/store.py +++ b/coworker/teams/store.py @@ -545,12 +545,21 @@ class TeamStore: f"illegal transition {current.value} → {target.value}" ) self._check_transition_authority(actor, item, current, target) - # Canceling an assigned item ADDRESSES the notice to its assignee — the - # top-priority queue entry whose delivery (or in-flight interrupt) makes - # the worker actually stop, instead of finishing into the void. + # When someone ELSE moves your assigned item to a state that needs + # YOUR action, the event is addressed to you: a send-back + # (review→in_progress with feedback), an unblock, a cancel (whose + # delivery/in-flight interrupt makes the worker actually stop). This + # is a board write, not a message — delivery is the queue projection + # doing its job. DONE is deliberately unaddressed: waking a worker to + # say its finished item is finished would burn a turn for nothing. + action_needed = { + ItemState.IN_PROGRESS, + ItemState.BLOCKED, + ItemState.CANCELED, + } recipient = ( item["assignee"] - if target is ItemState.CANCELED + if target in action_needed and item["assignee"] and item["assignee"] != actor.id else None diff --git a/surfaces/gui/e2e/board.spec.ts b/surfaces/gui/e2e/board.spec.ts index 2e605dcc..b7252d60 100644 --- a/surfaces/gui/e2e/board.spec.ts +++ b/surfaces/gui/e2e/board.spec.ts @@ -111,7 +111,7 @@ test("item detail: timeline with attachment, worker link, request changes", asyn // Request changes… discloses a comment box; sending returns the item to work await detail.getByRole("button", { name: "Request changes…" }).click(); await detail.getByPlaceholder("What needs to change?").fill("totals drift on Tom"); - await detail.getByRole("button", { name: "Send to security" }).click(); + await detail.getByRole("button", { name: "Request changes", exact: true }).click(); await expect(detail).toContainText("In progress"); // switching rows switches the pane await page.getByTestId("board-item-3").click(); diff --git a/surfaces/gui/src/components/BoardPanel.tsx b/surfaces/gui/src/components/BoardPanel.tsx index 18126812..c6ab5937 100644 --- a/surfaces/gui/src/components/BoardPanel.tsx +++ b/surfaces/gui/src/components/BoardPanel.tsx @@ -358,6 +358,8 @@ function DetailActions({ onChange={(e) => setChangesText(e.target.value)} />
+ {/* A board write, not a message: review → in_progress with the + comment attached; delivery to the assignee is the queue's job. */}