@tangle-network/agent-eval 0.190.0 → 0.191.0

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 (192) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/{agent-profile-DNV_U6QR.d.ts → agent-profile-DDfIjdyS.d.ts} +3 -3
  4. package/dist/{agent-profile-DNV_U6QR.d.ts.map → agent-profile-DDfIjdyS.d.ts.map} +1 -1
  5. package/dist/analyst/index.d.ts +11 -11
  6. package/dist/analyst/index.d.ts.map +1 -1
  7. package/dist/analyst/index.js +6 -6
  8. package/dist/{insight-report-CvPkEIcC.d.ts → analyze-runs-CPiKLJFs.d.ts} +73 -3
  9. package/dist/analyze-runs-CPiKLJFs.d.ts.map +1 -0
  10. package/dist/{attribute-vocabulary-DLJ6303h.d.ts → attribute-vocabulary-CcXqHODT.d.ts} +23 -12
  11. package/dist/attribute-vocabulary-CcXqHODT.d.ts.map +1 -0
  12. package/dist/{benchmark-command-TZlsuAh9.js → benchmark-command-3tZJnD82.js} +12 -11
  13. package/dist/benchmark-command-3tZJnD82.js.map +1 -0
  14. package/dist/benchmarks/index.d.ts +3 -3
  15. package/dist/benchmarks/index.js +3 -3
  16. package/dist/campaign/index.d.ts +6 -6
  17. package/dist/campaign/index.js +9 -7
  18. package/dist/{campaign-_29Qpc9Z.js → campaign-C8iWEF0M.js} +11 -9
  19. package/dist/{campaign-_29Qpc9Z.js.map → campaign-C8iWEF0M.js.map} +1 -1
  20. package/dist/{campaign-evidence-CWF8pEIk.js → campaign-evidence-BqjlTM3P.js} +11 -112
  21. package/dist/campaign-evidence-BqjlTM3P.js.map +1 -0
  22. package/dist/{chat-client-DbH06Ek6.js → chat-client-B_ItsSBw.js} +2 -2
  23. package/dist/{chat-client-DbH06Ek6.js.map → chat-client-B_ItsSBw.js.map} +1 -1
  24. package/dist/{chat-json-call-B0xTEY0I.js → chat-json-call-CXHBvUz8.js} +2 -2
  25. package/dist/{chat-json-call-B0xTEY0I.js.map → chat-json-call-CXHBvUz8.js.map} +1 -1
  26. package/dist/claim-V9Zqbq0J.js +54 -0
  27. package/dist/claim-V9Zqbq0J.js.map +1 -0
  28. package/dist/cli.js +101 -4
  29. package/dist/cli.js.map +1 -1
  30. package/dist/client-wFyDisxi.d.ts +236 -0
  31. package/dist/client-wFyDisxi.d.ts.map +1 -0
  32. package/dist/contract/index.d.ts +10 -11
  33. package/dist/contract/index.js +11 -141
  34. package/dist/contract/index.js.map +1 -1
  35. package/dist/{default-registry-B5HrwrPM.d.ts → default-registry-DK_9aVJf.d.ts} +6 -6
  36. package/dist/{default-registry-B5HrwrPM.d.ts.map → default-registry-DK_9aVJf.d.ts.map} +1 -1
  37. package/dist/{default-registry-16I-Bxlf.js → default-registry-xMLX160E.js} +3 -3
  38. package/dist/{default-registry-16I-Bxlf.js.map → default-registry-xMLX160E.js.map} +1 -1
  39. package/dist/{define-agent-eval-DrGfrCTZ.js → define-agent-eval-BE43YTm4.js} +27 -109
  40. package/dist/define-agent-eval-BE43YTm4.js.map +1 -0
  41. package/dist/{define-agent-eval-BWeyIpny.d.ts → define-agent-eval-P28y7mI1.d.ts} +16 -20
  42. package/dist/define-agent-eval-P28y7mI1.d.ts.map +1 -0
  43. package/dist/diagnosis/index.d.ts +16 -4
  44. package/dist/diagnosis/index.d.ts.map +1 -1
  45. package/dist/diagnosis/index.js +10 -3
  46. package/dist/diagnosis/index.js.map +1 -1
  47. package/dist/{dspy-rlm-engine-CTIGomgr.js → dspy-rlm-engine-MfpwoEaj.js} +3 -3
  48. package/dist/{dspy-rlm-engine-CTIGomgr.js.map → dspy-rlm-engine-MfpwoEaj.js.map} +1 -1
  49. package/dist/{engine-BkLCnZQX.d.ts → engine-vNiM02Ub.d.ts} +4 -4
  50. package/dist/{engine-BkLCnZQX.d.ts.map → engine-vNiM02Ub.d.ts.map} +1 -1
  51. package/dist/{eval-campaign-CMKRjWl0.js → eval-campaign-CwsBn0Gm.js} +2 -2
  52. package/dist/{eval-campaign-CMKRjWl0.js.map → eval-campaign-CwsBn0Gm.js.map} +1 -1
  53. package/dist/evaluation.d.ts +2 -2
  54. package/dist/{exact-types-CfpP2A4Z.d.ts → exact-types-KGxBWH4b.d.ts} +2 -2
  55. package/dist/{exact-types-CfpP2A4Z.d.ts.map → exact-types-KGxBWH4b.d.ts.map} +1 -1
  56. package/dist/experiment/index.d.ts +1 -1
  57. package/dist/experiment/index.js +2 -1
  58. package/dist/experiment/index.js.map +1 -1
  59. package/dist/{external-optimizer-process-Mc83UoWl.js → external-optimizer-process-xFTliuiK.js} +3 -3
  60. package/dist/{external-optimizer-process-Mc83UoWl.js.map → external-optimizer-process-xFTliuiK.js.map} +1 -1
  61. package/dist/{external-optimizer-subprocess-C0dHXH8e.js → external-optimizer-subprocess-B234V9V0.js} +5 -28
  62. package/dist/external-optimizer-subprocess-B234V9V0.js.map +1 -0
  63. package/dist/{extract-usage-BrQ8mCLX.js → extract-usage-DFATEuWW.js} +2 -2
  64. package/dist/{extract-usage-BrQ8mCLX.js.map → extract-usage-DFATEuWW.js.map} +1 -1
  65. package/dist/{feedback-trajectory-BYjh7NEM.d.ts → feedback-trajectory-BXCGTRkz.d.ts} +3 -3
  66. package/dist/{feedback-trajectory-BYjh7NEM.d.ts.map → feedback-trajectory-BXCGTRkz.d.ts.map} +1 -1
  67. package/dist/hosted/index.d.ts +66 -6
  68. package/dist/hosted/index.d.ts.map +1 -1
  69. package/dist/hosted/index.js +2 -2
  70. package/dist/{index-Ci0-EYzc.d.ts → index-CzfnASj_.d.ts} +18 -11
  71. package/dist/index-CzfnASj_.d.ts.map +1 -0
  72. package/dist/{index-2e_MTznj.d.ts → index-D-TN7ZRM.d.ts} +6 -6
  73. package/dist/{index-2e_MTznj.d.ts.map → index-D-TN7ZRM.d.ts.map} +1 -1
  74. package/dist/{index-BR_R1eBE.d.ts → index-DH-MWH5f.d.ts} +10 -104
  75. package/dist/index-DH-MWH5f.d.ts.map +1 -0
  76. package/dist/{index-BqDJ6fUK.d.ts → index-I4UJGRno.d.ts} +74 -2
  77. package/dist/index-I4UJGRno.d.ts.map +1 -0
  78. package/dist/index.d.ts +17 -18
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +17 -17
  81. package/dist/jev.d.ts +2 -2
  82. package/dist/{journal-CDP0Vhx_.js → journal-c3qY0SDP.js} +246 -5
  83. package/dist/journal-c3qY0SDP.js.map +1 -0
  84. package/dist/{kind-factory-ByZeXDqF.js → kind-factory-CdPPHtGZ.js} +10 -26
  85. package/dist/kind-factory-CdPPHtGZ.js.map +1 -0
  86. package/dist/ledger-core/index.d.ts +2 -2
  87. package/dist/ledger-core/index.js +2 -2
  88. package/dist/{llm-client-BqmRnibA.js → llm-client-KYQBh9C8.js} +2 -2
  89. package/dist/{llm-client-BqmRnibA.js.map → llm-client-KYQBh9C8.js.map} +1 -1
  90. package/dist/{llm-judge-bwbgDMP0.js → llm-judge-NJOHM0iA.js} +11 -1428
  91. package/dist/llm-judge-NJOHM0iA.js.map +1 -0
  92. package/dist/{matrix-CNypzP-v.d.ts → matrix-CgqdFm5N.d.ts} +2 -2
  93. package/dist/{matrix-CNypzP-v.d.ts.map → matrix-CgqdFm5N.d.ts.map} +1 -1
  94. package/dist/multishot/golden/index.d.ts +1 -1
  95. package/dist/multishot/index.d.ts +2 -2
  96. package/dist/openapi.json +1 -1
  97. package/dist/{otel-spans-CQY1pNiN.js → otel-spans-DS7t1t1J.js} +8 -19
  98. package/dist/otel-spans-DS7t1t1J.js.map +1 -0
  99. package/dist/otlp-attributes-D9ptWaIJ.js +53 -0
  100. package/dist/otlp-attributes-D9ptWaIJ.js.map +1 -0
  101. package/dist/pipelines/index.d.ts +1 -1
  102. package/dist/pipelines/index.js +1 -1
  103. package/dist/pipelines/index.js.map +1 -1
  104. package/dist/{prime-protocol-Fwvctmhm.d.ts → prime-protocol-T0i6xcAs.d.ts} +2 -2
  105. package/dist/{prime-protocol-Fwvctmhm.d.ts.map → prime-protocol-T0i6xcAs.d.ts.map} +1 -1
  106. package/dist/{produced-state-zSaGDC_Q.js → produced-state-CY-L7CqS.js} +4 -4
  107. package/dist/{produced-state-zSaGDC_Q.js.map → produced-state-CY-L7CqS.js.map} +1 -1
  108. package/dist/{raw-provider-sink-DIRCZjP_.js → raw-provider-sink-DYh4Bszw.js} +2 -2
  109. package/dist/{raw-provider-sink-DIRCZjP_.js.map → raw-provider-sink-DYh4Bszw.js.map} +1 -1
  110. package/dist/{redact-8fX8-uKr.js → redact-B7rt9Zot.js} +117 -6
  111. package/dist/redact-B7rt9Zot.js.map +1 -0
  112. package/dist/{redact-Du3WKUOP.d.ts → redact-CopuMxll.d.ts} +2 -2
  113. package/dist/{redact-Du3WKUOP.d.ts.map → redact-CopuMxll.d.ts.map} +1 -1
  114. package/dist/{registry-mAQVtuLx.d.ts → registry-Bu3lNole.d.ts} +3 -3
  115. package/dist/{registry-mAQVtuLx.d.ts.map → registry-Bu3lNole.d.ts.map} +1 -1
  116. package/dist/rl.d.ts +1 -1
  117. package/dist/rl.js +2 -2
  118. package/dist/{run-record-DnMFyg_g.js → run-record-tNnlQIrD.js} +2 -10
  119. package/dist/{run-record-DnMFyg_g.js.map → run-record-tNnlQIrD.js.map} +1 -1
  120. package/dist/search-ledger-CQ8Uy4FK.js +1451 -0
  121. package/dist/search-ledger-CQ8Uy4FK.js.map +1 -0
  122. package/dist/search-ledger-file-EvdDZRhv.js +27 -0
  123. package/dist/search-ledger-file-EvdDZRhv.js.map +1 -0
  124. package/dist/search-shipper-C55V7HE3.js +781 -0
  125. package/dist/search-shipper-C55V7HE3.js.map +1 -0
  126. package/dist/{semantic-concept-judge-BY0me-Jq.js → semantic-concept-judge-Bt7bXAAo.js} +6 -6
  127. package/dist/{semantic-concept-judge-BY0me-Jq.js.map → semantic-concept-judge-Bt7bXAAo.js.map} +1 -1
  128. package/dist/{server-DnJCDLf8.js → server-DtetGGoA.js} +2 -2
  129. package/dist/{server-DnJCDLf8.js.map → server-DtetGGoA.js.map} +1 -1
  130. package/dist/{skillopt-optimization-method-CfnQEjgT.js → skillopt-optimization-method-DwO3TOAV.js} +7 -6
  131. package/dist/{skillopt-optimization-method-CfnQEjgT.js.map → skillopt-optimization-method-DwO3TOAV.js.map} +1 -1
  132. package/dist/{spans-D1RftP_w.d.ts → spans-BWtjk_9c.d.ts} +2 -2
  133. package/dist/{spans-D1RftP_w.d.ts.map → spans-BWtjk_9c.d.ts.map} +1 -1
  134. package/dist/{statistical-heldout-CLpjYffJ.d.ts → statistical-heldout-BED3wBtX.d.ts} +2 -2
  135. package/dist/{statistical-heldout-CLpjYffJ.d.ts.map → statistical-heldout-BED3wBtX.d.ts.map} +1 -1
  136. package/dist/{store-otlp-84DH0OEH.js → store-otlp-BPowgPm6.js} +2 -2
  137. package/dist/{store-otlp-84DH0OEH.js.map → store-otlp-BPowgPm6.js.map} +1 -1
  138. package/dist/{store-tool-spans-DSbYpl7f.js → store-tool-spans-BcC_5ef-.js} +6 -6
  139. package/dist/{store-tool-spans-DSbYpl7f.js.map → store-tool-spans-BcC_5ef-.js.map} +1 -1
  140. package/dist/{store-tool-spans-BBXs8hDP.d.ts → store-tool-spans-Cfh9XUCm.d.ts} +5 -9
  141. package/dist/store-tool-spans-Cfh9XUCm.d.ts.map +1 -0
  142. package/dist/{task-failure-attributes-B34TiMBe.js → task-failure-attributes-CEqEfuIY.js} +17 -9
  143. package/dist/task-failure-attributes-CEqEfuIY.js.map +1 -0
  144. package/dist/{tool-groups-W7MJobX_.d.ts → tool-groups-D-mkeN0N.d.ts} +3 -3
  145. package/dist/tool-groups-D-mkeN0N.d.ts.map +1 -0
  146. package/dist/trace-attributes.d.ts +1 -1
  147. package/dist/trace-attributes.js +23 -75
  148. package/dist/trace-attributes.js.map +1 -1
  149. package/dist/trace-repair/index.d.ts +1 -1
  150. package/dist/traces.d.ts +12 -19
  151. package/dist/traces.d.ts.map +1 -1
  152. package/dist/traces.js +18 -18
  153. package/dist/traces.js.map +1 -1
  154. package/dist/{types-BvmWNjjs.d.ts → types-BmQRs661.d.ts} +2 -2
  155. package/dist/{types-BvmWNjjs.d.ts.map → types-BmQRs661.d.ts.map} +1 -1
  156. package/dist/{types-Bay1dh2o.d.ts → types-CeDfCRXp.d.ts} +11 -16
  157. package/dist/types-CeDfCRXp.d.ts.map +1 -0
  158. package/dist/{types-Cvqy7asY.d.ts → types-ClK-sHs8.d.ts} +2 -2
  159. package/dist/{types-Cvqy7asY.d.ts.map → types-ClK-sHs8.d.ts.map} +1 -1
  160. package/dist/wire/index.d.ts +1 -1
  161. package/dist/wire/index.js +1 -1
  162. package/docs/hosted-ingest-spec.md +92 -133
  163. package/docs/public-api.md +58 -43
  164. package/docs/search-ledger.md +17 -0
  165. package/package.json +2 -2
  166. package/dist/analyze-runs-BvK4-wSs.d.ts +0 -75
  167. package/dist/analyze-runs-BvK4-wSs.d.ts.map +0 -1
  168. package/dist/attribute-vocabulary-DLJ6303h.d.ts.map +0 -1
  169. package/dist/benchmark-command-TZlsuAh9.js.map +0 -1
  170. package/dist/campaign-evidence-CWF8pEIk.js.map +0 -1
  171. package/dist/client-BhEyAdfe.d.ts +0 -202
  172. package/dist/client-BhEyAdfe.d.ts.map +0 -1
  173. package/dist/client-QwJpsNYU.js +0 -655
  174. package/dist/client-QwJpsNYU.js.map +0 -1
  175. package/dist/define-agent-eval-BWeyIpny.d.ts.map +0 -1
  176. package/dist/define-agent-eval-DrGfrCTZ.js.map +0 -1
  177. package/dist/external-optimizer-subprocess-C0dHXH8e.js.map +0 -1
  178. package/dist/index-BR_R1eBE.d.ts.map +0 -1
  179. package/dist/index-BqDJ6fUK.d.ts.map +0 -1
  180. package/dist/index-Ci0-EYzc.d.ts.map +0 -1
  181. package/dist/insight-report-CvPkEIcC.d.ts.map +0 -1
  182. package/dist/journal-CDP0Vhx_.js.map +0 -1
  183. package/dist/kind-factory-ByZeXDqF.js.map +0 -1
  184. package/dist/llm-judge-bwbgDMP0.js.map +0 -1
  185. package/dist/otel-spans-CQY1pNiN.js.map +0 -1
  186. package/dist/otlp-attributes-BpC_blLF.js +0 -83
  187. package/dist/otlp-attributes-BpC_blLF.js.map +0 -1
  188. package/dist/redact-8fX8-uKr.js.map +0 -1
  189. package/dist/store-tool-spans-BBXs8hDP.d.ts.map +0 -1
  190. package/dist/task-failure-attributes-B34TiMBe.js.map +0 -1
  191. package/dist/tool-groups-W7MJobX_.d.ts.map +0 -1
  192. package/dist/types-Bay1dh2o.d.ts.map +0 -1
