Skip to content

FIX-2335: Teammates lab drops projects for one working folder from config - #4206

Merged
jhoffner merged 9 commits into
claude/project-thread-uin65ofrom
claude/project-thread-7txcx4
Oct 29, 2026
Merged

jhoffner merged 9 commits into
claude/project-thread-uin65ofrom
claude/project-thread-7txcx4

Conversation

@jhoffner

@jhoffner jhoffner commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Jake · project thread

Closes FIX-2335 (under FIX-2152). Stacked on #4199 (FIX-2332): base it on that branch, or on main once #4199 merges. FIX-2336 (Chief of Staff) stacks on this.

What changes

Jake took projects out of the Teammates lab (2026-10-29). The lab now works in one working folder that the operator names at start.

  • Host: host.mts uses the existing constant run source, { kind: "repo", repo: TEAMMATES_WORKDIR }, with that folder in localRepositories. Every coding run gets a worktree of it, and the source reads use it. There's no lab-only resolver and no new run-source kind, and no model can see or pass a path.
  • Startup: if TEAMMATES_WORKDIR is unset, missing, or not a git checkout, the lab stops with an error that names the setting and the path. It never falls back to cwd or the lab's checkout. Checked by hand:
    • teammates: TEAMMATES_WORKDIR is not set. Set it to the git checkout the team works in.
    • teammates: TEAMMATES_WORKDIR names /…/nope, which is not a folder on this machine.
  • Removed:
    • Project tools and setup: the project tools (projectTools, setWorkProjectTool), the projects flow, TEAMMATES_PROJECTS and the start-up project writes.
    • Screens: the header project select, NewProjectForm, and the needs-project status, card prompt and PICKED_LINE. The approval card stays as generic plumbing. Any agent worker can call waitForUser with an approval (it's a control tool), so the page must still show the card and answer it.
    • Adapter and tests: watchProjects, createProject, setWorkProject and watchWorkProject from the adapter, and work-project.test.ts.
    • Wiring: projectWorkspaceCapability is gone from the agent flow's uses and from coder's managers. A constant source reads no project collections.
  • Prompts: no WORKER.md or TEAM.md mentions a project. researcher's and writer's tools: lines drop listProjects and setWorkProject. rg -i project labs/teammates/src labs/teammates/workforce now finds only the package tool names globProjectSource, readProjectSource and grepProjectSource.
  • Task cards say running, done or failed, with no "in ".
  • Spec: dated amendments to ER-8 (specs/epics/FIX-2152/DECISIONS.md) and FIX-2154 D3. They cite Jake's words and the Architect's conditions, and are limited to labs/teammates.
  • Goals: a-worker-talks-to-another-while-you-talk sets TEAMMATES_WORKDIR to its scratch checkout. Step 5 now fails if the page mentions a project. The project-not-kept control is gone, since there's nothing left to patch. consults-a-conversation-without-waking-it gives the lab an empty scratch checkout.
  • packages/ has no diff.

Verification

  • labs/teammates vitest: 37/37 pass. The new screen test files a coding task and asserts that it runs at once, with no combobox, no group and no "project" anywhere in the page. working-folder.test.ts covers the startup check. An approval screen test (writer waits for a yes, then goes on after Approve) and an entries.test.ts mapping case cover the kept card. The mapping case fails with the user_approval branch removed.
  • I booted the lab with fsdev dev against a scratch git checkout: the page serves (200) and the roster lists lead, researcher, writer and coder. localWorkspaceHost with the constant source answers {kind:"repo"} and globs the checkout.
  • typecheck, eslint, check-retired-terms, the vocabulary sweep, the goals tsc and inventory.mjs all pass.
  • Not run: the real-model goal and Jake's "hire a PM" test. Both need a gateway key and a signed-in Claude Code host.

Known gap (package, not changed here): projectSourceTools' own descriptions still say "the project this session works in". The README lists this under Not wired yet.

No changeset: private lab.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NczDiGfGi2RaecD1vUwy8K

…nfig

The lab's host now runs on the existing constant run source, a git checkout
the operator names in TEAMMATES_WORKDIR, listed in localRepositories. Unset,
missing or not a checkout, the lab fails at start; it never falls back to the
current directory or its own checkout. Project tools, TEAMMATES_PROJECTS and
the start-up project writes are gone, and so are the header project select,
the New project form, the needs-project card and the repository approval card.
Task cards say running and done. No WORKER.md mentions a project. ER-8 and
FIX-2154 D3 get dated amendments scoped to this lab; packages/ is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiCsRqCenZsFQRpJBHi
@vercel

vercel Bot commented Oct 29, 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 29, 2026 10:31pm UTC
flow-state-dev-kitchen-sink Ignored Ignored Oct 29, 2026 10:31pm UTC
flow-state-dev-ui Ignored Ignored Preview Oct 29, 2026 10:31pm UTC

Request Review

@linear-code

linear-code Bot commented Oct 29, 2026

Copy link
Copy Markdown

FIX-2335

@jhoffner jhoffner self-assigned this Oct 29, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-29T22:32:36.690753Z ae2ce9c 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-only review)

Verdict: the approach is right. Reusing the existing constant run source ({ kind: "repo", repo } plus localRepositories) is the lean shape. It adds no resolver, no new run-source kind and no packages/ diff, and it is net −620 lines. I looked for a leaner or better alternative and didn't find one. The items below are small and worth fixing in this PR.

Should fix

  1. labs/teammates/host.mts header comment is stale. The same file's new bullets say "There are no projects", but the top-of-file doc still says:

    • line 4: "coding flow, a projects flow, and a store"
    • lines 13-14: "The flow's tool catalog holds Workforce's project tools, web search and fetch, and uses adds reading a project's source"

    Both are now false, and BP-007/BP-034 call for finishing a removal, not just its imports. Reword them to the working folder and the globProjectSource/readProjectSource/grepProjectSource tools.

  2. workingFolder() is the lab's one new safety rule and has no unit test. The PR says "checked by hand" for the two error messages. The three failure cases (unset or blank, not a directory, no .git) and the "never falls back to cwd" guarantee are the spec's Architect conditions, so they should be pinned in a small labs/teammates/test/working-folder.test.ts. Cover:

    • undefined and " " throw, with the message naming TEAMMATES_WORKDIR
    • a nonexistent path throws and names the resolved path
    • a plain directory with no .git throws
    • a directory with a .git entry (dir or file) returns the absolute path

    Without it, a later refactor can reintroduce a cwd fallback and nothing goes red. The screen test only covers the UI side.

Worth a look (not blocking)

  1. .git presence is a weak "is a checkout" test. It passes for a stale .git file or an empty .git dir, and fails for a bare repo (arguably correct). If an invalid checkout reaches git worktree add at first run, the user sees a git error rather than the startup message the PR promises. If you want the guarantee to hold, git -C <folder> rev-parse --git-dir is the real check. If .git is deliberate to avoid spawning git at startup, say so in a one-line comment.

  2. Silent status regression in TaskCard. The status span now prints raw task.status. That's fine today because adapter.ts:75 narrows it to running | done | failed. If the adapter's union grows, the card will print internal strings without anyone noticing. This is acceptable as is. A comment is enough.

  3. Remaining project strings. Beyond item 1, screen.test.tsx:8 and :135 use the word in comments. That's fine for a test asserting its absence. The spec amendments citing Jake's words are appropriate for the DECISIONS files.

Architecture opportunity (only because this PR already touches it)

  • workingFolder() validates "a folder the operator names must be a git checkout" inline in a lab host. shift-manager and the other labs will want the same rule, and ER-8 says each lab still works in a checkout. I'd not extract it now. It has one caller, and the Architect's condition was "Workforce stays project-agnostic". Leave it in the lab, and move it to a shared helper when a second caller appears. Noted only so it isn't re-invented with different error text.
  • The Entry/Conversation approval-card removal is clean. I grepped labs/teammates for approval and found no remaining references, so no dead answerApproval or approval entry kind is left behind.

Not verified here

Real-model goal and the "hire a PM" run (as the PR notes). I read the diff only; I did not run vitest.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiGfGi2RaecD1vUwy8K

@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-2335)

Verdict: Approve. The direction matches the ER-8 / D3 amendments: one operator-named checkout, constant localWorkspaceHost source, and deleting the projects flow, adapter surface, and UI rather than hiding it behind a single auto-seeded project. That is the cleaner operational model for "prove projects aren't required," even though the diff is wide.

Did the approach go too far?

Alternative Trade-off
Hide UI, keep one TEAMMATES_PROJECTS + setWorkProject on open Smaller diff, but two sources of truth (env checkout vs project record), startup runAction, polling, and worker project tools stay live.
What this PR does ~620 net lines removed, one mental model, aligns with kitchen-sink / harness-manager constant-repo hosts. Costs: Teammates no longer demos Workforce project UX until restored.

For the documented product call, depth is justified, not accidental complexity.

What looks good

  • Host wiring (remotes: { allow: [] }, source: () => ({ kind: "repo", repo: workdir })) reuses an established pattern instead of a lab-only resolver.
  • Removing project bootstrap, watchProjects / watchWorkProject, and approval/project card UI is a real simplification (less polling and session I/O).
  • Spec amendments in DECISIONS track the supersession honestly; README inventory and "Not wired yet" notes are coherent.

Follow-ups (non-blocking)

