Skip to content

fix(sidebar): clear a standing bot's founder mention badge once read - #252

Open
nullStack65 wants to merge 3 commits into
release/native-0.1.10from
clo-1359-founder-mention-badge-read
Open

nullStack65 wants to merge 3 commits into
release/native-0.1.10from
clo-1359-founder-mention-badge-read

Conversation

@nullStack65

@nullStack65 nullStack65 commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Browser proof

  • URL: none live. Checked in real Chromium through the repo's browser test project (vp test run --project browser src/components/sidebar/SidebarBotsGroup.browser.test.tsx), which renders the real SidebarBotsGroup row.
  • Time: 2026-12-01 ~02:18 ET. Result: 5/5 pass on this head; 2 of 5 fail against the old SidebarBotsGroup.tsx (read clears the pill; each founder judged on their own read).
  • Screenshot: none captured.
  • Gaps: not yet observed on a running desktop/web client against a live Product Designer thread, and no before/after screenshots. That pass belongs with the fleet rollout.

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. SidebarBotsGroup passed the shell's attentionMentions to resolveBotAttention with no read check (Linear CLO-1359, the standing-bot mention badge that never cleared).

Change

  • The shell now also carries attentionMentionsAt, the time of the message that names the founders (same latest-visible-message lookup, SQL and in-memory paths agree).
  • resolveBotAttention takes mentionedAt and lastVisitedAt; 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.
  • SidebarBotsGroup feeds it the same per-founder read cursor the rest of the sidebar uses (resolveThreadLastVisitedAt).
  • Decisions, reviews, approvals and joint sign-offs are checked first and are untouched; agent-only audience unchanged; no routing, design or database content changes.

Scope

Contracts (botAttention, orchestrationV2), server projection (ProjectionStore), web standing-bot row. Only surface that renders this mark: grep shows resolveBotAttention and attentionMentions are used nowhere else (no mobile consumer).

Verification

  • contracts: botAttention.test.ts + orchestrationV2.test.ts pass (53); the new cases fail against the old function.
  • server: ProjectionStore.test.ts (mention time, SQL vs in-memory) and HumanNote.test.ts pass; server typecheck clean.
  • web: new browser test 5/5 (unread badges, read clears, newer mention re-badges, per-founder isolation, open decision stays badged).
  • vp fmt --check and vp lint on touched files: clean for this change. Lint reports one error at botAttention.ts:29 and a warning in ProjectionStore.ts:8151; both are on lines this PR does not touch.
  • qa/check-map.ts --changed: ok.
  • Not caused by this change (untouched files): 9 web typecheck errors in Sidebar.logic.test.ts and botOrgTree.test.ts; knip unused exports in AgentOutputGate.ts, RemoteDelegation.ts, secretRedaction.ts; React Compiler bailouts in founderSessionSeed.tsx and LinkedThreadPane.tsx. Not compared against a clean base build.
  • The package test step of check:changed timed out at 900s; I ran the affected tests directly instead.

Deploy: fleet

Prior art

  • Existing read cursors (lastVisitedAt, visitsByFounder, seenCursorForViewer, hasUnseenCompletion): reused as the notion of read; no new store.
  • Separate mention-ack table or event: rejected, adds state where the cursor already answers it.
  • Searched: this repo's sidebar and client-runtime read path, 2026-12-01.

🤖 Generated with Claude Code

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]>
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…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]>
@nullStack65

Copy link
Copy Markdown
Owner Author

Independent full review of the standing-bot mention badge (t3code pull request 252), read at head e9f14efd91bd27c45ba767fb433bda0c4d779d1e and base 1d87e8030dda52d154c763b204ee147d4737bc9a. Reviewer family grok. One finding.

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 visitsByFounder and leaves lastVisitedAt unchanged (Orchestrator.ts dispatchThreadVisit: globalMoves is false on a shared thread). shellFromState, which builds the sidebar snapshot, copies lastVisitedAt and does not copy visitsByFounder. The in-memory threadShellFromProjection does copy it. With the field missing, seenCursorForViewer uses the shared watermark, so the new mentionedAt <= lastVisitedAt check never sees the read. SidebarBotsGroup.browser.test.tsx builds the row through presentThreadShell with visitsByFounder already set, so it does not cover this path.

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]>
@nullStack65

nullStack65 commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner Author
{
  "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"
    }
  ]
}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant