WIP: Attention Inbox: human-decision-pending trigger #285

Closed
toasterson wants to merge 1 commit from claude/wi-019f1778-attention-inbox-human-decision-pending-t into main
Owner

Anima work item 019f1778-03a5-7ed2-abd9-637655bb4ccf.

What to build

Add the second Attention Inbox trigger: changes awaiting a human accept/reject ("decision pending"). Each WI that has a pending, review-requiring change becomes one inbox row routing to that WI (deduped — one row per WI even if it has several pending changes). Builds directly on the pipeline from the tracer-bullet WI.

End-to-end: a change whose integration_decision = 'pending' and whose kind requires human review surfaces as an inbox row ("decision pending — accept/reject") → click routes to the WI. When the decision is made (accept/reject/supersede), the row disappears (state-derived).

Pushed context

  • Reuse the EXISTING pending-decision definition — do not invent a new one. The canonical predicate lives in crates/anima-db/src/repo/workitem_change.rs (list_pending_for_project / the requires_review allowlist: agent_diff, human_patch, companion_proposal) and is mirrored by the dashboard pending-decisions count in crates/anima-server/src/services/dashboard.rs. external_pr is bookkeeping and is intentionally excluded (see ADR/PR #275 history). Dedup to one AttentionItem per work_item_id.
  • Add these as AttentionItem { trigger: "decision_pending", work_item_id, route: WI route, reason: "decision pending", occurred_at: change.created_at } inside build_dashboard, alongside the parked items from the tracer-bullet WI. RBAC-scope identically.
  • PWA: extend AttentionInbox.tsx with the decision_pending trigger's icon/colour + label; no new fetch (rows already arrive in attention_inbox). Keep the row a <Link> to the WI; the actual accept/reject UI stays where it already lives (the project view's "Needs Your Decision" rail) — the inbox only ROUTES, per ADR 0015.
  • Design fixed by ADR 0015 + CONTEXT.md "Attention feed". Note the deliberate relationship: the inbox supersedes the old "Pending Decisions" counter (removed in a later WI), so this trigger is what makes that removal safe.

Acceptance criteria

  • WIs with a pending review-requiring change appear as decision_pending inbox rows, one per WI, RBAC-scoped.
  • external_pr and other non-review kinds do NOT produce rows (matches requires_review).
  • Row routes to the WI; resolving the decision removes the row on next load.
  • cargo check clean; npm run verify green (test: a pending-decision row renders and a non-review change does not).

Blocked by

  • WI "Attention Inbox end-to-end (WI-parked trigger)" (019f1777-b171-7390-ac92-a9583112a848).
Anima work item `019f1778-03a5-7ed2-abd9-637655bb4ccf`. ## What to build Add the second Attention Inbox trigger: **changes awaiting a human accept/reject** ("decision pending"). Each WI that has a pending, review-requiring change becomes one inbox row routing to that WI (deduped — one row per WI even if it has several pending changes). Builds directly on the pipeline from the tracer-bullet WI. End-to-end: a change whose `integration_decision = 'pending'` and whose kind requires human review surfaces as an inbox row ("decision pending — accept/reject") → click routes to the WI. When the decision is made (accept/reject/supersede), the row disappears (state-derived). ## Pushed context - Reuse the EXISTING pending-decision definition — do not invent a new one. The canonical predicate lives in `crates/anima-db/src/repo/workitem_change.rs` (`list_pending_for_project` / the `requires_review` allowlist: `agent_diff`, `human_patch`, `companion_proposal`) and is mirrored by the dashboard pending-decisions count in `crates/anima-server/src/services/dashboard.rs`. `external_pr` is bookkeeping and is intentionally excluded (see ADR/PR #275 history). Dedup to one `AttentionItem` per `work_item_id`. - Add these as `AttentionItem { trigger: "decision_pending", work_item_id, route: WI route, reason: "decision pending", occurred_at: change.created_at }` inside `build_dashboard`, alongside the parked items from the tracer-bullet WI. RBAC-scope identically. - PWA: extend `AttentionInbox.tsx` with the `decision_pending` trigger's icon/colour + label; no new fetch (rows already arrive in `attention_inbox`). Keep the row a `<Link>` to the WI; the actual accept/reject UI stays where it already lives (the project view's "Needs Your Decision" rail) — the inbox only ROUTES, per ADR 0015. - Design fixed by ADR 0015 + CONTEXT.md "Attention feed". Note the deliberate relationship: the inbox supersedes the old "Pending Decisions" counter (removed in a later WI), so this trigger is what makes that removal safe. ## Acceptance criteria - [ ] WIs with a pending review-requiring change appear as `decision_pending` inbox rows, one per WI, RBAC-scoped. - [ ] `external_pr` and other non-review kinds do NOT produce rows (matches `requires_review`). - [ ] Row routes to the WI; resolving the decision removes the row on next load. - [ ] `cargo check` clean; `npm run verify` green (test: a pending-decision row renders and a non-review change does not). ## Blocked by - WI "Attention Inbox end-to-end (WI-parked trigger)" (019f1777-b171-7390-ac92-a9583112a848).
toasterson force-pushed claude/wi-019f1778-attention-inbox-human-decision-pending-t from 6410664fa2 to 889857584d 2026-07-05 00:13:28 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-human-decision-pending-t from 889857584d to 815aa99da9 2026-07-05 00:21:12 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-human-decision-pending-t from 815aa99da9 to a6bde3bd2f 2026-07-05 00:33:44 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-human-decision-pending-t from a6bde3bd2f to 49fc2831dd 2026-07-05 00:44:36 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-human-decision-pending-t from 49fc2831dd to b8e4a212f6 2026-07-06 01:24:14 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-human-decision-pending-t from b8e4a212f6 to 7708ffc92d 2026-07-06 02:37:00 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-human-decision-pending-t from 7708ffc92d to e7c536873b 2026-07-06 16:27:24 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-human-decision-pending-t from e7c536873b to bda5b29d8f 2026-07-06 17:08:38 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-human-decision-pending-t from bda5b29d8f to 1626907f09 2026-07-06 18:19:58 +00:00 Compare
Author
Owner

Subsumed by #287 (full inbox trigger set) and merged at ae5d72d. WI done. Closing.

Subsumed by #287 (full inbox trigger set) and merged at `ae5d72d`. WI done. Closing.
toasterson closed this pull request 2026-07-09 17:54:43 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
toasterson/Anima!285
No description provided.