Repository navigation
fix: retire expired approvals from the notifications feed - #14739
jeeshofone wants to merge 2 commits into
Conversation
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the patch removes nothing, rendered evidence of this revision is committed, and slotless decides use the same owner check as the bare-id route. Notes
[DESIGN-REVIEWED] 7d61167 Description read[DESCRIPTION-READ] 292d2504a695c8d1254c405cb1578a770336754391318cc9cb219322fcb3673c That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Every item traces to issue #14711 or to an invariant the spec already records. The one leftover is a single-value map type, which is a note and does not block. Notes
What this change shipsInventory (10 items) — 9 justifiedIntent: an expired tool approval should stop sitting in the Notifications panel with dead Approve/Reject, and a failed press should say why. FIX.
[FIRST-PRINCIPLES-REVIEWED] 7d61167 Description read[DESCRIPTION-READ] 95acbdda4b48d5cce92e08db8167e6eabd2715a5edc7da773c2aecab74a86731 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — 🔴 changes requested (blocking)Reviewed 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/dashboard/handlers/sessions_parts/live_turn.py:188 -- Concurrent target decisions erase the winning responder (origin: validation)
[BLOCK-MERGE] 7d61167 Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 (fenced): the harm is a corrupted attribution record for who decided an approval. I confirmed every condition in code and could not argue it is rare enough to FLAG.
|
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS The 17 committed stills cover every new state: retired, the 5xx hedge, quoted 400, decided with a failed DELETE (dark and light), slotless cron, and expiry during a press. The expiry removal has a recording. No blind reader has read them; pushing the branch to this repo runs one. Notes
[UX-REVIEWED] 7d61167 Description read[DESCRIPTION-READ] d762e1b5dc299403fc7bc68865c8f0058abf714f0284fd6f0d416798e3bdd2a5 That sha256 names everything this verdict read: the PR description, plus the 20 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
c874f8f to
b1a071f
Compare
b1a071f to
7b4b205
Compare
|
Dispositions for the review findings on
Local checks on |
7b4b205 to
eff33de
Compare
|
Dispositions for the findings on
Local checks on |
|
Disposition for the GPT 5.6 blocking finding on Still open and needing a body edit I cannot make in this run: the UX BLOCK (screenshots of this revision; captures are ready) and the Design/First-Principles CONCERNS that the description still says "No new catalog strings" and "four new tests". The diff now adds |
eff33de to
4112d90
Compare
|
|
First-pass check: R1-R8 OK. |
|
|
|
|
|
|
|
Fixed in Test: First-pass check: R1-R8 OK. |
Fixed in Test: First-pass check: R1-R8 OK. |
Holding position, as on |
Holding position. On this head the repository's adjudication upheld the GPT lane's finding about the unread counts: a settled row asks for nothing, so it must stay out of the bell, desktop badge and page unread counts. Dropping the |
Holding position. Shown on a settled row, Mark unread would put the row back in the unread counts through the panel's own press. That is the outcome the GPT finding upheld on this head rules out. |
Holding position, as on |
Holding position. When a decision lands and the stored note's DELETE then fails, the request has already ended. The |
Holding position. A press's response lands on its row: a refusal is shown there, and a landed decision removes the row. If a cap eviction, a clear-all or a snapshot drops the row while the press is in flight, a refusal has nowhere to show and the press fails silently, which is the silent-failure half of #14711. Only rows this tab is deciding are held back, so the list can exceed the cap by those rows and no more. The slice tests pin a full ring arriving during a decision and 500 seeded interleavings of presses, snapshots, clears and ring fills. The panel tests pin an expiry frame during one. |
Holding position. Both guard this PR's reconnect reconcile, the step that retires a row whose approval ended while the socket was down. GPT 6.1 blocked |
Fixed in the next push. |
Fixed in the next push, in the first commit. A deciding row's record now has its own Class sweep: every caller of New slice tests fail on the previous head and pass now. They cover the close X and Clear all, and check that a frame-ended row still retires with its failure even after a close X. The 500-seed property test now models a clear as a dismissal, and it checks that a row no frame ended never retires with |
|
HOLD at 539e80f for maintainer review. The backend diff is line-identical to the 89be338 head I held in r123, and I still found no defect in it. The empty-slot target (live_turn.py#L150-L173) needs an exact instance, runs the same owner gate as the bare-id path, and matches only a record whose own slot is empty. GPT and Opus report no findings, and CI is green. What holds it:
— crew-pr-reviewer (r133) |
The feed and detail panel Approve/Reject buttons sent every rejection from resolveApproval to the console and left the row in place, so an approval that had already expired stayed listed with buttons that could never succeed. An approval_resolved frame removes the row. A decide this tab sent that the server refused as no longer pending failed, so it now retires the row in the notifications slice: the row stays listed without Approve/Reject, keeps its close X (shown without a hover), and renders through the shared ErrorNotice the sentence the chat card, tool group, Subagents panel and command center already show for a refused press. Retiring also marks the row read in this tab (the server holds no approval note, so nothing is sent) and drops the critical border and unread dot. A retired row recedes through its title and controls only; its notice keeps full contrast, and the row open in the detail panel leaves that sentence to the panel. The page feed, the bell popover and the detail panel read the same marks, and being read, a retired row leaves every unread count. A decision that lands removes the row, as before. An approval row is this tab's own copy (the server keeps no approval note), so a landed decision and the row's close X remove it locally and send no DELETE: there is no request left to fail. A retryable decide failure keeps Approve/Reject and says why on that row through the shared ErrorNotice, so no failed action is silent. A retired row's close X stays at near full strength while its title recedes, and the detail panel offers no read toggle on a retired row. A coordinator approval's id is the caller's and recurs, so each feed row carries the server-issued instance of the request it was raised for, and every coordinator approval_resolved frame names the instance it resolved, so an earlier request's retired row under the same id is not the one removed. A request that takes over an id ends the one it replaced with no frame, so the approval frame and the reconnect reconcile remove any live row under that id bound to another instance, and a row that names its request (slot and instance) decides with that coordinator target, so the server refuses a stale instance instead of settling the request that replaced it. When the pressed button is withdrawn, keyboard focus moves to the row's close X (or the detail panel's Close), the one thing left to do with it, instead of falling to the page body. A row whose decide is still in flight survives a notifications snapshot (the reconnect refetch) and a clear-all, with its marks, so a late refusal still renders on it. A clear-all or the row's close X marks it dismissed, not ended: the request may still be pending, so the row leaves once the response settles unless a refusal claims it, and a retryable failure never shows it as no longer pending. Only a frame ends the request. Both go through one list replacement in the slice. A 5xx or a missing response comes from the layer between the tab and the decide route, so the row says the decision may not have been recorded, in the chat approval card's own words, instead of quoting that layer's text; the route's own 4xx refusals are still quoted. A slotless approval (cron, autonudge, task runner) is decided with an empty slot and its instance, and only from the owner's browser session, as before. Only an approval row withdraws the detail panel's controls for a failed DELETE, since only it carries the notice, and the open approval row leaves that notice to the panel instead of showing it twice. The notice names the retry, the row's dismiss control in the feed, by that control's own accessible name, and the panel has no Dismiss of its own: a row leaves through its close X in the feed. On a retired row the notice sits under "no longer pending" and claims no recorded decision, in the panel, the page feed and the bell popover alike. Closes kirodotdev#14711
|
First Principles note (item 10, duplicate settled-row predicate): acknowledged, deferred as the description states. This push is a rebase onto current main with no behaviour change; the inline check in |
A retired or decided approval row is marked read in this tab only. Two paths made it unread again and relit the badge: the reconnect refetch reinstalled the server's unread flag, and an unread request sent before the settlement landed after it because the settle wrote no ack stamp. The fetch merge now keeps the local read state for a settled row, and each settle branch stamps the ack. A decide that names its coordinator target (slot and instance) settles through the decision registry, as a decide by id does, so the decision records the verified person who pressed it instead of an unknown responder settled by the host.
|
Moved to #27509: same commits, now on a branch of this repo so CI uses the CodeBuild fleet. Review history stays here. |
Problem / Motivation
Goal: An expired tool approval stops sitting in the Notifications panel with dead Approve and Reject buttons, and a failed press or dismissal on a feed row says why.
An expired cron approval stayed in the feed with live Approve and Reject; each press 404'd.
Why it matters
Cron and sub-agent approvals expire fast.
Not a goal
approvalDecisions,retiredApprovalsanddismissFailedinto one per-row phase record: refactor(notifications): one per-row phase record for approval rows #20618, landing after this PR and before fix: bind every approval decide to an owner-bound target #16481 restacks.Design
notificationsSlice.ts: idle -> deciding -> settled.decideApprovalRow, the one decide path for feed and panel, marks the row deciding, sends its target and settles on the response. A frame that ends the request callsendApprovalRow: an idle row leaves, a deciding row stays until its response lands. A terminal refusal retires the row. A landed decision whose stored-note DELETE fails settles asdismissFailed(decided): controls withdrawn, an infoStatusNotice(decision_recorded) above a blockErrorNotice(decided_clear_failed). A retryable failure keeps the buttons unless a frame ended the request meanwhile.replaceRows, and every growth path through ONE cap,capRows. A settled row is evicted like any note.decisionFailedCopy): a 4xx reason is quoted; a 5xx or no response hedges with the chat approval card's owncomponents.approvalCard.decision_failed, on a live row and on one a frame ended meanwhile.clearNotesclear (feat(notifications): stack notes by sender, clear by group #22744): a failed DELETE keeps the row under the oneclear_failednotice. A local row leaves throughdismissApprovalRow(dismissLocalApprovalRow). A close X or clear-all on a deciding row marks itdismissed, apart from a frame'sended: on a retryable failure the row leaves, and only a frame-ended row says "no longer pending". Why no Dismiss in the detail panel: its Close is one press from the row's X, as for every other note.What changed (motivation → approach → change)
approval_resolvedframe ends the instance-matched feed row (hooks/websocket/approvals.ts), so an expired cron approval leaves the feed. The frame names the record'sinstance(interaction_coordinator.py,state_parts/dashboard_services.py).approvalframe, or a reconnect listing a new instance under an id, ends the live row bound to another instance; the reconnect still adds the listed request's row beside an ended chat row. A read a newer one overtook changes nothing.approval_instance(types/index.chat.ts) and decides with the coordinator target (api/client/approvals.ts), so the server refuses a stale instance. A slotless row (cron, autonudge, task runner) sends an empty slot, matched only against a record with no slot (handlers/sessions_parts/live_turn.py).approval_no_longer_pendingthroughErrorNoticeand its close X visible. A withdrawn panel hides the read toggle; Close only closes and takes the lost focus. A row that leaves after a landed decision hands lost focus to the feed list. A retryable failure says why on the row.notificationFeedkeysdecision_recordedanddecided_clear_failed(it names the row's dismiss control by its accessible name) in every catalog (website/src/i18n/locales/).learn-cron-dashboard.md;api-reference.md(approval_resolved).coverage-baselines/frontend.txtdropsNotificationDetailPanel.tsx, now over the per-file floor.Backwards compatibility
Compatible:
approval_resolvedgains an optionalinstance. The decide route's coordinator target also accepts an emptyslotfor a record with no slot. Who may decide is unchanged: only the owner's browser session, which alone could decide a slotless record, may use the empty slot (bare_approval_decide_allowed), soAttentionCard.tsx's slotless decides stop getting 400; the internal secret, a peer-verified subprocess with noappclaim and no claim get 403approval_owner_required(pinned intest_chat_mode_security.py).ChatEmbed.tsxignoresinstance;kirocrew_clientuses the bare-id route;mochireadsapproved;crew-companionreleases on any resolution.Tests
Proof: not provable -- other: prove.py exits 2 applying this diff's committed PNG stills
Frontend, in
website/src/test/:notificationsSlice: end frames, ring fills and a local close X keep a deciding row; a refetch and a late unread receipt keep a settled row read; a refused DELETE keeps the decided mark; a row closed or cleared mid-flight leaves on a retryable failure instead of retiring; a 500-seed property test.NotificationFeed.retiredApproval: 5xx hedged on the row; an approve racing the expiry frame shows the refusal; a 503 or no response after it retires the row; a decided row's failed DELETE shows the status and the one alert; settled rows leave the unread count; a landed decision hands focus to the named list; 404.NotificationDetailPanel.approvalRefusal: the same, panel open; Close only closes and takes lost focus; no panel Dismiss; a retired row's failed DELETE claims no decision; a failed feed close X shows oneclear_failed; expiry, snapshot or clear-all mid-decision keeps the row.UseWebSocketCoverage: a reconnect's new instance adds its row; the tracked one does not; an overtaken first-connect read changes nothing.hooks/websocket/approvals.overtakenRead: an older read answering after or before a newer one changes nothing. 10 shuffled runs pass.useWebSocket.frameTrace,NotificationDetailPanel.readAndRelated; server:test_dashboard_approval_denials.py,test_chat_mode_security.py,test_state_parts_dashboard_state.py.Manual verification
website/scripts/capture-notification-approval-refusal.mjsdrives the built SPA and asserts each frame's state before writing it; all frames passed on539e80febf; frames 04 and 20 count only the detail panel's own Approve and Reject.Commits
This PR has two commits. The first retires expired approvals from the feed, and #16481 carries it on its own. So
unackNotificationByTschecks the settled state inline there, and the commit builds and passes withoutisSettledApprovalRow, which arrives with the second commit. Switching that check to the helper once both commits are on main is #25227.Screenshots / video
In
temp-screenshots/notification-approval-refusal/:01,05,09404 retired;03,04,06,10503 or no response;13,15expiry removes the row;17,17b(light),18decision lands, DELETE fails;19,20400 quoted;21,22slotless cron approval and its expiry;24,25expiry during the press, then 503.Related Issues
Closes #14711
Sibling sweep
Sibling: website/src/components/chat-input/approval.ts -- tracked in #16389
Sibling: website/src/pages/chat/ActivityViewer.tsx -- tracked in #16389
Sibling: website/src/pages/chat/page/transcriptRendering.tsx -- tracked in #16389
Sibling: website/src/hooks/useSceneInteraction.tsx -- tracked in #16389
Sibling: website/src/pages/ProjectDetailPage.tsx -- tracked in #16389
Sibling: website/src/pages/chat/command-center/AttentionCard.tsx -- not affected -- it already sends the coordinator target
Pattern harvest
Rule candidate: review-prompt
Pattern: a row a concurrent frame, snapshot or cap can remove needs one per-row hold before its press can report a refusal.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement