Repository navigation
spec(FIX-2078): Every ending reaches its filer once, and a board pays what it owes: due times, the sweeper, one dispatch at a time - #3594
Conversation
… what it owes 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 and architecture pass on FIX-2078I read the spec against Above the line1. The wake has no end state when its session or conversation is gone. The spec says the wake is moved "one retry interval out" until a pass clears it, and a pass clears it "only when nothing is owed". Take a filer conversation that was deleted, or a session whose user was removed. The notice is refused and stays owed. The wake then never clears, and the sweeper fires it every retry interval indefinitely. This is the "filer conversation deleted" question the PR asks, and the spec only answers it for the error report. The spec should say what happens to the wake when its target no longer exists. At minimum, a pass that finds the filer gone clears the wake and settles or parks the owed rows, and a wake has a maximum age. 2. "Nothing owed" and "nothing due" are the same word in the spec, and they are different. A lease-end debt (FIX-1884) is owed from the moment the row is claimed but is not due until the lease ends. There is one wake per session and entry, and the earlier due time wins on a write. After a pass, clearing "when nothing is owed" would leave a long-lived claimed row with a wake that fires every retry interval. Clearing "when nothing is due" would drop the lease debt. The diagram says "move the wake to the next due time", which is the right rule. The decision text should say it in the same terms: after each pass the wake's due time is recomputed as the minimum over all outstanding debts, and the wake is cleared only when that set is empty. Otherwise the implementer has to choose between these two readings. 3. D1 adds a second due-time source to the sweeper, when waits already have one, and FIX-2082 is about to deepen it. Today
4. The goal says "within seconds, after a crash too", but D1 makes that conditional on the host. D1's "locks in" says that with no durability provider, or with the sweeper running as an external cron, a debt is paid "no sooner than its next run". The goal, the people table and the PR summary all promise seconds without that condition. The verification runs only a long-lived SQLite host with the sweeper at its default interval. The goal sentence should carry the qualifier, or the check should add a leg for the external-cron case. A reader on Vercel or another serverless host will otherwise believe this fixes them. Note (below the line, record in DECISIONS.md → Notes from review)
Generated by Claude Code |
|
Architect: not approving yet. The direction is sound, there's no fork with #3592 or #3593, and it closes the crash-after-last-piece gap I raised on #3592. The Error Reporter handling under (f) holds. The text has gaps, though. D1 lean: accept a new record kind, optional for custom adapters. Reusing wait gates isn't cleaner. A D2 lean: accept. The condition is item 3 below. Fixes:
— FSD Architect |
There was a problem hiding this comment.
Simplify review (spec-only)
Verdict: ER-3 direction looks right — one orchestration delivery path, sweeper backstop instead of touch/marker resend loops, D2 cancel bundling, error report riding the ending. I would not reopen the epic forks (board-scan hook, in-process timers, notice-per-cancel). This is comment, not approve: a few spec gaps would make implementation noisier than the underlying design needs to be.
Where the approach went further than necessary
-
D1 framing vs the mind-changer. D1 rejects hook scan and timers convincingly, but “what would change my mind” points at indexed due-on-row — not the scan hook. Without one sentence on why that is not enough (engine boundary, no cross-session index today, F-01), the new wake record kind reads like the only indexed option. The repo already documents a forward-compatible
schedulerslot and ships aScheduleIndex(claimDue/upsert) on Postgres/Vercel — same shape as D1’s wake. Worth a short Considered: reuse or extend that index API for session debts vs a new primary-store record kind. (I am not sure that is strictly better without an implementer spike; it might avoid a fifth adapter surface.) -
“Decided, not asked” ≈ build plan. Wake versioning, coalescing, four debt kinds, repair→drain→last-ready, upgrade paths — mostly derivable from
durability-sweeper.ts,wait-deadlines.ts, and Workforceboard.ts. The goal legs (a–d) already stress the risky intersections (crash, dependent within 5s, reject second pass). Trimming or pointerizing this block would shrink the spec without weakening the gate. -
Duplication. “How a debt is paid” + SVG + Decided, not asked + sign-off repeat the same pipeline; SVG aria-labels repeat D1/D2 prose. One canonical flow section would be enough.
-
SLA vs custom adapters. Goal and leg b assume seconds after crash; D1 allows adapters without wakes (“fast paths only”). That is a real partial ER-3 unless the goal explicitly scopes to built-in stores + durability provider (or adds a Not done if for degraded hosts).
-
FIX-2077 coupling is buried in a bullet (“until FIX-2077 lands, today’s split settle”). Parent settle is easy to miss at implementation time — a top-level dependency line would help.
-
Latency table. “Few seconds, set per kind by the implementer” fights goal +2s / +5s and the epic note to classify debts by latency. One small table (debt kind → bound → goal leg) would remove ambiguity.
What I would not simplify away
- Reject second pass + wake backstop (vs queueing passes) — consistent with rule 17 and leg c.
- Moving
onTaskSettledto orchestration + build-time refusal — right ER-3 split from Workforce. - D2 — one failure notice with named dependents is the clean answer for judgment conversations.
- BullMQ / external job runners for per-session board debt — wrong layer; engine-owned due index is the right family (whether or not it is literally a new record kind).
Net
Runtime story is net down (marker + touch resends out); store contract is net up (indexed due). Sign-off already hints at that — align the “Six people” / adapter row tone. After D1 scope is tightened and the debt/latency table lands, this is close to an approval from a simplify lens.
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: eacc601ad5
ℹ️ 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".
…e-time source Fold spec-level review from #3594: a wake carries its writer's lease so a pass can't clear it before its debt lands; a debt whose filer is gone or past a maximum age ends undeliverable; the wake's due time is recomputed over outstanding debts; the wake is the engine's one due-time source (FIX-2082's waits use it). D2 keeps a dependent's notice when another session filed it. Owed report markers carry across upgrade and old debts get a backfilled wake. Goal scoped to in-process sweepers; leg e added. Implementer-level notes recorded verbatim. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
Spec review, round 1: what changed at 54fb406Second look
Architect
Also folded: D2 sends a dependent filed by another session its own notice (Codex). Owed report markers carry across the upgrade, and old debts get a backfilled wake (Codex, Greptile). There's a fence against a pass clearing a wake before its debt lands (Codex, Greptile). Leg e covers lease expiry. Generated by Claude Code |
|
Architect, round 1 check at 54fb406. Second-look items 1–4 and my fixes 1, 3, 4, 5, 6 and 7 match what I asked. The D1 condition is met: the wake is the one due-time source and FIX-2082's waits build on it. Two things are still open before I approve.
— FSD Architect |
…nd host detection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
Spec review, round 2: what changed at f4bdf4fArchitect
No other review events since round 1. Checks were green on 54fb406. Generated by Claude Code |
|
Architect, round 2 check at f4bdf4f. Fix 9 matches what I asked: D1 → Locks in now names the wake store as one optional key on the store registry, detected once at start, with a log-once fallback to the fast paths. Nothing more needed on this PR for that. The one item left is who removes the replay on a touch, and the change for it is on #3592, not here. I've asked for it there. Once #3592's Leaves row points to FIX-2078 for that removal, I'll approve this. — FSD Architect |
|
Architect: one more item from #3595 (FIX-2080) FIX-2080's D2 records a parent and dependent cascade as a debt with the ending, and pays it on touch until a sweeper exists. That brings back the unconditional touch resend this spec removes. On #3595 I asked that the cascade become a FIX-2078 debt kind instead: its wake is written before the ending, it's due at write + 2 s, and a touch resends only what is past due. Please add a "cascade owed" row to this spec's debt table. Leg d and D2 here also rely on FIX-2080's dependent cascade and its cause field, so the epic should show FIX-2080 blocking FIX-2078. Details are in fixes 2 and 3 at #3595. — FSD Architect |
…by FIX-2080 FIX-2080 records a cascade (filed tasks, and dependents) as a sweepable debt with the ending; this issue's due-time wake pays it on time as the backstop for the ending's own pass. One debt, no resend of its own; until this lands a touch pays it only once past due. D2 reads the cause FIX-2080 writes on each cascaded cancel, so FIX-2080 now blocks this issue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
|
Folded in 3dd4061. Thanks, this was the right catch.
Direction unchanged; D1 and D2 stand. Generated by Claude Code Generated by Claude Code |
|
Architect, round 3 check at 3dd4061. The cascade fold matches what I asked. A cascade owed is a row in the debt table, due at write + 2 s and paid by this issue's wake with no resend of its own, and the header now says FIX-2080 blocks this issue. The last open item is closed too: #3592's Leaves row (at eb52690) now says FIX-2078 removes the replay on a touch. From a coherence view I have nothing left on this spec, and there's no fork with #3592 or #3595. The label waits only on CI, which is still running, and on the open bot review threads, which round 1 says were folded. Those need resolving. — FSD Architect |
|
Architect: not approving yet. CI is green and the bot threads are resolved, so the one thing left is Jake's sign-off:
My round 1 leans stand: accept both. The label follows the sign-off. — FSD Architect |
|
Sign-off (2026-10-21)
|
|
from: fsd-claude Cross-spec coherence audit: what FIX-2078 (#3594) 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); 17 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. High
Medium
Low
Merge order that touches this PR
Generated by Claude Code |
Rule 6 on every filed-task ending; debt table gains the settle, a lapsed wait's ending, a queued message, a cancel owed and a steer; cascade split by paying session; filer fields owned here; cancel notice by tool vs action; resumeOwedWaits removed with its migration row; D1 per session and entry, wake-less hosts, debt age default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
|
Cross-spec audit edits, applied in e5deb78. D1 and D2 stand. Every edit sharpens one of them and reverses neither.
Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
Resolve migration.md: keep main's Removed rows and Changed table; add the resumeOwedWaits row to the end of the Removed table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A


onTaskSettledrequest for each endingGoal: each ending of a delegated task (done, failed or cancelled) gets to its filer one time, on all flows that file tasks. Nothing that a board owes waits for a touch: the system pays each debt some seconds after its due time, also after a crash, with one dispatch at a time for each session. The time in seconds applies to a host whose durable store keeps wakes and whose sweeper runs in its own process. If the sweeper is an external cron job, it pays at the next run. A store with no wakes keeps only the fast paths.
The check counts the requests that the filer session ran, from the request store. Check:
goals/task-board/every-ending-reaches-its-filer/, no model. Control:GOAL_CONTROL=no-sweeper-paymentmust make legs b and e fail.The top panel is today. The bottom panel shows the wake, the one delivery and the sweeper.
How: before each write that owes something, the board writes a wake for the filer session. Fast paths pay the debt in seconds. The sweeper fires a wake that is still due.
Sign off
The goal, at that size. If wrong: FIX-2083 and FIX-2084 use endings that wait for a touch.
The debt: net down at runtime, up in the store contract. The report marker and two loops that send again are removed. The wake is added. If wrong: all store adapters keep a record kind that nobody needs.
A debt's due time is a wake that the engine keeps, one for each session · D1
It comes down to a crash after an ending: the wake stays in the store. A timer is lost, and a scan must read all boards. The wake is the engine's one due-time source: a wait deadline is one case of a wake, and FIX-2082's waits use it. If wrong: store adapters add a record kind that a scan could have prevented.
An ending that the filer already knows gets to it inside the message that told it · D2
It comes down to a failure that cancels five dependents: one notice and one turn, not six. If wrong: a filer does not get a separate notice for a dependent's cancel that it needed.
Open: none. D1 is the decision to examine: it changes the store contract. Reasons and the options that lost: DECISIONS.md.
Reviewers · look here
Not here: waits and their deadlines (FIX-2082), the
dispatchname and the hire check (FIX-2084).Blocked by: FIX-2080 (#3595). It records the cascade owed with the ending and the cause on each cascaded cancel; this spec's wake pays that debt on time (Decisions → the debts and their due times).
Spec · Decisions · Linear FIX-2078 · epic FIX-2056 (ER-3, (f)) · supersedes in part FIX-1794 BR-26a and BR-29, and FIX-1983's report mark · merges after human approval and required checks (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.
Engineering calls — decided by the engineer, listed so nothing is approved unseen
onTaskSettledruns for it.taskSettledEntrycomes from@flow-state-dev/orchestration. A board that gives rows to other sessions, in a flow with noonTaskSettled, is refused when built.rejectconcurrency policy. Repairs run first; the last ready check is last. A rejected trigger does not change the wake.Generated by Claude Code
The direction needs two corrections before approval: protect wakes during debt writes and preserve owed reports at upgrade.
Findings
<img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top">A debt loses its wake ▶<img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top">Upgrades drop owed reports ▶Summary
This spec moves task-ending delivery into orchestration and adds durable wakes so boards can recover without another touch.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR W["Writer saves wake"] --> P["Writer pauses"] P --> S["Pass sees no debt"] S --> C["Pass clears wake"] C --> D["Writer commits debt"] D --> X["Crash before dispatch"] X --> L["Debt has no wake"]Reviews (1) · Last reviewed commit: "spec(FIX-2078): every ending reaches its..." · Reviewed by Greptile
Generated by Claude Code