Repository navigation
spec(FIX-1654): Abort fence should compare the request's incarnation, not createdAt - #2415
Conversation
Retained spec set for moving setFieldsIfStatus's identity fence from createdAt to the incarnation across the memory, filesystem, SQLite and Postgres request stores, with legacy records resolved as legacy_<createdAt>. A POC on main shows the createdAt fence failing both ways: a same-millisecond reuse takes another tenant's cancel, and a same-owner hand-off makes the owner's own cancel miss. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HNTQkGXCUryuVD2TEBLi6G
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
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. |
|
Process guards is red, but not because of this PR. The spec-folder guard fails on No fix for it exists yet. Removing the guard is waiting on the maintainer's decision, so I'm not changing it from here. Generated by Claude Code |
|
Second-look and architecture review of the FIX-1654 spec: no changes requested. The PR is spec only (+753 lines, all under Alternatives I considered and found justified:
Architecture note for the implementer, which does not block anything: Generated by Claude Code |
jhoffner
left a comment
There was a problem hiding this comment.
FSD Architect — direction lean (not impl).
Approve D1. Merge = Jake’s call.
Approach: Right Hard-gates follow-on to FIX-1021 + FIX-1286. Goal correctly owns both failure directions (same-ms stranger reuse and same-owner hand-off). Route-only was rightly rejected; incarnation mint stays 1286; other writers (stale sweep / FIX-1128) out of scope. POC on 70f777def is the right control.
D1: Replace createdAt with incarnation outright — not optional beside it, not “accept either.” Any leftover createdAt compare keeps BR-3 (owner hand-off → false 404). Dual fence = two identities for “same request,” which FIX-1286 already forbade. Compile break for out-of-tree stores is the honest migration signal; fail-closed for untyped adapters + conformance fence case is correct. Flip condition stands: only a known OOT store we must not break this release would buy an options-field soft land — none is named here.
Soft (S6): Postgres stating the legacy rule in SQL is fine if conformance V3/V4 hold it equal to resolveRequestIncarnation — don’t add a JS path “just to share code.”
Open: none. No D-n, no Linear edit.
There was a problem hiding this comment.
Simplify review (spec FIX-1654)
Verdict: The implementation approach is the right minimal patch, not an over-built design. This is mostly finishing what FIX-1286 already promised (types.ts still documents the fence follow-up) and what FIX-1021 wired: rename the fifth setFieldsIfStatus argument, compare via existing resolveRequestIncarnation on the TS path, mirror that rule once in Postgres SQL, export the helper for out-of-tree stores. Rejected forks (route-only, dual fence, deprecating both number and string, freezing createdAt) are the ones that would either not fix the bug or add a second identity notion.
Where complexity shows up is artifact surface area, not architecture:
- The same two failure modes (same-ms stranger leak + same-owner hand-off 404) are narrated in SPEC, DECISIONS, PLAN, POC README, and the POC file header. One canonical story plus pointers elsewhere would shrink the diff without weakening sign-off.
figures/what-changes.svglargely duplicates the "Four people" table and the short prose under What changes; I'd keep either the table or that figure for gate readers.- DECISIONS carries three views of dropped options (mermaid dashed edges, D1 "Instead of", and the table). Two is enough.
- The retained POC and
run.shcopy pattern match FIX-1286 and are justified: today'sabort.test.tsinterleave at differentcreatedAts (1_000 vs 2_000) does not exercise BR-1; the POC's equal-createdAtcases are the real red control.
At implement time (optional trim, not blocking): V3's full legacy matrix in conformance is the main "could be smaller" knob—request-incarnation.test.ts already pins derivation; you could lean on it and keep conformance to the two fence interleaves if you want less duplication. I'd only do that if you're confident Postgres SQL drift cannot slip past route tests.
No third-party package buys anything here; this is a contract-aligned string compare and a SQL COALESCE aligned with code you already own.
Approving direction for merge; inline notes are editorial simplifications you can take or leave before or during implementation.
Sent by Cursor Automation: Review For Best Approach
jhoffner
left a comment
There was a problem hiding this comment.
Not owner approval / not the gate. Shared jhoffner login — this is FSD Architect coherence only. Direction merge still needs human product-owner sign-off and required checks.
Coherence: clean. Sole open issue-spec for FIX-1654. Complements merged FIX-1286 (#2400 → 70f777def, which named this fence follow-up) and merged FIX-1021 (#2387, which landed the createdAt fence). No competing open stream on abort-fence / expectedCreatedAt → incarnation. FIX-1128 and FIX-1647 stay correctly out of scope. D1 (replace createdAt outright) matches FIX-1286's identity lock: keeping both fences would leave the owner hand-off miss. POC control pinned to that same main commit is the right bar.
Soft (does not block direction): Linear nests FIX-1654 under FIX-1635, but the locked children list on the epic body / never-merge epic-spec #2360 does not name it yet (unlike Jake's 1647/1648 AuthZ expansions). If this is a hard-gates child, fold it into the epic set on #2360 + Linear; if it is remainder debt outside the release proof, un-nest. Also: Linear still shows FIX-1286/FIX-1021 as In Review — status lag only; both are on main.
No two-direction fork. No Jake ping from this watch.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9803956ae8
ℹ️ 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".
…ntegration scenario Folds the Codex review on 9803956: the cancel route's in-process fire is fenced by incarnation too (the registry tags each controller), SQLite keeps the legacy rule local to respect its type-only engine boundary, and a runAction scenario in integration-tests joins the checks. Cursor's six editorial nits are recorded verbatim in PLAN -> Notes from review. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HNTQkGXCUryuVD2TEBLi6G


Goal: a cancel lands on exactly the request its owner check read, never on another request that took the id in between, even in the same millisecond, and never misses that request because its own owner's retry rewrote the record, on all four first-party stores, legacy records included.
Both interleaves run through the real route and real store writes; only the timing is forced. Check: route cases in
abort.test.tsplus fence cases in the request-store conformance suite on memory, filesystem, SQLite and Postgres (PGlite). Control: the POC onmain70f777def, which answers 202 on the other tenant's request and 404 on the owner's. Not over HTTP, because the window sits between two store calls inside one handler: SPEC.md.Same route, same interleaves. Today both cells go wrong in opposite directions; the incarnation gets both right.
How: the route passes the incarnation of the record it checked; each store compares it with the stored record's, resolving a legacy record as
legacy_<createdAt>, inside the step that already checks status. No schema change.Sign off
The goal, at that size: both directions, on all four stores, legacy records included. If wrong: a fence that's right for strangers and still tells an owner their running request is gone.
The fence names a request by its incarnation, replacing
createdAtoutright · D1Trade-off figure: D1 in DECISIONS.md.
It comes down to the owner's hand-off: any option still comparing
createdAtanswers 404 there. If wrong: an out-of-tree store author meets a compile error for a window only a same-millisecond reuse opens.Open: none. D1 is the one to weigh. Reasoning and what lost: DECISIONS.md. The cases: BUSINESS-RULES.md.
Reviewers · look here
Not here: other writers that could use the fence (the stale-request sweep, FIX-1128); how the incarnation is minted (FIX-1286).
POC · the createdAt fence on main, both directions
bash specs/issues/FIX-1654/poc/abort-fence-createdat/run.shanswers: does thecreatedAtfence fail onmain? Both cases pinned today's defect on70f777def(202 on another tenant's request; 404 on the owner's running one). Throwaway; excluded from default test and typecheck discovery.Spec · Decisions · Rules · Plan · Docs · Evolution · Linear FIX-1654 · epic FIX-1635 · builds on FIX-1021 and FIX-1286 · 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. 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.BUSINESS-RULES.mdmisses, or a rule that would invalidate the design.DOCS.mdand their fit with the rules; a missing ormisleading lineage claim in conditional
EVOLUTION.md.Out of scope — deliberately unsettled here, and owned by the implementing agent:
PLAN.mdpins on purpose.PLAN.mdleft open on purpose — it is directional by design, and a gap at thataltitude is intended, not an omission.
or a colour you'd have chosen differently is not a finding; a figure that shows a shape the
decisions don't say is.
PLAN.mdmay include a rough pseudocode sketchshowing the shape of the proposed solution. It is knowingly incomplete, is not real code,
and is not what will ship. Review it for directional viability only. Do not report
that it lacks error handling, omits edge cases, names things that don't exist in the repo, or
wouldn't build: all of that is true on purpose.
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
PLAN.md → Notes from reviewfor the implementer to weigh against real code. It will not be argued with, and itwill not be folded into the design prose. Please don't re-raise it: one mention is enough.
The one exception is the sketch and the POC. Line-level feedback on either is dropped, not
recorded — there is nothing for an implementer to weigh about code that isn't shipping. Feedback
about their 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 with Claude Code
https://claude.ai/code/session_01HNTQkGXCUryuVD2TEBLi6G
Generated by Claude Code