Skip to content

FIX-1792 P1: coordinators without boards (kitchen-sink's help desk, the pentest lab, the desk fixtures) - #2938

Merged
jhoffner merged 17 commits into
mainfrom
fix/FIX-1792-p1
Oct 10, 2026
Merged

jhoffner merged 17 commits into
mainfrom
fix/FIX-1792-p1

Conversation

@jhoffner

@jhoffner jhoffner commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

The problem

A team's mailbox and a coordinator do the same job: a person posts, and the right worker answers. Today the repo has both, and everything that still runs on a mailbox has to move before FIX-1792 can remove it. The first slice is the coordinators that hold no board: kitchen-sink's support desk, the pentest lab, and the goal fixtures that tested a post reaching a worker. Until they move, P4 can't delete the mailbox flow, and the goals that prove these behaviours keep testing the old thing.

What this does

Each of P1's mailbox files becomes a WORKER.md on Workforce's coordinator flow, with the same id, description, body and member list (delegates:). A file that routed by purpose keeps routing: best-fit and its fallback; one that woke everyone gets routing: everyone.

  • kitchen-sink's support.help is a best-fit coordinator over the four specialists. A person posts to it from the page, and the picked specialist's answer appears in that conversation under its own name. The escalation feature (the escalate tool, the escalations board and its panel, and the specialists' "file it" instruction) is removed, not replaced, as the product owner decided on 2026-10-06.
  • The pentest lab hires its findings coordinator over two seats. A coordinator that names a delegate no file declares is now refused when the app loads, instead of opening and skipping it (BR-10).
  • The goal fixtures that tested a routed post and a fresh host now run on coordinators.
  • The goals that read these files are converted, rewritten where the escalation legs went, or retired (lists-a-filed-case-without-a-reload). Each passes on its converted tree, and each control fails at the assertion it names.

What's asked of you

Nothing. The product owner decided follow-ups keep context; this PR waits on FIX-1828 and then restores the followup/context legs.

Parts worth reviewing closely

  • goals/pentest-lab/a-post-reaches-both-declared-seats/run.mts is rewritten on the coordinator. Who received the post is now read from the coordinator's routing record and the delegate sessions, not from a log the lab kept. Check that each of the twelve controls still tests the claim it names.
  • The charter clause in that same gate. A coordinator on routing: everyone never runs a turn of its own, so nothing reads its WORKER.md body while the app is running. The clause reads it from the worker the installation hands the flow, and its drop-charter control fails there.
  • apps/kitchen-sink/lib/coordinator-control.ts and lib/landing-control.ts are the goal controls, rebuilt for the coordinator. Each is honoured only in test mode.
  • The two workforce-mailboxes hosts now name an org in resolvePrincipal (FIX-1792 BR-25, from review). Each check gains an org leg, which reads the sessions from the store rather than the router, and a no-org control.
  • The kitchen-sink-talk checks read which sessions belong to a specialist from the server's workerId index. FIX-1788 removed the rail row per worker, so nothing on the page names the session. What each session holds is still read off the page.
  • specs/issues/FIX-1792/poc/inventory/check.mjs gains a done marker, so converted files still count toward the spec's census.

Spec: specs/issues/FIX-1792/ · Linear: FIX-1792 · Epic: FIX-1786 · Stacked on #2933 (closure child goals). This PR merges after #2933, then after FIX-1828, once it has restored a-routed-post-gets-one-answer's followup and context legs.

How to review this

How to review this. This implements an approved spec — the approach and the numbered
decisions in its DECISIONS.md are already signed off by a human, so please review the
code against that direction, not the direction itself. The canonical set is retained
at specs/issues/FIX-1792/ on main; 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 in docs/contributing/best-practices.md.

Engineering calls
  • kitchen-sink's boot guards over stored mailbox sessions go with the mailbox (the stale-org guard and the pre-rename guard, and named-org's V19): they read sessions the app no longer opens, and D2 says nothing reads old data.
  • The rail opens the person's conversation with each coordinator the shell names (SHELL_COORDINATORS), found or started by the worker id (BR-7a), never by a bare session id. The team panel keeps the roster; its board list goes with the escalations board.
  • kitchen-sink's goal controls are re-expressed, not kept: no-route (best fit read as everyone), answers-go-on (rounds: 1), no-delivery (no flow takes a delegated post) in lib/coordinator-control.ts, and no-landing (an agent flow that answers and hands nothing back) in lib/landing-control.ts. Test mode only, as before.
  • The pentest charter is read off the installation, not a running block. A coordinator on routing: everyone runs no turn, so nothing reads its WORKER.md body at run time. The gate reads it from the worker the installation hands the coordinator flow; drop-charter fails there. Wrong costs: a body that stops reaching the judgment turn would pass this gate (judgment coordinators' own tests cover that).
  • BR-9's "member with no address" became "a delegate whose flow takes no posts". The lab registers its kind again as probe-desk, outside delegateFlows; the routing record says skipped with the coordinator's own reason. Wrong costs: none outside the lab.
  • BR-17 refuses any author claim. The coordinator's door is { message }, strict, so "a member's own claim is accepted" has no subject; its opposite state is the same post with no claim. BR-8's second lab is gone: answers-go-on (rounds: 1) now reddens BR-8 on the main path.
  • tamper-principal → tamper-record. A message item has no principal; the control changes a stored answer's role and leaves author and body alone.
  • The unknown-member scenario's description and body changed (they stated the old behaviour, "this mailbox still opens"). Every other converted file keeps its description and body (BR-7).
  • The pentest lab writes its inventory from a flow of its own (inventory-writer, spreading inventoryWriterActions), since no mailbox kind is registered to carry the writer. P4 moves inventoryWriterActions out of the mailbox module; the checker keeps it (KEPT_EXPORTS).
  • An everyone-only coordinator still names a routeModel. The flow requires one; it is never called.
  • The kitchen-sink-talk checks read which session is a specialist's from the server's workerId index (FIX-1788's rail has no row per worker); content is graded off the page.
  • Flow-scoped page controls in keeps-both-sides. The person's post and their message to a seat are both user messages now, so each control strips one flow's, learned from the session's state.
  • Two main controls retired (shows-the-reply, a-person-talks, with today-main.json): no commit has a coordinator without the live view they compared against.
  • agent-replies' post-without-author → no-author-name, at the page: there is no tool to swap now.
  • a-person-talks waits for the panel to draw the session it opened (by the server's message texts, not graded). The panel keeps the previous session's items for a moment, and a seat panel draws a coordinator conversation's messages as turns; the first run read the coordinator's conversation as a specialist's session.
  • The a-person-talks smoke's follow-up is unpinned — the open question above.
  • kitchen-sink's chat-assistant.tsx left as is (reclassified to S9 in the checker): it is a registry copy (upstream first), and no coordinator-route item reaches it.
  • support.help's task tools (BR-14) are not built here. They arrive with FIX-1802's wiring of the coordinator flow; nothing in kitchen-sink changes for them.
  • The checker gains a done marker, so P1's converted files (and the one FIX-1788 retired) keep counting toward the spec's census, and a done file left in the tree fails. It also classifies six files and two exports main added after the spec.
  • Downstream, not run here: shift-manager/a-lab-is-worked-through-one-skinned-shell leg b posts to the pentest mailbox through Shift Manager's workstream view, which can't show a coordinator until S8 (P3); its P4 re-run is in PLAN's goal table. one-person-runs-a-labs-projects-and-people/j4 hands the lab's README (updated here) to a writer agent and waits on FIX-1793.
  • The specialists never promise a hand-off. On real models, one told a locked-out user I'm escalating this to our security/support team, and nothing does that now. Each specialist's instructions gain one sentence: never promise to escalate or hand a case to another team; answer what you can, and say plainly what you can't. No tool is added (BR-14). answers-a-clerk-note's live leg, re-run: none of its five answers promises a hand-off.
Everything else: verification and file-by-file

Goals, each run green and under every named control, with the check before the change taken first. Each goal's goal.md verdict log has the rows.

Goal Before After Controls (each red at its named legs only, unless noted)
pentest-lab/a-post-reaches-both-declared-seats (REWRITE) old check on the converted lab: TypeError PASS, all ten legs (re-run on the rebased head) 11 red on their own clause, reverse-order green
pentest-lab/a-seat-answers-from-its-own-document — PASS on gpt-5.4-mini, clearance carried tool-dropped, documents-swapped, handler-in-the-slot red
workforce-mailboxes/a-fresh-host-wakes-its-member-agents old check: TypeError; the org leg on the unchanged host: org (3 sessions on the default org) PASS (re-run on d55a8c3) no-wake → woken, answers; answers-go-on → answers, quiet; no-org → org
workforce-mailboxes/a-routed-post-gets-one-answer old check refused the fixture; a faithful port failed followup and context; the org leg on the unchanged host: org (10 sessions on the default org) PASS (re-run on d55a8c3); live PASS before the org fix (follow-up unpinned) no-route → one, lands, held, fallback; no-landing → one, lands, fallback, everyone; no-org → org
kitchen-sink-talk/a-post-runs-each-member-agent-once FAIL on main (setup: rail row per worker) PASS no-delivery → support.accounts; no-route → others; answers-go-on green
kitchen-sink-talk/agent-replies-in-the-mailbox FAIL on main (setup) PASS answers-go-on → woken-once; no-author-name → author
kitchen-sink-talk/keeps-both-sides-across-a-reload FAIL on main (setup) PASS drop-coordinator-post → coordinator; drop-user-message → seat
kitchen-sink-talk/shows-the-reply-without-a-reload FAIL on main (setup) PASS no-live → working, line
kitchen-sink-talk/answers-a-clerk-note-or-files-it (REWRITE) FAIL on main (roster) PASS; live PASS no-landing → answer (re-taken after the landing-control fold)
kitchen-sink-talk/a-person-talks-to-a-seat-a-mailbox-and-back (REWRITE) FAIL on main (b, c1 setup) PASS, plain journey and five controls; smoke PASS each control at its named assertions (no-landing re-taken after the landing-control fold: a:line, b:line; c1, c2, seg green)
shift-manager/it-sends-a-turn-into-a-seat-session PASS on #2933 PASS (on the rebased head) optimistic-turn → delivered; fresh-session → continued

Every kitchen-sink-talk goal was already red on clean main at 57d2c10, at setup: the checks looked for a rail row per worker, which FIX-1788 P4 removed. lists-a-filed-case-without-a-reload passed there and is retired here.

Suites

  • pnpm typecheck --concurrency=2 on d55a8c3: 74 tasks, all pass. The root script's guards (package boundaries, updater purity, side-chain vocabulary, the goals' control shape) pass, and the goals package's tsc --noEmit passes.
  • pnpm --filter @flow-state-dev/kitchen-sink test on d55a8c3: 27 files, 168 tests pass. The red states: mailbox-wake.test.ts under each server control failed at the tests that control names; the panel's label case failed under a mutated label.
  • kitchen-sink e2e, a test-mode production build, on d55a8c3: 21 pass.
  • fsdev gen --check in kitchen-sink: up to date. node scripts/check-mailbox-rename.mjs: pass.
  • node specs/issues/FIX-1792/poc/inventory/check.mjs on d55a8c3: PASS, with the census at the spec's counts, and nothing classified but gone. Before the table updates it failed with 25 problems. --control: every plant refused. A converted file put back by hand fails it: marked done (P1) but still a MAILBOX.md.
  • pnpm knip: no new finding in the files this PR touches. The repo-wide run fails as it does on main.

kitchen-sink (S6)

  • workforce/teams/support/workers/help/WORKER.md (from mailboxes/help/MAILBOX.md): flow: coordinator, delegates: the four specialists, routing: best-fit, fallback: support.general; boards: and boardActions: go. The four specialists' WORKER.md lose post-to-mailbox, escalate and the instruction to file.
  • Removed: workforce/blocks/escalate.ts, workforce/mailbox-notify.ts, lib/escalate-control.ts, lib/mailbox-{landing,post,route,wake}-control.ts, test/escalate.test.ts. workforce/workforce.gen.ts regenerated.
  • workforce/hire.ts registers defineCoordinatorFlow beside agent; new lib/coordinator-control.ts and lib/landing-control.ts carry the goal controls. The no-landing stand-in loads its worker once per request, as the built-in agent does (folded from POC: quiet agent loads its worker once #2943).
  • fsdev.config.ts: the mailbox wiring, its session opening and the boot guards over mailbox sessions go.
  • The page: lib/workforce-shell.ts (coordinator kinds, delegateOfRun), lib/rail-sessions.ts, components/picked-session-panel.tsx (the conversation's lines under their writers), components/team-panel.tsx (roster only), app/page.tsx (the Coordinators section). lib/e2e-mock-script.ts and test/mock-flowstate.ts script coordinator-route.
  • Tests and e2e rewritten for the coordinator; README.md's support-desk section, with how to post over HTTP.

pentest-lab (S4)

  • Six MAILBOX.md → workers/<name>/WORKER.md coordinators (findings in the lab and the four refusal trees, briefing in the scenario tree). notify.mts removed.
  • lab/host.mts rewritten: the installation, the probe kind and Workforce's coordinator flow, the operator's conversation per coordinator, reads of the conversation, its routing record and delegate sessions, and the inventory from a writer flow of the lab's own. lab/workforce/flows/workers/probe.mts takes delegated posts through delegatedPostEntry. lab/README.md, lab/fsdev.config.mts, the scribe's body.
  • a-post-reaches-both-declared-seats: run.mts, fixture and goal.md rewritten; a-seat-answers-from-its-own-document: run.mts, harness.mts, fixture and goal.md converted.

Fixtures and goals

  • workforce-mailboxes/a-fresh-host-wakes-its-member-agents and a-routed-post-gets-one-answer: front, help, lounge → coordinator WORKER.md; hosts, checks and goal.md converted (routed-post retires followup and context until FIX-1828). Both hosts name their org in resolvePrincipal, and each check has an org leg and a no-org control.
  • kitchen-sink-talk: five goals converted or rewritten (run.mts, fixture, goal.md); lists-a-filed-case-without-a-reload retired, with its line in goals/README.md; a-person-talks' fixtures/today-main.json removed. goals/lib/kitchen-sink.mts gains talkTo, openWorkerCopy, showCoordinator, workerSessions, coordinatorConversation, and loses newConversation.
  • shift-manager/it-sends-a-turn-into-a-seat-session: the asker lab's front → coordinator WORKER.md, its config registers the coordinator flow and writes its inventory from a flow of its own, and the check finds the asker by its flow.

Spec evidence

  • specs/issues/FIX-1792/poc/inventory/check.mjs: the done marker, P1's rows marked done, six files and two exports main added since the spec classified, kitchen-sink's chat-assistant.tsx moved to S9. The twelve rows for files that are gone (P1's and FIX-1788's deletions) are removed, and FIX-1824's goals/lib/shift-manager.mts is classified.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV


Generated by Claude Code


Note

Medium Risk
Large behavioral and API-path change in the reference app (session model, routing, removed escalation), but scoped to kitchen-sink/fixtures/goals with extensive test rewrites rather than core auth or payment paths.

Overview
Replaces the mailbox-based support desk with Workforce’s coordinator flow so support.help is a WORKER.md coordinator (flow: coordinator, delegates, routing: best-fit) instead of MAILBOX.md + boot-time openMailboxes. Posts go through coordinator sessions and run, and answers show up as session messages (not mailbox-post components).

Removes escalation end-to-end in kitchen-sink: the escalate block, escalations board UI, specialist tooling/instructions, related goal controls, and e2e/tests that asserted live board rows.

Shell/UI and boot simplify: rail section Coordinators (via railSessions + workforce ensureWorkerSession), coordinator transcript in picked-session-panel, roster-only team panel, and fsdev.config drops mailbox flow registration, session opening, and stale-store guards. Goal controls move to coordinator-control.ts and landing-control.ts (test mode only).

Docs, mocks (coordinator-route), and e2e are retargeted; pentest-lab and workforce-mailboxes fixtures follow the same mailbox→coordinator pattern (per PR scope).

Reviewed by Cursor Bugbot for commit 80e4f6a. Configure here.


Generated by Claude Code

claude added 6 commits October 9, 2026 01:30
…post desks are coordinators (FIX-1792 P1)

Kitchen-sink's help desk is a WORKER.md on the coordinator flow
(routing: best-fit, fallback: support.general), converted key by key from
its MAILBOX.md, which is deleted. The escalation feature is removed, not
replaced: the escalate tool and its test, the no-filing control, the
escalations board and its panel, and the specialists' instruction to file.
The page lists the person's conversation with support.help under
Coordinators, draws its lines under their writers' names, and names each
delegate still working. The mailbox wiring, notify block and boot guards
over stored mailbox sessions go; the goal controls are re-expressed on the
coordinator (no-route, no-landing, no-delivery, answers-go-on).

The workforce-mailboxes fresh-host and routed-post goals convert onto the
coordinator flow (BR-8, BR-9). The routed-post goal retires its followup
and context legs: the coordinator's best fit routes a post on its own
words and hands a delegate the post alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…inators (FIX-1792 P1)

S4 and the rest of S6's goals.

- pentest-lab: `pentest.findings` and the four refusal trees' `findings`
  are coordinator WORKER.md files on `routing: everyone`; the
  unknown-member scenario's `briefing` names `pentest.nobody` and is now
  refused at load (BR-10). The host registers Workforce's coordinator
  flow over the lab's `probe` kind, which takes delegated posts through
  `delegatedPostEntry`; notify.mts goes. The gate is rewritten on the
  conversation, the routing record and the delegate sessions, with its
  twelve controls re-expressed; the honesty check converts.
- kitchen-sink-talk: a-post-runs, agent-replies, keeps-both-sides and
  shows-the-reply convert; answers-a-clerk-note and a-person-talks are
  rewritten without the escalation legs; lists-a-filed-case retires
  (goals/README.md). goals/lib/kitchen-sink.mts gains the helpers they
  share (Talk, the worker copy, the coordinator's conversation).
- workforce-mailboxes: fresh-host and routed-post verdict rows.
- The inventory checker marks P1's files done and classifies what main
  added since the spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…rdicts (FIX-1792 P1)

The check's head states the rewrite: leg e and no-filing go with the
escalation feature, main's control goes, and the smoke's follow-up is no
longer pinned. The checker's chat-assistant row moves to S9 with its
registry copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
Built on fix/closure-children-one-copy's hire fix for the asker lab (#2933).
`front` is a WORKER.md on the coordinator flow (delegates: [desk.asker],
routing: everyone); the asker takes no delegated posts, so a post to it
reaches nobody, as the mailbox woke nobody. The lab registers the
coordinator flow, opens no mailbox, and writes the inventory from a flow
of its own. The check finds the asker by its flow. The inventory checker
marks the file done and classifies the concept-doc skill's example.

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

Nothing imports it or its line type, so neither is exported.

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

vercel Bot commented Oct 9, 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 10, 2026 12:14am UTC
flow-state-dev-kitchen-sink Ignored Ignored Oct 10, 2026 12:14am UTC
flow-state-dev-ui Ignored Ignored Preview Oct 10, 2026 12:14am UTC

Request Review

@linear-code

linear-code Bot commented Oct 9, 2026

Copy link
Copy Markdown

FIX-1792

@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot 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: 8ce149e6-9714-4068-b96e-ac4aa20472cf)

…FIX-1792 P1)

With the escalation feature removed, a specialist on a real model still
told a locked-out user it was escalating the case, and nothing does that.
Each specialist's instructions gain one sentence: never promise to
escalate or hand a case to another team; answer what you can, and say
plainly what you can't. No tool is added (BR-14). answers-a-clerk-note's
live leg re-run: none of its five answers promises a hand-off.

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

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot 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: ba5ffee2-1cc1-4c2f-b9e1-4b3e596de473)

@jhoffner
jhoffner marked this pull request as ready for review October 9, 2026 16:37
@jhoffner

jhoffner commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot 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: b6e1bf58-caee-49f3-8753-68a99068757e)

claude added 2 commits October 9, 2026 16:40
Conflicts:
- goals/kitchen-sink-talk/lists-a-filed-case-without-a-reload/run.mts:
  kept the deletion (the goal is retired in P1; main's FIX-1491 edit
  goes with it).
- goals/workforce-mailboxes/a-fresh-host-wakes-its-member-agents/run.mts:
  FIX-1491's failure collection (runGoal hands the body its list) over
  P1's coordinator conversion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
goals/coordinators/hands-each-post-to-its-delegates arrived from main and
reads the DevTeam's mailbox boards; it follows the DevTeam in P3 (S7).

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

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot 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: 18e305fc-d9f9-44b1-ab1a-718c73274cf6)

@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: 6c912d3fec

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

@chatgpt-codex-connector

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-09T16:44:08.228681Z 6c912d3 Manual 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" 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.

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

Verdict

Approve. P1 is the right slice: net ~2k lines removed, four mailbox-specific control modules collapsed into two coordinator-focused ones, kitchen-sink escalations deleted instead of re-homed, and pentest / goal hosts converged on the same readWorkforce → defineCoordinatorFlow wiring. I do not think a materially simpler P1 design exists without moving goal-control seams into @flow-state-dev/workforce (which BR-22 and goal-control.test.ts deliberately forbid).

Ran pnpm --filter kitchen-sink test (168 tests green). check.mjs --after still fails on P1 as expected (mailbox floor removal is P4).


Did the approach over-complicate things?

Mostly no. The scary part of the diff is breadth (goals + pentest + kitchen-sink), not depth. The app boundary is cleaner: workforce-shell.ts stays a leaf constants module, hire.ts is the single wiring point, and deleting escalate.ts / mailbox-notify.ts / four mailbox-*-control.ts files is real simplification.

One real cost: no-landing is implemented twice — apps/kitchen-sink/lib/landing-control.ts (~110 lines) and quietAgentFlow in goals/workforce-mailboxes/a-routed-post-gets-one-answer/run.mts. Both re-implement “agent flow that answers onDelegatedPost but does not call delegatedPostEntry.” That is understandable (kitchen-sink needs intent/chat + tools; the goal needs scripted models; goals must not import kitchen-sink), but it will drift unless you centralize it.

Not a P1 blocker: goals/multi-seat-collab/… is still mailbox-shaped; PLAN marks it REWRITE in P2 — correct deferral.


Cleaner alternatives (for follow-ups, not a rewrite of this PR)

Option Trade-off
Export delegatedPostMessage from @flow-state-dev/workforce and delete local heard() copies Tiny, safe, reduces string drift
goals/lib/quiet-agent-flow.mts (scripted) + kitchen-sink keeps thin landingControl wrapper Cuts duplicate flow structure without wrong dependency direction
defineAgentWorkerFlow({ …, delegateHandback: false }) in workforce Cleanest long-term API for controls + tests; needs a deliberate public/test surface and docs — bigger than P1
Rename e2e markers [reply:in-mailbox] → coordinator vocabulary Pure clarity; touches assertions in e2e + unit tests
Update check.mjs FILE_CLASS rows for mailbox-*-control.ts → coordinator-control.ts / landing-control.ts Keeps the inventory script honest as files move (census metadata, not runtime)

I would not try to dedupe pentest host.mts with kitchen-sink hire.ts — different error policies (loadTree throws vs collected errors) and lab-only controls are intentional.


Performance / CI (informational)

No production hot-path regression spotted. Test harness cost is in expected places: pentest readConversation polling, e2e answerLanded double-fetch + reload-heavy delegate checks, fixed waitForTimeout(1500) for routing-hold races. Worth watching CI duration; not merge-blocking.


What I skipped

  • Requesting a workforce-level landAnswers flag in this PR — correct product boundary for P1.
  • REQUEST_CHANGES on duplicate quietAgentFlow — document and track as a small follow-up unless you want it fixed before merge.
Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

Comment thread apps/kitchen-sink/workforce/hire.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: the quiet agent can be smaller.

apps/kitchen-sink/lib/landing-control.ts builds agent-answer twice, then wraps each copy in a sequencer whose only extra step is reloading the worker. The built-in agent already loads that worker once, on the request. One shared generator body and that hook is the same contract: under no-landing the specialist still answers in its own conversation (instructions and the tools its tools: names unchanged), the line still does not land, and a direct message to the specialist still answers. Off the control, the built-in agent is unchanged. Net −15 lines (112 → 97).

The rest of this PR is already a deletion. The two fixture hosts stay written out in full because their checks read each file's source.

POC, draft, does not merge: #2943

Fold that subtraction into this PR. After this lands, close the POC unmerged.

Open in Web View Automation 

Sent by Cursor Automation: Code Snob

claude added 4 commits October 9, 2026 16:55
…t exist (P1)

FILE_CLASS still classified twelve files that are gone: the five kitchen-sink
controls and the escalation and notify files P1 removed (their replacements,
coordinator-control.ts and landing-control.ts, name none of the removed
surface, so they need no row), and four FIX-1788 removed before it. The census
printed them as "classified but gone"; it now describes the tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…FIX-1792 P1, BR-25)

Neither converted host had a resolvePrincipal, so every session they made,
the coordinator conversation and each delegate's, landed in the development
default org, and neither goal could see a session leave the named-org path.

Each host now names its one user and org in resolvePrincipal, ignoring the
request (BP-031). Each check gains an org leg that reads the conversation and
every delegate session under it from the store (the router scopes listings to
the caller's org, so it could not show one that landed elsewhere) and requires
the host's org; and a no-org control that leaves the resolver out.

Red first: the org leg on the unchanged hosts failed at org alone (3 and 10
sessions on __fsd_default_org__). Green with the resolver. no-org fails at org
alone; the existing controls still fail only their own legs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
… per request (FIX-1792 P1)

Folds Code Snob's shape proof (#2943, not merged). The stand-in built the
same answer generator twice and wrapped each in a sequencer whose only job
was to load the worker. It now loads the worker on request.onStarted, as the
built-in agent does, and its two doors share one generator body.

Same contract, checked before and after through the app's real config under
no-landing: a delegated post is answered in the specialist's own session with
its own instructions, nothing lands in the person's conversation, and a direct
message to a specialist is answered. That check went red with the control off
(the answer landed) and with the new onStarted removed (the delegate never
answered). Off the control landingControl returns before building anything,
so the built-in agent is untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
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
….mts (P1)

FIX-1824 moved pendingSeatAsks into goals/lib/shift-manager.mts, whose doc
comment says "a mailbox post". The word only: an EDIT row, FIX-1796's sweep.

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

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot 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: 4823562b-a0b3-4900-b72a-88c37041a5bd)

