Repository navigation
ER-Collab: two seats hand a row over, and you can watch it in the DevTool (FIX-1497) - #2065
Conversation
A sibling lab under goals/multi-seat-collab/: a planner and two worker seats hired from Markdown work one channel's board on the shipped fsdev dev. The owning seat parks a row with its question, a person answers through that seat's own action, the same seat finishes and files the next row for the other desk, and the other seat runs it. The goal check drives it over HTTP and reads it in Chromium on the shipped DevTool: the seat's Tasks tab, the child session's reason with nothing expanded, and the ledger collection with both rows. Five controls, each graded against the legs it names. Nothing under packages/ changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
Trimming the whole status output ate the first line's leading status column and shifted its path by one character. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
Every named control was run on 2f2e86a and went red at exactly the legs it names; V0, V6 and V7 were reddened once by hand and reverted. The graded run is not recorded: it waits on a live hired Workforce, which #2051 stands up and which has not merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
|
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. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
There was a problem hiding this comment.
Simplify review (FIX-1497)
Read the full diff (~3.2k lines, goals/multi-seat-collab/ + retained spec/POC). Parallel passes looked for unnecessary abstraction, duplication, and simpler alternative architectures.
Verdict on the approach
The served fsdev dev + HTTP driver + separate kinds.mts / fsdev.config.mts split is the right shape for what this issue proves. An in-process lab like manager-queue-lab's openLab() would be materially smaller, but it would not exercise the ordinary dev server, intent-free env (FIX-1511), or the DevTool legs (VB/VG). Folding that into one process would trade proof strength for line count — I would not recommend it without a spec change.
The retained POC under specs/issues/FIX-1497/poc/ is heavy (inline flow logic + a second copy of the workforce tree), but it is documented as evidence, not something to copy. That is acceptable for a spec PR; the publishable surface is the lab + goal.
Approval is on direction: the complexity here mostly buys real fences (served path, outbox oracle, controls, DevTool visibility), not framework churn in packages/.
Where the change went further than necessary (non-blocking)
These are hygiene / follow-up items, not merge blockers:
-
goals/libscaffolding duplicated again —serveLab(~run-scenario.mts) closely mirrorsspecs/.../poc/served-hire-observable/check.mts(tsx spawn, random port,intentFreeEnv, health poll, child-exit guard). Same story forpreinstalledChromium()(verbatim vsgoals/flow-instances/devtool-shows-the-selected-copy/run.mts), recursivetreeFiles, DevToolbuild:assets, and most ofdiff-check.mtsvsmanager-queue-lab. A small shared module (serve-fsdev.mts,playwright.mts,listFilesRecursive, parameterized merge-base fence) would shrink the next DevTool goal more than this PR needs to grow. -
Identical
workforce/in lab and POC —diff -qrshows no differences. One canonical tree undergoals/multi-seat-collab/lab/workforcewith the POC defaulting to that path (or a CI sync check) avoids silent drift. -
run.mtsat ~587 lines — Headless legs (V0–V7, controls, oracle) and Playwright (VB) share onemain(). Extraction of browser-only helpers would help readability; splitting headless vs browser drivers is optional unless more collab goals appear. -
Type escape hatches —
as neverondefineFlow/hireWorkforceandctx.cap as unknown as Record<...>fortasks()hide whether the lab is fighting framework types. Worth a quick experiment to narrow types once; might be unavoidable today. -
Lab-local HTTP
any—Scenariobodies use loose shapes; fine for one goal, brittle if copied. Partial@flow-state-dev/clientadoption only where it matches debug routes. -
Comments vs README — Module headers largely restate
lab/README.md/goal.md. Trimming to API + traps would reduce drift surface (style, not correctness).
Simpler alternatives considered
| Alternative | Why weaker here |
|---|---|
Reuse openLab in-process only |
No served DevTool / BR-15–17 path |
| Drop NDJSON outbox oracle; assert board only | Weakens anti-game controls in goal.md |
| Merge POC into lab dispatcher | Violates retained-evidence boundary |
| Third-party for browser | Already Playwright; appropriate |
Performance (lab scale only)
appendFileSync in runRow, idlePollMs: 25, and 50ms HTTP polling in act / waitForRow are fine for this scenario. Only worth revisiting if this pattern becomes a template for many seats or long runs.
Optional follow-up
If you touch this again before VG un-fences on #2051, the highest leverage simplification is goals/lib serve + Playwright + tree listing and one workforce tree — not restructuring the lab's orchestration model.
Sent by Cursor Automation: Review For Best Approach
There was a problem hiding this comment.
Code Snob — already tight. No POC.
Read goals/multi-seat-collab/lab/kinds.mts, host.mts, fsdev.config.mts, run-scenario.mts, diff-check.mts, it-hands-a-row-between-two-seats-in-view/run.mts, and the four workforce files, against PLAN S1–S7 on head 4abf485.
A rewrite would not shrink the contract. The two kinds, the caller-supplied desk map, the HTTP driver, and the nine legs are the surfaces the plan names. Inlining file / drainAll / answer into the check, or folding the three screens into one helper, moves the same assertions. deskDispatcher and the outbox line are the sibling shape the plan says to take, and every field on that line except goal is read by a leg. LAB_DIR is an unused export. Neither is a smaller hire. The hand-rolled fetch is shorter than adapting @flow-state-dev/client: that client binds userId and throws on a non-202, and V4 has to see both.
Not re-opened: grading BR-6 on the next drain, two claim sources, GOAL_CONTROL as the one switch, as never matching the sibling factories.
Sent by Cursor Automation: Code Snob
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4abf4851e3
ℹ️ 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".
- BR-10: the second answer must come back declined as terminal, read from the answer action's own recorded output. - V4: the row for nobody must have a claim or refusal on record from a seat's own drain, not just an errored status. - V4: a second person's delivery passes only as a 202 with a request id or an explicit 401/403; any other status or a transport error fails. - VB: a listed ledger row whose expanded body shows nothing fails screen 3 instead of being skipped. - BR-1: the tree must hold exactly one planner and two workers. Also drops the unused LAB_DIR export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
VG passes on 6a2b33c. Each named control still reddens exactly its legs; each of the five hardened checks was reddened alone by hand and reverted. The verdict rows now describe the checks as they stand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
| * wrong one. | ||
| */ | ||
|
|
||
| import { defineFlow, dispatcher, handler } from "@flow-state-dev/core"; |
There was a problem hiding this comment.
kinds should be declared within flows/ not as a single kinds file
There was a problem hiding this comment.
Done in 6409f7f00. kinds.mts is split into one file per kind: lab/workforce/flows/workers/planner.mts and worker.mts, each basename matching the kind a WORKER.md names in its flow: line, as devforce-lab does. The row's input contract, which both kinds use, sits beside them in lab/workforce/flows/piece.mts rather than in flows/workers/, because a file there reads as a kind.
It's a move with no behaviour change:
- The loader doesn't walk
flows/. The tree read and the scan for the minted ledger id both pass with the new files in place. - VG passes on
6409f7f00. - All five controls fail at the same legs as before.
The verdict log is updated in 54b81d015.
Generated by Claude Code
…kers planner.mts and worker.mts, basename = the kind a WORKER.md names, as devforce-lab and manager-queue-lab do. The row's input contract both kinds share sits beside them in workforce/flows/piece.mts, not under flows/workers/, where a file reads as a kind. A move: no behaviour changes, and the loader does not walk flows/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
VG passes on 6409f7f; every control reddens the same legs as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
|
Please provide SVGs that detail how the lab is setup to work and flow, so we can document. Reference those SVGs within the PR description |
setup.svg: the Markdown tree, the lab's code and what runs, with the person's one door. flow.svg: one run as four lanes with the check that grades each step, and the three DevTool screens that read it. Both are self-contained, both themes, referenced from the lab README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
|
Re your figures request (comment 5784314186): added in
Both figures are embedded in the PR description, pinned to that commit, and referenced from Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
FIX-1497's spec still described its graded run as fenced by ER-26. The fence lifted on 2026-09-22 when #2051 stood the live hire up, and the graded run passed (#2065). Dated in place, history kept, the same way FIX-1496's lines were: - PLAN.md:8 — "The run is fenced; the build is not" - BUSINESS-RULES.md:73 — BR-21 "It waits on a live hired Workforce" - DECISIONS.md:69 — "ER-26 still fences the graded run" - DECISIONS.md:83 — "the run is already fenced until a live hire exists" PLAN.md:203 was already dated and is unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
…eaches the prompts Review on #2167, two findings: - Per-assertion alone passes vacuously when an assertion is missing, and two of the ten cited instances were exactly that (#2065's decline, #2051's completed-over-rejected row). The same sentence now also says every outcome the leg claims maps to an assertion. - The rule has to reach what is dispatched. One line each mirrors it into the Step 6 completeness gate, implementer-prompt.md and spec-reviewer-prompt.md. No new section. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz


The problem
W5 is done when three exit proofs pass. ER-Collab is the one that decides whether "two seats can work a shared channel, stop to ask a person, hand work over — and you can see it happen" is a claim or a fact. Every piece existed; nothing had ever run them as one scenario, and nobody had watched work change hands. The human leg — a seat stopping on a question and a person answering it — had never run on a hired workforce at all.
What this does
A new lab,
goals/multi-seat-collab/, and one goal check that drives it. Three seats hired from Markdown (a planner and two workers) share one channel's board, served by the ordinaryfsdev dev:builddesk.buildtakes it, hits a question only a person can settle, and parks the row saying what it needs.reviewdesk.Then a real browser opens the shipped DevTool and reads it on three screens, one click apart: the seat's Tasks tab (the row and a link to where it ran) → that session's Tasks tab (why it waited, then what it was told, with nothing expanded) → the Resources panel's ledger (both rows, both desks, which seat ran each). Nothing was built to make the inspection possible.
Left to right: files on disk, code, what runs. Routing comes only from the app's map in the config — each
WORKER.md's desk is what the checks grade against — and the person has one door, the owning seat'sansweraction.The crossing from
eng.builder's lane toeng.reviewer's is the handoff, a second row on the same board; each step carries the leg that grades it.It has been run, and it passes. The graded run waited on ER-26 until FIX-1496's #2051 merged; this branch was brought up to that
mainand run, and the verdict log carries a datedPASSon the current checks. Every claim has a control that makes it go red, and every control has been seen red at exactly the leg it names. Nothing underpackages/changes.What's asked of you
This implements the approved spec. Nothing here needs a sign-off. DOCS.md records no reader-facing change, so there is nothing to publish now that the graded run has passed.
Parts worth reviewing closely
handed-off) before the row parks. BR-6's "the drain returns and the row stays parked" is therefore graded on the next drain over the parked row, which must returnparked-for-reviewwith the row still parked. The spec assumed the first drain would say it; with hand-off it can't.lab/workforce/flows/workers/worker.mts,uses: [board.capability]). An earlier draft built its own reference over the raw ledger and the assignee move BR-14 must see refused was accepted — a hand-built reference skips the board's frozen-assignee policy. Worth a glance from anyone who knows that policy.actionOutputOfinrun-scenario.mts): the HTTP action route returns no output, so BR-10'sdeclined/terminalis read from the root block trace the DevTool's Trace tab renders.second-principalcontrol is driver-side. Nothing underpackages/may change, so the control sends the "second person's" answer as the owner instead. It proves the leg can see a landing; the unperturbed run is what shows a second person's answer does not land.one-seat, as the plan requires). It matters on screen too: the child session's own Tasks tab still lists the review row aspending, because its last change there was the add — where both rows are now is the ledger's to show (BR-17a).FIX-1497 · epic FIX-1457 · spec
specs/issues/FIX-1497/(approved, merged #2045) · graded run after #2051 · related FIX-1511 · merges when approved; implementation merge is a human's callHow to review this — altitude, what's in scope, what's deliberately unsettled
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-1497/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
202) and never settles, with nothing logged. That is FIX-1511's to fix (an engine change BR-19 fences out of here); this PR adds the evidence — an ordinary wrong-user request triggers it, commented on FIX-1511. V4 counts a202with a request id, or an explicit401/403recorded as a refusal; any other status, a missing request id or a transport error fails it.handed-off) rather than asserted.claimeditem is overwritten when the same request later records another change for that row. So every claim is graded on the row's ownclaimedBy, read from inside each attempt (it must be the running seat's own session), and the row for nobody — which never reached an attempt — must have a claim or refusal on record from a seat's own drain.answerrequest on the owning seat's session, not by a later drain that happened by.lab/workforce/flows/workers/(planner.mts,worker.mts), as the sibling labs do. The row's input contract both share sits beside them inlab/workforce/flows/piece.mts, not underflows/workers/, where a file reads as a kind.input: { follows: <first row id> }and is added by the finishing seat through the board, not through the channel'sfileTaskdoor.GOAL_CONTROLis read by both the check and the server's config (the POC's two variable names were a review note).as neverondefineFlow/hireWorkforce/createFlowStatestays, as inmanager-queue-lab's kind factories.fsdev devbuilds when it discovers flows itself.goals/is private and nothing published changes.Everything else — surfaces, checks, verification
Surfaces (PLAN S1–S7), all under
goals/multi-seat-collab/:lab/workforce/(the POC's tree, unchanged, plusflows/workers/planner.mts,flows/workers/worker.mtsandflows/piece.mts) ·lab/host.mts(read, refuse whole, hire; the map is an argument) ·lab/fsdev.config.mts(whatfsdev devserves; the app's desk → seat map) ·lab/run-scenario.mts(spawn, open the channel throughopenChannelsover HTTP, file / drain / answer) ·lab/diff-check.mts(the fence) ·lab/figures/(setup.svg,flow.svg) ·it-hands-a-row-between-two-seats-in-view/(run.mts,goal.md,fixtures/input.json) ·lab/README.md.Checks: V0–V7 and VB are legs of one run, each failure tagged with its leg; controls grade themselves.
goal.mdhas the contract and the verdict log.Verification on this branch:
pnpm tsx goals/multi-seat-collab/it-hands-a-row-between-two-seats-in-view/run.mts— PASS on every leg, on the current checks, on the branch merged with themainthat carries The DevForce exit proof ships a real artifact, and it has been run (FIX-1496) #2051; recorded in the verdict log.GOAL_CONTROL=swapped-desks→ V2 only ·ignore-the-answer→ V3 only ·second-principal→ V4 only ·silent-park→ VB only ·one-seat→ V2 and V5. Each recorded in the verdict log with what it printed.unchanged→ V3; the orphan's seat record dropped → V4; the screen-3 body locator pointed at nothing → VB; a thirdWORKER.md→ refused before any leg; a simulated500for the second person → V4.packages/), then reverted.goalstypecheck clean;pnpm knip:ciclean;validate-model-strings,validate-no-nul-bytes,validate-spec-folderclean.🤖 Generated with Claude Code
https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz