docs: agent invocation parity audit 2026-07 + enclave workspace-ops and BYOA SDK designs - #1144
Open
kristofferremback wants to merge 1 commit into
Open
docs: agent invocation parity audit 2026-07 + enclave workspace-ops and BYOA SDK designs#1144kristofferremback wants to merge 1 commit into
kristofferremback wants to merge 1 commit into
Conversation
…nd BYOA SDK designs Re-verifies the agent-runtimes unification matrix against the tree three weeks after Phases 0-2 shipped, audits the 50-commit window for new drift, and adds two committed-shape designs: opt-in workspace read tools for the E2EE enclave (per-stream consent on stream_policies, one generic sealed session callback), and the @threa/bot SDK consolidating the three hand-rolled harness protocol layers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MJU9G8akiwCi4g8KQZeQ2Q
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
Collaborator
Author
|
@coderabbitai review Generated by Claude Code |
|
Action performedReview triggered.
|
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
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.
Problem
docs/plans/agent-runtimes-unification-redesign.mddeclared Phases 0–2 of the Turn Contract complete as of 2026-06-12. Three weeks and ~50 commits later there was no verified answer to: are the three agent surfaces (in-process companion, E2EE enclave, external bot-runtimes) still at parity, what new drift landed, and what do the two known open fronts — workspace tools inside the enclave, and the bring-your-own-agent kit — actually look like against the current tree?Solution
One new doc,
docs/plans/agent-invocation-parity-audit-2026-07.md, in three parts. Produced by a fan-out audit (five per-surface inventory agents, two adversarial verification passes that re-opened every cited file) with the load-bearing claims re-verified by hand before writing.Part 1 — verified state. The unification held: companion and enclave share the loop,
TraceProjector,negotiateCapabilities/stream_policiesgating, turn digests, rolling summary,/fail, and cost recording (each suspected-regression row re-verified with file:line evidence). What remains is enumerated and classified (by-design / drift / new-drift / policy-off):schedule_follow_up(feat(agents): schedule_follow_up tool + follow-up infra (roadmap 1.1) #1138) is companion-only — the first durable-write tool and the template for every roadmap tool after it; the roadmap's per-tool parity policy makes this compound unless PRs must declare an enclave/external story.rebindPiRemoteSessionInstancehardcodesruntimeKind: "pi-local"(bot-runtimes/service.ts:359,368) whilerebindInstancefiltersAND runtime_kind = $kind(repository.ts:540) — aclaude-code-channelsession link 404s on every rebind. Verified by hand.costService/recordUsage/otel on the bot path; complete schemas carry no token field).EXTERNAL_SEALED_DELIVERY = false(negotiate-capabilities.ts:35).apps/enclave/orfeatures/enclave-runtimes/in the window.Also corrects a stale row in the baseline doc (digest injection now ships on both first-party surfaces) and ends with a ranked fix list.
Part 2 — design: opt-in workspace tools for the E2EE enclave. Consent-first per the product ruling (Threa never decides sensitivity; opting in is informed acceptance that queries/results transit the backend in the clear while traces stay sealed). Mechanism: an explicit E2E policy floor at the claim seam (
policy ?? ["web"]— today policy absence means allow-everything, which would silently grant the leak once enclave workspace tools exist), consent via the existingToolPolicyPickerwith an honest-disclosure row, one generic session-token-bound execute callback dispatching to the existing server-side tool registry with an independent server-side re-gate, reads-only (writes 403'd and structurally excluded at assembly), an enumerated leak surface including the log-scrubbing requirement, and a unifiedresolveE2eAgentPolicyresolver so the future BIK-bot sealed flip is the same gate, not a second one. Five-PR shipping plan, safety floor first.Part 3 — design: the
@threa/botSDK. Verdict:extensions/bot-runtime-clientis the hard 25% (socket, hello/cursor, reconnect, lease-safe renew); each harness hand-rolls the rest — three HTTP clients, two disagreeingClaimedInvocationtypes, duplicated claim loops/presence/shutdown. Design:createThreaBot({ token, runtimeKind, capabilities, onTurn })factory + callbacks, renew/presence/error-normalization invisible by default, 9-line echo bot, wire types promoted topackages/types, sealed-readyTurnContextunion, ~1,000–1,300 LOC of duplicated protocol code deleted across pi-remote / claude-code-remote / harness-daemon, npm publish as the trigger for the deferredtaipVersion.Files changed
docs/plans/agent-invocation-parity-audit-2026-07.mdOut of scope (deliberate)
No code changes. The ranked fixes (rebind bug, external
usagefield, enclave follow-up parity, workspace-ops PR1) are follow-up PRs; this doc is the shared baseline for them.Test plan
tsc --noEmitacross all packages/apps, dockerfile-workspace check, migration check (181 clean), OpenAPI spec--checkEXTERNAL_SEALED_DELIVERY=false, absent bot-path cost recording, and policy-absence semantics additionally re-verified by hand in-session🤖 PR by Claude Code
https://claude.ai/code/session_01MJU9G8akiwCi4g8KQZeQ2Q
Generated by Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.