Repository navigation
feat(FIX-2154): Grok Bot-style lab front end, on fixtures - #3798
Conversation
labs/teammates: a list of workers (lead, researcher, writer), each with one long conversation, and workers that message each other where you can see it. Worker talk shows as one-line cards in both conversations and in a Talk panel over the message log (D1). A message never interrupts the turn you are in: it shows as pending and lands after (D2). A divider marks where the turns the worker reads word for word begin, labelled "summarized" only when the earlier turns were. The screen reads and writes through one adapter whose functions name the package calls they stand for; until wiring they run on src/fixtures.ts. The inventory script fails on any file that is not config, React UI, a small flow, a check or a fixture. Setup copied from the Claude Code-style lab, no code shared. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0147y64Do6d4RkSqzyXhUyKg
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
@codex review Please look especially at:
Generated by Claude Code |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Second look + architecture pass (read-only; for the implementing agent to triage)Overall the shape earns its scope: one adapter, fixtures confined to one file, joins as plain functions in Correctness (worth fixing in this PR)
Architecture (the refactor opportunity is now, before wiring multiplies it)
Tests (intent)
None of this blocks the approach; #1 and #3 are the ones I'd fix before merge, #6/#7 are cheapest to do before the adapter is wired. Generated by Claude Code |
Fallow flagged it as an export with no consumer. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0147y64Do6d4RkSqzyXhUyKg
There was a problem hiding this comment.
/simplify review (FIX-2154 · teammates lab)
Verdict: The adapter-first, fixture-until-wiring shape matches ER-5 and the epic inventory rules; I would not replace it with a thinner “just React + mocks” lab without losing the wiring checklist and anti-game boundary. Where complexity crept in is mostly how watches and fixtures are wired, not that they exist.
What looks like the right approach
LabAdapteras the only package seam — UI stays ignorant of workforce/client; the README + adapter table are the wiring contract. That is heavier than a demo, but it is the spec product.- Scripted fixtures — Needed to prove D1/D2/divider on screen before G1/G2 land; screen tests on
speed: 0.05are the right verification tier for this PR. - Design-system + hand-rolled panes — Sensible; importing Shift Manager would violate “copy layout, not package.”
Where it went further than necessary (and cleaner alternatives)
| Area | Issue | Simpler direction (optional / follow-up) |
|---|---|---|
| React subscriptions | Every WorkerItem holds 3 useWatch hooks; the selected worker also subscribes in Conversation + TalkPanel → duplicate filter/sort work on every fixture notify(). |
Lift one subscription per channel at App (or a tiny LabWatchProvider / useSyncExternalStore keyed by worker+session). Sidebar rows become pure props. Matches Shift Manager’s snapshot style without depending on that package. |
| Fixture bus | Global listeners + notify() rebroadcasts to all watches; watchTalk filter+sort runs per listener. |
Fine for 3 workers; at wiring, real SSE will want scoped emits anyway. Consider channel-keyed listeners in fixtures so you do not bake in broadcast semantics. |
fixtures.ts size |
~half simulator, ~half seed narrative (52+ turns, writer thread). | Split static seed data (seed.ts / JSON) from queue + timer (~80 lines). Tests could use adapter.tick() instead of wall-clock setTimeout chains (and cancel timers on Unsubscribe to avoid post-cleanup() flake). |
components.json |
shadcn scaffold with no src/components/ui/* yet — only cn + tokens. |
Drop until first fsdev ui add; keep tokens.css + design-system import. |
| Inventory (ER-1) | adapter.ts is bucketed as React UI (inventory.mjs), while the spec table lists adapter separately. |
Add an adapter kind (or count under config) so the README proof matches spec semantics. |
| Wiring names | Spec table uses listTalk / workerActivity / summarizedUpTo; code uses watch* — reasonable for streams, but worth one line in README that watch = future useSession / log subscription. |
At wiring, bind to useSession, listSessionRequests, WorkerMessageRow paging (kitchen-sink + shift-manager messages.ts as reference), not a second client abstraction. |
Third-party / reuse (not implemented yet — by design)
@flow-state-dev/reactuseSessionshould replacewatchConversationwhen wired.- Message log: reuse
WorkerMessageRow+ collection paging; mapreplyTo→inReplyToonce at the adapter. - Do not pull in
@flow-state-dev/devtooljust foruseSessionRequests— copy the small client poll pattern if needed.
Skipped (larger than this PR)
- Virtualizing long conversations, incremental log indexes, merging
ConversationEntrywithItemsRendererbefore G2 — all wiring-era concerns.
Approval stance
No merge blockers from this pass: complexity is concentrated in intentional lab proof, not accidental glue. I’m leaving COMMENT (not Approve) so the watch/subscription duplication and fixture timer lifecycle are visible for a quick pre-wiring tidy — happy to approve after those are addressed or explicitly deferred to wiring.
Sent by Cursor Automation: Review For Best Approach
|
Thanks for the /simplify pass. All of it is marked optional, so here's where each point stands:
Generated by Claude Code |
There was a problem hiding this comment.
Code Snob — a smaller shape, same screen. POC: #3800 (03147c0e2). That PR does not merge.
useWatch is called six times. Each call exists to spell the callback (Parameters<LabAdapter["watchTalk"]>[1]) and hand the hook a deps array it then ignores under an eslint disable. Every watch on this adapter is (id, onChange). Pass the method and the id.
Unread counts are read only by the worker list. Threading seen / onSeen through App adds a prop pair and a second nameOf. The list can hold useSeen and use the nameOf the conversation already has.
The two typed temps in the fixture watches only named the object they passed on.
Net −17 against 15f864237 (+27/−44). pnpm --filter @flow-state-dev/teammates typecheck is clean. The lab tests are 10 passed (7 screen, 3 inventory), including the pending line and the unread count. Divider, Talk panel, and the fixture script are unchanged.
Fold 03147c0e2 onto this branch. Close #3800 unmerged after this PR lands.
Sent by Cursor Automation: Code Snob
useWatch takes the adapter method and its id. Unread state stays in the worker list, the only reader. Same screen. Co-authored-by: Jake Hoffner <jhoffner@users.noreply.github.com>
|
Folded Generated by Claude Code |


Requested by Jake · project thread
The problem
Someone who has used Grok Bot meets Workforce through Shift Manager, which is a new way of working. The epic needs a second, familiar app on the same package pieces. The approved spec (#3787) designed it: a list of workers, one long conversation each, and workers that message each other where you can see it. The package pieces it needs (FIX-2070's messaging, the history-window gap) are still being refactored, so Jake asked for the front end to be built now, on fixtures.
What this does
A new private lab,
labs/teammates, with the screen from the spec's wireframe:Everything goes through one adapter,
src/adapter.ts. Each function names the package call it stands for (roster(),ensureWorkerSession,respond, session items, the message log,listSessionRequests, the window's mark). Until wiring, they run onsrc/fixtures.ts, markedfixture:. The lab copies FIX-2153's setup (the app contract incli/index.ts, the design-system theme, the registry tokens, the inventory script) and shares no code with it.What's asked of you
Nothing new. This implements the approved direction in
specs/issues/FIX-2154/(D1 and D2). Wiring waits on FIX-2070 and the history-window gap, as the spec says.Parts worth reviewing closely
src/lib/talk.ts→pendingFor): a log row addressed to the worker with no received entry carrying its message id. That needs G2 (a received message with its id). Check that the join can't show a stale pending line for a message that already landed.WorkersList.tsx): per viewer, in browser storage. A worker never seen starts with nothing unread, and the open conversation is marked seen as it grows. Check that the effect can't loop.scripts/inventory.mjs): 31 files, no other row. Config 13 files, React UI 14, fixtures 1, checks 3.SPEC.md · DECISIONS.md · Linear FIX-2154 · epic FIX-2152 · sibling lab #3793. Merges on approval. No changeset: the lab is private.
How to review this
How to review this. This implements an approved spec — the approach and the numbered decisions in its
DECISIONS.mdare already signed off by a human, so please review the code against that direction, not the direction itself. The canonical set is retained atspecs/issues/FIX-2154/onmain; Linear links to it and the original merged spec PR, which keeps review history. Follow-up amendment PRs explain later direction changes. Current architecture docs remain the authority for shipped behavior (BP-037).Most valuable here: correctness on the second path (the legacy shape, the null boundary, the concurrent case, the cancel path), anything deriving an auth or routing decision from caller-controllable input, and a behaviour the tests assert around rather than on.
Already settled upstream: the approach and every decision in the spec's
DECISIONS.md(human-approved — if one is wrong, say so as a spec finding and it gets folded back; don't re-argue it inline), and the conventions indocs/contributing/best-practices.md.Engineering calls
listTalk,workerActivityandsummarizedUpTobecamewatchTalk,watchActivityandwatchWindow, because each one is a live subscription. The header table inadapter.tsmaps each one to its package call.usesplusafterAnswer) lives in the host file, which wiring adds. The README says so. This PR has no host file and nofsdev.config.mts, which matches the sibling lab.Everything else: verification
pnpm --filter @flow-state-dev/teammates test: 10 passed (7 screen, 3 inventory).pnpm --filter @flow-state-dev/teammates typecheckandbuildare clean.node scripts/inventory.mjspasses, and--controlfails as required on a plantedsrc/glue.ts.Generated by Claude Code