@tangle-network/agent-runtime 0.79.3 → 0.79.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +50 -327
  2. package/dist/agent.js +5 -5
  3. package/dist/analyst-loop.js +2 -2
  4. package/dist/{chunk-KRULXIWS.js → chunk-44CX5JU6.js} +4 -4
  5. package/dist/{chunk-T2HVQVB4.js → chunk-4J6RBI3K.js} +15 -1
  6. package/dist/chunk-4J6RBI3K.js.map +1 -0
  7. package/dist/{chunk-AG335EXG.js → chunk-AHZ3YBL6.js} +524 -12
  8. package/dist/chunk-AHZ3YBL6.js.map +1 -0
  9. package/dist/{chunk-IODKUOBA.js → chunk-C2FZ6GR6.js} +2 -2
  10. package/dist/{chunk-Z3RRRPRB.js → chunk-H7IBHAFT.js} +23 -14
  11. package/dist/chunk-H7IBHAFT.js.map +1 -0
  12. package/dist/{chunk-VMNEQHJR.js → chunk-IPEQ3ERC.js} +17 -2
  13. package/dist/chunk-IPEQ3ERC.js.map +1 -0
  14. package/dist/{chunk-PBE35ULD.js → chunk-NXZEVWKP.js} +2 -2
  15. package/dist/{chunk-PVPFDTO3.js → chunk-RUJZK6VH.js} +2 -2
  16. package/dist/{chunk-63MHOCIE.js → chunk-U6AP535M.js} +4 -4
  17. package/dist/{coordination-DCmljYDf.d.ts → coordination-BFVtgRax.d.ts} +2 -2
  18. package/dist/environment-provider.d.ts +1 -1
  19. package/dist/environment-provider.js +1 -1
  20. package/dist/index.d.ts +4 -4
  21. package/dist/index.js +8 -8
  22. package/dist/intelligence.d.ts +29 -1
  23. package/dist/intelligence.js +33 -23
  24. package/dist/intelligence.js.map +1 -1
  25. package/dist/{loop-runner-bin-C4X0FZ2Z.d.ts → loop-runner-bin-CTVja8e0.d.ts} +2 -2
  26. package/dist/loop-runner-bin.d.ts +4 -4
  27. package/dist/loop-runner-bin.js +7 -7
  28. package/dist/loops.d.ts +242 -11
  29. package/dist/loops.js +26 -6
  30. package/dist/mcp/bin.js +5 -5
  31. package/dist/mcp/index.d.ts +5 -5
  32. package/dist/mcp/index.js +7 -7
  33. package/dist/{types-C1sozrte.d.ts → types-DYW0tloU.d.ts} +2 -2
  34. package/dist/{worktree-fanout-CXGzHET4.d.ts → worktree-fanout-DaUDwCA_.d.ts} +2 -2
  35. package/dist/{worktree-harness-Bmho9SH0.d.ts → worktree-harness-Dt6s_m3z.d.ts} +1 -1
  36. package/package.json +1 -1
  37. package/skills/build-with-agent-runtime/SKILL.md +53 -23
  38. package/dist/chunk-AG335EXG.js.map +0 -1
  39. package/dist/chunk-T2HVQVB4.js.map +0 -1
  40. package/dist/chunk-VMNEQHJR.js.map +0 -1
  41. package/dist/chunk-Z3RRRPRB.js.map +0 -1
  42. /package/dist/{chunk-KRULXIWS.js.map → chunk-44CX5JU6.js.map} +0 -0
  43. /package/dist/{chunk-IODKUOBA.js.map → chunk-C2FZ6GR6.js.map} +0 -0
  44. /package/dist/{chunk-PBE35ULD.js.map → chunk-NXZEVWKP.js.map} +0 -0
  45. /package/dist/{chunk-PVPFDTO3.js.map → chunk-RUJZK6VH.js.map} +0 -0
  46. /package/dist/{chunk-63MHOCIE.js.map → chunk-U6AP535M.js.map} +0 -0
@@ -21,8 +21,8 @@ capture-integrity, or eval/prod parity).
21
21
 
22
22
  ## Load order — point at source, never freeze snippets
23
23
 
24
- This skill carries **no API snippets**. The barrel MOVES (`./loops` is a
25
- back-compat alias of `./runtime`), the agent-eval pin drifts, and signatures get
24
+ This skill carries **no API snippets**. The barrel MOVES (`./loops` is the
25
+ runtime barrel), the agent-eval pin drifts, and signatures get
26
26
  corrected in place. Freezing a snippet here guarantees rot. Instead, read, in
27
27
  order, and re-verify against source:
28
28
 
@@ -32,9 +32,8 @@ order, and re-verify against source:
32
32
  two-substrate map. Every signature there was read from source.
33
33
  2. **`grep` the export barrel** — `grep -nE 'export (function|const|type)' src/runtime/index.ts`
34
34
  (and `src/agent/index.ts`, `src/improvement/index.ts`, `src/mcp/index.ts`,
35
- `src/intelligence/index.ts`) for the live names + subpaths. `./loops` and
36
- `./runtime` resolve to the SAME barrel (`package.json` maps both to
37
- `src/runtime/index.ts`).
35
+ `src/intelligence/index.ts`) for the live names + subpaths. `./loops` is the
36
+ runtime barrel (`package.json` maps it to `src/runtime/index.ts`).
38
37
  3. **`bench/HARNESS.md`** — the experiment-harness map: commands, the
39
38
  `rollout → corpus → selector → CI → gate` flow, and the `ADAPTERS` registry
40
39
  (a harness-local export, `bench/src/adapters.ts`, not a package export).
@@ -54,36 +53,48 @@ profile and letting the substrate materialize it into harness shapes —
54
53
  self-verification, iteration, and audit are profile levers (hooks/skills/
55
54
  subagents), never glue code.
56
55
 
57
- `AgentProfile` is now owned by `@tangle-network/agent-interface` (the `/runtime`
58
- barrel still re-exports the sandbox alias for back-compat), which also owns
56
+ `AgentProfile` is owned by `@tangle-network/agent-interface` (the `/loops`
57
+ barrel re-exports the sandbox alias as a one-stop import), which also owns
59
58
  `HarnessType` + `ReasoningEffort` and a capability layer
60
59
  (`harnessSupportsModel` / `reasoningEffortsFor`) — so harness/model/reasoning
61
60
  compatibility is a queryable contract, not an assumption.
62
61
 
62
+ Harness is a RUN-layer coordinate, not part of the portable genome: it rides on
63
+ agent-runtime's `AgentSpec { profile, harness }`. To sweep it as an eval axis,
64
+ don't hand-declare a harness list — expand one base profile across
65
+ `CODING_HARNESSES` with `expandProfileAxes` (agent-eval), run with
66
+ `runProfileMatrix`, and pivot results by the stamped `AgentProfileCell`
67
+ (`groupRunsByAgentProfileCell`); incompatible `(harness, model)` pairs drop via
68
+ `harnessSupportsModel`.
69
+
63
70
  | Altitude — I want to… | Use | Source |
64
71
  |---|---|---|
65
- | **Define a genome** (who the agent is + what it can do, ONE surface) | `AgentProfile` (runnable) / `AgentSurfaces` (the editable-coordinate map) — `/runtime`, `/agent` | canonical-api §3.2 |
66
- | **Define the personified-run record** (model+prompt+tools+role+seams) | `definePersona(input)` — `/runtime` | canonical-api §3.1 |
67
- | **Run a genome driver⟷worker, end-to-end** | `runPersonified({ persona, shape, task, budget })` — `/runtime` | canonical-api §3.1 |
68
- | **Loop a worker over one evolving artifact, K rounds, stop-when-good** | `loopUntil(seed, spec)` as the `shape` — `/runtime` | canonical-api §3.1 |
69
- | **Best-of-N / parallel-research at equal compute** | `fanout(items, opts)` — `/runtime` | canonical-api §3.1 |
70
- | **Produce-then-gate / multi-judge quorum / fixed chain** | `verify` / `panel` / `pipeline` — `/runtime` | canonical-api §3.1 |
72
+ | **Define a genome** (who the agent is + what it can do, ONE surface) | `AgentProfile` (runnable) / `AgentSurfaces` (the editable-coordinate map) — `/loops`, `/agent` | canonical-api §3.2 |
73
+ | **Define the personified-run record** (model+prompt+tools+role+seams) | `definePersona(input)` — `/loops` | canonical-api §3.1 |
74
+ | **Run a genome driver⟷worker, end-to-end** | `runPersonified({ persona, shape, task, budget })` — `/loops` | canonical-api §3.1 |
75
+ | **Loop a worker over one evolving artifact, K rounds, stop-when-good** | `loopUntil(seed, spec)` as the `shape` — `/loops` | canonical-api §3.1 |
76
+ | **Best-of-N / parallel-research at equal compute** | `fanout(items, opts)` — `/loops` | canonical-api §3.1 |
77
+ | **Produce-then-gate / multi-judge quorum / fixed chain** | `verify` / `panel` / `pipeline` — `/loops` | canonical-api §3.1 |
71
78
  | **Run depth-vs-breadth (or a custom strategy) over a stateful tool domain** | `runAgentic({ surface, task, mode\|strategy, budget })` — `/loops` | canonical-api §3.3 |
72
79
  | **Author a new topology/strategy compactly** | `defineStrategy(name, body)` w/ `ctx.shot()`+`ctx.critique()` — `/loops` | canonical-api §3.3 |
73
80
  | **Add a stateful tool-using domain** | implement `AgenticSurface` (5 hooks) — `/loops` | canonical-api §3.3 |
81
+ | **Drive a team of agents over a graded `AgenticSurface` task** (workers settle on its check, driver self-improves from the failing tests) | `superviseSurface(profile, task, { surface, worker })` — `/loops` | canonical-api §2 |
74
82
  | **Benchmark: compare strategies + significance + Pareto on a domain** | `runBenchmark({ environment, tasks, worker, strategies })` — `/loops` | canonical-api §3.3 |
83
+ | **Benchmark report: multi-profile × multi-axis leaderboard** (ranked board + score matrix + SVG/HTML charts, any `RunRecord[]`) | `leaderboard(records)` + `renderLeaderboardMarkdown` / `renderLeaderboardSvg` / `renderLeaderboardHtml` — `/loops` | canonical-api §2 |
84
+ | **Meter one `openSandboxRun` cell's token/cost usage** | `sumSandboxUsage(events)` — `/loops` | canonical-api §2 |
85
+ | **Sweep harness × model as an eval axis** (turn one base profile into the full harness × model set) | `expandProfileAxes({ base, harnesses, models })` over `CODING_HARNESSES` → `runProfileMatrix(...)`, pivot with `groupRunsByAgentProfileCell` — `agent-eval` root — NOT a hand-declared `HARNESSES` list | agent-eval root (verify vs source) |
75
86
  | **Benchmark: add/run an external benchmark from the harness** | `ADAPTERS`/`resolveAdapter(key)` + a bench gate (`*-gate.mts`) over `openSandboxRun` + `sandboxAgentRun` (`bench/src/sandbox-run.ts`) | canonical-api §3.3 |
76
- | **Spawn N coding agents on isolated git worktrees, keep the one whose patch passes checks** | `worktreeFanout` + `createWorktreeCliExecutor` + `gateOnDeliverable(DeliverableSpec)` over a raw `WorktreePatchArtifact`, winner via `selectValidWinner` — `/runtime` — NOT a hand-rolled spawn-loop / "coder" role | canonical-api §3.1 / §5 |
77
- | **Sandbox coding rollout** (fresh box/round, or persistent+resume) | `runLoop(options)` / `openSandboxRun(client, opts, deliverable)` — `/runtime` | canonical-api §3.1 |
78
- | **Optimize a CODE surface** in a gated loop | `improvementDriver({ worktree, generator })` — `/improvement` | canonical-api §3.4 |
87
+ | **Spawn N coding agents on isolated git worktrees, keep the one whose patch passes checks** | `worktreeFanout` + `createWorktreeCliExecutor` + `gateOnDeliverable(DeliverableSpec)` over a raw `WorktreePatchArtifact`, winner via `selectValidWinner` — `/loops` — NOT a hand-rolled spawn-loop / "coder" role | canonical-api §3.1 / §5 |
88
+ | **Sandbox coding rollout** (fresh box/round, or persistent+resume) | `runLoop(options)` / `openSandboxRun(client, opts, deliverable)` — `/loops` | canonical-api §3.1 |
89
+ | **Optimize a CODE surface** in a gated loop | `improvementDriver({ worktree, generator })` — root `.` | canonical-api §3.4 |
79
90
  | **Optimize a PROMPT/config surface** (one call) | `selfImprove({ agent, scenarios, judge, baselineSurface })` — `agent-eval/contract` | canonical-api §3.4 |
80
91
  | **Gate: ship/hold a candidate** (campaign ctx) | `defaultProductionGate` / `heldOutGate` / `composeGate` — `agent-eval/contract` | canonical-api §3.4 |
81
- | **Gate: ship/hold from a `BenchmarkReport`** (per-task cells) | `promotionGate({ report, incumbent, candidate })` — `/runtime` | canonical-api §3.4 |
82
- | **Run the full multi-generation flywheel + certify** | `runStrategyEvolution(config)` — `/runtime` | canonical-api §3.4 |
83
- | **Compose the prod sandbox profile** (eval/prod parity) | `composeProductionAgentProfile(base, opts)` — `/mcp` | canonical-api §3.2 |
84
- | **Observe a run** (cost/time waterfall, live tree, OTLP) | `createWaterfallCollector` / `createOtelExporter` via `composeRuntimeHooks(...)` — root; `createTopologyView` / `renderTopologyTree` — `/topology` | canonical-api §3.5 |
92
+ | **Gate: ship/hold from a `BenchmarkReport`** (per-task cells) | `promotionGate({ report, incumbent, candidate })` — `/loops` | canonical-api §3.4 |
93
+ | **Run the full multi-generation flywheel + certify** | `runStrategyEvolution(config)` — `/loops` | canonical-api §3.4 |
94
+ | **Observe a run** (cost/time waterfall, OTLP) | `createWaterfallCollector()` — `/loops`; `createOtelExporter` attached via `composeRuntimeHooks(...)` — root `.` | canonical-api §2 |
85
95
  | **State any A/B claim** | `pairedLift` (bench) over `pairedBootstrap`/`heldoutSignificance` (substrate) | canonical-api §3.5 |
86
- | **Observe/ship with billing-boundary** | `withTangleIntelligence(agent, { project, effort })` — `/intelligence` | canonical-api §7 (now live on main — verify) |
96
+ | **Observe/ship with billing-boundary** | `withTangleIntelligence(agent, { project, effort })` — `/intelligence` | canonical-api §2 |
97
+ | **Pull the certified profile from the Intelligence plane** (pull-by-default delivery: fold the gate-certified prompt onto the base surface) | `pullCertified` / `withCertifiedDelivery` / `composeCertifiedPrompt` — `/intelligence` | `src/intelligence/delivery.ts` |
87
98
 
88
99
  ## Do-NOT-reinvent — the traps this skill exists to stop
89
100
 
@@ -112,6 +123,12 @@ holds the load-bearing invariant the parallel breaks:
112
123
  sum of spans IS the billed run cost; a parallel tally drifts).
113
124
  - your own bootstrap loop / PRNG per gate **≈** `pairedLift` / `promotionGate`
114
125
  (seeded, identical run-to-run; never report a point lift without `low/high/pairs`).
126
+ - a per-product `HARNESSES` / `HarnessBackend` list + a metadata-harness reader
127
+ **≈** `CODING_HARNESSES` + `expandProfileAxes` (the one canonical harness list;
128
+ incompatible `(harness, model)` pairs drop via `harnessSupportsModel`) and the
129
+ `AgentProfileCell` stamped by `runProfileMatrix`, pivoted via
130
+ `groupRunsByAgentProfileCell` — never bake the harness into the model id so the
131
+ same model can run under multiple harnesses.
115
132
 
116
133
  ## End-to-end recipe
117
134
 
@@ -146,8 +163,21 @@ One line wraps any agent with trace + billing boundary:
146
163
  off|eco|standard|thorough|max` (`'off'` is the provable passthrough floor —
147
164
  intelligence spend clamped to 0). It builds on `createOtelExporter` +
148
165
  `loopEventToOtelSpan` — don't hand-roll a trace-wrapper or effort/tier config.
149
- Verify the live subpath against `src/intelligence/index.ts` (canonical-api §7's
150
- "branch-only" note is stale — it landed on main).
166
+ Verify the live subpath against `src/intelligence/index.ts`.
167
+
168
+ Two operational facts every consumer must know:
169
+
170
+ - **Export is a silent no-op without an endpoint.** The export leg only ships
171
+ when `INTELLIGENCE_OTLP_ENDPOINT` (or `OTEL_EXPORTER_OTLP_ENDPOINT`) is set —
172
+ e.g. `https://intelligence.tangle.tools/v1/otlp`; absent, spans are dropped
173
+ best-effort with no error. The client's `doctor().exportConfigured` is the
174
+ check that export will actually ship.
175
+ - **Delivery pulls the certified profile from the plane.** `pullCertified` /
176
+ `withCertifiedDelivery` hit
177
+ `GET {TANGLE_INTELLIGENCE_URL|https://intelligence.tangle.tools}/v1/profiles/:target/composed`
178
+ with `Bearer TANGLE_API_KEY`; `withCertifiedDelivery` folds the certified
179
+ prompt onto the base surface, refreshes at most every 5 minutes, and is
180
+ fail-closed — a failed pull runs the agent on its base surface.
151
181
 
152
182
  ## Final check
153
183