@tangle-network/agent-eval 0.189.0 → 0.190.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 (146) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/README.md +3 -2
  3. package/dist/adapters/http.d.ts +10 -1
  4. package/dist/adapters/http.d.ts.map +1 -1
  5. package/dist/adapters/http.js +75 -7
  6. package/dist/adapters/http.js.map +1 -1
  7. package/dist/analyst/index.d.ts +66 -3
  8. package/dist/analyst/index.d.ts.map +1 -1
  9. package/dist/analyst/index.js +212 -7
  10. package/dist/analyst/index.js.map +1 -1
  11. package/dist/{benchmark-command-BhhAYstU.js → benchmark-command-BXIr_k8D.js} +12 -11
  12. package/dist/benchmark-command-BXIr_k8D.js.map +1 -0
  13. package/dist/benchmarks/index.d.ts +1 -1
  14. package/dist/benchmarks/index.js +3 -3
  15. package/dist/campaign/index.d.ts +4 -4
  16. package/dist/campaign/index.js +7 -7
  17. package/dist/{campaign-BWoSQPSU.js → campaign-B7q74uIh.js} +256 -11
  18. package/dist/campaign-B7q74uIh.js.map +1 -0
  19. package/dist/{campaign-evidence-CBlGJ3kC.js → campaign-evidence-D40-LHIL.js} +6 -5
  20. package/dist/campaign-evidence-D40-LHIL.js.map +1 -0
  21. package/dist/{chat-client-C4dg7Ng_.js → chat-client-B_ItsSBw.js} +2 -2
  22. package/dist/{chat-client-C4dg7Ng_.js.map → chat-client-B_ItsSBw.js.map} +1 -1
  23. package/dist/{chat-json-call-JVGbfx95.js → chat-json-call-CXHBvUz8.js} +2 -2
  24. package/dist/{chat-json-call-JVGbfx95.js.map → chat-json-call-CXHBvUz8.js.map} +1 -1
  25. package/dist/claim-BGOUqoMq.d.ts +38 -0
  26. package/dist/claim-BGOUqoMq.d.ts.map +1 -0
  27. package/dist/cli.js +3 -3
  28. package/dist/contract/index.d.ts +4 -4
  29. package/dist/contract/index.js +8 -8
  30. package/dist/{default-registry-m2jhbG6Q.js → default-registry-16I-Bxlf.js} +2 -2
  31. package/dist/{default-registry-m2jhbG6Q.js.map → default-registry-16I-Bxlf.js.map} +1 -1
  32. package/dist/{define-agent-eval-98sgUaC1.js → define-agent-eval-DPizhHfy.js} +4 -4
  33. package/dist/{define-agent-eval-98sgUaC1.js.map → define-agent-eval-DPizhHfy.js.map} +1 -1
  34. package/dist/{define-agent-eval-q6890HU4.d.ts → define-agent-eval-DblGedQk.d.ts} +4 -3
  35. package/dist/define-agent-eval-DblGedQk.d.ts.map +1 -0
  36. package/dist/diagnosis/index.d.ts +14 -2
  37. package/dist/diagnosis/index.d.ts.map +1 -1
  38. package/dist/diagnosis/index.js +11 -4
  39. package/dist/diagnosis/index.js.map +1 -1
  40. package/dist/{dspy-rlm-engine-DLYttKBm.js → dspy-rlm-engine-Cs5LzJ-f.js} +3 -3
  41. package/dist/{dspy-rlm-engine-DLYttKBm.js.map → dspy-rlm-engine-Cs5LzJ-f.js.map} +1 -1
  42. package/dist/{eval-campaign-C0Q1Eeo_.js → eval-campaign-CwsBn0Gm.js} +2 -2
  43. package/dist/{eval-campaign-C0Q1Eeo_.js.map → eval-campaign-CwsBn0Gm.js.map} +1 -1
  44. package/dist/experiment/index.d.ts +2 -1
  45. package/dist/experiment/index.d.ts.map +1 -1
  46. package/dist/experiment/index.js +1 -1
  47. package/dist/exporters-XMCYJlqT.d.ts +161 -0
  48. package/dist/exporters-XMCYJlqT.d.ts.map +1 -0
  49. package/dist/{external-optimizer-process-C3quNeKV.js → external-optimizer-process-BnSmrkgL.js} +3 -3
  50. package/dist/{external-optimizer-process-C3quNeKV.js.map → external-optimizer-process-BnSmrkgL.js.map} +1 -1
  51. package/dist/{external-optimizer-subprocess-BDwgKLO1.js → external-optimizer-subprocess-kbcPu5po.js} +3 -3
  52. package/dist/{external-optimizer-subprocess-BDwgKLO1.js.map → external-optimizer-subprocess-kbcPu5po.js.map} +1 -1
  53. package/dist/{feedback-trajectory-B3ZSkfAq.d.ts → feedback-trajectory-BYjh7NEM.d.ts} +2 -2
  54. package/dist/{feedback-trajectory-B3ZSkfAq.d.ts.map → feedback-trajectory-BYjh7NEM.d.ts.map} +1 -1
  55. package/dist/{index-CnJOPR_E.d.ts → index-CJv56rhX.d.ts} +673 -244
  56. package/dist/index-CJv56rhX.d.ts.map +1 -0
  57. package/dist/{index-Dk1dOUfm.d.ts → index-CWoIJHmy.d.ts} +4 -4
  58. package/dist/{index-Dk1dOUfm.d.ts.map → index-CWoIJHmy.d.ts.map} +1 -1
  59. package/dist/{index-Bcc9PkOz.d.ts → index-D4pC7Tvd.d.ts} +3 -2
  60. package/dist/index-D4pC7Tvd.d.ts.map +1 -0
  61. package/dist/{index-BqDJ6fUK.d.ts → index-I4UJGRno.d.ts} +74 -2
  62. package/dist/index-I4UJGRno.d.ts.map +1 -0
  63. package/dist/index.d.ts +66 -17
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +375 -31
  66. package/dist/index.js.map +1 -1
  67. package/dist/{journal-CDP0Vhx_.js → journal-c3qY0SDP.js} +246 -5
  68. package/dist/journal-c3qY0SDP.js.map +1 -0
  69. package/dist/{kind-factory-BGwN0nE6.js → kind-factory-ByZeXDqF.js} +2 -2
  70. package/dist/{kind-factory-BGwN0nE6.js.map → kind-factory-ByZeXDqF.js.map} +1 -1
  71. package/dist/ledger-core/index.d.ts +2 -2
  72. package/dist/ledger-core/index.js +2 -2
  73. package/dist/{llm-client-DF9bPNYA.js → llm-client-KYQBh9C8.js} +2 -2
  74. package/dist/{llm-client-DF9bPNYA.js.map → llm-client-KYQBh9C8.js.map} +1 -1
  75. package/dist/{llm-judge-M_l_WXw2.js → llm-judge-BnxAv7ed.js} +1892 -1378
  76. package/dist/llm-judge-BnxAv7ed.js.map +1 -0
  77. package/dist/mint-C9Lojt1V.d.ts +147 -0
  78. package/dist/mint-C9Lojt1V.d.ts.map +1 -0
  79. package/dist/openapi.json +1 -1
  80. package/dist/pipelines/index.d.ts +1 -1
  81. package/dist/pipelines/index.js +1 -1
  82. package/dist/pipelines/index.js.map +1 -1
  83. package/dist/{produced-state-BOY98IJO.js → produced-state-BXjXJHJT.js} +4 -4
  84. package/dist/{produced-state-BOY98IJO.js.map → produced-state-BXjXJHJT.js.map} +1 -1
  85. package/dist/{raw-provider-sink-C96CcqeG.js → raw-provider-sink-DYh4Bszw.js} +2 -2
  86. package/dist/{raw-provider-sink-C96CcqeG.js.map → raw-provider-sink-DYh4Bszw.js.map} +1 -1
  87. package/dist/{redact-DxwlUAvh.js → redact-B7rt9Zot.js} +130 -10
  88. package/dist/redact-B7rt9Zot.js.map +1 -0
  89. package/dist/{redact-DPoH1-OW.d.ts → redact-CopuMxll.d.ts} +7 -5
  90. package/dist/redact-CopuMxll.d.ts.map +1 -0
  91. package/dist/rl.d.ts +3 -2
  92. package/dist/rl.d.ts.map +1 -1
  93. package/dist/rl.js +1 -1
  94. package/dist/rollout/index.d.ts +3 -2
  95. package/dist/search-ledger-types-C9anU2DX.d.ts +489 -0
  96. package/dist/search-ledger-types-C9anU2DX.d.ts.map +1 -0
  97. package/dist/{semantic-concept-judge-Cm2K2wAo.js → semantic-concept-judge-ClB73cei.js} +6 -6
  98. package/dist/{semantic-concept-judge-Cm2K2wAo.js.map → semantic-concept-judge-ClB73cei.js.map} +1 -1
  99. package/dist/{server-C8XvqCg8.js → server-DtetGGoA.js} +2 -2
  100. package/dist/{server-C8XvqCg8.js.map → server-DtetGGoA.js.map} +1 -1
  101. package/dist/{skillopt-optimization-method-BVSB676o.js → skillopt-optimization-method-l2vDBtKp.js} +363 -18
  102. package/dist/skillopt-optimization-method-l2vDBtKp.js.map +1 -0
  103. package/dist/{spans-W0o8pbEg.d.ts → spans-BWtjk_9c.d.ts} +2 -2
  104. package/dist/{spans-W0o8pbEg.d.ts.map → spans-BWtjk_9c.d.ts.map} +1 -1
  105. package/dist/{statistical-heldout-plAHG82H.d.ts → statistical-heldout-CLpjYffJ.d.ts} +2 -36
  106. package/dist/statistical-heldout-CLpjYffJ.d.ts.map +1 -0
  107. package/dist/{store-otlp-D0AV4cvB.js → store-otlp-84DH0OEH.js} +2 -2
  108. package/dist/{store-otlp-D0AV4cvB.js.map → store-otlp-84DH0OEH.js.map} +1 -1
  109. package/dist/{store-tool-spans-8PAyhRqb.d.ts → store-tool-spans-BBXs8hDP.d.ts} +2 -2
  110. package/dist/{store-tool-spans-8PAyhRqb.d.ts.map → store-tool-spans-BBXs8hDP.d.ts.map} +1 -1
  111. package/dist/{store-tool-spans-B_0mXvYl.js → store-tool-spans-DUiqyHvR.js} +5 -5
  112. package/dist/{store-tool-spans-B_0mXvYl.js.map → store-tool-spans-DUiqyHvR.js.map} +1 -1
  113. package/dist/traces.d.ts +3 -63
  114. package/dist/traces.d.ts.map +1 -1
  115. package/dist/traces.js +6 -195
  116. package/dist/traces.js.map +1 -1
  117. package/dist/wire/index.d.ts +1 -1
  118. package/dist/wire/index.js +1 -1
  119. package/docs/adapters-observability.md +31 -27
  120. package/docs/charter.md +1 -1
  121. package/docs/design/mlbenchmarks-book-review.md +1 -1
  122. package/docs/distributed-driver.md +1 -5
  123. package/docs/experiment.md +15 -0
  124. package/docs/public-api.md +181 -71
  125. package/docs/redaction.md +7 -1
  126. package/docs/search-ledger.md +174 -0
  127. package/docs/trace-contracts.md +48 -3
  128. package/package.json +1 -1
  129. package/dist/benchmark-command-BhhAYstU.js.map +0 -1
  130. package/dist/campaign-BWoSQPSU.js.map +0 -1
  131. package/dist/campaign-evidence-CBlGJ3kC.js.map +0 -1
  132. package/dist/define-agent-eval-q6890HU4.d.ts.map +0 -1
  133. package/dist/index-Bcc9PkOz.d.ts.map +0 -1
  134. package/dist/index-BqDJ6fUK.d.ts.map +0 -1
  135. package/dist/index-CnJOPR_E.d.ts.map +0 -1
  136. package/dist/journal-CDP0Vhx_.js.map +0 -1
  137. package/dist/llm-judge-M_l_WXw2.js.map +0 -1
  138. package/dist/mint-DsS38v5c.d.ts +0 -305
  139. package/dist/mint-DsS38v5c.d.ts.map +0 -1
  140. package/dist/redact-DPoH1-OW.d.ts.map +0 -1
  141. package/dist/redact-DxwlUAvh.js.map +0 -1
  142. package/dist/search-ledger-types-D7KDVg-o.d.ts +0 -302
  143. package/dist/search-ledger-types-D7KDVg-o.d.ts.map +0 -1
  144. package/dist/skillopt-optimization-method-BVSB676o.js.map +0 -1
  145. package/dist/statistical-heldout-plAHG82H.d.ts.map +0 -1
  146. package/docs/search-history-receipts.md +0 -233
@@ -0,0 +1,489 @@
1
+ import { t as EvaluationClaim } from "./claim-BGOUqoMq.js";
2
+ import { r as LedgerHash } from "./canonical-CFpojCN5.js";
3
+ import { AgentProfileDiff } from "@tangle-network/agent-interface";
4
+ //#region src/campaign/search-ledger-types.d.ts
5
+ /**
6
+ * Schema tag every search-ledger entry carries. A ledger written under another
7
+ * tag, such as the retired `tangle.search-ledger.v1` candidate-slot format, is
8
+ * refused with its tag named; it is never translated.
9
+ */
10
+ declare const SEARCH_LEDGER_SCHEMA: 'tangle.search-ledger.2026-09';
11
+ type SearchLedgerHash = LedgerHash;
12
+ type SearchSurfaceKind = 'prompt' | 'tool-contract' | 'runtime-config' | 'memory' | 'knowledge' | 'agent-profile' | 'code' | 'deployment';
13
+ /** What a search's nodes are: a mutable agent surface, or an output artifact. */
14
+ type SearchArtifactKind = SearchSurfaceKind | 'output';
15
+ /** Content-addressed artifact or receipt. Mutable paths are locators only; the
16
+ * digest and byte length bind the exact bytes. */
17
+ interface SearchArtifactRef {
18
+ role: string;
19
+ uri: string;
20
+ sha256: SearchLedgerHash;
21
+ byteLength: number;
22
+ }
23
+ /** Repository, dataset, or package source pinned to an immutable commit or
24
+ * content digest. Branches, tags, and bare package versions are rejected. */
25
+ interface SearchSourceRef {
26
+ uri: string;
27
+ revision: string;
28
+ }
29
+ /** A fact the producer does not have, with the reason. Unknown is never 0. */
30
+ interface SearchUnknown {
31
+ unknown: string;
32
+ }
33
+ /** The model an attempt ran: an immutable snapshot, or a moving alias whose
34
+ * served snapshot the producer could not observe. */
35
+ type SearchModelIdentity = {
36
+ provider: string;
37
+ snapshot: string;
38
+ } | {
39
+ provider: string;
40
+ alias: string;
41
+ unknown: string;
42
+ };
43
+ interface SearchCandidateSurface {
44
+ surfaceId: string;
45
+ kind: SearchSurfaceKind;
46
+ artifact: SearchArtifactRef;
47
+ }
48
+ type SearchOperationKind = 'candidate-generation' | 'analysis' | 'selection' | 'judge' | 'other';
49
+ /** train is the proposer's feedback, selection is private to the policy and
50
+ * allocator, and test is sealed for the claim. */
51
+ type SearchSplit = 'train' | 'selection' | 'test';
52
+ interface SearchTask {
53
+ taskId: string;
54
+ /** The claim's independent unit this task samples. Repeats and sibling
55
+ * tasks of one unit average inside it before any statistic. */
56
+ unitId: string;
57
+ source: SearchSourceRef;
58
+ }
59
+ interface SearchSplitTasks {
60
+ /** `hashCanonical` of `tasks` in taskId order. */
61
+ taskSetDigest: SearchLedgerHash;
62
+ tasks: SearchTask[];
63
+ }
64
+ interface SearchSplits {
65
+ train: SearchSplitTasks;
66
+ selection: SearchSplitTasks;
67
+ test: SearchSplitTasks;
68
+ /**
69
+ * True when no test unit is a train or selection unit. A search that ran
70
+ * with shared units records false, and then its claim cannot ship: a test
71
+ * run of a seen unit measures a fresh run of a seen task, not an
72
+ * improvement on unseen ones.
73
+ */
74
+ heldOutUnits: boolean;
75
+ }
76
+ interface SearchBudget {
77
+ /** Hard dollar cap on committed spend plus open reservations; null = none declared. */
78
+ maxUsd: number | null;
79
+ maxCells: number | null;
80
+ maxNodes: number | null;
81
+ /** ISO time after which the policy stops expanding. */
82
+ deadline: string | null;
83
+ maxConcurrency: number | null;
84
+ /** Held back at start for the root's and finalists' test cells. */
85
+ reservedClaimUsd: number;
86
+ }
87
+ /** Where a cell ran relative to the search's decisions. */
88
+ type SearchCellStage = 'root' | 'train' | 'screen' | 'rung' | 'claim' | 'external';
89
+ type SearchEdgeOperator = 'seed' | 'draft' | 'improve' | 'debug' | 'merge' | 'derive';
90
+ /**
91
+ * How an edge's parents are known. `explicit`: the proposer that created the
92
+ * child emitted the edge. `correlated`: an importer joined an optimizer's own
93
+ * parent record by content digest. `unknown`: no parent record exists, and the
94
+ * edge has no parents. Nothing is inferred from timing or order.
95
+ */
96
+ type SearchEdgeAttribution = 'explicit' | 'correlated' | 'unknown';
97
+ type SearchProposerKind = NonNullable<AgentProfileDiff['source']>['kind'];
98
+ interface SearchProposer {
99
+ kind: SearchProposerKind;
100
+ name: string;
101
+ /** The candidate-generation operation that produced the child, when one was recorded. */
102
+ operationId: string | null;
103
+ source: SearchSourceRef;
104
+ }
105
+ interface SearchNodeRef {
106
+ searchId: string;
107
+ nodeId: string;
108
+ }
109
+ /** Dollars held for a cell or operation before it runs. `hard`: the lane
110
+ * enforces the maximum. `estimate`: the lane cannot, and overshoot is recorded. */
111
+ interface SearchReservation {
112
+ kind: 'hard' | 'estimate';
113
+ usd: number;
114
+ }
115
+ type SearchTokenAccounting = {
116
+ status: 'known';
117
+ inputTokens: number;
118
+ outputTokens: number;
119
+ cachedTokens: number;
120
+ } | {
121
+ status: 'unknown';
122
+ reason: string;
123
+ };
124
+ type SearchCostAccounting = {
125
+ status: 'known';
126
+ usd: number;
127
+ source: 'provider' | 'pricing-table' | 'free';
128
+ } | {
129
+ status: 'unknown';
130
+ /** Proven part of the spend; the total may be higher. */
131
+ knownLowerBoundUsd: number;
132
+ reason: string;
133
+ };
134
+ interface SearchAttemptAccounting {
135
+ tokens: SearchTokenAccounting;
136
+ cost: SearchCostAccounting;
137
+ }
138
+ interface SearchFailureReason {
139
+ code: string;
140
+ message: string;
141
+ }
142
+ /** `failed` is the agent's defect and carries a score; `errored` is the
143
+ * environment's fault, carries none, and may be retried. */
144
+ type SearchTaskOutcome = {
145
+ status: 'passed';
146
+ score: number;
147
+ metrics: Record<string, number>;
148
+ } | {
149
+ status: 'failed';
150
+ score: number;
151
+ metrics: Record<string, number>;
152
+ failure: SearchFailureReason;
153
+ } | {
154
+ status: 'errored';
155
+ metrics: Record<string, number>;
156
+ error: SearchFailureReason & {
157
+ retryable: boolean;
158
+ };
159
+ };
160
+ type SearchSurfaceEffect = {
161
+ status: 'measured';
162
+ metric: string;
163
+ baselineValue: number;
164
+ candidateValue: number;
165
+ delta: number;
166
+ } | {
167
+ status: 'not-measured';
168
+ reason: string;
169
+ };
170
+ /** Per-attempt proof that a declared node surface did or did not fire. A
171
+ * surface without evidence is unobserved, not fired. */
172
+ interface SearchSurfaceEvidence {
173
+ surfaceId: string;
174
+ fired: boolean;
175
+ firingCount: number;
176
+ effect: SearchSurfaceEffect;
177
+ evidence: SearchArtifactRef[];
178
+ }
179
+ type SearchTraceRef = {
180
+ traceId: string;
181
+ execRunId: string | null;
182
+ spansWritten: number | null;
183
+ spansDropped: number | null;
184
+ } | SearchUnknown;
185
+ interface SearchExecutionIdentity {
186
+ model: SearchModelIdentity;
187
+ agent: SearchSourceRef;
188
+ benchmark: SearchSourceRef;
189
+ }
190
+ type SearchEstimateMethod = 'none' | 'insufficient' | 'descriptive' | 'bootstrap';
191
+ /**
192
+ * A paired contrast of one node against another on shared units. `none` below
193
+ * 2 pairs, `insufficient` below 6, `descriptive` below 20, `bootstrap` from 20.
194
+ * `estimateNode` computes it; the ledger records the estimate a decision used.
195
+ */
196
+ interface NodeEstimate {
197
+ against: string;
198
+ split: SearchSplit;
199
+ /** Units the node scored on the split. */
200
+ units: number;
201
+ /** Units both nodes scored: the paired sample. */
202
+ pairs: number;
203
+ /** Mean per-unit difference, node minus `against`, in the metric's units.
204
+ * Null for `none`. */
205
+ delta: number | null;
206
+ /** Bootstrap interval on `delta`: spread for `descriptive`, decision grade
207
+ * for `bootstrap`. Null for `none`, `insufficient` and an indeterminate sample. */
208
+ interval: [number, number] | null;
209
+ method: SearchEstimateMethod;
210
+ /** Exact one-sided sign-test p toward improvement; `descriptive` only. */
211
+ exactSignP: number | null;
212
+ /** Every paired delta is equal, so an interval would have zero width and
213
+ * carries no evidence either way. */
214
+ indeterminate: boolean;
215
+ /** Digest of the cells read, which also seeds the bootstrap. */
216
+ cellSetDigest: SearchLedgerHash;
217
+ estimator: SearchSourceRef;
218
+ }
219
+ type SearchNodeDecision = {
220
+ status: 'advanced';
221
+ rung: number;
222
+ } | {
223
+ status: 'pruned';
224
+ } | {
225
+ status: 'invalid';
226
+ } | {
227
+ status: 'finalist';
228
+ } | {
229
+ status: 'selected';
230
+ } | {
231
+ status: 'rejected';
232
+ };
233
+ type SearchNodeStatus = SearchNodeDecision['status'];
234
+ type SearchCloseReason = 'budget' | 'deadline' | 'max-nodes' | 'patience' | 'converged' | 'aborted';
235
+ type SearchCancelReason = 'pruned' | 'budget' | 'deadline' | 'aborted';
236
+ type SearchClaimPower = {
237
+ adequate: boolean;
238
+ minimumEffect: number;
239
+ powerAtMinimumEffect: number;
240
+ units: number;
241
+ } | SearchUnknown;
242
+ /** The claim made once, on the sealed test split. `selected` names the node the
243
+ * search keeps: a finalist on `ship`, the root otherwise (or null when the
244
+ * search keeps nothing). */
245
+ interface SearchClaim {
246
+ power: SearchClaimPower;
247
+ finalists: Array<{
248
+ nodeId: string;
249
+ estimate: NodeEstimate | null;
250
+ promote: boolean;
251
+ }>;
252
+ selected: string | null;
253
+ decision: 'ship' | 'hold' | 'test-cannot-resolve';
254
+ }
255
+ interface SearchLedgerEventBase {
256
+ eventId: string;
257
+ occurredAt: string;
258
+ artifacts: SearchArtifactRef[];
259
+ }
260
+ /** First event, once: what is searched, against what, on which tasks, under which budget. */
261
+ interface SearchOpenedEvent extends SearchLedgerEventBase {
262
+ kind: 'search-opened';
263
+ /** What the search improves, for example `vb/coder`. */
264
+ subject: string;
265
+ process: {
266
+ name: string;
267
+ executionRef: SearchSourceRef;
268
+ };
269
+ artifactKind: SearchArtifactKind;
270
+ objective: {
271
+ metric: string;
272
+ direction: 'maximize' | 'minimize';
273
+ judge: SearchSourceRef | SearchUnknown;
274
+ claim: EvaluationClaim;
275
+ };
276
+ splits: SearchSplits;
277
+ policy: {
278
+ expansion: string;
279
+ allocation: string;
280
+ seed: number;
281
+ };
282
+ budget: SearchBudget;
283
+ /** The cell attempt of another search whose execution runs this one. */
284
+ containment: {
285
+ searchId: string;
286
+ cellId: string;
287
+ attempt: number;
288
+ } | null;
289
+ /** The node of another search this one starts from. */
290
+ derivedFrom: {
291
+ searchId: string;
292
+ nodeId: string;
293
+ headHash: SearchLedgerHash;
294
+ } | null;
295
+ identity: SearchExecutionIdentity;
296
+ }
297
+ interface SearchOperationStartedEvent extends SearchLedgerEventBase {
298
+ kind: 'operation-started';
299
+ operationId: string;
300
+ operationKind: SearchOperationKind;
301
+ reservation: SearchReservation | null;
302
+ }
303
+ interface SearchOperationRecordedEvent extends SearchLedgerEventBase {
304
+ kind: 'operation-recorded';
305
+ operationId: string;
306
+ operationKind: SearchOperationKind;
307
+ execution: {
308
+ kind: 'model';
309
+ model: SearchModelIdentity;
310
+ source: SearchSourceRef;
311
+ } | {
312
+ kind: 'deterministic';
313
+ source: SearchSourceRef;
314
+ };
315
+ outcome: {
316
+ status: 'completed';
317
+ } | {
318
+ status: 'partial';
319
+ failure: SearchFailureReason;
320
+ } | {
321
+ status: 'failed';
322
+ failure: SearchFailureReason;
323
+ };
324
+ accounting: SearchAttemptAccounting;
325
+ }
326
+ /** A content-addressed artifact enters the search. `nodeId` is
327
+ * `searchNodeId(searchId, artifactDigest)`, so a re-proposal of identical
328
+ * content is a second edge into this node, never a second node. */
329
+ interface SearchNodeRegisteredEvent extends SearchLedgerEventBase {
330
+ kind: 'node-registered';
331
+ nodeId: string;
332
+ artifactDigest: SearchLedgerHash;
333
+ artifact: SearchArtifactRef;
334
+ surfaces: SearchCandidateSurface[];
335
+ }
336
+ /** The proposal that derived a node from its parents. */
337
+ interface SearchEdgeRecordedEvent extends SearchLedgerEventBase {
338
+ kind: 'edge-recorded';
339
+ edgeId: string;
340
+ childNodeId: string;
341
+ /** Primary parent first. Empty for `seed` and for `unknown` attribution; a
342
+ * parent in another search appears only on a `derive` edge. */
343
+ parents: SearchNodeRef[];
344
+ operator: SearchEdgeOperator;
345
+ attribution: SearchEdgeAttribution;
346
+ /** Null only on a `seed` edge: the search's starting artifact was not proposed. */
347
+ proposer: SearchProposer | null;
348
+ /** Why the policy chose these parents. */
349
+ selection: {
350
+ rule: string;
351
+ evidence: Record<string, number>;
352
+ } | null;
353
+ /** The proposer's redacted rationale. */
354
+ rationale: SearchArtifactRef | SearchUnknown;
355
+ /** One diff per parent, parent to child. */
356
+ diffs: Array<SearchArtifactRef | SearchUnknown>;
357
+ /** At most 200 characters, redacted. */
358
+ label: string;
359
+ }
360
+ /** One node on one task in one split at one repeat is planned. `cellId` is
361
+ * `searchCellId(searchId, nodeId, taskId, split, rep)`. */
362
+ interface SearchCellAllocatedEvent extends SearchLedgerEventBase {
363
+ kind: 'cell-allocated';
364
+ cellId: string;
365
+ nodeId: string;
366
+ taskId: string;
367
+ unitId: string;
368
+ split: SearchSplit;
369
+ rep: number;
370
+ stage: SearchCellStage;
371
+ lane: string | null;
372
+ /** Null when no reservation was made: an external optimizer dispatched the cell. */
373
+ reservation: SearchReservation | null;
374
+ }
375
+ /** One attempt at a cell finished. Its RunRecord, when the producer minted one,
376
+ * is an artifact with role `run-record`. */
377
+ interface SearchCellSettledEvent extends SearchLedgerEventBase {
378
+ kind: 'cell-settled';
379
+ cellId: string;
380
+ /** Counted from 1 without gaps. */
381
+ attempt: number;
382
+ /** `searchCellRunId({ cellId, attempt })`. */
383
+ runId: string;
384
+ outcome: SearchTaskOutcome;
385
+ accounting: SearchAttemptAccounting;
386
+ boxMinutes: number | null;
387
+ wallMs: number | null;
388
+ queueMs: number | null;
389
+ placement: {
390
+ lane: string;
391
+ boxId: string | null;
392
+ } | null;
393
+ identity: SearchExecutionIdentity;
394
+ surfaceEvidence: SearchSurfaceEvidence[];
395
+ traceRef: SearchTraceRef;
396
+ }
397
+ interface SearchCellCancelledEvent extends SearchLedgerEventBase {
398
+ kind: 'cell-cancelled';
399
+ cellId: string;
400
+ reason: SearchCancelReason;
401
+ }
402
+ /** A policy, allocator or claim decision about a node. May repeat; the latest wins. */
403
+ interface SearchNodeDecidedEvent extends SearchLedgerEventBase {
404
+ kind: 'node-decided';
405
+ nodeId: string;
406
+ decision: SearchNodeDecision;
407
+ basis: NodeEstimate | null;
408
+ rule: string;
409
+ reason: string;
410
+ }
411
+ /** Last event, once. More work on a closed search is a derived search. */
412
+ interface SearchClosedEvent extends SearchLedgerEventBase {
413
+ kind: 'search-closed';
414
+ reason: SearchCloseReason;
415
+ claim: SearchClaim | null;
416
+ }
417
+ type SearchLedgerEvent = SearchOpenedEvent | SearchOperationStartedEvent | SearchOperationRecordedEvent | SearchNodeRegisteredEvent | SearchEdgeRecordedEvent | SearchCellAllocatedEvent | SearchCellSettledEvent | SearchCellCancelledEvent | SearchNodeDecidedEvent | SearchClosedEvent;
418
+ interface SearchLedgerEntry {
419
+ schema: typeof SEARCH_LEDGER_SCHEMA;
420
+ searchId: string;
421
+ sequence: number;
422
+ previousHash: SearchLedgerHash | null;
423
+ event: SearchLedgerEvent;
424
+ entryHash: SearchLedgerHash;
425
+ }
426
+ /** Counts and sums over the whole search. Every field is a number or a short
427
+ * scalar, so reading the audit costs the same at any search size. */
428
+ interface SearchAudit {
429
+ searchId: string;
430
+ eventCount: number;
431
+ headHash: SearchLedgerHash | null;
432
+ status: 'open' | 'closed';
433
+ closeReason: SearchCloseReason | null;
434
+ nodes: number;
435
+ /** Nodes with no edge yet: not placed in the tree. */
436
+ nodesWithoutEdge: number;
437
+ /** Nodes whose latest decision is missing or `advanced`. */
438
+ undecidedNodes: number;
439
+ selectedNodeId: string | null;
440
+ edges: {
441
+ explicit: number;
442
+ correlated: number;
443
+ unknown: number;
444
+ reproposals: number;
445
+ };
446
+ cells: {
447
+ allocated: number;
448
+ settled: number;
449
+ cancelled: number;
450
+ open: number;
451
+ };
452
+ attempts: number;
453
+ outcomes: {
454
+ passed: number;
455
+ failed: number;
456
+ errored: number;
457
+ };
458
+ operations: {
459
+ started: number;
460
+ recorded: number;
461
+ open: number;
462
+ };
463
+ spend: {
464
+ /** Sum of known cell and operation costs. */
465
+ knownUsd: number;
466
+ /** Sum of the proven lower bounds of unknown costs. */
467
+ floorUsd: number;
468
+ unknownCostCells: number;
469
+ unknownCostOperations: number;
470
+ /** knownUsd + floorUsd. */
471
+ committedUsd: number;
472
+ /** Reservations of unsettled cells and unrecorded operations, net of their spend so far. */
473
+ openReservationUsd: number;
474
+ /** Spend above reservations. */
475
+ overspendUsd: number;
476
+ /** Settled cells that ran without a reservation. */
477
+ unreservedCells: number;
478
+ boxMinutes: number;
479
+ };
480
+ tokens: {
481
+ inputTokens: number;
482
+ outputTokens: number;
483
+ cachedTokens: number;
484
+ unknownTokenAttempts: number;
485
+ };
486
+ }
487
+ //#endregion
488
+ export { SearchNodeDecision as A, SearchReservation as B, SearchExecutionIdentity as C, SearchLedgerHash as D, SearchLedgerEvent as E, SearchOperationKind as F, SearchSurfaceEffect as G, SearchSplit as H, SearchOperationRecordedEvent as I, SearchTask as J, SearchSurfaceEvidence as K, SearchOperationStartedEvent as L, SearchNodeRegisteredEvent as M, SearchNodeStatus as N, SearchModelIdentity as O, SearchOpenedEvent as P, SearchUnknown as Q, SearchProposer as R, SearchEstimateMethod as S, SearchLedgerEntry as T, SearchSplitTasks as U, SearchSourceRef as V, SearchSplits as W, SearchTokenAccounting as X, SearchTaskOutcome as Y, SearchTraceRef as Z, SearchClosedEvent as _, SearchAttemptAccounting as a, SearchEdgeOperator as b, SearchCancelReason as c, SearchCellCancelledEvent as d, SearchCellSettledEvent as f, SearchCloseReason as g, SearchClaimPower as h, SearchArtifactRef as i, SearchNodeRef as j, SearchNodeDecidedEvent as k, SearchCandidateSurface as l, SearchClaim as m, SEARCH_LEDGER_SCHEMA as n, SearchAudit as o, SearchCellStage as p, SearchSurfaceKind as q, SearchArtifactKind as r, SearchBudget as s, NodeEstimate as t, SearchCellAllocatedEvent as u, SearchCostAccounting as v, SearchFailureReason as w, SearchEdgeRecordedEvent as x, SearchEdgeAttribution as y, SearchProposerKind as z };
489
+ //# sourceMappingURL=search-ledger-types-C9anU2DX.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-ledger-types-C9anU2DX.d.ts","names":[],"sources":["../src/campaign/search-ledger-types.ts"],"mappings":"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"}
@@ -1,9 +1,9 @@
1
1
  import { i as CostLedger } from "./cost-ledger-_IbkejCF.js";
