Repository navigation
fix(sidebar): clear a standing bot's founder mention badge once read - #252
nullStack65 wants to merge 3 commits into
Conversation
The standing-bot row badged a founder-named message forever: it passed the shell's mention names to resolveBotAttention with no read check, so opening the bot and reading it left the purple name pill on. The shell now carries the time of the message that names the founders (attentionMentionsAt, from the same latest-visible-message lookup). The row compares it with the viewing founder's own read cursor, the one the rest of the sidebar uses (a message at or before the visit is read; a later one re-badges). Decisions, reviews, approvals and joint sign-offs still badge until answered. Model: claude-sonnet-5-5 Task: fix Agent: Platform Lane: CLO-1359 Harness: t3/claude-code Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
…ature Model: claude-sonnet-5-5 Task: fix Agent: Platform Lane: CLO-1359 Harness: t3/claude-code Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Independent full review of the standing-bot mention badge (t3code pull request 252), read at head F1 (important, open): a shared standing bot such as Product Designer does not clear its name pill when that founder reads it. A named founder's visit updates The click jobs that failed twice and then passed on this head, and the passing clean-base job, are not evidence about this path. I did not re-run the suite. {
"reviewed_base": "1d87e8030dda52d154c763b204ee147d4737bc9a",
"reviewed_head": "e9f14efd91bd27c45ba767fb433bda0c4d779d1e",
"reviewer": "magpie-grok, T3 Code",
"reviewer_family": "grok",
"author_session": "t3code-pr-252-author commit:e9f14efd91bd27c45ba767fb433bda0c4d779d1e model:claude-sonnet-5-5 harness:t3/claude-code lane:CLO-1359",
"reviewer_session": "grok-session:01a23092-266b-7273-8405-e2e603482ab1",
"fresh_context": true,
"review_kind": "full",
"round_id": "grok-full-01a23092-266b-7273-8405-e2e603482ab1",
"intent": [
"The founder's name pill should clear when that founder reads the mentioned message.",
"A later mention must show a fresh pill.",
"Use the same notion of read as the rest of the sidebar.",
"Preserve per-founder isolation on shared threads, and keep decisions, reviews, approvals and joint sign-off until answered.",
"Do not change routing, settle the design conversation, or alter live database contents."
],
"prior_findings": [],
"findings": [
{
"id": "F1",
"severity": "important",
"outcome": "open",
"file": "apps/server/src/orchestration-v2/ProjectionStore.ts",
"line": 2516,
"summary": "A shared standing bot's read updates visitsByFounder and leaves lastVisitedAt unchanged (Orchestrator.ts dispatchThreadVisit, globalMoves is false when a named founder visits a shared thread). shellFromState, which builds the sidebar snapshot, copies lastVisitedAt at line 2516 and does not copy visitsByFounder, unlike threadShellFromProjection at line 2179. The client then treats the cursor as the shared watermark (seenCursorForViewer falls through when visitsByFounder is missing). Opening Product Designer and reading it therefore does not clear the name pill. SidebarBotsGroup.browser.test.tsx builds the row with presentThreadShell and a visitsByFounder map, so it never takes the snapshot path."
}
]
} |
…'s read clears their mention pill shellFromState, which builds the shells the server snapshot and getThreadShell return, copied lastVisitedAt but not visitsByFounder. On a shared standing bot a named founder's read only moves their own cursor, so clients fell back to the shared watermark and never saw the read. Copy it, and cover the SQL snapshot path (the existing sidebar test builds its row through threadShellFromProjection, which already copied it). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
{
"reviewed_head": "1984c85d0a534e980ab7cfa872f81ae01ced26e6",
"reviewed_base": "1d87e8030dda52d154c763b204ee147d4737bc9a",
"reviewer": "claude-sonnet-5-5",
"reviewer_family": "claude",
"review_kind": "focused_recheck",
"round_id": "grok-full-01a23092-266b-7273-8405-e2e603482ab1",
"author_session": "t3code-pr-252-author commit:e9f14efd91bd27c45ba767fb433bda0c4d779d1e model:claude-sonnet-5-5 harness:t3/claude-code lane:CLO-1359",
"reviewer_session": "claude-code-session:d0039109-92a9-4138-833e-a51b1de3f53d",
"fresh_context": true,
"intent": [
"The repair at head 1984c85d adds visitsByFounder to the snapshot shell built by shellFromState in ProjectionStore.ts.",
"Both callers of shellFromState (the shell snapshot at about line 9841 and the single-thread shell read at about line 10434) now return the per-founder cursors.",
"The data reaches shellFromState: the visit event writes visitsByFounder into the stored thread payload, and the snapshot decodes that payload through the thread JSON schema, which declares visitsByFounder.",
"The shell schema declares visitsByFounder, so the field is not stripped when the snapshot is sent to the client.",
"The client reads it: presentThreadShell calls seenCursorForViewer, which returns the viewer's own cursor when the thread is shared and visitsByFounder is present, so the name pill compares mentionedAt against the founder's own read.",
"The fix cannot hide the finding by changing semantics for other threads: the field is copied only when defined, so unshared or older threads keep falling back to lastVisitedAt as before.",
"The new test goes through the snapshot path and checks the snapshot, the single shell read and the in-memory projection against the same per-founder cursors, with lastVisitedAt left unchanged, which is the exact failing case in F1.",
"The diff from the reviewed head e9f14efd to 1984c85d touches only ProjectionStore.ts (4 lines) and ProjectionStore.test.ts; it is limited to F1. I did not re-run the test suite."
],
"prior_findings": [
"F1"
],
"findings": [
{
"id": "F1",
"severity": "important",
"file": "apps/server/src/orchestration-v2/ProjectionStore.ts",
"line": 2516,
"outcome": "confirmed",
"summary": "Re-check result: the repair holds and F1 is resolved on this head. Fix is at ProjectionStore.ts lines 2517-2520 in shellFromState: the shell now spreads visitsByFounder from input.state.thread when it is defined, matching threadShellFromProjection at line 2179. The state's thread comes from the stored payload, which the visit event updates with visitsByFounder, so the snapshot and the single-thread shell read both carry each founder's own cursor. seenCursorForViewer then returns the named founder's cursor for a shared thread instead of falling through to the unchanged lastVisitedAt, so a read clears the name pill. The added test 'shells keep each founder's read cursor on the server snapshot path' drives thread.visit-recorded with lastVisitedAt unchanged and asserts the snapshot, getThreadShell and threadShellFromProjection all return the same per-founder cursors.",
"rechecked_head": "1984c85d0a534e980ab7cfa872f81ae01ced26e6"
}
]
} |
Browser proof
vp test run --project browser src/components/sidebar/SidebarBotsGroup.browser.test.tsx), which renders the realSidebarBotsGrouprow.SidebarBotsGroup.tsx(read clears the pill; each founder judged on their own read).Problem
Opening a standing bot (for example Product Designer, a shared FYI conversation with no pending decision) and reading its messages left the purple founder-name badge on its sidebar row forever.
SidebarBotsGrouppassed the shell'sattentionMentionstoresolveBotAttentionwith no read check (Linear CLO-1359, the standing-bot mention badge that never cleared).Change
attentionMentionsAt, the time of the message that names the founders (same latest-visible-message lookup, SQL and in-memory paths agree).resolveBotAttentiontakesmentionedAtandlastVisitedAt; the name pill clears when the mention is at or before the viewing founder's own visit. A later mention shows a fresh pill. With no stamp or no time the pill stays.SidebarBotsGroupfeeds it the same per-founder read cursor the rest of the sidebar uses (resolveThreadLastVisitedAt).Scope
Contracts (
botAttention,orchestrationV2), server projection (ProjectionStore), web standing-bot row. Only surface that renders this mark: grep showsresolveBotAttentionandattentionMentionsare used nowhere else (no mobile consumer).Verification
botAttention.test.ts+orchestrationV2.test.tspass (53); the new cases fail against the old function.ProjectionStore.test.ts(mention time, SQL vs in-memory) andHumanNote.test.tspass; server typecheck clean.vp fmt --checkandvp linton touched files: clean for this change. Lint reports one error atbotAttention.ts:29and a warning inProjectionStore.ts:8151; both are on lines this PR does not touch.qa/check-map.ts --changed: ok.Sidebar.logic.test.tsandbotOrgTree.test.ts; knip unused exports inAgentOutputGate.ts,RemoteDelegation.ts,secretRedaction.ts; React Compiler bailouts infounderSessionSeed.tsxandLinkedThreadPane.tsx. Not compared against a clean base build.check:changedtimed out at 900s; I ran the affected tests directly instead.Deploy: fleet
Prior art
lastVisitedAt,visitsByFounder,seenCursorForViewer,hasUnseenCompletion): reused as the notion of read; no new store.🤖 Generated with Claude Code