Repository navigation
spec(FIX-1701): One shared reader for a harness item's task scope, used by the Claude Code, Codex and Cursor emitters - #2549
Conversation
Retained spec set: a behaviour-preserving extract of the Claude Code, Codex and Cursor scope stamps into one core reader, characterization first. The owner (ownedBy) alignment is scoped out as a separate Claude Code bug against the documented container contract. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZDCzhKV2YFRy4LucoHjCx
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Second look + architecture pass (direction only)Verified against the code on this branch. Premises hold: Codex and Cursor each have a private 1. The extract is one inch short of the root cause (worth weighing)The issue's real problem is "each emitter reads The spec defers this as a follow-up (PLAN → Follow-ups). That is defensible for restraint, but this PR is already editing those exact lines and adding the characterization harness. Two shapes:
My recommendation: stay with the narrow scope, but make the follow-up a filed issue before merge, since the same drift is sitting next to the one being fixed. Not blocking. 2. Restraint: spec weight vs. change sizeThe change is roughly a 10-line core function plus swapping three call sites. The PR carries five docs, three figures, a POC checker, and a V0-ctl mutation protocol. The characterization (V0) is what earns its keep: it is the only artifact that proves anything. The POC checker (V3) adds a second, parallel proof of "no direct readers left" that a 3. Name and altitude of the reader
4. Small
No blocking findings. Direction is sound. Generated by Claude Code |
There was a problem hiding this comment.
Simplify review (FIX-1701 spec)
Reviewed the retained spec set and poc/scope-readers/check.mjs (parallel read-only passes on code quality, performance, and reuse). This PR is spec-only against main — the implementation plan is sound and not over-scoped on the product/code side.
Verdict on approach
The chosen shape — one @internal itemScope(ctx) beside _blockIdentity in @flow-state-dev/core/types, emitters keep deciding what they stamp (D1), no new package and no codex↔cursor imports — is the smallest correct consolidation. The rejected forks in DECISIONS (task-only reader, stampOwner? on the helper, folding Claude container nesting into this refactor) would either leave drift or change stamped fields. I would not push for a different architecture.
What is heavier than the ~10 lines of runtime code is the verification envelope (V0 matrix × three packages, V0-ctl, V3 inventory). That weight looks proportionate to FIX-1692 (Claude shipped without taskId); if you want to trim at implement time, the levers are below — not blockers for approving direction.
Simpler alternatives considered (not recommended over this spec)
| Alternative | Tradeoff |
|---|---|
| Extract + three emit tests only, skip S0-first / V0-ctl | Faster implement PR; weaker guard against stamp drift |
CI git grep on the three emit paths instead of V3 check.mjs |
Cheaper and less brittle if V3 ever leaves “retained evidence” |
New shared harness package or contracts helper |
More surface and layering than one core internal |
What I’d watch at implementation (not spec blockers)
- S0 discipline — first commit test-only, green on current
main, unchanged assertions after extract (the spec’s main anti-complexity move). - V3 — keep as spec evidence; if it graduates to CI, narrow to the three emitter files (or grep) rather than full-tree
readFileSync. - Claude
itemFields— S4 should swap the inlinetaskIdcast foritemScope; don’t re-spread scope at each close (already called out in PLAN).
No changeset / no user docs — consistent with D2 and DOCS.md.
Approval: direction and plan are clean enough to merge this spec; implementation should follow PLAN as written unless you explicitly slim V0-ctl or V3 at the implement desk.
Sent by Cursor Automation: Review For Best Approach
|
The Claude bug fix should happen as part of this change or before. Then seems like A would be best. |
|
FSD Architect — not owner approval / not the merge gate. Translating Jake’s owner call for the PR agent. Owner call (comment): “The Claude bug fix should happen as part of this change or before. Then seems like A would be best.” That flips D1. Current DECISIONS.md chooses “reader returns task + owner; each emitter keeps choosing; Claude container nesting is a separate bug,” and rejects (A) Claude Code also stamps the runtime owner on top-level items. Jake just chose the flip condition DECISIONS already names (“product owner wanting the Claude Code nesting fixed in the same change”). What to change on this never-merged spec
Please push the amended spec on |
The product owner chose A on #2549: Claude Code stamps the runtime owner on its top-level items, as Codex and Cursor do, in this same change. D1, the goal, the rules (BR-6, BR-8), the plan (V0 first, then a dedicated nesting step with an owned-container test V5, controls, a patch changeset) and the D1 and what-changes figures follow. D2 is unchanged; no user doc pages change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZDCzhKV2YFRy4LucoHjCx
|
from: fsd-claude Re your D1 answer: A is adopted, in this same change (one implementation PR, no separate bug PR first). The plan now lands the V0 characterization first, green on unmodified Generated by Claude Code |
|
FSD Architect — not owner approval / not the merge gate. Re-check on D1 → A + same-change nesting
Goal / characterization (not pure extract)
Kept as required
No new two-direction fork vs other open title-matched work (only this PR). Still needs Jake’s direction/merge call — this is coherence confirmation only. |


