Repository navigation
fix(goals): the remaining goals on one copy per flow (FIX-1824) - #2939
Conversation
…1824)
The harness built hireWorkforce(workers), which since FIX-1788 P4 takes an
installation. It now builds createWorkerInstallation({ standardWorkers })
with no worker flows, registers the copies hireWorkforce returns, and asks
each worker in a session on the agent copy that names it. Leg 0's scan moves
to the installation: it holds the roster and nothing else.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…IX-1824)
The harness hired with hireWorkforce(workers, { workerFlows, packageBlocks }).
It now builds the installation with the generated packageBlocks and no worker
flow, registers its copies, and asks each seat in a session on agent that
names it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
… (FIX-1824)
The harness hired with hireWorkforce(workers, { workerFlows: { agent } }).
The agent carrying the team's capabilities is now a workerFlow builder on
createWorkerInstallation, and each seat is asked in a session on the one
agent copy that names it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…rkerId (FIX-1824)
The shift-lab hired with hireWorkforce(tree.workers, { workerFlows }). It now
runs every worker on one copy of lead or seat through installWorkers; the
drain and each ask open their session on that copy naming the worker, and a
row's run session names the lead that drained it.
The store oracle read a session's flowId as its seat. goals/lib/shift-manager
gains pendingSeatAsks, which picks the person's pending asks as Shift
Manager's reads.ts does (a session on a seat's kind that names that seat, or
names none), and workerOf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
open-desk.mts hired with hireWorkforce(tree.workers, { workerFlows }) and an
asker flow built without its installation. It now goes through installWorkers
and inventorySeats. The check raises its asks in sessions on the asker's flow
created naming the asker, and finds the chief of staff's line in a session
that names it as its worker rather than one whose flowId is the seat.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…er (FIX-1824) readStore's seat-scoped ask read is the same predicate as Shift Manager's reads.ts, so it now goes through goals/lib's pendingSeatAsks. The every-session read behind the DevTeam precondition is a different predicate and stays local. The desk Lab's header said the chief of staff was a seat on the built-in agent kind; it says now that it is a worker on the one agent copy, with no flow of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…t as its worker (FIX-1824) ChangeRecord carried the session's flowId, which V4 read as the seat; on one copy per flow that is 'worker' for both seats. It now carries the workerId the session's state names, and V4 grades a claim as a seat's when that worker is a seat and the session is its own. V3's drain over the parked row posted to the seat's id as a flow, and VB opened the seat as a navigator instance; both now go through the one copy of the flow the seat runs on. works-a-task-from-its-row and the-checklist-rows opened the seat as a navigator instance the same way; they open the worker copy now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…ion names (FIX-1824) readStore kept an ask only when its session's flowId was a seat, which no session has on one copy per flow, so the store held no ask while Inbox drew the EM's. It now reads asks through goals/lib's pendingSeatAsks, as Shift Manager's reads.ts picks them. StoredAsk.seat is null for a session on a seat's kind that names no worker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 7304ae00-df1d-43d8-9121-5f5fc751ddfb) |
… hook (FIX-1824) The control swapped src/lib/cos.ts, which 2606901 folded into lib/conversation.ts, so the build failed before talk was graded. It now stands in for lib/conversation.ts and lib/send.ts, the two modules a conversation runs through: it opens no session, sends nothing, and draws the typed line with a canned reply. The build's swap takes one or more modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…to goals/lib (FIX-1824) The closure's reach walk looked for the sidebar's Day / Night switch, which the theme mark replaced (36bed12 / #2825), so a3, b:reach and c:reach were red on every run. It now clicks the mark as a person does until it reaches night, day and the theme it started on, checking the page takes each. pickShift, which it-draws-v2s-look already used for this, moves to goals/lib/shift-manager.mts so both goals share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…FIX-1824) FIX-1788 P4 has Shift Manager open the person's session with a seat on the flow the seat runs on, naming its worker, before the door runs in it (lib/conversation.ts). ER-15's seam list didn't name that write, so part 4 was red on every run. It is now allowed there and pinned: one createSession, on seat.kind, with state naming seat.id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…the drainer's flow (FIX-1824) A run's owner is the flow its session is on. The check compared it with the drainer's worker id, which since FIX-1788 P4 is no flow, so the store precondition failed and every control read WRONG. The tree read now names the drainer's flow from its file, and the held rows and the board-flow control use it. Found by the FIX-1663 closure's part 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…IX-1824) FIX-1789 added an em door leg to it-sends-a-turn-into-a-seat-session: Inbox's reply to the EM's ask goes through send.ts, the module optimistic-turn swaps, so it goes red with delivered. The closure graded it as a stray. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
… and control (FIX-1824) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…IX-1824) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: c24d9f8f-6052-44c3-bb5c-b69aa49f8589) |
…k (FIX-1824) The goal drove the Day / Night switch the theme mark replaced (36bed12 / #2825), and its passes relied on Shift Manager following the OS setting, which it no longer does. Each pass now runs over a Lab started on its shift (SHIFT_MANAGER_SHIFT), the switch leg picks with the theme mark (goals/lib's pickShift) against the shift each Lab started on, and switch-ignored patches out the mark's click handler. Still red at themed: the mark's root svg leaves fill at the default black. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 8284888f-597f-4f05-ac88-8fc4a1b2d046) |
Every shape in the mark sets its own fill, so the root svg's default black painted nothing, but the design-system look check grades every svg's computed fill and read it as a colour that isn't Shift Manager's. fill="none" on the root, as NavIcon does. Nothing changes on screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…eme mark (FIX-1824) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 3acfb87e-1981-4d9d-8a83-ffcfb08900fb) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 34038bad-63f3-4fb0-b607-e0446a564c73) |
There was a problem hiding this comment.
Problem this PR solves
Goals and labs were still on the pre–FIX-1788 shape: one registered flow copy per seat, oracles that treated flowKind as the seat id, and Shift Manager goals that reimplemented ask reads in several places. That fights the workforce contract (one copy per flow kind, workerId on the session) and makes drift from reads.ts likely.
Verdict
Approve. The core move is the right simplification: installWorkers + sessions opened on the shared kind with WORKER_ID_STATE_KEY, and oracles that read the worker from session state. Centralizing pendingSeatAsks, workerOf, and pickShift in goals/lib/shift-manager.mts is the appropriate layer (goals must oracle the store over raw HTTP, not import the app’s LabReader).
I do not think a smaller PR could have avoided the lab/harness churn; the old hireWorkforce(workers, { workerFlows }) pattern was the complexity. What could have been smaller is what rode along in the same branch (theme mark, design-system goal, optimistic-reply / conversation control, ShiftManagerMark fill). Those look correctness-driven for closure part 3, but they inflate review surface beyond “one copy per flow.”
Simpler approaches considered
| Approach | Trade-off |
|---|---|
What you did — goals lib oracles + installWorkers |
Keeps package boundaries clean; duplicates some predicate logic from reads.ts. |
Import workerOf + PERSON_REASONS from packages/shift-manager/src/lib/reads.ts (goals already deep-import shift-manager src for controls) |
Smallest dedup win; avoids a second workerOf and reason set. Full createLabReader is still a poor fit (React/client transport). |
Extract pure seatSessionsForAsks + pending reducer to @flow-state-dev/workforce (or workforce/browser) |
Cleanest long-term if more goals need the same semantics; needs a pinning test vs deriveSuspensions. |
| Split PR — (A) workforce + devtool goals migration, (B) theme mark + design-system, (C) optimistic-reply | Easier review/revert; no behavior change. |
Follow-ups (non-blocking)
pendingAsksBySeatstill usessession.state?.workerIdwhile the rest of the branch standardizes onworkerOf/WORKER_ID_STATE_KEY— same string today, butreads.ts’stext()treats empty string differently; worth aligning for oracle parity.- Manual suspension/resume pairing in
pendingSeatAsksvsderiveSuspensionsin the app — document or test equivalence so goals and UI cannot diverge quietly. it-takes-its-look-from-the-design-system: one lab per build × variant (shift at boot) is correct but ~2× lab startups vsemulateMediain one server — only worth revisiting if that goal’s CI time hurts.- Workforce harnesses: three near-identical HTTP/poll blocks remain;
goals/libcan’t be imported from kitchen-sink copies — a bundledharness-common.mtsor a thin@flow-state-dev/testinghelper would be the next simplification, not more goal logic.
What’s working well
goals/lib/workers.mtsinstallWorkersis a clear, reusable wrapper overcreateWorkerInstallation/hireWorkforce.pickShiftdedup across closure, v2 look, and design-system goals.- Multi-seat
ChangeRecord.workerIdis clearer than overloadingflowIdas seat id.
Sent by Cursor Automation: Review For Best Approach
There was a problem hiding this comment.
Code Snob: one subtraction.
pendingAsksBySeat in goals/shift-manager/it-draws-v2s-look/run.mts groups pending asks by worker, and the only caller sums the map. The seat-scoped read already lives in pendingSeatAsks, so the grouping does no work. Count in the loop. Same sessions, same filter, same total.
POC, does not merge: #2941
Fold that subtraction into this PR. After this PR lands, close the POC unmerged.
I also looked at sharing the three harness session-opens, and at folding it-opens-a-lab and screens-inbox-tasks-roster into pendingSeatAsks. Neither shrinks the contract. The harnesses are copied into kitchen-sink, so they cannot import goals/lib, and the built-in-kind scan needs the createWorkerInstallation({ standardWorkers }) literal to stay in the file. The other two reads use different predicates, which this PR already recorded.
Sent by Cursor Automation: Code Snob
…IX-1824) The per-seat map's only caller summed it. Count in the loop instead: same sessions, same filter, same total. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: f20a1133-a53c-4521-8703-72cfb73e9db4) |
|
@claude fix merge conflicts |
Conflict in goals/shift-manager/it-shows-and-stops-a-task-run/run.mts: FIX-1491 (123e553) moved the goal onto runGoal's failure list, and this branch points buildShiftManager at the drainer's flow. Kept both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…d base (FIX-1824) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 9d60d01c-6b24-4f8c-aef1-2ad5787d0647) |
Brings in FIX-1824 (#2939). No conflicts: goals/README.md, the one file both sides touched, merged on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV


What this does
FIX-1788 P4 made a worker a row on its owner's roster, run by one shared copy of the flow its file names. #2933 moved the closure children onto that model. This PR moves the goals that were left out (FIX-1824). Each one failed before it reached what it proves. It also fixes the FIX-1663 closure (the skinned shell) and the goal checks it runs that broke the same way.
hireWorkforcenow takes an installation. The two Shift Manager labs go throughgoals/lib/workers.mts(installWorkers). The three harnesses run copied into kitchen-sink, wheregoals/libdoesn't resolve, so they callcreateWorkerInstallationdirectly. Every worker is asked in a session on its flow's one copy, created withstate: { [WORKER_ID_STATE_KEY]: id }.flowIdas the seat.goals/lib/shift-manager.mtsgainspendingSeatAsksandworkerOf.pendingSeatAskspicks pending person-asks the waypackages/shift-manager/src/lib/reads.tsdoes: a session on a seat's kind that names that seat, or names no worker. The skinned shell,it-shows-who-is-on-shiftandit-draws-v2s-look's seat-scoped read now use it.it-opens-a-labandscreens-inbox-tasks-rosterkeep their own reads because their predicates are different: the first takes any session that names a seat, on any kind, and drops sessions that name none; the second reads every session.ChangeRecordnow carries theworkerIdits session's state names, in place offlowId, which readsworkerfor both seats on the shared copy. Getting the goal green turned up two more places that treated a seat as a flow: V3's drain over the parked row, and VB, which opened the seat as a DevTool navigator instance. The twodevtool-workforce-visibilitygoals opened the seat as an instance the same way. All three now open the oneworkercopy and the seat's session under it.pickShift, whichit-draws-v2s-lookalready used for this, moves togoals/lib/shift-manager.mtsso both goals share it.lib/conversation.ts. It is now allowed, pinned toseat.kindwithstatenamingseat.id.optimistic-turnreddening FIX-1789's em door leg along with delivered, since both go through the same send path.SHIFT_MANAGER_SHIFT), since Shift Manager no longer follows the OS setting. The switch leg picks withpickShift, against the shift each Lab started on.switch-ignorednow patches out the mark'sonClick={look.cycle}.optimistic-reply. The control now stands in forlib/conversation.tsandlib/send.ts, the two modules a conversation runs through. 2606901 foldedcos.tsinto the first. The build's swap takes one or more modules.it-draws-v2s-look/lab/fsdev.config.mtsnow says the chief of staff is a worker on the oneagentcopy. The lab'sWORKER.mdsaysflow: agent, so it isn't oncoordinator."workerId"literal is gone from every session body this touches. It usesWORKER_ID_STATE_KEYinstead.criteriaStateisn't exported from the package, so nothing here uses it.fill="none"on the theme mark's<svg>, asNavIconalready has. Every shape inside the mark sets its own fill, so nothing changes on screen. The design-system look check grades every svg's computed fill and read the default black as a colour that isn't Shift Manager's.No changeset: goals are private, and the Shift Manager change has no visible effect.
What's asked of you
Nothing. The reds that remain are outside FIX-1824 and are listed under "Still red" below. Per the coordinator,
hardcoded-accentis tracked in FIX-1827.One call I made without asking: in multi-seat-collab, VB (1) said "each seat is a navigator row by its exact id". After P4 a seat is no longer a copy, so the DevTool can't show it as a row of its own. VB (1) now checks that each seat's own session is listed under the one copy of the flow it runs on. The goal.md says so.
Verification
Each goal was run one at a time, with more than 5 GB available. The base was 9d136d2. Model-backed goals ran on
AI_GATEWAY_API_KEY, and no inference failed. Each touched goal.md has a dated verdict row for every run below.TypeError: installation.workerFlows is not a functionFailed to load fsdev config …: installation.workerFlows is not a functionFailed to load fsdev config …: Cannot read properties of undefined (reading 'session')[data-instance-id="eng.builder"][data-session-id="s_eng_builder"][data-instance-id="eng.builder"]readPassfill="none")Controls. Each one failed where its goal.md says it should, except the two listed under "Still red".
withhold-instructions/cross-wire/partial-hireworkerFlows: {}move-to-sibling/drop-tools-linetessonlyinstall-everything/ignore-selectionignore-asks/count-queuedoptimistic-reply(re-pointed)[desk] talkonly: "delivered was drawn while no session of desk.chief-of-staff held a user item with the token"static-brief[desk] inlineonlydrift/unclassified/missingswapped-desks/ignore-the-answer/second-principal/silent-park/one-seatchanges()readsflowIdagainmailbox-actions-offsilent-park/no-inventoryworker-session/optimistic-interrupt/board-flowauditrow only"agent"switch-ignored(now the mark's click handler) /fonts-not-loadedhardcoded-accentPart 3's repository checks:
pnpm typecheck's steps pass. I ran them with turbo held to--concurrency=2for the shared box.pnpm testpasses 72 of 72 tasks. Two earlier runs stopped first: once on a timing-flaky engine conformance test, which passes on its own, and once because this checkout hadn't builtpackages/shift-manager/dist-client.node_modules/.bin/tsc -p goals --noEmitexits 0.pnpm --filter @flow-state-dev/shift-manager testpasses 37 files and 391 tests on d3b2098.Still red, and outside this issue
openLabneeds only stores, inventory and devtool; and whether the host's options do the README's steps. This is about the README, not workers.labs/README.mdnow links../packages/shift-manager, notshift-manager/.hardcoded-accent, in the skinned shell and in it-takes-its-look (FIX-1827). Both read WRONG; the skinned shell's says "stayed green at c:tool". Since 5910d42 / 810765e, Shift Manager draws a tool call as a quiet line that doesn't rendertool.tsx's status icon, so the patched icon never paints.🤖 Generated with Claude Code
https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
Generated by Claude Code
Note
Medium Risk
Touches many goal runners and grading oracles across DevTool, multi-seat, and Shift Manager paths; behavior change is intentional for P4 but broad regression surface if session/worker resolution is wrong.
Overview
Updates goal checks and harnesses for FIX-1788 P4: a seat is no longer its own flow copy—it runs on the one shared copy of the flow named in its file, with
workerIdin session state.Hiring & sessions: Labs and harnesses switch from
hireWorkforce(workers, { workerFlows })toinstallWorkers/createWorkerInstallation, register one copy per flow, and open each seat via sessions on that flow withWORKER_ID_STATE_KEY. DevTool/multi-seat goals navigate the kind row → copy row (id = kind) → seat session, not[data-instance-id="<seat>"].Shared oracles in
goals/lib/shift-manager.mts:pendingSeatAsks,workerOf, andpickShift(theme mark cycling). Store/Inbox reads and V4 claim grading useworkerIdinstead of treatingflowIdas the seat.ChangeRecorddropsflowIdforworkerId.FIX-1663 closure / Shift Manager goals: Reach legs use the theme mark instead of Day/Night switch; look check runs per
SHIFT_MANAGER_SHIFTlab start; part 4 ER-15 allowsconversation.tscreateSessiononseat.kindnaming the worker;optimistic-replyswapsconversation.ts+send.ts.Product tweak:
ShiftManagerMark.tsxaddsfill="none"on the root SVG so theme look goals don’t grade default black fill.Reviewed by Cursor Bugbot for commit f06284f. Configure here.