modelrig 0.8.1 → 0.10.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 (382) hide show
  1. package/CHANGELOG.md +324 -0
  2. package/README.md +55 -29
  3. package/data/PROVENANCE.md +14 -0
  4. package/data/pricing-map.json +26 -0
  5. package/dist/adapters/attempt-meta-map.d.ts +8 -1
  6. package/dist/adapters/attempt-meta-map.d.ts.map +1 -1
  7. package/dist/adapters/attempt-meta-map.js +4 -0
  8. package/dist/adapters/build-adapters.js +2 -2
  9. package/dist/adapters/gemini.d.ts +28 -1
  10. package/dist/adapters/gemini.d.ts.map +1 -1
  11. package/dist/adapters/gemini.js +38 -9
  12. package/dist/adapters/grok.d.ts.map +1 -1
  13. package/dist/adapters/grok.js +53 -4
  14. package/dist/adapters/openai-compat.d.ts +8 -2
  15. package/dist/adapters/openai-compat.d.ts.map +1 -1
  16. package/dist/adapters/openai-compat.js +8 -1
  17. package/dist/adapters/openai-stream.d.ts +10 -2
  18. package/dist/adapters/openai-stream.d.ts.map +1 -1
  19. package/dist/adapters/openai-stream.js +5 -1
  20. package/dist/adapters/openai.d.ts +10 -1
  21. package/dist/adapters/openai.d.ts.map +1 -1
  22. package/dist/adapters/openai.js +57 -7
  23. package/dist/adapters/responses-api.d.ts +61 -0
  24. package/dist/adapters/responses-api.d.ts.map +1 -0
  25. package/dist/adapters/responses-api.js +124 -0
  26. package/dist/artifacts/artifact.d.ts +31 -12
  27. package/dist/artifacts/artifact.d.ts.map +1 -1
  28. package/dist/artifacts/artifact.js +218 -188
  29. package/dist/artifacts/index.d.ts +15 -5
  30. package/dist/artifacts/index.d.ts.map +1 -1
  31. package/dist/artifacts/index.js +19 -5
  32. package/dist/artifacts/run-context.d.ts +3 -24
  33. package/dist/artifacts/run-context.d.ts.map +1 -1
  34. package/dist/artifacts/run-context.js +3 -39
  35. package/dist/bakeoff/engine.d.ts +29 -0
  36. package/dist/bakeoff/engine.d.ts.map +1 -1
  37. package/dist/bakeoff/engine.js +47 -0
  38. package/dist/bakeoff/eval-cases-rig.d.ts +36 -0
  39. package/dist/bakeoff/eval-cases-rig.d.ts.map +1 -0
  40. package/dist/bakeoff/eval-cases-rig.js +27 -0
  41. package/dist/bakeoff/eval-cases.d.ts +19 -0
  42. package/dist/bakeoff/eval-cases.d.ts.map +1 -1
  43. package/dist/bakeoff/eval-cases.js +18 -1
  44. package/dist/bakeoff/golden-judge.d.ts +47 -0
  45. package/dist/bakeoff/golden-judge.d.ts.map +1 -0
  46. package/dist/bakeoff/golden-judge.js +49 -0
  47. package/dist/bakeoff/groundedness.d.ts +58 -0
  48. package/dist/bakeoff/groundedness.d.ts.map +1 -0
  49. package/dist/bakeoff/groundedness.js +165 -0
  50. package/dist/bakeoff/quality.d.ts +43 -0
  51. package/dist/bakeoff/quality.d.ts.map +1 -1
  52. package/dist/bakeoff/quality.js +31 -0
  53. package/dist/bakeoff/replay.d.ts +11 -0
  54. package/dist/bakeoff/replay.d.ts.map +1 -1
  55. package/dist/bakeoff/replay.js +12 -0
  56. package/dist/bakeoff/report.d.ts +7 -0
  57. package/dist/bakeoff/report.d.ts.map +1 -1
  58. package/dist/bakeoff/report.js +26 -0
  59. package/dist/cli-judge.d.ts +12 -0
  60. package/dist/cli-judge.d.ts.map +1 -0
  61. package/dist/cli-judge.js +48 -0
  62. package/dist/cli.d.ts.map +1 -1
  63. package/dist/cli.js +22 -42
  64. package/dist/config.d.ts +85 -29
  65. package/dist/config.d.ts.map +1 -1
  66. package/dist/config.js +109 -47
  67. package/dist/detect/detector.d.ts +4 -2
  68. package/dist/detect/detector.d.ts.map +1 -1
  69. package/dist/detect/safe-harbor.d.ts +57 -0
  70. package/dist/detect/safe-harbor.d.ts.map +1 -0
  71. package/dist/detect/safe-harbor.js +278 -0
  72. package/dist/doctor-cli.d.ts +7 -0
  73. package/dist/doctor-cli.d.ts.map +1 -0
  74. package/dist/doctor-cli.js +67 -0
  75. package/dist/doctor-preflight.d.ts +52 -0
  76. package/dist/doctor-preflight.d.ts.map +1 -0
  77. package/dist/doctor-preflight.js +112 -0
  78. package/dist/feedback/coverage.d.ts +11 -8
  79. package/dist/feedback/coverage.d.ts.map +1 -1
  80. package/dist/feedback/coverage.js +29 -16
  81. package/dist/feedback/grade.d.ts +58 -0
  82. package/dist/feedback/grade.d.ts.map +1 -0
  83. package/dist/feedback/grade.js +67 -0
  84. package/dist/gateway/http-protocol.d.ts +20 -1
  85. package/dist/gateway/http-protocol.d.ts.map +1 -1
  86. package/dist/gateway/http-protocol.js +1 -1
  87. package/dist/gateway/serve-client.d.ts +99 -0
  88. package/dist/gateway/serve-client.d.ts.map +1 -0
  89. package/dist/gateway/serve-client.js +360 -0
  90. package/dist/index.d.ts +68 -29
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +167 -46
  93. package/dist/init/observe-cli.js +1 -1
  94. package/dist/init/observe.d.ts +2 -2
  95. package/dist/init/observe.d.ts.map +1 -1
  96. package/dist/init/observe.js +11 -7
  97. package/dist/mask/arm.d.ts +112 -0
  98. package/dist/mask/arm.d.ts.map +1 -0
  99. package/dist/mask/arm.js +179 -0
  100. package/dist/mask/index.d.ts +2 -0
  101. package/dist/mask/index.d.ts.map +1 -1
  102. package/dist/mask/index.js +7 -1
  103. package/dist/mask/mask-policy-cli.d.ts +12 -4
  104. package/dist/mask/mask-policy-cli.d.ts.map +1 -1
  105. package/dist/mask/mask-policy-cli.js +34 -9
  106. package/dist/prompts/manifest.d.ts +128 -0
  107. package/dist/prompts/manifest.d.ts.map +1 -0
  108. package/dist/prompts/manifest.js +214 -0
  109. package/dist/prompts/prompt-fetch.d.ts +84 -0
  110. package/dist/prompts/prompt-fetch.d.ts.map +1 -0
  111. package/dist/prompts/prompt-fetch.js +120 -0
  112. package/dist/prompts/prompt-resolve.d.ts +76 -0
  113. package/dist/prompts/prompt-resolve.d.ts.map +1 -0
  114. package/dist/prompts/prompt-resolve.js +93 -0
  115. package/dist/prompts/slot-resolver.d.ts +91 -0
  116. package/dist/prompts/slot-resolver.d.ts.map +1 -0
  117. package/dist/prompts/slot-resolver.js +135 -0
  118. package/dist/prompts/tools-register.d.ts +60 -0
  119. package/dist/prompts/tools-register.d.ts.map +1 -0
  120. package/dist/prompts/tools-register.js +48 -0
  121. package/dist/prompts/version-hash.d.ts +29 -0
  122. package/dist/prompts/version-hash.d.ts.map +1 -0
  123. package/dist/prompts/version-hash.js +54 -0
  124. package/dist/prompts-export-cli.d.ts +21 -0
  125. package/dist/prompts-export-cli.d.ts.map +1 -0
  126. package/dist/prompts-export-cli.js +130 -0
  127. package/dist/query/grammar.d.ts +2 -2
  128. package/dist/query/grammar.d.ts.map +1 -1
  129. package/dist/query/grammar.js +3 -1
  130. package/dist/query/saved.d.ts +13 -0
  131. package/dist/query/saved.d.ts.map +1 -1
  132. package/dist/query/saved.js +67 -1
  133. package/dist/receipts/types.d.ts +1 -1
  134. package/dist/receipts/types.d.ts.map +1 -1
  135. package/dist/receipts/types.js +1 -0
  136. package/dist/registry/build.d.ts +43 -1
  137. package/dist/registry/build.d.ts.map +1 -1
  138. package/dist/registry/build.js +52 -0
  139. package/dist/registry/cache-policy.d.ts.map +1 -1
  140. package/dist/registry/cache-policy.js +22 -0
  141. package/dist/registry/pricing-shape.d.ts +67 -8
  142. package/dist/registry/pricing-shape.d.ts.map +1 -1
  143. package/dist/registry/pricing-shape.js +50 -13
  144. package/dist/registry/pricing.d.ts +6 -5
  145. package/dist/registry/pricing.d.ts.map +1 -1
  146. package/dist/registry/pricing.js +9 -5
  147. package/dist/registry/rows.d.ts.map +1 -1
  148. package/dist/registry/rows.js +1 -0
  149. package/dist/registry/select.d.ts +6 -1
  150. package/dist/registry/select.d.ts.map +1 -1
  151. package/dist/registry/select.js +11 -0
  152. package/dist/routes/call-config.d.ts +199 -0
  153. package/dist/routes/call-config.d.ts.map +1 -0
  154. package/dist/routes/call-config.js +343 -0
  155. package/dist/routes/destination-loader.d.ts +16 -0
  156. package/dist/routes/destination-loader.d.ts.map +1 -0
  157. package/dist/routes/destination-loader.js +29 -0
  158. package/dist/routes/draft.d.ts +7 -0
  159. package/dist/routes/draft.d.ts.map +1 -1
  160. package/dist/routes/draft.js +12 -0
  161. package/dist/routes/loader.d.ts.map +1 -1
  162. package/dist/routes/loader.js +31 -56
  163. package/dist/routes/objective-loader.d.ts +12 -0
  164. package/dist/routes/objective-loader.d.ts.map +1 -1
  165. package/dist/routes/objective-loader.js +82 -0
  166. package/dist/routes/output-loader.d.ts +42 -0
  167. package/dist/routes/output-loader.d.ts.map +1 -0
  168. package/dist/routes/output-loader.js +112 -0
  169. package/dist/routes/prompt-loader.d.ts +49 -0
  170. package/dist/routes/prompt-loader.d.ts.map +1 -0
  171. package/dist/routes/prompt-loader.js +113 -0
  172. package/dist/routes/resolved-bundle.d.ts +69 -0
  173. package/dist/routes/resolved-bundle.d.ts.map +1 -1
  174. package/dist/routes/resolved-bundle.js +76 -0
  175. package/dist/routes/screen-loader.d.ts +29 -1
  176. package/dist/routes/screen-loader.d.ts.map +1 -1
  177. package/dist/routes/screen-loader.js +59 -1
  178. package/dist/run/accept.d.ts +5 -0
  179. package/dist/run/accept.d.ts.map +1 -1
  180. package/dist/run/accept.js +2 -0
  181. package/dist/run/cost.d.ts +31 -2
  182. package/dist/run/cost.d.ts.map +1 -1
  183. package/dist/run/cost.js +57 -2
  184. package/dist/run/destination.d.ts +39 -0
  185. package/dist/run/destination.d.ts.map +1 -0
  186. package/dist/run/destination.js +45 -0
  187. package/dist/run/dispatch.d.ts +67 -16
  188. package/dist/run/dispatch.d.ts.map +1 -1
  189. package/dist/run/dispatch.js +133 -29
  190. package/dist/run/grounding.d.ts +28 -2
  191. package/dist/run/grounding.d.ts.map +1 -1
  192. package/dist/run/grounding.js +54 -10
  193. package/dist/run/raw-defaults.d.ts.map +1 -1
  194. package/dist/run/raw-defaults.js +6 -1
  195. package/dist/run/raw-finalize.d.ts +50 -0
  196. package/dist/run/raw-finalize.d.ts.map +1 -0
  197. package/dist/run/raw-finalize.js +266 -0
  198. package/dist/run/raw-knobs.d.ts +36 -0
  199. package/dist/run/raw-knobs.d.ts.map +1 -0
  200. package/dist/run/raw-knobs.js +99 -0
  201. package/dist/run/raw-request.d.ts +24 -0
  202. package/dist/run/raw-request.d.ts.map +1 -0
  203. package/dist/run/raw-request.js +69 -0
  204. package/dist/run/raw-schema.d.ts +76 -0
  205. package/dist/run/raw-schema.d.ts.map +1 -0
  206. package/dist/run/raw-schema.js +166 -0
  207. package/dist/run/raw-search-cost.d.ts +48 -0
  208. package/dist/run/raw-search-cost.d.ts.map +1 -0
  209. package/dist/run/raw-search-cost.js +78 -0
  210. package/dist/run/raw-support.d.ts +64 -6
  211. package/dist/run/raw-support.d.ts.map +1 -1
  212. package/dist/run/raw-support.js +84 -11
  213. package/dist/run/raw.d.ts +25 -26
  214. package/dist/run/raw.d.ts.map +1 -1
  215. package/dist/run/raw.js +30 -351
  216. package/dist/run/record-attempt.d.ts +12 -0
  217. package/dist/run/record-attempt.d.ts.map +1 -1
  218. package/dist/run/record-attempt.js +30 -12
  219. package/dist/run/repair-attempt.d.ts +68 -0
  220. package/dist/run/repair-attempt.d.ts.map +1 -0
  221. package/dist/run/repair-attempt.js +180 -0
  222. package/dist/run/resolve-destination.d.ts +49 -0
  223. package/dist/run/resolve-destination.d.ts.map +1 -0
  224. package/dist/run/resolve-destination.js +76 -0
  225. package/dist/run/routing-docs.d.ts.map +1 -1
  226. package/dist/run/routing-docs.js +10 -5
  227. package/dist/run/run.d.ts +30 -1
  228. package/dist/run/run.d.ts.map +1 -1
  229. package/dist/run/run.js +94 -172
  230. package/dist/run/telemetry-row.d.ts +92 -0
  231. package/dist/run/telemetry-row.d.ts.map +1 -0
  232. package/dist/run/telemetry-row.js +81 -0
  233. package/dist/run/validate.d.ts +12 -1
  234. package/dist/run/validate.d.ts.map +1 -1
  235. package/dist/run/validate.js +31 -0
  236. package/dist/run/web-search-pricing.d.ts +43 -0
  237. package/dist/run/web-search-pricing.d.ts.map +1 -0
  238. package/dist/run/web-search-pricing.js +56 -0
  239. package/dist/savings/odometer.d.ts +4 -0
  240. package/dist/savings/odometer.d.ts.map +1 -1
  241. package/dist/savings/odometer.js +20 -1
  242. package/dist/savings/swap-execute.d.ts +7 -0
  243. package/dist/savings/swap-execute.d.ts.map +1 -1
  244. package/dist/savings/swap-execute.js +30 -0
  245. package/dist/savings/swaps-client.d.ts +10 -0
  246. package/dist/savings/swaps-client.d.ts.map +1 -1
  247. package/dist/screen/fixtures/probe-corpora.d.ts +23 -0
  248. package/dist/screen/fixtures/probe-corpora.d.ts.map +1 -0
  249. package/dist/screen/fixtures/probe-corpora.js +69 -0
  250. package/dist/screen/index.d.ts +21 -0
  251. package/dist/screen/index.d.ts.map +1 -0
  252. package/dist/screen/index.js +64 -0
  253. package/dist/screen/model-screen.d.ts +111 -0
  254. package/dist/screen/model-screen.d.ts.map +1 -0
  255. package/dist/screen/model-screen.js +178 -0
  256. package/dist/screen/patterns.d.ts +51 -0
  257. package/dist/screen/patterns.d.ts.map +1 -0
  258. package/dist/screen/patterns.js +151 -0
  259. package/dist/screen/phi-gate.d.ts +52 -0
  260. package/dist/screen/phi-gate.d.ts.map +1 -0
  261. package/dist/screen/phi-gate.js +86 -0
  262. package/dist/screen/policy.d.ts +71 -0
  263. package/dist/screen/policy.d.ts.map +1 -0
  264. package/dist/screen/policy.js +334 -0
  265. package/dist/screen/probe.d.ts +118 -0
  266. package/dist/screen/probe.d.ts.map +1 -0
  267. package/dist/screen/probe.js +132 -0
  268. package/dist/screen/screen-cli.d.ts +16 -0
  269. package/dist/screen/screen-cli.d.ts.map +1 -0
  270. package/dist/screen/screen-cli.js +178 -0
  271. package/dist/screen/screen.d.ts +99 -0
  272. package/dist/screen/screen.d.ts.map +1 -0
  273. package/dist/screen/screen.js +0 -0
  274. package/dist/screen/sidecar.d.ts +69 -0
  275. package/dist/screen/sidecar.d.ts.map +1 -0
  276. package/dist/screen/sidecar.js +145 -0
  277. package/dist/screen/types.d.ts +43 -2
  278. package/dist/screen/types.d.ts.map +1 -1
  279. package/dist/settings/api-fetcher.d.ts +14 -3
  280. package/dist/settings/api-fetcher.d.ts.map +1 -1
  281. package/dist/settings/api-fetcher.js +61 -10
  282. package/dist/settings/grading-guide.d.ts +102 -0
  283. package/dist/settings/grading-guide.d.ts.map +1 -0
  284. package/dist/settings/grading-guide.js +23 -0
  285. package/dist/settings/index.d.ts +3 -2
  286. package/dist/settings/index.d.ts.map +1 -1
  287. package/dist/settings/index.js +2 -1
  288. package/dist/settings/task-settings.d.ts +44 -7
  289. package/dist/settings/task-settings.d.ts.map +1 -1
  290. package/dist/settings/task-settings.js +53 -12
  291. package/dist/status.d.ts +32 -20
  292. package/dist/status.d.ts.map +1 -1
  293. package/dist/status.js +51 -30
  294. package/dist/telemetry/artifact-store.d.ts +5 -6
  295. package/dist/telemetry/artifact-store.d.ts.map +1 -1
  296. package/dist/telemetry/artifact-store.js +21 -24
  297. package/dist/telemetry/attempt-meta.d.ts +76 -1
  298. package/dist/telemetry/attempt-meta.d.ts.map +1 -1
  299. package/dist/telemetry/attempt-meta.js +33 -1
  300. package/dist/telemetry/exporter-setup.d.ts +2 -0
  301. package/dist/telemetry/exporter-setup.d.ts.map +1 -1
  302. package/dist/telemetry/exporter-setup.js +6 -1
  303. package/dist/telemetry/exporter.d.ts +2 -2
  304. package/dist/telemetry/exporter.d.ts.map +1 -1
  305. package/dist/telemetry/exporter.js +22 -41
  306. package/dist/telemetry/grade-mappers.d.ts +25 -0
  307. package/dist/telemetry/grade-mappers.d.ts.map +1 -0
  308. package/dist/telemetry/grade-mappers.js +64 -0
  309. package/dist/telemetry/grades-sql.d.ts +56 -0
  310. package/dist/telemetry/grades-sql.d.ts.map +1 -0
  311. package/dist/telemetry/grades-sql.js +156 -0
  312. package/dist/telemetry/ingest-protocol.d.ts +55 -48
  313. package/dist/telemetry/ingest-protocol.d.ts.map +1 -1
  314. package/dist/telemetry/ingest-protocol.js +48 -83
  315. package/dist/telemetry/org-identity.d.ts +44 -0
  316. package/dist/telemetry/org-identity.d.ts.map +1 -0
  317. package/dist/telemetry/org-identity.js +98 -0
  318. package/dist/telemetry/route-registration.d.ts +48 -0
  319. package/dist/telemetry/route-registration.d.ts.map +1 -0
  320. package/dist/telemetry/route-registration.js +77 -0
  321. package/dist/telemetry/sinks.d.ts +10 -1
  322. package/dist/telemetry/sinks.d.ts.map +1 -1
  323. package/dist/telemetry/sinks.js +52 -6
  324. package/dist/telemetry/store-migrations.d.ts.map +1 -1
  325. package/dist/telemetry/store-migrations.js +64 -0
  326. package/dist/telemetry/store.d.ts +9 -6
  327. package/dist/telemetry/store.d.ts.map +1 -1
  328. package/dist/telemetry/store.js +8 -50
  329. package/dist/tenancy/api-key-format.d.ts +45 -1
  330. package/dist/tenancy/api-key-format.d.ts.map +1 -1
  331. package/dist/tenancy/api-key-format.js +50 -1
  332. package/dist/types/provider.d.ts +23 -3
  333. package/dist/types/provider.d.ts.map +1 -1
  334. package/dist/types/provider.js +26 -0
  335. package/dist/types/route.d.ts +154 -2
  336. package/dist/types/route.d.ts.map +1 -1
  337. package/dist/types/telemetry.d.ts +73 -48
  338. package/dist/types/telemetry.d.ts.map +1 -1
  339. package/dist/validate-cli.d.ts.map +1 -1
  340. package/dist/validate-cli.js +32 -0
  341. package/dist/verify/verify.d.ts +5 -0
  342. package/dist/verify/verify.d.ts.map +1 -1
  343. package/dist/verify/verify.js +2 -0
  344. package/dist/watch/evaluate.d.ts +84 -1
  345. package/dist/watch/evaluate.d.ts.map +1 -1
  346. package/dist/watch/evaluate.js +28 -0
  347. package/dist/watch/monitor.d.ts +8 -2
  348. package/dist/watch/monitor.d.ts.map +1 -1
  349. package/dist/watch/monitor.js +13 -5
  350. package/dist/watch/regret-monitor-cli.d.ts +16 -0
  351. package/dist/watch/regret-monitor-cli.d.ts.map +1 -0
  352. package/dist/watch/regret-monitor-cli.js +137 -0
  353. package/dist/watch/regret-monitor.d.ts +168 -0
  354. package/dist/watch/regret-monitor.d.ts.map +1 -0
  355. package/dist/watch/regret-monitor.js +304 -0
  356. package/dist/watch/upgrade.d.ts +62 -0
  357. package/dist/watch/upgrade.d.ts.map +1 -0
  358. package/dist/watch/upgrade.js +57 -0
  359. package/docs/agent-skill/SKILL.md +181 -9
  360. package/docs/how-it-fits.md +3 -2
  361. package/docs/instrumentation.md +219 -46
  362. package/docs/llms.txt +158 -35
  363. package/docs/managed-serving.md +150 -0
  364. package/docs/mcp-oracle.md +322 -0
  365. package/docs/migration-playbook.md +5 -4
  366. package/docs/quickstart.md +263 -89
  367. package/package.json +18 -4
  368. package/registry/leaderboard.json +74 -0
  369. package/registry/registry.json +232 -112
  370. package/screen.d.ts +16 -0
  371. package/templates/call-disposition-qa.json +77 -0
  372. package/templates/catalog-cleansing.json +77 -0
  373. package/templates/compliance-review.json +76 -0
  374. package/templates/cs-next-action.json +76 -0
  375. package/templates/document-extraction.json +78 -0
  376. package/templates/financial-classification.json +75 -0
  377. package/templates/lead-qualification.json +76 -0
  378. package/templates/medical-classification.json +71 -0
  379. package/templates/ticket-triage.json +76 -0
  380. package/dist/feedback/feedback.d.ts +0 -35
  381. package/dist/feedback/feedback.d.ts.map +0 -1
  382. package/dist/feedback/feedback.js +0 -39
@@ -1 +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;C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C;IAC7C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;CAChC;AAED;;;;kCAIkC;AAClC,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,6CAA6C;IAC7C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,8CAA8C;IAC9C,QAAQ,CAAC,eAAe,EAAE,cAAc,CAAC;IACzC,iFAAiF;IACjF,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,kEAAkE;IAClE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;2EACuE;IACvE,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC;AAID;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,iBAAiB,EACxB,MAAM,GAAE,qBAAgD,GACvD,YAAY,CA8Cd;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,YAAY,EACjB,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,GACtB,MAAM,CAaR"}
@@ -17,6 +17,8 @@
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.PROPOSAL_TTL_DAYS = void 0;
20
+ exports.upgradeTriggerHash = upgradeTriggerHash;
21
+ exports.regretBreachTriggerHash = regretBreachTriggerHash;
20
22
  exports.triggerHash = triggerHash;
21
23
  exports.manualChallengerTriggerHash = manualChallengerTriggerHash;
22
24
  exports.evaluateEvents = evaluateEvents;
@@ -24,6 +26,32 @@ exports.buildCacheContext = buildCacheContext;
24
26
  exports.explainCacheContext = explainCacheContext;
25
27
  const node_crypto_1 = require("node:crypto");
26
28
  const effective_rate_1 = require("../registry/effective-rate");