@jhoffner

jhoffner commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

@claude resolve conflicts

claude added 3 commits October 9, 2026 23:53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
FIX-1794 P2's conversation-board task entry takes mailbox task lists (an
S9 edit), and FIX-1776's chief-of-staff memory test passes the DevTeam
host its mailboxes option (an S7 conversion, as its coordinator sibling is).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…k (FIX-1792 P1)

FIX-1828 gave best fit the conversation's recent lines ({ recent, post })
and hands a delegate those lines as one user-role message before the post.
So the two legs the conversion retired are restored: the scripted route
sends a [follow-up] to whoever last wrote in recent, and the scripted
answer reads the earlier item from the lines message, never system text.

Each has a control wired as the others are: no-recent (best fit's
evaluation handed { post } alone, around the model) fails at followup
only; no-context (an agent flow of the app's own whose delegated post
reaches the published entry without its lines) fails at context only.
no-route and no-landing redden both again, as they did on the mailbox.
The live leg pins the follow-up to the laptop's specialist again and
strips the container's intent overrides. Verdicts in each goal.md,
fresh-host re-taken after the merge.

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

cursor Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot 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: 8c958fc6-646d-4f34-bada-bf63155025f4)

@jhoffner
jhoffner merged commit beac117 into main Oct 10, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants