Skip to content

feat(FIX-2154): coder and a project per worker in the Grok Bot-style lab, on fixtures - #3811

Merged
jhoffner merged 3 commits into
mainfrom
claude/project-thread-aseh3k
Oct 24, 2026
Merged

jhoffner merged 3 commits into
mainfrom
claude/project-thread-aseh3k

Conversation

@jhoffner

Copy link
Copy Markdown
Collaborator

What this does

This adds the front end for the FIX-2154 spec amendment (#3804: D3, D4 and step 5) to labs/teammates. Like #3798, it runs on fixtures, and wiring comes later.

  • coder joins the roster. It takes tasks only and runs Claude Code. Its row reads tasks · Claude Code. Its pane shows its runs read only, with no composer, because it takes no messages.
  • The project is asked for at the first job (D3, talk-first). Talking to a worker never needs a project. When you ask lead for a code change, lead files a task for coder. With no project picked, the run is refused before any file exists, and the task card asks for a project. Nothing runs until you pick one. The pick sticks to lead, is posted in lead's conversation as your own line ("Work in relay."), and lead files the task again in that project. The header also has a project picker.
  • Task cards (D4). A card shows where the task runs and opens to the run's steps. The result lands as a line from coder, and if lead is answering you at that moment, it waits for that turn to end.
  • Config: a coder/WORKER.md with harness: claude-code, and delegates: [teammates.coder] on lead.

New adapter functions, each naming the call it stands for: listProjects, watchWorkProject and setWorkProject (FIX-2161), watchTasks (listTasks_tasks), and watchRun (the row's run link, followed). The README's fixtures table lists each one.

Evidence

  • pnpm --filter @flow-state-dev/teammates test: 12 pass. There are two new screen tests:
    • The full step-5 flow: no project, the card asks, no run during the wait, then the pick, the refile, the run in relay and the result line.
    • coder's pane: runs are shown read only, with no composer.
  • Negative check: I made the fixture's run fall back to a default checkout when no project is set. The step-5 test then failed. I restored the fixture and it passes again.
  • node scripts/inventory.mjs: PASS, 34 files, no other row.
  • tsc and eslint on the lab are clean, and fallow reports nothing for the lab.
  • Screenshots (light and dark) were checked in a browser against the built lab.

No changeset: the lab is private.


Generated by Claude Code

…lab, on fixtures

The front end for the spec's amendment (D3, D4, step 5). coder joins the
roster as a worker that takes tasks only and runs Claude Code; its pane
shows its runs read only, with no composer. Asking lead for a code
change files a task: with no project picked, the run is refused before
any file and the card asks for one; the pick sticks to lead, is said to
lead as your line, and lead files the task again. The result lands as a
line from coder. Talking to a worker never needs a project.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147y64Do6d4RkSqzyXhUyKg
@linear-code

linear-code Bot commented Oct 23, 2026

Copy link
Copy Markdown

FIX-2154

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-docs Ignored Ignored Oct 23, 2026 11:53pm UTC
flow-state-dev-kitchen-sink Ignored Ignored Oct 23, 2026 11:53pm UTC
flow-state-dev-ui Ignored Ignored Preview Oct 23, 2026 11:53pm UTC

Request Review

Copy link
Copy Markdown
Collaborator Author

@codex review

Please look closely at three areas:

  • The refile path in src/fixtures.ts. The refused task has to be filed again exactly once after the pick, and a later line to lead must not file it again.
  • The new adapter functions. Each should stand for one existing package read, matching the spec's adapter table in specs/issues/FIX-2154/SPEC.md.
  • Conversation.tsx. The pick should store the project first and only then send the line.

Generated by Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T23:54:32.287507Z 76ce257 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Collaborator Author

Second look + architecture pass (read from the diff only; not run)

The approach is right for a fixtures lab: the adapter stays the one seam, and each new call names the package call it stands for. Findings, most important first.

Should fix in this PR

  1. Dead end after a header pick. Conversation.tsx header <select> calls adapter.setWorkProject only. pick() (the card path) also posts "Work in X." so lead refiles. If a user picks from the header while a card is in needs-project, the card flips to refused · no project (TaskCard.tsx status derivation), the prompt disappears (asking needs !workProject), and nothing refiles. There is no way forward from that state. Either route the header through the same pick, or keep the prompt/offer a "refile" on a refused card whose filer now has a project. The new tests only cover the card path.
  2. Formatting break in Entry.tsx. The patch has ); case "result": on one line (missing newline/indent after the previous case). Looks like prettier wasn't run on this file. Please run the repo formatter.
  3. harness is a display string in the fixture. WorkerRow.harness is documented as "from its WORKER.md harness setting", but the fixture sets "Claude Code" while WORKER.md says claude-code. At wiring the row would read tasks · claude-code, and the screen test pins "tasks · Claude Code". Decide now which side owns the display name (a small label map in the lab, or show the raw setting) so wiring doesn't change the asserted UI.

Simplification opportunities (this PR is the natural moment)

  1. Runs.tsx FiledBy fans out one watchTasks + one watchWorkProject subscription per talking worker, then filters by to === runner. The board is keyed by the task's recipient, so the real call is more likely "tasks for this runner" than "tasks per filing conversation". Consider watchTasks taking either { sessionId } or { runner }. That deletes FiledBy, the sessions/workers props on Runs, and the .filter wrapper. Worth settling before wiring bakes the per-session shape in.
  2. TaskCard takes seven props and derives "refused vs needs a project" from workProject (a second source) instead of from the task. If the board row carried the refusal reason, or the card was told asking by its parent, workProject/projects/filer would shrink. At minimum, the status ternary should be a small lookup, not nested.
  3. Entry has a case "task": return null that exists only to satisfy the exhaustive switch, while Conversation special-cases task before calling Entry. Two places know task is special. Prefer one: either Entry renders it (pass the card in via a render prop) or narrow the type passed to Entry to exclude task.
  4. Runs and Conversation duplicate the header block (name, role, <main aria-label="Conversation">). Runs also reuses aria-label="Conversation" for a pane that has none, which is why the test finds it with that name. A shared WorkerHeader or a distinct label ("Runs") is cheap now.

Architecture note for the wiring step (not this PR)

  1. The README says wiring adds "coder's worker flow, one harnessManager per harness over projectWorkspace(), routing each task by the worker's harness setting." That is the lab's one small flow, and it is generic: any app that sets harness: in WORKER.md would write the same router. The lab's stated contract is that anything beyond configuration, UI and tiny flows is a gap filed against the package. This looks like that gap (workforce/harness-manager resolving harness: to a manager). Suggest filing it against the package now rather than letting the lab own it.

Minor / fixtures only

  • setWorkProject then send in pick() can leave the project set with no refile if send fails; fine for fixtures, note for wiring.
  • Fixture script refiles on any later line to lead once a project exists and a refused task is unfiled, not only on "Work in X." A test sending an unrelated line after the pick would see a surprise refile.
  • ProjectPrompt seeds useState(projects[0]?.id); fine today because projects load with the roster, but it would stay "" if they ever arrive later.

No blocker on the fixture design itself; items 1–3 are the ones I'd want changed before merge.


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify review (FIX-2154 · coder + project on fixtures)

Scope on current main: this PR is one commit (~13 files, all labs/teammates/). Earlier stack (full lab shell, durable-by-default, FIX-2158 spec) is already merged; that keeps this delta appropriately small.

Is this the right approach?

Yes. The spec’s fixture-first bar (D3/D4) maps cleanly to:

  1. Extend LabAdapter with project + task + run watches (same shape as existing watchTalk / watchConversation), with the wiring table in adapter.ts as the single contract.
  2. Keep task UI in React (TaskCard shared by conversation + Runs) instead of growing ConversationEntry rendering inside Entry.
  3. Prove coder-as-task-only with a separate center pane (Runs) rather than bolting harness UI onto talk workers.

A simpler alternative would have been to defer D3/D4 until workforce wiring (2161 / real listTasks). That would shrink this PR but would delay evidence for “talk-first + refused no-project + harness delegate” — the decisions you already locked in DECISIONS.md. For ER-1, the adapter boundary + delete-at-wiring fixtures is the established lab pattern; pulling in Shift Manager lib/* now would cross the “app adds only UI + config” line (and the spec explicitly copies patterns, not imports).

Not worth adding: a third-party pub/sub or state library for fixtures — global notify() is fine at lab scale; at wiring you’ll replace it with client subscriptions anyway.

What went farther than necessary (actionable, not blocking)

Area Note
Two project-pick paths Header <select> only calls setWorkProject; card ProjectPrompt calls pick() (set + send to refile). README says header pick “works too,” but after header-only pick the card can show “refused · no project” until the next user line triggers fixture refile. Consider one applyProject(project, { refile }) used by both, or narrow README to “sets default before jobs.”
Entry + task task entries render in Conversation while Entry’s task case is null — workable but confusing; either narrow before Entry or drop task from the union for conversation feed items.
TaskCard type name Interface TaskCard vs component TaskCard — rename row type (BoardTask / TaskRow) before wiring.
fixtures.ts script() Order-sensitive branches (/coder/, refiled, refused refile) are the real complexity hotspot; a small scenario table or leadScriptForUserText would help maintain step 5 without changing behavior.
Fixture perf Global fan-out + Runs mounting watchTasks per filer is OK for the lab; when wiring, batch subscriptions (roster/session scope) to avoid N+1 streams.

Skipped (larger than this PR)

  • Shared getAssetPath with shift-manager (only two apps today).
  • Extracting Shift Manager conversation helpers into a package (intentionally deferred to wiring).
  • Fixing fsdev chat --store / dataLine (not in this diff; still a good follow-up when the lab goes durable).

Verdict

Approve. Direction and decomposition match the spec; complexity tracks real decisions (project gate, coder harness, dual center panes), not accidental abstraction. Inline nits below are polish before or during wiring — none change the architectural call.

Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

Comment thread labs/teammates/src/components/Entry.tsx Resolved
Comment thread labs/teammates/src/adapter.ts Resolved
Comment thread labs/teammates/src/fixtures.ts Resolved
Comment thread labs/teammates/src/components/Runs.tsx Resolved
Picking lead's project from the header while a job waits on one now
takes the card's path: store the project, then say it to lead, so lead
files the task again. Codex review on #3811.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147y64Do6d4RkSqzyXhUyKg

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Snob — already tight. No POC.

Read labs/teammates/src/adapter.ts, App.tsx, fixtures.ts, components/Conversation.tsx, Entry.tsx, Runs.tsx, TaskCard.tsx, WorkersList.tsx (the status line), lib/use-watch.ts, and test/screen.test.tsx.

A rewrite leaves this contract the same size.

  • FiledBy is the subscription. watchTasks takes a conversation id, and a hook cannot live inside the .map, so one child per filer is the loop. Keying that watch by the runner would be a different adapter than the one this PR names (the conversation board's rows).
  • The card prints needs a project or refused · no project from needs-project together with whether the filer has a project now. The screen test reads both strings. Storing the phrase on the row moves the same branch. `${task.status} in ${task.project}` only folds the running/done half.
  • Entry's task arm returns null because Conversation draws the card from the board row. Excluding task from Entry's argument deletes that arm. The branch in Conversation stays: the card needs the row, the project, and pick. Handing those to Entry adds them on every entry.
  • taskTile has one caller. The body is the find.
  • Conversation and Runs share the main/header/scroll classes. Conversation still carries the project select, the working chip, Talk, and the composer; Runs carries the harness chip. A pane with those slots is longer than the two headers.
  • received and result share a frame. The accent classes and the note (reply, task done) are the whole difference, and the classes have to be written in full, so a shared card ties.
  • The run's steps use their own timers so the filing turn can end. The result then waits on lead the same way a received message does. One play() over both loops is about a line.
  • refiled is the set of refused tasks already filed again. A flag written back onto the row is a longer update.
  • The comments that restate the next line are the takes-tasks activity note and the step labels in the new screen test. The pick comment is why send follows setWorkProject. Removing the labels leaves the asserts.
Open in Web View Automation 

Sent by Cursor Automation: Code Snob

…ne Runs

Cursor review on #3811: the row type no longer shares the card
component's name, the task-only pane has its own landmark label, and
Entry's switch is formatted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147y64Do6d4RkSqzyXhUyKg
@jhoffner
jhoffner merged commit d6760c1 into main Oct 24, 2026
18 checks passed
@jhoffner
jhoffner deleted the claude/project-thread-aseh3k branch October 24, 2026 02:07
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.

2 participants