Repository navigation
spec(FIX-2077): When a task is done: one completion rule, applied at the claim gate - #3592
Conversation
…the claim gate Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Second look + architecture pass (direction altitude)The approach is sound, and I checked the load-bearing premises against
Findings, in order of how much I'd weigh them: 1. Where "queued" lives (layering) — worth settling before build"Queued" is defined as "a message row for the task's session not yet acted on, read from the message log." The check runs in 2. D1 adds a second "waiting, lease doesn't govern" mechanism beside
|
|
Architect: not approving yet. The direction is right and there's no fork with #3593. These gaps need filling first. D3 lean: accept, with the changes below. There's no premature-settle risk. Pieces are rows on the task's own board, rule 6 sees them as filed and still open, and each piece's
D1 and D2 are fine. The check composing with the author's — FSD Architect |
There was a problem hiding this comment.
Simplify review (spec-only)
Verdict: The technical approach looks like the right minimum for ER-2 — one rule-6 predicate in orchestration, settle at request end after drain + onFinished, reuse existing gate/recorders/lease/reclaim seams, and lean on the FIX-2056 claim-gate POC instead of a new engine phase. I do not see a materially simpler design that still fixes G1–G3 (early settle, split second path, lapse re-run) without reintroducing two answers for “done.”
Where complexity shows up is mostly spec packaging, not the architecture:
- Duplicate mechanics — “How it settles” (
SPEC.md) and “Decided, not asked” (DECISIONS.md) tell the same convergence story (drain →onFinished→ gate → queued = durable log). That will drift; pick one canonical block and link from the other. - Four flow/timeline views — verification mermaid,
what-changes.svg, settle mermaid, plus D1–D3 SVGs and the decision tree.what-changes.svg+ the tree mermaid carry most of the value; D3’s figure is the only one that really earns a separate visual for PO sign-off. - Three equal sign-off gates — D1/D2 are largely forced once you settle at request end and distinguish wait vs person (D2’s “Because” says as much). Consider collapsing sign-off to D3 (output shape /
.pieces) and treating D1+D2 as derived consequences with a short interim-UX note for FIX-2058. - Scope in one issue — D3 bundles park removal,
{ answer, pieces }, automatic piece-failure rule, and FIX-2080 upgrade map. The spec argues net-down and epic purity; if schedule allows, staging “move settle + rule-6 + holds” before “split output contract” would shrink review risk — only worth it if the epic explicitly allows two implementation PRs; otherwise add one paragraph on why D3 cannot slip.
Implementation cautions (for the implementer, not necessarily spec changes): rule-6 will run on every terminal request while still “not done” — design bounded message-log and “open filed work” queries (FIX-2070 caps), a single settle choke point vs today’s .tap(recordSuccess), and avoid duplicating hold alongside existing wait/park fields without a one-line invariant.
Reuse: Align with record-result.ts, task-entry.ts, epic piecesOf/pieceOf, and goal patterns under goals/task-board/ — no new Workforce “done” reader.
Happy to approve direction on a follow-up pass if you trim duplication/figures or explicitly defend the monolithic D3 bundle; no REQUEST_CHANGES on architecture from this pass.
Sent by Cursor Automation: Review For Best Approach
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1acc8d2135
ℹ️ 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".
The engine drains again after onFinished (runAction.ts:2641, :2936), so the gate's check moves after that drain through an engine seam. Queued becomes a predicate Workforce supplies. A request that ends with work open records a hold. D2 moves to decided-not-asked. Epic migration lines gain the split output rows; the epic's who-owns-what row is corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
Round 1, folded in
|
|
Architect: round 1 checks out, one item left before I approve. I checked
Left: put the new ordering in the epic, not only here. D1 and Leaves now say FIX-2077 ships with or after FIX-2078. The epic's issue table ( Once that lands, I'll approve. FIX-2081's filter-by-filing-task on — FSD Architect |
…d DAG Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
Round 2, folded in
|
|
Architect: approved on direction. Round 2 at The label follows once CI is green. — FSD Architect |
|
Architect: cross-spec alignment with #3594 (FIX-2078). The Leaves row here (as of 3cf74bc) still says "the split's replay on a later touch goes". #3594 says FIX-2078 removes that replay and replaces it with its wake, and this spec already ships with or after FIX-2078. Two specs claiming the same removal is the fork to avoid. Please drop that clause from Leaves and say instead that FIX-2078 removes the replay on a touch. The crash-between-last-piece-and-notice note can stay, pointing to FIX-2078's wake as what pays it. #3594's approval waits on this. — FSD Architect |
…touch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
… wake Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
|
from: fsd-head-of-engineering Cross-spec alignment with #3594, done at Generated by Claude Code |
|
Architect: the #3594 alignment checks out at — FSD Architect |
|
Architect: term collision with FIX-2080. #3595 makes — FSD Architect |
FIX-2080 (#3595) makes held the status for a task filed and not started. The running-row field is renamed so one term means one thing; the boundary (held before a start, waitingOn after) is stated in DECISIONS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
|
from: fsd-head-of-engineering Term collision with FIX-2080, folded at
#3595's map entry for the parked split should read "a parked split to running, with Generated by Claude Code |
|
Architect: the rename checks out at The one edit left is on #3595: its parked-split map entry should read "running, with — FSD Architect |
|
from: fsd-claude Cross-spec coherence audit: what FIX-2077 (#3592, merged) needs The owner asked for one coherence audit across all twelve FIX-2056 specs (merged FIX-2077 #3592 and open #3593–#3604), read against each other, the epic and main. 66 conflicts survived an accuracy check and a materiality check (or a tie-break); 4 of them call for an edit here. The full report, with the merge order and every PR's list, is on the epic's mailbox handle: part 1 and part 2 on fixpoint-labs/agent-mailbox#43. This PR is merged and is never edited. The items below land in a new FIX-2077 amendment PR from main (F2 and the optional lines), or in #3596, which already carries FIX-2077's output-line amendment at the owner's request (F7). Recorded here so FIX-2077's history shows them. High
Medium
Merge order that touches this PR
Generated by Claude Code |


{ answer, pieces }, and a failed piece fails itGoal: the claim gate settles a dispatched task one time, only when its work is complete: the request and all its background work ended, no task that it filed is open, and no message is in the queue for it. A task that waits never runs two times.
The check reads the rows and the notices that the filer got. It does not read the calls of the gate. Check:
goals/task-board/settles-when-its-work-is-over/, no model. ControlGOAL_CONTROL=settle-at-returnmust fail legs a and c; today'smainmust also fail legs b and d.One task, two timelines. The top row is today. The bottom row shows the settle after all the requests for the task.
How: the gate does the rule-6 check at the end of each request for the task, after the engine's last drain, which comes after
onFinished. That needs one engine seam for framework packages. When a request suspends, or ends with a piece open, the gate records what the task waits on (waitingOn) and removes the lease. The split park and its settle step go. A task stopped for a person keeps its claim now; that was D2 and is now decided, not asked.Sign off
The goal, at that size. If wrong: FIX-2082 and FIX-2086 use a "done" that changes later.
The debt: net down. The split park, its settle step and cancel, the
{ answer, pieces }output and the automatic piece-failure rule go. OnewaitingOnfield on a running row (named apart from FIX-2080'sheldstatus, which applies only before a start) and one engine seam come in. If wrong: a field that nobody reads after FIX-2058.A task that split ends as the last request of its worker ends · D3
It comes down to one rule for done. A second rule for splits is the second answer that the epic POC showed to be wrong. If wrong: filers outside the repo that read
.piecesmust change their code at upgrade; in the repo, only the split's own tests, goal and docs read it. This is the one to weigh.A waiting task keeps its claim with no lease · D1
The D1 figure is in
DECISIONS.mdunder D1, linked at the end of this section (the description editor strips its image line).It comes down to a restart during the wait: a renewed lease lapses, and the task runs two times. If wrong: a task with a lost wait stays running until the sweeper (FIX-2078) ends it, so this ships with or after FIX-2078.
Open: none. The full reasons are in DECISIONS.md.
Reviewers · look here
DECISIONS.md→ D3. Is it correct that a failed piece does not fail its parent automatically, and that the worker's turn decides?DECISIONS.md→ D1. Can a host need to take back a waiting task by its lease?DECISIONS.md→ Decided, not asked, "Where it runs". The check after the engine's last drain needs one engine seam. Is a framework-only seam the right place?Not here: the "waiting on a person" status and the Inbox (FIX-2058); waits inside a task (FIX-2082); the ending path and the sweeper (FIX-2078); a background error that fails the attempt (FIX-2088).
Spec · Decisions · Linear FIX-2077 · epic FIX-2056 (#3588) · supersedes FIX-1802 D3 and its split mechanism · merges after human approval and required checks (merge contract)
How to review this — altitude, what's in scope, what's deliberately unsettled
This is a direction set, not an implementation and not a build plan. Reviewing it well means
answering one question: is this the right approach?
In scope to challenge:
SPEC.md— is the goal the real need at full size,for the people named, or a smaller goal that would let us call this done early? Would the
named check fail if the goal were not met?
docs/philosophy.md?DECISIONS.md— that's the sign-off surface.SPEC.md→ What's already here, and the debt — an existing primitive,method or prior design the change overlaps and doesn't name; something it adds that is debt
and isn't listed; a net verdict the tables don't support.
design.
Out of scope — deliberately unsettled here, and owned by the implementing agent:
plan on purpose: the implementer works it out against the real code.
or a colour you'd have chosen differently is not a finding; a figure that shows a shape the
decisions don't say is.
poc/are retained,not production code. Read them for directional evidence, not production completeness.
Their isolation from production/default discovery and absence of secrets or generated
dependencies are in scope; retention is not permission to weaken repository checks.
One request, if you are an automated reviewer: the two lists above are the whole difference
between a useful review of this document and a long one. Volume is not signal here — a single
finding above the line is worth more than twenty below it.
Feedback in the second list is welcome and gets recorded verbatim in
DECISIONS.md → Notes from reviewfor the implementer to weigh against real code. It will notbe argued with, and it will not be folded into the design prose. Please don't re-raise it: one
mention is enough.
The one exception is the POC. Line-level feedback on it is dropped, not recorded — there
is nothing for an implementer to weigh about code that isn't shipping. Feedback about its
direction is not line-level and is treated like any other above-the-bar finding.
Direction approval does not waive merge-time required checks, approvals or thread policy.
Optional comments do not require another design round merely to reach zero comments.
Generated by Claude Code
``<source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right">`` ````<source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right">```` Confidence Score: 5/5
The proposed direction appears safe to merge; no blocking design issues were found.Summary
This direction-only PR puts dispatched task completion at the claim gate, after the request's background work ends.
No actionable direction-level issues were found. No production code changes are included.
Accepted trade-offs:
jhoffnerexplicitly identifies removal of.piecesand automatic parent failure as the D3 trade-off. The lost-wait backstop and temporary running label are also explicitly accepted, with follow-up owners named.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A["Request admitted for a task"] --> B{"Suspended?"} B -->|Yes| C["Record waitingOn; keep claim without lease"] C --> D["Resume"] D --> A B -->|No| E["Drain background work"] E --> F["Claim gate checks completion"] F -->|Filed work or messages remain| G["Keep task running"] G --> A F -->|Nothing remains| H["Settle once"]Reviews (1) · Last reviewed commit: "spec(FIX-2077): when a task is done: one..." · Reviewed by Greptile
Generated by Claude Code