modelrig 0.0.1 → 0.2.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 (420) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/LICENSE +201 -0
  3. package/README.md +145 -8
  4. package/data/PROVENANCE.md +19 -0
  5. package/data/pricing-manual.json +22 -0
  6. package/data/pricing-map.json +46362 -0
  7. package/data/pricing-overlay.json +419 -0
  8. package/dist/adapters/anthropic.d.ts +90 -0
  9. package/dist/adapters/anthropic.d.ts.map +1 -0
  10. package/dist/adapters/anthropic.js +296 -0
  11. package/dist/adapters/build-adapters.d.ts +11 -0
  12. package/dist/adapters/build-adapters.d.ts.map +1 -0
  13. package/dist/adapters/build-adapters.js +45 -0
  14. package/dist/adapters/deepseek.d.ts +47 -0
  15. package/dist/adapters/deepseek.d.ts.map +1 -0
  16. package/dist/adapters/deepseek.js +216 -0
  17. package/dist/adapters/gemini.d.ts +44 -0
  18. package/dist/adapters/gemini.d.ts.map +1 -0
  19. package/dist/adapters/gemini.js +262 -0
  20. package/dist/adapters/grok.d.ts +53 -0
  21. package/dist/adapters/grok.d.ts.map +1 -0
  22. package/dist/adapters/grok.js +232 -0
  23. package/dist/adapters/openai-compat.d.ts +80 -0
  24. package/dist/adapters/openai-compat.d.ts.map +1 -0
  25. package/dist/adapters/openai-compat.js +244 -0
  26. package/dist/adapters/openai-stream.d.ts +58 -0
  27. package/dist/adapters/openai-stream.d.ts.map +1 -0
  28. package/dist/adapters/openai-stream.js +120 -0
  29. package/dist/adapters/openai.d.ts +55 -0
  30. package/dist/adapters/openai.d.ts.map +1 -0
  31. package/dist/adapters/openai.js +281 -0
  32. package/dist/adapters/sampling.d.ts +28 -0
  33. package/dist/adapters/sampling.d.ts.map +1 -0
  34. package/dist/adapters/sampling.js +34 -0
  35. package/dist/adapters/tool-mapping.d.ts +92 -0
  36. package/dist/adapters/tool-mapping.d.ts.map +1 -0
  37. package/dist/adapters/tool-mapping.js +143 -0
  38. package/dist/artifacts/artifact.d.ts +137 -0
  39. package/dist/artifacts/artifact.d.ts.map +1 -0
  40. package/dist/artifacts/artifact.js +377 -0
  41. package/dist/artifacts/content-uploader.d.ts +87 -0
  42. package/dist/artifacts/content-uploader.d.ts.map +1 -0
  43. package/dist/artifacts/content-uploader.js +124 -0
  44. package/dist/artifacts/index.d.ts +63 -0
  45. package/dist/artifacts/index.d.ts.map +1 -0
  46. package/dist/artifacts/index.js +80 -0
  47. package/dist/artifacts/run-context.d.ts +129 -0
  48. package/dist/artifacts/run-context.d.ts.map +1 -0
  49. package/dist/artifacts/run-context.js +208 -0
  50. package/dist/artifacts/scrub.d.ts +60 -0
  51. package/dist/artifacts/scrub.d.ts.map +1 -0
  52. package/dist/artifacts/scrub.js +139 -0
  53. package/dist/artifacts/step.d.ts +26 -0
  54. package/dist/artifacts/step.d.ts.map +1 -0
  55. package/dist/artifacts/step.js +37 -0
  56. package/dist/artifacts/taint.d.ts +63 -0
  57. package/dist/artifacts/taint.d.ts.map +1 -0
  58. package/dist/artifacts/taint.js +76 -0
  59. package/dist/bakeoff/cache-sim.d.ts +99 -0
  60. package/dist/bakeoff/cache-sim.d.ts.map +1 -0
  61. package/dist/bakeoff/cache-sim.js +126 -0
  62. package/dist/bakeoff/engine.d.ts +52 -0
  63. package/dist/bakeoff/engine.d.ts.map +1 -0
  64. package/dist/bakeoff/engine.js +163 -0
  65. package/dist/bakeoff/eval-cases.d.ts +96 -0
  66. package/dist/bakeoff/eval-cases.d.ts.map +1 -0
  67. package/dist/bakeoff/eval-cases.js +105 -0
  68. package/dist/bakeoff/replay.d.ts +52 -0
  69. package/dist/bakeoff/replay.d.ts.map +1 -0
  70. package/dist/bakeoff/replay.js +94 -0
  71. package/dist/bakeoff/report.d.ts +41 -0
  72. package/dist/bakeoff/report.d.ts.map +1 -0
  73. package/dist/bakeoff/report.js +142 -0
  74. package/dist/bakeoff/samples.d.ts +77 -0
  75. package/dist/bakeoff/samples.d.ts.map +1 -0
  76. package/dist/bakeoff/samples.js +148 -0
  77. package/dist/bakeoff/stats.d.ts +13 -0
  78. package/dist/bakeoff/stats.d.ts.map +1 -0
  79. package/dist/bakeoff/stats.js +48 -0
  80. package/dist/bakeoff/types.d.ts +37 -0
  81. package/dist/bakeoff/types.d.ts.map +1 -0
  82. package/dist/bakeoff/types.js +10 -0
  83. package/dist/cli.d.ts +25 -0
  84. package/dist/cli.d.ts.map +1 -0
  85. package/dist/cli.js +590 -0
  86. package/dist/config.d.ts +204 -0
  87. package/dist/config.d.ts.map +1 -0
  88. package/dist/config.js +252 -0
  89. package/dist/deprecations.d.ts +32 -0
  90. package/dist/deprecations.d.ts.map +1 -0
  91. package/dist/deprecations.js +59 -0
  92. package/dist/feedback/coverage.d.ts +32 -0
  93. package/dist/feedback/coverage.d.ts.map +1 -0
  94. package/dist/feedback/coverage.js +95 -0
  95. package/dist/feedback/feedback.d.ts +35 -0
  96. package/dist/feedback/feedback.d.ts.map +1 -0
  97. package/dist/feedback/feedback.js +39 -0
  98. package/dist/gateway/http-protocol.d.ts +175 -0
  99. package/dist/gateway/http-protocol.d.ts.map +1 -0
  100. package/dist/gateway/http-protocol.js +105 -0
  101. package/dist/index.d.ts +242 -0
  102. package/dist/index.d.ts.map +1 -0
  103. package/dist/index.js +576 -0
  104. package/dist/init/finder.d.ts +94 -0
  105. package/dist/init/finder.d.ts.map +1 -0
  106. package/dist/init/finder.js +343 -0
  107. package/dist/init/init-cli.d.ts +10 -0
  108. package/dist/init/init-cli.d.ts.map +1 -0
  109. package/dist/init/init-cli.js +86 -0
  110. package/dist/init/observe-cli.d.ts +19 -0
  111. package/dist/init/observe-cli.d.ts.map +1 -0
  112. package/dist/init/observe-cli.js +73 -0
  113. package/dist/init/observe.d.ts +81 -0
  114. package/dist/init/observe.d.ts.map +1 -0
  115. package/dist/init/observe.js +245 -0
  116. package/dist/init/run.d.ts +99 -0
  117. package/dist/init/run.d.ts.map +1 -0
  118. package/dist/init/run.js +281 -0
  119. package/dist/init/signatures.d.ts +39 -0
  120. package/dist/init/signatures.d.ts.map +1 -0
  121. package/dist/init/signatures.js +116 -0
  122. package/dist/matrix/aggregate.d.ts +89 -0
  123. package/dist/matrix/aggregate.d.ts.map +1 -0
  124. package/dist/matrix/aggregate.js +186 -0
  125. package/dist/query/grammar.d.ts +35 -0
  126. package/dist/query/grammar.d.ts.map +1 -0
  127. package/dist/query/grammar.js +279 -0
  128. package/dist/query/run.d.ts +8 -0
  129. package/dist/query/run.d.ts.map +1 -0
  130. package/dist/query/run.js +21 -0
  131. package/dist/registry/build.d.ts +219 -0
  132. package/dist/registry/build.d.ts.map +1 -0
  133. package/dist/registry/build.js +313 -0
  134. package/dist/registry/cache-policy.d.ts +94 -0
  135. package/dist/registry/cache-policy.d.ts.map +1 -0
  136. package/dist/registry/cache-policy.js +238 -0
  137. package/dist/registry/call-notes.d.ts +11 -0
  138. package/dist/registry/call-notes.d.ts.map +1 -0
  139. package/dist/registry/call-notes.js +110 -0
  140. package/dist/registry/claims.d.ts +63 -0
  141. package/dist/registry/claims.d.ts.map +1 -0
  142. package/dist/registry/claims.js +107 -0
  143. package/dist/registry/effective-rate.d.ts +151 -0
  144. package/dist/registry/effective-rate.d.ts.map +1 -0
  145. package/dist/registry/effective-rate.js +156 -0
  146. package/dist/registry/facts.d.ts +32 -0
  147. package/dist/registry/facts.d.ts.map +1 -0
  148. package/dist/registry/facts.js +136 -0
  149. package/dist/registry/fingerprint.d.ts +20 -0
  150. package/dist/registry/fingerprint.d.ts.map +1 -0
  151. package/dist/registry/fingerprint.js +150 -0
  152. package/dist/registry/parity.d.ts +52 -0
  153. package/dist/registry/parity.d.ts.map +1 -0
  154. package/dist/registry/parity.js +82 -0
  155. package/dist/registry/pricing-shape.d.ts +113 -0
  156. package/dist/registry/pricing-shape.d.ts.map +1 -0
  157. package/dist/registry/pricing-shape.js +123 -0
  158. package/dist/registry/pricing.d.ts +43 -0
  159. package/dist/registry/pricing.d.ts.map +1 -0
  160. package/dist/registry/pricing.js +127 -0
  161. package/dist/registry/rows.d.ts +16 -0
  162. package/dist/registry/rows.d.ts.map +1 -0
  163. package/dist/registry/rows.js +57 -0
  164. package/dist/registry/seed.d.ts +43 -0
  165. package/dist/registry/seed.d.ts.map +1 -0
  166. package/dist/registry/seed.js +97 -0
  167. package/dist/registry/select.d.ts +68 -0
  168. package/dist/registry/select.d.ts.map +1 -0
  169. package/dist/registry/select.js +141 -0
  170. package/dist/registry/staleness.d.ts +18 -0
  171. package/dist/registry/staleness.d.ts.map +1 -0
  172. package/dist/registry/staleness.js +39 -0
  173. package/dist/rigindex/bootstrap.d.ts +36 -0
  174. package/dist/rigindex/bootstrap.d.ts.map +1 -0
  175. package/dist/rigindex/bootstrap.js +97 -0
  176. package/dist/rigindex/fit.d.ts +24 -0
  177. package/dist/rigindex/fit.d.ts.map +1 -0
  178. package/dist/rigindex/fit.js +76 -0
  179. package/dist/rigindex/gates.d.ts +52 -0
  180. package/dist/rigindex/gates.d.ts.map +1 -0
  181. package/dist/rigindex/gates.js +109 -0
  182. package/dist/rigindex/graph.d.ts +31 -0
  183. package/dist/rigindex/graph.d.ts.map +1 -0
  184. package/dist/rigindex/graph.js +120 -0
  185. package/dist/rigindex/index.d.ts +23 -0
  186. package/dist/rigindex/index.d.ts.map +1 -0
  187. package/dist/rigindex/index.js +112 -0
  188. package/dist/rigindex/types.d.ts +76 -0
  189. package/dist/rigindex/types.d.ts.map +1 -0
  190. package/dist/rigindex/types.js +8 -0
  191. package/dist/routes/cache-lint.d.ts +41 -0
  192. package/dist/routes/cache-lint.d.ts.map +1 -0
  193. package/dist/routes/cache-lint.js +81 -0
  194. package/dist/routes/draft.d.ts +83 -0
  195. package/dist/routes/draft.d.ts.map +1 -0
  196. package/dist/routes/draft.js +135 -0
  197. package/dist/routes/loader.d.ts +63 -0
  198. package/dist/routes/loader.d.ts.map +1 -0
  199. package/dist/routes/loader.js +574 -0
  200. package/dist/routes/manifest.d.ts +24 -0
  201. package/dist/routes/manifest.d.ts.map +1 -0
  202. package/dist/routes/manifest.js +118 -0
  203. package/dist/routes/resolved-bundle.d.ts +79 -0
  204. package/dist/routes/resolved-bundle.d.ts.map +1 -0
  205. package/dist/routes/resolved-bundle.js +148 -0
  206. package/dist/routes/sampling-config.d.ts +32 -0
  207. package/dist/routes/sampling-config.d.ts.map +1 -0
  208. package/dist/routes/sampling-config.js +91 -0
  209. package/dist/routes/serveability.d.ts +52 -0
  210. package/dist/routes/serveability.d.ts.map +1 -0
  211. package/dist/routes/serveability.js +73 -0
  212. package/dist/routes/template.d.ts +18 -0
  213. package/dist/routes/template.d.ts.map +1 -0
  214. package/dist/routes/template.js +94 -0
  215. package/dist/run/ajv.d.ts +22 -0
  216. package/dist/run/ajv.d.ts.map +1 -0
  217. package/dist/run/ajv.js +32 -0
  218. package/dist/run/cache-handle.d.ts +58 -0
  219. package/dist/run/cache-handle.d.ts.map +1 -0
  220. package/dist/run/cache-handle.js +54 -0
  221. package/dist/run/cache-stamp.d.ts +65 -0
  222. package/dist/run/cache-stamp.d.ts.map +1 -0
  223. package/dist/run/cache-stamp.js +0 -0
  224. package/dist/run/capture-write.d.ts +33 -0
  225. package/dist/run/capture-write.d.ts.map +1 -0
  226. package/dist/run/capture-write.js +55 -0
  227. package/dist/run/cost.d.ts +26 -0
  228. package/dist/run/cost.d.ts.map +1 -0
  229. package/dist/run/cost.js +41 -0
  230. package/dist/run/dispatch.d.ts +99 -0
  231. package/dist/run/dispatch.d.ts.map +1 -0
  232. package/dist/run/dispatch.js +191 -0
  233. package/dist/run/envelope.d.ts +21 -0
  234. package/dist/run/envelope.d.ts.map +1 -0
  235. package/dist/run/envelope.js +45 -0
  236. package/dist/run/grounding.d.ts +56 -0
  237. package/dist/run/grounding.d.ts.map +1 -0
  238. package/dist/run/grounding.js +89 -0
  239. package/dist/run/raw.d.ts +88 -0
  240. package/dist/run/raw.d.ts.map +1 -0
  241. package/dist/run/raw.js +286 -0
  242. package/dist/run/record-attempt.d.ts +40 -0
  243. package/dist/run/record-attempt.d.ts.map +1 -0
  244. package/dist/run/record-attempt.js +99 -0
  245. package/dist/run/repair.d.ts +36 -0
  246. package/dist/run/repair.d.ts.map +1 -0
  247. package/dist/run/repair.js +61 -0
  248. package/dist/run/resolve.d.ts +99 -0
  249. package/dist/run/resolve.d.ts.map +1 -0
  250. package/dist/run/resolve.js +203 -0
  251. package/dist/run/retry.d.ts +19 -0
  252. package/dist/run/retry.d.ts.map +1 -0
  253. package/dist/run/retry.js +50 -0
  254. package/dist/run/run.d.ts +55 -0
  255. package/dist/run/run.d.ts.map +1 -0
  256. package/dist/run/run.js +540 -0
  257. package/dist/run/stream.d.ts +49 -0
  258. package/dist/run/stream.d.ts.map +1 -0
  259. package/dist/run/stream.js +87 -0
  260. package/dist/run/validate.d.ts +15 -0
  261. package/dist/run/validate.d.ts.map +1 -0
  262. package/dist/run/validate.js +55 -0
  263. package/dist/savings/cache-ledger.d.ts +108 -0
  264. package/dist/savings/cache-ledger.d.ts.map +1 -0
  265. package/dist/savings/cache-ledger.js +174 -0
  266. package/dist/savings/cache-reconcile.d.ts +64 -0
  267. package/dist/savings/cache-reconcile.d.ts.map +1 -0
  268. package/dist/savings/cache-reconcile.js +59 -0
  269. package/dist/savings/cache-stats.d.ts +63 -0
  270. package/dist/savings/cache-stats.d.ts.map +1 -0
  271. package/dist/savings/cache-stats.js +108 -0
  272. package/dist/savings/emit.d.ts +38 -0
  273. package/dist/savings/emit.d.ts.map +1 -0
  274. package/dist/savings/emit.js +100 -0
  275. package/dist/savings/odometer.d.ts +32 -0
  276. package/dist/savings/odometer.d.ts.map +1 -0
  277. package/dist/savings/odometer.js +70 -0
  278. package/dist/savings/swap-execute.d.ts +58 -0
  279. package/dist/savings/swap-execute.d.ts.map +1 -0
  280. package/dist/savings/swap-execute.js +130 -0
  281. package/dist/savings/swaps-client.d.ts +55 -0
  282. package/dist/savings/swaps-client.d.ts.map +1 -0
  283. package/dist/savings/swaps-client.js +95 -0
  284. package/dist/settings/api-fetcher.d.ts +39 -0
  285. package/dist/settings/api-fetcher.d.ts.map +1 -0
  286. package/dist/settings/api-fetcher.js +92 -0
  287. package/dist/settings/index.d.ts +10 -0
  288. package/dist/settings/index.d.ts.map +1 -0
  289. package/dist/settings/index.js +15 -0
  290. package/dist/settings/task-settings.d.ts +91 -0
  291. package/dist/settings/task-settings.d.ts.map +1 -0
  292. package/dist/settings/task-settings.js +116 -0
  293. package/dist/status.d.ts +77 -0
  294. package/dist/status.d.ts.map +1 -0
  295. package/dist/status.js +113 -0
  296. package/dist/telemetry/artifact-store.d.ts +48 -0
  297. package/dist/telemetry/artifact-store.d.ts.map +1 -0
  298. package/dist/telemetry/artifact-store.js +189 -0
  299. package/dist/telemetry/cache-miss-streak.d.ts +79 -0
  300. package/dist/telemetry/cache-miss-streak.d.ts.map +1 -0
  301. package/dist/telemetry/cache-miss-streak.js +99 -0
  302. package/dist/telemetry/capture.d.ts +31 -0
  303. package/dist/telemetry/capture.d.ts.map +1 -0
  304. package/dist/telemetry/capture.js +81 -0
  305. package/dist/telemetry/exporter-setup.d.ts +28 -0
  306. package/dist/telemetry/exporter-setup.d.ts.map +1 -0
  307. package/dist/telemetry/exporter-setup.js +34 -0
  308. package/dist/telemetry/exporter.d.ts +137 -0
  309. package/dist/telemetry/exporter.d.ts.map +1 -0
  310. package/dist/telemetry/exporter.js +510 -0
  311. package/dist/telemetry/health.d.ts +76 -0
  312. package/dist/telemetry/health.d.ts.map +1 -0
  313. package/dist/telemetry/health.js +92 -0
  314. package/dist/telemetry/ingest-protocol.d.ts +310 -0
  315. package/dist/telemetry/ingest-protocol.d.ts.map +1 -0
  316. package/dist/telemetry/ingest-protocol.js +363 -0
  317. package/dist/telemetry/load-error-report.d.ts +24 -0
  318. package/dist/telemetry/load-error-report.d.ts.map +1 -0
  319. package/dist/telemetry/load-error-report.js +50 -0
  320. package/dist/telemetry/otel-map.d.ts +121 -0
  321. package/dist/telemetry/otel-map.d.ts.map +1 -0
  322. package/dist/telemetry/otel-map.js +224 -0
  323. package/dist/telemetry/otel-normalize.d.ts +104 -0
  324. package/dist/telemetry/otel-normalize.d.ts.map +1 -0
  325. package/dist/telemetry/otel-normalize.js +530 -0
  326. package/dist/telemetry/otlp-emitter.d.ts +52 -0
  327. package/dist/telemetry/otlp-emitter.d.ts.map +1 -0
  328. package/dist/telemetry/otlp-emitter.js +144 -0
  329. package/dist/telemetry/otlp-proto.d.ts +29 -0
  330. package/dist/telemetry/otlp-proto.d.ts.map +1 -0
  331. package/dist/telemetry/otlp-proto.js +266 -0
  332. package/dist/telemetry/sinks.d.ts +90 -0
  333. package/dist/telemetry/sinks.d.ts.map +1 -0
  334. package/dist/telemetry/sinks.js +180 -0
  335. package/dist/telemetry/store.d.ts +65 -0
  336. package/dist/telemetry/store.d.ts.map +1 -0
  337. package/dist/telemetry/store.js +547 -0
  338. package/dist/tenancy/api-key-format.d.ts +77 -0
  339. package/dist/tenancy/api-key-format.d.ts.map +1 -0
  340. package/dist/tenancy/api-key-format.js +110 -0
  341. package/dist/tenancy/constants.d.ts +23 -0
  342. package/dist/tenancy/constants.d.ts.map +1 -0
  343. package/dist/tenancy/constants.js +25 -0
  344. package/dist/tenancy/scrub.d.ts +47 -0
  345. package/dist/tenancy/scrub.d.ts.map +1 -0
  346. package/dist/tenancy/scrub.js +85 -0
  347. package/dist/types/config-teaching.d.ts +62 -0
  348. package/dist/types/config-teaching.d.ts.map +1 -0
  349. package/dist/types/config-teaching.js +183 -0
  350. package/dist/types/failures-teaching.d.ts +56 -0
  351. package/dist/types/failures-teaching.d.ts.map +1 -0
  352. package/dist/types/failures-teaching.js +177 -0
  353. package/dist/types/failures.d.ts +27 -0
  354. package/dist/types/failures.d.ts.map +1 -0
  355. package/dist/types/failures.js +41 -0
  356. package/dist/types/provider.d.ts +200 -0
  357. package/dist/types/provider.d.ts.map +1 -0
  358. package/dist/types/provider.js +40 -0
  359. package/dist/types/route.d.ts +205 -0
  360. package/dist/types/route.d.ts.map +1 -0
  361. package/dist/types/route.js +6 -0
  362. package/dist/types/telemetry.d.ts +206 -0
  363. package/dist/types/telemetry.d.ts.map +1 -0
  364. package/dist/types/telemetry.js +6 -0
  365. package/dist/validate-cli.d.ts +12 -0
  366. package/dist/validate-cli.d.ts.map +1 -0
  367. package/dist/validate-cli.js +57 -0
  368. package/dist/verify/capture.d.ts +66 -0
  369. package/dist/verify/capture.d.ts.map +1 -0
  370. package/dist/verify/capture.js +180 -0
  371. package/dist/verify/cli-run.d.ts +23 -0
  372. package/dist/verify/cli-run.d.ts.map +1 -0
  373. package/dist/verify/cli-run.js +57 -0
  374. package/dist/verify/diff.d.ts +48 -0
  375. package/dist/verify/diff.d.ts.map +1 -0
  376. package/dist/verify/diff.js +157 -0
  377. package/dist/verify/index.d.ts +17 -0
  378. package/dist/verify/index.d.ts.map +1 -0
  379. package/dist/verify/index.js +24 -0
  380. package/dist/verify/report.d.ts +14 -0
  381. package/dist/verify/report.d.ts.map +1 -0
  382. package/dist/verify/report.js +88 -0
  383. package/dist/verify/types.d.ts +101 -0
  384. package/dist/verify/types.d.ts.map +1 -0
  385. package/dist/verify/types.js +17 -0
  386. package/dist/verify/verify.d.ts +29 -0
  387. package/dist/verify/verify.d.ts.map +1 -0
  388. package/dist/verify/verify.js +148 -0
  389. package/dist/watch/budget.d.ts +19 -0
  390. package/dist/watch/budget.d.ts.map +1 -0
  391. package/dist/watch/budget.js +35 -0
  392. package/dist/watch/evaluate.d.ts +225 -0
  393. package/dist/watch/evaluate.d.ts.map +1 -0
  394. package/dist/watch/evaluate.js +155 -0
  395. package/dist/watch/monitor.d.ts +116 -0
  396. package/dist/watch/monitor.d.ts.map +1 -0
  397. package/dist/watch/monitor.js +199 -0
  398. package/dist/watch/proposals.d.ts +89 -0
  399. package/dist/watch/proposals.d.ts.map +1 -0
  400. package/dist/watch/proposals.js +197 -0
  401. package/dist/watch/run-record.d.ts +64 -0
  402. package/dist/watch/run-record.d.ts.map +1 -0
  403. package/dist/watch/run-record.js +86 -0
  404. package/dist/watch/run-reported.d.ts +20 -0
  405. package/dist/watch/run-reported.d.ts.map +1 -0
  406. package/dist/watch/run-reported.js +53 -0
  407. package/dist/watch/run.d.ts +73 -0
  408. package/dist/watch/run.d.ts.map +1 -0
  409. package/dist/watch/run.js +83 -0
  410. package/dist/watch/state-store.d.ts +48 -0
  411. package/dist/watch/state-store.d.ts.map +1 -0
  412. package/dist/watch/state-store.js +86 -0
  413. package/dist/watch/state.d.ts +21 -0
  414. package/dist/watch/state.d.ts.map +1 -0
  415. package/dist/watch/state.js +93 -0
  416. package/package.json +56 -14
  417. package/registry/LICENSE +20 -0
  418. package/registry/leaderboard.json +3639 -0
  419. package/registry/registry.json +7263 -0
  420. package/index.js +0 -3
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Shadow-equivalence verifier contracts (Expansion §9, autonomy-ladder Tier 2).
3
+ *
4
+ * The verifier proves a SAME-MODEL call replacement is behavior-preserving
5
+ * BEFORE a human merges the Tier-2 PR: capture N invocations of the original
6
+ * call site's inputs/outputs locally, replay the SAME inputs through the
7
+ * ModelRig-routed replacement (same provider/model PINNED — this verifies the
8
+ * PLUMBING, never the model choice), diff the outputs, and emit a report the
9
+ * skill embeds in the PR.
10
+ *
11
+ * Honest refusal is a first-class output: a call site that can't be captured
12
+ * or replayed (streaming, dynamically-assembled prompts, or a route that does
13
+ * not pin the original model) is REFUSED, not forced — those sites are T0/T1
14
+ * territory per the spec's stated limits.
15
+ */
16
+ import type { CandidateSpec } from "../types/route";
17
+ /** One recorded original invocation: the extracted template variables that
18
+ * reconstruct the original prompt through the drafted route, and the original
19
+ * call's raw output text. */
20
+ export interface ShadowCapture {
21
+ /** The extracted template variables (Tier-2 turns a prompt into
22
+ * `systemTemplate` + variables); replayed through the route unchanged. */
23
+ readonly input: Record<string, unknown>;
24
+ /** The original call site's raw output text, verbatim. */
25
+ readonly output: string;
26
+ }
27
+ /** A call site (or a single input) that could NOT be captured/replayed.
28
+ * Refusing IS a correct output — these are T0/T1 territory, never a failure. */
29
+ export interface CaptureRefusal {
30
+ readonly reason: "streaming" | "dynamic-prompt" | "uncapturable";
31
+ readonly detail: string;
32
+ }
33
+ /** The portable capture fixture the skill writes and the verifier reads. Stays
34
+ * local (SQLite/JSON in the SDK process) — nothing here uploads. */
35
+ export interface ShadowCaptureFixture {
36
+ /** Where the original call lives, e.g. "src/pipeline/summarize.ts:42". */
37
+ readonly callSiteId: string;
38
+ /** The provider+model of the ORIGINAL call — the route MUST pin exactly this
39
+ * (same-model replacement; the verifier refuses otherwise). */
40
+ readonly original: CandidateSpec;
41
+ readonly capturedAt: string;
42
+ readonly samples: readonly ShadowCapture[];
43
+ /** Inputs/sites the capture step honestly declined (streaming, dynamic). */
44
+ readonly refusals?: readonly CaptureRefusal[];
45
+ /** JSON-pointer paths (exact, or subtree prefixes) whose value is allowed to
46
+ * differ without counting as a divergence — the migration's declared
47
+ * free-text / nondeterministic fields (e.g. "/summary"). Absent = every
48
+ * field must match (the conservative default). */
49
+ readonly nondeterministicPaths?: readonly string[];
50
+ }
51
+ /** Per-sample verdict — the honest three-way vocabulary. */
52
+ export type SampleVerdict = "equivalent" | "equivalent-modulo-nondeterminism" | "divergent";
53
+ /** Whole-run verdict: the per-sample vocabulary plus `refused` (the run never
54
+ * ran — pin violation, or nothing capturable). */
55
+ export type EquivalenceVerdict = SampleVerdict | "refused";
56
+ /** The result of diffing one original/routed output pair. */
57
+ export interface SampleDiff {
58
+ readonly verdict: SampleVerdict;
59
+ /** First differing structured field (JSON-pointer) when divergent on
60
+ * structured output; null when equivalent, modulo, or divergent for a
61
+ * non-field reason (bad JSON, plumbing failure, model mismatch). */
62
+ readonly firstDivergentPath: string | null;
63
+ readonly detail: string;
64
+ }
65
+ export interface SampleReport extends SampleDiff {
66
+ readonly index: number;
67
+ /** "provider/model" that actually served the replay — null when the replay
68
+ * itself failed before any model served. */
69
+ readonly servedModel: string | null;
70
+ readonly costUsd: number;
71
+ /** Set when the routed replay threw a typed failure (the plumbing could not
72
+ * produce a conformant output for this input) — itself a divergence. */
73
+ readonly failureClass: string | null;
74
+ }
75
+ export interface EquivalenceReport {
76
+ readonly schemaVersion: 1;
77
+ readonly kind: "shadow-equivalence";
78
+ readonly callSiteId: string;
79
+ readonly route: string;
80
+ readonly routeVersion: number;
81
+ /** "provider/model" the route pins — equal to the original by construction
82
+ * (the verifier refuses when it isn't). */
83
+ readonly pinnedModel: string;
84
+ readonly ranAt: string;
85
+ readonly n: number;
86
+ readonly overall: EquivalenceVerdict;
87
+ readonly counts: {
88
+ readonly equivalent: number;
89
+ readonly equivalentModulo: number;
90
+ readonly divergent: number;
91
+ };
92
+ readonly samples: readonly SampleReport[];
93
+ /** Capture-time refusals, surfaced verbatim (never a silent subset). */
94
+ readonly refusals: readonly CaptureRefusal[];
95
+ /** Set when `overall === "refused"` — why the run never ran. */
96
+ readonly refusalReason: string | null;
97
+ /** The plumbing-not-model-choice statement, embedded in the report so a PR
98
+ * reader cannot mistake equivalence for a model-quality claim. */
99
+ readonly guarantee: string;
100
+ }
101
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/verify/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;6BAE6B;AAC7B,MAAM,WAAW,aAAa;IAC5B;8EAC0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;gFACgF;AAChF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,gBAAgB,GAAG,cAAc,CAAC;IACjE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;oEACoE;AACpE,MAAM,WAAW,oBAAo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AAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;+CAC2C;IAC3C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;QAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;IAC7C,gEAAgE;IAChE,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC;sEACkE;IAClE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * Shadow-equivalence verifier contracts (Expansion §9, autonomy-ladder Tier 2).
4
+ *
5
+ * The verifier proves a SAME-MODEL call replacement is behavior-preserving
6
+ * BEFORE a human merges the Tier-2 PR: capture N invocations of the original
7
+ * call site's inputs/outputs locally, replay the SAME inputs through the
8
+ * ModelRig-routed replacement (same provider/model PINNED — this verifies the
9
+ * PLUMBING, never the model choice), diff the outputs, and emit a report the
10
+ * skill embeds in the PR.
11
+ *
12
+ * Honest refusal is a first-class output: a call site that can't be captured
13
+ * or replayed (streaming, dynamically-assembled prompts, or a route that does
14
+ * not pin the original model) is REFUSED, not forced — those sites are T0/T1
15
+ * territory per the spec's stated limits.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Shadow-equivalence orchestrator (Expansion §9, Tier 2) — the replay-and-diff
3
+ * pass that proves a same-model call replacement is behavior-preserving before
4
+ * a human merges the Tier-2 PR.
5
+ *
6
+ * Reuse, not twin (dev-rule S1): the EXECUTOR is the run loop — the same
7
+ * verified pipeline `rig.run()` drives — and the replay POSTURE is the
8
+ * bake-off's (`bakeoff/replay.ts`): captures severed (no capture-of-verify),
9
+ * one hard envelope across the pass, per-sample cost reconstructed from the
10
+ * tagged telemetry rows. What differs, and why this is a sibling of
11
+ * `replayVariant` rather than a call into it: shadow-equivalence pins a
12
+ * SPECIFIC captured input (not "last N by route"), needs the routed OUTPUT for
13
+ * a pairwise diff (not an aggregate metric), and asserts the served model
14
+ * equals the pinned original (a plumbing check variant comparison never makes).
15
+ */
16
+ import type { RunDeps } from "../run/run";
17
+ import type { EquivalenceReport, ShadowCaptureFixture } from "./types";
18
+ export interface VerifySwapRequest {
19
+ /** The drafted replacement route (must pin the original model — see below). */
20
+ readonly route: string;
21
+ /** The local capture fixture (original inputs/outputs). Never uploaded. */
22
+ readonly fixture: ShadowCaptureFixture;
23
+ /** Hard cap for the whole replay pass (default $10). */
24
+ readonly envelopeUsd?: number;
25
+ /** Injectable clock for a deterministic `ranAt` (tests). */
26
+ readonly now?: () => string;
27
+ }
28
+ export declare function verifySwap(deps: RunDeps, req: VerifySwapRequest): Promise<EquivalenceReport>;
29
+ //# sourceMappingURL=verify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/verify/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAK1C,OAAO,KAAK,EACV,iBAAiB,EAIjB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAWjB,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,wDAAwD;IACxD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CAC7B;AAiCD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,iBAAiB,CAAC,CAsH5B"}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ /**
3
+ * Shadow-equivalence orchestrator (Expansion §9, Tier 2) — the replay-and-diff
4
+ * pass that proves a same-model call replacement is behavior-preserving before
5
+ * a human merges the Tier-2 PR.
6
+ *
7
+ * Reuse, not twin (dev-rule S1): the EXECUTOR is the run loop — the same
8
+ * verified pipeline `rig.run()` drives — and the replay POSTURE is the
9
+ * bake-off's (`bakeoff/replay.ts`): captures severed (no capture-of-verify),
10
+ * one hard envelope across the pass, per-sample cost reconstructed from the
11
+ * tagged telemetry rows. What differs, and why this is a sibling of
12
+ * `replayVariant` rather than a call into it: shadow-equivalence pins a
13
+ * SPECIFIC captured input (not "last N by route"), needs the routed OUTPUT for
14
+ * a pairwise diff (not an aggregate metric), and asserts the served model
15
+ * equals the pinned original (a plumbing check variant comparison never makes).
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.verifySwap = verifySwap;
19
+ const run_1 = require("../run/run");
20
+ const failures_1 = require("../types/failures");
21
+ const diff_1 = require("./diff");
22
+ /** One hard envelope for the whole verification pass when the caller sets none
23
+ * — replay is real, billed dispatch and must stay bounded (spec §9). */
24
+ const DEFAULT_VERIFY_ENVELOPE_USD = 10;
25
+ const GUARANTEE = "Same provider/model pinned on both sides: this verifies the PLUMBING of the " +
26
+ "ModelRig-routed replacement, never the model choice. Model optimization is a " +
27
+ "separate, human-gated bake-off decision.";
28
+ function candidateEquals(a, b) {
29
+ return a.provider === b.provider && a.model === b.model;
30
+ }
31
+ /** Build a refused report — the run never ran (pin violation, or nothing to
32
+ * replay). Refusing IS a correct output; it costs nothing. */
33
+ function refused(req, routeVersion, pinnedModel, reason, nowIso) {
34
+ return {
35
+ schemaVersion: 1,
36
+ kind: "shadow-equivalence",
37
+ callSiteId: req.fixture.callSiteId,
38
+ route: req.route,
39
+ routeVersion,
40
+ pinnedModel,
41
+ ranAt: nowIso,
42
+ n: 0,
43
+ overall: "refused",
44
+ counts: { equivalent: 0, equivalentModulo: 0, divergent: 0 },
45
+ samples: [],
46
+ refusals: req.fixture.refusals ?? [],
47
+ refusalReason: reason,
48
+ guarantee: GUARANTEE,
49
+ };
50
+ }
51
+ async function verifySwap(deps, req) {
52
+ const nowIso = (req.now ?? (() => new Date().toISOString()))();
53
+ const bundle = deps.routes.get(req.route);
54
+ const original = req.fixture.original;
55
+ const pinnedModel = `${original.provider}/${original.model}`;
56
+ // Same-model pin (the C2-exit gateway-substitution ruling): the route must
57
+ // pin EXACTLY the original model and nothing else. A route that offers other
58
+ // candidates would introduce model choice — which is not what this verifies.
59
+ const pins = bundle.candidates.length > 0 &&
60
+ bundle.candidates.every((c) => candidateEquals(c, original));
61
+ if (!pins) {
62
+ const declared = bundle.candidates.map((c) => `${c.provider}/${c.model}`).join(", ") || "none";
63
+ return refused(req, bundle.version, pinnedModel, `route "${req.route}" declares candidates [${declared}]; shadow-equivalence requires it to ` +
64
+ `pin exactly the original model ${pinnedModel} — this verifies plumbing, not model choice. ` +
65
+ "A multi-model route is a bake-off, not a Tier-2 replacement.", nowIso);
66
+ }
67
+ if (req.fixture.samples.length === 0) {
68
+ const hadRefusals = (req.fixture.refusals ?? []).length > 0;
69
+ return refused(req, bundle.version, pinnedModel, hadRefusals
70
+ ? "no replayable captures — every invocation was honestly refused (streaming / dynamic prompt); " +
71
+ "this call site is T0/T1 territory, not a Tier-2 replacement"
72
+ : "no captures to replay — capture N original invocations first", nowIso);
73
+ }
74
+ // Replay posture: sever captures (no capture-of-verify) and share one hard
75
+ // envelope, exactly as bakeoff/replay.ts does.
76
+ const envelopeUsd = req.envelopeUsd ?? DEFAULT_VERIFY_ENVELOPE_USD;
77
+ const replayDeps = { ...deps, captures: null, envelopeBudgetUsd: envelopeUsd };
78
+ const envelopeKey = `verify:${req.route}:${nowIso}`;
79
+ const nd = req.fixture.nondeterministicPaths ?? [];
80
+ const samples = [];
81
+ for (let index = 0; index < req.fixture.samples.length; index += 1) {
82
+ const capture = req.fixture.samples[index];
83
+ const sampleTag = `${envelopeKey}#${index}`;
84
+ let servedModel = null;
85
+ let failureClass = null;
86
+ let diff = { verdict: "divergent", firstDivergentPath: null, detail: "" };
87
+ try {
88
+ const result = await (0, run_1.run)(replayDeps, req.route, {
89
+ input: capture.input,
90
+ tags: { shadow_verify: envelopeKey, shadow_verify_sample: sampleTag },
91
+ budget: { envelope: envelopeKey, budgetUsd: envelopeUsd },
92
+ });
93
+ servedModel = `${result.meta.provider}/${result.meta.model}`;
94
+ if (servedModel !== pinnedModel) {
95
+ // A declared candidate served something other than the original — the
96
+ // plumbing does not preserve the model. Divergent, not equivalent.
97
+ diff = {
98
+ verdict: "divergent",
99
+ firstDivergentPath: null,
100
+ detail: `routed run served ${servedModel}, not the pinned original ${pinnedModel} — a fallback fired`,
101
+ };
102
+ }
103
+ else {
104
+ const routedText = JSON.stringify(result.output);
105
+ diff = (0, diff_1.diffOutputs)(capture.output, result.output, routedText, nd);
106
+ }
107
+ }
108
+ catch (err) {
109
+ if (!(err instanceof failures_1.RigFailureError))
110
+ throw err;
111
+ failureClass = err.failure.class;
112
+ diff = {
113
+ verdict: "divergent",
114
+ firstDivergentPath: null,
115
+ detail: `routed replacement did not return a conformant output (${err.failure.class}): ` +
116
+ `${err.failure.message} — the plumbing regressed for this input`,
117
+ };
118
+ }
119
+ // Per-sample cost from the tagged rows — base + retries + repair, exactly
120
+ // what telemetry billed (the bake-off's F1-correct accounting).
121
+ const costUsd = deps.telemetry
122
+ .queryByTag("shadow_verify_sample", sampleTag)
123
+ .reduce((a, r) => a + r.costEstimateUsd, 0);
124
+ samples.push({ index, ...diff, servedModel, costUsd, failureClass });
125
+ }
126
+ const counts = {
127
+ equivalent: samples.filter((s) => s.verdict === "equivalent").length,
128
+ equivalentModulo: samples.filter((s) => s.verdict === "equivalent-modulo-nondeterminism").length,
129
+ divergent: samples.filter((s) => s.verdict === "divergent").length,
130
+ };
131
+ const overall = counts.divergent > 0 ? "divergent" : counts.equivalentModulo > 0 ? "equivalent-modulo-nondeterminism" : "equivalent";
132
+ return {
133
+ schemaVersion: 1,
134
+ kind: "shadow-equivalence",
135
+ callSiteId: req.fixture.callSiteId,
136
+ route: req.route,
137
+ routeVersion: bundle.version,
138
+ pinnedModel,
139
+ ranAt: nowIso,
140
+ n: samples.length,
141
+ overall,
142
+ counts,
143
+ samples,
144
+ refusals: req.fixture.refusals ?? [],
145
+ refusalReason: null,
146
+ guarantee: GUARANTEE,
147
+ };
148
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Watch monthly spend cap — Phase 4 WS1 (spec: MODELRIG_WATCH_MONTHLY_USD,
3
+ * default $50). Every paid run the loop triggers (--from-proposal
4
+ * bake-offs, future re-probes) draws from a calendar-month envelope in the
5
+ * SAME envelope machinery that guards everything else — one budget system,
6
+ * not two.
7
+ */
8
+ import type { TelemetryStore } from "../types/telemetry";
9
+ export declare const DEFAULT_WATCH_MONTHLY_USD = 50;
10
+ export declare function watchEnvelopeKey(now: Date): string;
11
+ export interface WatchBudgetReservation {
12
+ readonly key: string;
13
+ readonly remainingUsd: number;
14
+ }
15
+ /** Open (idempotently) this month's watch envelope and report the headroom.
16
+ * Throws typed budget_exhausted when the month's cap is spent — the caller
17
+ * refuses the paid run; nothing silently overruns. */
18
+ export declare function reserveWatchBudget(store: TelemetryStore, monthlyUsd: number, now: Date): WatchBudgetReservation;
19
+ //# sourceMappingURL=budget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"budget.d.ts","sourceRoot":"","sources":["../../src/watch/budget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAElD;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;sDAEsD;AACtD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,EACrB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,IAAI,GACR,sBAAsB,CAgBxB"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * Watch monthly spend cap — Phase 4 WS1 (spec: MODELRIG_WATCH_MONTHLY_USD,
4
+ * default $50). Every paid run the loop triggers (--from-proposal
5
+ * bake-offs, future re-probes) draws from a calendar-month envelope in the
6
+ * SAME envelope machinery that guards everything else — one budget system,
7
+ * not two.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.DEFAULT_WATCH_MONTHLY_USD = void 0;
11
+ exports.watchEnvelopeKey = watchEnvelopeKey;
12
+ exports.reserveWatchBudget = reserveWatchBudget;
13
+ const failures_1 = require("../types/failures");
14
+ exports.DEFAULT_WATCH_MONTHLY_USD = 50;
15
+ function watchEnvelopeKey(now) {
16
+ return `watch-${now.toISOString().slice(0, 7)}`;
17
+ }
18
+ /** Open (idempotently) this month's watch envelope and report the headroom.
19
+ * Throws typed budget_exhausted when the month's cap is spent — the caller
20
+ * refuses the paid run; nothing silently overruns. */
21
+ function reserveWatchBudget(store, monthlyUsd, now) {
22
+ const key = watchEnvelopeKey(now);
23
+ const envelope = store.openEnvelope(key, monthlyUsd);
24
+ const remainingUsd = Math.max(0, envelope.budgetUsd - envelope.spentUsd);
25
+ if (envelope.status === "exhausted" || remainingUsd <= 0) {
26
+ throw new failures_1.RigFailureError({
27
+ class: "budget_exhausted",
28
+ message: `watch monthly budget ${key} exhausted ` +
29
+ `($${envelope.spentUsd.toFixed(2)} of $${envelope.budgetUsd.toFixed(2)} spent)`,
30
+ fixHint: "Raise MODELRIG_WATCH_MONTHLY_USD or wait for the next calendar month — " +
31
+ "the watch loop never overruns its cap.",
32
+ });
33
+ }
34
+ return { key, remainingUsd };
35
+ }
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Watch diff-evaluators — Phase 4 WS1 (plan §4). Pure: no store, no
3
+ * network, no clock beyond the expiry stamp. Two event classes:
4
+ *
5
+ * price_change — a candidate's pricing moved; when the blended cost shift
6
+ * clears the threshold (default ±10%), every route declaring that
7
+ * candidate gets a suggested bake-off proposal.
8
+ * new_model — a new pricing-map entry on a provider a route already
9
+ * uses → suggested bake-off (the re-probe/bake-off run IS the evidence
10
+ * step; the proposal never claims conformance it hasn't measured).
11
+ *
12
+ * Proposals NEVER execute anything. Idempotency: the trigger hash is a
13
+ * stable digest of (route, trigger content) — re-running a watch cycle over
14
+ * the same facts produces the same hashes, and the control-plane unique
15
+ * index (route, trigger_hash) makes duplicates a no-op.
16
+ */
17
+ import type { CacheHysteresisConfig, CacheVerdict, EffectiveRates, ObservedCacheRates } from "../registry/effective-rate";
18
+ export interface CandidateEconomics {
19
+ readonly provider: string;
20
+ readonly model: string;
21
+ }
22
+ export interface RouteEconomics {
23
+ readonly route: string;
24
+ readonly candidates: readonly CandidateEconomics[];
25
+ }
26
+ export interface TokenRates {
27
+ readonly inputUsdPerTok: number;
28
+ readonly outputUsdPerTok: number;
29
+ }
30
+ export type WatchEvent = {
31
+ readonly type: "price_change";
32
+ readonly provider: string;
33
+ readonly model: string;
34
+ readonly old: TokenRates;
35
+ readonly new: TokenRates;
36
+ } | {
37
+ readonly type: "new_model";
38
+ readonly provider: string;
39
+ readonly model: string;
40
+ readonly pricing: TokenRates | null;
41
+ };
42
+ export interface WatchConfig {
43
+ /** Material-shift threshold in percent (spec default ±10). */
44
+ readonly thresholdPct: number;
45
+ /** Cache-aware hysteresis (cache-aware-routing spec §4.3) — the absolute
46
+ * per-call floor and relative window-spend threshold a cache-adjusted swap
47
+ * must clear to be `cache_positive`. OPTIONAL & additive: absent ⇒
48
+ * `DEFAULT_CACHE_HYSTERESIS`. Same home as `thresholdPct`, distinct numbers —
49
+ * the price-move threshold and the cache-swap hysteresis are different gates. */
50
+ readonly cacheHysteresis?: CacheHysteresisConfig;
51
+ }
52
+ /** Trigger payload persisted on the proposal row (jsonb). A discriminated union
53
+ * on `type`: the watch loop's price/model economics triggers, the Monitor's
54
+ * conform-rate degradation trigger (E4 chunk B), and the Rig Analyst's cluster
55
+ * findings (E6 chunk A). The watch/monitor triggers keep KIND `bakeoff`; the
56
+ * Analyst's triggers ride the widened kinds (`insight`/`promote-eval`) or reuse
57
+ * `bakeoff` for an Analyst-initiated bake-off — all through the SAME proposals
58
+ * machinery and the SAME `submitDrafts` seam (trajectory F1/F4, one emission path). */
59
+ export type ProposalTrigger = EconomicsTrigger | ConformDegradationTrigger | AnalystClusterTrigger | AnalystPromoteEvalTrigger | AnalystBakeoffTrigger;
60
+ /** The measured statistics behind one Analyst cluster — all deterministic. */
61
+ export interface AnalystClusterStats {
62
+ /** Runs in this (task, cluster) over the window. */
63
+ readonly runs: number;
64
+ /** This cluster's fail rate, 0..1 (run-outcome@v1 verdicts). */
65
+ readonly failRate: number;
66
+ /** The org's window-wide fail rate, 0..1 — the salience baseline. */
67
+ readonly windowFailRate: number;
68
+ /** failRate − windowFailRate, in percentage POINTS (the salience margin). */
69
+ readonly failPtsOverWindow: number;
70
+ /** Feedback down-rate for the task, 0..1 (downs / (ups+downs)); 0 when none. */
71
+ readonly downRate: number;
72
+ /** Feedback signals (ups+downs) behind `downRate` — the min-n gate input. */
73
+ readonly feedbackN: number;
74
+ /** The dominant run-outcome failure_class label for the cluster, or null. */
75
+ readonly dominantFailureClass: string | null;
76
+ }
77
+ /** One reporting cluster → the `insight` proposal's trigger. `clusterKey` is the
78
+ * within-task discriminator (`fail:<class>` | `feedback` | `ok`); the window END
79
+ * (quantized to day) is what the trigger_hash keys on so re-runs dedupe. */
80
+ export interface AnalystClusterTrigger {
81
+ readonly type: "analyst_cluster";
82
+ readonly task: string;
83
+ readonly clusterKey: string;
84
+ /** Trailing window bounds — inclusive-from / exclusive-to ISO days. */
85
+ readonly windowFrom: string;
86
+ readonly windowTo: string;
87
+ readonly stats: AnalystClusterStats;
88
+ /** Exemplar run ids (≤10) so a human can open the E2 run pages. */
89
+ readonly exemplarRunIds: readonly string[];
90
+ }
91
+ /** A failing cluster's promotable failing artifacts → the `promote-eval`
92
+ * proposal's trigger. Approving iterates `candidates` through the EXISTING
93
+ * promote path (≤ ANALYST_PROMOTE_MAX items). `task` is what each promote records. */
94
+ export interface AnalystPromoteEvalTrigger {
95
+ readonly type: "analyst_promote_eval";
96
+ readonly task: string;
97
+ readonly clusterKey: string;
98
+ readonly windowFrom: string;
99
+ readonly windowTo: string;
100
+ readonly candidates: readonly AnalystPromoteCandidate[];
101
+ }
102
+ export interface AnalystPromoteCandidate {
103
+ readonly runId: string;
104
+ readonly artifactId: string;
105
+ }
106
+ /** A cluster on a route with a cheaper NON-serving candidate → an Analyst-
107
+ * initiated `bakeoff` proposal's trigger (the wedge motion). Only candidates the
108
+ * route already DECLARES may appear (STOP list: no novel challenger generation,
109
+ * that is E8). */
110
+ export interface AnalystBakeoffTrigger {
111
+ readonly type: "analyst_bakeoff";
112
+ readonly task: string;
113
+ readonly route: string;
114
+ readonly clusterKey: string;
115
+ readonly windowFrom: string;
116
+ readonly windowTo: string;
117
+ /** The cheaper non-serving candidate the Analyst proposes baking off. */
118
+ readonly challenger: CandidateEconomics;
119
+ /** The route's current serving candidates (context for the human). */
120
+ readonly incumbents: readonly CandidateEconomics[];
121
+ }
122
+ /** Watch-loop trigger: a candidate's price moved, or a new model appeared. */
123
+ export interface EconomicsTrigger {
124
+ readonly type: "price_change" | "new_model";
125
+ readonly provider: string;
126
+ readonly model: string;
127
+ /** Blended-cost percent change (price_change only). */
128
+ readonly deltaPct?: number;
129
+ readonly oldRates?: TokenRates;
130
+ readonly newRates?: TokenRates;
131
+ readonly pricing?: TokenRates | null;
132
+ }
133
+ /** One side of the degradation comparison (E4 chunk B) — a window's conform
134
+ * rate over its evaluations. Dates are inclusive-from / exclusive-to ISO days. */
135
+ export interface ConformWindow {
136
+ readonly from: string;
137
+ readonly to: string;
138
+ readonly n: number;
139
+ readonly conformRate: number;
140
+ }
141
+ /** Monitor trigger (E4 chunk B): the recent window's deterministic conform rate
142
+ * fell below the trailing baseline by ≥ the ruled margin, with min-n met on both
143
+ * sides. Records BOTH windows + their ns so the evidence is self-explanatory. */
144
+ export interface ConformDegradationTrigger {
145
+ readonly type: "conform_degradation";
146
+ readonly task: string;
147
+ readonly window: ConformWindow;
148
+ readonly baseline: ConformWindow;
149
+ /** The drop that flagged it, in percentage POINTS of conform rate. */
150
+ readonly dropPts: number;
151
+ readonly marginPts: number;
152
+ readonly minN: number;
153
+ }
154
+ /** The proposal-kind vocabulary. `bakeoff`/`swap` are the shipped watch/monitor
155
+ * kinds (00006); `insight`/`promote-eval` join for the Rig Analyst (E6, migration
156
+ * 00052 widens the DB CHECK to match). */
157
+ export type ProposalKind = "bakeoff" | "swap" | "insight" | "promote-eval";
158
+ export interface ProposalDraft {
159
+ readonly route: string;
160
+ readonly kind: ProposalKind;
161
+ readonly trigger: ProposalTrigger;
162
+ readonly triggerHash: string;
163
+ readonly expiresAt: string;
164
+ /** Evidence seeded AT INSERT (optional). The Rig Analyst embeds a new insight
165
+ * cluster's summary here (Chunk B) so the summary rides the same idempotent
166
+ * insert as the row — a duplicate (already-seen trigger_hash) is a no-op and
167
+ * never overwrites. Watch/monitor never set it. */
168
+ readonly evidence?: Record<string, unknown>;
169
+ }
170
+ export declare const PROPOSAL_TTL_DAYS = 30;
171
+ export declare function triggerHash(route: string, trigger: ProposalTrigger): string;
172
+ export declare function evaluateEvents(routes: readonly RouteEconomics[], events: readonly WatchEvent[], config: WatchConfig): ProposalDraft[];
173
+ /** The §5.5 evidence block — every field the rendered explanation and the
174
+ * verdict need, in one self-describing object. Rates are per-Mtok (the surface
175
+ * unit); switch/option/spend quantities are USD. */
176
+ export interface CacheContext {
177
+ readonly observed_hit_rate: number;
178
+ readonly observed_write_rate: number;
179
+ readonly window_days: number;
180
+ readonly incumbent_effective_in_per_mtok: number;
181
+ readonly challenger_cold_in_per_mtok: number;
182
+ readonly switch_cost_usd: number;
183
+ readonly cache_option_value_usd: number;
184
+ readonly breakeven_conformant_calls: number;
185
+ readonly verdict: CacheVerdict;
186
+ }
187
+ /** The inputs `buildCacheContext` needs — the incumbent's observed cache
188
+ * behavior + both candidates' rates + the switch geometry. Kept as explicit
189
+ * separate inputs (NOT a widened `watch/evaluate` local `TokenRates`) per the
190
+ * QA name-collision note: the effective blend takes the rollup and the rate
191
+ * cards as distinct arguments. */
192
+ export interface CacheContextInput {
193
+ /** Incumbent's trailing-window observed cache rates (from `rollupCacheStats`). */
194
+ readonly observed: ObservedCacheRates;
195
+ readonly windowDays: number;
196
+ /** Incumbent (warm) rate card, USD/token. */
197
+ readonly incumbentRates: EffectiveRates;
198
+ /** Challenger (cold) rate card, USD/token. */
199
+ readonly challengerRates: EffectiveRates;
200
+ /** Warm prefix size the incumbent carries (tokens) — from the derived ledger. */
201
+ readonly incumbentPrefixTokens: number;
202
+ /** Expected remaining calls over which the decision amortizes. */
203
+ readonly remainingCalls: number;
204
+ /** Trailing-window spend on the route, USD — base of the relative bar. */
205
+ readonly windowSpendUsd: number;
206
+ /** True when the window carried ANY cache observation (read or write). When
207
+ * false the verdict is `no_cache_signal` regardless of the numbers. */
208
+ readonly hasCacheSignal: boolean;
209
+ }
210
+ /**
211
+ * Assemble the `cache_context` evidence block + verdict for a proposal (spec
212
+ * §5.5), pure. The verdict compares the incumbent's cache-ADJUSTED effective
213
+ * input rate against the challenger's COLD list rate, amortized over the switch
214
+ * cost, and gates on the hysteresis config. The advantage is measured PER
215
+ * CACHED PREFIX (the tokens the decision actually turns on), so a per-call
216
+ * dollar figure is directly comparable to the floor.
217
+ */
218
+ export declare function buildCacheContext(input: CacheContextInput, config?: CacheHysteresisConfig): CacheContext;
219
+ /**
220
+ * The [Briefing §30] rendered explanation — one prose line a human reads on the
221
+ * console and the `swap execute` approval prompt. Single-sourced here so the
222
+ * console, the CLI, and the OTLP span never phrase the same decision three ways.
223
+ */
224
+ export declare function explainCacheContext(ctx: CacheContext, incumbentLabel: string, challengerLabel: string): string;
225
+ //# sourceMappingURL=evaluate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/watch/evaluate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAYH,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACpD;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,MAAM,UAAU,GAClB;IACE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;CAC1B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CA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