diff --git a/docs/04-runtime-contracts.md b/docs/04-runtime-contracts.md index 555d1c11..35771aa9 100644 --- a/docs/04-runtime-contracts.md +++ b/docs/04-runtime-contracts.md @@ -11,14 +11,14 @@ When a current package blocks a real Braid flow, Braid records the unavailable a ## Evidence baseline The following published versions were resolved in this worktree. -Their installed manifests, declarations, and implementations were inspected directly on 2026-09-24. +Their installed manifests, declarations, and implementations were inspected directly on 2026-09-30. | Package | Installed version | Braid boundary | | --- | ---: | --- | -| [`@tangle-network/agent-interface`](https://github.com/tangle-network/agent-sdk/tree/main/packages/agent-interface) | `2.11.0` | Canonical profile, capabilities, environment, stream, portable context, native continuation, interaction, and explicitly based workspace contracts | +| [`@tangle-network/agent-interface`](https://github.com/tangle-network/agent-sdk/tree/main/packages/agent-interface) | `2.13.1` | Canonical profile, capabilities, environment, stream, portable context, native continuation, interaction, and explicitly based workspace contracts | | [`@tangle-network/agent-runtime`](https://github.com/tangle-network/agent-runtime) | `0.263.0` | Sole execution layer; exact executor, retained-run, interactive-run, environment-provider, and terminal-monitor exports | | [`@tangle-network/agent-eval`](https://github.com/tangle-network/agent-eval) | `0.187.2` | Run records, judges, trace analysts, comparisons, and feedback trajectories | -| `@tangle-network/agent-provider-cli-bridge` | `1.1.0` | CLI Bridge environment adapter with capability discovery, native retained sessions, bounded terminal results, live streaming, replay, retry-safe turns, retained control, exact native session close, durable interaction response, explicit cancel, and host cwd support | +| `@tangle-network/agent-provider-cli-bridge` | `1.1.1` | CLI Bridge environment adapter with capability discovery, native retained sessions, bounded terminal results, live streaming, replay, retry-safe turns, retained control, exact native session close, durable interaction response, explicit cancel, and host cwd support | | `@tangle-network/agent-provider-tangle` | `1.6.0` | Tangle environment adapter over Sandbox, including deployment-gated retained control, interaction response, repository-relative cwd support, workspace branching, and interactive-agent operations | | `@tangle-network/sandbox` | `0.45.0` | Tangle cloud client used by the provider, including keyed checkpoint/fork and interactive-agent operations | @@ -52,7 +52,7 @@ The lockfile pins the registry integrity for every installed package. `pnpm peers check` reports no peer dependency issues for this worktree. -The workspace overrides pin Interface `2.11.0` and Knowledge `17.1.3`. +The workspace overrides pin Interface `2.13.1`, Knowledge `17.1.3`, and Undici `8.11.2`. Historical snapshot: [Agent-runtime issue 803](https://github.com/tangle-network/agent-runtime/issues/803) records the interface peer mismatch fixed in Runtime `0.132.11`. @@ -136,6 +136,10 @@ An `AgentEnvironmentProvider` reports profile, streaming, session, workspace, br An environment can stream or dispatch turns, expose provider sessions, read and write, execute commands, checkpoint, fork, report placement, refresh, and destroy when its adapter implements those operations. +Workspace creation from a checkpoint requires an explicit provider capability and provider support for the field. +Braid currently rejects checkpoint-bearing requests because its request identity and provider dispatch do not preserve the field. +Neither installed provider advertises `create.workspaceCheckpoint`; workspace branching checkpoints remain separate. + An `AgentSession` can report status, replay events, return a result, accept a new prompt, and cancel when implemented. Capabilities are the only supported source for Braid feature availability. diff --git a/package.json b/package.json index 91a53471..f166ba54 100644 --- a/package.json +++ b/package.json @@ -108,8 +108,8 @@ "@earendil-works/pi-tui": "0.84.4", "@napi-rs/keyring": "2.0.0", "@tangle-network/agent-eval": "0.187.2", - "@tangle-network/agent-interface": "2.11.0", - "@tangle-network/agent-provider-cli-bridge": "1.1.0", + "@tangle-network/agent-interface": "2.13.1", + "@tangle-network/agent-provider-cli-bridge": "1.1.1", "@tangle-network/agent-provider-tangle": "1.6.0", "@tangle-network/agent-runtime": "0.263.0", "@tangle-network/sandbox": "0.45.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ef4e0bb3..9d3455a9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,10 +5,10 @@ settings: excludeLinksFromLockfile: false overrides: - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 '@tangle-network/agent-knowledge': 17.1.3 hono: 4.13.5 - undici: 8.10.1 + undici: 8.11.2 importers: @@ -27,17 +27,17 @@ importers: specifier: 0.187.2 version: 0.187.2 '@tangle-network/agent-interface': - specifier: 2.11.0 - version: 2.11.0 + specifier: 2.13.1 + version: 2.13.1 '@tangle-network/agent-provider-cli-bridge': - specifier: 1.1.0 - version: 1.1.0 + specifier: 1.1.1 + version: 1.1.1 '@tangle-network/agent-provider-tangle': specifier: 1.6.0 version: 1.6.0(@tangle-network/sandbox@0.45.0) '@tangle-network/agent-runtime': specifier: 0.263.0 - version: 0.263.0(@tangle-network/agent-eval@0.187.2)(@tangle-network/agent-interface@2.11.0)(@tangle-network/sandbox@0.45.0) + version: 0.263.0(@tangle-network/agent-eval@0.187.2)(@tangle-network/agent-interface@2.13.1)(@tangle-network/sandbox@0.45.0) '@tangle-network/sandbox': specifier: 0.45.0 version: 0.45.0 @@ -522,8 +522,8 @@ packages: engines: {node: '>=20.19.0'} hasBin: true - '@tangle-network/agent-interface@2.11.0': - resolution: {integrity: sha512-rS3MZtRVU8f3gH+b744z/lxSTRqcffuQW5vU3UwYpNk5JRX5so1hcKMj8Rg84Cwus8Ms8+rSivtCbU67E+h2XA==} + '@tangle-network/agent-interface@2.13.1': + resolution: {integrity: sha512-gIuuItox5ZXENrxiq4Hu5TCAKb0ICOmJfw/BqizQjkZop2WtfyvuZBiAROHVNS8T0PsIp202Wph+kaZ5ljYgLQ==} '@tangle-network/agent-knowledge@17.1.3': resolution: {integrity: sha512-jFNbVhGl7QqOOeKqM6GwneyLYmVWsym3MJpvxu2nnaIhK6YmlMH9rdy5GC1xzic3RSJsG3vW8jCU2Fj8TwL45Q==} @@ -531,15 +531,15 @@ packages: hasBin: true peerDependencies: '@tangle-network/agent-eval': '>=0.182.0 <0.188.0' - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 '@tangle-network/agent-profile-materialize@0.20.1': resolution: {integrity: sha512-4HUEowvLtdO+5DHu+lahBOuHi6bCJ+tvccwaxDbcUSfq5l3g2fVAwGyOx3NBm5APKsCkcVIuBTIrwqWQdv2Ayw==} peerDependencies: - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 - '@tangle-network/agent-provider-cli-bridge@1.1.0': - resolution: {integrity: sha512-3yHFMU5nICkFg205prnb7GxKsEdBL6UEDxOJOShryEbq3c6IgxZJqfKzmTZBRclSmFXQP+UdFgW9xKvz6LX3Ow==} + '@tangle-network/agent-provider-cli-bridge@1.1.1': + resolution: {integrity: sha512-SaCgNbR1PM9i0AFQN/5Mw3cPn9ALg3QuvR5OQQirFTFU0ViPkSJaTSv4y4rMgxUoRHjhpyYTua3FJd9DW2a00A==} engines: {node: '>=22.19.0'} '@tangle-network/agent-provider-tangle@1.6.0': @@ -553,7 +553,7 @@ packages: hasBin: true peerDependencies: '@tangle-network/agent-eval': '>=0.185.0 <0.188.0' - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 '@tangle-network/sandbox': '>=0.36.4 <0.48.0 || ^0.49.0-0 || ^0.50.0' '@tangle-network/agent-trace-contract@1.0.2': @@ -891,8 +891,8 @@ packages: undici-types@8.3.0: resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==} - undici@8.10.1: - resolution: {integrity: sha512-YQ3WlbqjYMmNpdvDH64jAgLjxuAR9+649calDWhbshYaeQGO2bR4nI94ORJmwI3J9YhoKQnpyGOK+0zlWS5N5Q==} + undici@8.11.2: + resolution: {integrity: sha512-u4UB2/IrKdU6lFxumHmmo1a3fCQO5tzQllRorfoRS63txhrB7xTpSn1PftwC4qEHkOaqP95fCWW4lJzwErwzhQ==} engines: {node: '>=22.19.0'} yaml@2.9.0: @@ -903,6 +903,9 @@ packages: zod@4.5.4: resolution: {integrity: sha512-sC95tT5iHHH9gtpj6A81kh+NEaRAUFN+qlUPDUbRfOMvNf5QCBqsb3WgvnpVtK5Y+4UfA6KqufotuTvMGiTlsA==} + zod@4.6.5: + resolution: {integrity: sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==} + snapshots: '@asteasolutions/zod-to-openapi@9.1.0(zod@4.5.4)': @@ -1163,7 +1166,7 @@ snapshots: '@tangle-network/agent-core@0.9.6': dependencies: - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 zod: 4.5.4 '@tangle-network/agent-eval@0.187.2': @@ -1171,7 +1174,7 @@ snapshots: '@asteasolutions/zod-to-openapi': 9.1.0(zod@4.5.4) '@hono/node-server': 2.1.1(hono@4.13.5) '@tangle-network/agent-core': 0.9.6 - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 '@tangle-network/agent-trace-contract': 1.0.2 hono: 4.13.5 linear-sum-assignment: 1.0.9 @@ -1181,41 +1184,41 @@ snapshots: transitivePeerDependencies: - '@modelcontextprotocol/sdk' - '@tangle-network/agent-interface@2.11.0': + '@tangle-network/agent-interface@2.13.1': dependencies: '@noble/hashes': 2.4.0 spdx-expression-parse: 5.0.0 - zod: 4.5.4 + zod: 4.6.5 - '@tangle-network/agent-knowledge@17.1.3(@tangle-network/agent-eval@0.187.2)(@tangle-network/agent-interface@2.11.0)': + '@tangle-network/agent-knowledge@17.1.3(@tangle-network/agent-eval@0.187.2)(@tangle-network/agent-interface@2.13.1)': dependencies: '@tangle-network/agent-eval': 0.187.2 - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 '@types/proper-lockfile': 4.1.4 proper-lockfile: 4.1.2 zod: 4.5.4 - '@tangle-network/agent-profile-materialize@0.20.1(@tangle-network/agent-interface@2.11.0)': + '@tangle-network/agent-profile-materialize@0.20.1(@tangle-network/agent-interface@2.13.1)': dependencies: - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 - '@tangle-network/agent-provider-cli-bridge@1.1.0': + '@tangle-network/agent-provider-cli-bridge@1.1.1': dependencies: - '@tangle-network/agent-interface': 2.11.0 - undici: 8.10.1 + '@tangle-network/agent-interface': 2.13.1 + undici: 8.11.2 '@tangle-network/agent-provider-tangle@1.6.0(@tangle-network/sandbox@0.45.0)': dependencies: - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 '@tangle-network/sandbox': 0.45.0 - '@tangle-network/agent-runtime@0.263.0(@tangle-network/agent-eval@0.187.2)(@tangle-network/agent-interface@2.11.0)(@tangle-network/sandbox@0.45.0)': + '@tangle-network/agent-runtime@0.263.0(@tangle-network/agent-eval@0.187.2)(@tangle-network/agent-interface@2.13.1)(@tangle-network/sandbox@0.45.0)': dependencies: '@tangle-network/agent-core': 0.9.6 '@tangle-network/agent-eval': 0.187.2 - '@tangle-network/agent-interface': 2.11.0 - '@tangle-network/agent-knowledge': 17.1.3(@tangle-network/agent-eval@0.187.2)(@tangle-network/agent-interface@2.11.0) - '@tangle-network/agent-profile-materialize': 0.20.1(@tangle-network/agent-interface@2.11.0) + '@tangle-network/agent-interface': 2.13.1 + '@tangle-network/agent-knowledge': 17.1.3(@tangle-network/agent-eval@0.187.2)(@tangle-network/agent-interface@2.13.1) + '@tangle-network/agent-profile-materialize': 0.20.1(@tangle-network/agent-interface@2.13.1) '@tangle-network/agent-trace-contract': 1.0.2 '@tangle-network/sandbox': 0.45.0 tar-stream: 3.2.1 @@ -1230,7 +1233,7 @@ snapshots: '@tangle-network/sandbox@0.45.0': dependencies: '@tangle-network/agent-core': 0.9.6 - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 zod: 4.5.4 '@tangle-network/tcloud-attestation@0.1.1': {} @@ -1544,8 +1547,10 @@ snapshots: undici-types@8.3.0: {} - undici@8.10.1: {} + undici@8.11.2: {} yaml@2.9.0: {} zod@4.5.4: {} + + zod@4.6.5: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 82b61eb7..e03c8130 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,8 +1,8 @@ overrides: - '@tangle-network/agent-interface': 2.11.0 + '@tangle-network/agent-interface': 2.13.1 '@tangle-network/agent-knowledge': 17.1.3 hono: 4.13.5 - undici: 8.10.1 + undici: 8.11.2 allowBuilds: '@dataiku/uv': true better-sqlite3-multiple-ciphers: true @@ -13,10 +13,10 @@ ignoreScripts: false minimumReleaseAgeExclude: - '@tangle-network/agent-runtime@0.126.0 || 0.128.0 || 0.131.0 || 0.131.1 || 0.131.2 || 0.131.3 || 0.131.4 || 0.131.5 || 0.131.6 || 0.131.7 || 0.132.0 || 0.132.4 || 0.132.6 || 0.132.9 || 0.132.10 || 0.132.11 || 0.132.12 || 0.133.6 || 0.134.2 || 0.134.4 || 0.134.5 || 0.134.9 || 0.135.0 || 0.135.3 || 0.142.0 || 0.142.1 || 0.142.3 || 0.143.0 || 0.153.2 || 0.177.0 || 0.178.0 || 0.179.0 || 0.180.0 || 0.182.0 || 0.184.0 || 0.185.0 || 0.185.1 || 0.185.2 || 0.188.0 || 0.189.0 || 0.190.0 || 0.191.0 || 0.192.0 || 0.192.2 || 0.252.1 || 0.262.0 || 0.263.0' - '@tangle-network/agent-eval@0.143.0 || 0.144.0 || 0.144.1 || 0.144.3 || 0.144.4 || 0.144.6 || 0.144.8 || 0.144.10 || 0.144.11 || 0.144.13 || 0.145.0 || 0.145.1 || 0.145.2 || 0.145.3 || 0.145.9 || 0.145.10 || 0.145.11 || 0.145.14 || 0.145.15 || 0.145.21 || 0.149.0 || 0.163.2 || 0.170.0 || 0.171.0 || 0.172.1 || 0.173.0 || 0.173.1 || 0.183.0 || 0.187.2' - - '@tangle-network/agent-interface@0.46.0 || 0.46.1 || 0.47.0 || 0.51.0 || 0.52.0 || 0.53.0 || 0.54.0 || 1.0.0 || 1.1.0 || 1.3.0 || 1.4.0 || 1.7.0 || 1.7.1 || 1.8.0 || 1.9.0 || 2.0.0 || 2.1.0 || 2.1.1 || 2.2.0 || 2.3.0 || 2.11.0' + - '@tangle-network/agent-interface@0.46.0 || 0.46.1 || 0.47.0 || 0.51.0 || 0.52.0 || 0.53.0 || 0.54.0 || 1.0.0 || 1.1.0 || 1.3.0 || 1.4.0 || 1.7.0 || 1.7.1 || 1.8.0 || 1.9.0 || 2.0.0 || 2.1.0 || 2.1.1 || 2.2.0 || 2.3.0 || 2.11.0 || 2.13.1' - '@tangle-network/agent-knowledge@7.0.8 || 7.1.2 || 7.1.3 || 7.2.0 || 7.2.2 || 7.2.3 || 7.2.4 || 7.2.6 || 8.0.0 || 8.0.1 || 8.0.5 || 8.0.10 || 10.7.0 || 10.8.0 || 11.0.0 || 13.0.0 || 13.0.1 || 17.1.0 || 17.1.3' - '@tangle-network/agent-profile-materialize@0.10.2 || 0.13.1 || 0.14.0 || 0.14.2 || 0.15.1 || 0.15.2 || 0.17.1 || 0.18.1 || 0.19.0' - - '@tangle-network/agent-provider-cli-bridge@0.4.2 || 0.4.3 || 0.5.0 || 0.6.0 || 0.6.4 || 0.7.1 || 0.7.2 || 0.7.3 || 0.7.6 || 0.8.0 || 0.8.1 || 0.9.0 || 0.9.2 || 0.9.3 || 0.9.4 || 0.9.5 || 0.9.6 || 0.10.0 || 0.11.0 || 0.11.1 || 1.0.0 || 1.0.3 || 1.1.0' + - '@tangle-network/agent-provider-cli-bridge@0.4.2 || 0.4.3 || 0.5.0 || 0.6.0 || 0.6.4 || 0.7.1 || 0.7.2 || 0.7.3 || 0.7.6 || 0.8.0 || 0.8.1 || 0.9.0 || 0.9.2 || 0.9.3 || 0.9.4 || 0.9.5 || 0.9.6 || 0.10.0 || 0.11.0 || 0.11.1 || 1.0.0 || 1.0.3 || 1.1.0 || 1.1.1' - '@tangle-network/agent-provider-tangle@0.13.0 || 0.13.1 || 0.13.3 || 0.14.0 || 0.14.1 || 0.14.2 || 0.14.3 || 0.14.4 || 1.0.0 || 1.0.1 || 1.0.2 || 1.1.2 || 1.1.3 || 1.1.4 || 1.6.0' - '@tangle-network/sandbox@0.30.1 || 0.31.0 || 0.34.0 || 0.34.3 || 0.34.4 || 0.34.6 || 0.36.1 || 0.36.3 || 0.36.4 || 0.36.5 || 0.37.0 || 0.45.0' - hono@4.13.5 @@ -62,4 +62,4 @@ minimumReleaseAgeExclude: - '@napi-rs/keyring-win32-ia32-msvc@2.0.0' - '@napi-rs/keyring-win32-x64-msvc@2.0.0' - '@napi-rs/keyring@2.0.0' - - undici@8.10.1 + - undici@8.11.2 diff --git a/src/domain/workspace-request.ts b/src/domain/workspace-request.ts index 10d4bb23..ebbd2142 100644 --- a/src/domain/workspace-request.ts +++ b/src/domain/workspace-request.ts @@ -15,6 +15,9 @@ export function snapshotWorkspaceRequest( 'Workspace providerOptions are not persisted; use a provider credential reference', ) } + if (parsed.checkpoint !== undefined) { + throw new Error('Workspace checkpoint restore is not supported by Braid yet') + } if ( parsed.environment === undefined && parsed.image === undefined && @@ -80,6 +83,9 @@ export function workspaceRequestErrorMessage(error: unknown): string { if (/providerOptions are not persisted/iu.test(message)) { return 'providerOptions are not persisted' } + if (/Workspace checkpoint restore is not supported by Braid yet/iu.test(message)) { + return 'starting a workspace from a checkpoint is not supported yet' + } if (/must be a valid URL|Invalid URL/iu.test(message)) return 'repoUrl must be a valid URL' return 'workspace request invalid' } diff --git a/test/workspace-request.test.ts b/test/workspace-request.test.ts index bd9a55ef..9c747b51 100644 --- a/test/workspace-request.test.ts +++ b/test/workspace-request.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import test from 'node:test' -import { defineAgentProfile } from '@tangle-network/agent-interface' +import { defineAgentProfile, WorkspaceRequestSchema } from '@tangle-network/agent-interface' import { exactAdmissionRequestDigest } from '../src/app/run-admission-request.js' import { snapshotRunExecution } from '../src/app/run-execution-snapshot.js' import { retainedExecutionRecoveryContext } from '../src/app/run-recovery-context.js' @@ -70,6 +70,31 @@ test('provider options are never persisted, even when the canonical schema accep ) }) +test('checkpoint restore requests fail closed until a provider supports workspace creation from checkpoints', () => { + const checkpoint = { + checkpointId: 'checkpoint-restore', + provider: 'tangle-sandbox', + source: { + runId: 'run-checkpoint-restore', + provider: 'tangle-sandbox', + environmentId: 'environment-checkpoint-restore', + sessionId: 'session-checkpoint-restore', + executionId: 'execution-checkpoint-restore', + requestDigest: `sha256:${'0'.repeat(64)}`, + }, + idempotencyKey: 'op-workspace-checkpoint', + requestDigest: `sha256:${'0'.repeat(64)}`, + createdAt: '2026-09-30T00:00:00.000Z', + } as const + for (const request of [{ checkpoint }, { environment: 'universal', checkpoint }]) { + assert.equal(WorkspaceRequestSchema.safeParse(request).success, true) + assert.equal( + thrownMessage(request), + 'starting a workspace from a checkpoint is not supported yet', + ) + } +}) + test('canonical workspace validation reports bounded actionable messages', () => { assert.equal(thrownMessage({ gitRef: 'main' }), 'gitRef requires repoUrl') assert.equal(