Skip to content

feat(lineage): host-test probe, live host lineage matrix, and runtime-held request.lineage - #421

Merged
ScriptedAlchemy merged 20 commits into
mainfrom
feat/host-test-lineage
Sep 3, 2026
Merged

feat(lineage): host-test probe, live host lineage matrix, and runtime-held request.lineage#421
ScriptedAlchemy merged 20 commits into
mainfrom
feat/host-test-lineage

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • examples/host-test — a probe plugin covering every canonical event family (targets restricted per pinned capability table), a generated host-test MCP server (dump/reset), a hand-rolled host-test-raw server that records the raw MCP request envelope, a rendered host-test dump CLI, and scripted probe:install|capture|uninstall <host> into isolated homes (/tmp/host-test/<host>-home) that never touch ~/.claude, ~/.codex, or ~/.cursor. probe:capture claude --scripted-model drives the real Claude Code binary against a checked-in scripted Messages API so Claude captures need no account.
  • Evidencedocs/audits/2026-09-03-host-lineage-matrix.md with redacted captures under fixtures/host-lineage/ from live Claude Code 2.1.257, Codex 0.147.0 (gpt-5.6-sol), and Cursor 3.18.25 desktop (isolated Xvfb instance driven over CDP), each with a subagent and a nested subagent. Answers the maintainer's question per host: who can see children / parents / roots, which id a subagent's events carry, hook↔MCP ordering and what _meta carries, and hook-process env names.
  • request.lineage on AgentRequestContext everywhere (events, generated MCP tools, routed CLI, rendered scripts): { conversation, root, parent?, depth, generation?, subagent?, resolution }, resolved by a new runtime-held agent lineage registry (@agent-bundle/runtime/lineage) journaled through the state kernel beside project state (durable only where the project already has workspace-durable state; process-lifetime otherwise), fed by agent/start, agent/stop, tool/before, tool/after. MCP calls correlate via Claude claudecode/toolUseId, Codex x-codex-turn-metadata (native parent/root), or Cursor's open MCP:<tool> pre-tool hook. Typed unavailability: no-subagent-events, id-not-resolvable, cloud-agent-no-user-hooks, no-shared-runtime, unsupported-surface, not-provided.
  • Dated lineage capability rows in all four host tables; Workbench Lifecycles shows the lineage axis and a root→parent→request chain; openInMemoryMcpServer({ lineage, lineageHost }) for projection tests.
  • Bug found by the probe: Claude Code 2.1.257 delivers an MCP tool's PostToolUse tool_response as a plain string; the pinned validator rejected every such event (tool_response must be an object). Presence is now the only host-independent rule (as on Codex).

Evidence

  • Live replay through the built artifact (examples/host-test, Claude scripted-model capture, reinstalled probe): every hook and dump call resolves depth 0/1/2 with correct parents; probe:capture output is in the matrix's §6.
  • fixtures/host-lineage/*.ndjson replayed by packages/rsc-runtime/tests/lineage-registry.test.ts (6 tests) and the in-memory MCP correlation ordering test packages/agent-bundle/tests/projection/mcp-lineage.test.ts.
  • Not exercised: Cursor CLI (cursor-agent status → not logged in); Claude session used a scripted model because this machine has no signed-in Claude account (host plumbing is real).

Test plan

  • pnpm typecheck, pnpm lint
  • pnpm test:unit (only pre-existing native-claude-contract 5 s timeout flake on the loaded machine, fails identically on the baseline)
  • pnpm test:route-unit, pnpm test:projection
  • pnpm build && pnpm test:integration:run (failing files rerun green in isolation after the durable-gating fix; full rerun in progress)
  • pnpm examples:check
  • examples/host-test probe:install/capture/uninstall on claude (scripted model), codex (live), cursor (isolated IDE)

Review status

  • Codex (chatgpt-codex-connector) last reviewed head 0cb78d06bd (pre-rebase). Its content is the commits feat(lineage): add examples/host-test probe… through fix(host-test): allowlist the probe host environment… on the current history. Every thread it left (11 rounds, 40+ threads) is fixed and resolved with a reply naming the fixing commit.
  • After that head the reviewer returned "You have reached your Codex usage limits for code reviews" for every @codex review (14:58, 15:27, 15:4x, 16:0x UTC), so the following commits on the current head are not reviewer-covered and merge on CI green per the lane rule — request a follow-up Codex review of the squash commit when credits return:
    • fix(lineage): record every applied journal key in the replay ledger… — fixes the reviewer's own last thread; test fails without it
    • test(build): refresh the Flight worker source hash after rebasing onto main
    • fix(build): pass notice delivery and lineage through the generated MCP server together after rebasing onto main — rebase conflict resolution (settled/afterRender + RegisterGeneratedRoutesOptions, teardown order host → lineage journal → transport)
    • build(docs): resolve @agent-bundle/runtime/lineage from source in the TypeDoc program
    • test(build): a durable project without resources/updated still journals lineage through sqlite — asserts the notice runtime (not the sqlite driver) is absent when mcp-resource-updated is unavailable

@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cdb5b31

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

This PR includes changesets to release 2 packages
Name Type
@agent-bundle/runtime Patch
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

@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-03T14:22:42.576618Z 0cb78d0 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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 3, 2026

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

commit: cdb5b31

@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: 87c270f30d

ℹ️ 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 packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread .changeset/request-lineage.md Outdated
Comment thread .gitignore Outdated
@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: bce5d1ffe1

ℹ️ 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 packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread examples/host-test/src/capture.ts Outdated
Comment thread examples/host-test/scripts/probe.mjs
@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: 340c61d7f5

ℹ️ 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 packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/state.ts
@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: d68ad646cc

ℹ️ 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 packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/agent-request.ts
@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: 8d8e09650e

ℹ️ 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 packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts
@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: 16ef19faeb

ℹ️ 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 packages/agent-bundle/src/build/entry-shell.ts
Comment thread packages/rsc-runtime/src/lineage/registry.ts
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
@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: bab2ddc71f

ℹ️ 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 packages/rsc-runtime/src/lineage/registry.ts
Comment thread packages/rsc-runtime/src/lineage/state.ts
@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: 6297b5c636

ℹ️ 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 packages/rsc-runtime/src/lineage/registry.ts
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/agent-bundle/src/adapters/hook-contract.ts
@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: 9f8939392e

ℹ️ 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 packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts
Comment thread examples/host-test/src/capture.ts
@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: ea13811ac2

ℹ️ 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 packages/rsc-runtime/src/lineage/registry.ts Outdated
Comment thread packages/rsc-runtime/src/lineage/registry.ts Outdated
@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: f757ade976

ℹ️ 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
@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: 0cb78d06bd

ℹ️ 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 packages/rsc-runtime/src/lineage/registry.ts
…n on a cold session/end, release a retired root's correlation windows (review)
…ed Claude ids as misses, dedupe storeless redeliveries (review)
…ecord windows only for placeable carriers (review)
…ads, stay in memory after a durable commit failure, retire the journal from standalone session/end (review)
…tive spawn spellings; probe redacts Basic/cookie/header credentials (review)
…, remember start identities past node pruning (review)
…o degradation keeps suppressing redeliveries (review)
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@ScriptedAlchemy
ScriptedAlchemy merged commit 21af4ce into main Sep 3, 2026
13 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the feat/host-test-lineage branch September 3, 2026 16:16
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Review-status tracking (final sweep, 2026-09-03 16:37 UTC): @codex review re-requested for the merged head; the connector answered usage limits reached (also at 15:51 and 16:02 UTC). Last Codex-reviewed commit: 0cb78d06bd (14:22 UTC, pre-rebase). The branch was then rebased, so every commit in the merged series is a new SHA — unreviewed: the post-0cb78d06bd fixes now carried as 45d421aef5, b5f362b357, 369f0ca84a, cdb5b31032 (head) plus the rebased earlier commits, and the squash merge 21af4ce23d. Re-request once credits return; no thread on this PR awaits a reply.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

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