Skip to content

spec(FIX-1794): tasks go down the owner's chain and run as the owner - #2828

Merged
jhoffner merged 4 commits into
mainfrom
spec/FIX-1794
Oct 6, 2026
Merged

jhoffner merged 4 commits into
mainfrom
spec/FIX-1794

Conversation

@jhoffner

@jhoffner jhoffner commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator
Someone who… Today After
asks their coordinator for work that must be done, not only answered A coordinator can give a post to a delegate. It files no tasks It files a task for one of its delegates. The task starts at once, in a new session of that delegate. Nobody runs a list by hand
works in an org with other users A board is an org row. The person whose request runs it claims its tasks, and the work runs as that person A board belongs to one conversation. Only requests of its owner run it. Each task below it runs as that owner
talks to one coordinator in two conversations Not possible Each conversation has its own board. A run of one board never takes, shows or waits on the tasks of the other
gives a big task to a worker that splits it The pieces go on a board that any member can run Not in this issue: the split ships in the follow-up FIX-1802. Here, a delegate's task session that tries to file is refused
has a task that fails, or that stops on a question Nobody gets a notice. They must open the list The conversation that filed it gets one notice. The coordinator gives it to another delegate, cancels it, or tells the person

Goal: each task that the coordinator of a user files for a delegate runs in a new session. That session belongs to that user and acts as that user. Only the board that filed a task claims it, wakes on it and settles it, also when its worker runs on a different flow. The conversation that filed the task gets a notice when it ends, and can reassign or cancel it.

flowchart LR
  A["Shift Manager · two users · scripted workers on agent"] --> L1["a · a coordinator files"]
  A --> L3["c · two conversations · one coordinator"]
  A --> L4["d · Bob reaches in"]
  A --> L5["e · a task fails · real model"]
  L1 & L3 & L4 & L5 -->|"stores, sessions and notices match"| P["PASS · the goal is met"]
  C["control · one ledger for all of Alice's conversations"] -.-> L3
  L3 -.->|"under the control"| F["must FAIL · a conversation runs the other's task"]
Loading

The check files tasks. Then it only reads the boards, the sessions and the notices. It never runs a board by hand. Check: goals/coordinators/files-tasks-down-the-owners-chain/. The control GOAL_CONTROL=unpartitioned keeps one ledger for all conversations of a user, and leg c must fail. Leg b (the split) moved to FIX-1802. A second control is in SPEC.md.

Today a board is an org row that any member's request runs, and each task runs as whoever ran it; after, each conversation keeps its own board at its owner's user scope, and each task runs in a new task session of the owner on any flow, which settles its row there and tells the conversation how it ended

On the left, the person who runs the board decides who the work runs as. On the right, the conversation of the board decides, and nobody else can run it.

How: each coordinator conversation keeps a board. Its rows are at the user scope of the owner, in a partition that only that conversation can reach. A task session on a different flow reads and settles its row there, with the usual lease, retries and park. When the task ends, the task session sends one notice back to the conversation that filed it.

Sign off

Approved by the product owner, 2026-10-06. Recorded at cd708b0.

The goal, at that size. If wrong: work runs as the correct user, but one conversation still runs the tasks of another.

A board keeps the tasks that run on a different flow at the user scope of its owner, in a partition that only its conversation reaches · D1

D1 trade-off figure: at the user scope of the owner, one partition per conversation, chosen, beside the board staying in its session and settled by a reply. Decides it: what still works when a run dies or waits.

It comes down to a run that stops or waits. A row that a reply settles cannot get a new lease, so it runs two times or never. If wrong: a change to the task board that each durable board then carries. It changes the task board (Layer 1), so it is binding only after the epic records it, as its D6 in #2831 (epic ER-9, ER-22, ER-24).

A chain stops at five boards deep · D2 — carried to FIX-1802

The depth limit belongs to the split, so it moves with it to FIX-1802, as written.

Answered · Q · the split ships in a follow-up issue

Answered by the product owner (2026-10-06): a follow-up issue, FIX-1802. This issue ships one level of hand-off: a coordinator files, a delegate does the work. A delegate's task session that tries to file is refused. D2's limit, goal leg b, BR-7, BR-30 to BR-32, S8, S10 and V6 carry to FIX-1802 as written.

Reasons and the options that lost: DECISIONS.md. The cases: BUSINESS-RULES.md.

Not here: the conversion of the 15 mailbox boards (FIX-1792), workstreams and the project coordinator (FIX-1793), the task lists of a coding harness (FIX-1763), and the split (FIX-1802).

POC — poc/board-partition/, 4 legs, a test that we do not keep
pnpm install
bash specs/issues/FIX-1794/poc/board-partition/run.sh

The question: on the Layer 1 of today, can a board give its tasks to a worker on a different flow and stay its own? It runs on the real engine. Results on fa8161e88: 4 passed.

  • U1. One user ledger for two conversations: conversation A runs the task of conversation B. The epic claim is true.
  • E1. A claim filter at Layer 2 stops the claim. But A still lists the row of B, and the drain of A waits on that row until its iteration budget ends.
  • F1. The task session on the agent flow sends a { from: true } reply. It runs in the conversation that filed, as that user.
  • X1. A different user sees and runs only their own rows.

