WIP: Attention Inbox: slice-done trigger + time-based auto-clear #286

Closed
toasterson wants to merge 1 commit from claude/wi-019f1778-attention-inbox-slice-done-trigger-time into main
Owner

Anima work item 019f1778-57ad-7500-ad1a-869be806ac82.

What to build

Add the third trigger — slice done → deploy/promote hand-off — and introduce the time-based auto-clear window that the hand-off triggers need (because Anima gets no signal that the human deployed/promoted). A slice that has just completed surfaces as an inbox row ("slice done — deploy / promote"), routing to the slice (project view filtered to that slice), and the row ages out after a configurable window (server default for now; per-user config is a separate, design-pending WI).

End-to-end: a slice transitions to done (via the slice→done reconcile already shipped) → an inbox row appears → clicking routes to the slice → the row disappears once it's older than the auto-clear window even if nothing else changes.

Pushed context

  • This is the first trigger with NO state-based clear (a done slice stays done forever), so it MUST be windowed. Implement the window as a single server-side default constant/env now (e.g. ATTENTION_CLEAR_WINDOW, default ~7d) applied in build_dashboard: include slice_done items only where slice.updated_at > now() - window. Keep the window value in one place so the later per-user-config WI can swap the source.
  • Source: work_slices with status = 'done' (the done transition + SliceRepo::reconcile_for_plan landed already — see crates/anima-db/src/repo/slice.rs). RBAC-scope by project. Map to AttentionItem { trigger: "slice_done", slice_id, project_id, route: slice route, reason: "slice done — deploy / promote", occurred_at: slice.updated_at }.
  • "Done" here means the slice just completed; updated_at is the proxy for "completed at" (no dedicated completed_at column — note this; if a column is cheap/worth it, add it, else use updated_at and document the approximation).
  • PWA: extend AttentionInbox.tsx with the slice_done trigger icon/colour/label; route to the slice (the project view supports ?slice=<id>). No new fetch.
  • Design fixed by ADR 0015 + CONTEXT.md "Attention feed" (resolution = state-resolve OR time-clear; no dismiss buttons).

Acceptance criteria

  • Slices in status='done' within the window appear as slice_done inbox rows, RBAC-scoped, routing to the slice.
  • A done slice older than the window does NOT appear (auto-clear); the window is a single configurable server default.
  • cargo check clean; npm run verify green (test: a recently-done slice renders a row; a stale one is filtered out).

Blocked by

  • WI "Attention Inbox end-to-end (WI-parked trigger)" (019f1777-b171-7390-ac92-a9583112a848).
Anima work item `019f1778-57ad-7500-ad1a-869be806ac82`. ## What to build Add the third trigger — **slice done → deploy/promote hand-off** — and introduce the **time-based auto-clear window** that the hand-off triggers need (because Anima gets no signal that the human deployed/promoted). A slice that has just completed surfaces as an inbox row ("slice done — deploy / promote"), routing to the slice (project view filtered to that slice), and the row **ages out after a configurable window** (server default for now; per-user config is a separate, design-pending WI). End-to-end: a slice transitions to `done` (via the slice→done reconcile already shipped) → an inbox row appears → clicking routes to the slice → the row disappears once it's older than the auto-clear window even if nothing else changes. ## Pushed context - This is the first trigger with NO state-based clear (a done slice stays done forever), so it MUST be windowed. Implement the window as a single server-side default constant/env now (e.g. `ATTENTION_CLEAR_WINDOW`, default ~7d) applied in `build_dashboard`: include `slice_done` items only where `slice.updated_at > now() - window`. Keep the window value in one place so the later per-user-config WI can swap the source. - Source: `work_slices` with `status = 'done'` (the `done` transition + `SliceRepo::reconcile_for_plan` landed already — see `crates/anima-db/src/repo/slice.rs`). RBAC-scope by project. Map to `AttentionItem { trigger: "slice_done", slice_id, project_id, route: slice route, reason: "slice done — deploy / promote", occurred_at: slice.updated_at }`. - "Done" here means the slice just completed; `updated_at` is the proxy for "completed at" (no dedicated completed_at column — note this; if a column is cheap/worth it, add it, else use updated_at and document the approximation). - PWA: extend `AttentionInbox.tsx` with the `slice_done` trigger icon/colour/label; route to the slice (the project view supports `?slice=<id>`). No new fetch. - Design fixed by ADR 0015 + CONTEXT.md "Attention feed" (resolution = state-resolve OR time-clear; no dismiss buttons). ## Acceptance criteria - [ ] Slices in `status='done'` within the window appear as `slice_done` inbox rows, RBAC-scoped, routing to the slice. - [ ] A done slice older than the window does NOT appear (auto-clear); the window is a single configurable server default. - [ ] `cargo check` clean; `npm run verify` green (test: a recently-done slice renders a row; a stale one is filtered out). ## Blocked by - WI "Attention Inbox end-to-end (WI-parked trigger)" (019f1777-b171-7390-ac92-a9583112a848).
toasterson force-pushed claude/wi-019f1778-attention-inbox-slice-done-trigger-time from 53993c1204 to 2d7c6608a3 2026-07-05 00:27:49 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-slice-done-trigger-time from 2d7c6608a3 to 81447dd5a0 2026-07-06 02:33:27 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-slice-done-trigger-time from 81447dd5a0 to b19446218e 2026-07-06 03:50:47 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-slice-done-trigger-time from b19446218e to 30a3ccbb86 2026-07-06 16:32:17 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-slice-done-trigger-time from 30a3ccbb86 to 1b12d4db92 2026-07-06 17:13:48 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-slice-done-trigger-time from 1b12d4db92 to 9d423dfa23 2026-07-06 18:24:53 +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:44 +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!286
No description provided.