WIP: Attention Inbox: AI-deliverable-awaiting-review trigger #287

Closed
toasterson wants to merge 0 commits from claude/wi-019f1778-attention-inbox-ai-deliverable-awaiting into main
Owner

Anima work item 019f1778-e0b6-7793-9af8-a66ceb96bec8.

What to build

Add the fourth trigger — AI deliverable awaiting review. When an AI session produces a Document/artifact (e.g. define-think research, define-build findings, define-artifact render), it lands in the human's inbox so they can find their way back to it after multitasking away from the chat/session that produced it. One row per AI-authored Document, routing to the Document; ages out via the same window as slice-done.

End-to-end: an AI authors a Document → an inbox row appears ("review — ") → clicking opens the Document → the row ages out after the auto-clear window.

Pushed context

  • Detection (decided in the grill): derive from the activity event, not a new flag. Use activity_events rows with kind = 'document.created' AND actor_kind = 'ai', within the auto-clear window from the slice-done WI. The event already carries actor_kind (crates/anima-core/src/domain/activity_event.rs) and document_id/entity refs in its payload — no schema change, no per-user "reviewed" state (consistent with the time-clear model). Confirm the document.created event payload carries the document id + title; if not, read it via DocumentRepo (crates/anima-db/src/repo/document.rs) — author_identity_id exists on the document version but actor_kind on the event is the cleaner AI signal.
  • Map to AttentionItem { trigger: "deliverable_review", document_id, project_id, route: Document route, reason: "review — <title>", occurred_at: event.occurred_at } in build_dashboard. RBAC-scope by project. Reuse the window constant from WI "slice-done trigger + time-based auto-clear" — do NOT introduce a second window.
  • PWA: extend AttentionInbox.tsx with the deliverable_review trigger icon/colour/label; route to the Document viewer (match the PWA's Document route). No new fetch.
  • One slice can already throw a slice_done row; a deliverable produced under it is a SEPARATE row keyed by document — that's intended (different action: deploy vs review).
  • Design fixed by ADR 0015 + CONTEXT.md "Attention feed".

Acceptance criteria

  • AI-authored Documents (document.created + actor_kind='ai') within the window appear as deliverable_review rows, RBAC-scoped, routing to the Document.
  • Human-authored documents do NOT produce rows.
  • Reuses the single auto-clear window (no second constant); stale deliverables age out.
  • cargo check clean; npm run verify green (test: an AI document renders a review row; a human one does not).

Blocked by

  • WI "Attention Inbox: slice-done trigger + time-based auto-clear" (019f1778-57ad-7500-ad1a-869be806ac82).
Anima work item `019f1778-e0b6-7793-9af8-a66ceb96bec8`. ## What to build Add the fourth trigger — **AI deliverable awaiting review**. When an AI session produces a Document/artifact (e.g. define-think research, define-build findings, define-artifact render), it lands in the human's inbox so they can find their way back to it after multitasking away from the chat/session that produced it. One row per AI-authored Document, routing to the Document; ages out via the same window as slice-done. End-to-end: an AI authors a Document → an inbox row appears ("review — <doc title>") → clicking opens the Document → the row ages out after the auto-clear window. ## Pushed context - **Detection (decided in the grill): derive from the activity event, not a new flag.** Use `activity_events` rows with `kind = 'document.created'` AND `actor_kind = 'ai'`, within the auto-clear window from the slice-done WI. The event already carries `actor_kind` (`crates/anima-core/src/domain/activity_event.rs`) and `document_id`/entity refs in its payload — no schema change, no per-user "reviewed" state (consistent with the time-clear model). Confirm the `document.created` event payload carries the document id + title; if not, read it via `DocumentRepo` (`crates/anima-db/src/repo/document.rs`) — `author_identity_id` exists on the document version but `actor_kind` on the event is the cleaner AI signal. - Map to `AttentionItem { trigger: "deliverable_review", document_id, project_id, route: Document route, reason: "review — <title>", occurred_at: event.occurred_at }` in `build_dashboard`. RBAC-scope by project. Reuse the window constant from WI "slice-done trigger + time-based auto-clear" — do NOT introduce a second window. - PWA: extend `AttentionInbox.tsx` with the `deliverable_review` trigger icon/colour/label; route to the Document viewer (match the PWA's Document route). No new fetch. - One slice can already throw a `slice_done` row; a deliverable produced under it is a SEPARATE row keyed by document — that's intended (different action: deploy vs review). - Design fixed by ADR 0015 + CONTEXT.md "Attention feed". ## Acceptance criteria - [ ] AI-authored Documents (`document.created` + `actor_kind='ai'`) within the window appear as `deliverable_review` rows, RBAC-scoped, routing to the Document. - [ ] Human-authored documents do NOT produce rows. - [ ] Reuses the single auto-clear window (no second constant); stale deliverables age out. - [ ] `cargo check` clean; `npm run verify` green (test: an AI document renders a review row; a human one does not). ## Blocked by - WI "Attention Inbox: slice-done trigger + time-based auto-clear" (019f1778-57ad-7500-ad1a-869be806ac82).
toasterson force-pushed claude/wi-019f1778-attention-inbox-ai-deliverable-awaiting from 97f7fb1061 to a06b14a9e0 2026-07-05 00:46:43 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-ai-deliverable-awaiting from a06b14a9e0 to 1cabcb92fc 2026-07-06 03:48:58 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-ai-deliverable-awaiting from 1cabcb92fc to d873b5f22b 2026-07-06 05:07:30 +00:00 Compare
toasterson force-pushed claude/wi-019f1778-attention-inbox-ai-deliverable-awaiting from d873b5f22b to 34e922bb1b 2026-07-06 05:52:06 +00:00 Compare
Author
Owner

Merged to main at ae5d72d (human-gated integration of the 20-PR approved batch; homelab deploy 05585a1). This PR's build_dashboard implemented the full trigger set (parked + decision_pending + slice_done + review), so it was taken as the canonical Attention Inbox and subsumes #284/#285/#286 (which were parallel partial re-implementations of the same inbox against the shared base). Closing.

Merged to main at `ae5d72d` (human-gated integration of the 20-PR approved batch; homelab deploy 05585a1). This PR's `build_dashboard` implemented the **full trigger set** (parked + decision_pending + slice_done + review), so it was taken as the canonical Attention Inbox and **subsumes #284/#285/#286** (which were parallel partial re-implementations of the same inbox against the shared base). Closing.
toasterson closed this pull request 2026-07-09 17:54:45 +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!287
No description provided.