Skip to content

feat(FIX-2159): a person's running turn hears the tasks that finished while it answered - #3823

Merged
jhoffner merged 7 commits into
mainfrom
claude/project-thread-uzb61a
Oct 24, 2026
Merged

jhoffner merged 7 commits into
mainfrom
claude/project-thread-uzb61a

Conversation

@jhoffner

Copy link
Copy Markdown
Collaborator

Requested by Jake · project thread

The problem

A person asks the main worker for something that starts background tasks. A task ends while the reply is still running. Today the person hears that result only after the reply, as a turn of its own in a later request. The reply they are reading can't use it.

What this does

A worker on the built-in agent flow can now opt in with answerAgain: true. After each answer, the flow takes the tasks its conversation filed that finished since the turn began. It says each one under the delegate's name in the person's own request, and the worker answers again with them. Each result is heard once: the copy that would have arrived after the turn finds it already taken and does nothing. Any block can be the source instead of true, which is how FIX-2153's lab plugs in its own.

The plan's own "answer once more" step and this one are now the same step, with one cap (MAX_ANSWERS_AGAIN, 3), and the plan's answer counts toward it.

What's asked of you

This implements the approved direction in the spec (#3799). Nothing here is new for you to decide.

Parts worth reviewing closely

  • The at-most-once boundary. takeFinishedTasks (packages/workforce/src/conversation-board/take-finished.ts) takes through orchestration's new takeOwedNotice, then settleTakenNotice acknowledges at noteSeen. A stop before the acknowledgement leaves the notice taken by this request for the queued copy to take over. A stop after it drops the line. Check that this matches what onTaskSettled does (task-settled.ts now shares beforeAcknowledge / acknowledgeOnce with it).
  • The shared step in plan.ts. The round loop runs on doWhile, decidePlan resets the counters each turn, and the app source receives the worker's answer through a connector. The cap leg in the tests pins the plan counting toward the cap.
  • Only a person's own turn takes (D2). isUserTurn gates it. Task sessions, woken turns and worker-to-worker turns hand over nothing.
  • The coordinator doesn't take answerAgain (coordinator-flow.ts omits it).

Links

Spec: specs/issues/FIX-2159/ on main (#3799) · Linear: FIX-2159 · Epic: FIX-2152 · Goal: goals/hand-offs/result-reaches-the-running-turn/ · Merges when approved. Fixes FIX-2159.

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-2159/ 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
  • takeFor was extracted from the admit path in task-settled-entry.ts so the take and onTaskSettled use one take.
  • The take reads each row committed (readCommittedTask), not from the turn's snapshot. Rows the snapshot shows ended and acknowledged are skipped.
  • A routed result (resultTo: "conversation"), a retry and a park that asks keep their own paths.
  • answerAgain is ignored without installation (no session board), and documented as such.
Everything else: verification

Goal (goals/hand-offs/result-reaches-the-running-turn/, real model): PASS on this branch and with GOAL_ORDER=reversed. Controls: read-only fails once (each code said 4 times), no-source fails request-id, and main before this change fails request-id. The verdict log is in goal.md.

Red states (each control reverted, then restored):

  • No take: workforce legs 1, 4, 6, 7, 9 go red.
  • No person-turn gate: the D2 leg goes red.
  • No acknowledgement: legs 1, 4, 6, 7, 9 go red.
  • Cap + 1, one round only, plan's answer not counted: the cap leg goes red (and the loop leg for one round).
  • Orchestration with a snapshot read: legs 1, 4, 4b go red. Without the take record: legs 1 and 3 go red.

Suites: orchestration and workforce test suites, typecheck, eslint and validate scripts green locally.

Files: orchestration task-settled-entry.ts (takeOwedNotice), workforce take-finished.ts (new), task-settled.ts, plan.ts, agent-worker-flow.ts, coordinator-flow.ts, exports, tests (answer-again-finished-tasks.test.ts, take-owed-notice.test.ts), both READMEs, the coordination concept doc's rule 7, and a changeset (minor, workforce + orchestration).


Generated by Claude Code

… while it answered

- orchestration: takeOwedNotice takes an owed notice in the running
  request's name through onTaskSettled's take record (shared takeFor).
- workforce: takeFinishedTasks (person's turn only), handled by the same
  steps as the queued onTaskSettled (settleTakenNotice), and
  finishedTasksAnswerAgain, the pre-built source.
- planned's answer-once-more becomes one answer-again step with two
  sources (the plan, the flow's) under MAX_ANSWERS_AGAIN, on doWhile.
- defineAgentWorkerFlow({ answerAgain: true | block }).
- Goal: goals/hand-offs/result-reaches-the-running-turn.

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

Workforce README: the answerAgain option, the finished-tasks source, its
limits and exports. Orchestration README: taking an owed notice in a
running request. Goal verdict log: PASS at af14e78b.

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

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

Request Review

@linear-code

linear-code Bot commented Oct 24, 2026

Copy link
Copy Markdown

FIX-2159

@jhoffner jhoffner self-assigned this Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Please pay special attention to:

  • the at-most-once boundary in take-finished.ts + settleTakenNotice (a stop before vs after noteSeen), and whether the queued onTaskSettled copy can ever say a taken notice again;
  • the doWhile round loop in plan.ts: the shared cap, counter reset per turn in decidePlan, and the plan's answer counting toward it;
  • takeOwedNotice reading the row committed, and the isUserTurn gate.

Generated by Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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-24T00:57:00.456704Z 71f267d New commits
ℹ️ 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 (code against the approved direction)

Verdict: The approach is right and I'd keep it: one take record shared with onTaskSettled, one answer-again step, one cap. I found no blocker. The items below are ordered by how much I'd want them handled in this PR. Read the code at ba5415c; I did not re-run the goal or suites.

Worth fixing in this PR

  1. takes() re-implements decideNotice's exclusions (workforce/src/conversation-board/take-finished.ts, takes). It hard-codes "not retried, not asked, not resultTo: conversation", which are the same branches decideNotice (task-notice.ts) already owns. The take and the queued handler can now disagree the next time decideNotice gains a case. Suggest gating on decideNotice(notice, policy).act being a delivering act (line / wake-turn), keeping only the resultTo check local.
    • Related: the take always says a line, but under the "judgment" policy the queued path would wake the coordinator turn. Is answerAgain meant to be legal on a judgment-routed conversation? If not, say so in the option's doc. If yes, the take shouldn't bypass the judgment.
  2. Type seams hidden by casts. takeOwedNotice(ctx, owed as never) and notice as TaskNotice paper over TaskSettledInput vs TaskNotice. Fix at the orchestration boundary (let takeOwedNotice accept and return TaskNotice) rather than casting in the new workforce file.
  3. Cap vs resume (plan.ts, decidePlan). It now resets ANSWERS_AGAIN_STATE and PLAN_BRIEFED_STATE, and its comment changed from "once per request" to "once per run of the turn". If a turn can run again within one request (a parked wait resumed), the "3 per request" cap resets with it. Please confirm with a test that a resume doesn't grant a fresh budget, or document that the cap is per run.
  4. endPlanWaiting and afterPlan moved after the whole loop. Before, they ran right after the plan's answer. Now, on a request with both a plan and answerAgain, the plan-waiting flag stays set (and afterPlan is held) through up to two more model answers. Probably fine, but it is a behaviour change for existing afterPlan users and I don't see a test pinning the new order.

Second look: a leaner shape for plan.ts

The loop is correct, but it needs four new request-state keys (answersAgain, answerRoundOpen, answerRoundMessages, planBriefed) and six small handlers (openRound, keepMessage, briefRound, answeredAgain, lastAnswer, plus the sources sequencer) to express "ask sources, answer, repeat". The doWhile value already carries { answer, again }. Carrying the round count and collected messages in that value (sources as .steps that return { messages }, instead of .taps that write state) would drop ROUND_OPEN, ROUND_MESSAGES, PLAN_BRIEFED (planDue becomes "first round") and keepMessage, and make a replay simpler to reason about. I can't tell without trying whether tapIf/doWhile typing allows it, so treat this as a candidate, not a demand. If it doesn't fit, a short comment on why state is used would help the next reader.

Smaller

  1. Double committed read. takeFinishedTasks reads the row via readCommittedTask, then takeOwedNotice reads the same row committed again. Let takeOwedNotice accept the row (or return it). Separately, each round scans every open ledger row with a committed read (BP-033: filter at the source). Fine at session scale; worth a one-line note, since the loop can now scan up to 4 times per request.
  2. Answering turn can't file plan steps in answer-again rounds, even with no plan: briefRound sets PLAN_ANSWERING_STATE. When the worker hears a failed task, its natural move is to file a recovery step for itself, and that is now refused ("do the work or answer"). It can still delegate tasks, so this is a limitation, not a bug. Please state it in the README under answerAgain, or scope the refusal to the plan's own answer.
  3. Doc/code mismatch. The PR text and docs say "finished since the turn began", but the code takes any owed notice on the ledger, including one that settled before the turn and is still queued. Harmless (earlier delivery, still at-most-once), but the wording should match.
  4. Three overlapping hooks now: afterAnswer, afterPlan, answerAgain. A short table in the workforce README on which fires when would save users a read of plan.ts.

Checked and fine

  • At-most-once: dedupe write is the point of no return, a stop before it leaves the notice taken for the queued copy to take over; acknowledgeOnce / beforeAcknowledge are shared with onTaskSettled, so the two can't diverge on order.
  • The auth/routing input is isUserTurn and the ledger's own rows, not caller-controllable input (BP-031).
  • Legacy path: with no answerAgain and no plan the turn runs alone, and a plan-only request takes the same path as before.
  • Coordinator omits answerAgain as stated.

Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: ba5415c6b2

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

@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 (FIX-2159)

Problem this PR solves: task results that land while the worker is still answering should show up in the same person-started request (once), not as a later turn.

Verdict: The shape matches what the spec already chose — one take record (takeOwedNotice / FIX-2123), one acknowledge pipeline (settleTakenNotice), two delivery modes (queued onTaskSettled vs in-turn takeFinishedTasks + answerAgain). I would not collapse this into “just call onTaskSettled from inside the turn”: that re-enters heldFor/defer admission and the wake-turn path, which is the wrong product behavior for a person turn (D1/D3 in the issue spec).

Extracting takeFor + exporting takeOwedNotice is a real simplification over duplicating take logic at the workforce layer. Wiring finished tasks through the existing planned(turn, answerAgain) loop is also the right reuse story vs inventing a second answer-again mechanism.

Where complexity is “real” vs “optional”

Area Assessment
plan.ts answer-again state machine Heavy, but it generalizes plan-brief + answerAgain under one cap (MAX_ANSWERS_AGAIN). Shrinking it without dropping plan+finished composition would mean a different spec.
take-finished.ts ledger scan O(rows × rounds) with committed reads; acceptable at conversation scale and aligned with snapshot semantics. Worth documenting; premature optimization would be a request-scratch index unless boards get large active footprints.
340-line goal + large vitest files Cost is test/verification surface, not production architecture. The goal’s anti-game (grade session items, controls for read-only / no-source) is doing real work.

Cleaner alternatives considered (and why I’d stay on this PR)

  1. Steer-style “read finished rows before every model call” — fewer moving parts in plan.ts, but hides the loop from apps and can’t compose custom messaging (spec D3 rejected this).
  2. answerAgain: true only, no takeFinishedTasks export — smaller API, loses the lab/trace composition the spec wants.
  3. Parameterize task-settled.ts with a delivery mode — could reduce drift between queued settle and in-turn take long term; larger refactor than this issue needs. Optional follow-up, not a blocker.
  4. Third-party package — nothing obvious; this is framework notice/take semantics, not generic queueing.

Non-blocking nits (inline)

  • Centralize “which notices are eligible for in-turn take” with the settle guard / decideNotice story (takes() duplication).
  • Consider deriving answerRoundOpen from answersAgain < MAX instead of a second request-state flag (if you trust one source of truth).
  • Narrow the settleTakenNotice catch or classify expected vs unexpected failures.
  • takeOwedNotice + readCommittedTask in takeFinishedTasks duplicates a committed read per notice — fine at low N; pass row through if you ever optimize.

No changes requested for merge from a simplify lens; approving direction.

Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

…test (FIX-2159)

"user" for the signed-in user, and a test helper not named like the
retired ask mark, so the Process guards pass.

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

Copy link
Copy Markdown
Collaborator Author

Engineering review: FIX-2159 (answerAgain / takeFinishedTasks) at 7fb929d

Verdict: good to merge once CI is green. No blockers.

In scope against the merged spec (#3799, with epic amendments #3797 / #3803). The merged #3799 keeps answerAgain as a source for the one shared answer-again step (D3, with true meaning the pre-built block), and the #3797 D2 amendment keeps that source slot too. What #3799 review removed was option (c): a separate hook with its own loop and its own cap. This PR doesn't add that. plan.ts runs one doWhile step, the plan and the app share it, and both count against one MAX_ANSWERS_AGAIN. So this is not scope creep.

What I checked:

  • The take is a real conditional take. takeOwedNotice goes through the same takeFor as the queued copy (task-settled-entry.ts:167): one conditional takeNotice write, busy when a live request holds it, gone when the write isn't recorded. Person turns are serialised per session by REPLY_CONCURRENCY (hold), so the race that matters is take vs. queued copy. take-owed-notice.test.ts covers that in both orders, plus failed-before-clear (taken over, heard once) and failed-after-clear (dropped, at most once).
  • What the take skips. It skips routed results, retried markers and waited-on rows: asked is row.wait != null (task-notice.ts:401), so "a park that asks" is still taken, as the spec says. A read-only source leaves the notice owed (the control fails once, as expected).
  • Only a person's own turn takes. The isUserTurn gate in take-finished.ts is covered by the D2 test: a turn no message started takes nothing, and the result is heard after it.
  • The cap is enforced and tested. The answer-again-finished-tasks.test.ts:388 test asserts exactly 3 answers again in one request, with the plan's answer counted. It also checks the source isn't run after the cap and that the request completes.
  • D1 guarantees. An Error Reporter refusal stops before the ack (heard once, after the turn). A death between the dedupe write and the ack drops the line instead of repeating it.
  • Local runs (rebuilt at the new head): take-owed-notice 5/5, answer-again-finished-tasks 9/9, full workforce suite 130 files / 1576 tests passing. The retired-terms check passes at 7fb929d; the 19 "person" lines that failed at ba5415c were fixed in this commit.

Notes (none blocking):

  1. take-finished.ts:92-94: each round does a committed read of every non-terminal row the conversation filed. That's up to 4 rounds per request, so the cost grows with open rows times rounds. It's fine at current sizes. If conversations ever hold many open tasks, pre-filter on the snapshot (rows with no ending since the turn began) before the committed read.
  2. task-settled-entry.ts:167: when a ledger ref has no takeNotice, the take goes ahead without any take record, and only noteSeen prevents a repeat. Both built-in refs implement it, so this only affects custom refs. A one-line doc note or a test would make that contract explicit.
  3. For Architect: the coordinator flow doesn't take answerAgain. That matches the PR's stated scope, but please confirm it's intended and not a follow-up the epic expects.

CI at 7fb929d: changesets and Vercel pass; Analyze, and the rest (Test / Typecheck / Process guards), are pending.

— FSD Head of Engineering

…out takeNotice (FIX-2159)

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

Copy link
Copy Markdown
Collaborator Author

Thanks. Taking your notes in order:

  1. Scan cost. This one already pre-filters on the snapshot. take-finished.ts:93 skips any row the snapshot shows as ended and acknowledged, so the committed read only covers rows that are open or still owe a notice. A tighter index waits until large boards show a need for it.
  2. A ref without takeNotice. takeOwedNotice's doc now says it: on such a ref nothing records the take, and only noteSeen stops a repeat. That is in 0f06609, comment only.
  3. Coordinator. This is intended, not a follow-up. FIX-2159 DECISIONS.md D2 ("Locks in") says this issue adds no source to the coordinator flow. Its delegates' answers are routed, and the take never hands those over. Widening it would be a new decision.

Generated by Claude Code

@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 cap is a second flag.

answerRoundOpen lets a round past MAX_ANSWERS_AGAIN start and then skip its sources. The loop already stops when again is false, so that flag is the cap. After the last counted answer, again is false and no further source runs. The open flag, roundOpen, and answer-again-open-round go away. Clearing the messages that round consumed, in the same write that counts the answer, is what stops the plan's message being asked again.

POC, and it does not merge: #3825

Fold fdf786323 onto 0f06609ec. Do not fold 4b746f18c (that commit sits on ba5415c6; the POC body still names it, and gh pr edit could not update the body). Do not reset onto the POC. Close the POC unmerged after this PR lands.

What still passes there: answer-again-finished-tasks 9, and the cap case again on fdf786323. worker-plans-its-steps 22 on the same plan.ts change. eslint on plan.ts. answered <= MAX_ANSWERS_AGAIN answered 4 times (expected 3). Net −12 in plan.ts (+16/−28).

Open in Web View Automation 

Sent by Cursor Automation: Code Snob

The round-open flag only let a round past MAX_ANSWERS_AGAIN start and
then skip its sources. The loop already stops when a round says not to
look again, so the last counted answer says so and no further source
runs. A round's consumed messages are cleared with the answer that used
them, and decidePlan clears them for a fresh turn.

Folds the subtraction proposed in #3825.

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

The take now leaves what the queued handling would not deliver to the turn
by asking decideNotice, so the two can't drift, and a test pins each case.
takeOwedNotice takes and returns a TaskNotice, which drops the casts. The
docs say which endings are taken (not yet heard), and decidePlan's comment
says once per request again.

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

Copy link
Copy Markdown
Collaborator Author

Replying to the second-look review (comment 6377381499), which I missed earlier. Point by point, at 71f267d:

  1. takes() vs decideNotice. Done. The gate is now resultTo !== "conversation" && decideNotice(notice, "fixed").act === "line", exported as takesNotice, with a test for each case. This also corrects an earlier reply of mine: before this commit no test pinned the gate. Letting a retry, an asked row or a routed result through each turned the full suite green. Now each one fails the new test.
    • Under judgment, the queued path wakes a turn with the line. The take replaces that woken turn with an answer again in the same request, which is the point of the spec (D3). The built-in agent flow always runs judgment. A flow with fixed that passes its own answerAgain asked to answer again, so that is its choice.
  2. Casts. Done. takeOwedNotice takes and returns a TaskNotice, and the three casts in take-finished.ts are gone.
  3. Cap vs resume. On a resume, decidePlan's record is replayed, not re-run, so the counter isn't reset. Inside a request the answer-again turns call turn directly, never planned, so decidePlan runs once per request. My comment edit had said "per run of the turn"; it is back to "once per request". The FIX-2110 durable leg (a drain parks and resumes in one request) still answers exactly once.
  4. endPlanWaiting / afterPlan order. No change for existing users. With a plan and no answerAgain, the round after the plan's answer finds no message and ends, so both run right after that answer, as before. Only a flow that opts into answerAgain holds them through its extra answers. The request is still running then, so keeping its waiting flag is right.
  5. Double committed read. Kept. Both reads go through the same committed-read path, and folding the row into takeOwedNotice's signature would widen a public API to save one read at conversation scale.
  6. Answering turns file no step. This is already in the README limits: "An answering-again turn files no step for the worker itself. A task it files for a delegate is dispatched as usual."
  7. "Since the turn began" wording. Fixed in the README (two places) and in the handler doc: the take covers endings not yet heard, usually ones that finished while the worker answered.
  8. Hooks table. Left out of this PR. afterAnswer and afterPlan predate it, and a table comparing all three belongs in a README pass of its own.

Verified at this head (with FSDEV_DEFAULT_MODEL unset): workforce 1578 tests pass, orchestration take-owed-notice 5/5, typecheck and eslint clean, fallow new-dead-code clean, retired-terms and the vocabulary sweep pass.


Generated by Claude Code

… spelling (FIX-2159)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N9RvCHba2QKPohNxnZNzct
@jhoffner
jhoffner merged commit ad0babd into main Oct 24, 2026
18 checks passed
@jhoffner
jhoffner deleted the claude/project-thread-uzb61a branch October 24, 2026 02:03
jhoffner pushed a commit that referenced this pull request Oct 24, 2026
FIX-2159 (#3823) ships finishedTasksAnswerAgain, so the lab writes no
block of its own for a result to reach the running turn.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Afupg1DNVRUaS1VEW2HnMn
jhoffner added a commit that referenced this pull request Oct 24, 2026
* spec(FIX-2153): Claude Code-style lab, session mode

Spec and UI design for the first lab of FIX-2152: sessions left, main
thread center, read-only background tasks right. The main worker is a
manager on the agent flow; sessions ride the more-conversations gap; a
background result reaches the running turn through the mid-turn gap.
Plans for FIX-2157's threads mode as a per-session mode.

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

* spec(FIX-2153): follow corrected epic D3; cite FIX-2158 and FIX-2159

Sessions are ordinary sessions on the worker's flow, listed through
FIX-2158, with no new criteria key. The control is the absence of
FIX-2159's delivery. Mode is derived from the main worker. Adapter
names verbs only; fixtures carry a plain marker.

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

* spec(FIX-2153): bind signal 4 to the first request; FIX-2159 must step after a late settle

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

* spec(FIX-2153): mode comes from the view; result reaches the turn through the lab's loop-back flow

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

* spec(FIX-2153): the loop-back takes through FIX-2159 on FIX-2078's path, so an ending is heard once

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

* spec(FIX-2153): a long task that ends before the stop is a bad input, rerun

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

* spec(FIX-2153): a project per session (D3) and a coding harness on delegated workers

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

* spec(FIX-2153): cite FIX-2161 for a session on a project

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

* spec(FIX-2153): one coding worker flow, harness picked by the worker's setting (epic ER-9)

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

* FIX-2153 spec: a session opens only on a project the person may work in

Reading a shared project is org-wide, but a run by a non-member is refused
not-a-member, so the picker and FIX-2161 admit members and owners only.

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

* FIX-2153 spec: align the result-in-turn path to FIX-2159's answerAgain source

FIX-2159 moved the answer-again loop into the package: the lab supplies
only an answerAgain source block that calls takeFinishedTasks, and the
control leaves that block out.

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

* FIX-2153 spec: name FIX-2161's setWorkProject call for the session's project

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

* FIX-2153 spec: say 'kind of worker', not 'role'; main worker on the agent flow

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

* spec(FIX-2157): Claude Code-style lab, threads mode (#3792)

* spec(FIX-2157): Claude Code-style lab, threads mode

Threads mode for FIX-2153's app: the main worker is a coordinator that hands
each request to threads, each in a session of its own, and the right pane is a
status board read from task rows. Two decisions for sign-off (a thread's own
session; ready for review as a review the task waits on), two package gaps for
the epic to file.

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

* spec(FIX-2157): pin gap A's thread session to epic D3's shape

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

* spec(FIX-2157): gap A amends epic ER-7; thread sessions stay off the session list; gap B uses the existing deadline

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

* spec(FIX-2157): a thread is an ordinary task the coordinator files; drop the routed-session gap

The coordinator's turn already files plain tasks in a new session each
(board.ts addTask intercepts only a conversation result on a routing turn),
so threads run side by side with no gap. D1 now says leg c does not prove
routing. The review gap is gap A; review notes recorded for the implementer.

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

* spec(FIX-2157): review through FIX-2131's model tool; no blocking gap left

Codex: FIX-2131 already gives a model on a task turn waitForUser({ kind:
"review" }), so the thread worker asks for review from its WORKER.md and the
review gap is dropped. Same-delegate routing finding is moot after D1.

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

* spec(FIX-2157): one table for the board's columns; fixture marker as in FIX-2153

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

* FIX-2157 spec: say worker, not role

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

* FIX-2157 spec: threads mode is the Projects view

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

* FIX-2157 spec: lead files ordinary tasks; control shares one session

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

* FIX-2157 spec: threads work in the session's project; harness threads (D5)

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

* FIX-2157 spec: step 6 controls that really fail

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

* FIX-2157 spec: state the session project rule here, not by citation

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

* FIX-2157 spec: a harness run with changes waits for review; gap blocks step 6

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

* FIX-2157 spec: the debt names the one blocking gap

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

* FIX-2157 spec: match the shared session directory rule; name FIX-2161

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

* FIX-2157 spec: step 6 checks the worktree's repository, not the mapped path

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

* FIX-2157 spec: one harness-thread flow, harness chosen by a worker setting (ER-9)

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

* FIX-2157 spec: a session gets its project through FIX-2161's setWorkProject

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

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Lab specs: a task works in its session's project, never another

ownProjectIn overwrites a named project with the filing session's, and
projectWorkspace() refuses a different one other-project.

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

* FIX-2157 spec: amend D5 for FIX-2163's not-reviewed mark on harness threads

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

* FIX-2153 spec: the main worker sets answerAgain: true (FIX-2159 merged)

FIX-2159 (#3823) ships finishedTasksAnswerAgain, so the lab writes no
block of its own for a result to reach the running turn.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants