diff --git a/CLAUDE.md b/CLAUDE.md index 6a302ca9..c710f10e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -74,7 +74,7 @@ Headline entrypoints: `runAgentTask`/`runAgentTaskStream` (`src/run.ts`), the mu ## Commands -- `pnpm run lint` (Biome — **not** `npx biome`), `pnpm run build`, `pnpm test`, `pnpm run typecheck`. Tests live next to code and under `tests/`; the loops kernel is covered by `tests/loops/`. +- `pnpm run lint` (Biome — **not** `npx biome`), `pnpm run build`, `pnpm test`, `pnpm run typecheck`. Tests live next to code and under `tests/`; the execution kernel is covered by `tests/kernel/`. - **Publish gotcha (Tangle obfuscate step):** never give a module-global `const` an UPPERCASE-prefixed name — the obfuscator (`--rename-globals false`) trips `pnpm pack`/verify-dist on a banned UPPERCASE pattern. (e.g. `SIDECAR_PERMISSION_KEYS` → `CANONICAL_PERMISSION_KEYS`.) Lowercase or rename module-globals. - Verify with the dedicated tools (Edit/Read errors if a change failed) — don't re-read files just to confirm an edit landed. diff --git a/README.md b/README.md index a48be4c8..c3729c6e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ That file defines the scripted `worker`, `output`, and `validator` used below so Replace the scripted worker with a sandbox, CLI bridge, or router backend without changing the driver. ```ts -import { inProcessSandboxClient, runAgentRounds } from '@tangle-network/agent-runtime/loops' +import { inProcessSandboxClient, runAgentRounds } from '@tangle-network/agent-runtime/kernel' const result = await runAgentRounds({ task: { prompt: 'Write a one-line release note for one-click restore.' }, @@ -113,7 +113,7 @@ For a repeated initial dispatch, reuse both `sessionId` and `turnId`; `execution One supervisor spawns and steers workers toward a goal. Where the workers run (an in-process loop, or a sandboxed coding harness) is one data value; the budget, journaling, and stopping are handled for you. ```ts -import { supervise } from '@tangle-network/agent-runtime/loops' +import { supervise } from '@tangle-network/agent-runtime/kernel' const result = await supervise( { name: 'supervisor', harness: null, systemPrompt: 'Delegate to workers; do not solve the task yourself.' }, @@ -434,11 +434,11 @@ The general-purpose pieces, by import path. Every export with its one-line summa | Primitive | What it does | Import | |---|---|---| -| Chat-turn runtime | Stream and persist one production chat turn (`handleChatTurn`); derive its stable execution and turn identity (`deriveExecutionId`); normalize any backend's stream into one event shape (`streamAgentTurn`) | `/durable` · `/loops` | -| Supervision | One agent spawns, budgets, and steers workers toward a goal (`supervise`, `delegate`), on an in-process loop or a sandboxed coding harness | `/loops` · `/mcp` | -| Loop kernel + combinators | Write a driver (`plan`/`decide`) and run it (`runAgentRounds`), or compose fixed shapes: refine (`loopUntil`), best-of-N (`fanout`), chain (`pipeline`), multi-judge (`panel`) | `/loops` | +| Chat-turn runtime | Stream and persist one production chat turn (`handleChatTurn`); derive its stable execution and turn identity (`deriveExecutionId`); normalize any backend's stream into one event shape (`streamAgentTurn`) | `/durable` · `/kernel` | +| Supervision | One agent spawns, budgets, and steers workers toward a goal (`supervise`, `delegate`), on an in-process loop or a sandboxed coding harness | `/kernel` · `/mcp` | +| Loop kernel + combinators | Write a driver (`plan`/`decide`) and run it (`runAgentRounds`), or compose fixed shapes: refine (`loopUntil`), best-of-N (`fanout`), chain (`pipeline`), multi-judge (`panel`) | `/kernel` | | Improvement driver | Optimize one part of an agent and ship only if it wins on tasks it never practiced on (`improve`); production proposal/review/activation flow | root · `/intelligence` | -| Benchmarks + leaderboards | Compare strategies with significance stats (`runBenchmark`), stand up a harness×model leaderboard (`defineLeaderboard`, `leaderboard`) | `/loops` | +| Benchmarks + leaderboards | Compare strategies with significance stats (`runBenchmark`), stand up a harness×model leaderboard (`defineLeaderboard`, `leaderboard`) | `/kernel` | | Knowledge improvement | Produce a measured candidate copy of a KB/wiki/RAG corpus without touching the live one (`runKnowledgeImprovementJob`) | `/knowledge` | | MCP tool servers | Give an agent a `delegate` tool or live worker-coordination tools over MCP | `/mcp` | | Conversations + durability | Multi-turn two-agent sessions with SQL-backed resume (D1/pg/sqlite/libSQL adapters) | `/conversation` | diff --git a/bench/HARNESS.md b/bench/HARNESS.md index eecb5e23..fb7c2baa 100644 --- a/bench/HARNESS.md +++ b/bench/HARNESS.md @@ -4,7 +4,7 @@ If you're an agent picking this up: read this page, then run `pnpm help` + `pnpm do NOT re-derive the harness from source. This map is SHORT on purpose; if it disagrees with the code, the code wins — fix this page in the same turn (the anti-rediscovery law). Verified against source 2026-07-18 · agent-eval pinned `0.122.8`. The CANONICAL surface is now -the published optimization suite (`@tangle-network/agent-runtime/loops`): `Environment` + +the published optimization suite (`@tangle-network/agent-runtime/kernel`): `Environment` + `Strategy`/`defineStrategy` + `runBenchmark` — see the section below FIRST. The recursive diverse-vs-blind gate runs through the keystone (`gate-cli.mts` → `runGate`); the offline selector replay (`corpus-replay.mts` / `corpus-report.mts`) gates the legacy corpora. diff --git a/bench/src/aec-gate.mts b/bench/src/aec-gate.mts index aab9d79d..c5f0952c 100644 --- a/bench/src/aec-gate.mts +++ b/bench/src/aec-gate.mts @@ -22,7 +22,7 @@ import { resolveAdapter } from './adapters' import type { BenchmarkAdapter, BenchTask } from './benchmarks/types' import { type AttemptRecord, appendRunRecord, buildRunRecordFromAttempts } from './corpus' import { composeStrategies } from './directives' -import { type RouterConfig, routerChatWithUsage } from '@tangle-network/agent-runtime/loops' +import { type RouterConfig, routerChatWithUsage } from '@tangle-network/agent-runtime/kernel' import { pool } from './stats.mts' function must(name: string): string { diff --git a/bench/src/benchmarks/agentbench.ts b/bench/src/benchmarks/agentbench.ts index 0632d153..007fbdad 100644 --- a/bench/src/benchmarks/agentbench.ts +++ b/bench/src/benchmarks/agentbench.ts @@ -9,7 +9,7 @@ import { readFile } from 'node:fs/promises' import { join } from 'node:path' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import { benchRoot } from './_harness' import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types' diff --git a/bench/src/benchmarks/appworld.ts b/bench/src/benchmarks/appworld.ts index bfa8f234..c30ead86 100644 --- a/bench/src/benchmarks/appworld.ts +++ b/bench/src/benchmarks/appworld.ts @@ -22,7 +22,7 @@ import { spawn } from 'node:child_process' import { join } from 'node:path' import { createInterface } from 'node:readline' -import { type OutputAdapter, routerToolLoop, type ToolSpec } from '@tangle-network/agent-runtime/loops' +import { type OutputAdapter, routerToolLoop, type ToolSpec } from '@tangle-network/agent-runtime/kernel' import { benchRoot, preflightVenvImports, runVenvScriptStdin, venvPython } from './_harness' import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types' diff --git a/bench/src/benchmarks/bfcl.ts b/bench/src/benchmarks/bfcl.ts index dd312dd7..7c653b31 100644 --- a/bench/src/benchmarks/bfcl.ts +++ b/bench/src/benchmarks/bfcl.ts @@ -11,7 +11,7 @@ import { readFile, stat } from 'node:fs/promises' import { join } from 'node:path' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import { benchRoot } from './_harness' import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types' diff --git a/bench/src/benchmarks/commit0.ts b/bench/src/benchmarks/commit0.ts index 6f8306d3..0816297b 100644 --- a/bench/src/benchmarks/commit0.ts +++ b/bench/src/benchmarks/commit0.ts @@ -23,7 +23,7 @@ import { join } from 'node:path' import { readFile } from 'node:fs/promises' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import { benchRoot, preflightVenvImports, runVenvScriptStdin, venvPythonAt } from './_harness' import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types' diff --git a/bench/src/benchmarks/dabstep.ts b/bench/src/benchmarks/dabstep.ts index 0fb17932..45d784fc 100644 --- a/bench/src/benchmarks/dabstep.ts +++ b/bench/src/benchmarks/dabstep.ts @@ -11,7 +11,7 @@ import { join } from 'node:path' import { access, readFile, stat } from 'node:fs/promises' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import { benchRoot, runVenvPython, runVenvScriptStdin } from './_harness' import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types' diff --git a/bench/src/benchmarks/enterpriseops-gym.ts b/bench/src/benchmarks/enterpriseops-gym.ts index d3af1e73..213c1b04 100644 --- a/bench/src/benchmarks/enterpriseops-gym.ts +++ b/bench/src/benchmarks/enterpriseops-gym.ts @@ -30,7 +30,7 @@ import { mkdir, readFile, rm, writeFile } from 'node:fs/promises' import { join } from 'node:path' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import { benchRoot, runVenvScriptStdin } from './_harness' import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types' diff --git a/bench/src/benchmarks/programbench.ts b/bench/src/benchmarks/programbench.ts index 82e4d6b9..234bc36e 100644 --- a/bench/src/benchmarks/programbench.ts +++ b/bench/src/benchmarks/programbench.ts @@ -25,7 +25,7 @@ import { join } from 'node:path' import { readFile } from 'node:fs/promises' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import { benchRoot, preflightVenvImports, runVenvScriptStdin } from './_harness' import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types' diff --git a/bench/src/benchmarks/rag-shared.ts b/bench/src/benchmarks/rag-shared.ts index 882557a0..8065d1d2 100644 --- a/bench/src/benchmarks/rag-shared.ts +++ b/bench/src/benchmarks/rag-shared.ts @@ -1,5 +1,5 @@ import { readFile } from 'node:fs/promises' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import type { BenchScore, BenchTask, LoadOptions } from './types' export const FINAL_ANSWER_SENTINEL = 'FINAL ANSWER:' diff --git a/bench/src/benchmarks/swe-bench.ts b/bench/src/benchmarks/swe-bench.ts index 71fc9b83..db21f412 100644 --- a/bench/src/benchmarks/swe-bench.ts +++ b/bench/src/benchmarks/swe-bench.ts @@ -13,7 +13,7 @@ */ import { join } from 'node:path' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import { preflightVenvImports, readJsonReport, diff --git a/bench/src/benchmarks/tau-bench-shared.ts b/bench/src/benchmarks/tau-bench-shared.ts index da9e9c62..d6b0014f 100644 --- a/bench/src/benchmarks/tau-bench-shared.ts +++ b/bench/src/benchmarks/tau-bench-shared.ts @@ -9,7 +9,7 @@ import { readFile, stat } from 'node:fs/promises' import { resolve } from 'node:path' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import { runVenvPython } from './_harness' import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types' diff --git a/bench/src/benchmarks/toollm.ts b/bench/src/benchmarks/toollm.ts index bc2d6c75..12332797 100644 --- a/bench/src/benchmarks/toollm.ts +++ b/bench/src/benchmarks/toollm.ts @@ -9,7 +9,7 @@ import { readFile } from 'node:fs/promises' import { join } from 'node:path' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import { benchRoot } from './_harness' import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types' diff --git a/bench/src/benchmarks/types.ts b/bench/src/benchmarks/types.ts index b02c16d0..d24def67 100644 --- a/bench/src/benchmarks/types.ts +++ b/bench/src/benchmarks/types.ts @@ -8,7 +8,7 @@ * from the benchmark's published evaluation harness. */ -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' export interface BenchTask { /** Stable benchmark instance id. */ diff --git a/bench/src/benchmarks/webarena-verified.ts b/bench/src/benchmarks/webarena-verified.ts index 1d671dec..3ee509ce 100644 --- a/bench/src/benchmarks/webarena-verified.ts +++ b/bench/src/benchmarks/webarena-verified.ts @@ -9,7 +9,7 @@ import { access, readFile, stat } from 'node:fs/promises' import { join, resolve } from 'node:path' -import type { OutputAdapter } from '@tangle-network/agent-runtime/loops' +import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel' import { benchRoot, runVenvPython } from './_harness' import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types' diff --git a/bench/src/clbench-codebase-gate.mts b/bench/src/clbench-codebase-gate.mts index 1619f1c3..317fb6d1 100644 --- a/bench/src/clbench-codebase-gate.mts +++ b/bench/src/clbench-codebase-gate.mts @@ -31,7 +31,7 @@ import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { promisify } from 'node:util' -import { acquireSandbox } from '@tangle-network/agent-runtime/loops' +import { acquireSandbox } from '@tangle-network/agent-runtime/kernel' import { Sandbox } from '@tangle-network/sandbox' import { composeStrategies } from './directives' import { type AttemptRecord, appendRunRecord, buildRunRecordFromAttempts } from './corpus' diff --git a/bench/src/clbench-context-gate.mts b/bench/src/clbench-context-gate.mts index df79b892..ecf33784 100644 --- a/bench/src/clbench-context-gate.mts +++ b/bench/src/clbench-context-gate.mts @@ -36,7 +36,7 @@ import { execFileSync } from 'node:child_process' import { existsSync, readFileSync } from 'node:fs' import { composeStrategies } from './directives' import { type AttemptRecord, appendRunRecord, buildRunRecordFromAttempts } from './corpus' -import { type RouterConfig, routerChatWithUsage } from '@tangle-network/agent-runtime/loops' +import { type RouterConfig, routerChatWithUsage } from '@tangle-network/agent-runtime/kernel' import { selfConsistencySelect, verifierGroundedSelect } from './selector' import { type PairedLift, pairedLift, pool } from './stats.mts' diff --git a/bench/src/cloud-loop.mts b/bench/src/cloud-loop.mts index 8ab65ad6..ea71198e 100644 --- a/bench/src/cloud-loop.mts +++ b/bench/src/cloud-loop.mts @@ -30,7 +30,7 @@ * env MODEL=gpt-4.1 ROUNDS=3 pnpm exec tsx src/cloud-loop.mts */ import { createChatClient } from '@tangle-network/agent-eval' -import { observe, openSandboxRun } from '@tangle-network/agent-runtime/loops' +import { observe, openSandboxRun } from '@tangle-network/agent-runtime/kernel' import { Sandbox } from '@tangle-network/sandbox' import { answerOutput, sandboxAgentRun } from './sandbox-run' diff --git a/bench/src/commit0-env-run.mts b/bench/src/commit0-env-run.mts index d3de31ea..389aba1e 100644 --- a/bench/src/commit0-env-run.mts +++ b/bench/src/commit0-env-run.mts @@ -10,7 +10,7 @@ */ import { readFileSync } from 'node:fs' import { join } from 'node:path' -import { adaptiveRefine, printBenchmarkReport, refine, runBenchmark, sample, type Strategy } from '@tangle-network/agent-runtime/loops' +import { adaptiveRefine, printBenchmarkReport, refine, runBenchmark, sample, type Strategy } from '@tangle-network/agent-runtime/kernel' import { type Commit0Row, createCommit0Environment, rowToTask } from './commit0-env' function must(name: string): string { diff --git a/bench/src/commit0-env.ts b/bench/src/commit0-env.ts index 18f6e062..a7c90c70 100644 --- a/bench/src/commit0-env.ts +++ b/bench/src/commit0-env.ts @@ -20,7 +20,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { promisify } from 'node:util' -import type { AgenticSurface, AgenticTask, AgenticTool, ArtifactHandle, SurfaceScore } from '@tangle-network/agent-runtime/loops' +import type { AgenticSurface, AgenticTask, AgenticTool, ArtifactHandle, SurfaceScore } from '@tangle-network/agent-runtime/kernel' const exec = promisify(execFile) diff --git a/bench/src/commit0-gate.mts b/bench/src/commit0-gate.mts index dc61ab4d..ea2711bc 100644 --- a/bench/src/commit0-gate.mts +++ b/bench/src/commit0-gate.mts @@ -57,7 +57,7 @@ import { type Deliverable, openSandboxRun, type SandboxRun, -} from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' import { Sandbox } from '@tangle-network/sandbox' import { createCommit0Adapter } from './benchmarks/commit0' import type { BenchTask } from './benchmarks/types' diff --git a/bench/src/corpus.ts b/bench/src/corpus.ts index 85276e16..cfe35a1b 100644 --- a/bench/src/corpus.ts +++ b/bench/src/corpus.ts @@ -16,7 +16,7 @@ import { appendFile, mkdir } from 'node:fs/promises' import { dirname } from 'node:path' import { hashContent, type RunSplitTag, validateRunRecord } from '@tangle-network/agent-eval' import type { CorpusRecord } from '@tangle-network/agent-eval/rl' -import type { Iteration } from '@tangle-network/agent-runtime/loops' +import type { Iteration } from '@tangle-network/agent-runtime/kernel' import type { BenchRuntimeDecisionPoint, BenchRuntimeHookEvent } from './runtime-hook-recorder' /** One attempt within a condition-run: the prompt/steer sent, the output, the diff --git a/bench/src/examples/lean-proof-gate.mts b/bench/src/examples/lean-proof-gate.mts index 5bb372ce..f67a2740 100644 --- a/bench/src/examples/lean-proof-gate.mts +++ b/bench/src/examples/lean-proof-gate.mts @@ -22,7 +22,7 @@ import { runBenchmark, sample, sampleThenRefine, -} from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' import { ensureLeanImage, leanCheck } from './lean-verify.js' // Real, mathlib-free Lean 4 theorems (compile in core Lean). `header` is everything up to `:=`; diff --git a/bench/src/examples/math-demo.mts b/bench/src/examples/math-demo.mts index 76dd4813..240254d9 100644 --- a/bench/src/examples/math-demo.mts +++ b/bench/src/examples/math-demo.mts @@ -19,7 +19,7 @@ import { runBenchmark, sample, sampleThenRefine, -} from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' // GSM8K-style problems; meta.answer is the ground truth the deployable check compares to. const problems: Array<{ q: string; answer: number }> = [ diff --git a/bench/src/examples/strategy-demo.mts b/bench/src/examples/strategy-demo.mts index f0d0ad6a..5705d2cd 100644 --- a/bench/src/examples/strategy-demo.mts +++ b/bench/src/examples/strategy-demo.mts @@ -12,7 +12,7 @@ * Toy task = only a router key needed (no dataset, no sandbox). Run from bench/: * TANGLE_API_KEY=... WORKER_MODEL=gpt-4o-mini tsx src/examples/strategy-demo.mts */ -import { adaptiveRefine, type AgenticTask, type ArtifactHandle, defineStrategy, type Environment, printBenchmarkReport, refine, runBenchmark, sample } from '@tangle-network/agent-runtime/loops' +import { adaptiveRefine, type AgenticTask, type ArtifactHandle, defineStrategy, type Environment, printBenchmarkReport, refine, runBenchmark, sample } from '@tangle-network/agent-runtime/kernel' // ── 1. Implement an Environment (the only thing a new domain writes) ────────────── // A toy: the agent must drive a counter to exactly the target using the increment tool. diff --git a/bench/src/fleet.mts b/bench/src/fleet.mts index a05e0c27..1b14f62e 100644 --- a/bench/src/fleet.mts +++ b/bench/src/fleet.mts @@ -13,7 +13,7 @@ * Run it twice: the second run injects the first run's learnings into the workers. */ import { createChatClient } from '@tangle-network/agent-eval' -import { FileCorpus, observe, openSandboxRun, renderReport } from '@tangle-network/agent-runtime/loops' +import { FileCorpus, observe, openSandboxRun, renderReport } from '@tangle-network/agent-runtime/kernel' import { Sandbox } from '@tangle-network/sandbox' import { answerOutput, sandboxAgentRun, type WorkerBackendType } from './sandbox-run' diff --git a/bench/src/gate-cli.mts b/bench/src/gate-cli.mts index 94fde519..70f33530 100644 --- a/bench/src/gate-cli.mts +++ b/bench/src/gate-cli.mts @@ -15,7 +15,7 @@ * single CLI run is the instrument, not the significance test). */ -import type { AgentProfile } from '@tangle-network/agent-runtime/loops' +import type { AgentProfile } from '@tangle-network/agent-runtime/kernel' import { resolveAdapter } from './adapters' import { runGate } from './gate' diff --git a/bench/src/gate.test.mts b/bench/src/gate.test.mts index 42ef65ba..976eb66e 100644 --- a/bench/src/gate.test.mts +++ b/bench/src/gate.test.mts @@ -19,7 +19,7 @@ import type { Executor, ExecutorFactory, ExecutorResult, -} from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' import type { BenchmarkAdapter, BenchScore, BenchTask } from './benchmarks/types' import { runGate, type SolveTask } from './gate' diff --git a/bench/src/gate.ts b/bench/src/gate.ts index 9adb59f9..ad9afdd6 100644 --- a/bench/src/gate.ts +++ b/bench/src/gate.ts @@ -46,7 +46,7 @@ import type { Spend, SupervisedResult, TrajectoryReport, -} from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' import { definePersona, routerChatWithUsage, @@ -56,7 +56,7 @@ import { InMemorySpawnJournal, runPersonified, trajectoryReport, -} from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' import type { BenchmarkAdapter, BenchTask } from './benchmarks/types' /** A fanout child's task: the prompt to solve with + the instance to grade against. The instance diff --git a/bench/src/generate-eval/certify.ts b/bench/src/generate-eval/certify.ts index f21b8fcc..e1186dfa 100644 --- a/bench/src/generate-eval/certify.ts +++ b/bench/src/generate-eval/certify.ts @@ -24,7 +24,7 @@ import { execSync } from 'node:child_process' import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { dirname, join, resolve } from 'node:path' -import { routerChatWithUsage } from '@tangle-network/agent-runtime/loops' +import { routerChatWithUsage } from '@tangle-network/agent-runtime/kernel' import { scoreTask, taskToPrompt } from '../search-bench/tasks' import { type EvalCertification, type GeneratedEval, generatedEvalSchemaVersion, parseCandidate } from './schema' diff --git a/bench/src/humaneval-gate.mts b/bench/src/humaneval-gate.mts index ef27b586..0bd02232 100644 --- a/bench/src/humaneval-gate.mts +++ b/bench/src/humaneval-gate.mts @@ -43,7 +43,7 @@ import { composeStrategies } from './directives' import { basePrompt, type CheckResult, extractCode, type HumanEvalTask, loadHumanEval, runChecker } from './benchmarks/humaneval' -import { type RouterConfig, routerChatWithUsage } from '@tangle-network/agent-runtime/loops' +import { type RouterConfig, routerChatWithUsage } from '@tangle-network/agent-runtime/kernel' import { selfConsistencySelect, verifierGroundedSelect } from './selector' import { type PairedLift, pairedLift, pool } from './stats.mts' diff --git a/bench/src/humaneval-repair-gate.mts b/bench/src/humaneval-repair-gate.mts index 88cd2474..3ebbc10b 100644 --- a/bench/src/humaneval-repair-gate.mts +++ b/bench/src/humaneval-repair-gate.mts @@ -20,7 +20,7 @@ * tsx src/humaneval-repair-gate.mts */ import { type HumanEvalTask, basePrompt, extractCode, loadHumanEval, runChecker } from './benchmarks/humaneval' -import { type RouterConfig, type ToolSpec, routerChatWithUsage, routerToolLoop } from '@tangle-network/agent-runtime/loops' +import { type RouterConfig, type ToolSpec, routerChatWithUsage, routerToolLoop } from '@tangle-network/agent-runtime/kernel' import { verifierGroundedSelect } from './selector' import { type PairedLift, pairedLift, pool } from './stats.mts' diff --git a/bench/src/research-shot.ts b/bench/src/research-shot.ts index 1076fdc8..5dad6268 100644 --- a/bench/src/research-shot.ts +++ b/bench/src/research-shot.ts @@ -10,7 +10,7 @@ * — the only difference is who drives the rounds (a flat best-of-k pool vs the real * `runLoop` kernel with analyst steering). */ -import { routerChatWithUsage } from '@tangle-network/agent-runtime/loops' +import { routerChatWithUsage } from '@tangle-network/agent-runtime/kernel' export interface ShotCfg { model: string diff --git a/bench/src/resolve-client.ts b/bench/src/resolve-client.ts index e93d5987..5a03ab0f 100644 --- a/bench/src/resolve-client.ts +++ b/bench/src/resolve-client.ts @@ -24,7 +24,7 @@ import { inlineSandboxClient, resolveSandboxClient, type SandboxClient, -} from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' import { Sandbox } from '@tangle-network/sandbox' import { makeSearchExecutor, webSearchTool } from './search-tool' diff --git a/bench/src/router-executor.ts b/bench/src/router-executor.ts index ebc34f90..c4b1dbd1 100644 --- a/bench/src/router-executor.ts +++ b/bench/src/router-executor.ts @@ -20,7 +20,7 @@ import { type ExecutorResult, inlineSandboxClient, type SandboxClient, -} from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' import { runResearchShot, type ShotCfg } from './research-shot' export function routerSandboxClient(cfg: ShotCfg): SandboxClient { diff --git a/bench/src/run-benchmarks-report.ts b/bench/src/run-benchmarks-report.ts index ea0a248e..9a4f0de9 100644 --- a/bench/src/run-benchmarks-report.ts +++ b/bench/src/run-benchmarks-report.ts @@ -16,7 +16,7 @@ import { renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, -} from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' import type { BenchCellTaskResult, RunBenchmarksReport } from './run-benchmarks' /** Project the runner's per-task results into `RunRecord`s the leaderboard engine reads. Cost/tokens are diff --git a/bench/src/run-benchmarks.test.mts b/bench/src/run-benchmarks.test.mts index 0291ee47..45c00738 100644 --- a/bench/src/run-benchmarks.test.mts +++ b/bench/src/run-benchmarks.test.mts @@ -137,7 +137,7 @@ async function main(): Promise { assert.equal(leakyPrompts[1]!.includes(leakyGold), false, 'retry prompt redacts hidden gold fields') assert.match(leakyPrompts[1]!, /publicHint/) - const runtime = await import('@tangle-network/agent-runtime/loops') + const runtime = await import('@tangle-network/agent-runtime/kernel') if (runtime.openSandboxRun.toString().includes('beforeStart')) { // The default shot path supports benchmark-owned box setup/extract without real sandbox infra. const order: string[] = [] diff --git a/bench/src/run-benchmarks.ts b/bench/src/run-benchmarks.ts index e55e5c3a..e72bcbeb 100644 --- a/bench/src/run-benchmarks.ts +++ b/bench/src/run-benchmarks.ts @@ -34,8 +34,8 @@ import type { AgentRunSpec, Deliverable, OpenSandboxRunOptions, -} from '@tangle-network/agent-runtime/loops' -import { openSandboxRun } from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' +import { openSandboxRun } from '@tangle-network/agent-runtime/kernel' import type { SandboxEvent } from '@tangle-network/sandbox' import { resolveAdapter } from './adapters' import type { BenchmarkAdapter, BenchScore, BenchTask } from './benchmarks/types' diff --git a/bench/src/sandbox-run.ts b/bench/src/sandbox-run.ts index 4271f387..79e67f98 100644 --- a/bench/src/sandbox-run.ts +++ b/bench/src/sandbox-run.ts @@ -14,7 +14,7 @@ import { type AgentRunSpec, type OutputAdapter, routerChatWithUsage, -} from '@tangle-network/agent-runtime/loops' +} from '@tangle-network/agent-runtime/kernel' // `BackendType` is the sandbox SDK's harness union — its canonical home. agent-runtime consumes // it from there too; it is not re-exported from the loops barrel. import type { BackendType } from '@tangle-network/sandbox' diff --git a/bench/src/search-bench/bridge.ts b/bench/src/search-bench/bridge.ts index 2613499b..2a36549b 100644 --- a/bench/src/search-bench/bridge.ts +++ b/bench/src/search-bench/bridge.ts @@ -12,7 +12,7 @@ * The bridge model id IS the harness selector (e.g. `claude-code/sonnet`, * `opencode/zai-coding-plan/glm-5.1`), so `harness` here is just the label. */ -import { createExecutor } from '@tangle-network/agent-runtime/loops' +import { createExecutor } from '@tangle-network/agent-runtime/kernel' import type { SearchArm } from './profiles' import { armLabel } from './profiles' import type { SearchCellResult } from './run.mts' diff --git a/bench/src/search-bench/parametric-check.mts b/bench/src/search-bench/parametric-check.mts index 40667467..9780fb7e 100644 --- a/bench/src/search-bench/parametric-check.mts +++ b/bench/src/search-bench/parametric-check.mts @@ -11,7 +11,7 @@ */ import { writeFileSync } from 'node:fs' import { runPool } from '../run-pool' -import { routerChatWithUsage } from '@tangle-network/agent-runtime/loops' +import { routerChatWithUsage } from '@tangle-network/agent-runtime/kernel' import { freshTasks } from './tasks-fresh' import { scoreTask, taskToPrompt } from './tasks' diff --git a/bench/src/search-bench/run.mts b/bench/src/search-bench/run.mts index f99528db..10d97fbb 100644 --- a/bench/src/search-bench/run.mts +++ b/bench/src/search-bench/run.mts @@ -15,7 +15,7 @@ */ import { appendFileSync, mkdirSync, writeFileSync } from 'node:fs' import { dirname } from 'node:path' -import { extractLlmCallEvent, openSandboxRun } from '@tangle-network/agent-runtime/loops' +import { extractLlmCallEvent, openSandboxRun } from '@tangle-network/agent-runtime/kernel' import { Sandbox, type SandboxEvent } from '@tangle-network/sandbox' import { answerOutput, sandboxAgentRun, type WorkerBackendType } from '../sandbox-run' import { type BridgeCfg, runBridgeCell } from './bridge' diff --git a/bench/src/search-tool.ts b/bench/src/search-tool.ts index a21a1f5f..0205bc11 100644 --- a/bench/src/search-tool.ts +++ b/bench/src/search-tool.ts @@ -13,7 +13,7 @@ * a recall-only answer; a valid-but-empty result returns an explicit "no results" * string the model can reason about. */ -import type { ToolSpec } from '@tangle-network/agent-runtime/loops' +import type { ToolSpec } from '@tangle-network/agent-runtime/kernel' export const webSearchTool: ToolSpec = { type: 'function', diff --git a/bench/src/swe-arena/fixtures/factory/loops-28/calibration.md b/bench/src/swe-arena/fixtures/factory/loops-28/calibration.md index 51414cbb..47346e5e 100644 --- a/bench/src/swe-arena/fixtures/factory/loops-28/calibration.md +++ b/bench/src/swe-arena/fixtures/factory/loops-28/calibration.md @@ -43,5 +43,5 @@ All three fail at collection: `src/best-effort.ts`, `src/worker-clone.ts`, `src/ - Tests spawn `git` in temporary directories with identity passed inline, and use symlink/chmod, so they are POSIX-only. The judge runs in the pinned factory container with network disabled and no operator environment. **Excluded: none.** - `tests/worker-evidence.test.ts` imports the bound constants (`EVIDENCE_MAX_CHARS` etc.) and asserts **relative to them** (`length ≤ EVIDENCE_MAX_CHARS`, tail contains `'v'.repeat(VERIFY_TAIL_CHARS)`) — exact values are the builder's choice; the names and semantics are contract and are in `spec.md`. Not trimmed: self-referencing bounds have behavioral content (bounding + tail retention). - One pinned prose contract: the best-effort delivery commit subject must contain `best-effort delivery from