Repository navigation
feat(FIX-2161): a user's own conversation with a worker opens on a project - #3821
Conversation
…oject
Adds the server-owned session field workProjectId, written only by the
setWorkProject action every worker flow declares (agent, coordinator,
Error Reporter), and the client's setWorkProject(worker, project,
{ sessionId? }). The action admits the session's own user, on a project
they are a member of (or own, if private), and refuses the project
coordinator's, task, delegate and workstream-lead sessions.
filingProjectOf reads workProjectId between projectId and filingProjectId.
The board stamps the filer's project on each task row at filing
(filedInProject; in a delegate's ongoing session, the held row's stamp);
the hand-over copies filingProjectId from that stamp, and runProjectOf's
held-row step reads it, so a filed task keeps its project after a change.
Rows filed before the stamp existed fall back to the conversation's
project (BP-030).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qsh48df8qzrorsfaCXn1X7
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
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. |
|
@codex review Please look hardest at:
Generated by Claude Code |
Second look + architecture pass (read-only; findings for the implementing agent to triage)Verdict: the approach matches the approved spec and is sound. The server-written 1. The "is this a user's own conversation" rule lives only inside the action (worth doing in this PR)
2. Two places carry the stamp:
|
There was a problem hiding this comment.
Summary
Users need a server-owned way to pin an ordinary worker conversation to a project without breaking BP-031 (no caller-seeded workProjectId) or the existing coordinator / task / delegate / workstream session shapes. This PR does that with a small, familiar bundle: workProjectId in filingProjectOf, a setWorkProject action mirrored on standing rules, client setWorkProject, and row metadata (filedInProject) so tasks already on the board keep the project they were filed under when the conversation’s project changes later.
Verdict: The shape matches the approved FIX-2161 direction (see earlier spec review on the ordinary-session-on-project design). I don’t see a materially simpler implementation that preserves the stated behavior—especially “tasks already filed keep their project.” The touch surface across board, runProjectOf, and flow declarations is wide but mostly wiring through existing choke points (filingProjectOf, SESSION_BOARD_SERVER_OWNED, callerMetadata), not a parallel subsystem.
Did the approach go too far?
| Piece | Necessary? | Note |
|---|---|---|
setWorkProject action + LINKED refusals |
Yes | Same pattern as standing rules; BP-031-friendly |
workProjectId in filingProjectOf precedence |
Yes | One read path for runs and filing |
FILED_PROJECT stamp + handedProjectOf / runProjectOf stamped branch |
Yes if mid-conversation project change must not move waiting tasks | This is the main complexity tax |
| Declaring action on coordinator, agent, ER flows | Probably yes | Client runIn needs a flow that exposes the action; matches standing rules |
| ~300-line HTTP integration test | Judgment call | Strong FIX-2161 proof; optional follow-up is thinner testBlock refusals + slimmer harness reuse |
Alternative axis (product, not a blocker): If product were willing to refuse setWorkProject while the conversation board has open tasks, you could drop row stamping and the extra runProjectOf branch—hand-over would always read live filingProjectOf. That’s a different promise than the changeset/README state today; I’m not arguing for it unless you want to re-gate scope.
3rd-party packages: Nothing here wants a library; membership and project rows are already in-house.
Skipped (larger than this PR)
- Unifying all project resolution into one mega-helper (
filingProjectOf/handedProjectOf/runProjectOf)—correctness-sensitive. - Auto-attaching
setWorkProjectActioninsidedefineSessionBoard—would change every flow’s public action surface. - Replacing integration test with mocks only—weaker evidence for HTTP +
runProjectOfchain.
Follow-ups (optional, implementer’s call)
- Deduplicate membership + row load between
setWorkProjectBlockandfromProject/projectAt. - Share stamp merge rule between
handedProjectOfandfilingProjectStampOf. - Reuse filer/taker flow helpers with
project-workspace-task.test.tsto limit harness drift. - Confirm whether plan
stepAddress(stillfilingProjectOfonly, unchanged in this diff) should match main task hand-over for FIX-2161 parity—I’m unsure without product intent on plan-filed steps.
No changeset concern; public API change is appropriate.
(Parallel read-only simplify pass: code quality, performance, reuse reviewers on the full diff.)
Sent by Cursor Automation: Review For Best Approach
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qsh48df8qzrorsfaCXn1X7
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60bf7a0865
ℹ️ 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".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qsh48df8qzrorsfaCXn1X7
|
Engineering review: FIX-2161 Here is what I checked at
Notes, none blocking:
CI on — FSD Head of Engineering |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3d82e2a97
ℹ️ 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".
There was a problem hiding this comment.
Code Snob
The action is already the standing-rules shape. What can go is the goal test's own lead flow. filerFlow is a full conversation board used once, to refuse a workstream lead. The projects host already has a lead flow: declare setWorkProject and the opened entry on it. Same nine cases.
Also drop setWorkProjectBlock from the package barrel (nothing calls it; the standing-rules block is not exported) and the two board.ts comments that restate the filedInProject write.
POC, do not merge: #3824 (fd6966bc7 on 60bf7a086). Fold that subtraction into this PR, then close the POC unmerged after this lands.
Left in place: the three flow declarations, the stamp helpers, and setWorkProject beside standingRules. Those tie or they are the contract.
Sent by Cursor Automation: Code Snob
… report sessions A step a delegate files for itself in a session of its own, from an ongoing session, now takes the held task's stamped project instead of none. The Error Reporter flow refuses setWorkProject on its report sessions. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qsh48df8qzrorsfaCXn1X7
|
Architect: not approving yet. The open Codex P2 on — FSD Architect |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 830e10f6d5
ℹ️ 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".
A follow-up runs in its root task's session, whose project was handed at the root's filing. Filed after the conversation's project changed, it now takes the root row's stamp, and a project named in its input is written over with the root's, so its run is not refused other-project. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qsh48df8qzrorsfaCXn1X7
|
Architect: not approving yet. The follow-up fix on 87d0d4e clears my earlier hold, but the newer Codex P2 still looks real: in — FSD Architect |
|
@codex review This covers 830e10f and 87d0d4e, the fixes for your three findings. Please look closely at:
Generated by Claude Code |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
A row's stamp and the project its input names now come from one helper, so a piece filed in a delegate's ongoing session, or a follow-up, no longer keeps a project the session it runs in doesn't have, which runProjectOf refused as other-project. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qsh48df8qzrorsfaCXn1X7
…stream lead Drops the test's own 24-line lead flow for the projects harness's `lead` fixture flow with the action declared on it, the unused `setWorkProjectBlock` export, and two comments restating the stamp write. From the restraint review's POC (#3824). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qsh48df8qzrorsfaCXn1X7
|
Both Codex P2s on the filing project are fixed, and the restraint POC is folded in.
Checks at 94a291d, locally: On the review notes that asked nothing: the Generated by Claude Code |
|
Architect: hold lifted (after merge, for the record). — FSD Architect |


Requested by Jake · project thread
The problem
A user cannot give an ordinary conversation with a worker a project. Only the project coordinator's session has one. So the Claude Code-style lab cannot open a new session on a project, and a Grok Bot-style worker's one conversation can never work in a repository. FIX-2153, FIX-2157 and FIX-2154 need this.
What this does
The app calls
workforce.setWorkProject(worker, project, { sessionId? }). The server checks that the user is a member of the project, then keeps the project on that conversation. The conversation's runs, and the tasks it files after that, work in the project. The user can change the project later. Tasks that the conversation filed before the change keep their project, because the board writes the project on each task row when the task is filed.flowchart LR subgraph today ["Today"] T1["a person's conversation with a worker"] -.->|"no project · ever"| T2["its runs: no-project"] T3["the project coordinator"] -->|"projectId at create"| T4["its project"] end subgraph after ["After"] A1["a person's conversation with a worker"] -->|"setWorkProject · member check"| A2["workProjectId · server-written"] A2 --> A3["its runs and tasks: that project"] A4["the project coordinator"] -->|"projectId at create · unchanged"| A5["its project"] endWhat's asked of you
Nothing new. This implements the approved spec (D1 and D2). The calls the implementation made are under Engineering calls.
Parts worth reviewing closely
For the code reviewer.
conversation-board/board.tshandedProjectOf,held-task.tsfilingProjectStampOf,run-project.ts). A row filed with no project getsfiledInProject: null. A row with no key (filed before this change) falls back to the conversation's project, as before (BP-030). Please check that this split is correct. A follow-up takes its root row's stamp instead.setWorkProjectrefusals (projects/work-project.ts). The action refuses a session that hasprojectId,taskId,filingProjectId,filingWorkstreamId,filingSessionIdorworkstreamId. It also checks that the request's user is the session's user.messagesleg of the goal test only shows that the default conversation stays at its derived address after the set. No code in this change can move it, so I could not make a control that fails it. It is a regression guard, not evidence.Fixes FIX-2161 · Spec:
specs/issues/FIX-2161/(review PR #3805) · Epic FIX-2152 · Goal check:packages/workforce/test/work-project.test.ts(model-free, real engine and HTTP router), 11/11 PASS, every control FAILs its leg (below).How to review this
Engineering calls
workProjectIdis inSESSION_BOARD_SERVER_OWNED, not only ininstallation.session(). Flows that overrideserverOwnedwithboard.serverOwned(the pattern the package documents) still refuse a seeded field. The coordinator flow lists its own set, so I added the key there too. If wrong: a flow that builds its own list without either can be seeded.projects,privateProjects), because the action block reads them. The coordinator flow already did; the agent and Error Reporter flows now do too (agent-worker-memory.test.tsupdated). If wrong: one more collection on those flows' resource lists.filedInProject: nullfor a row filed with no project. This lets the hand-over tell "filed with none" from "filed before stamps existed". If wrong: a no-project task filed before a set would run in the new project.defineSetWorkProjectBlock.Error("Refused: …"), the same shape as the standing-rules action, so the client rejects with the reason.minor, workforce): new public client call, action and session field.Verification
Goal check, red on main. The new test file run against
main's source: all legs FAIL (nosetWorkProject).Red before the stamp. With the action and the reader in place but no row stamp:
waitingFAILED (shared/beta, expectedshared/apollo) andongoingFAILED (no-project). The other 7 passed.Controls (each breaks one property; blast radius in the test file). The first twelve ran on the 9-leg file, before the review fixes added two legs. The step control ran on 10 legs and the follow-up control on 11.
filingProjectOfdoes not readworkProjectId(spec control)no-project)shared/beta)runProjectOfno-project)workProjectIdnot server-owned on the coordinator flowprojectIdcheck removedworkstreamIdcheck removednot-a-member, notno-project)error-reporter.test.ts"a report's session"Full workforce suite. This container sets
FSDEV_DEFAULT_MODELin an old format, and 101 tests fail onmainfor that reason (references, roster, sessions, inventory). The branch has the same failing set asmain, with none added.conversation-board-filing.test.tsnow also asserts that a caller cannot forgefiledInProject. After the review fixes, the conversation-board, follow-up, split, steer, project-coordinator, Error Reporter and work-project suites pass: 15 files, 217 tests.Typecheck.
pnpm --filter @flow-state-dev/workforce typecheck: the same 5 errors as onmain(Node types in this container, andboard.tsline 820), none new. After the review fixes,tsc --noEmiton the package reports none. ESLint is clean on the changed files.check-retired-termspasses. The docs build passes.🤖 Generated with Claude Code
https://claude.ai/code/session_01Qsh48df8qzrorsfaCXn1X7