Skip to content

feat(agent-interface): add optional provider observation and interactive-terminal contract (#136) - #158

Merged
drewstone merged 1 commit into
mainfrom
feat/136-observation-terminal-contract
Aug 13, 2026
Merged

feat(agent-interface): add optional provider observation and interactive-terminal contract (#136)#158
drewstone merged 1 commit into
mainfrom
feat/136-observation-terminal-contract

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Problem

The neutral agent-interface environment contract exposed only coarse capability bits (placement/usage/confidential booleans), 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)

  • Observation surface (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 on known/stale, so a missing number is never a measured zero.
  • Credential safety: SafeEndpointSchema has no field for a user/password/token/secret and its superRefine rejects a host or scheme that carries embedded credentials.
  • Interactive terminal (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.
  • New optional capability bits on AgentEnvironmentCapabilities; all surfaces optional so a provider declaring none still validates.

Verification

  • agent-interface 411/411; pnpm -r check-types green; check:package-artifacts (26 exports / 52 targets); check:control-artifacts 129/129.
  • Independent adversarial review confirmed the contract slice is correct; it flagged (as expected) that provider behavior is not implemented — that is the tracked phase 2.

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

@tangletools tangletools 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.

✅ 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

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