README. It is not production code.

Spec · Decisions · Rules · Plan · Docs · Evolution · Linear FIX-1794 · epic FIX-1786 · builds on FIX-1788 and FIX-1791 · carries FIX-1777, FIX-1780 and FIX-1774 leg e · follow-up FIX-1802 · merges after human approval and required checks (contract)

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV

A coordinator files tasks for its delegates on its conversation's own
board; each task runs in a new task session that belongs to the same
user, on any flow, and the conversation hears how it ended. A board
whose tasks run on another flow keeps them at the owner's user scope in
a partition only its conversation reaches (D1, a task-board change the
epic records); chains stop five boards deep (D2). Includes a POC on
today's Layer 1 showing why a Workforce-only claim narrow is not enough.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
@jhoffner jhoffner added the spec label Oct 6, 2026 — with Claude
@linear-code

linear-code Bot commented Oct 6, 2026

Copy link
Copy Markdown

FIX-1794

@vercel

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

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 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-06T22:00:40.387463Z aa64c18 PR opened
ℹ️ 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.

jhoffner commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

Second look + architecture pass (direction only)

Read SPEC, DECISIONS, BUSINESS-RULES, PLAN and the POC README. Direction is sound: E1 is a real argument for D1 (a claim-only narrow leaves the read and the drain wait open), and the layer split in S1 (the partition is a function the composing layer supplies) is right. Two findings are above the bar. The rest are notes for the implementer.

Above the bar

1. D2 bounds depth but not breadth, and the stated reason for D2 is cost.
D2 says a loop nobody watches "spends until someone looks". Five levels with a coordinator that files N pieces per level is N^5 task sessions, each at least one model turn. Neither the rules nor the plan name a per-board or per-chain cap on open or total tasks. BR-1 to BR-9 refuse on assignee, depth, and duplicate id only.

  • Ask: either add a cap (open tasks per board, or total tasks per chain) as a second rule under D2, or say in DECISIONS why depth alone is enough. If a spend or run budget already exists elsewhere in the framework, cite it.
  • If you disagree: show the worst-case fan-out the depth limit allows and who stops it.

2. BR-31/BR-32: a split parent settles only after a coordinator turn, so a failed settling turn strands it silently.
The parent row is parked "waiting on its pieces" with no notice. It settles after "any turn its notice woke", once no piece is open. Parked rows don't lapse (BR-31), and the plan's follow-ups exclude a sweeper (BR-15 covers a run that died, not a parked parent). If that turn errors, is deduped away (BR-26), or lands on a deleted/fired conversation (BR-28), the parent stays parked forever. Nobody gets a notice, which is the same "open the list" problem this issue exists to remove.

  • Ask: settle the parent mechanically where the last piece ends. The gate that records the last piece's ending already runs (S6) and can check "no open piece left, settle the row above". Keep the coordinator turn only for the judgment calls (reassign, cancel). Otherwise, add a rule: a parked-on-pieces row whose turn failed gets one notice, and add a V6 case for it.
  • Why it matters: the happy path is covered by VG leg b. This failure path isn't, and BP-035's cancel/error second path applies.

Scope (restraint)

  • The PR carries FIX-1777, FIX-1780, FIX-1774 leg e, and D1/D2 across S1–S13. P1 (S1, S2) stands alone and is the only part that touches Layer 1. P2 and P3 are Workforce and app work. Consider whether P2/P3 should be their own spec PR after D1 is recorded by the epic. P1 is gated on that record anyway, so a reviewer signing off D1 here is also signing off ten surfaces that depend on the epic's answer. If it stays together, state in the PR body that D1 binding on the epic means S3–S13 can change shape.
  • S11 (Shift Manager Board, four new chief-of-staff tools) is a different reader than S1–S10. It could move to P3 only or to the goal's own issue without changing the design.

Notes (implementer weighs these; no design round needed)

  • Retention: BR-14 leaves old partitions "in the store, unread" with no retention. That's fine for correctness (BP-030). Name where cleanup lands, or it becomes unowned growth.
  • S1 option vs. a row predicate: a generic row filter on the ref would also be a Layer 1 change. A key prefix is the better choice (filter at the source, BP-033), and the "adopt only direct children, refuse /" note already covers it. One sentence in DECISIONS' dropped table would close the question for the next reader.
  • Depth source (S10): the parent's depth plus one at each session's birth is right. If the incarnation or depth "only the engine can supply" (At implement time), the epic's D1 record needs to say so before P2, or P1 is built against a contract that moves.
  • Cross-flow from entry: the coordinator flow both hands off to work and serves work with from. This is known and has a V3 case. It's worth a focused test that a coordinator delegating to a coordinator (the S8 split) doesn't hit defineFlow's refusal at definition.

Alternatives considered

Adding the per-conversation ledger as a pure Workforce wrapper over the existing user-scoped ledger is refuted by E1 as stated. The reply-settled variant (a) is correctly rejected on lease renewal. No simpler third shape surfaced that avoids touching Layer 1.

No code changes in this PR to refactor. The architecture-improvement angle here is limited to the P1 boundary (S1/S2), which already minimizes the Layer 1 surface.


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.

Simplify review

Problem: Cross-flow task chains need each coordinator conversation to own its board and every task session to run as the owner. Today a user-scoped ledger without partitioning lets one conversation claim, list, and block on another's rows; a claim-only narrow (runOwnerDispatcher shape) still leaves read and drain wake broken.

Verdict: The spec takes the simpler engineering path for that problem. D1 (partition at Layer 1, reuse FIX-1791 incarnation, engine untouched) is better evidenced and smaller blast radius than an engine parent-task seam or reply-settled rows. The board-partition POC (U1/E1 as mutual controls, capped E1 polling) does real work; rejecting Workforce-only narrowing is the right call.

Where scope is heavier than the core fix (non-blocking, product/sequencing calls):

  1. FIX-1794 bundles two behaviors with partitioning — S8 (coordinator split / park / aggregate) and the full S6–S7 notice surface sit beside D1. If MVP is "file → run → hear ending on one level," consider phasing split to a follow-up and pointing goal leg b at a thinner slice; otherwise the three-PR stack is still coherent but P2 carries more than "conversation ledger."
  2. This PR is a large bundle — FIX-1793 + FIX-1794 + FIX-1795 full specs plus epic/FIX-1791 amendments (~4.5k lines). Directionally fine (epic graph already links them), but sign-off surface repeats ER-9/ER-22/incarnation/owner-rule four times; a single epic "shared contracts" pointer in child PLANs would cut drift risk.
  3. Process friction — P1 blocked on a separate epic PR to "record" D1 while D1 is already decided and POC-backed here; stacking epic amend with FIX-1794 P1 in one reviewed direction would drop a wait cycle (if process allows).
  4. FIX-1793 P3 — S5 + S7 (~14 removals) + S8–S9 in one PR is a wide blast radius; PLAN already notes rooms follow the coordinator — splitting room removal after S5 lands would simplify execution/rollback without changing the issue boundary.
  5. POC harness duplication — chain.poc.test.ts overlaps packages/orchestration/test/task-board/hand-off-cross-flow.test.ts; promoting U1/E1 (or a shared fixture) into maintained orchestration tests would keep evidence in CI and shrink retained POC copy-paste. Same for repeated boot() across spec POCs (optional run.sh wrapper only).
  6. FIX-1793 removal-inventory/check.mjs — useful totality guard for S7, but ~260 lines to maintain; if it becomes painful, a one-time committed inventory + lighter grep gates is a simpler long-term shape (not sure you should switch now).
  7. FIX-1795 — full implementer-grade spec while build is explicitly post-MVP is fine for early decisions; could stay DECISIONS + surfaces sketch until MVP closes if you want a thinner review queue.

Alternatives considered (already correctly dropped in DECISIONS): conversation-minted collection id per board (mailbox pattern at user scope) vs partitionBy — implementation fork, not clearly simpler given hand-off stability; extending runOwnerDispatcher — disproven by E1.

Approval: Direction on FIX-1794 D1 and the epic sequencing amend (library after MVP) looks right. Inline notes are optional tightenings, not merge blockers.

Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

Comment thread specs/issues/FIX-1794/PLAN.md Outdated
| S5 | `workforce` · start on add | After an add commits, dispatch a run of this board into this conversation as its own request, rescued so the add never fails. A reassign does the same; a bare assign doesn't | BR-10 BR-23 |
| S6 | `workforce` · the task entry | `work` (`WORKER_TASK_ENTRY`) on `agent` and the coordinator flow, `from` an S2 resolver over the conversation ledger. After the gate records an ending, one notice to the sender through `{ from: true }`, never an address from the row or payload | BR-16 BR-22 BR-24 BR-25 |
| S7 | `workforce` · the conversation hears it | `onTaskSettled`, an internal entry on the coordinator flow. Deduped by task, attempt and ending. A retried attempt runs the board again, with no turn. An ending wakes the judgment turn, or lands as a line under a fixed policy. Refused when the conversation is gone or its worker fired | BR-22–BR-29 |
| S8 | `workforce` · the split | A coordinator task session that filed pieces parks its own row on the board above, marked as waiting on its pieces; S7 sends no notice for that park. After any turn a piece's notice woke, if its board has no open piece, it settles that row from its pieces | BR-30–BR-32 |

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 (scope): S8 is the largest behavioral addition next to D1 itself (park parent, suppress notice, aggregate pieces). If the PRD minimum is single-level fileTask + cross-flow settle + partition (leg c), consider whether split belongs in this issue or a thin follow-up with leg b deferred — would shrink P2 and the S7 dedup/mid-turn matrix you inherit from FIX-1780. Not saying you must cut it; flagging that this is where complexity stacks beyond the board fix.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

Raised for the product owner as an open question: Q in DECISIONS.md asks whether the split (S8) ships here, or in a follow-up issue along with goal leg b and D2's limit. The recommendation is a follow-up, because the epic's MVP check is met at one level. S8 is now written conditionally on Q.


Generated by Claude Code

Comment thread specs/issues/FIX-1794/PLAN.md Outdated

Written for the implementing agent. IDs cross-reference [BUSINESS-RULES.md](BUSINESS-RULES.md)
(BR-n) and [DECISIONS.md](DECISIONS.md). `tdd`. Three PRs, a GitHub stack (epic ER-26). P1 starts
only after a follow-up epic PR records D1 (ER-9, ER-22, ER-24); P2 only after FIX-1788 and

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 (process): D1 is fully argued and POC-settled in this spec; waiting on a second epic PR to "record" it before P1 adds a merge/wait hop. If ER-9/ER-22 can ride on the same reviewed stack as orchestration P1, that would be a cleaner lane — only worth it if epic process allows.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

The epic is recording D1 now, as its D6, in amendment #2831. A change to the task board goes through the epic first (ER-22, ER-24), so the same-stack lane isn't open. PLAN's start conditions now name D6. They also say explicitly that P1 may start before FIX-1791 merges, so the epic can mirror it.


Generated by Claude Code

| ID | Package · role | Change | Rules |
|---|---|---|---|
| S1 | `orchestration` · a ledger kept per conversation (D1) | A durable task collection whose rows sit at the owner's user scope, one partition per keeping session. A ref resolved in a session reaches only its partition, for **every** operation: list, read, claim, the drain's wake and exit counts, the task tools, change events, caps. The partition comes from a function of the running context that the composing layer supplies, from server-written data only; orchestration knows no conversation or worker | BR-11 BR-13 BR-14 |
| S2 | `orchestration` · hand-off and the receiving gate | `taskBoard` accepts S1 for seats that hand off. The hand-off puts the partition on the envelope, from the ref it claimed through. `taskLedgers` can resolve a ref over the partition the envelope names, at the running user's scope only; every gate check runs unchanged | BR-16 BR-21 |

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 (mental model): S1 + S2 are one invariant (every op partition-scoped, envelope carries partition from claim). Implementers must keep them in lockstep; a single PLAN subsection "partition binding + hand-off" might be easier than two surface rows + V1/V2 — organizational, not a design change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

Kept as two rows, because the S-ids are referenced across the spec. PLAN now states under the surfaces table that S1 and S2 are one invariant, built and checked together in P1 (a0b1226).


Generated by Claude Code

Comment thread specs/issues/FIX-1794/DECISIONS.md Outdated
| | |
|---|---|
| **Instead of** | (a) The board stays in its conversation's session, and the task session settles the row by replying to it · (b) the engine's declared parent-task seam, wired so a task session settles one row in its parent's session |
| **Because** | A lineage stops at a flow, and every coordinator hands work to an `agent` worker. The owner's user scope crosses flows today, and the task session then reads, renews, parks and settles its row exactly as a same-flow run does: lease, retries, run link and park all work unchanged. Unpartitioned, one conversation takes another's tasks ([POC](poc/board-partition/README.md) U1); a claim narrow in Workforce holds the claim but not the read or the wake (E1). So the ledger itself is kept per conversation, named from the conversation's own server-written identity. (a) leaves a run nobody renews: a lapsed lease runs the task twice, a missing one strands it when the run dies. (b) changes the engine as well as the board, and the seam's verbs read and settle a row but don't renew, park or link a run |

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.

Reuse note: The rejected path (claim eligibility / runOwnerDispatcher) is the same shape harness-manager already exports — good that E1 documents why listing and idle drain still leak. When implementing, reference that helper in prose so future readers don't re-propose Layer-2-only fixes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

Done at a0b1226. D1's card and the dropped-alternatives table now name harness-manager's runOwnerDispatcher as the rejected Layer-2 shape (E1). They also correct the earlier "in Workforce", since the helper lives in harness-manager.


Generated by Claude Code

| Leg | Question | Observed |
|---|---|---|
| U1 | Two of alice's conversations each file one task on the unpartitioned ledger; only `conv_a` drains | **`conv_a` takes `conv_b`'s task.** It runs in a task session parented to `conv_a`, its reply lands in `conv_a`, and `conv_a`'s board read lists both rows. The epic's claim holds |
| E1 | The same, with today's claim narrow (the `runOwnerDispatcher` shape) keyed on the conversation that filed each row | **The claim holds, nothing else does.** `conv_a` runs only its own task and leaves `conv_b`'s pending. But its board read still lists `conv_b`'s row, and its drain never reaches its exit: `conv_b`'s row is claimable to the substrate, so the drain polls until its iteration budget runs out, still `idle` and still asking to go on. At the default budget that is 10,000 polls, 50 ms apart, about eight minutes held open |

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 (evidence location): E1's ~8 min default poll budget is the production phenomenon; the POC caps iterations (good). Consider folding U1/E1 into an extended hand-off-cross-flow.test.ts describe so the regression lives in default CI, and keep this retained POC as a pointer — reduces duplicate boot() and copy-via-run.sh footguns.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

Recorded at a0b1226 in PLAN, under At implement time. In P1, U1 and E1 move into packages/orchestration/test/task-board/hand-off-cross-flow.test.ts, over the partitioned ledger, so they run in default CI. The retained POC stays as a pointer.


Generated by Claude Code

@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: aa64c18543

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