29
+ /**
30
+ * Idempotency key for an `upgrade_opportunity` — per (route, reference, cause,
31
+ * snapshot) ONLY (spec §4.1), so the `band`/audit context never splits a dedupe.
32
+ * A re-run over the SAME ceiling is a no-op via the `(org_id, route,
33
+ * trigger_hash)` unique index; a NEWER snapshot (distinct `snapshotId`) is a
34
+ * genuinely new opportunity and a distinct hash.
35
+ */
36
+ function upgradeTriggerHash(route, reference, cause, snapshotId) {
37
+ return (0, node_crypto_1.createHash)("sha256")
38
+ .update(`upgrade_opportunity\n${route}\n${reference.provider}/${reference.model}\n${cause}\n${snapshotId ?? ""}`)
39
+ .digest("hex")
40
+ .slice(0, 32);
41
+ }
42
+ /**
43
+ * Idempotency key for a `regret_breach` — per (route, reference, window bounds,
44
+ * breachKind) ONLY (spec §5.2), so the sampled band's noisy per-run regret
45
+ * numbers never split a dedupe. The window bounds are day-quantized off the
46
+ * injected `now`, so a re-run the SAME day is a no-op via the `(org_id, route,
47
+ * trigger_hash)` unique index.
48
+ */
49
+ function regretBreachTriggerHash(route, reference, windowFrom, windowTo, breachKind) {
50
+ return (0, node_crypto_1.createHash)("sha256")
51
+ .update(`regret_breach\n${route}\n${reference.provider}/${reference.model}\n${windowFrom}\n${windowTo}\n${breachKind}`)
52
+ .digest("hex")
53
+ .slice(0, 32);
54
+ }
27
55
  exports.PROPOSAL_TTL_DAYS = 30;
28
56
  /** Reference token mix for blending input/output rates into one comparable
29
57
  * number: 3 input tokens per output token — a conservative, route-agnostic
@@ -110,7 +110,13 @@ export interface MonitorReadsConfig {
110
110
  }
111
111
  /** PostgREST reads for a Monitor cycle (service role; mirrors the proposals
112
112
  * client). Two org-scoped queries, joined in-SDK by `runMonitorCycle` — no DDL,
113
- * no view (spec §3.1). `taskFor` batches ids ≤100 (T9 — PostgREST URLs fail
114
- * silently around 8KB). */
113
+ * no view (spec §3.1). The deterministic-eval read addresses `grades` directly
114
+ * (grade primitive, GP-2): `artifact_evaluations` was a compat view dropped by
115
+ * 00071, so this reads artifact-SUBJECT deterministic grades (`subject_kind=
116
+ * eq.artifact&kind=eq.deterministic`) and derives `passed = score >= 0.5`. This
117
+ * is the exact set the old read effectively used: run-subject deterministic rows
118
+ * carried a NULL `artifact_id`, so they never joined a task in `rollupConformRate`
119
+ * and were always dropped downstream. `taskFor` batches ids ≤100 (T9 — PostgREST
120
+ * URLs fail silently around 8KB). */
115
121
  export declare function createMonitorReads(config: MonitorReadsConfig): MonitorReads;
116
122
  //# sourceMappingURL=monitor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"monitor.d.ts","sourceRoot":"","sources":["../../src/watch/monitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAA4C,aAAa,EAAE,MAAM,YAAY,CAAC;AAG1F;gEACgE;AAChE,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC;;;+EAG+E;AAC/E,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC;;oEAEoE;AACpE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC;uDACuD;AACvD,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAKpC,CAAC;AAEF,wEAAwE;AACxE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC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,CACnC,KAAK,EAAE,YAAY,EACnB,YAAY,EAAE,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,EACnE,GAAG,EAAE,IAAI,EACT,MAAM,GAAE,aAAsC,GAC7C,OAAO,CAAC,kBAAkB,CAAC,CAU7B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;mFAC+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;CACjC;AAYD;;;;;;;;;qCASqC;AACrC,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CA+B3E"}
@@ -164,8 +164,14 @@ async function runMonitorCycle(reads, submitDrafts, now, config = exports.DEFAUL
164
164
  }
165
165
  /** PostgREST reads for a Monitor cycle (service role; mirrors the proposals
166
166
  * client). Two org-scoped queries, joined in-SDK by `runMonitorCycle` — no DDL,
167
- * no view (spec §3.1). `taskFor` batches ids ≤100 (T9 — PostgREST URLs fail
168
- * silently around 8KB). */
167
+ * no view (spec §3.1). The deterministic-eval read addresses `grades` directly
168
+ * (grade primitive, GP-2): `artifact_evaluations` was a compat view dropped by
169
+ * 00071, so this reads artifact-SUBJECT deterministic grades (`subject_kind=
170
+ * eq.artifact&kind=eq.deterministic`) and derives `passed = score >= 0.5`. This
171
+ * is the exact set the old read effectively used: run-subject deterministic rows
172
+ * carried a NULL `artifact_id`, so they never joined a task in `rollupConformRate`
173
+ * and were always dropped downstream. `taskFor` batches ids ≤100 (T9 — PostgREST
174
+ * URLs fail silently around 8KB). */
169
175
  function createMonitorReads(config) {
170
176
  const base = config.supabaseUrl.replace(/\/$/, "");
171
177
  const fetchFn = config.fetchFn ?? fetch;
@@ -180,9 +186,11 @@ function createMonitorReads(config) {
180
186
  }
181
187
  return {
182
188
  async recentDeterministicEvals(sinceIso) {
183
- const rows = await get(`artifact_evaluations?select=artifact_id,passed,created_at&org_id=eq.${org}` +
184
- `&evaluator_kind=eq.deterministic&created_at=gte.${encodeURIComponent(sinceIso)}`);
185
- return rows.map((r) => ({ artifactId: r.artifact_id, passed: r.passed, createdAt: r.created_at }));
189
+ const rows = await get(`grades?select=subject_id,score,created_at&org_id=eq.${org}` +
190
+ `&subject_kind=eq.artifact&kind=eq.deterministic&created_at=gte.${encodeURIComponent(sinceIso)}`);
191
+ // Grade primitive: score is the NOT-NULL primitive; the pass/fail verdict is
192
+ // DERIVED (passed = score >= 0.5), never stored.
193
+ return rows.map((r) => ({ artifactId: r.subject_id, passed: r.score >= 0.5, createdAt: r.created_at }));
186
194
  },
187
195
  async taskFor(artifactIds) {
188
196
  const out = new Map();
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `modelrig regret-monitor --route <route> [--dry-run] [--json]` — run ONE Q1
3
+ * regret-monitor cycle for a route locally (near-optimal spec §6). Prints the
4
+ * band (regret ± CI, n, the ε line, the 7d-vs-28d drift arrow, last-measured) and
5
+ * any `regret_breach` proposal it would file. `--dry-run` computes the band +
6
+ * draft WITHOUT persisting the cycle or submitting the proposal.
7
+ *
8
+ * This is the LOCAL/self-host proof of the cycle; the multi-tenant hosted run is
9
+ * `regret-monitor-main` (a POST-DEPLOY gate — keyed reference replay + Matt's
10
+ * per-route reference envelope). Reuses `runRegretMonitorCycle` unchanged (N2 — no
11
+ * second implementation). T12: reads/writes ride the `bakeoffs` mirror through the
12
+ * control-plane client, never a bespoke DB path.
13
+ */
14
+ import type { Flags } from "../cli";
15
+ export declare function cmdRegretMonitor(flags: Flags): Promise<number>;
16
+ //# sourceMappingURL=regret-monitor-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regret-monitor-cli.d.ts","sourceRoot":"","sources":["../../src/watch/regret-monitor-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiBH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AA8BpC,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CA0FpE"}
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ /**
3
+ * `modelrig regret-monitor --route <route> [--dry-run] [--json]` — run ONE Q1
4
+ * regret-monitor cycle for a route locally (near-optimal spec §6). Prints the
5
+ * band (regret ± CI, n, the ε line, the 7d-vs-28d drift arrow, last-measured) and
6
+ * any `regret_breach` proposal it would file. `--dry-run` computes the band +
7
+ * draft WITHOUT persisting the cycle or submitting the proposal.
8
+ *
9
+ * This is the LOCAL/self-host proof of the cycle; the multi-tenant hosted run is
10
+ * `regret-monitor-main` (a POST-DEPLOY gate — keyed reference replay + Matt's
11
+ * per-route reference envelope). Reuses `runRegretMonitorCycle` unchanged (N2 — no
12
+ * second implementation). T12: reads/writes ride the `bakeoffs` mirror through the
13
+ * control-plane client, never a bespoke DB path.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.cmdRegretMonitor = cmdRegretMonitor;
17
+ const config_1 = require("../config");
18
+ const loader_1 = require("../routes/loader");
19
+ const rawonly_1 = require("../run/rawonly");
20
+ const index_1 = require("../index");
21
+ const node_os_1 = require("node:os");
22
+ const proposals_1 = require("./proposals");
23
+ const regret_monitor_1 = require("./regret-monitor");
24
+ /** Format a band as "regret 1.4 pts (CI 0.6…2.3, n=180)" — every regret number
25
+ * carries n + CI (regret-claim-ceiling). Null band ⇒ "no cycles yet". */
26
+ function fmtBand(band) {
27
+ if (band === null)
28
+ return "no cycles in window yet";
29
+ const pts = (v) => (v * 100).toFixed(1);
30
+ return `regret ${pts(band.regretMean)} pts (CI ${pts(band.regretCi95[0])}…${pts(band.regretCi95[1])}, n=${band.nPaired})`;
31
+ }
32
+ /** The 7d-vs-28d drift arrow (⬆ worse / ⬇ better / → flat), or "—" when a side
33
+ * is missing. */
34
+ function driftArrow(recent, baseline) {
35
+ if (recent === null || baseline === null)
36
+ return "—";
37
+ const delta = recent.regretMean - baseline.regretMean;
38
+ if (Math.abs(delta) < 1e-9)
39
+ return "→ flat";
40
+ return delta > 0 ? `⬆ +${(delta * 100).toFixed(1)} pts vs 28d` : `⬇ ${(delta * 100).toFixed(1)} pts vs 28d`;
41
+ }
42
+ /** Resolve the reference identity (provider/model) for the trigger + dedupe hash
43
+ * from a resolved bake-off artifact — handles `reference: auto` (the concrete
44
+ * model is only known after the engine resolves it). */
45
+ function referenceOf(artifact) {
46
+ const model = artifact.reference?.model;
47
+ if (typeof model !== "string")
48
+ return null;
49
+ const slash = model.indexOf("/");
50
+ if (slash <= 0)
51
+ return null;
52
+ return { provider: model.slice(0, slash), model: model.slice(slash + 1) };
53
+ }
54
+ async function cmdRegretMonitor(flags) {
55
+ const route = flags.named.get("route");
56
+ if (route === undefined || route === "") {
57
+ throw new Error("usage: modelrig regret-monitor --route <route> [--dry-run] [--json]");
58
+ }
59
+ const dryRun = flags.bare.has("dry-run");
60
+ const asJson = flags.bare.has("json");
61
+ const config = (0, config_1.loadConfigFromEnv)();
62
+ const routes = (0, loader_1.loadRoutes)((0, rawonly_1.requireRoutesDir)(config, "modelrig regret-monitor"));
63
+ const bundle = routes.get(route);
64
+ if (bundle.bakeoff?.reference === undefined) {
65
+ throw new Error(`route "${route}" declares no bakeoff.reference — there is no ceiling to measure regret against. ` +
66
+ "Add bakeoff.reference (auto or provider/model) and, optionally, bakeoff.regret_monitor.");
67
+ }
68
+ const rm = bundle.bakeoff.regretMonitor;
69
+ const sampleN = rm?.sampleN ?? 200;
70
+ const referenceEnvelope = bundle.bakeoff.referenceEnvelopeUsd;
71
+ const rig = (0, index_1.createRig)(config);
72
+ try {
73
+ // Run the sampled 2-arm bake-off ONCE (default vs the route's reference — the
74
+ // reference arm runs automatically because the route declares it). Memoize it
75
+ // so `runRegretMonitorCycle`'s injected collaborator returns the same artifact
76
+ // and we can resolve the (possibly `auto`) reference identity from it first.
77
+ const artifact = await rig.bakeoff(route, {
78
+ variants: ["default"],
79
+ replayLastN: sampleN,
80
+ ...(referenceEnvelope !== undefined ? { envelopeUsdPerVariant: referenceEnvelope } : {}),
81
+ });
82
+ const reference = referenceOf(artifact);
83
+ if (reference === null) {
84
+ throw new Error(`route "${route}" resolved no reference arm on this cycle (no reference model, or nothing to replay) — ` +
85
+ "cannot form a regret band. Check the reference declaration and that captures exist.");
86
+ }
87
+ const cfg = (0, regret_monitor_1.regretMonitorConfig)({
88
+ route,
89
+ reference,
90
+ epsilon: bundle.objective?.maxRegret ?? null,
91
+ ...(rm?.windowDays !== undefined ? { windowDays: rm.windowDays } : {}),
92
+ ...(rm?.baselineDays !== undefined ? { baselineDays: rm.baselineDays } : {}),
93
+ });
94
+ // Reads: the real bakeoffs-mirror when a direct control plane is configured;
95
+ // an in-memory stub for a keyless local proof (no prior cycles, no persist).
96
+ let reads;
97
+ let submitDrafts;
98
+ if (config.export?.mode === "direct" && !dryRun) {
99
+ const exp = (0, config_1.directExportOf)(config, "modelrig regret-monitor");
100
+ reads = (0, regret_monitor_1.createRegretMonitorReads)({
101
+ supabaseUrl: exp.supabaseUrl,
102
+ serviceRoleKey: exp.serviceRoleKey,
103
+ route,
104
+ sourceId: exp.sourceId ?? (0, node_os_1.hostname)(),
105
+ });
106
+ const client = (0, proposals_1.createProposalsClient)({ supabaseUrl: exp.supabaseUrl, serviceRoleKey: exp.serviceRoleKey });
107
+ submitDrafts = (drafts) => client.submitDrafts(drafts);
108
+ }
109
+ else {
110
+ // Local/dry proof: band from THIS cycle only, no persistence, no submit.
111
+ reads = { recentCycles: async () => [], persistCycle: async () => { } };
112
+ submitDrafts = async () => 0;
113
+ }
114
+ const result = await (0, regret_monitor_1.runRegretMonitorCycle)(reads, async () => artifact, submitDrafts, new Date(), cfg);
115
+ if (asJson) {
116
+ console.log(JSON.stringify({ route, band: result.band, baseline: result.baseline, drafts: result.drafts, inserted: result.inserted, dryRun }, null, 2));
117
+ return 0;
118
+ }
119
+ const epsLine = cfg.epsilon === null ? "ε: none declared (drift-only)" : `ε (max_regret): ${(cfg.epsilon * 100).toFixed(1)} pts`;
120
+ console.log(`regret-monitor ${route} vs reference ${reference.provider}/${reference.model}`);
121
+ console.log(` recent (7d): ${fmtBand(result.band)}`);
122
+ console.log(` baseline(28d): ${fmtBand(result.baseline)}`);
123
+ console.log(` ${epsLine} · drift ${driftArrow(result.band, result.baseline)} · last measured ${artifact.ranAt}`);
124
+ if (result.drafts.length > 0) {
125
+ const t = result.drafts[0].trigger;
126
+ console.log(` BREACH (${t.breachKind ?? "?"}) → ${dryRun ? "would file" : `filed ${result.inserted}`} ` +
127
+ "one regret_breach bake-off proposal. Approval stays human: run the bake-off, then swap execute --approve.");
128
+ }
129
+ else {
130
+ console.log(" within bounds — no proposal (measured-only; below min-n both sides ⇒ also no proposal).");
131
+ }
132
+ return 0;
133
+ }
134
+ finally {
135
+ await rig.close();
136
+ }
137
+ }
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Q1 regret monitor — a standing measurement of how far a served route sits from
3
+ * its reference/ceiling over time (near-optimal spec §5). The quality twin of the
4
+ * cost odometer: the watch loop reacts to PRICE, the conform Monitor
5
+ * (`watch/monitor.ts`) reacts to shape, and THIS reacts to REGRET drifting up.
6
+ *
7
+ * A cycle is, precisely, a 2-arm SAMPLED bake-off — `default` vs the route's
8
+ * `__reference__` — under `reference_envelope_usd`. It therefore REUSES the
9
+ * bake-off engine (`runBakeoff`) wholesale via the injected `runSampledBakeoff`
10
+ * collaborator: the reference arm, `replayVariant`, `pairedRegret`, partial-result
11
+ * honesty and metering all come for free. This file adds NO regret estimator — it
12
+ * is the Monitor's STRUCTURE (a per-route band, a drift rule, a cron) wrapped
13
+ * around the number the engine already produces (`metrics.regret`).
14
+ *
15
+ * ── MEASURED-ONLY DOCTRINE (mirrors the conform Monitor) ───────────────────
16
+ * A breach is proposed only when BOTH the recent window and the trailing baseline
17
+ * clear `REGRET_MONITOR_MIN_N` PAIRED samples. Below that the band is too noisy to
18
+ * act on — the house rule is to refuse rather than propose on thin data. The rule
19
+ * is deterministic over an injected `now`, so the fixture test is reproducible.
20
+ *
21
+ * ZERO DDL (spec §10): a cycle mirrors as a `bakeoffs` row MARKED a monitor cycle
22
+ * inside the existing matrix jsonb (`regret-band-provenance`) so the band reads
23
+ * back over time, never double-proposes, and never seeds the odometer.
24
+ */
25
+ import type { BakeoffArtifact } from "../bakeoff/types";
26
+ import type { CandidateEconomics, ProposalDraft, RegretBandSummary } from "./evaluate";
27
+ /** The recent window whose regret we judge — a week, mirroring the conform
28
+ * Monitor (smooths daily noise, stays responsive to a just-landed regression). */
29
+ export declare const REGRET_MONITOR_WINDOW_DAYS = 7;
30
+ /** The trailing baseline the window is compared against — the 28 days before it
31
+ * (non-overlapping), mirroring the conform Monitor + the proposal TTL cadence. */
32
+ export declare const REGRET_MONITOR_BASELINE_DAYS = 28;
33
+ /** Minimum PAIRED samples required in EACH window before the band is trustworthy
34
+ * enough to propose on (measured-only; mirrors `MONITOR_MIN_N`). */
35
+ export declare const REGRET_MONITOR_MIN_N = 20;
36
+ /** Drift-up margin in QUALITY POINTS (0..1 — the same scale as `regretMean` and
37
+ * ε / `max_regret`). A recent window whose mean regret sits this far ABOVE the
38
+ * baseline is materially worse even while still under ε, and files a drift_up
39
+ * breach. Distinct from ε (the absolute bound); this is the relative move. */
40
+ export declare const REGRET_MONITOR_MARGIN = 0.02;
41
+ export interface RegretMonitorConfig {
42
+ /** The route this cycle monitors. */
43
+ readonly route: string;
44
+ /** The reference (ceiling) it measures against — recorded on the trigger. */
45
+ readonly reference: CandidateEconomics;
46
+ /** The route's `objective.max_regret` (ε). null ⇒ drift-only (no over_epsilon
47
+ * breach; a drift_up breach can still fire). */
48
+ readonly epsilon: number | null;
49
+ readonly windowDays: number;
50
+ readonly baselineDays: number;
51
+ /** Drift-up margin, quality points (0..1). */
52
+ readonly margin: number;
53
+ readonly minN: number;
54
+ }
55
+ /** Build a config from the route's declared knobs, defaulting to the house
56
+ * constants (mirrors `DEFAULT_MONITOR_CONFIG`). */
57
+ export declare function regretMonitorConfig(input: {
58
+ readonly route: string;
59
+ readonly reference: CandidateEconomics;
60
+ readonly epsilon: number | null;
61
+ readonly windowDays?: number;
62
+ readonly baselineDays?: number;
63
+ readonly margin?: number;
64
+ readonly minN?: number;
65
+ }): RegretMonitorConfig;
66
+ /** One persisted monitor cycle's regret point (the `default` arm's regret vs the
67
+ * reference on that cycle's paired sample). Read back to form the band. */
68
+ export interface RegretCyclePoint {
69
+ readonly date: string;
70
+ readonly regretMean: number;
71
+ readonly regretCi95: readonly [number, number];
72
+ readonly nPaired: number;
73
+ }
74
+ /**
75
+ * Aggregate the cycle points whose date is in [from, to) into one band. The
76
+ * pooled mean + CI bounds are nPaired-WEIGHTED across the window's cycles (each
77
+ * cycle already carries its own seeded paired-bootstrap CI from `pairedRegret`);
78
+ * `nPaired` is the window's paired total — the min-n gate input. Honest-limits:
79
+ * this pools per-cycle summaries, not per-sample data, so the CI is a weighted
80
+ * blend of the cycles' intervals, not a fresh cross-cycle bootstrap. Null when
81
+ * the window has no cycles.
82
+ */
83
+ export declare function aggregateRegretBand(points: readonly RegretCyclePoint[], from: string, to: string): RegretBandSummary | null;
84
+ /**
85
+ * The regret drift rule (measured-only) — mirrors `evaluateConformDegradation`.
86
+ * Compares the recent window band to the trailing baseline band; emits ONE
87
+ * `regret_breach` bake-off draft when either
88
+ * • recent.regretCi95[1] > ε (over_epsilon), or
89
+ * • recent.regretMean − baseline.regretMean ≥ margin (drift_up),
90
+ * with `nPaired ≥ MIN_N` on BOTH windows; else refuse. Deterministic over `now`.
91
+ * The trigger_hash keys on (route, reference, window bounds, breachKind) so a
92
+ * same-day re-run dedupes.
93
+ */
94
+ export declare function evaluateRegretDrift(series: readonly RegretCyclePoint[], now: Date, config: RegretMonitorConfig): ProposalDraft[];
95
+ /**
96
+ * Extract this cycle's regret point from a freshly-run 2-arm sampled bake-off —
97
+ * the `default` arm's regret vs the reference. Null when the artifact carries no
98
+ * reference/regret (no ceiling resolved ⇒ nothing to band). Pure.
99
+ */
100
+ export declare function cyclePointFromArtifact(artifact: BakeoffArtifact, now: Date): RegretCyclePoint | null;
101
+ /** A cycle to persist as a monitor-marked `bakeoffs` artifact (spec §10). Carries
102
+ * the full artifact (the mirror row) + the monitor marker + the epsilon it was
103
+ * judged against, so the band reads back with provenance. */
104
+ export interface PersistedRegretCycle {
105
+ readonly route: string;
106
+ readonly artifact: BakeoffArtifact;
107
+ readonly point: RegretCyclePoint;
108
+ readonly epsilon: number | null;
109
+ /** Always true — the provenance marker (`regret-band-provenance`). */
110
+ readonly monitorCycle: true;
111
+ }
112
+ /**
113
+ * The reads a regret-monitor cycle needs, injected so the orchestrator is
114
+ * testable without a database (mirrors `MonitorReads`). Both are scoped to ONE
115
+ * (org, route): a hosted cron iterates them.
116
+ */
117
+ export interface RegretMonitorReads {
118
+ /** Prior monitor-cycle regret points for this route, since `sinceIso` — the
119
+ * `bakeoffs` mirror filtered to MONITOR cycles (regret-band-provenance). MUST
120
+ * exclude non-monitor (hand-run) bake-offs so the band is provenance-clean. */
121
+ readonly recentCycles: (sinceIso: string) => Promise<readonly RegretCyclePoint[]>;
122
+ /** Persist a freshly-run cycle as a monitor-marked `bakeoffs` artifact. */
123
+ readonly persistCycle: (cycle: PersistedRegretCycle) => Promise<void>;
124
+ }
125
+ export interface RegretMonitorCycleResult {
126
+ /** The recent-window band for the surface (regret ± CI, n) — null when the
127
+ * window has no cycles yet. */
128
+ readonly band: RegretBandSummary | null;
129
+ /** The trailing baseline band — for the drift arrow on the surface. */
130
+ readonly baseline: RegretBandSummary | null;
131
+ /** This cycle's fresh point (null when no reference/regret resolved). */
132
+ readonly point: RegretCyclePoint | null;
133
+ readonly drafts: ProposalDraft[];
134
+ /** How many proposals the control plane actually created (0 on duplicates). */
135
+ readonly inserted: number;
136
+ }
137
+ /**
138
+ * One regret-monitor cycle (mirror of `runMonitorCycle`): read the prior monitor
139
+ * cycles, run ONE sampled bake-off (default vs the reference) via the injected
140
+ * collaborator, persist it as a monitor-marked artifact, then apply the drift
141
+ * rule over [prior + this cycle] and submit any breach draft through the EXISTING
142
+ * proposals client (idempotent on (route, trigger_hash)). The prior series is
143
+ * read BEFORE persisting this cycle, so the fresh point is counted exactly once.
144
+ * Never actuates — submitting a proposal is the whole of its authority.
145
+ */
146
+ export declare function runRegretMonitorCycle(reads: RegretMonitorReads, runSampledBakeoff: () => Promise<BakeoffArtifact>, submitDrafts: (drafts: readonly ProposalDraft[]) => Promise<number>, now: Date, config: RegretMonitorConfig): Promise<RegretMonitorCycleResult>;
147
+ /** The sentinel arm name that marks a `bakeoffs` matrix as a Q1 monitor cycle.
148
+ * A user variant can never be named this (names cannot start with `__`). */
149
+ export declare const MONITOR_CYCLE_MARKER = "__monitor_cycle__";
150
+ /** The `source_id` prefix that distinguishes a monitor cycle from a hand-run
151
+ * bake-off in the mirror. */
152
+ export declare const MONITOR_SOURCE_PREFIX = "regret-monitor:";
153
+ export interface RegretMonitorReadsConfig {
154
+ readonly supabaseUrl: string;
155
+ readonly serviceRoleKey: string;
156
+ /** The route this reads/writes cycles for (scopes both queries). */
157
+ readonly route: string;
158
+ /** The org this cycle runs for — reads/writes are org-scoped so tenants never
159
+ * merge. A hosted cron iterates orgs; a self-host has exactly one. */
160
+ readonly orgId?: string;
161
+ /** The host that ran the cycle — recorded after the monitor prefix. */
162
+ readonly sourceId: string;
163
+ readonly fetchFn?: typeof fetch;
164
+ }
165
+ /** PostgREST reads for a regret-monitor cycle (service role; mirrors
166
+ * createMonitorReads). ZERO DDL — reuses the `bakeoffs` mirror. */
167
+ export declare function createRegretMonitorReads(config: RegretMonitorReadsConfig): RegretMonitorReads;
168
+ //# sourceMappingURL=regret-monitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regret-monitor.d.ts","sourceRoot":"","sources":["../../src/watch/regret-monitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;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