2
- import { u as Mutex } from "./journal-CDP0Vhx_.js";
3
- import { N as RawAnalystFindingSchema } from "./kind-factory-BGwN0nE6.js";
4
- import { c as extractJsonPayload } from "./llm-client-DF9bPNYA.js";
5
- import { n as paidJsonChat, t as paidChat } from "./chat-json-call-JVGbfx95.js";
6
- import { n as decodeRawFindingArray } from "./dspy-rlm-engine-DLYttKBm.js";
2
+ import { f as Mutex } from "./journal-c3qY0SDP.js";
3
+ import { N as RawAnalystFindingSchema } from "./kind-factory-ByZeXDqF.js";
4
+ import { c as extractJsonPayload } from "./llm-client-KYQBh9C8.js";
5
+ import { n as paidJsonChat, t as paidChat } from "./chat-json-call-CXHBvUz8.js";
6
+ import { n as decodeRawFindingArray } from "./dspy-rlm-engine-Cs5LzJ-f.js";
7
7
  import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
8
8
  import { z } from "zod";
9
9
  import { dirname } from "node:path";
@@ -777,4 +777,4 @@ async function runSemanticConceptJudge(input, options) {
777
777
  //#endregion
778
778
  export { diffFindings as a, defaultIsMaterial as i, runSemanticConceptJudge as n, createChatTraceEngine as o, FindingsStore as r, SEMANTIC_CONCEPT_JUDGE_VERSION as t };
779
779
 
780
- //# sourceMappingURL=semantic-concept-judge-Cm2K2wAo.js.map
780
+ //# sourceMappingURL=semantic-concept-judge-ClB73cei.js.map