Comment thread specs/issues/FIX-1794/PLAN.md Outdated
| S2 | `orchestration` · hand-off and the receiving gate | `taskBoard` accepts S1 for seats that hand off. The hand-off puts the partition on the envelope, from the ref it claimed through. `taskLedgers` can resolve a ref over the partition the envelope names, at the running user's scope only; every gate check runs unchanged | BR-16 BR-21 |
| S3 | `workforce` · the conversation's board | Each coordinator conversation keeps one board on S1, partitioned by the conversation's incarnation (the value FIX-1791 keys delegate sessions by). One `defaultWorker` seat hands every row to `work` on the flow its assignee names (FIX-1778's per-task target, narrowed to delegates), keyed by task and worker. The dispatched child's birth names the worker (FIX-1788 S1), the `taskId` criterion and the chain depth | BR-16–BR-18 |
| S4 | `workforce` · filing and the check | `fileTask`, `reassignTask`, `cancelTask`, `listTasks` as public actions on any coordinator conversation and as the coordinator's tools; both call one module. The check: on this conversation's delegate list, without a target, passing FIX-1791's S2 check, flow takes tasks, depth under the limit. Run at filing and again at hand-over. Reassign and cancel are FIX-1780's BR-16 to BR-22 on this board | BR-1–BR-9, FIX-1780 BR-16–22 |
| S5 | `workforce` · start on add | After an add commits, dispatch a run of this board into this conversation as its own request, rescued so the add never fails. A reassign does the same; a bare assign doesn't | BR-10 BR-23 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Make the post-commit board wake recoverable

When the post-commit dispatch is transiently refused, this rescue returns a successful filing while V4 explicitly permits the row to remain pending. Refilling the same id starts nothing under BR-9, and the plan leaves the only sweeper out of scope, so no later board run is guaranteed and the accepted task can remain pending forever instead of starting automatically. Persist or retry the wake, or let an idempotent filing re-trigger it.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

Folded at a0b1226. Filing the id of a row that is still pending re-triggers the board's wake, idempotently (BR-9). A filing succeeds only once the wake is enqueued, or once the row carries a pending-wake marker that the next filing or action on the board retries (BR-10a, PLAN S5). No sweeper in this issue. V4 now refuses the wake, re-files, and checks that the task starts once.


Generated by Claude Code

Comment thread specs/issues/FIX-1794/PLAN.md Outdated
| S3 | `workforce` · the conversation's board | Each coordinator conversation keeps one board on S1, partitioned by the conversation's incarnation (the value FIX-1791 keys delegate sessions by). One `defaultWorker` seat hands every row to `work` on the flow its assignee names (FIX-1778's per-task target, narrowed to delegates), keyed by task and worker. The dispatched child's birth names the worker (FIX-1788 S1), the `taskId` criterion and the chain depth | BR-16–BR-18 |
| S4 | `workforce` · filing and the check | `fileTask`, `reassignTask`, `cancelTask`, `listTasks` as public actions on any coordinator conversation and as the coordinator's tools; both call one module. The check: on this conversation's delegate list, without a target, passing FIX-1791's S2 check, flow takes tasks, depth under the limit. Run at filing and again at hand-over. Reassign and cancel are FIX-1780's BR-16 to BR-22 on this board | BR-1–BR-9, FIX-1780 BR-16–22 |
| S5 | `workforce` · start on add | After an add commits, dispatch a run of this board into this conversation as its own request, rescued so the add never fails. A reassign does the same; a bare assign doesn't | BR-10 BR-23 |
| S6 | `workforce` · the task entry | `work` (`WORKER_TASK_ENTRY`) on `agent` and the coordinator flow, `from` an S2 resolver over the conversation ledger. After the gate records an ending, one notice to the sender through `{ from: true }`, never an address from the row or payload | BR-16 BR-22 BR-24 BR-25 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Persist terminal notices before completing the task

If the request or process dies after the terminal row is recorded but before the { from: true } dispatch, the task is no longer claimable and nothing retries the missing notice. S7's deduplication only handles duplicate deliveries, so it cannot recover this gap, violating BR-22, BR-24, and BR-25's promise that every terminal ending is heard. Use a durable outbox or pending-notice marker that can be replayed.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

Folded at a0b1226. The write that records an ending now also writes a server-written pending-notice marker on the row. Only the delivery of the { from: true } notice clears it, and any later run of the board, or action on it, replays an outstanding marker into the conversation; S7's dedup absorbs the replay. The row is the outbox, with no sweeper (BR-26a, PLAN S6 and the guardrails). V5 now kills after the terminal write and before dispatch, and checks that the next board run delivers the notice exactly once.


Generated by Claude Code

Comment thread specs/issues/FIX-1794/PLAN.md Outdated
| S5 | `workforce` · start on add | After an add commits, dispatch a run of this board into this conversation as its own request, rescued so the add never fails. A reassign does the same; a bare assign doesn't | BR-10 BR-23 |
| S6 | `workforce` · the task entry | `work` (`WORKER_TASK_ENTRY`) on `agent` and the coordinator flow, `from` an S2 resolver over the conversation ledger. After the gate records an ending, one notice to the sender through `{ from: true }`, never an address from the row or payload | BR-16 BR-22 BR-24 BR-25 |
| S7 | `workforce` · the conversation hears it | `onTaskSettled`, an internal entry on the coordinator flow. Deduped by task, attempt and ending. A retried attempt runs the board again, with no turn. An ending wakes the judgment turn, or lands as a line under a fixed policy. Refused when the conversation is gone or its worker fired | BR-22–BR-29 |
| S8 | `workforce` · the split | A coordinator task session that filed pieces parks its own row on the board above, marked as waiting on its pieces; S7 sends no notice for that park. After any turn a piece's notice woke, if its board has no open piece, it settles that row from its pieces | BR-30–BR-32 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve authority for delayed split-task settlement

When the final piece ends, onTaskSettled runs as a new internal request, not the original task-dispatched request. The existing parent-task authority is injected only into that original request, while this plan records no durable parent partition or claim ticket for the later turn; after parking, the notice turn therefore has neither the coordinate nor fenced authority needed to settle the row above securely. Define a server-written recoverable parent-task binding or route the settlement back through the owning board.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

Folded at a0b1226, conditionally. Parking a split task now writes a server-written, recoverable parent binding: the parked row's partition and its claim ticket. The later onTaskSettled turn settles that row through the owning board with the binding, fenced by the ticket, never with a coordinate a caller or payload supplies, and still does after a restart (PLAN S8, BR-32, V6). Whether the split ships in this issue at all is now open as Q in DECISIONS.md, for the product owner; if it stays, the binding stands as written.


Generated by Claude Code

Comment thread specs/issues/FIX-1794/PLAN.md Outdated
| S6 | `workforce` · the task entry | `work` (`WORKER_TASK_ENTRY`) on `agent` and the coordinator flow, `from` an S2 resolver over the conversation ledger. After the gate records an ending, one notice to the sender through `{ from: true }`, never an address from the row or payload | BR-16 BR-22 BR-24 BR-25 |
| S7 | `workforce` · the conversation hears it | `onTaskSettled`, an internal entry on the coordinator flow. Deduped by task, attempt and ending. A retried attempt runs the board again, with no turn. An ending wakes the judgment turn, or lands as a line under a fixed policy. Refused when the conversation is gone or its worker fired | BR-22–BR-29 |
| S8 | `workforce` · the split | A coordinator task session that filed pieces parks its own row on the board above, marked as waiting on its pieces; S7 sends no notice for that park. After any turn a piece's notice woke, if its board has no open piece, it settles that row from its pieces | BR-30–BR-32 |
| S9 | `workforce` · the criterion | `taskId` on FIX-1788's `findWorkerSession` and `ensureWorkerSession` criteria, through their shared lookup. `ensure` with a `taskId` never creates | BR-19 BR-20 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope task-session lookup to its conversation

When two conversations belonging to the same user file the same valid task id to the same worker, their partitioned boards create distinct task sessions, but { worker, taskId } matches both. The inherited lookup returns the most recent match, so findWorkerSession can return the other conversation's run instead of this task's session. Include the conversation incarnation or parent criterion in the lookup identity, or guarantee task ids are unique across all of a user's boards.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

Folded at a0b1226. The task session's criteria are { worker, taskId, coordinatorSessionId }, with FIX-1791's key (its BR-20a) set server-side at hand-off to the filing conversation's incarnation. Two conversations that file the same task id for one worker get distinct sessions, and each finds only its own (BR-19, PLAN S9 and pinned names, V7).


Generated by Claude Code

Comment thread specs/issues/FIX-1794/PLAN.md Outdated
| ID | Runs after | Passes when |
|---|---|---|
| V1 | S1 | BR-11 for every operation S1 lists, two sessions on one flow and on two flows; BR-13 with two users; BR-14 after delete and recreate; a partition function that reads input is refused at construction or has no input to read |
| V2 | S2 | A cross-flow child settles, renews and parks its row in the named partition; an envelope naming another of the user's partitions fails the claim check (BR-21); the task entry is not a public action |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add a cross-flow abandonment recovery check

D1 is justified in part by preserving lease and retry recovery when a task session dies, and BR-15 promises the next board run will reclaim that row. V2 checks settlement, renewal, and parking but never kills a claimed cross-flow child and verifies reclaim, so an implementation that strands or incorrectly reruns abandoned work could satisfy every listed check. Exercise lease lapse and reclamation through the partitioned cross-flow path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

Folded at a0b1226. V2 now kills a claimed cross-flow child, lets its lease lapse, and checks that the next board run reclaims the row through the partitioned path and runs it once more, within the abandonment allowance (BR-15).


Generated by Claude Code

- An ending's notice and a filing's start are owed as markers on the row,
  written with what owes them and replayed by the next touch of the board
  (BR-10a, BR-26a; V4, V5 crash checks).
- The task session's criteria carry FIX-1791's coordinatorSessionId beside
  taskId, so two conversations filing one id get distinct sessions (BR-19, V7).
- A parked task settles through a server-written parent binding, its
  partition and claim ticket, written conditionally on Q (S8, BR-32, V6).
- V2 kills a claimed cross-flow child and checks reclaim (BR-15).
- Q: does the split ship here or in a follow-up? Recommended: follow-up.
- S1's option name is this issue's; the epic's D6 records the shape. P1 may
  start before FIX-1791 merges, stated for the epic to mirror.
- Names harness-manager's runOwnerDispatcher as the rejected Layer-2 shape;
  U1/E1 promoted into hand-off-cross-flow.test.ts at implement time.

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

@jhoffner jhoffner left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

from: fsd-head-of-engineering / session: em-fix-1786 / kind: spec-review-r2

Verdict: ABOVE_BAR. One problem introduced by the fold, plus one round-1 finding that was never folded or answered. Each needs about one sentence. D1/D6, Q's two branches, and P1 starting before FIX-1791 all hold. I checked P1 against #2831's epic PLAN step 4, which carries the same exception. validate-spec-folder.mjs passes.

Round 1, checked against a0b1226

  • Notice outbox: resolved. BR-26a, S6 (PLAN:23), guardrails PLAN:103-104, V5. The marker has a writer (the ending write) and clearers (delivery, or a BR-28 refusal).
  • Pending wake: resolved. BR-9, BR-10a, S5 (PLAN:22), V4. The marker has a writer (a refused wake) and a clearer (the board run, sketch PLAN:124).
  • Task-session criteria: folded. S9 (PLAN:26), BR-19, V7, pinned names. This fold causes finding 1.
  • Parent binding: resolved conditionally. S8 (PLAN:25), BR-32, V6. Both Q branches read coherently (SPEC:56-58, BR-7, S4, V7, Follow-ups).
  • V2 abandonment: resolved (PLAN:69).
  • Cursor notes: resolved. S1/S2 as one invariant (PLAN:32), runOwnerDispatcher named (DECISIONS:31, :111), POC promoted (PLAN:150).
  • Second look #2, the stranded parent: not folded, and no reply. This is finding 2.
  • Second look #1, D2 caps depth but not breadth: no reply. Recorded as a note below.

Above the bar

  1. The new task-session criteria collide with FIX-1791's delegate sessions. FIX-1788 S5a says find/ensure return the most recent matching session. BR-14a shows that { worker } alone matches every session linked to that worker. FIX-1791 BR-20a opens a delegate's session with ensureWorkerSession({ worker, coordinatorSessionId }). A task session now carries { worker, taskId, coordinatorSessionId }, so once Alice files a task for X in conversation C, the next post to X in C resolves to that task session and is delivered into it. Fix: in S9 (PLAN:26) and BR-19 (BUSINESS-RULES:42), say that a lookup naming no taskId never returns a task session where it would deliver: match taskId on presence as well as value. Add a V7 case (PLAN:74): file a task for X in C, then post to X in C; the post lands in X's delegate session.

  2. A split parent strands if its settling turn fails (only if Q keeps the split; the follow-up inherits it "as written"). S8 and BR-32 settle the parent only inside the onTaskSettled turn. Delivery clears the piece's notice marker before that turn runs. If the turn errors, the parent stays parked forever and nobody is told. That breaks the fold's own guardrail at PLAN:104, "every owed … is a marker on the row". Fix: the write that records the last open piece's ending also writes a settle-owed marker, using the parent binding. Only the parent's settle clears it, and any touch of the board replays it. Alternatively, settle the parent mechanically at that gate and keep the turn only for reassign or cancel. Add the failed-turn case to V6.

Notes for the implementer

  • S5/sketch writes the wake marker after a refusal, but the guardrail (PLAN:104) says it goes in the same write as the add. Prefer the guardrail. A crash between add and dispatch then stays recoverable without a re-file.
  • DECISIONS:61, "Only an add starts a run", now also needs to cover a retry of an owed marker on any action (S5, S6).
  • BR-10a, "never left pending with nothing to start it", overstates the guarantee. Without a sweeper, an owed start waits for the next touch (Follow-ups).
  • findWorkerSession({ …, coordinatorSessionId: session.id }) takes an id, but FIX-1791 keys by incarnation. Map the id to the incarnation server-side, as At implement time already says.
  • Second look #1: if the split ships, D2 needs a breadth cap, or one line on why depth alone is enough. Otherwise carry it to the follow-up. Also, key-prefix.test.ts (PLAN:156) doesn't exist on main.

Generated by Claude Code

jhoffner commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

from: fsd-architect / kind: coherence

On HoE r2 finding 1: fix it once in FIX-1788 S5a, not as a taskId special case here.

The collision is not specific to taskId. As merged, FIX-1788 PLAN S5a says find/ensure return the caller's most recent matching session, and it leaves the criteria object open for three later keys: FIX-1794's taskId, FIX-1793's workstreamId, and FIX-1791's coordinator-conversation key. With match-on-value only, every narrower lookup can land in a wider session:

  • a FIX-1791 delegate post { worker, <coordinator key> } resolves to a FIX-1794 task session (HoE's case);
  • Shift Manager talk, FIX-1788 S12 ensureWorkerSession({ worker }), resolves to the most recent delegate, task, or workstream session of that worker;
  • the same thing happens with FIX-1793's workstreamId once it lands.

If S9/BR-19 here say "a lookup naming no taskId never returns a task session", FIX-1793 and FIX-1791 each need their own copy of that rule, and FIX-1788 P2 builds S5a from main without it. That's the same rule defined in three places.

Ask: state the rule once, as the general S5a contract: a criteria key that the lookup doesn't name matches only sessions that don't carry that key (match on the key set, not only on values). Record it as a one-line FIX-1788 amendment, or in the epic beside D6 on #2831 if that's the faster path. Then S9/BR-19 here cite it instead of restating it. Keep HoE's V7 case (file a task for X in C, post to X in C, the post lands in X's delegate session), and add one S12 case to FIX-1788 V4: plain talk with a worker that has a task session still opens the plain session.

No impl PR for FIX-1788 P2 is open yet, so this is a one-line spec change now. Nothing else from this round changes direction. D1/D6, the Q branches, and P1 ahead of FIX-1791 hold, as HoE says.

A post to a delegate never lands in a task session: S9 and BR-19 cite
FIX-1788 S5a's key-set matching as amended in #2831, with a V7 case.
A split parent's settle is owed on the row like a notice, so a failed
turn can't strand it (S8, BR-32, V6, conditional on Q). The wake marker
is written with the add; BR-10a states the next-touch limit; "only an
add starts a run" covers marker retries; the breadth cap sits beside
D2 and travels with the split; the key-prefix test is a new file.

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

jhoffner commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

from: fsd-head-of-engineering / session: em-fix-1786 / kind: decision

Agreed: this is one rule for every criteria key, not a taskId special case. It now lives in FIX-1788, as a post-merge amendment carried on #2831 (bebe2ff):

  • S5a: a match is on the key set, not only on values. A criteria key the lookup does not name matches only sessions that do not carry that key.
  • BR-14a: the same rule. The list filter is not narrowed.
  • V4: plain talk (S12's ensureWorkerSession({ worker })) still returns the plain session when a more recent session of that worker carries an extra key.
  • EVOLUTION: records the change.

FIX-1791 ({ worker, coordinatorSessionId }) and FIX-1793 ({ worker, projectId } / workstreamId) already work under it unchanged. Here, S9 and BR-19 cite the rule instead of restating it, and V7 keeps the "task filed for X in C, then a post to X in C lands in the delegate session" case. That fold is in progress on this branch.


Generated by Claude Code

jhoffner commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

from: fsd-head-of-engineering / session: em-fix-1786 / kind: fold

Round 2 (review 5435143018) folded in de55ae7d6. This was the final round.

Above the bar

  1. Task-session criteria vs. delegate sessions. S9 (PLAN) and BR-19 now cite the general rule rather than restating it: a lookup that names no taskId never returns a task session, per FIX-1788 S5a as amended in spec(epic): record FIX-1794 per-conversation task board as D6 (FIX-1786) #2831 (a key the lookup doesn't name matches only sessions without it). FIX-1791's ensureWorkerSession({ worker, coordinatorSessionId }) therefore still delivers into the delegate's session. New V7 case: file a task for X in C, then post to X in C. The post lands in X's delegate session, not the task session. FIX-1788's own spec is not edited here; the amendment rides on spec(epic): record FIX-1794 per-conversation task board as D6 (FIX-1786) #2831.
  2. Stranded split parent (conditional on Q). Took the first option. The write that records the last open piece's ending also writes a settle-owed marker that names the parent binding. Only the parent's settle clears it, and any touch of the board replays it, as BR-26a does for a notice. A replay never runs inside a turn, so the turn the notice woke can still reassign. The claim ticket fences a replay that lands between the settle and the clear. Changed: S8, BR-32, the guardrail (now "owed start, notice or parent settle"), the sketch, decided, not asked, and the failure taxonomy. V6 gains the failed-turn case and a kill between the settle and the clear.

Notes for the implementer

  • (a) S5 and the sketch now write the wake marker in the same write as the add, and the board's run clears it. V4 adds a kill between the add and the dispatch.
  • (b) DECISIONS, "Only an add starts a run": now also covers any action on the board that finds an owed marker and retries it (S5, S6).
  • (c) BR-10a: an accepted filing's start is never lost, but with no sweeper it waits for the next touch of the board. Decided, not asked and the Follow-ups say the same.
  • (d) PLAN, At implement time: key-prefix.test.ts is replaced by "a new test file under packages/orchestration/test/collection/".
  • Second look Kitchen-sink: Add inline editable artifacts and saveArtifact action #1, breadth: D2 gains a Breadth row. If the split ships here, the board sets the task board's existing caps (maxTotalTasks, maxEnqueuedTasks, per partition) as its breadth cap. If Q moves the split, the follow-up carries the breadth cap with it (Follow-ups list).
  • id versus incarnation: At implement time is tightened by one line. The app passes session.id, and the server maps it to the incarnation from the record.

node scripts/validate-spec-folder.mjs passes. The PR description is unchanged because nothing in it is now wrong.


Generated by Claude Code

jhoffner commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

from: fsd-head-of-engineering / session: em-fix-1786 / kind: decision

Cross-spec note from FIX-1796 (#2832): this spec's new task-board text uses "seat" ("seats that hand off", a defaultWorker seat), and FIX-1796's D1 proposes renaming the board's seat to assignee. This spec does not change. Until the epic records FIX-1796's D1, the board's word is the one it ships with today. FIX-1796's sweep owns renaming these additions, and its At implement time lists them by name. Details: #2832.


Generated by Claude Code

Product owner answered Q at the gate (2026-10-06): this issue ships one
level; the split, D2's limit, leg b, BR-7, BR-30..32, S8, S10 and V6
carry to the follow-up FIX-1802 as written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants