@tangle-network/agent-eval 0.94.0 → 0.95.1

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 (140) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +44 -30
  3. package/dist/adapters/http.d.ts +8 -7
  4. package/dist/adapters/http.js.map +1 -1
  5. package/dist/adapters/langchain.d.ts +3 -2
  6. package/dist/adapters/otel.d.ts +5 -4
  7. package/dist/analyst/index.d.ts +11 -31
  8. package/dist/analyst/index.js +5 -65
  9. package/dist/analyst/index.js.map +1 -1
  10. package/dist/{analyze-runs-B6Ljo_dI.d.ts → analyze-runs-DtT6F_6T.d.ts} +3 -3
  11. package/dist/belief-state/index.d.ts +4 -3
  12. package/dist/benchmarks/index.d.ts +3 -2
  13. package/dist/campaign/index.d.ts +727 -616
  14. package/dist/campaign/index.js +1863 -1316
  15. package/dist/campaign/index.js.map +1 -1
  16. package/dist/{chunk-2K6UUZ7P.js → chunk-2T4EZACH.js} +1 -1
  17. package/dist/chunk-2T4EZACH.js.map +1 -0
  18. package/dist/{chunk-CTBHKLEU.js → chunk-77T4STFI.js} +59 -86
  19. package/dist/chunk-77T4STFI.js.map +1 -0
  20. package/dist/{chunk-EGPMSBEZ.js → chunk-7QTQKIDD.js} +178 -177
  21. package/dist/chunk-7QTQKIDD.js.map +1 -0
  22. package/dist/{chunk-MIFZUPEK.js → chunk-AQ5WQAIV.js} +21 -6
  23. package/dist/chunk-AQ5WQAIV.js.map +1 -0
  24. package/dist/chunk-DJWX3GVS.js +81 -0
  25. package/dist/chunk-DJWX3GVS.js.map +1 -0
  26. package/dist/{chunk-S6OZEZQK.js → chunk-HMA63UEO.js} +37 -9
  27. package/dist/{chunk-S6OZEZQK.js.map → chunk-HMA63UEO.js.map} +1 -1
  28. package/dist/{chunk-TBDR6PAI.js → chunk-IZCEK2HR.js} +2 -2
  29. package/dist/{chunk-SD2YFWQQ.js → chunk-KKWJD5E6.js} +20 -20
  30. package/dist/chunk-KKWJD5E6.js.map +1 -0
  31. package/dist/{chunk-KWRRMR3J.js → chunk-LO6IOIJ2.js} +10 -10
  32. package/dist/chunk-LO6IOIJ2.js.map +1 -0
  33. package/dist/{chunk-E4GH6USR.js → chunk-NZEQVRH5.js} +2 -2
  34. package/dist/chunk-NZEQVRH5.js.map +1 -0
  35. package/dist/{chunk-MPQWFX6Y.js → chunk-PSWWQXHF.js} +13 -88
  36. package/dist/chunk-PSWWQXHF.js.map +1 -0
  37. package/dist/{chunk-Q5LIB7BC.js → chunk-S4SYLDFX.js} +2 -2
  38. package/dist/chunk-S4SYLDFX.js.map +1 -0
  39. package/dist/{chunk-KW53MSA5.js → chunk-X74V6ESX.js} +2 -2
  40. package/dist/{chunk-QMUEXQJS.js → chunk-YBIGNSCZ.js} +81 -4
  41. package/dist/chunk-YBIGNSCZ.js.map +1 -0
  42. package/dist/{chunk-2KNZHH3P.js → chunk-Z6L6YSU6.js} +2 -2
  43. package/dist/{code-agent-session-BO8nCnv3.d.ts → code-agent-session-CPHRCb4-.d.ts} +1 -1
  44. package/dist/contract/index.d.ts +91 -43
  45. package/dist/contract/index.js +127 -17
  46. package/dist/contract/index.js.map +1 -1
  47. package/dist/{control-D6qwHXIR.d.ts → control-Doncu-B_.d.ts} +2 -2
  48. package/dist/control.d.ts +3 -2
  49. package/dist/control.js +2 -2
  50. package/dist/{corpus-B8A4BDR3.d.ts → corpus-D4YW9UoJ.d.ts} +1 -1
  51. package/dist/{default-registry-6dhErQbs.d.ts → default-registry-GyE8X5SP.d.ts} +3 -3
  52. package/dist/diagnose.d.ts +4 -3
  53. package/dist/diagnose.js +1 -1
  54. package/dist/{run-improvement-loop-DBahB8Ax.d.ts → gepa-C1NCIZ9o.d.ts} +117 -130
  55. package/dist/hosted/index.d.ts +5 -4
  56. package/dist/{index-Bx3gZ8xl.d.ts → index-_Y4oNOOb.d.ts} +1 -1
  57. package/dist/index.d.ts +76 -81
  58. package/dist/index.js +66 -31
  59. package/dist/index.js.map +1 -1
  60. package/dist/{insight-report-DWl3z9tl.d.ts → insight-report-BnRjTibG.d.ts} +1 -1
  61. package/dist/{kind-factory-0BhLSI27.d.ts → kind-factory-X3eDYbKn.d.ts} +2 -3
  62. package/dist/matrix/index.d.ts +1 -1
  63. package/dist/meta-eval/index.d.ts +3 -2
  64. package/dist/multishot/index.d.ts +4 -4
  65. package/dist/multishot/index.js.map +1 -1
  66. package/dist/openapi.json +1 -1
  67. package/dist/{pre-registration-mAnCugl9.d.ts → pre-registration-nfUdc9EQ.d.ts} +2 -42
  68. package/dist/{provenance-P-bCL2Fo.d.ts → provenance-CncDq9qE.d.ts} +26 -41
  69. package/dist/{release-report-BEbWmVYj.d.ts → release-report-pidWUMZ2.d.ts} +2 -2
  70. package/dist/reporting.d.ts +5 -4
  71. package/dist/{researcher-B0C2_fVO.d.ts → researcher-Jr8ME1dZ.d.ts} +2 -2
  72. package/dist/rl.d.ts +516 -515
  73. package/dist/rl.js +612 -612
  74. package/dist/rl.js.map +1 -1
  75. package/dist/{rubric-predictive-validity-Cy_W-hWZ.d.ts → rubric-predictive-validity-C2hDKM8Z.d.ts} +1 -1
  76. package/dist/{run-campaign-7WNXMDSN.js → run-campaign-WXY7KI67.js} +2 -2
  77. package/dist/{run-record-e7vj1uZQ.d.ts → run-record-CP2ObebC.d.ts} +14 -18
  78. package/dist/{runtime-trajectory-BDgfGZSr.d.ts → runtime-trajectory-BOUUjI0y.d.ts} +1 -1
  79. package/dist/{semantic-concept-judge-B9MgmBnM.d.ts → semantic-concept-judge-DSBB2Cfp.d.ts} +2 -2
  80. package/dist/{summary-report-BDOFevaT.d.ts → summary-report-CInXwsza.d.ts} +1 -1
  81. package/dist/testing-C21CHsq2.d.ts +20 -0
  82. package/dist/testing.d.ts +1 -0
  83. package/dist/testing.js +8 -0
  84. package/dist/testing.js.map +1 -0
  85. package/dist/traces.d.ts +26 -10
  86. package/dist/traces.js +41 -11
  87. package/dist/{types-Ce17tDlG.d.ts → types-B5x54y6n.d.ts} +1 -1
  88. package/dist/{types-mn5Aqk7x.d.ts → types-BUxNaJ8c.d.ts} +2 -4
  89. package/dist/{types-BU-7W85F.d.ts → types-DQRY8ZT-.d.ts} +60 -58
  90. package/dist/workflow/index.d.ts +5 -4
  91. package/dist/workflow/index.js +1 -1
  92. package/docs/campaign-proposers.md +170 -0
  93. package/docs/concepts.md +8 -4
  94. package/docs/customer-journeys.md +15 -13
  95. package/docs/design/loop-taxonomy.md +34 -66
  96. package/docs/distributed-driver.md +14 -14
  97. package/docs/feature-guide.md +1 -1
  98. package/docs/hosted-ingest-spec.md +2 -3
  99. package/docs/multi-shot-optimization.md +8 -8
  100. package/docs/product-eval-adoption.md +1 -1
  101. package/docs/self-improvement-map.md +33 -29
  102. package/package.json +8 -14
  103. package/dist/chunk-2K6UUZ7P.js.map +0 -1
  104. package/dist/chunk-CTBHKLEU.js.map +0 -1
  105. package/dist/chunk-E4GH6USR.js.map +0 -1
  106. package/dist/chunk-EGPMSBEZ.js.map +0 -1
  107. package/dist/chunk-KWRRMR3J.js.map +0 -1
  108. package/dist/chunk-MIFZUPEK.js.map +0 -1
  109. package/dist/chunk-MPQWFX6Y.js.map +0 -1
  110. package/dist/chunk-Q5LIB7BC.js.map +0 -1
  111. package/dist/chunk-QMUEXQJS.js.map +0 -1
  112. package/dist/chunk-SD2YFWQQ.js.map +0 -1
  113. package/docs/design/external-agent-wedge.md +0 -89
  114. package/docs/design/phase-d-rfc.md +0 -125
  115. package/docs/design/phase4-consumer-migration.md +0 -70
  116. package/docs/design/primitives-integration-spec.md +0 -393
  117. package/docs/design/product-self-improvement-loop.md +0 -146
  118. package/docs/design/self-improvement-engine.md +0 -140
  119. package/docs/design/self-improvement-protocol.md +0 -223
  120. package/docs/design/self-improvement-roadmap.md +0 -106
  121. package/docs/design/substrate-gaps.md +0 -118
  122. package/docs/phase-b-pairing-kit.md +0 -188
  123. package/docs/phase-b-runbook.md +0 -176
  124. package/docs/pilot/README.md +0 -62
  125. package/docs/pilot/customer-checklist.md +0 -90
  126. package/docs/pilot/integration-foreign-stack.md +0 -296
  127. package/docs/pilot/integration-tangle-stack.md +0 -248
  128. package/docs/pilot/one-pager.md +0 -161
  129. package/docs/pilot/sample-insight-report.json +0 -172
  130. package/docs/quickstart-external.md +0 -229
  131. package/docs/research/belief-state-agent-eval-roadmap.md +0 -593
  132. package/docs/research/research-roadmap.md +0 -205
  133. package/docs/specs/driver-honest-spec.md +0 -251
  134. package/docs/specs/hermes-self-improvement-audit.md +0 -93
  135. package/docs/specs/profile-versioning.md +0 -291
  136. package/docs/three-package-architecture.md +0 -168
  137. /package/dist/{chunk-TBDR6PAI.js.map → chunk-IZCEK2HR.js.map} +0 -0
  138. /package/dist/{chunk-KW53MSA5.js.map → chunk-X74V6ESX.js.map} +0 -0
  139. /package/dist/{chunk-2KNZHH3P.js.map → chunk-Z6L6YSU6.js.map} +0 -0
  140. /package/dist/{run-campaign-7WNXMDSN.js.map → run-campaign-WXY7KI67.js.map} +0 -0
@@ -1,223 +0,0 @@
1
- # Self-improvement protocol — the world-class architecture
2
-
3
- **Status:** Strategic design. The artifact that every roadmap entry maps to.
4
- **Date:** 2026-05-27.
5
-
6
- ## Thesis
7
-
8
- **Self-improvement is a protocol, not a product.** We define the wire formats, surface abstractions, driver interface, gate interface, and insight format. We ship reference implementations. Customers plug in whatever framework, model, or runtime they already use — our infrastructure handles the rigorous middle (analysis, gating, version-safe deployment).
9
-
10
- No competitor ships this combination. LangSmith / Braintrust / Phoenix / LangFuse ship tracing. Hermes ships an agent. SkillOpt ships an academic optimizer. Anthropic's Claude Code ships skill-creation. **Nobody ships the protocol.**
11
-
12
- ## The pipeline as a single abstract flow
13
-
14
- ```
15
- ┌──────────────────────────────────────────────────────────────────────┐
16
- │ WHATEVER YOU ALREADY USE │
17
- │ LangChain · LlamaIndex · Anthropic SDK · OpenAI Assistants · │
18
- │ Hermes · Claude Code · Codex · agent-runtime · your own stack │
19
- └─────────────────────────────────┬────────────────────────────────────┘
20
- │ traces (any format)
21
-
22
- ┌──────────────────────────────────────────────────────────────────────┐
23
- │ INGEST — universal trace adapters │
24
- │ fromOtelSpans · fromFeedbackTable · fromLangChain · fromLlamaIndex ·│
25
- │ fromAnthropicSDK · fromOpenAISDK · fromHermesProfileLog · BYO │
26
- │ → canonical RunRecord[] │
27
- └─────────────────────────────────┬────────────────────────────────────┘
28
-
29
- ┌──────────────────────────────────────────────────────────────────────┐
30
- │ ANALYZE — analyzeRuns({ runs, baselineRuns?, userFeedback? }) │
31
- │ paired-bootstrap CI · Pareto · failure clusters · prior-period │
32
- │ delta · user-corrective-signal extraction · recommendations │
33
- │ ← THE STATISTICAL EDGE NOBODY ELSE SHIPS │
34
- └─────────────────────────────────┬────────────────────────────────────┘
35
-
36
- ┌──────────────────────────────────────────────────────────────────────┐
37
- │ IMPROVE — selfImprove() closed loop │
38
- │ gepaDriver · evolutionaryDriver · BYO ImprovementDriver │
39
- │ → ProfileDiff (versioned, hashed, content-addressable) │
40
- └─────────────────────────────────┬────────────────────────────────────┘
41
-
42
- ┌──────────────────────────────────────────────────────────────────────┐
43
- │ GATE — defaultProductionGate (paired-CI) · BYO gate │
44
- │ ship-substrate / ship-harness / merge / inconclusive │
45
- │ ← STATISTICALLY STRICTER THAN ANY COMPETITOR │
46
- └─────────────────────────────────┬────────────────────────────────────┘
47
-
48
- ┌──────────────────────────────────────────────────────────────────────┐
49
- │ DEPLOY — back into WHATEVER YOU ALREADY USE │
50
- │ agent-runtime · Hermes profile log · LangChain config · custom hook │
51
- └──────────────────────────────────────────────────────────────────────┘
52
- ```
53
-
54
- ## The integration promise
55
-
56
- Customers pick one of three integration shapes. All three work today (some are aspirational on adapter coverage). Every shape uses the same canonical types underneath.
57
-
58
- ### Shape A — offline analysis only
59
-
60
- You have traces, you want a decision packet. Zero LLM cost. Zero closed loop.
61
-
62
- ```typescript
63
- import { fromOtelSpans, analyzeRuns } from '@tangle-network/agent-eval'
64
-
65
- const runs = fromOtelSpans({ spans: mySpans })
66
- const report = await analyzeRuns({ runs })
67
- // → InsightReport with composite, recommendations, Pareto, ...
68
- ```
69
-
70
- Use case: dashboards, weekly post-mortems, "did anything regress" checks. The intelligence-kernel ships this.
71
-
72
- ### Shape B — closed loop, your runtime
73
-
74
- You have an agent, you want to improve it. We provide drivers + gate + insight. You decide when to deploy.
75
-
76
- ```typescript
77
- import { selfImprove, gepaDriver } from '@tangle-network/agent-eval'
78
-
79
- const result = await selfImprove({
80
- scenarios,
81
- agent: yourAgent, // any function (surface, scenario) → artifact
82
- judge: yourJudge, // any function (artifact) → JudgeScore
83
- baselineSurface,
84
- driver: gepaDriver({ llm, model, target }),
85
- budget: { generations: 3, populationSize: 4, holdoutFraction: 0.3 },
86
- })
87
- // → SelfImproveResult { baselineHash, diff, winningHash, lift, gateDecision, insight }
88
- ```
89
-
90
- Use case: every product agent we ship. Hermes-on-our-sandbox. Claude Code with skills. Anyone wanting "ship if statistically better, else hold."
91
-
92
- ### Shape C — hosted, cross-language
93
-
94
- You stream traces from anywhere, get InsightReports + selfImprove orchestration. Bills usage-based.
95
-
96
- ```sh
97
- # Stream traces
98
- curl https://api.tangle.tools/v1/ingest/otel \
99
- -H "Authorization: Bearer ${TANGLE_KEY}" \
100
- --data-binary @traces.jsonl
101
-
102
- # Get the decision packet
103
- curl https://api.tangle.tools/v1/insight/${runId}
104
-
105
- # Or run a closed-loop campaign
106
- curl https://api.tangle.tools/v1/improve \
107
- -d '{"scenarios": ..., "baselineHash": "...", "budget": {...}}'
108
- ```
109
-
110
- Use case: Python customers, Go customers, customers behind firewalls, customers who don't want to operate the substrate.
111
-
112
- ## The five non-negotiables
113
-
114
- The protocol claim only holds if all five of these survive integration. Customers shouldn't have to compromise on any.
115
-
116
- 1. **Universal ingest.** Any trace format → canonical RunRecord. Coverage: OTel ✓, multi-rater feedback ✓, LangChain ⏳, LlamaIndex ⏳, Anthropic SDK ⏳, OpenAI Assistants ⏳, Hermes profile log ⏳.
117
- 2. **Statistical rigor.** Every claim falsifiable. Paired bootstrap CI on lift, Cohen's d on effect size, MDE-aware sample-size recommendations, p-values. **SkillOpt's gate is literal `cand > current`. Hermes has no gate. Ours has all of the above.** This is the moat.
118
- 3. **Plug-in everything.** Driver, judge, gate, intake adapter, storage all swappable. Customer brings their LLM, their judge, their scenarios. We bring the rigor.
119
- 4. **Version-safe deployment.** AgentProfile is content-addressable. Two writers (harness + substrate) can both mutate without lost-update. Gate verdicts are scoped to baseline hash, not absolute. Tracked as #98.
120
- 5. **Cross-language wire format.** Python client at parity with TypeScript. Hosted ingest spec versioned. Customers in any language consume the same shape.
121
-
122
- ## Where we are honest about gaps
123
-
124
- | Component | Status | Customer impact when missing |
125
- |---|---|---|
126
- | `fromOtelSpans` ingest adapter | ✓ shipped 0.50.0 | — |
127
- | `fromFeedbackTable` multi-rater intake | ✓ shipped 0.50.0 | — |
128
- | `analyzeRuns` decision packet | ✓ shipped 0.50.0 / 0.50.2 actionability | — |
129
- | `selfImprove` closed loop | ✓ shipped 0.50.0 | — |
130
- | Paired-bootstrap gate | ✓ shipped early; still our edge | — |
131
- | `gepaDriver` reflection (not full Pareto — task #101) | ⚠ partial | OK; customers don't need Pareto until plateau hit |
132
- | **Prior-period comparison** in `analyzeRuns` | ✗ MISSING | "Did my last change help?" — the #1 customer question — has no rigorous answer today |
133
- | **User-corrective-feedback signal extraction** | ✗ MISSING | Hermes' first-class skill signal. We have the trace data. We don't mine it. |
134
- | **`init` CLI** scaffolding canonical eval/ layout | ✗ MISSING | Every new consumer wires it by hand; the skill describes 80 lines they have to copy |
135
- | **Framework-specific intake adapters** (LangChain, LlamaIndex, Anthropic SDK, OpenAI Assistants) | ✗ MISSING | Customers using these frameworks can't ingest without writing custom adapter code |
136
- | **Profile versioning** (task #98) | ✗ MISSING | Offline/online drift; gate verdicts can be stale by the time they're applied |
137
- | **Composite driver** (optimize all surfaces against one gate) | ✗ MISSING | Customers can optimize prompts OR skills, not both jointly |
138
- | **Empirical proof drivers work** | ✗ MISSING | We've never published "we ran gepaDriver on real customer data, here's the lift CI" |
139
- | Hosted-tier production launch | ⚠ in scaffolding (intelligence-kernel) | Customers must self-host today |
140
-
141
- ## The roadmap — what closes each gap
142
-
143
- Mapping every roadmap entry back to a concrete protocol gap.
144
-
145
- ### 0.53.0 (this session-or-next) — answer "did my last change help?"
146
-
147
- - **`analyzeRuns({ runs, baselineRuns? })`** — when `baselineRuns` is provided, the report includes a `priorPeriodComparison?` block: per-metric delta with paired-bootstrap CI, MDE-aware significance judgment, "regressed metrics" surfaced in `recommendations`.
148
- - Built on top of existing `diffRuns()` primitive (already shipped 0.48.0).
149
- - 1 PR. Pure additive surface.
150
- - **Customer impact**: this is the conversion question for every prospect.
151
-
152
- ### 0.54.0 — extract Hermes' missing signal
153
-
154
- - **`extractUserCorrections(runs)`** — new substrate primitive. Mines user messages in traces for corrective markers (regex pass + LLM classifier for nuance). Returns `UserCorrectionEvent[]` keyed by runId.
155
- - `analyzeRuns({ runs, userFeedback? })` includes a "common corrections" cluster in `recommendations`.
156
- - Bridge to Hermes-style signal without adopting Hermes' runtime.
157
- - **Customer impact**: distinctive — no competitor mines this signal.
158
-
159
- ### 0.55.0 — framework-specific intake adapters
160
-
161
- - **`fromLangChain(traces)`**, **`fromLlamaIndex(traces)`**, **`fromAnthropicSDK(traces)`**, **`fromOpenAIAssistants(traces)`**.
162
- - Each maps the framework's native trace shape to RunRecord.
163
- - Top 4 frameworks = 80% of agent-builder market coverage.
164
- - **Customer impact**: removes "we don't support your framework" friction.
165
-
166
- ### 0.56.0 — `init` CLI + worked examples
167
-
168
- - `pnpm dlx @tangle-network/agent-eval init` scaffolds the canonical `eval/scenarios.json` + 3 pnpm scripts + judges template + `.runs/` directory.
169
- - Adds 5+ end-to-end runnable examples covering Shapes A/B/C across the 4 framework adapters.
170
- - **Customer impact**: time-to-first-eval drops from 4 hours to 5 minutes.
171
-
172
- ### 1.0.0 — profile versioning (#98) + composite driver
173
-
174
- - Content-addressable `AgentProfileVersion` + `ProfileDiff` + 3-way merge + 4-way `DriftGateDecision`.
175
- - `compositeDriver` — optimize all surfaces of one AgentProfile against one gate.
176
- - Hermes-on-sandbox forcing function validates the work before commit.
177
- - **Customer impact**: production-safe; the moat is locked.
178
-
179
- ### 1.1.0 — empirical-proof publication
180
-
181
- - Pick one named customer or one synthetic-realistic corpus (legal-agent canonical).
182
- - Run gepaDriver end-to-end with real LLM cost.
183
- - Publish: "n=, lift=, CI=, p=, $cost=, vs no-driver baseline."
184
- - One blog post, one demo video, one runnable repro.
185
- - **Customer impact**: every other claim becomes credible because this one is verified.
186
-
187
- ## Why this design is 100x
188
-
189
- Not a 10% improvement over LangSmith. A category change.
190
-
191
- | Capability | LangSmith / Braintrust / Phoenix | Hermes / Claude Code | Tangle (target) |
192
- |---|---|---|---|
193
- | Trace ingest | ✓ proprietary | ✓ own runtime | ✓ universal |
194
- | Decision packet | ⚠ scorecards (no CI) | ✗ | ✓ paired-bootstrap |
195
- | Closed loop | ✗ | ✓ heuristic | ✓ statistically rigorous |
196
- | Plug-in drivers | ✗ | ✗ | ✓ |
197
- | Profile versioning | ✗ | ✗ | ✓ (1.0.0) |
198
- | Composite multi-surface | ✗ | ✗ | ✓ (1.0.0) |
199
- | Cross-language | ✗ | ✗ | ✓ (Python at parity) |
200
- | Empirical-proof publication | ✗ | ✗ | ✓ (1.1.0) |
201
-
202
- Eight rows. Nobody else has eight. We can be the only one. The work is named, scoped, and queued.
203
-
204
- ## What's NOT on the roadmap (and why)
205
-
206
- - **Building our own agent runtime.** Hermes / agent-runtime / Claude Code cover that. We are infrastructure, not a runtime.
207
- - **Single-vendor LLM.** Substrate stays model-agnostic.
208
- - **UI-first product.** API-first. UIs are downstream.
209
- - **LangChain replacement.** Wrong layer.
210
- - **"Self-improvement" without a held-out gate.** Hermes and SkillOpt both ship this; we explicitly refuse — every selfImprove() requires a holdout.
211
-
212
- ## Decision log — what we committed to in 0.52.0 → 1.0.0
213
-
214
- 1. **`skillOptDriver` removed; behavior in `gepaDriver({ constraints })`** — 0.52.0 ✓ shipped
215
- 2. **Honest spec docs** — 0.52.0 ✓ shipped
216
- 3. **Profile-versioning spec with symmetric-fork framing** — 0.52.0 ✓ shipped
217
- 4. **No V2 names anywhere** — enforced
218
- 5. **Forcing-function gate on profile-versioning work** — Hermes-on-sandbox experiment required before phases 1-5 commit
219
- 6. **Single-PR-per-repo discipline** — enforced 0.52.0 onwards
220
- 7. **Prior-period comparison as 0.53.0** — committed; the customer-conversion primitive
221
- 8. **User-feedback extraction as 0.54.0** — committed; the Hermes-signal bridge
222
- 9. **Framework intake adapters as 0.55.0** — committed; 80% market coverage
223
- 10. **Empirical-proof publication as 1.1.0** — committed; the credibility lock
@@ -1,106 +0,0 @@
1
- # Self-Improvement Substrate — Closed-Loop Roadmap
2
-
3
- Single source of truth for the agent self-improvement program: the architecture decisions, the end-to-end loop, and a completable checklist. Companion to [`self-improvement-engine.md`](./self-improvement-engine.md) (the phase diagram) — this doc is the *execution* plan.
4
-
5
- ## North star
6
-
7
- One system under test. **Prod chat == eval == benchmark == self-improvement candidate** all run through the same execution path — a trading-desk backtester you also deploy live. Every improvement is *measured* against that path before it ships, on **any model**, with the full evidence vector preserved (never a scalar collapse).
8
-
9
- ## The closed loop (what we are completing)
10
-
11
- ```
12
- RUN ───────────► OBSERVE ─────────► DIAGNOSE ─────────► PROPOSE ─────────► EVALUATE ─────────► GATE ─────────► PROMOTE ──┐
13
- (ExecutionEnv: (OTLP traces, (EYES: competing (HANDS: competing (evidence VECTOR: (pluggable, (PR / config) │
14
- chat=eval= RunRecords) analysts/HALO → drivers → per-dim judges + versioned, │
15
- benchmark) AnalystFinding[]) candidates) Pareto frontier + benchmarkable │
16
- ▲ counterfactual) POLICIES) │
17
- └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
18
- ```
19
-
20
- Two architectural invariants, both load-bearing:
21
-
22
- ### Invariant 1 — Unify the *contract*, pluralize the *strategies*. Never collapse the vector.
23
-
24
- The temptation ("merge the two loops under one gate") is wrong if it means one scalar criterion. The correct design, mirroring a quant desk:
25
-
26
- - **Evidence Bus** — a typed, high-dimensional record. Every judge dimension, every driver's proposal, every finding, every counterfactual verdict is preserved. Backed by what we already have: per-dimension `JudgeScore`, `computeParetoFrontier` (`pareto.ts`), the per-driver `DriverComparison` rows (`compare-drivers.ts`). **Nothing is averaged away.**
27
- - **Proposers** — gepa, skill-opt, evolutionary, analyst-findings, HALO, memory-curation, ACE, and *whatever ships next year* — all implement one `ImprovementDriver`/proposer contract and **compete** on the bus, each proposing different changes. `compareDrivers` already runs this head-to-head; make it first-class for findings-driven proposers too.
28
- - **Promotion Policies** — pluggable, versioned, and themselves benchmarkable. A policy is a function over the evidence *vector* (Pareto-dominance + per-dimension significance + safety gates), **not** a scalar threshold. Different loops may run different policies; policies compete and are A/B-backtested like strategies.
29
-
30
- The only thing that is truly *shared* is the **interface** (evidence schema + proposer contract + policy contract). New loops plug in forever. The one non-negotiable: a write path (the findings loop's auto-apply) must flow through *a* policy — today it ships on a bare confidence float with none. Plurality of policies, yes; zero policy on a git-write, no.
31
-
32
- ### Invariant 2 — Everything is a versioned, benchmarkable surface. Including the signatures.
33
-
34
- Prompts are already optimizable surfaces (GEPA via `analyst-surface.ts`). The **signatures/schemas themselves** (Ax I/O contract, the `AnalystFinding` schema, the kind taxonomy) are currently hand-fixed and unsearched. Three layers, staged by cost:
35
-
36
- - **(a) Fix known-wrong structure now** — empirically caught, not speculative. The `subject` grammar rejected a valid finding; the kind taxonomy had no "successful-but-suboptimal" lens. → Track A.
37
- - **(b) Make signatures/schemas versioned + A/B-benchmarkable** through `compareDrivers` (e.g. `findings:json[]` vs `report, findings:json[]` becomes a measured choice). → Track A.
38
- - **(c) Search signature *structure* + let the analyst critique its own schema** (run the trace-analyst on its own runs; a "schema-fit" finding like "I dropped a row because subject grammar X" — we already have the first such data point). Program/architecture search, expensive, discrete. → **Track B research. Must not block shipping.**
39
-
40
- ---
41
-
42
- ## Track A — Ship (weeks). In-substrate, proven mechanism, properly tested.
43
-
44
- ### A0. Analyst → model-agnostic, HALO-parity *(the live problem; ~2–3 wks to a measured result)*
45
-
46
- Root cause (probe-verified): our Ax-RLM **fuses** reasoning + JS-sandbox + a strict typed-array emission into every turn; a weak model resolves the fused contract by emitting nothing. HALO **decouples** exploration (free-form + native tool-calls, no schema) from structuring (a deferred sub-call). Fix = decouple + recover-don't-drop + deterministic reducers (the real any-model guarantee) + the right lens.
47
-
48
- - [x] **A0.1 — Recover the dropped finding (0→1, deterministic).** Widen cluster regex to admit `.`/`_` (exclude `:` — no prefix collision); fix `deriveQuestion` to pass a task directive, not the bare kind id. *Done — `finding-subject.ts:173`, `kind-factory.ts:224`; regression tests in `finding-subject.test.ts` (dotted-subject accepted + prefixed-subjects still route); 93 analyst tests green.*
49
- - [x] **A0.2 — Forgiving pre-parser** — `src/analyst/parse-tolerant.ts` (`stripCodeFences`/`coerceJson`/`coerceToFindingRows`), wired into `parseRawFinding` (coerce-then-retry before dropping). *Done — 3 tests incl. the arXiv:2605.02363 fence case.*
50
- - [x] **A0.3 — Deterministic behavioral reducers + analyst** (the any-model keystone). `src/trace-analyst/behavioral-metrics.ts` (`computeTraceMetrics` + signal detectors) + `src/analyst/behavioral-analyst.ts` (`behavioralAnalyst`, `cost.kind:'deterministic'`, + `deriveEfficiencyFindings`). *Done — went past "reducers feeding a prompt": the behavioral class is emitted DIRECTLY by a zero-LLM analyst, so it's any-model by construction (not per-model-measured). E2E on the real `530b157_1`: **4 findings exactly matching HALO's four** (13.1× input growth, 157→75 output decay, 7× single-tool, no self-verify), `status:ok`, deterministic cost. 7 unit tests + 94 suite green.*
51
- - [x] **A0.4 — Two-phase: free-form `report` + structuring pass.** Ax signature → `report:string, findings:json[]`; `structureFindings` wired into `kind-factory` as opt-in recovery on an empty harvest. **Round-trip live-validated on deepseek** (the `report` populates through Ax's responder; no regression — failure-mode still emits its finding; full suite 1720 green).
52
- - [ ] **A0.5 — New `efficiency` kind + broaden `failure-mode`.** Non-error-scoped, seeded with the `behavioral` block (HALO's 4 diagnoses); add the `span.attributes['llm.input_tokens']` projection hint. ~2d.
53
- - [x] **A0.6 — Fail-loud on empty harvest.** `kind-factory` surfaces a visible `info` finding (`outcome: extraction_failed`) carrying the actor's report when the harvest is empty + the report is substantive (≥200 chars); a short/no-report empty stays empty (no false-fire). **Live-validated on deepseek:** `improvement` went from a *silent 0* to a visible report-bearing finding.
54
-
55
- **Gen-2 also shipped (not in the original A0 list):** `buildDefaultAnalystRegistry` (`src/analyst/default-registry.ts`) — the missing "default suite" primitive: always registers the deterministic `behavioralAnalyst`, adds the agentic kinds when an `ai` is supplied. Carries the **any-model CI regression gate** (≥4 behavioral findings, no LLM). Consumers stop hand-wiring `new AnalystRegistry()`.
56
- - [ ] **A0.7 — Reflexion retry** in agent-runtime `runAnalystLoop` (the one piece that belongs in runtime, not substrate): Evaluator checks the harvest, on `extraction_failed` appends a critique and retries once. Add a **per-analysis call-count budget** (critique: the pipeline adds ≤4 model calls vs HALO's 1). ~1–2d.
57
- - [ ] **A0.8 — Terminal gate (reframed, honest).** Re-run the probe on `530b157_1` with deepseek-chat **and** moonshot-v1-128k via the `efficiency` kind; assert ≥4 findings, ≥3 overlapping HALO's four. **Prove with the structurer disabled** (reducer-seeded prose alone) so "any model" is *measured*, not assumed. Wire as a `compareDrivers`/`runProfileMatrix` CI invariant; GEPA-optimize the structurer + efficiency prompts vs goldens for the compounding lift number. ~2–3d.
58
-
59
- > Honest scorecard: A0.1 is a proven 0→**1** *correctness* finding (zero overlap with HALO's 4 behavioral findings). HALO-parity (≥4) rests on A0.3+A0.5 and is a **hypothesis to measure**, not yet a result.
60
-
61
- ### A1. Evidence Bus + competing pluggable policies *(Invariant 1; ~2–3 wks)*
62
-
63
- - [x] **A1.1 — Light the dead EYES→HANDS wire.** SHIPPED (PR #161): `renderAnalystEvidence(findings, report)` (severity-ranked, capped, duck-typed) wired into both `gepaDriver` (reflection prompt) and `skillOptDriver` (`findingsNote` → `buildPatchPrompt`); a mutation now targets a NAMED diagnosed root cause, not just low-scoring trials. Loop closure: `runOptimization` gained `analyzeGeneration` — after each generation's candidates score, the producer re-diagnoses and the fresh findings REPLACE `ctx.findings` for the next generation's `propose()` (generic — no analyst import; consumer plugs its registry/HALO). 6 deterministic tests (each driver injects findings+report; producer feeds gen N→N+1; no-producer path stays static). *Remaining (live):* the `compareDrivers` findings-fed vs findings-blind lift CI — an LLM run, not deterministic-shippable.
64
- - [x] **A1.2 — Promotion-policy contract.** SHIPPED (PR #161): `buildEvidenceVector` (the bus) + `PromotionPolicy = (ev) => GateResult` + `paretoPolicy` (symmetric multi-objective — every axis is gain-source AND floor; ship iff candidate weakly dominates baseline at the confidence level; floor breach → hold, insufficient evidence → need_more_work, no-op → hold) + `paretoSignificanceGate` (bus + policy as a `Gate`, composes via `composeGate`, default loop unchanged). One `contributingGate` per axis — no scalar collapse. `policy?` override runs competing strategies over one bus. Reuses `pairHoldout`/`pairedBootstrap`/`detectScale`. 9 deterministic tests. Policy *registry* + auto-A/B-backtest deferred (needs a labeled promote/rollback corpus).
65
- - [ ] **A1.3 — Route the findings-loop write path through a policy.** agent-runtime `run-analyst-loop.ts` auto-apply flows through a substrate-exported policy instead of the bare confidence float. (Runtime calls down — no upward dep.)
66
- - [ ] **A1.4 — MAST-typed findings.** `analyst/types.ts` `area:string` → a MAST-aligned enum reconciled with `FailureClass` (drop multi-agent-only modes). Counterfactual verification (extend `counterfactual.ts` → `verifyFindingCausally`) on a *sampled/triaged* subset, not every finding (frontier LLMs attribute <10% zero-shot — budget it).
67
-
68
- ### A2. More drivers *(fast wins; days each)*
69
-
70
- - [x] **A2.1 — ACE driver** SHIPPED (PR #161, `src/campaign/drivers/ace.ts`): delta-structured append-mostly playbook — appends provenance-tagged `- [gN] <lesson>` deltas, preserves existing verbatim (anti context-collapse, arXiv:2510.04618), idempotent on recurring findings, FIFO-evicts oldest on overflow (never merges), deterministic, fail-loud. Reuses the shared finding→text helpers (`_findings-text.ts`; memory.ts refactored onto them). 7 deterministic tests. *Remaining (live, same plateau as A1.1):* the `compareDrivers`-on-AppWorld CI'd head-to-head vs gepa/memory — needs the AppWorld env + an open model. Deferred the formal `playbook` MutableSurface kind (string surface suffices for the append-only mechanism).
71
- - [ ] **A2.2 — `majorityVoteReward`** (`rl/verifiable-reward.ts`): TTRL consensus pseudo-labels over best-of-N fanout, **verifiable subset only** (tax by-line, AppWorld — out of scope for rubric domains), through `heldoutSignificance` + the reward-hacking guard. ~2–3d.
72
-
73
- ### A3. Execution-Environment seam *(the keystone; ~3–4 wks, staged, highest blast radius)*
74
-
75
- The one-SUT precondition. Specced at `agent-spine.md:58`, never built (zero code refs). `src/loops` and `src/conversation` share zero code today (loop kernel lacks the journal/idempotency/circuit-breaker the conversation kernel has).
76
-
77
- - [ ] **A3.1 — Define `ExecutionEnvironment`** (`agent-runtime/src/loops/execution-environment.ts`): `{ tools(), invoke(call), workspace, artifacts() }` with `WorkerEnv`/`SandboxEnv`/`DispatchEnv` impls. Additive; `runLoop` accepts an env, default preserves current path.
78
- - [ ] **A3.2 — Route eval + benchmark + self-improve through it** (lowest-risk paths first). *Gate:* one AppWorld run and one self-improve campaign through the **same** `DispatchEnv` → identical `RunRecord` shape + trace correlation.
79
- - [ ] **A3.3 — Lift the conversation kernel's distributed primitives** (`journal-sql.ts`/`turn-id.ts`/`call-policy.ts`) into the shared layer; migrate the conversation kernel **last**, behind a deletable shim once parity is proven.
80
-
81
- ---
82
-
83
- ## Track B — Research (months, uncertain). Flagship bets; must NOT block Track A.
84
-
85
- - [ ] **B1 — Logprob-free causal step credit-assignment** (`rl/belief-delta.ts`): ΔP(success) via ablate-and-replay through the opaque `DispatchFn` (no logprobs — the regime everyone ships on; `process-reward.ts:29-33` concedes the gap). Publish a labeled attribution benchmark + leaderboard. *Risk:* replay non-determinism vs N; tool side-effects break replay. SOTA: AgenTracer (2509.03312).
86
- - [ ] **B2 — Self-distilled small models** (offline): an RLM trace-analyst + a causal-attribution model trained on our corpus exhaust (traces + outcome truth + causally-verified MAST-typed findings). Removes the frontier-root-LM dependency → kills 0-findings brittleness at the root. *Gated on:* B1 producing enough labels + a data-governance/redaction story. SOTA: AgenTracer-8B beats Gemini-2.5-Pro +18%.
87
- - [ ] **B3 — AZR self-play curriculum with a published anti-reward-hacking guarantee** (`drivers/proposer.ts`): a driver that *emits* scenarios, scored by learnability variance, gated by the reward-hacking detector + bootstrap-CI. The *guarantee* (non-collapse over cycles) is the research deliverable, not a mitigated risk. SOTA: Absolute Zero (2505.03335), TTRL.
88
- - [ ] **B4 — Signature-structure search + analyst-self-schema-critique** (Invariant 2, layer c): a meta-driver that proposes signature/schema variants and benchmarks them; a "schema-fit" analyst kind that critiques the finding schema. Architecture search — expensive, discrete.
89
- - [ ] **B5 — Trainable rubric reward models as product** (`rl/rubric-reward-export.ts`) + a Vertical Reward-Model leaderboard. Hypothesis: production-grounded GenRMs beat synthetic OOD. SOTA: GenRM (2410.12832).
90
- - [ ] **B6 — Verified Vertical RL-Environment Exchange** (`exportVerifiersEnvironment`): wrap `MultiLayerVerifier` as a PrimeIntellect-verifiers Environment so every product agent auto-publishes a verified vertical RL env. *Blocked on legal/compliance for regulated traces (see Out of Scope).*
91
-
92
- ---
93
-
94
- ## Out of scope (now) — not an engineering sprint
95
-
96
- - Reselling/open-weighting on regulated tax/legal traces: PII/privilege/consent/membership-inference. Legal + compliance gated. B2/B6 must train only on a redacted, consented, gold-ladder-admitted slice; the de-identification pipeline for financial/legal artifacts is itself unsolved.
97
-
98
- ## Research difficulty index
99
-
100
- | Easy (days) | Medium (1–4 wks) | Hard / research (months) |
101
- |---|---|---|
102
- | A0.1✓ A0.2 A0.3 A0.5 A0.6 A2.1 A2.2 | A0.4 A0.7 A0.8 A1.* A3.* B5 | B1 B2 B3 B4 B6(+legal) |
103
-
104
- ## Verification discipline (every box)
105
-
106
- Real e2e (mock only at process boundaries), name the regression each test catches, extend the existing suite, assert exact shapes/CIs, adversarial inputs, fail-loud. The `530b157_1` probe is the analyst-track instrument throughout; `compareDrivers`/`runProfileMatrix` is the CI forcing-function for every driver and the any-model parity gate.
@@ -1,118 +0,0 @@
1
- # Substrate gaps — design-partner readiness
2
-
3
- What's missing from `@tangle-network/agent-eval` substrate (this repo) and `~/code/agent-dev-container/products/intelligence/` (the orchestrator) to credibly hand to a first design partner.
4
-
5
- This doc is the engineering-side mirror of `~/company/gtm/experiments/2026-05-27/design-partner-readiness.md` — gtm tracks the partner-facing readiness, this tracks the code that backs each bar.
6
-
7
- ## Current substrate state
8
-
9
- Shipped in v0.47:
10
- - `selfImprove({ scenarios, judges, dispatch, hostedTenant })` one-shot helper
11
- - `defaultProductionGate(deltaThreshold)` autonomous-ship gate
12
- - Wire format frozen at `HOSTED_WIRE_VERSION = '2026-05-26.v1'`
13
- - `/hosted/client.ts` — bearer auth, idempotency, bounded retries on 5xx/408/429
14
- - `examples/hosted-ingest-server/` — reference receiver implementing the spec
15
- - `docs/hosted-ingest-spec.md` — semver-locked wire spec
16
- - `docs/design/phase-d-rfc.md` — scope decisions + deferred items
17
- - `docs/quickstart-external.md` — foreign-agent quickstart
18
- - `docs/phase-b-pairing-kit.md` — partner discovery script
19
- - `adapters/langchain` + `adapters/http`
20
-
21
- ## Engineering gaps keyed to first-partner readiness
22
-
23
- ### Substrate gaps (this repo)
24
-
25
- **S1. TraceAI/OTel adapter (`adapters/traceai`).**
26
- Future AGI's `traceai` library is the strongest OTel-native instrumentation in the TS ecosystem. Partners using it should be able to wire its emitted spans into our hosted ingest via one config line. The adapter receives OTel spans, normalizes them to `TraceSpanEvent`, ensures the `tangle.runId` attribute is present, and forwards via the existing hosted client.
27
-
28
- Path: `src/adapters/traceai.ts`. Export from `tsup.config.ts`. Add to `docs/adapters-observability.md`.
29
-
30
- Estimate: 6-8h. Owner: claude. Priority: medium (Tier C in partner-readiness — defer until first partner asks, but pre-build the contract).
31
-
32
- **S2. Run-diff data primitive.**
33
- The orchestrator needs to render "v3 vs v4" comparisons. The substrate should expose a `diffRuns(runA: EvalRunEvent, runB: EvalRunEvent): RunDiff` helper that computes cell-by-cell judge-score deltas, artifact-text diff (using a stable diff algorithm), and lift summary. Without this, every consumer rebuilds the diff logic.
34
-
35
- Path: `src/contract/diff.ts`. Add to `/contract` entry.
36
-
37
- Estimate: 4-6h. Owner: claude. Priority: high (orchestrator's run-diff view depends on this).
38
-
39
- **S3. Sampling controls in hosted client.**
40
- The Phase D RFC flags trace sampling as an open question. Add `sampling: { traces: number /* 0-1 */ }` to `createHostedClient` options. Default 1.0. Document the cost implication. Reservoir-sample if over budget.
41
-
42
- Path: `src/hosted/client.ts`. Update `docs/hosted-ingest-spec.md` accordingly.
43
-
44
- Estimate: 2h. Owner: claude. Priority: medium (Tier B partner-readiness).
45
-
46
- **S4. Auto-instrumentation library (`@tangle-network/agent-eval/auto`).**
47
- LangSmith's `@traceable` decorator + auto-wrap of OpenAI/Anthropic SDKs is their highest-leverage adoption tool. Build the equivalent: a `traceable()` HOF that emits OTel spans with `tangle.runId` attribute and forwards via the hosted client. Optional auto-wrap of `OpenAI` / `Anthropic` SDK clients.
48
-
49
- This is the biggest unlock for non-LangChain TS partners. Defer until at least one partner asks — pre-shipping costs 16-20h and may be the wrong shape without partner signal.
50
-
51
- Path: `src/auto/index.ts` (new entry). Estimate: 16-20h. Owner: claude. Priority: low (Tier C — defer).
52
-
53
- **S5. Surface-confidentiality option in wire format.**
54
- RFC open question 1. Add `surfaceMode: 'verbatim' | 'hashed' | 'omitted'` to `selfImprove` config. When `'hashed'`, ship `surfaceHash` instead of `surface` on the eval-run event. When `'omitted'`, ship neither.
55
-
56
- This is partner-shaped — wait for the first conversation. But the wire format should accommodate it without a breaking version bump. Add the optional field to types now.
57
-
58
- Path: `src/hosted/types.ts` (add `surfaceHash?: string`). Estimate: 1h to land the type change; later partner work to wire selfImprove. Priority: low until asked.
59
-
60
- ### Orchestrator gaps (`agent-dev-container/products/intelligence/`)
61
-
62
- These are the gtm-doc's Tier A items rephrased for engineering tracking.
63
-
64
- **O1. Adversarial tenant-isolation test suite.**
65
- `tests/auth.test.ts` exists. Need `tests/isolation.test.ts` covering: cross-tenant header mismatch, cross-tenant `/v1/runs/:id` reads, webhook tenant scoping, idempotency-key tenant scoping, raw-SQL cross-tenant query, JWT replay after revocation. Use `VITEST_INTEGRATION=1` with a real Postgres in CI.
66
-
67
- Estimate: 4-6h. Owner: claude. Priority: **critical** (blocker for any partner conversation).
68
-
69
- **O2. Web dashboard MVP.**
70
- List runs + run detail + login. See gtm doc A2 for shape. Pages: `/login`, `/runs`, `/runs/:id`, `/keys`. Use `intelligence-web` Vite scaffold; wire to `/v1/runs*` reads.
71
-
72
- Estimate: 12-16h. Owner: claude. Priority: **critical** (without UI, partner can't show anyone in their org).
73
-
74
- **O3. Free-tier plan limits enforcement.**
75
- `lib/plans.ts` defines limits. `routes/ingest.ts` does not enforce them. Add per-tenant counters (eval-runs/mo, trace-spans/day), check against plan, return 429 with clear message + reset time on exceed.
76
-
77
- Estimate: 3-4h. Owner: claude. Priority: medium (Tier B partner-readiness).
78
-
79
- **O4. Stale README sweep.**
80
- `api/README.md` lists T0-3..T0-8 as "next/pending" when 5 of them are shipped. Broken link to `../../../docs/intelligence-product-rfc.md` (gitignored path; should be `../RFC.md`).
81
-
82
- Estimate: 30min. Owner: claude. Priority: **must-fix-now** (5-min job, awful first impression for anyone reading the repo).
83
-
84
- **O5. Onboarding partner-facing doc.**
85
- Engineer-shaped `quickstart-external.md` exists in this repo. Partner-facing 10-minute walkthrough does not. Lives at `intelligence.tangle.tools/docs` once provisioned; for now, write at `products/intelligence/docs/partner-onboarding.md`.
86
-
87
- Estimate: 2-3h. Owner: claude. Priority: high (Tier A — needed for any partner call).
88
-
89
- ## Recommended sequencing (engineering view)
90
-
91
- **Sprint 1 — partner-ready (≤ 1 week):**
92
- - O4 (README sweep) — ship today
93
- - O1 (isolation tests) — 4-6h
94
- - O2 (dashboard MVP) — 12-16h
95
- - O5 (partner onboarding doc) — 2-3h
96
- - S2 (run-diff primitive) — 4-6h (substrate side of O2 follow-up)
97
-
98
- Total: ~25-32h focused work. One engineer-week.
99
-
100
- **Sprint 2 — concurrent with first partner conversations:**
101
- - O3 (plan limits enforcement) — partner will hit it
102
- - S3 (trace sampling) — partner will ask about cost
103
-
104
- **Sprint 3 — after first partner ships to prod:**
105
- - S1 (TraceAI adapter)
106
- - Stripe billing wire-up in orchestrator
107
-
108
- **Holding for partner signal:**
109
- - S4 (auto-instrumentation library) — 16-20h speculative without ask
110
- - S5 wiring (surface confidentiality) — partner-shaped
111
-
112
- ## Cross-references
113
-
114
- - `docs/design/phase-d-rfc.md` — substrate scope decisions (this doc operationalizes its "what's deferred until Phase B")
115
- - `docs/hosted-ingest-spec.md` — wire format spec (any change here is a wire-version bump)
116
- - `~/company/gtm/experiments/2026-05-27/design-partner-readiness.md` — partner-facing readiness, mirrors this
117
- - `~/company/gtm/products/tangle-intelligence.md` — product hub
118
- - `~/company/gtm/competitor-analysis/agent-improvement.md` — competitive frame
@@ -1,188 +0,0 @@
1
- # Phase-B partner pairing kit
2
-
3
- Everything we hand a design partner — the pitch, the discovery doc,
4
- the judge worksheet, the 4-hour pairing agenda, the success criteria.
5
-
6
- > This file is **partner-facing**. The internal driving runbook is in
7
- > [`phase-b-runbook.md`](./phase-b-runbook.md).
8
-
9
- ---
10
-
11
- ## The pitch (one-pager)
12
-
13
- You have a working agent. You don't have evals. You don't have a
14
- self-improvement loop. You don't know which prompt change actually
15
- made the agent better last week.
16
-
17
- We have all of that on a shelf — same engine our six internal product
18
- agents use in production. It's open source, free at the LAND tier, and
19
- sandbox-free if you don't want our sandbox.
20
-
21
- **The Phase-B offer:** in one 4-hour pairing, we wrap your agent
22
- behind our `Dispatch`, author your domain-specific judge with you,
23
- and run one real campaign + improvement loop on **your actual use
24
- case**. You walk away with:
25
-
26
- - A reproducible eval harness against scenarios you control.
27
- - A judge that scores your outputs on dimensions you defined.
28
- - One measurable lift on your real product, with a held-out gate.
29
- - Trace artifacts you own (locally on disk; nothing leaves your
30
- network unless you point at our hosted tier).
31
-
32
- What we get: design-partner evidence the substrate works on a foreign
33
- agent we did not build. That validates the wedge for us. Nothing else
34
- changes hands.
35
-
36
- **Cost to you:** 4 hours of pairing + your LLM bill for the campaign
37
- run (typically $5-$50 depending on model + scenario count). No
38
- commitment, no contract, no exclusivity. We don't take your code, your
39
- data, or your secrets.
40
-
41
- ---
42
-
43
- ## Discovery questions (15 min, before the pairing)
44
-
45
- Send these to the partner ahead of the pairing so they walk in with
46
- their answers.
47
-
48
- ### About the agent
49
-
50
- 1. What does your agent **do** — one paragraph, end-user perspective?
51
- 2. What's the **input** it accepts and the **output** it produces?
52
- (Schemas help; English is fine.)
53
- 3. What framework / stack? (LangChain / Mastra / OpenAI Agents SDK /
54
- bespoke / something else.)
55
- 4. Where does it run? (Local node / serverless / your sandbox /
56
- browser / mobile / other.)
57
- 5. What model(s) does it use today? Any model-routing layer
58
- (OpenRouter, Portkey, your own)?
59
-
60
- ### About quality
61
-
62
- 6. How do you currently know your agent is good? (Eyeballing /
63
- user feedback / metrics / nothing yet — all fine answers.)
64
- 7. What does a **bad** output look like for you? Give 2-3 concrete
65
- examples. Be specific.
66
- 8. What does a **good** output look like? Same.
67
- 9. Are there outputs that are *technically correct but feel wrong*?
68
- What's the signal?
69
- 10. How would a senior person on your team **score** an output, if
70
- they had to give it a 1-10? Walk us through the rubric they'd
71
- use, even informally.
72
-
73
- ### About the loop
74
-
75
- 11. If we could improve one thing about the agent in 4 hours, what
76
- would move the needle the most for you?
77
- 12. Are there *prompt* changes you've wanted to try but haven't had
78
- the loop to validate?
79
- 13. Anything you've explicitly tried that **didn't** work? (Saves us
80
- suggesting it.)
81
-
82
- ---
83
-
84
- ## Judge-design worksheet (45 min into the pairing)
85
-
86
- The judge is the most under-discussed piece of an eval system. Most
87
- projects fail at the judge, not the agent.
88
-
89
- We start with a **strawman** — the 6 dimensions in our canonical
90
- marketing-quality judge:
91
-
92
- | Dim | What it measures |
93
- |---|---|
94
- | hook_strength | Opens with concrete user outcome, not category |
95
- | voice_match | Reads human-written; no AI slop |
96
- | cta_clarity | Next step unambiguous for the audience |
97
- | factual_grounding | Only claims things the brief supports |
98
- | surface_fit | Length + register correct for medium |
99
- | audience_specificity | Vocabulary the audience actually responds to |
100
-
101
- **Your job in this 45 min:** rip this apart. We expect:
102
-
103
- - **2-3 of these are wrong for you.** Replace them.
104
- - **2-3 dimensions are missing.** Add them. (E.g., "tone matches our
105
- brand book" or "safety-critical claim has a citation" or "answer is
106
- decisive — no hedging when the user wants a recommendation".)
107
- - **Weights are wrong.** For your use case some dims matter 5x more.
108
-
109
- The deliverable: a judge with 4-8 dimensions, each scored 0.0 - 1.0,
110
- each unambiguous enough that two independent humans would score the
111
- same artifact within 0.1.
112
-
113
- If a dimension is squishy, throw it out. A noisy judge poisons the
114
- loop.
115
-
116
- ---
117
-
118
- ## The 4-hour pairing agenda
119
-
120
- ### Hour 1 — Discovery + Dispatch wiring
121
-
122
- | Time | What | Deliverable |
123
- |---|---|---|
124
- | 0:00 - 0:15 | Review discovery answers, align on scope | Shared doc with goals + constraints |
125
- | 0:15 - 0:45 | Wire `Dispatch` around their agent — typically 1 function | Working `Dispatch<TScenario, TArtifact>` |
126
- | 0:45 - 1:00 | Run 1-2 scenarios through `Dispatch` manually; see real artifacts | Confirmed wire shape |
127
-
128
- ### Hour 2 — Judge calibration
129
-
130
- | Time | What | Deliverable |
131
- |---|---|---|
132
- | 1:00 - 1:45 | Walk through the strawman judge; redesign dimensions with the partner | Final `JudgeConfig` for their domain |
133
- | 1:45 - 2:00 | Calibrate judge against the 2 manual outputs from Hour 1 | Confirmed judge gives same scores a human would |
134
-
135
- ### Hour 3 — First campaign + tuning
136
-
137
- | Time | What | Deliverable |
138
- |---|---|---|
139
- | 2:00 - 2:30 | Define 8-15 scenarios with the partner (or use ours as a template) | Scenario set with train + holdout split |
140
- | 2:30 - 3:00 | Run `runEval` for baseline; review per-scenario scores | Baseline score + identified failure modes |
141
-
142
- ### Hour 4 — Improvement loop + go/no-go
143
-
144
- | Time | What | Deliverable |
145
- |---|---|---|
146
- | 3:00 - 3:30 | Configure `runImprovementLoop` with `gepaDriver` (3 generations, population 2) + `defaultProductionGate` | Improvement run completes |
147
- | 3:30 - 3:50 | Walk the partner through the gate decision + lift per scenario | Report artifact |
148
- | 3:50 - 4:00 | Capture: was the lift real? Would they ship the winner? Will they keep using the lib? | **Go/no-go signal for Phase D** |
149
-
150
- If we're tracking ahead at any hour, use the slack to deepen — add a
151
- red-team battery, swap the judge model, run more generations. If we're
152
- behind, cut the scenario set to 6 and ship.
153
-
154
- ---
155
-
156
- ## Success criteria — what counts as Phase B passed
157
-
158
- For us to greenlight Phase D (hosted orchestrator + metered billing),
159
- we need ALL of:
160
-
161
- 1. **Real lift.** Held-out winner score > baseline by ≥ 0.05 composite
162
- points (or the partner's chosen threshold). Not just train; held-out.
163
- 2. **Partner-validated lift.** The partner reads the winner output on
164
- 3+ held-out scenarios and confirms it's actually better.
165
- 3. **Integration time ≤ 1 day.** Discovery + wiring + judge took ≤ 4
166
- hours for the pairing; partner could reach the same point solo in
167
- ≤ 1 day from the quickstart doc.
168
- 4. **Public commitment.** Partner agrees to a public reference (case
169
- study / quote / logo) OR commits to running the LAND tier in their
170
- own product within 2 weeks.
171
-
172
- 3-of-4 = soft pass (revisit Phase D scope but proceed). 4-of-4 = hard
173
- pass (build Phase D). ≤ 2 = fail (back to substrate iteration).
174
-
175
- ---
176
-
177
- ## What we don't ask for
178
-
179
- - Your code. Wire `Dispatch` around your existing API; we never see the
180
- source.
181
- - Your customer data. Use synthetic scenarios or anonymized real ones —
182
- whichever you prefer.
183
- - Your model keys. You bring your own; if you want, route through Tangle
184
- Router and we never see the prompts either.
185
- - Exclusivity, commitment, or contract. Walk away whenever.
186
-
187
- The point is to learn if the substrate works for someone we didn't
188
- build it for. That's it.