@@ -1,133 +1,121 @@
1
1
  # Hosted-ingest wire spec: `2026-07-24.v1`
2
2
 
3
- This is the only hosted-ingest wire format implemented by the current package.
3
+ This is the only hosted-ingest wire format the current package implements.
4
4
  Clients and servers reject every other wire version.
5
5
 
6
- This is the contract between `@tangle-network/agent-eval` and any hosted
7
- or self-hosted orchestrator. A builder can:
6
+ This is the contract between `@tangle-network/agent-eval` and any hosted or self-hosted store.
7
+ A builder can use our store, self-host the reference receiver from `examples/hosted-ingest-server/`, or implement this spec.
8
8
 
9
- - Use our orchestrator at `https://orchestrator.tangle.tools/v1`.
10
- - Self-host the reference receiver from
11
- `examples/hosted-ingest-server/`.
12
- - Implement their own orchestrator against this spec.
9
+ The wire carries two streams:
13
10
 
14
- All three are wire-compatible by definition.
11
+ - **Search ledgers.** A producer ships a search's hash-chained ledger and the blobs its entries name.
12
+ The ledger is the search's record: nodes, edges, cells, decisions and the claim ([search ledger](./search-ledger.md)).
13
+ - **Trace spans.** OTLP-shaped spans with `tangle.*` pivots, so a store can join a cell to its execution.
14
+
15
+ The shapes are exported from `@tangle-network/agent-eval/hosted` as zod schemas.
16
+ A store imports them instead of copying them.
15
17
 
16
18
  ---
17
19
 
18
20
  ## Transport
19
21
 
20
- Two endpoints, both `POST`, both JSON. Headers on every request:
22
+ Headers on every request:
21
23
 
22
24
  | Header | Value |
23
25
  |---|---|
24
- | `Authorization` | `Bearer <tenant-key>` (the orchestrator issues this) |
25
- | `Content-Type` | `application/json` |
26
- | `X-Tangle-Tenant-Id` | The tenant's stable id (the orchestrator's primary key for the tenant) |
27
- | `X-Tangle-Wire-Version` | `2026-07-24.v1` (this spec) |
28
- | `Idempotency-Key` | Non-empty request key, at most 256 characters; clients generate one per call and reuse it across retries |
26
+ | `Authorization` | `Bearer <tenant-key>` |
27
+ | `X-Tangle-Tenant-Id` | The tenant's stable id |
28
+ | `X-Tangle-Wire-Version` | `2026-07-24.v1` |
29
+ | `Idempotency-Key` | On `POST` and `PUT`: at most 256 characters, reused across retries |
29
30
 
30
- Responses are JSON of shape `{ accepted: number, rejected: Array<{ index, reason }> }`.
31
- Clients validate the complete response before returning it.
32
- The server can return 202 for asynchronous acceptance or 200 for synchronous acceptance.
31
+ A client retries network errors, 408, 429 and 5xx.
32
+ When the response carries `Retry-After` (delay-seconds or an HTTP date), the client waits exactly that long before the next attempt; otherwise it backs off exponentially.
33
33
 
34
- ### `POST /v1/ingest/eval-runs`
34
+ ---
35
35
 
36
- Body: `IngestEvalRunsRequest = { wireVersion, events: EvalRunEvent[] }`.
36
+ ## Search ledgers
37
37
 
38
- One ingest call per logical eval-run; generations stream in
39
- incrementally via repeated calls with the same `runId`. The
40
- orchestrator deduplicates by `(tenantId, runId, generation.index)`.
38
+ A producer ships in this order, so a store has an entry's content before the entry.
41
39
 
42
- ### `POST /v1/ingest/traces`
40
+ ### `PUT /v1/search-blobs/<sha256 hex>`
43
41
 
44
- Body: `IngestTracesRequest = { wireVersion, spans: TraceSpanEvent[] }`.
42
+ Body: the exact bytes an artifact ref names.
43
+ `Content-Type` is `application/json` for the JSON blobs the recorder writes, otherwise `application/octet-stream`.
45
44
 
46
- Standard OTLP-shaped spans with a few additional attributes
47
- (`tangle.runId`, `tangle.generation`, `tangle.cellId`,
48
- `tangle.scenarioId`) so the orchestrator can pivot between the
49
- eval-run stream and the underlying execution trace.
45
+ The store re-hashes the bytes and refuses a mismatch with 422.
46
+ The call is idempotent by content.
47
+ Response (`SearchBlobPutResponseSchema`): `{ sha256, byteLength, state }`, where `state` is `stored`, `masked` or `withheld`.
48
+ A store masks or withholds bytes its redaction scan or the tenant's content posture refuses; it never rejects the entry that names them.
50
49
 
51
- ---
50
+ ### `GET /v1/ingest/search-ledger/<searchId>/head`
52
51
 
53
- ## `EvalRunEvent`
52
+ Response (`SearchLedgerHeadSchema`): `{ searchId, nextSequence, headHash }`.
53
+ `nextSequence` is the number of entries the store holds, and `headHash` is the hash of the last one, or null when it holds none.
54
+ A restarted producer starts here.
54
55
 
55
- ```ts
56
- interface EvalRunEvent {
57
- runId: string // stable; same id across all generations of one run
58
- runDir: string // logical run directory (mem://... or filesystem path)
59
- timestamp: string // ISO-8601
60
- status: // lifecycle stage this event represents
61
- | 'started'
62
- | 'baseline-complete'
63
- | 'generation-complete'
64
- | 'gate-decided'
65
- | 'finished'
66
- | 'errored'
67
- labels: Record<string, string> // free-form (env, branch, model id, etc.)
68
- baseline?: EvalRunGenerationSnapshot // present when status >= baseline-complete
69
- generations: EvalRunGenerationSnapshot[]
70
- gateDecision?: // present when status >= gate-decided
71
- | 'ship' | 'hold' | 'need_more_work' | 'model_ceiling' | 'arch_ceiling'
72
- holdoutLift?: number // winner-on-holdout - baseline-on-holdout
73
- totalCostUsd: number
74
- totalDurationMs: number
75
- errorMessage?: string // present when status === 'errored'
76
- insightReport?: InsightReport // current report contract
77
- }
78
- ```
56
+ ### `POST /v1/ingest/search-ledger`
79
57
 
80
- ## `EvalRunGenerationSnapshot`
58
+ Body (`IngestSearchLedgerRequestSchema`):
81
59
 
82
60
  ```ts
83
- interface EvalRunGenerationSnapshot {
84
- index: number // 0 is baseline; 1..N are improvement generations
85
- surfaceHash: string // stable hash of the candidate surface (pivot key)
86
- surface?: MutableSurface // OMITTED to avoid PII when consumer prefers
87
- cells: EvalRunCellScore[]
88
- compositeMean: number | null // null when no cell has a task-quality label
89
- costUsd: number
90
- durationMs: number
61
+ {
62
+ wireVersion: '2026-07-24.v1'
63
+ searchId: string
64
+ runKind: 'optimization' | 'eval' // an eval is a one-node search
65
+ fromSequence: number // the sequence of lines[0]
66
+ lines: string[] // canonical ledger lines, without newlines
91
67
  }
92
68
  ```
93
69
 
94
- ## `EvalRunCellScore`
70
+ At most 1,000 lines and 1 MiB of line bytes per request.
71
+ Each line is the producer's own ledger bytes, so producer and store hash identical input.
95
72
 
96
- ```ts
97
- interface EvalRunCellScore {
98
- scenarioId: string
99
- rep: number // 0 for the default; > 0 when reps > 1
100
- compositeMean: number | null // null when the cell is unscored
101
- dimensions: Record< // successful scores; failed or missing judges are absent
102
- string,
103
- Record<string, number>
104
- >
105
- terminalOutcome: 'succeeded' | 'failed' | 'cancelled' | 'incomplete' | 'unknown'
106
- executionErrorCount: number | null // null when the producer cannot classify errors
107
- errorMessage?: string // present for a dispatch or judge error
108
- }
109
- ```
73
+ The store applies `admitSearchLedgerBatch` to the batch, in one transaction:
74
+
75
+ 1. `fromSequence` past the store's head: `409 sequence_gap`.
76
+ 2. Each line must verify alone with `parseSearchLedgerLine`: the schema tag, the entry and event schemas, canonical bytes, its `entryHash`, and its `searchId`. A line that does not: 422.
77
+ 3. A line below the head with the stored hash is a no-op; a different hash is `409 chain_conflict`.
78
+ 4. The first new line must extend the stored head; if it does not, `409 chain_conflict`.
79
+ 5. The new entries pass the `SearchState` state machine, or the batch returns 422 and stores nothing.
80
+
81
+ Response (`SearchLedgerHeadSchema`): the head after the batch.
82
+ A 409 body (`SearchLedgerConflictSchema`) is `{ error: 'sequence_gap' | 'chain_conflict', message, head }`.
83
+
84
+ A producer resends from `head.nextSequence` after a gap.
85
+ It stops on a fork: the store holds a different chain for the same search, and nothing is overwritten.
86
+
87
+ `runKind` is fixed by the first batch; a later batch with another kind is a 422.
88
+
89
+ ### The shipper
110
90
 
111
- ## `TraceSpanEvent`
91
+ `shipSearchLedger({ tenant, ledger: { path, searchId }, runKind })` ships every complete line of a ledger file and returns the store's head and blob counts.
92
+ `startSearchShipper(...)` tails the file while the search runs: the search never waits on the network, and `stop()` ships the rest.
93
+ `agent-eval search ship <ledger> --run-kind optimization|eval` does the same from a terminal, reading the store from `TANGLE_INGEST_URL`, `TANGLE_INGEST_API_KEY` and `TANGLE_TENANT_ID`.
94
+ `selfImprove({ hostedTenant, searchLedger })` runs the tailing shipper for its own ledger.
95
+
96
+ `content: 'digests'` ships entries without blobs, so the store holds refs and digests but no text.
97
+ A blob whose local bytes are missing or do not match their ref is not uploaded and is reported under `blobs.missing`; the entries still ship.
98
+
99
+ ---
100
+
101
+ ## Trace spans
102
+
103
+ ### `POST /v1/ingest/traces`
104
+
105
+ Body (`IngestTracesRequestSchema`): `{ wireVersion, spans: TraceSpanEvent[] }`.
106
+ Response (`IngestResponseSchema`): `{ accepted, rejected: Array<{ index, reason }> }`.
112
107
 
113
108
  ```ts
114
109
  interface TraceSpanEvent {
115
- // Standard OTel
116
110
  traceId: string
117
111
  spanId: string
118
112
  parentSpanId?: string
119
113
  name: string
120
- startTimeUnixNano: string // canonical unsigned 64-bit integer encoded in base 10
121
- endTimeUnixNano: string // canonical unsigned 64-bit integer encoded in base 10
114
+ startTimeUnixNano: string // canonical unsigned 64-bit integer in base 10
115
+ endTimeUnixNano: string
122
116
  attributes: Record<string, string | number | boolean>
123
- events?: Array<{
124
- timeUnixNano: string // canonical unsigned 64-bit integer encoded in base 10
125
- name: string
126
- attributes?: Record<string, string | number | boolean>
127
- }>
128
- status?: { code: 'OK' | 'ERROR' | 'UNSET', message? }
129
-
130
- // Tangle additions (all optional) for pivoting
117
+ events?: Array<{ timeUnixNano: string; name: string; attributes?: Record<string, string | number | boolean> }>
118
+ status?: { code: 'OK' | 'ERROR' | 'UNSET'; message?: string }
131
119
  'tangle.runId'?: string
132
120
  'tangle.generation'?: number
133
121
  'tangle.cellId'?: string
@@ -135,59 +123,30 @@ interface TraceSpanEvent {
135
123
  }
136
124
  ```
137
125
 
126
+ A store keeps at most one span per `(tenantId, traceId, spanId)`.
127
+ It accepts an exact duplicate as stored and rejects a conflicting payload with the same identity.
128
+ When an `Idempotency-Key` matches a request from the same tenant in the last 24 hours, it returns the recorded response.
129
+
138
130
  ---
139
131
 
140
132
  ## Server requirements
141
133
 
142
- Any orchestrator implementing this spec MUST:
143
-
144
- 1. **Validate auth**: reject without `Authorization` header (401), with a
145
- mismatched bearer token (401), or without a recognized `X-Tangle-Tenant-Id`
146
- (404).
147
- 2. **Validate wire version**: reject incompatible wire versions (400 with
148
- a clear error message). The major component is the breaking-change axis.
149
- 3. **Validate tenant isolation**: queries with `tenantId` X never return
150
- data tagged with `tenantId` Y. Test this adversarially.
151
- 4. **Honor idempotency**: require an `Idempotency-Key`; when it matches a prior request to the same endpoint from the same tenant in the last 24 hours, return the same response without processing the body again.
152
- 5. **Deduplicate spans**: store at most one span for each `(tenantId, traceId, spanId)` identity.
153
- Accept an exact duplicate as already stored and reject a conflicting payload with the same identity.
154
- 6. **Keep run state monotonic**: accept forward lifecycle transitions, but never replace `finished` or `errored` with a late event.
155
- Delayed events can add a missing generation without replacing terminal totals, labels, or status.
156
- 7. **Persist eval-runs durably**: at least the event + cell scores must
157
- survive an orchestrator restart. Trace spans MAY be best-effort.
158
- 8. **Provide read access**: GET endpoints for the tenant to list + fetch
159
- their own runs. Wire format for reads is NOT part of this spec: each
160
- orchestrator can pick its own (REST + JSON, gRPC, GraphQL).
161
-
162
- Servers SHOULD also:
163
-
164
- - Provide a webhook callback per tenant for `gate-decided` events.
165
- - Provide a billable-events emitter (Stripe meter / equivalent) per ingest
166
- call so consumption can be metered.
167
- - Provide a dashboard or API to view + diff per-scenario lifts over time.
134
+ A store that implements this spec must:
135
+
136
+ 1. Reject a request without a valid bearer token (401) or with an unknown tenant (404).
137
+ 2. Reject every wire version other than `2026-07-24.v1` (400) and name the accepted one.
138
+ 3. Isolate tenants: a read for tenant X never returns tenant Y's data, and a blob, search or span of another tenant reads as absent.
139
+ 4. Apply the search-ledger batch rule above, and store a batch whole or not at all.
140
+ 5. Keep search entries, blobs and their metadata durably; trace spans may be best-effort.
168
141
 
169
142
  ---
170
143
 
171
144
  ## Reference implementation
172
145
 
173
- `examples/hosted-ingest-server/` is a Hono receiver for local development and contract tests.
174
- It validates auth, request and response shapes, versions, exact nanosecond strings, request keys, span identity, and monotonic run state.
175
- It is not production storage because process restart clears its in-memory data.
146
+ `examples/hosted-ingest-server/` is an in-memory Hono receiver for local development.
147
+ It applies `admitSearchLedgerBatch` and `SearchState` to every batch, re-hashes blobs, and serves `GET /v1/searches/<searchId>` with the replayed audit.
148
+ A process restart clears it.
176
149
 
177
150
  ```sh
178
151
  TENANT_KEY=dev-token TENANT_ID=acme pnpm tsx examples/hosted-ingest-server/server.ts
179
152
  ```
180
-
181
- Send events with [`createHostedClient`](../src/hosted/client.ts) from `@tangle-network/agent-eval/hosted`.
182
- Call `client.ingestEvalRun(event)` with a valid `EvalRunEvent` after configuring the client's endpoint, tenant ID, and API key.
183
- For `selfImprove`, configure `hostedTenant` as shown in the [receiver example](../examples/hosted-ingest-server/).
184
- The receiver's authenticated `GET /v1/runs` endpoint lists ingested runs.
185
-
186
- ---
187
-
188
- ## Version
189
-
190
- `HostedWireVersion` is `"2026-07-24.v1"`.
191
- The current clients emit only this value.
192
- Servers return 400 for every other value and list the accepted version.
193
- There are no compatibility readers or migration branches.
@@ -7,11 +7,11 @@ Generated by `pnpm api:census` on demand — this is a dated reading, not a gate
7
7
  | measure | count |
8
8
  | --- | --- |
9
9
  | export subpaths | 32 |
10
- | published value exports (subpath x symbol) | 1496 |
11
- | distinct symbols | 1309 |
12
- | production | 975 |
13
- | planned | 269 |
14
- | none | 252 |
10
+ | published value exports (subpath x symbol) | 1511 |
11
+ | distinct symbols | 1324 |
12
+ | production | 992 |
13
+ | planned | 268 |
14
+ | none | 251 |
15
15
 
16
16
  Type-only exports are not listed: a type binds no runtime surface, and removing one cannot break a caller at run time.
17
17
 
@@ -152,7 +152,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
152
152
  | `checkTraceContracts` | production | creative-agent:eval/lib/trace-contracts.ts |
153
153
  | `clamp01` | production | agent-dev-container:products/intelligence/api/src/lib/consultant/executor.ts |
154
154
  | `classifyFailure` | production | phony:products/builder/api/src/eval/autoresearch/trace-analyst.ts |
155
- | `classifyFailureReason` | production | this package: src/diagnosis/first-failure.ts:28 |
155
+ | `classifyFailureReason` | production | this package: src/diagnosis/first-failure.ts:39 |
156
156
  | `cliffsDelta` | production | agent-builder:src/lib/.server/eval/loops/differential-eval.ts |
157
157
  | `CODING_HARNESSES` | production | agent-runtime:src/runtime/define-leaderboard.ts |
158
158
  | `cohensD` | production | starter-foundry:examples/recruiter-eval-workspace/eval/src/eval/regression/gate.ts |
@@ -223,7 +223,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
223
223
  | `evaluateInterimReleaseConfidence` | production | agent-builder:scripts/eval.ts |
224
224
  | `evaluateOracles` | planned | doc: docs/verdicts.md |
225
225
  | `evaluateReleaseConfidence` | production | agent-knowledge:src/release.ts |
226
- | `evaluateTraceContract` | planned | doc: docs/verdicts.md |
226
+ | `evaluateTraceContract` | planned | doc: docs/trace-contracts.md |
227
227
  | `expandProfileAxes` | production | agent-runtime:src/runtime/define-leaderboard.ts |
228
228
  | `explainTraceContract` | planned | doc: docs/trace-contracts.md |
229
229
  | `exportProductBenchmark` | production | creative-agent:eval/research-package.ts |
@@ -402,7 +402,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
402
402
  | `scorePolicyEditReadiness` | none | — |
403
403
  | `scoreRedTeamOutput` | production | agent-dev-container:products/intelligence/api/src/lib/optimization-gate.ts |
404
404
  | `scoreTraceInsightReadiness` | production | blueprint-agent:scripts/experiments/lib/analyze-vb-run/report-html-sections.ts |
405
- | `searchCellRunId` | production | this package: src/campaign/search-ledger-recording.ts:24 |
405
+ | `searchCellRunId` | production | this package: src/campaign/search-ledger-recording.ts:25 |
406
406
  | `seatPresets` | production | supervisor-lab:bench/comms/judges.ts |
407
407
  | `selfImprove` | production | agent-app:src/eval-campaign/index.ts |
408
408
  | `SEMANTIC_CONCEPT_JUDGE_VERSION` | production | blueprint-agent:scripts/experiments/lib/semantic-audit.ts |
@@ -460,7 +460,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
460
460
 
461
461
  ### `./analyst`
462
462
 
463
- 129 value exports — 78 production, 20 planned, 31 none.
463
+ 131 value exports — 79 production, 19 planned, 33 none.
464
464
 
465
465
  | symbol | consumer | evidence |
466
466
  | --- | --- | --- |
@@ -489,6 +489,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
489
489
  | `AnalystRegistry` | production | blueprint-agent:scripts/experiments/vb-multi-analyst.ts |
490
490
  | `analystUsageReceiptFromPrimeUsage` | production | this package: src/analyst/benchmark-runner-prime.ts:19 |
491
491
  | `appendVerificationArtifactsToOtlp` | production | this package: src/analyst/benchmark-public-data.ts:32 |
492
+ | `askTraceQuestions` | none | only this package's tests: src/analyst/trace-questions.test.ts:7 |
492
493
  | `assertProposalFindings` | production | agent-runtime:src/improvement/code-execution.ts |
493
494
  | `behavioralAnalyst` | production | agent-dev-container:products/intelligence/api/src/lib/deep-trace-analyst.ts |
494
495
  | `bindAnalyst` | planned | doc: docs/trace-analysis.md |
@@ -497,6 +498,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
497
498
  | `buildPrimeRepairPrompt` | planned | doc: docs/prime-analyst.md |
498
499
  | `buildSkillUsageReport` | none | only this package's tests: src/analyst/kinds/skill-usage.test.ts:2 |
499
500
  | `buildTraceToolsForGroup` | production | this package: src/analyst/kind-factory.ts:15 |
501
+ | `citedSpansOnly` | none | only this package's tests: src/analyst/trace-questions.test.ts:7 |
500
502
  | `CODE_TRACE_BENCH_ANALYST_PROMPT` | production | this package: scripts/gepa-analyst-campaign.ts:60 |
501
503
  | `codeTraceBenchCase` | production | this package: scripts/gepa-analyst-campaign.ts:58 |
502
504
  | `codeTracerPredictionsToFindings` | production | this package: benchmarks/trace-analysis/codetracebench-glm52-20260730/summarize-codetracer.mjs:6 |
@@ -519,7 +521,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
519
521
  | `DEFAULT_TRACE_ANALYST_OUTPUT_TOKENS` | production | this package: src/analyst/chat-trace-engine.ts:46 |
520
522
  | `defaultIsMaterial` | none | only this package's tests: src/analyst/analyst.test.ts:8 |
521
523
  | `defineCustomAnalyst` | planned | doc: docs/trace-analysis.md |
522
- | `defineTraceAnalyst` | planned | doc: docs/feature-guide.md |
524
+ | `defineTraceAnalyst` | production | this package: src/analyst/trace-questions.ts:24 |
523
525
  | `deriveEfficiencyFindings` | none | only this package's tests: src/trace-analyst/behavioral-metrics.test.ts:2 |
524
526
  | `diffFindings` | production | agent-runtime:src/analyst-loop/run-analyst-loop.ts |
525
527
  | `effectiveAnalystProtocolSha256` | production | this package: src/analyst/benchmark-command-persistence.ts:31 |
@@ -582,7 +584,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
582
584
  | `rlmEngineLimits` | none | only this package's tests: src/analyst/definition-parity.test.ts:26 |
583
585
  | `roundAgentRxStep` | production | this package: src/analyst/benchmark-agentrx-calibration.ts:2 |
584
586
  | `runAnalystBenchmark` | production | this package: benchmarks/trace-analysis/codetracebench-glm52-20260730/summarize-codetracer.mjs:6 |
585
- | `runAnalystBenchmarkCommand` | production | this package: src/cli.ts:17 |
587
+ | `runAnalystBenchmarkCommand` | production | this package: src/cli.ts:18 |
586
588
  | `runPrimeExchange` | production | this package: src/analyst/benchmark-runner-prime.ts:19 |
587
589
  | `runTraceAnalyst` | production | this package: scripts/gepa-analyst-campaign.ts:71 |
588
590
  | `scoreAnalystFindings` | production | this package: scripts/gepa-analyst-campaign.ts:57 |
@@ -642,7 +644,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
642
644
 
643
645
  ### `./campaign`
644
646
 
645
- 143 value exports — 91 production, 26 planned, 26 none.
647
+ 144 value exports — 92 production, 26 planned, 26 none.
646
648
 
647
649
  | symbol | consumer | evidence |
648
650
  | --- | --- | --- |
@@ -660,7 +662,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
660
662
  | `buildTraceAnalystSurfaceDispatch` | none | only this package's tests: src/campaign/analyst-surface.test.ts:4 |
661
663
  | `campaignBreakdown` | production | this package: src/campaign/external-text-evaluation.ts:11 |
662
664
  | `campaignMeanComposite` | production | agent-dev-container:products/intelligence/api/src/lib/optimization-engine.ts |
663
- | `campaignMeasurementDigest` | production | this package: src/contract/self-improve-method.ts:13 |
665
+ | `campaignMeasurementDigest` | production | this package: src/contract/self-improve-method.ts:14 |
664
666
  | `campaignScenarioIdentity` | production | agent-runtime:src/improvement/method-identity.ts |
665
667
  | `campaignSplitDigest` | production | discovery-lab:tools/profile-population.mjs |
666
668
  | `campaignSplitDigestFromIdentities` | production | agent-runtime:src/improvement/method-identity.ts |
@@ -677,7 +679,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
677
679
  | `createProfileMatrixPlan` | production | discovery-lab:tools/run-profile-confirmation.mjs |
678
680
  | `createReferenceEquivalenceJudge` | none | only this package's tests: src/reference-equivalence-judge.test.ts:13 |
679
681
  | `createRunCostLedger` | production | agent-dev-container:products/intelligence/api/src/lib/eval-engine.ts |
680
- | `createSearchHistoryReceipt` | production | this package: src/campaign/search-ledger-recording.ts:26 |
682
+ | `createSearchHistoryReceipt` | production | this package: src/campaign/search-ledger-recording.ts:27 |
681
683
  | `crowdedFrontierParent` | planned | doc: docs/campaign-proposers.md |
682
684
  | `decodeExternalTextCandidate` | production | agent-runtime:src/improvement/method-execution.ts |
683
685
  | `DEFAULT_EXTERNAL_OPTIMIZER_CALLBACK_LIMITS` | none | — |
@@ -722,6 +724,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
722
724
  | `pairHoldout` | production | agent-dev-container:products/intelligence/api/src/lib/run-provenance.ts |
723
725
  | `paretoPolicy` | none | only this package's tests: src/campaign/gates/promotion-policy.test.ts:3 |
724
726
  | `paretoSignificanceGate` | production | agent-app:src/eval-campaign/index.ts |
727
+ | `parseSearchLedgerLine` | production | this package: src/hosted/search-ledger-wire.ts:24 |
725
728
  | `phoenixEvaluatorJudge` | none | only this package's tests: src/campaign/upstream-evaluators.test.ts:6 |
726
729
  | `planCampaignRun` | production | this package: src/campaign/fixtures.ts:5 |
727
730
  | `planEvalFixtureRun` | planned | example: examples/eval-fixtures-quickstart/index.ts:11 |
@@ -753,21 +756,21 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
753
756
  | `scoreDiscrimination` | production | supervisor-lab:bench/comms/seat-discrimination.ts |
754
757
  | `scoreUserStory` | production | blueprint-agent:scripts/experiments/eval/launch-scoreboard/scoreboard-core.ts |
755
758
  | `SEARCH_ESTIMATOR` | planned | doc: docs/search-ledger.md |
756
- | `SEARCH_LEDGER_SCHEMA` | production | this package: src/campaign/search-ledger.ts:40 |
757
- | `searchCellId` | production | this package: src/campaign/search-ledger-recording.ts:56 |
759
+ | `SEARCH_LEDGER_SCHEMA` | production | this package: src/campaign/search-ledger.ts:41 |
760
+ | `searchCellId` | production | this package: src/campaign/search-ledger-recording.ts:57 |
758
761
  | `searchCellSetDigest` | planned | doc: docs/search-ledger.md |
759
762
  | `searchEdgeId` | planned | doc: docs/search-ledger.md |
760
763
  | `searchHistoryCoverageRow` | production | this package: src/campaign/optimization-method.ts:14 |
761
764
  | `SearchHistoryRequiredError` | none | — |
762
- | `SearchLedgerConflictError` | production | this package: src/campaign/search-ledger.ts:33 |
765
+ | `SearchLedgerConflictError` | production | this package: src/campaign/search-ledger.ts:34 |
763
766
  | `SearchLedgerError` | production | this package: src/campaign/estimate-node.ts:20 |
764
767
  | `SearchLedgerIntegrityError` | production | this package: src/campaign/search-ledger-file.ts:10 |
765
- | `searchNodeId` | production | this package: src/campaign/search-ledger-recording.ts:56 |
768
+ | `searchNodeId` | production | this package: src/campaign/search-ledger-recording.ts:57 |
766
769
  | `searchPosterior` | planned | doc: docs/search-ledger.md |
767
770
  | `SearchRecorder` | production | this package: src/campaign/gepa-search-import.ts:23 |
768
- | `SearchState` | production | this package: src/campaign/search-ledger.ts:47 |
771
+ | `SearchState` | production | this package: src/campaign/search-ledger.ts:48 |
769
772
  | `SearchStateView` | production | this package: src/campaign/estimate-node.ts:28 |
770
- | `searchTaskSetDigest` | production | this package: src/campaign/search-ledger-recording.ts:56 |
773
+ | `searchTaskSetDigest` | production | this package: src/campaign/search-ledger-recording.ts:57 |
771
774
  | `searchUnitScores` | production | this package: src/campaign/estimate-node.ts:28 |
772
775
  | `selectDiscriminative` | none | only this package's tests: src/campaign/scenario-selection.test.ts:2 |
773
776
  | `sequentialDecide` | planned | doc: docs/experiment.md |
@@ -783,7 +786,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
783
786
  | `traceAnalystQualityJudge` | production | this package: scripts/gepa-analyst-campaign.ts:74 |
784
787
  | `transientDispatchFailure` | planned | doc: docs/eval-surface-map.md |
785
788
  | `userStoryScoreboard` | production | blueprint-agent:scripts/experiments/eval/launch-scoreboard/run.ts |
786
- | `validateSearchLedgerEvent` | production | this package: src/campaign/search-ledger-recording.ts:27 |
789
+ | `validateSearchLedgerEvent` | production | this package: src/campaign/search-ledger-recording.ts:28 |
787
790
  | `verifyCodeSurface` | production | agent-runtime:src/candidate-execution/builder.ts |
788
791
  | `verifyLoopProvenanceRecord` | none | only this package's tests: src/campaign/provenance-integrity.test.ts:5 |
789
792
  | `verifySearchHistoryArtifact` | production | this package: src/campaign/optimization-method.ts:14 |
@@ -792,7 +795,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
792
795
 
793
796
  ### `./contract`
794
797
 
795
- 65 value exports — 41 production, 14 planned, 10 none.
798
+ 62 value exports — 41 production, 14 planned, 7 none.
796
799
 
797
800
  | symbol | consumer | evidence |
798
801
  | --- | --- | --- |
@@ -806,9 +809,6 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
806
809
  | `createReferenceEquivalenceJudge` | none | only this package's tests: src/reference-equivalence-judge.test.ts:13 |
807
810
  | `defaultProductionGate` | production | agent-app:src/eval-campaign/index.ts |
808
811
  | `defineAgentEval` | planned | example: examples/evaluate-a-change/index.ts:10 |
809
- | `diffGenerations` | none | only this package's tests: tests/contract-diff.test.ts:2 |
810
- | `diffRunBaselineToWinner` | none | only this package's tests: tests/contract-diff.test.ts:2 |
811
- | `diffRuns` | none | only this package's tests: tests/contract-diff.test.ts:2 |
812
812
  | `evalReportingSuite` | none | only this package's tests: tests/contract-eval-reporting-suite.test.ts:19 |
813
813
  | `evaluatePairedMeasurements` | production | this package: src/contract/profile-measured-comparison.ts:26 |
814
814
  | `externalTextOptimizationMethod` | production | agent-app:src/eval-campaign/index.ts |
@@ -1010,20 +1010,33 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
1010
1010
 
1011
1011
  ### `./hosted`
1012
1012
 
1013
- 11 value exports — 7 production, 2 planned, 2 none.
1013
+ 24 value exports — 20 production, 2 planned, 2 none.
1014
1014
 
1015
1015
  | symbol | consumer | evidence |
1016
1016
  | --- | --- | --- |
1017
+ | `admitSearchLedgerBatch` | planned | example: examples/hosted-ingest-server/server.ts:30 |
1017
1018
  | `createHostedClient` | production | traces:src/index.ts |
1018
- | `EvalRunEventSchema` | planned | example: examples/hosted-ingest-server/server.ts:33 |
1019
1019
  | `HOSTED_WIRE_VERSION` | production | agent-dev-container:packages/sdk-data/src/sink/intelligence-sink.ts |
1020
1020
  | `hostedClientFromEnv` | production | traces:src/index.ts |
1021
+ | `HostedRequestError` | none | — |
1021
1022
  | `hostedTenantFromEnv` | production | creative-agent:eval/self-improve.ts |
1022
- | `IngestEvalRunsRequestSchema` | production | this package: src/hosted/client.ts:19 |
1023
- | `IngestResponseSchema` | production | this package: src/hosted/client.ts:19 |
1024
- | `IngestTracesRequestSchema` | production | this package: src/hosted/client.ts:19 |
1025
- | `InsightReportSchema` | none | only this package's tests: tests/contract-analyze-runs.test.ts:29 |
1026
- | `TraceSpanEventSchema` | planned | example: examples/hosted-ingest-server/server.ts:33 |
1023
+ | `IngestResponseSchema` | production | this package: src/hosted/client.ts:22 |
1024
+ | `IngestSearchLedgerRequestSchema` | production | this package: src/hosted/client.ts:23 |
1025
+ | `IngestTracesRequestSchema` | production | this package: src/hosted/client.ts:22 |
1026
+ | `SEARCH_LEDGER_BATCH_MAX_BYTES` | production | this package: src/hosted/search-shipper.ts:18 |
1027
+ | `SEARCH_LEDGER_BATCH_MAX_LINES` | production | this package: src/hosted/search-shipper.ts:18 |
1028
+ | `SEARCH_LEDGER_INGEST_PATH` | production | this package: src/hosted/client.ts:23 |
1029
+ | `searchBlobPath` | production | this package: src/hosted/client.ts:23 |
1030
+ | `SearchBlobPutResponseSchema` | production | this package: src/hosted/client.ts:23 |
1031
+ | `searchLedgerArtifactRefs` | production | this package: src/hosted/search-shipper.ts:18 |
1032
+ | `SearchLedgerConflictSchema` | production | this package: src/hosted/client.ts:23 |
1033
+ | `searchLedgerHeadPath` | production | this package: src/hosted/client.ts:23 |
1034
+ | `SearchLedgerHeadSchema` | production | this package: src/hosted/client.ts:23 |
1035
+ | `SearchRunKindSchema` | production | this package: src/search-command.ts:13 |
1036
+ | `SearchShipConflictError` | production | this package: src/search-command.ts:14 |
1037
+ | `shipSearchLedger` | production | this package: src/contract/self-improve-method.ts:24 |
1038
+ | `startSearchShipper` | production | this package: src/contract/self-improve.ts:66 |
1039
+ | `TraceSpanEventSchema` | planned | example: examples/hosted-ingest-server/server.ts:29 |
1027
1040
  | `UnixNanoTimestampSchema` | none | — |
1028
1041
 
1029
1042
  ### `./jev`
@@ -1060,7 +1073,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
1060
1073
 
1061
1074
  ### `./ledger-core`
1062
1075
 
1063
- 17 value exports — 16 production, 0 planned, 1 none.
1076
+ 19 value exports — 18 production, 0 planned, 1 none.
1064
1077
 
1065
1078
  | symbol | consumer | evidence |
1066
1079
  | --- | --- | --- |
@@ -1073,12 +1086,14 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
1073
1086
  | `LEDGER_HASH_PATTERN` | production | this package: src/campaign/final-evidence.ts:13 |
1074
1087
  | `LedgerCanonicalizationError` | none | only this package's tests: src/ledger-core/canonical.test.ts:5 |
1075
1088
  | `probeAtomicFileLock` | production | this package: src/campaign/single-run-lock.ts:17 |
1076
- | `readTrustedHeadFile` | production | this package: src/ledger-core/journal.ts:40 |
1089
+ | `projectorSnapshotPathFor` | production | this package: src/ledger-core/journal.ts:48 |
1090
+ | `readProjectorSnapshotFile` | production | this package: src/ledger-core/journal.ts:48 |
1091
+ | `readTrustedHeadFile` | production | this package: src/ledger-core/journal.ts:55 |
1077
1092
  | `replayLedgerText` | production | this package: src/campaign/search-ledger.ts:23 |
1078
- | `trustedHeadPathFor` | production | this package: src/ledger-core/journal.ts:40 |
1093
+ | `trustedHeadPathFor` | production | this package: src/ledger-core/journal.ts:55 |
1079
1094
  | `tryAcquireAtomicFileLock` | production | this package: src/campaign/single-run-lock.ts:17 |
1080
1095
  | `tryWithLedgerFileLock` | production | this package: src/campaign/search-ledger-file.ts:3 |
1081
- | `verifyEntriesAgainstTrustedHead` | production | this package: src/ledger-core/journal.ts:40 |
1096
+ | `verifyEntriesAgainstTrustedHead` | production | this package: src/ledger-core/journal.ts:55 |
1082
1097
  | `withLedgerFileLock` | production | this package: src/analyst/benchmark-response-cache.ts:6 |
1083
1098
  | `writeLedgerFileAtomically` | production | this package: src/analyst/benchmark-response-cache.ts:6 |
1084
1099
 
@@ -1364,7 +1379,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
1364
1379
  | `ROLLOUT_ROLES` | production | this package: src/rollout/interchange/harbor.ts:60 |
1365
1380
  | `ROLLOUT_SCHEMA` | production | this package: src/rollout/interchange/harbor.ts:60 |
1366
1381
  | `ROLLOUT_SPLITS` | production | this package: src/rollout/interchange/harbor.ts:60 |
1367
- | `runRolloutReleaseCli` | production | this package: src/cli.ts:19 |
1382
+ | `runRolloutReleaseCli` | production | this package: src/cli.ts:20 |
1368
1383
  | `scoreOrigin` | production | this package: src/rollout/mint.ts:39 |
1369
1384
  | `scrubLines` | production | supervisor-lab:bench/vertical-rollout-package.ts |
1370
1385
  | `scrubRolloutLine` | none | only this package's tests: src/rollout/release/scrub.test.ts:4 |
@@ -1425,7 +1440,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
1425
1440
  | `renderSupervisorRunMarkdown` | production | discovery-lab:experiments/0005-run-visibility/render-run.mjs |
1426
1441
  | `reportSupervisorRound` | planned | named in agent-runtime (bind not in the import graph) |
1427
1442
  | `rollupSupervisorRuns` | production | discovery-lab:tools/disco.mjs |
1428
- | `runSupervisorRunCommand` | production | this package: src/cli.ts:20 |
1443
+ | `runSupervisorRunCommand` | production | this package: src/cli.ts:22 |
1429
1444
  | `RUNTIME_FAILED_STATUS` | none | — |
1430
1445
  | `runtimeSupervisorRunReader` | none | only this package's tests: src/supervisor-run/index.test.ts:2 |
1431
1446
  | `showMeasured` | production | this package: src/supervisor-run/render.ts:8 |
@@ -1770,7 +1785,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
1770
1785
 
1771
1786
  | symbol | consumer | evidence |
1772
1787
  | --- | --- | --- |
1773
- | `buildOpenApi` | production | this package: src/cli.ts:22 |
1788
+ | `buildOpenApi` | production | this package: src/cli.ts:24 |
1774
1789
  | `createApp` | planned | doc: docs/wire-protocol.md |
1775
1790
  | `dispatchRpc` | planned | doc: docs/wire-protocol.md |
1776
1791
  | `ErrorResponseSchema` | production | this package: src/wire/openapi.ts:15 |
@@ -1781,7 +1796,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
1781
1796
  | `handleJudge` | production | this package: src/wire/rpc.ts:15 |
1782
1797
  | `handleListRubrics` | production | this package: src/wire/rpc.ts:15 |
1783
1798
  | `handleTracesIngest` | production | this package: src/wire/server.ts:20 |
1784
- | `handleVersion` | production | this package: src/cli.ts:21 |
1799
+ | `handleVersion` | production | this package: src/cli.ts:23 |
1785
1800
  | `hashRubric` | production | this package: src/wire/handlers.ts:22 |
1786
1801
  | `HealthResponseSchema` | production | this package: src/wire/openapi.ts:15 |
1787
1802
  | `JudgeRequestSchema` | production | this package: src/wire/openapi.ts:15 |
@@ -1791,10 +1806,10 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
1791
1806
  | `RUBRIC_VERSION_SCHEME` | none | — |
1792
1807
  | `RubricDimensionSchema` | none | only this package's tests: tests/wire/schemas.test.ts:12 |
1793
1808
  | `RubricSchema` | none | only this package's tests: tests/wire/schemas.test.ts:12 |
1794
- | `runRpcBatch` | production | this package: src/cli.ts:23 |
1795
- | `runRpcOnce` | production | this package: src/cli.ts:23 |
1809
+ | `runRpcBatch` | production | this package: src/cli.ts:25 |
1810
+ | `runRpcOnce` | production | this package: src/cli.ts:25 |
1796
1811
  | `startServer` | production | creative-agent:eval/ingestion-server.ts |
1797
- | `startServerAsync` | production | this package: src/cli.ts:24 |
1812
+ | `startServerAsync` | production | this package: src/cli.ts:26 |
1798
1813
  | `TraceEventSchema` | planned | named in insurance-agent (bind not in the import graph) |
1799
1814
  | `TracesIngestRequestSchema` | production | this package: src/wire/openapi.ts:15 |
1800
1815
  | `TracesIngestResponseSchema` | production | this package: src/wire/openapi.ts:15 |
@@ -141,6 +141,23 @@ The loop's scenarios are its proposer's feedback, so they are the train split; i
141
141
  `importGepaPopulation` turns the population into nodes and `correlated` edges and reports collapsed duplicates.
142
142
  `importExternalEvaluations` turns every callback evaluation into an `external` cell; a candidate GEPA evaluated but kept out of its population gets an `unknown` edge and is decided `pruned`.
143
143
 
144
+ ## Ship a search
145
+
146
+ A hosted store (Intelligence, or the reference receiver in `examples/hosted-ingest-server/`) receives a search through the [hosted ingest wire](./hosted-ingest-spec.md).
147
+ The shipper reads the ledger file, uploads the blobs each entry names, and posts the entries from the store's head.
148
+ A restarted shipper, a lost response, or a store that lost data continues from the store's head; a store that holds a different chain for the same search stops it with `SearchShipConflictError`.
149
+
150
+ ```ts
151
+ import { shipSearchLedger, startSearchShipper } from '@tangle-network/agent-eval/hosted'
152
+
153
+ const shipper = startSearchShipper({ tenant, ledger: { path: ledger.path, searchId }, runKind: 'optimization' })
154
+ // ...the search appends to its ledger; the shipper tails it...
155
+ const shipped = await shipper.stop() // { head, localLines, batches, blobs: { uploaded, missing, ... } }
156
+ ```
157
+
158
+ `selfImprove({ hostedTenant, searchLedger })` does this for its own ledger.
159
+ `agent-eval search ship <ledger> --run-kind optimization|eval` finishes or resumes a ship from a terminal.
160
+
144
161
  ## Receipts and `require-complete`
145
162
 
146
163
  `createSearchHistoryReceipt({ producerId, runId, ledger })` reads the ledger's bytes, replays them, and binds the byte digest, the audit digest, and a bounded summary.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-eval",
3
- "version": "0.190.0",
3
+ "version": "0.191.0",
4
4
  "description": "Evaluate and improve AI agents from runs, traces, judges, and feedback. Compare candidates, cluster failures, measure lift, and gate releases.",
5
5
  "homepage": "https://github.com/tangle-network/agent-eval#readme",
6
6
  "repository": {
@@ -221,7 +221,7 @@
221
221
  "@hono/node-server": "^2.1.1",
222
222
  "@tangle-network/agent-core": "^0.9.6",
223
223
  "@tangle-network/agent-interface": "^2.0.0",
224
- "@tangle-network/agent-trace-contract": "^1.0.2",
224
+ "@tangle-network/agent-trace-contract": "^1.2.0",
225
225
  "hono": "^4.13.5",
226
226
  "linear-sum-assignment": "1.0.9",
227
227
  "re2js": "2.8.6",