These are suggestions, not merge gates — I'd still ship as-is if you're time-boxed.

  1. Brittle "no project" checks — Step 5 and screen.test.tsx scan all page text for /project/i. That fails if a model innocently says "project" in prose, and it conflates "no project UX" with "never utter the word." Prefer asserting absence of removed UI (aria-label project select, approval entries, task prompt groups) like the old chip check did.
  2. workingFolder tests — Deleting work-project.test.ts leaves no unit coverage for unset / non-dir / non-git failures; a small vitest on the exported helper would lock the fail-fast contract.
  3. Hygiene — Stale host.mts file header still mentions a projects flow; unused cn import in TaskCard.tsx; extra blank line in ConversationEntry union in adapter.ts.
  4. Optional parity — Other labs use realpathSync on checkout paths and sometimes explicit baseRef: "HEAD" on constant sources; worth aligning if you hit symlink edge cases (not required for this PR).
  5. Task card status copy — Raw running / done / failed is simpler code but less operator context than done in …; fine if intentional.

Performance

Net win from dropping startup project creation and 3s project list polling; no new hot-path concerns in the lab app.

Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

Comment thread labs/teammates/test/screen.test.tsx Resolved
Comment thread labs/teammates/host.mts Resolved
Comment thread labs/teammates/host.mts Resolved
Comment thread labs/teammates/src/adapter.ts Resolved

@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 on e117f54c. No POC.

Read labs/teammates/host.mts (workingFolder, openTeammates), fsdev.config.mts, src/adapter.ts (toBoardTask, QUIET_ACTIONS), src/components/Conversation.tsx, TaskCard.tsx, Entry.tsx, Runs.tsx, WorkersList.tsx (BackgroundItems), src/flows/coder.ts, test/screen.test.tsx, test/fake-lab.ts, and both goals/teammates-lab/*/run.mts checkouts. The ER-8 and FIX-2154 D3 amendments stay as recorded.

A rewrite would not shrink this contract:

  • workingFolder is the three startup messages (unset, not a folder, not a checkout) and the absolute path the constant source closes over. RunSource is a function, so source: () => ({ kind: "repo", repo: workdir }) is the call. Collapsing the throws changes the text the start contract prints. A shared helper waits for a second caller; this file is the only one.
  • QUIET_ACTIONS is one name (dispatch) used by two filters, with the reason on the const. Inlining the compare repeats that reason or drops it.
  • Conversation's panel is only "instructions" now. A boolean is the same number of lines.
  • TaskCard still imports cn and does not call it. Deleting the import is one line, the same card.
  • The consult goal's git init is three lines. The other goal's checkout also writes a README, a gitignore, and a commit. Sharing that helper carries work this goal does not do.
  • Task cards and the sidebar both print task.status. There is no second format to share.
Open in Web View Automation 

Sent by Cursor Automation: Code Snob

…unused import

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiGfGi2RaecD1vUwy8K

@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.

Reviewed commit: e9743fb337

ℹ️ 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".

Comment thread labs/teammates/src/adapter.ts Resolved
The project tools were the only thing asking for approval, but waitForUser is
a control tool every agent worker has. Without the entry and answerApproval a
worker that asked would stop with nothing on the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiGfGi2RaecD1vUwy8K
#4183 (FIX-2288) changed the lab's files without rewriting the table, so the
lab's inventory test is red on main and on every PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiGfGi2RaecD1vUwy8K

Copy link
Copy Markdown
Collaborator Author

Test (3/3) failed on 791f49e at labs/claude-code-style → test/inventory.test.ts ("README.md's inventory is out of date"). This PR didn't cause it: it touches nothing in that lab, and the same check fails on main (df92436, after #4183 changed the lab's files). No fix PR was open, so I ported the regenerated table here in 091232e. It's a README-only change (two counts) and becomes a no-op once main carries the same fix.


Generated by Claude Code

Red on main since #4078: both hook-timeout failures in worker-calls.test.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiGfGi2RaecD1vUwy8K

Copy link
Copy Markdown
Collaborator Author

Test (2/3) failed on 791f49e in packages/workforce → test/worker-calls.test.ts (two "Hook timed out in 10000ms"). This PR didn't cause it: the PR has no packages/ diff, and main fails the same way on df92436. #4204 is the fix, so I ported its test change in 93e45e9. That file passes 11/11 locally now. The README table #4204 also carries was already ported in 091232e.


Generated by Claude Code

1 similar comment

Copy link
Copy Markdown
Collaborator Author

Test (2/3) failed on 791f49e in packages/workforce → test/worker-calls.test.ts (two "Hook timed out in 10000ms"). This PR didn't cause it: the PR has no packages/ diff, and main fails the same way on df92436. #4204 is the fix, so I ported its test change in 93e45e9. That file passes 11/11 locally now. The README table #4204 also carries was already ported in 091232e.


Generated by Claude Code

@jhoffner
jhoffner added this pull request to stack #4217 October 29, 2026 22:48
@jhoffner
jhoffner merged commit 4166a64 into main Oct 29, 2026
18 checks passed
@jhoffner
jhoffner deleted the claude/project-thread-7txcx4 branch October 29, 2026 22:49
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