Skip to content

docs(lineage): live Claude Code 2.1.259 orchestration capture (parallel, sequential, nested spawns; resumed turns; /compact) - #455

Merged
ScriptedAlchemy merged 6 commits into
mainfrom
docs/claude-live-harness-rerun
Sep 3, 2026
Merged

docs(lineage): live Claude Code 2.1.259 orchestration capture (parallel, sequential, nested spawns; resumed turns; /compact)#455
ScriptedAlchemy merged 6 commits into
mainfrom
docs/claude-live-harness-rerun

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

Maintainer refinement on the live Claude lineage evidence: drive Claude Code's own orchestration surfaces instead of one prompt, so the capture is realistic. Live model (Claude Code 2.1.259, claude-sonnet-5), unmodified harness, isolated home; the real ~/.claude was never written.

  • Harnessprobe:capture <host> --scenario <file.json> takes an ordered prompt list. Claude turns run claude -p --output-format stream-json --verbose; turns after the first --resume the session id the first turn's system/init reported, so one capture is a multi-turn session. Per-turn model streams are saved as session-<stamp>.turn-N.stream.ndjson. Codex/Cursor drivers take the first turn only and refuse longer scenarios. README note added. scenarios/claude-orchestration.json is the checked-in scenario.
  • Capture — four turns in one session 76bb405f…: (1) pwd, dump, two Agent calls in one message (Explore + general-purpose, both backgrounded by the host), then a sequential general-purpose spawn that nested another (depth 2); each subagent ran a shell command and called host-test.dump (+ probe); (2) Skill host-test:host-test at the root, plugin-command probe → NO_PLUGIN_COMMAND (the pack ships no commands/; the skill is its only slash command); (3) /compact as the -p prompt → PreCompact (trigger: manual) / SessionStart source: compact / PostCompact; (4) final stop. Fixtures: fixtures/host-lineage/claude-2.1.259-orchestration.ndjson (141 records: 127 hooks, 14 MCP) + .stream.ndjson (thinned model stream, 202 envelopes, tagged by turn). Same redaction rules as the existing fixtures.
  • Registry verification — new lineage-registry.test.ts case: every one of the 66 child hook payloads resolves to its own agent_id, the right parent (root for the three depth-1 agents, the sequential agent for the nested one) and the root; root-side hooks across resumed turns, the compact pair and the failed tool calls stay depth 0 native; the five probe calls resolve at depths 1, 1, 1, 2, 0 via claudecode/toolUseId; spawn toolCallIds are certain for all four children (the host serialised the parallel pair: SubagentStart before the next Agent PreToolUse) and equal tool_response.agentId and the stream's system/task_started (task_id, tool_use_id, spawn_depth 1/1/1/2, is_backgrounded). No lineage/projection code change was needed.
  • Product defect fixedPostToolUseFailure fired three times, all dump exceeding the runtime's Agent Document node limit ("Agent Document node count exceeds 10000") once the live log held ~180 records; the model recovered with limit. dump now returns the newest 50 records by default (DEFAULT_DUMP_LIMIT), matched still counts the log; route-unit test added.
  • Docs — matrix gets an "orchestration run" subsection (turn table, agent table, findings: serialised parallel spawns, Explore reaches MCP tools, Skill is the only skill trace, PostToolUseFailure fields, SessionStart resume fields, ScheduleWakeup, turn boundaries, stream-vs-hooks incl. depth-2 traffic absent from stream-json), §2/§3/§5/§7/§8 updated (PostToolUseFailure and PreCompact/PostCompact "not observed" corrected; OAuth gap closed — the unmodified harness now signs in; auto-compaction not induced, recorded). Proofs note records the 2.1.259 re-run. Capability table claude-2.1.250.json lineage.* evidence extended; emitted output and adapterRevision unchanged. Changeset: .changeset/claude-orchestration-lineage-evidence.md (patch).

Signed-in proofs (re-run against the harness home, 2.1.259)

Stand-in vs live differences stated

Everything the stand-in claimed still holds (§8). New/corrected by this run: PostToolUseFailure and PreCompact/PostCompact are observed (were "not observed"); two spawns in one message do not produce an uncertain sibling cohort; stream-json gives spawn_depth and task_id↔tool_use_id but omits depth-2 traffic; SessionStart source: resume carries seconds_since_last_response, context_tokens, prompt_cache_likely_expired, estimated_cache_write_usd.

Test plan

  • pnpm lint — 0 errors, 0 warnings
  • pnpm typecheck — clean
  • pnpm test:unit — 3018 passed, 0 failed
  • pnpm docs:site:build — clean
  • rstest lineage-registry.test.ts — 38 passed (new orchestration case included)
  • examples/host-test: pnpm validate, pnpm test (incl. new dump-limit test), pnpm typecheck
  • probe:uninstall claude/tmp/host-test/claude-home and workspace gone; ~/.claude.json has no host-test project entry

Review status

  • Codex reviewed 344d7650d (3 threads: fail-closed resume, site docs in both locales, releasable changeset) — fixed in 8e181ecb4, answered on-thread.
  • Codex reviewed 8e181ecb4 (3 threads: refuse --scripted-model + --scenario, document the dump default limit in both locales, correct the per-turn Stop claim) — fixed in c1b5cf25e (rebased onto main at feat(lineage): request.lineage is the only identity-adjacent surface; scoped, self-correcting Cursor child binding #444/fix(plugin): point Claude plugin.json at hooks/hooks.json so Cursor wrappers are not loaded #450; matrix and Claude capability-table conflicts resolved by merging both sides), answered on-thread.
  • Codex reviewed c1b5cf25e (3 P2 threads: value flags need a value, keep completed turns when a later turn times out, docs say multi-turn is Claude-only) — fixed in 931770b43, answered on-thread.
  • Codex reviewed 931770b43 (2 P2 threads: refuse --prompt together with --scenario, keep the 2.1.257 payload excerpts under the 2.1.257 heading) — fixed in 60f29cdda, answered on-thread.
  • Codex reviewed 60f29cdda (1 P2 thread: value flags must accept option-like values) — fixed in 96df81f64, answered on-thread.
  • Codex reviewed 96df81f64 (current head): "Didn't find any major issues" (2026-09-03T23:20Z). No unreviewed commits.
  • Release gates on c1b5cf25e failed only in npm audit (audit endpoint returned an error … Service Unavailable), an npm registry outage unrelated to this PR; re-run on the new head.
  • Verify (Node 24) on 96df81f64 failed only in packages/workbench/tests/mcp-app-preview-browser.test.ts ("retains a failed runtime lifecycle tombstone…", bootstrapRequests saw one /runtime-bootstrap instead of two) — a Workbench browser-timing flake in a package this PR does not touch (968/969 passed); failed job re-run.

Note for the hook_event_name lane

The live 2.1.259 capture confirms Claude delivers hook_event_name in PascalCase (PreToolUse, PostToolUse, PostToolUseFailure, SubagentStart, SessionStart, PreCompact, …) on all 127 hook payloads in fixtures/host-lineage/claude-2.1.259-orchestration.ndjson; every one mapped to a canonical event (provenance.nativeEvent keeps the PascalCase name). No casing change is made in this PR.

@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 96df81f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T23:20:13.034214Z 96df81f Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 344d7650d2

ℹ️ 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".

Comment thread examples/host-test/scripts/probe.mjs Outdated
Comment thread examples/host-test/scripts/probe.mjs Outdated
Comment thread .changeset/claude-orchestration-lineage-evidence.md Outdated
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

CI never picked up the open event for 344d765 (zero check runs after 7 minutes); closing and reopening to fire pull_request: reopened. No content change.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Heads-up from the queue worker: GitHub is not creating any workflow runs for this PR (0 check runs on 344d765 and 8e181ec) because the PR is CONFLICTING against mainpull_request workflows never start when the merge ref cannot be computed. Conflicts are in docs/audits/2026-09-03-host-lineage-matrix.md and packages/agent-bundle/src/adapters/capabilities/claude-2.1.250.json (from #444 and #450). A rebase onto main will unblock CI. I will not touch the branch while the lane is active; if it goes quiet I will do the rebase.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e181ecb41

ℹ️ 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".

Comment thread examples/host-test/scripts/probe.mjs
Comment thread examples/host-test/src/mcp/host-test/tools/dump.tsx
Comment thread examples/host-test/README.md Outdated
…lel, sequential and nested spawns, resumed turns, manual compact

- examples/host-test probe:capture: --scenario <file.json> ordered prompt list;
  Claude turns run claude -p --output-format stream-json --verbose and resume
  the first turn's session_id; per-turn stream transcripts saved; README note.
- scenarios/claude-orchestration.json: two parallel Agent spawns (Explore +
  general-purpose), one sequential spawn nesting another, the host-test skill,
  a plugin-command probe, /compact, a final stop.
- fixtures/host-lineage/claude-2.1.259-orchestration{,.stream}.ndjson: 141
  redacted records (127 hooks, 14 MCP) plus the thinned model stream.
- lineage-registry.test.ts: replay the orchestration fixture; every child
  event resolves to its agent, parent and root (depth 1 and 2); spawn claims
  cross-checked against tool_response.agentId and the stream's task_started.
- host-test dump tool: DEFAULT_DUMP_LIMIT=50 newest records unless limit is
  given (a bare dump over ~180 records exceeded the Agent Document node limit,
  PostToolUseFailure live); route-unit test.
- Matrix, proofs note and claude-2.1.250.json lineage evidence updated
  (PostToolUseFailure and PreCompact/PostCompact now observed; stream-json
  shows depth-1 children only). adapterRevision unchanged.
…document Host Test on the examples pages; releasable changeset
…mp's default limit (README, site en/zh); describe Stop as prompt-path dependent
@ScriptedAlchemy
ScriptedAlchemy force-pushed the docs/claude-live-harness-rerun branch from 8e181ec to c1b5cf2 Compare September 3, 2026 22:34
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@pkg-pr-new

pkg-pr-new Bot commented Sep 3, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@455
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@455
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@455

commit: 96df81f

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c1b5cf25e6

ℹ️ 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".

Comment thread examples/host-test/scripts/probe.mjs Outdated
Comment thread examples/host-test/scripts/probe.mjs Outdated
Comment thread website/docs/en/examples/index.mdx Outdated
…r turn times out; site docs say multi-turn scenarios are Claude-only
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 931770b437

ℹ️ 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".

Comment thread examples/host-test/scripts/probe.mjs
Comment thread docs/audits/2026-09-03-host-lineage-matrix.md
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60f29cddac

ℹ️ 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".

Comment thread examples/host-test/scripts/probe.mjs Outdated
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 96df81f643

ℹ️ 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".

@ScriptedAlchemy
ScriptedAlchemy merged commit d9e4589 into main Sep 3, 2026
20 of 21 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the docs/claude-live-harness-rerun branch September 3, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant