GeezerVison is showing github.com — id(phase-14): spike step 5/5 — program.invoke through the policy point + scripted spike run by dezren39 · Pull Request #13236 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Spike step 5/5 for the id phase-14 spike (#6300): bounded program interaction, exercised end to end by a scripted spike run.
What lands
program.invoke joins the bridge's v1 tool surface (id_caps::mcp_bridge, now eight tools): one call becomes exactly one input frame carrying the invocation's argument payload as the program's participant input, plus the caller's screen_revision when given. Program and object names are validated for presence only — the allowlist decision stays at the policy point, and the audit event takes the program name from the same arguments.
- The policy point admits it (
id_caps::mcp_policy): the step-4 boundary ("every program.invoke is refused until the interaction lands") is replaced — the ceiling allowlist is checked, the program axis of the quota is charged before execution, and the invocation is audited like every other action.
- The scripted spike run (
pkgs/id/tests/mcp_spike_e2e.rs): an agent joins a local tic-tac-toe world over iroh, driven entirely through the policy point — join, screen reads, subscribe, chat with a second participant, one ceiling-refused invoke of an unlisted program, one admitted invoke of the named program on the named object, the result read back as a semantic diff (input_applied, board ----X----), leave. Oracles: the signed audit chain (nine events in script order, one refusal, chain verifies), the owner summary (9 actions / 8 executed / 1 refusal; spend frames 4, tool calls 7, program invocations 1), and the host journal exported through the fixture recorder (chats at sequences 2 and 3, the invocation's input at sequence 4).
Finding recorded in the test
A commit's frames are generated together but their wire order is not contractual: a re-rendered view can land behind the semantic diff. A driver that takes the screen_revision token from a partially drained stream can lag the host's current revision by exactly that trailing view, and the stale-decision gate refuses the invoke (observed live: stale decision: input was decided against screen revision 0, current is 1). The spike driver drains its own chat to quiescence before taking the token; the helper's doc comment carries the reasoning.
Verification
Laptop route (nix develop in pkgs/id) — the fleet-build dispatch container cannot run these suites (the #13159-family environment gaps), so the laptop is the verifying route:
Closes #7917
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-23T11:52:09Z",
"session_id": null,
"lane": null,
"host": "amd",
"worktree": "/home/user/wt-lane-rv-7917",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/user/wt-lane-rv-7917",
"repo": "developing-today/code",
"branch": "lane-rv-7917",
"sha": "2504b765c79f8dca1bfefa2a0084e0c79519adaa"
},
"auth_subject": "oc-code-05",
"stamped_by": "fleet 0.1.0 (native)"
}
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…t + scripted spike run
The bridge gains the eighth v1 tool, program.invoke: one call
becomes exactly one input frame carrying the invocation's argument
payload (and the caller's screen_revision when given); the program
and object names are validated for presence only — the allowlist
decision stays at the policy point, which now charges admitted
invocations on the program axis instead of refusing the tool
outright (the step-4 boundary this step was gated on).
pkgs/id/tests/mcp_spike_e2e.rs is the scripted spike run for #7917:
an agent joins a local tic-tac-toe world over iroh through the
policy point, reads screens, exchanges chat with a second
participant, is refused for an unlisted program, invokes the named
program once, reads the result back as a semantic diff, and leaves.
The oracles are the signed audit chain (one event per action, in
order, chain verifies), the owner summary and spend, and the host
journal exported through the fixture recorder.
Driver note recorded in the test: a commit's frames are generated
together but their wire order is not contractual — a re-rendered
view can land behind the semantic diff — so the run drains its own
chat to quiescence before taking the screen revision the invoke is
decided against; without that, the host's stale-decision gate
refuses the invoke (observed: "decided against screen revision 0,
current is 1").
Verification (laptop, nix develop in pkgs/id): cargo test -p
id-caps --lib 251/251; id-caps integration suites 13/13 + 3/3;
cargo test --test mcp_spike_e2e green 4 consecutive runs;
--test mcp_bridge_e2e 1/1; the shell + agent-profile conformance
suite (cargo test -p id-worlds shell_contract) 20/20.
coderabbitai
Bot
commented
Nov 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 34 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5c89cb77-7ed9-4e93-aa61-8e7205503be4
Commits
-
Reviewing files that changed from the base of the PR and between 14ee2ad and 22b0031.
Files selected for processing: 4
-
pkgs/id/crates/id-caps/src/mcp_bridge.rs
pkgs/id/crates/id-caps/src/mcp_policy.rs
pkgs/id/crates/id-caps/tests/mcp_bridge_surface.rs
pkgs/id/tests/mcp_spike_e2e.rs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-23T12:00:36.183534Z |
22b0031 |
New commits |
ℹ️ 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
# Conflicts:
# pkgs/id/crates/id-caps/src/mcp_policy.rs
There was a problem hiding this comment.
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: 2504b765c7
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+491
to
+494
|
|
let mut frame = serde_json::json!({
|
|
|
"type": "input",
|
|
|
"data_hex": hex_encode(payload.as_bytes()),
|
|
|
});
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bind the approved program and object to the dispatched input
When the connected world's installed program differs from the allowlisted name supplied by the caller, this frame still executes input against the installed program: it discards both program and object. The host dispatch in world_session/mod.rs:1863–1867 calls input_from_session, and world/actor.rs:1372–1375 invokes self.program.update without checking either requested identity. Thus a grant allowing only scorekeeper can drive tic-tac-toe by labeling the call scorekeeper, while the audit records that label rather than the actual target. Bind the checked program and object to the actual execution target, or reject mismatches before producing the frame.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+495
to
+499
|
|
if let Some(revision) = arguments
|
|
|
.get("screen_revision")
|
|
|
.and_then(serde_json::Value::as_u64)
|
|
|
{
|
|
|
frame["screen_revision"] = serde_json::json!(revision);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Require a valid screen revision for program invocations
An agent can omit screen_revision, or supply a non-integer value, and this invocation is still emitted without a stale-decision token. PolicySession::act checks freshness only when as_u64() succeeds, and the host's gate in world_session/mod.rs likewise skips inputs without a token, so the mutation executes even when the agent's observed screen is outdated. This bypasses the agent-specific guardrail required by design §4.3. Require a valid revision for program.invoke and reject missing or malformed tokens; ordinary human input can retain its existing optional-token behavior.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+169
to
+173
|
|
let frame = match tokio::time::timeout(
|
|
|
Duration::from_millis(500),
|
|
|
self.client.as_mut().unwrap().recv_json(),
|
|
|
)
|
|
|
.await
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve pending frame reads across the idle timeout
If the 500 ms timeout expires after part of a frame has been consumed, dropping recv_json() loses that partial read and corrupts subsequent framing. WorldClient::recv_json delegates to id-core/src/frames.rs::read_frame, which explicitly documents that it is not cancel-safe and stores the length prefix and body in local buffers. Under delayed delivery or a loaded test runner, the next receive can interpret the remaining body bytes as a new length prefix, causing this end-to-end test to fail despite correct host behavior. Keep the receive running across idle checks, for example in a dedicated reader task that forwards complete frames through a channel.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 23, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|