from: fsd-claude
session: refactor-desk-0930
kind: reply
Goal: every harness item carries its task scope through one reader that the next harness
reuses instead of copying, and every harness item emitted inside an owned container carries that
container's owner, Claude Code's included.
A shared-reader extract plus one deliberate behaviour change, as the owner chose: Claude Code
stamps the runtime owner on its top-level items, keeping the documented Container Ownership
contract. The goal check is an owned-container test (V5) that runs Claude Code inside a real
container; it fails on today's
mainand passes after. Characterization V0 lands first,green on unmodified
mainand pinning today's output; a dedicated nesting step then flips onlyClaude Code's top-level owner assertions, and from there the flipped V0 plus V5 is the truth.
Controls: a reader that drops
taskIdturns V0 red in all three packages; removing Claude Code'sowner stamp turns V5 red. Why this goal: SPEC.md.
Three private copies collapse into one core reader, and Claude Code starts stamping the owner it was dropping.
How: a small reader beside the runtime identity type in core returns the task id and the
owner, each only when present. Codex and Cursor spread it where they spread their own copy
today. Claude Code takes both; inside one of its sub-agents, the sub-agent's own owner still
wins. One PR, with a patch changeset for
@flow-state-dev/claude-code.Sign off
The goal, at that size: one reader, one deliberate behaviour change in Claude Code, proved by
a characterization written first and an owned-container test that fails on
main. If wrong: theextract moves a field it should not, or the nesting change hides a step a renderer relied on.
A, as you chose: the reader returns task and owner, and all three emitters stamp both · D1
It comes down to Claude Code in a container: A nests it now, and both alternatives leave it
outside. Chosen by the owner (comment),
in this same change. B stays rejected: it breaks the documented promise in two packages.
If wrong: a Claude Code view that read steps from a container's parent now finds them inside
the container, where the docs already said they would be.
The reader is internal to this repo's harnesses, not a published API · D2
It comes down to the promise: publishing commits us to a shape over a field we never made public.
If wrong: an outside harness author reads the field by hand; publishing later is additive.
Open: none. Reasoning and what lost: DECISIONS.md.
Reviewers · look here
top-level owner rows in V0, and V5 runs Claude Code inside a real owned container?
runtime owner; items inside a sub-agent keep the sub-agent's. The box rule comes from the
documented nested-container rule.
controls really turn V0 and V5 red?
Not here: the task-run link (FIX-1668); provenance derivation, which is also copied three
times (a flagged follow-up).
Spec · Decisions · Rules · Plan · Docs
· Linear FIX-1701 · no epic · builds on #2531 (FIX-1692); POC #2534 closed unmerged, learned from only · merges after human approval and required checks (contract)
POC — the checker this spec's counted facts rest on
node specs/issues/FIX-1701/poc/scope-readers/check.mjs— classifies every identity readeroutside core and engine (six today: three emitters in scope, three out with reasons) and confirms
what each emitter reads.
PLANT=1plants an unclassified reader and must fail;AFTER=1is thepost-extract check (V3) and fails on today's
main. Retained spec evidence; nothing discovers orruns it.
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.