Skip to content

id-shell contract revision 11: agent profile — region subscriptions, semantic diffs, stale-decision token (#7913) - #11302

Merged
dezren39 merged 3 commits into
mainfrom
queue/20044-7913-agent-shell-profile
Nov 17, 2026
Merged

dezren39 merged 3 commits into
mainfrom
queue/20044-7913-agent-shell-profile

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Implements #7913 (spike 1/5 for #6300): the agent shell profile in the id-shell contract, per design doc/2026-11-09_design_id6300_agents_in_worlds_v1.md sections 4.2, 4.3, 8, 9.1 (PR #7911).

Contract (additive revision 10 -> 11)

  • join gains the agent_profile capability flag: a shell that sets it advertises it can consume semantic diffs.
  • New client frame screen_subscribe (ephemeral, joined): a screen region and/or semantic event classes (chat_posted, input_applied, object_changed, system_event, program_changed; empty list = all, absent = none).
  • New server frames semantic_diff (ephemeral) and screen_subscription (reply, echoes the active subscription + current screen revision).
  • Agent input frames (input, chat, paste, form_result, pointer) gain the optional screen_revision stale-decision token.
  • features.agent_profile documents the profile, including the reduced-fidelity rule: a host without the revision serves an agent full view frames with identical authority.

Host (id-worlds)

  • Join threads agent_profile into the session's view state; authority is unchanged.
  • screen_subscribe is validated (region bounds, known classes, at least one of region/classes, agent flag required), recorded connection-locally, and answered with screen_subscription.
  • Subscribed event classes arrive as semantic_diff frames in world terms (chat text, object ref, program hash — never raw input bytes, system payloads, or seeds).
  • Region subscribers get region_changed diffs computed in send_view against the last screen the session received, scoped to the subscribed rows/columns.
  • Stale-decision gate: an input whose screen_revision is not the session's current screen revision is rejected before dispatch with an error frame (code stale_decision), commits nothing, and the current view follows.

Native shell (id-native-shell)

  • Builders: agent_join_frame, screen_subscribe_frame, input_frame_with_revision.
  • SessionState folds semantic_diff / screen_subscription frames; semantic_diff_text renders diffs as world-term lines.

Conformance (design section 8 cases for this spike)

  • Contract parity + transcript tests (shell_contract): agent-profile session conforms; subscription is joined-only; a diff may not leak a seed.
  • Live host tests (world_session contract_tests): scoped diffs delivered, unsubscribed classes and region-only subscriptions leak nothing, stale input rejected with no commit, current input commits exactly one event, human sessions get no agent frames.
  • Region scoping + subscription scoping unit oracles (view.rs); native-shell transcript conformance + semantic-diff rendering test.

Also fixes the pre-existing main breakage filed as #11277 (id-worlds did not compile at e5eab19: revision-10 Pointer/Hover dispatch missing, E0004 x2 — proven on a clean worktree; plus two test-build import/shadowing errors behind it). Interim dispatch: hover = ephemeral no-op, pointer = explicit input_refused/unknown_or_unsupported_event until #1831 routing lands; the journal-boundary test's pointer expectation is written ahead of that routing and stays red for #1831.

Queue: task 20044, lane any-e.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…semantic diffs, stale-decision token (#7913)

Additive revision per design doc/2026-11-09_design_id6300_agents_in_worlds_v1.md sections 4.2/4.3/8/9.1: join agent_profile capability flag, screen_subscribe client frame, semantic_diff + screen_subscription server frames, screen_revision stale-decision token on agent input frames with host-side rejection (error code stale_decision, no commit, current view follows). Host: id-worlds world_session (join threading, subscription validation + ack, event diffs scoped by class, region diffs in send_view). Native shell: builders + SessionState folding + semantic_diff_text rendering. Conformance: contract parity/transcript tests, live host contract tests, view region/scoping oracles, native-shell transcript test.

Also fixes #11277 (pre-existing, proven on clean e5eab19): revision-10 Pointer/Hover variants had no dispatch arms (E0004 x2, crate did not compile), plus E0618 in shell_contract pointer test and missing world_caps imports in actor device_info/form test modules. Interim pointer dispatch is an explicit input_refused/unknown_or_unsupported_event; hover is an ephemeral no-op; real pointer routing remains #1831 follow-up work.
@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 13:08
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T13:08:44.999877Z
We couldn’t complete this review. Comment @codex review to try again.
c167ac1 PR opened
ℹ️ 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

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.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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

…t-shell-profile

# Conflicts:
#	pkgs/id/crates/id-worlds/src/shell_contract/tests.rs
…ttern

Main's pointer handler (#1831 S2) destructured every Pointer field;
revision 11 adds screen_revision, which is checked before dispatch and
is not part of the journaled input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 merged commit 1e681d2 into main Nov 17, 2026
1 check passed
@dezren39
dezren39 deleted the queue/20044-7913-agent-shell-profile branch November 17, 2026 22:14
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.

2 participants