feat(agent-interface): add optional provider observation and interactive-terminal contract (#136) - #158
Merged
Conversation
…ive-terminal contract (#136)
tangletools
approved these changes
Aug 13, 2026
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — a9716922
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: drewstone_author · 2026-08-13T01:26:22Z
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
The neutral
agent-interfaceenvironment contract exposed only coarse capability bits (placement/usage/confidentialbooleans), so a provider had to drop sandbox-SDK methods with no contract slot — identity/placement/resource/billing observation (#136) and terminal/PTY attach (folded-in #138). Braid carries a local adapter to retain data already in the sandbox SDK.Change (contract phase 1 — additive, optional, no breaking change)
environment-observation.ts): normalized provider/session identity, lifecycle, credential-free endpoint location, requested+verified placement, requested+effective CPU/RAM/disk/accelerator, current+peak use, per-execution usage+cost, per-env compute billing, account usage/credits/plan/quota/period. Every payload carries a required freshness discriminator (known/stale/unavailable/redacted/unknown) — a value exists only onknown/stale, so a missing number is never a measured zero.SafeEndpointSchemahas no field for a user/password/token/secret and itssuperRefinerejects a host or scheme that carries embedded credentials.environment-terminal.ts): a provider-neutral optional capability + typed refs (terminal identity, ordered output frames with a replay cursor, input bytes, resize, attach-vs-logical-resume, detach/close acks, parent-execution identity, fail-closed expiry) — distinct from the interactions (question/permission/plan) channel.AgentEnvironmentCapabilities; all surfaces optional so a provider declaring none still validates.Verification
pnpm -r check-typesgreen;check:package-artifacts(26 exports / 52 targets);check:control-artifacts129/129.Scope
Contract only. Provider wiring (a CLI-bridge usage/placement readout and a Tangle terminal bridge to the already-live sandbox transport) is phase 2, the same split used for #146 → #154.
Refs #136