Repository navigation
POC: stamp Claude Code's item owner once in itemFields - #2570
Closed
cursor[bot] wants to merge 8 commits into
Closed
cursor[bot] wants to merge 8 commits into
cursor[bot] wants to merge 8 commits into
Conversation
…X-1701 S0) Pins which of taskId and ownedBy each emitted item version carries, by key presence and value, across the identity matrix (none, task only, owner only, task and owner, empty-string task), on every item kind and close path of the Claude Code, Codex and Cursor emitters. Test-only, green on unmodified source, including Claude Code's current missing top-level and sub-agent-box owner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZDCzhKV2YFRy4LucoHjCx
…iner (FIX-1701 S1) Claude Code stamped no ownedBy on its top-level items or its sub-agent container items, so a run inside a container showed its steps outside it, breaking the documented Container Ownership contract that Codex and Cursor keep. Every top-level item and sub-agent box now carries the runtime owner; items inside a sub-agent keep the sub-agent's owner (subAgentOwner ?? runtimeOwner, decided at the call site). Presence is `!== undefined`. Flips only the characterization's Claude Code top-level and sub-agent-box owner rows, and adds the owned-container test that drives claudeCodeAgent through a real sequencer declaring a container (red on main, green now). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZDCzhKV2YFRy4LucoHjCx
…cope (FIX-1701 S2)
itemScope(ctx) returns { taskId?, ownedBy? } off the runtime identity, each
key present only when the identity defines it (!== undefined). Marked
@internal and exported through @flow-state-dev/core/types beside asRuntime;
not re-exported from the package root.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ZDCzhKV2YFRy4LucoHjCx
…701 S3) Removes the private deriveScope reader and its EmitScope type; every former use spreads itemScope(ctx). Stamped output unchanged (V0 untouched). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZDCzhKV2YFRy4LucoHjCx
…1701 S4) Removes the private deriveScope reader and its EmitScope type; every former use spreads itemScope(ctx). Stamped output unchanged (V0 untouched). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZDCzhKV2YFRy4LucoHjCx
…(FIX-1701 S5) The shared item stamp reads the task id, and the owner precedence reads the runtime owner, through itemScope(ctx) instead of casting the identity inline. Pure refactor against S1's behaviour (V0 and V5 untouched). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZDCzhKV2YFRy4LucoHjCx
…ting (FIX-1701 S6) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZDCzhKV2YFRy4LucoHjCx
The runtime owner belongs on the shared item stamp. A passed owner replaces it for a sub-agent or a close that kept the open's owner. Co-authored-by: Jake Hoffner <jhoffner@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Collaborator
|
Closing unmerged: POC shape sketch for #2569, which has merged. Branch left in place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I subtracted. Claude Code was still deciding
ownedByat every emit site: fourteen...(ownedBy !== undefined ? { ownedBy } : {})spreads, plus four extraitemScope(ctx).ownedByreads for the sub-agent box, its close, the error item, and finalize.itemFields/buildBasenow stampitemScope(task and runtime owner). A caller passes an owner only to replace that: a sub-agent id, or the owner the open stored so the close keeps it. Sub-agent boxes, errors, and their closes take the runtime owner with no extra line. Net −17 lines inpackages/claude-code/src/sdk/emit.ts. Codex, Cursor, and core are untouched.What still passes.
pnpm --filter @flow-state-dev/claude-code test— 8 files, 271 tests, including the scope characterization and the owned-container agent check. Same contract: sub-agent owner wins inside a sub-agent, everything else carries the runtime owner, an absent owner is omitted.This PR does not merge. It is a shape sketch for #2569. Fold the subtraction there, then close this unmerged.