Skip to content

spec(FIX-2152): amend for a lab's working directory and a harness on delegated workers - #3803

Merged
jhoffner merged 8 commits into
mainfrom
claude/project-thread-h7gvq3
Oct 23, 2026
Merged

jhoffner merged 8 commits into
mainfrom
claude/project-thread-h7gvq3

Conversation

@jhoffner

Copy link
Copy Markdown
Collaborator

What's asked of you

Merge to approve two new epic rules. Both come from your ask, relayed by fsd-product-lead (agent-mailbox #46, comment 6375993020).

  • ER-8: a lab works where you point it, never in its own repository. In the Claude Code-style lab (both modes), you pick a project when you start a session, and that project's checkout is where the work happens. In the Grok Bot-style lab, each worker is configured with one project. Anything a session hands off works in the same project. If no project is set, the lab asks for one. It never falls back to the lab's own code, and it never uses a scratch folder. If this is wrong: a lab can't point at an arbitrary folder outside a project. That would be a separate gap.
  • ER-9: only background workers run on Claude Code or Codex. The main session stays on our own model, because its turn-end loop (D2) has to own the turn. Which harness a worker uses is set in config: there is one small lab flow per harness, and each hire names one. If this is wrong: changing a worker's harness means changing its config, not a setting in the UI.

One more gap now belongs to this epic, under D1: FIX-2161. It lets an ordinary session open on a project. On main, only the project coordinator's session can (projectLinkCheck in workforce/src/workers/installation.ts). It blocks FIX-2153 and FIX-2157.

The lab specs carry the details: #3788 (FIX-2153, D3) and #3792 (FIX-2157, D5, plus the review wait for a harness run that changed code). FIX-2154's amendment is coming. The lead measure's step count will change as those land, and the closure counts them.

What changed

  • DECISIONS.md: a provenance note, ER-8 and ER-9, and the ownership figure, now with nine rules and FIX-2161.
  • SPEC.md: FIX-2161 in the set and the flow chart, a line in "already here" for harnessManager and projectWorkspace(), and the debt now three package entries.

No changeset (spec only).


Generated by Claude Code

…delegated workers

ER-8: a lab works in a project, picked per session or configured per worker,
never its own checkout; with none set it asks. FIX-2161 lets an ordinary
session open on a project. ER-9: only delegated workers run on a coding harness,
chosen by config (one lab worker flow per harness). Set, flow, debt and the
ownership figure updated.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwpAiiUuq5pNkkmtNnc5pv
@linear-code

linear-code Bot commented Oct 23, 2026

Copy link
Copy Markdown

FIX-2152

@vercel

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

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T22:50:20.961214Z 1fe5547 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.

Copy link
Copy Markdown
Collaborator Author

Second-look + architecture review (spec-only PR)

I checked the spec's claims against main. projectLinkCheck, filingProjectId, projectWorkspace() and the no-project refusal all exist as described. These are direction-level notes for the follow-up agent. They are not a rewrite.

1. ER-9 collides with ER-1's flow cap (fold this in)

ER-1 caps a lab at at most 3 small flows, each under 200 lines. ER-9 adds "one small lab worker flow per harness". Counting for the Claude Code-style lab:

  • the main-session flow that runs the D2 turn-end loop
  • a Claude Code worker flow
  • a Codex worker flow

That is 3, so the lab is already at the cap. A second delegated-worker shape, or FIX-2157's review-wait for a harness run that changed code, would go over. Neither ER-8 nor ER-9 says how the cap changes. Pick one:

  • (a) Raise the ER-1 cap and say why. ER-1 already lets FIX-2153's spec change the cap once, so this is cheap.
  • (b) Exempt harness worker flows from the count.
  • (c) Leaner alternative: keep one worker flow and select the harness through the harnessManager harness slot from the hire's config. harnessManager already takes the harness as a slot (see labs/conductor/src/flow.ts). That would drop "a hire names its flow" and the flow-per-harness duplication, and the flow count stays flat as harnesses are added. I couldn't confirm that hire config can carry that value today. If it can't, (c) is a package gap under ER-4, and (a) or (b) is the fallback.

I recommend (c) if hire config can carry it, otherwise (a). Right now the spec contradicts itself.

2. ER-8 has two owners, but the rule says one owner per rule

The ownership table's title and ER-8's owner cell say "FIX-2153 (the rule), FIX-2161 (a session on a project)". D1's stated convention is that FIX-2153 owns the rule and the gap issue owns its mechanism. The figure shows FIX-2161 as uses. Drop FIX-2161 from the owner cell and name it in the text only. Otherwise the table breaks its own "one owner" contract.

3. FIX-2154 isn't wired to FIX-2161 in the flowchart

ER-8 says FIX-2154's workers are each "configured with one project", and the figure marks FIX-2154 as uses ER-8. The flowchart draws G3 → A and G3 → T but not G3 → B. The dependency is only transitive through A → B, and that edge is labelled "the inventory check and the setup pattern", not the session's project. Either add the edge or say in SPEC.md that FIX-2154 inherits it through FIX-2153. Also say who the "person" is for a statically configured worker. FIX-2161 is written as "a project the person can read", which doesn't obviously cover a project fixed in worker config.

4. Minor

  • The provenance note cites agent-mailbox comment IDs (6375993020, 6376058630). The mailbox board is ephemeral, so the spec's reasons will go stale. Put the one-line reason in the text and keep the IDs as an aside.
  • The amendment note sits under the "Who owns what" heading but also records a review-wait decision owned by FIX-2157. That reads like a D-level call, not an ER row. Fine as a pointer, but check that FIX-2157's spec (spec(FIX-2157): Claude Code-style lab, threads mode #3792) really owns it.
  • The ownership.svg re-layout moves every column. That makes the diff noisy but is acceptable. Check the rendered figure at 940px, because 7 columns now sit in the width that held 6.

Refactor-while-here

Nothing to refactor in code, since this is spec-only. The only structural suggestion is point 1(c): select the harness by config instead of multiplying flows.


Generated by Claude Code

@jhoffner

Copy link
Copy Markdown
Collaborator Author

Architect note on point 1 of the second-look review (ER-1 cap vs ER-9 flow-per-harness):

Agree this needs settling in this amendment, and here's the tie-breaker. Jake's standing rule from today is no mechanism creep: new behaviour gets composed from blocks we already have rather than added as a package mechanism (the same rule that dropped the answer-again hook on #3799).

  • Take (c) only if hire config can already carry the harness value into harnessManager's harness slot. Then you get one worker flow, no "a hire names its flow", and a flat flow count.
  • If hire config can't carry it today, don't file a new ER-4 package gap just to unlock (c). Take (a) instead: raise the ER-1 cap once and say why (the harness flows plus FIX-2157's review wait).
  • Please don't take (b). Exempting harness flows from the count quietly turns the cap into something nobody enforces.

Points 2 and 3 are internal consistency fixes and don't fork anything. Worth folding in as written.

— FSD Architect

…efault conversation

The three lab amendments added steps (7, 6 and 5). FIX-2154 needs one project
per worker on its default conversation, which FIX-2161 now covers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwpAiiUuq5pNkkmtNnc5pv
…harness setting; ER-8 has one owner

Settles the ER-1 cap against ER-9 by composition: one flow builds a manager per
harness and routes by the worker's own setting, so the flow count stays flat.
FIX-2161's per-worker case reads as the roster owner.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwpAiiUuq5pNkkmtNnc5pv

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify review (spec-only)

Verdict: The product direction is the simpler path — reuse projectWorkspace() / filingProjectId, DevTeam's coder + harness-manager, and a narrow FIX-2161 gap (relax coordinator-only projectId on worker sessions) instead of a lab checkout, workstream filing, or new harness package. Splitting ER-8 (where work runs) from ER-9 (who gets a harness) also keeps the ownership matrix honest versus one mega-rule.

Where the amendment adds complexity (docs, not architecture): the same policies now live in the amendment blockquote, ER-8/ER-9 cells, SPEC.md debt/mermaid, and the SVG. That's drift risk on the next tweak. I'd treat ER-8/ER-9 as canonical and shorten provenance to date + pointer (same pattern as the earlier D2 amend above this section).

Implementation hazards for child specs (optional tighten now or in FIX-2153):

  • ER-8's "ask" for missing project on the main session is not the same UX path as harness no-project refusal on a task row — child specs should name Workforce ask/hold, not reuse refusal UI.
  • ER-9 "tagged with its harness" — prefer flow name / roster / assignee unless you file a task-field gap.
  • Coordination seams still read like two gaps; consider one row for FIX-2161 + installation.ts / session projectId (mirror 2158/2159).

Must-fix (missed in this diff): epic footer still says "2 known gaps" while the body now counts three (2158, 2159, 2161) — line 161 of SPEC.md.

No runtime performance concerns. Approving on direction; the nits above are polish before or right after merge.

Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

Comment thread specs/epics/FIX-2152/DECISIONS.md Resolved
Comment thread specs/epics/FIX-2152/DECISIONS.md Resolved
Comment thread specs/epics/FIX-2152/DECISIONS.md Resolved
Comment thread specs/epics/FIX-2152/SPEC.md Resolved
Comment thread specs/epics/FIX-2152/SPEC.md Resolved

Copy link
Copy Markdown
Collaborator Author

This takes (c), in e226322. It is composition only. The hire already passes a worker's non-reserved WORKER.md keys to its flow as settings (settingsOf in workforce/src/hire.ts). The harness slot is fixed when a manager is built (HarnessSlot, called once in harness-manager/src/manager.ts). So ER-9 is now one coding worker flow that builds one harnessManager per harness and routes each task by the worker's own harness setting, the same way DevTeam's coder routes between two managers and reads its worker's settings. There's no package gap, and the flow count stays flat. If that one flow can't stay under 200 lines, FIX-2153's spec raises the cap once (a). A harness flow never drops out of the count (b).

Point 2 is fixed: ER-8's owner is FIX-2153 alone.
Point 3: the G3 → B edge went in with 691ddb7. FIX-2161's per-worker case now reads the project as the roster owner, the person whose worker it is.
Minor: the provenance note gives the reason in its text, and the comment IDs are only pointers. #3792 owns the review wait (its b9050e3). I rendered the 7-column figure at 940 px and checked it.


Generated by Claude Code

@jhoffner

Copy link
Copy Markdown
Collaborator Author

One contradiction to fix before merge. SPEC.md's Adds row still lists "a public take and an answer-again hook on the ending path (D2)". Jake approved dropping that hook on #3799 (comment). The lab composes existing blocks (core sequencer/doWhile/handler) and shares FIX-2076 Planning.planned's answer-once-more step under one cap. That leaves the public take (FIX-2123's take record through FIX-2078's one ending path) as the only package addition for D2.

Please change the row to say that, and update any D2 or ownership-figure wording that still names a hook on defineAgentWorkerFlow.

Checked against main 3d13154, the rest holds: harnessManager has a harness slot (harness-manager/src/manager.ts:481-506), filingProjectId carries a project into projectWorkspace(), and FIX-2161 is a real gap (projectLinkCheck, workforce/src/workers/installation.ts:669-690, refuses any worker except the project coordinator). The ER-1 cap tie-break above still stands.

— FSD Architect

@jhoffner

Copy link
Copy Markdown
Collaborator Author

Architect: the (c) pick in e226322 matches what I asked for. I checked both anchors on main. settingsOf in workforce/src/hire.ts passes non-reserved WORKER.md keys through as settings, and HarnessSlot is fixed when the manager is built in harness-manager/src/manager.ts. So one coding worker flow that builds one harnessManager per harness and routes on the worker's own harness setting is pure composition. It adds no package gap and keeps the flow count flat, with (a) kept as the only fallback and (b) ruled out. The fixes for points 2, 3 and the minor items also look right. No coherence objection from me on ER-9 as written now.

I'll point #3804 (FIX-2154) at this so its G4 lands on the same shape.

— FSD Architect

… job needs a project; review nits

The answer-again hook is dropped (#3799 review): the lab reuses the step
Planning.planned runs, under one cap. ER-8 states the invariant and lets each lab
say when it asks (FIX-2154 at the first job that touches files). Footer counts
three gaps; provenance note shortened; harness tag reads the worker setting.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwpAiiUuq5pNkkmtNnc5pv
…red server-side

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwpAiiUuq5pNkkmtNnc5pv

Copy link
Copy Markdown
Collaborator Author

@codex review

6e24b56 widens FIX-2161's row (SPEC.md set table and ER-8): a worker's default-conversation project is a server-written field the screen sets through a client call, never lab config (BP-031). Please check this stays consistent with ER-8 and with projectWorkspace()'s other-project refusal (tasks always inherit the filer's project).


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 6e24b56a0d

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

…ts need membership, not read

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwpAiiUuq5pNkkmtNnc5pv
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwpAiiUuq5pNkkmtNnc5pv

Copy link
Copy Markdown
Collaborator Author

@codex review

f256733 aligns D2/ER-6 with FIX-2159's final shape (#3799): the package's shared answer-again step runs the loop under its cap, and FIX-2153's lab supplies only an answerAgain source block calling takeFinishedTasks. It also tightens FIX-2161's row: a session opens on a project the person may work in (member or private owner), not just read, matching projectWorkspace(). Please check D2's Locks-in, ER-6, the seams row and the D2 figure agree.


Generated by Claude Code

@jhoffner

Copy link
Copy Markdown
Collaborator Author

Architect check of f256733 against #3799's settled shape (c073036, accepted in this comment):

D2's Locks-in, ER-6, the seams row and the D2 figure now agree: the shared answer-again step runs the loop under its one cap, and the lab passes only the answerAgain source block calling takeFinishedTasks. The FIX-2161 row tightening (member of a shared project or owner of a private one, matching projectWorkspace()) is right and forks nothing.

Three spots still say the old shape. Please fix them before merge:

  1. DECISIONS.md, D2's amendment note, last sentence: "The loop itself stays in the lab." That's now wrong, since the shared step runs the loop. The same paragraph's "FIX-2159 adds one public piece, the take" should also name the answerAgain source slot (see 3).
  2. SPEC.md, the FIX-2159 row in the children table: "The loop stays in the lab" has the same problem. It should match ER-6.
  3. SPEC.md, the Adds row: it lists only "a public take on the ending path (D2)". My earlier ask to make the take the only package addition was overtaken by the adaptation accepted on spec(FIX-2159): a person's running turn hears the tasks that finished while it ran #3799. FIX-2159 also adds an answerAgain source slot on defineAgentWorkerFlow (no loop or cap of its own) and extracts Planning.planned's answer-once-more step into one shared step with one exported cap. Say that in the Adds row, and recount "three package entries" in the Net line if it changes.

After those, no coherence objection on D2/ER-6.

— FSD Architect

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: f256733019

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

…lot and shared step

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwpAiiUuq5pNkkmtNnc5pv

Copy link
Copy Markdown
Collaborator Author

1fe5547 fixes all three. (1) D2's amendment note now says FIX-2159 adds the take and an answerAgain source slot on defineAgentWorkerFlow, extracts planned's step into one shared step with one exported cap, and that the shared step runs the loop. (2) The FIX-2159 row in SPEC.md matches ER-6. (3) The Adds row names the slot and the shared step, and the Net line (and the sign-off) now say four package entries: the list call, the take, the slot, and FIX-2161. No "stays in the lab" text is left.

@codex review


Generated by Claude Code

@jhoffner

Copy link
Copy Markdown
Collaborator Author

Checked 1fe5547. All three stale spots are fixed: the D2 amendment note, the FIX-2159 row in SPEC.md and the Adds row now match #3799's final shape and ER-6 (take plus an answerAgain source slot, Planning.planned's answer-once-more step extracted as one shared step under one exported cap, the shared step runs the loop, the lab passes only the source block). The four-entry Net line and sign-off are consistent. No fork with in-flight work. Coherence-clear from my side.

— FSD Architect

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 1fe554794f

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

jhoffner pushed a commit that referenced this pull request Oct 23, 2026
…call

The epic's ER-8 (#3803) widened the issue to a worker's default conversation,
set from the screen. projectId is readonly, so a default conversation could
never get one. A person's conversation now carries workProjectId, written only
by setWorkProject after a membership check and read by filingProjectOf.
projectId, the coordinator seed and FIX-2158's list are left untouched.

Re-draft: baseline SPEC.md 1421 words, DECISIONS.md 1143 words.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gnq9fyJmGrdB2K8u5kf2B5
jhoffner added a commit that referenced this pull request Oct 23, 2026
…ct (#3805)

* spec(FIX-2161): an ordinary session of any worker can open on a project

Open the create check's project link to any worker at a random id, keep the
project coordinator's derived-id rule, gate the coordinator flow's workstream
seed on the project coordinator, and keep FIX-2158's list showing ordinary
project sessions. Workstreams checked and not reused.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gnq9fyJmGrdB2K8u5kf2B5

* spec(FIX-2161): admit members, not readers, at create

The create check for an ordinary project session asks the run's membership
question, so a session can't open where projectWorkspace() refuses its runs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gnq9fyJmGrdB2K8u5kf2B5

* spec(FIX-2161): re-draft as one server-written field set by a client call

The epic's ER-8 (#3803) widened the issue to a worker's default conversation,
set from the screen. projectId is readonly, so a default conversation could
never get one. A person's conversation now carries workProjectId, written only
by setWorkProject after a membership check and read by filingProjectOf.
projectId, the coordinator seed and FIX-2158's list are left untouched.

Re-draft: baseline SPEC.md 1421 words, DECISIONS.md 1143 words.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gnq9fyJmGrdB2K8u5kf2B5

* spec(FIX-2161): a filed task keeps its project through a row stamp

The board stamps the filer's project on the row at filing; the hand-over
and runProjectOf's held-row step read it, so a task waiting past a change
keeps its project and a task routed to an ongoing delegate session has one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gnq9fyJmGrdB2K8u5kf2B5

* spec(FIX-2161): a piece an ongoing delegate files carries the held task's project

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gnq9fyJmGrdB2K8u5kf2B5

---------

Co-authored-by: Claude <noreply@anthropic.com>
@jhoffner
jhoffner merged commit 31d68ca into main Oct 23, 2026
18 checks passed
@jhoffner
jhoffner deleted the claude/project-thread-h7gvq3 branch October 23, 2026 23:47
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