oh-my-knowledge 0.53.0 → 1.0.0-beta.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 (1244) hide show
  1. package/README.md +49 -15
  2. package/README.zh.md +49 -15
  3. package/dist/assets/agent-skills/omk/SKILL.md +35 -12
  4. package/dist/assets/agent-skills/omk/references/commands.md +45 -53
  5. package/dist/cli/commands/doctor.js +39 -36
  6. package/dist/cli/commands/eval/gold/compare.d.ts +5 -2
  7. package/dist/cli/commands/eval/gold/compare.js +57 -28
  8. package/dist/cli/commands/eval/gold/init.js +1 -1
  9. package/dist/cli/commands/eval/gold/validate.js +1 -1
  10. package/dist/cli/commands/eval/index.js +38 -360
  11. package/dist/cli/commands/evolve.d.ts +2 -12
  12. package/dist/cli/commands/evolve.js +67 -142
  13. package/dist/cli/commands/init.d.ts +2 -0
  14. package/dist/cli/commands/init.js +55 -65
  15. package/dist/cli/commands/install.js +2 -2
  16. package/dist/cli/commands/list.d.ts +1 -1
  17. package/dist/cli/commands/list.js +2 -2
  18. package/dist/cli/commands/observe/inbox.js +6 -6
  19. package/dist/cli/commands/observe/index.d.ts +4 -4
  20. package/dist/cli/commands/observe/index.js +22 -20
  21. package/dist/cli/commands/observe/ingest.d.ts +1 -1
  22. package/dist/cli/commands/observe/ingest.js +7 -7
  23. package/dist/cli/commands/observe/show.js +3 -3
  24. package/dist/cli/commands/promote.js +10 -18
  25. package/dist/cli/commands/rollback.js +2 -2
  26. package/dist/cli/commands/sample.d.ts +3 -20
  27. package/dist/cli/commands/sample.js +38 -306
  28. package/dist/cli/commands/studio.js +32 -42
  29. package/dist/cli/lib/cli-exit.d.ts +1 -1
  30. package/dist/cli/lib/cli-exit.js +1 -1
  31. package/dist/cli/lib/cmd-flags.d.ts +1 -14
  32. package/dist/cli/lib/i18n-dict/common.d.ts +1 -1
  33. package/dist/cli/lib/i18n-dict/common.js +5 -5
  34. package/dist/cli/lib/i18n-dict/evolve.d.ts +1 -1
  35. package/dist/cli/lib/i18n-dict/evolve.js +3 -27
  36. package/dist/cli/lib/i18n-dict/gen.js +4 -4
  37. package/dist/cli/lib/i18n-dict/help.js +26 -26
  38. package/dist/cli/lib/i18n-dict/init.d.ts +1 -1
  39. package/dist/cli/lib/i18n-dict/init.js +15 -3
  40. package/dist/cli/lib/i18n-dict/promote.d.ts +1 -1
  41. package/dist/cli/lib/i18n-dict/promote.js +2 -10
  42. package/dist/cli/lib/i18n-dict.d.ts +1 -1
  43. package/dist/cli/lib/i18n-dict.js +1 -1
  44. package/dist/cli/lib/i18n.d.ts +1 -1
  45. package/dist/cli/lib/localized-sample-discovery.d.ts +3 -0
  46. package/dist/cli/lib/localized-sample-discovery.js +16 -0
  47. package/dist/cli/lib/open-workbench.d.ts +2 -0
  48. package/dist/cli/lib/open-workbench.js +19 -0
  49. package/dist/cli/lib/parse-run-config/judge-models.d.ts +1 -1
  50. package/dist/cli/lib/parse-run-config/samples-discovery.d.ts +6 -7
  51. package/dist/cli/lib/parse-run-config/samples-discovery.js +19 -18
  52. package/dist/cli/lib/parse-run-config/variant-resolution.d.ts +2 -1
  53. package/dist/cli/lib/parse-run-config/variant-resolution.js +2 -2
  54. package/dist/cli/lib/parse-run-config.d.ts +5 -6
  55. package/dist/cli/lib/parse-run-config.js +10 -10
  56. package/dist/cli/lib/progress.d.ts +1 -1
  57. package/dist/cli/lib/record-evolve-outcome.d.ts +10 -25
  58. package/dist/cli/lib/record-evolve-outcome.js +26 -103
  59. package/dist/cli/lib/resolve-skill-input.js +8 -9
  60. package/dist/cli/lib/run-core-evaluation.d.ts +21 -0
  61. package/dist/cli/lib/run-core-evaluation.js +340 -0
  62. package/dist/cli/lib/shared.d.ts +0 -7
  63. package/dist/cli/lib/shared.js +0 -15
  64. package/dist/cli/lib/source-probe.d.ts +2 -2
  65. package/dist/cli/lib/source-probe.js +2 -2
  66. package/dist/cli/lib/update-check.d.ts +2 -3
  67. package/dist/cli/lib/update-check.js +4 -5
  68. package/dist/cli/lib/update-fetch-worker.js +2 -1
  69. package/dist/cli/templates/init-samples.d.ts +4 -0
  70. package/dist/cli/templates/init-samples.js +328 -0
  71. package/dist/diagnosis/contracts/parser.d.ts +9 -0
  72. package/dist/diagnosis/contracts/parser.js +181 -0
  73. package/dist/diagnosis/lifecycle.d.ts +4 -0
  74. package/dist/diagnosis/observe-mapper.d.ts +1 -1
  75. package/dist/diagnosis/observe-mapper.js +1 -1
  76. package/dist/diagnosis/observe-producer.d.ts +3 -3
  77. package/dist/diagnosis/observe-producer.js +2 -2
  78. package/dist/diagnosis/studio-projection.d.ts +1 -1
  79. package/dist/diagnosis/studio-projection.js +1 -1
  80. package/dist/dsh-plugin/cordis.patch.yml +1 -1
  81. package/dist/dsh-plugin/core-adapter.d.ts +26 -0
  82. package/dist/dsh-plugin/core-adapter.js +737 -0
  83. package/dist/dsh-plugin/core-command.d.ts +22 -0
  84. package/dist/dsh-plugin/core-command.js +305 -0
  85. package/dist/dsh-plugin/core-protocol.d.ts +16 -0
  86. package/dist/dsh-plugin/core-protocol.js +250 -0
  87. package/dist/dsh-plugin/host-executor.d.ts +7 -2
  88. package/dist/dsh-plugin/host-executor.js +1 -1
  89. package/dist/dsh-plugin/index.d.ts +5 -3
  90. package/dist/dsh-plugin/index.js +158 -100
  91. package/dist/dsh-plugin/observe.d.ts +47 -0
  92. package/dist/dsh-plugin/observe.js +359 -0
  93. package/dist/dsh-plugin/protocol.d.ts +1 -1
  94. package/dist/dsh-plugin/protocol.js +3 -3
  95. package/dist/dsh-plugin/trace-adapter.d.ts +49 -0
  96. package/dist/dsh-plugin/trace-adapter.js +590 -0
  97. package/dist/eval-core/analysis/builtins.d.ts +88 -0
  98. package/dist/eval-core/analysis/builtins.js +771 -0
  99. package/dist/eval-core/analysis/decision.d.ts +8 -0
  100. package/dist/eval-core/analysis/decision.js +488 -0
  101. package/dist/eval-core/analysis/index.d.ts +4 -0
  102. package/dist/eval-core/analysis/index.js +4 -0
  103. package/dist/eval-core/analysis/runtime.d.ts +6 -0
  104. package/dist/eval-core/analysis/runtime.js +908 -0
  105. package/dist/eval-core/analysis/types.d.ts +254 -0
  106. package/dist/eval-core/analysis/types.js +65 -0
  107. package/dist/eval-core/budget/index.d.ts +44 -0
  108. package/dist/eval-core/budget/index.js +577 -0
  109. package/dist/eval-core/compiler/errors.d.ts +24 -0
  110. package/dist/eval-core/compiler/errors.js +35 -0
  111. package/dist/eval-core/compiler/immutability.d.ts +2 -0
  112. package/dist/eval-core/compiler/immutability.js +17 -0
  113. package/dist/eval-core/compiler/index.d.ts +9 -0
  114. package/dist/eval-core/compiler/index.js +1013 -0
  115. package/dist/eval-core/compiler/types.d.ts +334 -0
  116. package/dist/eval-core/compiler/types.js +110 -0
  117. package/dist/eval-core/compiler/validation.d.ts +4 -0
  118. package/dist/eval-core/compiler/validation.js +566 -0
  119. package/dist/eval-core/contracts/analysis-bundle.d.ts +83 -0
  120. package/dist/eval-core/contracts/analysis-bundle.js +513 -0
  121. package/dist/eval-core/contracts/analysis-identities.d.ts +10 -0
  122. package/dist/eval-core/contracts/analysis-identities.js +24 -0
  123. package/dist/eval-core/contracts/artifacts.d.ts +9168 -0
  124. package/dist/eval-core/contracts/artifacts.js +468 -0
  125. package/dist/eval-core/contracts/budget.d.ts +299 -0
  126. package/dist/eval-core/contracts/budget.js +323 -0
  127. package/dist/eval-core/contracts/common.d.ts +191 -0
  128. package/dist/eval-core/contracts/common.js +132 -0
  129. package/dist/eval-core/contracts/comparability.d.ts +595 -0
  130. package/dist/eval-core/contracts/comparability.js +1208 -0
  131. package/dist/eval-core/contracts/definition.d.ts +1415 -0
  132. package/dist/eval-core/contracts/definition.js +335 -0
  133. package/dist/eval-core/contracts/digests.d.ts +118 -0
  134. package/dist/eval-core/contracts/digests.js +401 -0
  135. package/dist/eval-core/contracts/evaluation-bundle.d.ts +180 -0
  136. package/dist/eval-core/contracts/evaluation-bundle.js +862 -0
  137. package/dist/eval-core/contracts/evaluation-identities.d.ts +46 -0
  138. package/dist/eval-core/contracts/evaluation-identities.js +82 -0
  139. package/dist/eval-core/contracts/evaluation-report.d.ts +62 -0
  140. package/dist/eval-core/contracts/evaluation-report.js +233 -0
  141. package/dist/eval-core/contracts/execution-bundle.d.ts +150 -0
  142. package/dist/eval-core/contracts/execution-bundle.js +657 -0
  143. package/dist/eval-core/contracts/execution-controls.d.ts +147 -0
  144. package/dist/eval-core/contracts/execution-controls.js +77 -0
  145. package/dist/eval-core/contracts/execution-facts.d.ts +191 -0
  146. package/dist/eval-core/contracts/execution-facts.js +349 -0
  147. package/dist/eval-core/contracts/execution-identities.d.ts +96 -0
  148. package/dist/eval-core/contracts/execution-identities.js +374 -0
  149. package/dist/eval-core/contracts/index.d.ts +20 -0
  150. package/dist/eval-core/contracts/index.js +20 -0
  151. package/dist/eval-core/contracts/json-schema.d.ts +13 -0
  152. package/dist/eval-core/contracts/json-schema.js +183 -0
  153. package/dist/eval-core/contracts/json.d.ts +18 -0
  154. package/dist/eval-core/contracts/json.js +154 -0
  155. package/dist/eval-core/contracts/plans.d.ts +2562 -0
  156. package/dist/eval-core/contracts/plans.js +137 -0
  157. package/dist/eval-core/contracts/runtime-capabilities.d.ts +203 -0
  158. package/dist/eval-core/contracts/runtime-capabilities.js +48 -0
  159. package/dist/eval-core/contracts/schemas/v1/analysis-bundle.schema.json +991 -0
  160. package/dist/eval-core/contracts/schemas/v1/analysis-plan.schema.json +889 -0
  161. package/dist/eval-core/contracts/schemas/v1/budget-summary.schema.json +462 -0
  162. package/dist/eval-core/contracts/schemas/v1/comparability-assessment.schema.json +452 -0
  163. package/dist/eval-core/contracts/schemas/v1/comparability-policy.schema.json +84 -0
  164. package/dist/eval-core/contracts/schemas/v1/decision-plan.schema.json +389 -0
  165. package/dist/eval-core/contracts/schemas/v1/evaluation-bundle.schema.json +1793 -0
  166. package/dist/eval-core/contracts/schemas/v1/evaluation-definition.schema.json +1243 -0
  167. package/dist/eval-core/contracts/schemas/v1/evaluation-event.schema.json +144 -0
  168. package/dist/eval-core/contracts/schemas/v1/evaluation-plan.schema.json +789 -0
  169. package/dist/eval-core/contracts/schemas/v1/evaluation-report.schema.json +1041 -0
  170. package/dist/eval-core/contracts/schemas/v1/evaluation-series-definition.schema.json +333 -0
  171. package/dist/eval-core/contracts/schemas/v1/evaluation-series-plan.schema.json +573 -0
  172. package/dist/eval-core/contracts/schemas/v1/evaluation-series-report.schema.json +513 -0
  173. package/dist/eval-core/contracts/schemas/v1/execution-bundle.schema.json +1512 -0
  174. package/dist/eval-core/contracts/schemas/v1/execution-facts.schema.json +460 -0
  175. package/dist/eval-core/contracts/schemas/v1/execution-plan.schema.json +1007 -0
  176. package/dist/eval-core/contracts/schemas/v1/executor-capabilities.schema.json +307 -0
  177. package/dist/eval-core/contracts/schemas/v1/measurement-policy.schema.json +473 -0
  178. package/dist/eval-core/contracts/schemas/v1/run-plan.schema.json +2514 -0
  179. package/dist/eval-core/contracts/schemas/v1/series-analysis-bundle.schema.json +1299 -0
  180. package/dist/eval-core/contracts/series.d.ts +1924 -0
  181. package/dist/eval-core/contracts/series.js +686 -0
  182. package/dist/eval-core/engine/index.d.ts +7 -0
  183. package/dist/eval-core/engine/index.js +570 -0
  184. package/dist/eval-core/engine/types.d.ts +148 -0
  185. package/dist/eval-core/evaluation/index.d.ts +3 -0
  186. package/dist/eval-core/evaluation/index.js +3 -0
  187. package/dist/eval-core/evaluation/runtime.d.ts +6 -0
  188. package/dist/eval-core/evaluation/runtime.js +1224 -0
  189. package/dist/eval-core/evaluation/types.d.ts +163 -0
  190. package/dist/eval-core/evaluation/types.js +33 -0
  191. package/dist/eval-core/execution/index.d.ts +4 -0
  192. package/dist/eval-core/execution/index.js +4 -0
  193. package/dist/eval-core/execution/runtime.d.ts +6 -0
  194. package/dist/eval-core/execution/runtime.js +1140 -0
  195. package/dist/eval-core/execution/scheduler.d.ts +7 -0
  196. package/dist/eval-core/execution/scheduler.js +102 -0
  197. package/dist/eval-core/execution/semaphore.d.ts +6 -0
  198. package/dist/eval-core/execution/semaphore.js +54 -0
  199. package/dist/eval-core/execution/types.d.ts +115 -0
  200. package/dist/eval-core/execution/types.js +34 -0
  201. package/dist/eval-core/facade.d.ts +8 -0
  202. package/dist/eval-core/facade.js +2 -0
  203. package/dist/eval-core/index.d.ts +14 -0
  204. package/dist/eval-core/index.js +6 -0
  205. package/dist/eval-core/internal/sealed-run-plan.d.ts +14 -0
  206. package/dist/eval-core/internal/sealed-run-plan.js +12 -0
  207. package/dist/eval-core/runtime/event-stream.d.ts +8 -0
  208. package/dist/eval-core/runtime/event-stream.js +51 -0
  209. package/dist/eval-core/runtime/events.d.ts +30 -0
  210. package/dist/eval-core/runtime/events.js +102 -0
  211. package/dist/eval-core/runtime/snapshot.d.ts +6 -0
  212. package/dist/eval-core/runtime/snapshot.js +23 -0
  213. package/dist/eval-core/schema-url.d.ts +4 -0
  214. package/dist/eval-core/schema-url.js +10 -0
  215. package/dist/eval-core/schemas.d.ts +2 -0
  216. package/dist/eval-core/schemas.js +23 -0
  217. package/dist/eval-core/series/index.d.ts +1 -0
  218. package/dist/eval-core/series/index.js +1 -0
  219. package/dist/eval-core/series/runtime.d.ts +146 -0
  220. package/dist/eval-core/series/runtime.js +758 -0
  221. package/dist/eval-workflows/analysis/bootstrap.d.ts +145 -0
  222. package/dist/eval-workflows/analysis/bootstrap.js +274 -0
  223. package/dist/eval-workflows/artifact-store/batch-contracts.d.ts +117 -0
  224. package/dist/eval-workflows/artifact-store/batch-contracts.js +70 -0
  225. package/dist/eval-workflows/artifact-store/contracts.d.ts +161 -0
  226. package/dist/eval-workflows/artifact-store/contracts.js +115 -0
  227. package/dist/eval-workflows/artifact-store/index.d.ts +6 -0
  228. package/dist/eval-workflows/artifact-store/index.js +6 -0
  229. package/dist/eval-workflows/artifact-store/node-batch-store.d.ts +8 -0
  230. package/dist/eval-workflows/artifact-store/node-batch-store.js +187 -0
  231. package/dist/eval-workflows/artifact-store/node-content-store.d.ts +13 -0
  232. package/dist/eval-workflows/artifact-store/node-content-store.js +157 -0
  233. package/dist/eval-workflows/artifact-store/node-run-store.d.ts +12 -0
  234. package/dist/eval-workflows/artifact-store/node-run-store.js +516 -0
  235. package/dist/eval-workflows/artifact-store/overlay-store.d.ts +12 -0
  236. package/dist/eval-workflows/artifact-store/overlay-store.js +112 -0
  237. package/dist/eval-workflows/artifact-store/private-json-file.d.ts +4 -0
  238. package/dist/eval-workflows/artifact-store/private-json-file.js +50 -0
  239. package/dist/eval-workflows/assertions/deterministic.d.ts +31 -0
  240. package/dist/eval-workflows/assertions/deterministic.js +301 -0
  241. package/dist/eval-workflows/assertions/layers.d.ts +5 -0
  242. package/dist/eval-workflows/assertions/layers.js +55 -0
  243. package/dist/eval-workflows/evaluation-defaults.d.ts +4 -0
  244. package/dist/eval-workflows/evaluation-defaults.js +4 -0
  245. package/dist/eval-workflows/gold/cli.d.ts +9 -0
  246. package/dist/eval-workflows/gold/cli.js +61 -0
  247. package/dist/eval-workflows/gold/human.d.ts +103 -0
  248. package/dist/eval-workflows/gold/human.js +189 -0
  249. package/dist/eval-workflows/input-compilation/compile.d.ts +6 -0
  250. package/dist/eval-workflows/input-compilation/compile.js +1108 -0
  251. package/dist/eval-workflows/input-compilation/error.d.ts +16 -0
  252. package/dist/eval-workflows/input-compilation/error.js +14 -0
  253. package/dist/eval-workflows/input-compilation/index.d.ts +5 -0
  254. package/dist/eval-workflows/input-compilation/index.js +5 -0
  255. package/dist/eval-workflows/input-compilation/parse.d.ts +25 -0
  256. package/dist/eval-workflows/input-compilation/parse.js +546 -0
  257. package/dist/eval-workflows/input-compilation/registry.d.ts +35 -0
  258. package/dist/eval-workflows/input-compilation/registry.js +274 -0
  259. package/dist/eval-workflows/input-compilation/types.d.ts +396 -0
  260. package/dist/eval-workflows/input-compilation/types.js +4 -0
  261. package/dist/eval-workflows/inputs/assertion-types.d.ts +6 -0
  262. package/dist/eval-workflows/inputs/contracts/assertion-kind.d.ts +3 -0
  263. package/dist/eval-workflows/inputs/contracts/assertion.d.ts +25 -0
  264. package/dist/eval-workflows/inputs/contracts/config.d.ts +68 -0
  265. package/dist/eval-workflows/inputs/contracts/index.d.ts +5 -0
  266. package/dist/eval-workflows/inputs/contracts/sample.d.ts +78 -0
  267. package/dist/eval-workflows/inputs/contracts/schemas/v1/eval-sample-set.schema.json +620 -0
  268. package/dist/eval-workflows/inputs/contracts/variant.d.ts +16 -0
  269. package/dist/eval-workflows/inputs/eval-config.d.ts +19 -0
  270. package/dist/eval-workflows/inputs/eval-config.js +340 -0
  271. package/dist/eval-workflows/inputs/eval-samples.d.ts +8 -0
  272. package/dist/eval-workflows/inputs/eval-samples.js +12 -0
  273. package/dist/eval-workflows/inputs/load-samples.d.ts +43 -0
  274. package/dist/eval-workflows/inputs/load-samples.js +290 -0
  275. package/dist/eval-workflows/inputs/materialize-copy.js +193 -0
  276. package/dist/eval-workflows/inputs/sample-contract.d.ts +3 -0
  277. package/dist/eval-workflows/inputs/sample-contract.js +361 -0
  278. package/dist/eval-workflows/inputs/sample-document.d.ts +10 -0
  279. package/dist/eval-workflows/inputs/sample-document.js +94 -0
  280. package/dist/eval-workflows/inputs/sample-locator.d.ts +27 -0
  281. package/dist/eval-workflows/inputs/sample-locator.js +160 -0
  282. package/dist/eval-workflows/inputs/schemas/assertion.d.ts +4 -0
  283. package/dist/eval-workflows/inputs/schemas/assertion.js +23 -0
  284. package/dist/eval-workflows/inputs/schemas/error.d.ts +8 -0
  285. package/dist/eval-workflows/inputs/schemas/error.js +36 -0
  286. package/dist/eval-workflows/inputs/schemas/json-schema.d.ts +1 -0
  287. package/dist/eval-workflows/inputs/schemas/json-schema.js +27 -0
  288. package/dist/eval-workflows/inputs/schemas/mock.d.ts +6 -0
  289. package/dist/eval-workflows/inputs/schemas/mock.js +27 -0
  290. package/dist/eval-workflows/inputs/schemas/sample-set.d.ts +15 -0
  291. package/dist/eval-workflows/inputs/schemas/sample-set.js +60 -0
  292. package/dist/eval-workflows/inputs/skill-loader.d.ts +191 -0
  293. package/dist/eval-workflows/inputs/skill-loader.js +836 -0
  294. package/dist/eval-workflows/instruments/contracts/config.d.ts +7 -0
  295. package/dist/eval-workflows/instruments/contracts/index.d.ts +2 -0
  296. package/dist/eval-workflows/instruments/contracts/result.d.ts +54 -0
  297. package/dist/eval-workflows/instruments/judge-trace.d.ts +8 -0
  298. package/dist/eval-workflows/instruments/judge-trace.js +94 -0
  299. package/dist/eval-workflows/instruments/judge.d.ts +78 -0
  300. package/dist/eval-workflows/instruments/judge.js +323 -0
  301. package/dist/eval-workflows/instruments/prompts/debias-instructions.js +43 -0
  302. package/dist/eval-workflows/instruments/prompts/judge-prompts.d.ts +30 -0
  303. package/dist/eval-workflows/instruments/prompts/judge-prompts.js +205 -0
  304. package/dist/eval-workflows/messages.d.ts +1 -1
  305. package/dist/eval-workflows/production-host/artifact-graph-persistence.d.ts +11 -0
  306. package/dist/eval-workflows/production-host/artifact-graph-persistence.js +66 -0
  307. package/dist/eval-workflows/production-host/environment.d.ts +9 -0
  308. package/dist/eval-workflows/production-host/environment.js +34 -0
  309. package/dist/eval-workflows/production-host/holdout.d.ts +8 -0
  310. package/dist/eval-workflows/production-host/holdout.js +25 -0
  311. package/dist/eval-workflows/production-host/index.d.ts +9 -0
  312. package/dist/eval-workflows/production-host/index.js +9 -0
  313. package/dist/eval-workflows/production-host/measurement-design.d.ts +21 -0
  314. package/dist/eval-workflows/production-host/measurement-design.js +562 -0
  315. package/dist/eval-workflows/production-host/node-cli-composition.d.ts +26 -0
  316. package/dist/eval-workflows/production-host/node-cli-composition.js +474 -0
  317. package/dist/eval-workflows/production-host/node-cli-evaluation-resolver.d.ts +20 -0
  318. package/dist/eval-workflows/production-host/node-cli-evaluation-resolver.js +755 -0
  319. package/dist/eval-workflows/production-host/node-sample-content-resolver.d.ts +43 -0
  320. package/dist/eval-workflows/production-host/node-sample-content-resolver.js +270 -0
  321. package/dist/eval-workflows/production-host/orchestration.d.ts +78 -0
  322. package/dist/eval-workflows/production-host/orchestration.js +274 -0
  323. package/dist/eval-workflows/production-host/runtime-registry.d.ts +57 -0
  324. package/dist/eval-workflows/production-host/runtime-registry.js +270 -0
  325. package/dist/eval-workflows/production-host/safe-http-content-resolver.d.ts +4 -0
  326. package/dist/eval-workflows/production-host/safe-http-content-resolver.js +219 -0
  327. package/dist/eval-workflows/production-host/sample-content-resolution.d.ts +44 -0
  328. package/dist/eval-workflows/production-host/sample-content-resolution.js +242 -0
  329. package/dist/eval-workflows/production-host/workflow.d.ts +76 -0
  330. package/dist/eval-workflows/production-host/workflow.js +200 -0
  331. package/dist/eval-workflows/projections/artifact-graph.d.ts +15 -0
  332. package/dist/eval-workflows/projections/artifact-graph.js +388 -0
  333. package/dist/eval-workflows/projections/cli-gate.d.ts +3 -0
  334. package/dist/eval-workflows/projections/cli-gate.js +45 -0
  335. package/dist/eval-workflows/projections/cli.d.ts +39 -0
  336. package/dist/eval-workflows/projections/cli.js +334 -0
  337. package/dist/eval-workflows/projections/contracts.d.ts +332 -0
  338. package/dist/eval-workflows/projections/contracts.js +16 -0
  339. package/dist/eval-workflows/projections/decision.d.ts +4 -0
  340. package/dist/eval-workflows/projections/decision.js +27 -0
  341. package/dist/eval-workflows/projections/diagnostic.d.ts +7 -0
  342. package/dist/eval-workflows/projections/diagnostic.js +160 -0
  343. package/dist/eval-workflows/projections/evolution.d.ts +13 -0
  344. package/dist/eval-workflows/projections/evolution.js +144 -0
  345. package/dist/eval-workflows/projections/gold.d.ts +21 -0
  346. package/dist/eval-workflows/projections/gold.js +204 -0
  347. package/dist/eval-workflows/projections/index.d.ts +9 -0
  348. package/dist/eval-workflows/projections/index.js +9 -0
  349. package/dist/eval-workflows/projections/managed.d.ts +8 -0
  350. package/dist/eval-workflows/projections/managed.js +105 -0
  351. package/dist/eval-workflows/projections/source.d.ts +2 -0
  352. package/dist/eval-workflows/projections/source.js +48 -0
  353. package/dist/eval-workflows/resume-admission/admit.d.ts +8 -0
  354. package/dist/eval-workflows/resume-admission/admit.js +180 -0
  355. package/dist/eval-workflows/resume-admission/contracts.d.ts +81 -0
  356. package/dist/eval-workflows/resume-admission/contracts.js +22 -0
  357. package/dist/eval-workflows/resume-admission/index.d.ts +2 -0
  358. package/dist/eval-workflows/resume-admission/index.js +2 -0
  359. package/dist/eval-workflows/runtime-adapter/adapters/anthropic/api.d.ts +31 -0
  360. package/dist/eval-workflows/runtime-adapter/adapters/anthropic/api.js +286 -0
  361. package/dist/eval-workflows/runtime-adapter/adapters/anthropic/protocol.d.ts +67 -0
  362. package/dist/eval-workflows/runtime-adapter/adapters/anthropic/protocol.js +192 -0
  363. package/dist/eval-workflows/runtime-adapter/adapters/claude/cli-protocol.d.ts +19 -0
  364. package/dist/eval-workflows/runtime-adapter/adapters/claude/cli-protocol.js +322 -0
  365. package/dist/eval-workflows/runtime-adapter/adapters/claude/cli.d.ts +48 -0
  366. package/dist/eval-workflows/runtime-adapter/adapters/claude/cli.js +607 -0
  367. package/dist/eval-workflows/runtime-adapter/adapters/claude/resources.d.ts +151 -0
  368. package/dist/eval-workflows/runtime-adapter/adapters/claude/resources.js +664 -0
  369. package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk-protocol.d.ts +7 -0
  370. package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk-protocol.js +84 -0
  371. package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk-runtime.d.ts +40 -0
  372. package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk-runtime.js +163 -0
  373. package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk.d.ts +29 -0
  374. package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk.js +507 -0
  375. package/dist/eval-workflows/runtime-adapter/adapters/codex/cli-protocol.d.ts +61 -0
  376. package/dist/eval-workflows/runtime-adapter/adapters/codex/cli-protocol.js +36 -0
  377. package/dist/eval-workflows/runtime-adapter/adapters/codex/cli-resources.d.ts +13 -0
  378. package/dist/eval-workflows/runtime-adapter/adapters/codex/cli-resources.js +16 -0
  379. package/dist/eval-workflows/runtime-adapter/adapters/codex/cli.d.ts +44 -0
  380. package/dist/eval-workflows/runtime-adapter/adapters/codex/cli.js +348 -0
  381. package/dist/eval-workflows/runtime-adapter/adapters/codex/content-identity.d.ts +5 -0
  382. package/dist/eval-workflows/runtime-adapter/adapters/codex/content-identity.js +3 -0
  383. package/dist/eval-workflows/runtime-adapter/adapters/codex/environment.d.ts +4 -0
  384. package/dist/eval-workflows/runtime-adapter/adapters/codex/environment.js +2 -0
  385. package/dist/eval-workflows/runtime-adapter/adapters/codex/protocol-core.d.ts +21 -0
  386. package/dist/eval-workflows/runtime-adapter/adapters/codex/protocol-core.js +232 -0
  387. package/dist/eval-workflows/runtime-adapter/adapters/codex/resources.d.ts +108 -0
  388. package/dist/eval-workflows/runtime-adapter/adapters/codex/resources.js +331 -0
  389. package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk-protocol.d.ts +61 -0
  390. package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk-protocol.js +20 -0
  391. package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk-runtime.d.ts +33 -0
  392. package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk-runtime.js +169 -0
  393. package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk.d.ts +32 -0
  394. package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk.js +375 -0
  395. package/dist/eval-workflows/runtime-adapter/adapters/custom/command.d.ts +207 -0
  396. package/dist/eval-workflows/runtime-adapter/adapters/custom/command.js +696 -0
  397. package/dist/eval-workflows/runtime-adapter/adapters/index.d.ts +8 -0
  398. package/dist/eval-workflows/runtime-adapter/adapters/index.js +8 -0
  399. package/dist/eval-workflows/runtime-adapter/adapters/openai/api.d.ts +31 -0
  400. package/dist/eval-workflows/runtime-adapter/adapters/openai/api.js +292 -0
  401. package/dist/eval-workflows/runtime-adapter/adapters/openai/protocol.d.ts +67 -0
  402. package/dist/eval-workflows/runtime-adapter/adapters/openai/protocol.js +236 -0
  403. package/dist/eval-workflows/runtime-adapter/adapters/shared/api-http.d.ts +53 -0
  404. package/dist/eval-workflows/runtime-adapter/adapters/shared/api-http.js +167 -0
  405. package/dist/eval-workflows/runtime-adapter/adapters/shared/api-protocol-core.d.ts +7 -0
  406. package/dist/eval-workflows/runtime-adapter/adapters/shared/api-protocol-core.js +96 -0
  407. package/dist/eval-workflows/runtime-adapter/adapters/shared/classified-environment.d.ts +21 -0
  408. package/dist/eval-workflows/runtime-adapter/adapters/shared/classified-environment.js +43 -0
  409. package/dist/eval-workflows/runtime-adapter/adapters/shared/content-identity.d.ts +16 -0
  410. package/dist/eval-workflows/runtime-adapter/adapters/shared/content-identity.js +101 -0
  411. package/dist/eval-workflows/runtime-adapter/adapters/shared/same-process.d.ts +109 -0
  412. package/dist/eval-workflows/runtime-adapter/adapters/shared/same-process.js +322 -0
  413. package/dist/eval-workflows/runtime-adapter/adapters/shared/stateless-api-resources.d.ts +80 -0
  414. package/dist/eval-workflows/runtime-adapter/adapters/shared/stateless-api-resources.js +230 -0
  415. package/dist/eval-workflows/runtime-adapter/analysis/agreement-node-contract.d.ts +10 -0
  416. package/dist/eval-workflows/runtime-adapter/analysis/agreement-node-contract.js +78 -0
  417. package/dist/eval-workflows/runtime-adapter/analysis/agreement-node.d.ts +3 -0
  418. package/dist/eval-workflows/runtime-adapter/analysis/agreement-node.js +29 -0
  419. package/dist/eval-workflows/runtime-adapter/analysis/agreement-parameters.d.ts +31 -0
  420. package/dist/eval-workflows/runtime-adapter/analysis/agreement-parameters.js +65 -0
  421. package/dist/eval-workflows/runtime-adapter/analysis/agreement-source-adapter.d.ts +11 -0
  422. package/dist/eval-workflows/runtime-adapter/analysis/agreement-source-adapter.js +114 -0
  423. package/dist/eval-workflows/runtime-adapter/analysis/agreement-table.d.ts +259 -0
  424. package/dist/eval-workflows/runtime-adapter/analysis/agreement-table.js +303 -0
  425. package/dist/eval-workflows/runtime-adapter/analysis/analysis-support.d.ts +14 -0
  426. package/dist/eval-workflows/runtime-adapter/analysis/analysis-support.js +44 -0
  427. package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer-node.d.ts +5 -0
  428. package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer-node.js +218 -0
  429. package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer-parameters.d.ts +39 -0
  430. package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer-parameters.js +49 -0
  431. package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer.d.ts +552 -0
  432. package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer.js +289 -0
  433. package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-node-contract.d.ts +10 -0
  434. package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-node-contract.js +89 -0
  435. package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-node.d.ts +3 -0
  436. package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-node.js +35 -0
  437. package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-parameters.d.ts +41 -0
  438. package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-parameters.js +111 -0
  439. package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-source-adapter.d.ts +9 -0
  440. package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-source-adapter.js +28 -0
  441. package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-table.d.ts +240 -0
  442. package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-table.js +368 -0
  443. package/dist/eval-workflows/runtime-adapter/analysis/composite-node-contract.d.ts +10 -0
  444. package/dist/eval-workflows/runtime-adapter/analysis/composite-node-contract.js +80 -0
  445. package/dist/eval-workflows/runtime-adapter/analysis/composite-node.d.ts +3 -0
  446. package/dist/eval-workflows/runtime-adapter/analysis/composite-node.js +79 -0
  447. package/dist/eval-workflows/runtime-adapter/analysis/composite-parameters.d.ts +56 -0
  448. package/dist/eval-workflows/runtime-adapter/analysis/composite-parameters.js +92 -0
  449. package/dist/eval-workflows/runtime-adapter/analysis/composite-source-adapter.d.ts +13 -0
  450. package/dist/eval-workflows/runtime-adapter/analysis/composite-source-adapter.js +60 -0
  451. package/dist/eval-workflows/runtime-adapter/analysis/composite-table.d.ts +244 -0
  452. package/dist/eval-workflows/runtime-adapter/analysis/composite-table.js +199 -0
  453. package/dist/eval-workflows/runtime-adapter/analysis/dimension-node.d.ts +5 -0
  454. package/dist/eval-workflows/runtime-adapter/analysis/dimension-node.js +169 -0
  455. package/dist/eval-workflows/runtime-adapter/analysis/dimension-parameters.d.ts +24 -0
  456. package/dist/eval-workflows/runtime-adapter/analysis/dimension-parameters.js +44 -0
  457. package/dist/eval-workflows/runtime-adapter/analysis/dimension-table.d.ts +135 -0
  458. package/dist/eval-workflows/runtime-adapter/analysis/dimension-table.js +195 -0
  459. package/dist/eval-workflows/runtime-adapter/analysis/index.d.ts +21 -0
  460. package/dist/eval-workflows/runtime-adapter/analysis/index.js +21 -0
  461. package/dist/eval-workflows/runtime-adapter/analysis/judge-aggregation.d.ts +343 -0
  462. package/dist/eval-workflows/runtime-adapter/analysis/judge-aggregation.js +731 -0
  463. package/dist/eval-workflows/runtime-adapter/analysis/release-decision-parameters.d.ts +36 -0
  464. package/dist/eval-workflows/runtime-adapter/analysis/release-decision-parameters.js +114 -0
  465. package/dist/eval-workflows/runtime-adapter/analysis/release-decision.d.ts +6 -0
  466. package/dist/eval-workflows/runtime-adapter/analysis/release-decision.js +406 -0
  467. package/dist/eval-workflows/runtime-adapter/assembly.d.ts +6 -0
  468. package/dist/eval-workflows/runtime-adapter/assembly.js +787 -0
  469. package/dist/eval-workflows/runtime-adapter/builtins.d.ts +7 -0
  470. package/dist/eval-workflows/runtime-adapter/builtins.js +106 -0
  471. package/dist/eval-workflows/runtime-adapter/composition.d.ts +82 -0
  472. package/dist/eval-workflows/runtime-adapter/composition.js +824 -0
  473. package/dist/eval-workflows/runtime-adapter/evaluators/assertion-common.d.ts +17 -0
  474. package/dist/eval-workflows/runtime-adapter/evaluators/assertion-common.js +72 -0
  475. package/dist/eval-workflows/runtime-adapter/evaluators/execution-assertions.d.ts +38 -0
  476. package/dist/eval-workflows/runtime-adapter/evaluators/execution-assertions.js +307 -0
  477. package/dist/eval-workflows/runtime-adapter/evaluators/index.d.ts +5 -0
  478. package/dist/eval-workflows/runtime-adapter/evaluators/index.js +5 -0
  479. package/dist/eval-workflows/runtime-adapter/evaluators/llm-assertions.d.ts +71 -0
  480. package/dist/eval-workflows/runtime-adapter/evaluators/llm-assertions.js +493 -0
  481. package/dist/eval-workflows/runtime-adapter/evaluators/llm-judge-invocation.d.ts +49 -0
  482. package/dist/eval-workflows/runtime-adapter/evaluators/llm-judge-invocation.js +72 -0
  483. package/dist/eval-workflows/runtime-adapter/evaluators/output-assertions.d.ts +33 -0
  484. package/dist/eval-workflows/runtime-adapter/evaluators/output-assertions.js +168 -0
  485. package/dist/eval-workflows/runtime-adapter/evaluators/rubric-judge.d.ts +73 -0
  486. package/dist/eval-workflows/runtime-adapter/evaluators/rubric-judge.js +431 -0
  487. package/dist/eval-workflows/runtime-adapter/event-projection.d.ts +34 -0
  488. package/dist/eval-workflows/runtime-adapter/event-projection.js +175 -0
  489. package/dist/eval-workflows/runtime-adapter/index.d.ts +11 -0
  490. package/dist/eval-workflows/runtime-adapter/index.js +11 -0
  491. package/dist/eval-workflows/runtime-adapter/preflight.d.ts +54 -0
  492. package/dist/eval-workflows/runtime-adapter/preflight.js +248 -0
  493. package/dist/eval-workflows/runtime-adapter/resource-leases/access.d.ts +14 -0
  494. package/dist/eval-workflows/runtime-adapter/resource-leases/access.js +173 -0
  495. package/dist/eval-workflows/runtime-adapter/resource-leases/index.d.ts +3 -0
  496. package/dist/eval-workflows/runtime-adapter/resource-leases/index.js +3 -0
  497. package/dist/eval-workflows/runtime-adapter/resource-leases/node.d.ts +24 -0
  498. package/dist/eval-workflows/runtime-adapter/resource-leases/node.js +803 -0
  499. package/dist/eval-workflows/runtime-adapter/resource-leases/types.d.ts +105 -0
  500. package/dist/eval-workflows/runtime-adapter/resource-leases/types.js +25 -0
  501. package/dist/eval-workflows/runtime-adapter/series-variance.d.ts +6 -0
  502. package/dist/eval-workflows/runtime-adapter/series-variance.js +94 -0
  503. package/dist/eval-workflows/runtime-adapter/source-neutral-trace.d.ts +57 -0
  504. package/dist/eval-workflows/runtime-adapter/source-neutral-trace.js +66 -0
  505. package/dist/eval-workflows/runtime-adapter/types.d.ts +159 -0
  506. package/dist/eval-workflows/runtime-adapter/types.js +12 -0
  507. package/dist/evidence/graph/contracts.d.ts +93 -0
  508. package/dist/evidence/graph/doctor.d.ts +22 -0
  509. package/dist/evidence/graph/doctor.js +572 -0
  510. package/dist/evidence/graph/schema.d.ts +3 -0
  511. package/dist/evidence/graph/schema.js +233 -0
  512. package/dist/evidence/storage/default-dirs.d.ts +34 -0
  513. package/dist/evidence/storage/default-dirs.js +35 -0
  514. package/dist/evidence/storage/directories.js +65 -0
  515. package/dist/evidence/storage/discovery-index.d.ts +88 -0
  516. package/dist/evidence/storage/discovery-index.js +307 -0
  517. package/dist/evidence/storage/file-names.d.ts +14 -0
  518. package/dist/evidence/storage/file-names.js +57 -0
  519. package/dist/evidence/storage/layout.d.ts +35 -0
  520. package/dist/evidence/storage/layout.js +50 -0
  521. package/dist/evidence/storage/report-bundle.d.ts +35 -0
  522. package/dist/evidence/storage/report-bundle.js +122 -0
  523. package/dist/evidence/storage/run-id.d.ts +2 -0
  524. package/dist/evidence/storage/run-id.js +19 -0
  525. package/dist/executors/anthropic/api.d.ts +3 -2
  526. package/dist/executors/anthropic/api.js +5 -3
  527. package/dist/executors/anthropic/claude/cli.d.ts +3 -2
  528. package/dist/executors/anthropic/claude/cli.js +3 -2
  529. package/dist/executors/anthropic/claude/protocol.d.ts +1 -1
  530. package/dist/executors/anthropic/claude/protocol.js +1 -1
  531. package/dist/executors/anthropic/claude/sdk.d.ts +3 -2
  532. package/dist/executors/anthropic/claude/sdk.js +7 -2
  533. package/dist/executors/anthropic/claude/trace.d.ts +1 -1
  534. package/dist/executors/anthropic/claude/trace.js +4 -4
  535. package/dist/executors/contracts/index.d.ts +4 -0
  536. package/dist/executors/contracts/index.js +1 -0
  537. package/dist/executors/contracts/mock.d.ts +65 -0
  538. package/dist/executors/contracts/mock.js +1 -0
  539. package/dist/executors/contracts/ports.d.ts +63 -0
  540. package/dist/executors/contracts/ports.js +1 -0
  541. package/dist/executors/contracts/result.d.ts +41 -0
  542. package/dist/executors/contracts/result.js +1 -0
  543. package/dist/executors/contracts/runtime.d.ts +40 -0
  544. package/dist/executors/contracts/runtime.js +1 -0
  545. package/dist/executors/contracts/trace-source.d.ts +2 -0
  546. package/dist/executors/contracts/trace-source.js +1 -0
  547. package/dist/executors/contracts/trace.d.ts +36 -0
  548. package/dist/executors/contracts/trace.js +1 -0
  549. package/dist/executors/core/capabilities.d.ts +6 -2
  550. package/dist/executors/core/runtime-fingerprint.d.ts +2 -1
  551. package/dist/executors/core/runtime.d.ts +1 -1
  552. package/dist/executors/core/subprocess.d.ts +1 -0
  553. package/dist/executors/core/subprocess.js +9 -8
  554. package/dist/executors/core/trace-source-kind.d.ts +4 -0
  555. package/dist/executors/core/trace-source-kind.js +13 -0
  556. package/dist/executors/index.d.ts +1 -1
  557. package/dist/executors/mock-runtime/mock-hook.cjs +271 -0
  558. package/dist/executors/mock-runtime/runtime.d.ts +103 -0
  559. package/dist/executors/mock-runtime/runtime.js +638 -0
  560. package/dist/executors/openai/api.d.ts +3 -2
  561. package/dist/executors/openai/api.js +5 -3
  562. package/dist/executors/openai/codex/cli.d.ts +3 -2
  563. package/dist/executors/openai/codex/cli.js +3 -1
  564. package/dist/executors/openai/codex/protocol.d.ts +2 -1
  565. package/dist/executors/openai/codex/protocol.js +1 -1
  566. package/dist/executors/openai/codex/sdk.d.ts +3 -2
  567. package/dist/executors/openai/codex/sdk.js +6 -1
  568. package/dist/executors/openai/codex/trace.d.ts +1 -1
  569. package/dist/executors/openai/codex/trace.js +2 -2
  570. package/dist/executors/preflight/contracts.d.ts +40 -0
  571. package/dist/executors/preflight/contracts.js +1 -0
  572. package/dist/executors/preflight/dependencies.d.ts +36 -0
  573. package/dist/executors/result-validation.d.ts +18 -0
  574. package/dist/executors/result-validation.js +221 -0
  575. package/dist/executors/script/index.d.ts +1 -1
  576. package/dist/executors/script/index.js +2 -2
  577. package/dist/executors/tool-call-status.d.ts +9 -0
  578. package/dist/executors/tool-call-status.js +79 -0
  579. package/dist/index.d.ts +4 -0
  580. package/dist/index.js +4 -0
  581. package/dist/knowledge-artifacts/authoring/core-evolver.d.ts +65 -0
  582. package/dist/knowledge-artifacts/authoring/core-evolver.js +277 -0
  583. package/dist/knowledge-artifacts/authoring/generator.d.ts +100 -0
  584. package/dist/knowledge-artifacts/authoring/generator.js +1019 -0
  585. package/dist/knowledge-artifacts/authoring/improvement.d.ts +15 -0
  586. package/dist/knowledge-artifacts/authoring/improvement.js +52 -0
  587. package/dist/knowledge-artifacts/contracts.d.ts +18 -0
  588. package/dist/knowledge-artifacts/contracts.js +1 -0
  589. package/dist/knowledge-artifacts/doctor/contracts.d.ts +199 -0
  590. package/dist/knowledge-artifacts/doctor/contracts.js +1 -0
  591. package/dist/knowledge-artifacts/doctor/endpoint-rule.d.ts +60 -0
  592. package/dist/knowledge-artifacts/doctor/endpoint-rule.js +382 -0
  593. package/dist/knowledge-artifacts/doctor/fixer.d.ts +11 -0
  594. package/dist/knowledge-artifacts/doctor/fixer.js +337 -0
  595. package/dist/knowledge-artifacts/doctor/health/composer.d.ts +18 -0
  596. package/dist/knowledge-artifacts/doctor/health/composer.js +407 -0
  597. package/dist/knowledge-artifacts/doctor/health/dimension-spec.d.ts +52 -0
  598. package/dist/knowledge-artifacts/doctor/health/merge-prompt.d.ts +22 -0
  599. package/dist/knowledge-artifacts/doctor/health/prompt-builder.d.ts +21 -0
  600. package/dist/knowledge-artifacts/doctor/index.d.ts +19 -0
  601. package/dist/knowledge-artifacts/doctor/index.js +274 -0
  602. package/dist/knowledge-artifacts/doctor/messages.d.ts +20 -0
  603. package/dist/knowledge-artifacts/doctor/preflight.d.ts +32 -0
  604. package/dist/knowledge-artifacts/doctor/preflight.js +31 -0
  605. package/dist/knowledge-artifacts/doctor/renderer.d.ts +17 -0
  606. package/dist/knowledge-artifacts/doctor/report-parser.d.ts +3 -0
  607. package/dist/knowledge-artifacts/doctor/report-parser.js +103 -0
  608. package/dist/knowledge-artifacts/doctor/report-schema.d.ts +3 -0
  609. package/dist/knowledge-artifacts/doctor/report-schema.js +3 -0
  610. package/dist/knowledge-artifacts/doctor/rule-kind.d.ts +2 -0
  611. package/dist/knowledge-artifacts/doctor/rule-kind.js +3 -0
  612. package/dist/knowledge-artifacts/doctor/rules.d.ts +32 -0
  613. package/dist/knowledge-artifacts/doctor/rules.js +290 -0
  614. package/dist/knowledge-artifacts/governance/contracts.d.ts +158 -0
  615. package/dist/knowledge-artifacts/governance/contracts.js +1 -0
  616. package/dist/knowledge-artifacts/governance/evidence.d.ts +24 -0
  617. package/dist/knowledge-artifacts/governance/evidence.js +109 -0
  618. package/dist/knowledge-artifacts/governance/index.d.ts +11 -0
  619. package/dist/knowledge-artifacts/governance/index.js +11 -0
  620. package/dist/knowledge-artifacts/governance/list-view.d.ts +67 -0
  621. package/dist/knowledge-artifacts/governance/list-view.js +77 -0
  622. package/dist/knowledge-artifacts/governance/observe-feedback.d.ts +60 -0
  623. package/dist/knowledge-artifacts/governance/promote-gate.d.ts +34 -0
  624. package/dist/knowledge-artifacts/governance/promote-gate.js +32 -0
  625. package/dist/knowledge-artifacts/governance/source-probe.d.ts +15 -0
  626. package/dist/knowledge-artifacts/governance/source-probe.js +129 -0
  627. package/dist/knowledge-artifacts/governance/store.d.ts +141 -0
  628. package/dist/knowledge-artifacts/governance/store.js +585 -0
  629. package/dist/knowledge-artifacts/skills/contracts.d.ts +35 -0
  630. package/dist/knowledge-artifacts/skills/contracts.js +1 -0
  631. package/dist/knowledge-artifacts/skills/hard-rules.d.ts +7 -0
  632. package/dist/knowledge-artifacts/sources/content-hash.d.ts +31 -0
  633. package/dist/knowledge-artifacts/sources/content-hash.js +121 -0
  634. package/dist/mcp/capture-store.d.ts +25 -0
  635. package/dist/mcp/capture-store.js +48 -0
  636. package/dist/mcp/feedback-store.d.ts +78 -0
  637. package/dist/mcp/feedback-store.js +241 -0
  638. package/dist/mcp/http.d.ts +26 -0
  639. package/dist/mcp/http.js +225 -0
  640. package/dist/mcp/index.d.ts +7 -0
  641. package/dist/mcp/index.js +7 -0
  642. package/dist/mcp/mcp-server.d.ts +14 -0
  643. package/dist/mcp/mcp-server.js +293 -0
  644. package/dist/mcp/principal.d.ts +25 -0
  645. package/dist/mcp/principal.js +83 -0
  646. package/dist/mcp/review-component.d.ts +11 -0
  647. package/dist/mcp/review-component.js +846 -0
  648. package/dist/mcp/stdio.d.ts +2 -0
  649. package/dist/mcp/stdio.js +16 -0
  650. package/dist/observability/analysis/contracts.d.ts +57 -0
  651. package/dist/observability/analysis/contracts.js +1 -0
  652. package/dist/observability/analysis/coverage-analyzer.d.ts +53 -0
  653. package/dist/observability/analysis/coverage-analyzer.js +306 -0
  654. package/dist/observability/analysis/gap-analyzer.d.ts +118 -0
  655. package/dist/observability/analysis/gap-analyzer.js +470 -0
  656. package/dist/observability/analysis/hedging-classifier.d.ts +34 -0
  657. package/dist/observability/contracts/experience.d.ts +651 -0
  658. package/dist/observability/contracts/experience.js +1 -0
  659. package/dist/observability/contracts/inbox.d.ts +181 -0
  660. package/dist/observability/contracts/inbox.js +1 -0
  661. package/dist/observability/contracts/index.d.ts +7 -0
  662. package/dist/observability/contracts/index.js +1 -0
  663. package/dist/observability/contracts/problem-patterns.d.ts +50 -0
  664. package/dist/observability/contracts/problem-patterns.js +1 -0
  665. package/dist/observability/contracts/review.d.ts +47 -0
  666. package/dist/observability/contracts/review.js +1 -0
  667. package/dist/observability/contracts/skill-chain-advisories.d.ts +8 -0
  668. package/dist/observability/contracts/skill-chain-advisories.js +1 -0
  669. package/dist/observability/contracts/skill-chain.d.ts +114 -0
  670. package/dist/observability/contracts/skill-chain.js +1 -0
  671. package/dist/observability/contracts/trace.d.ts +22 -0
  672. package/dist/observability/contracts/trace.js +1 -0
  673. package/dist/observability/conversation/catalog.d.ts +42 -0
  674. package/dist/observability/conversation/catalog.js +575 -0
  675. package/dist/observability/conversation/index-process.d.ts +1 -0
  676. package/dist/observability/conversation/index-process.js +31 -0
  677. package/dist/observability/conversation/knowledge-debugger.d.ts +7 -0
  678. package/dist/observability/conversation/knowledge-debugger.js +397 -0
  679. package/dist/observability/conversation/task-semantic-projection.d.ts +11 -0
  680. package/dist/observability/conversation/task-window.d.ts +10 -0
  681. package/dist/observability/conversation/task-window.js +57 -0
  682. package/dist/observability/conversation/turn-index.d.ts +3 -0
  683. package/dist/observability/conversation/turn-index.js +255 -0
  684. package/dist/observability/conversation/view-model.d.ts +5 -0
  685. package/dist/observability/conversation/view-model.js +100 -0
  686. package/dist/observability/experience/primitives.d.ts +11 -0
  687. package/dist/observability/experience/primitives.js +75 -0
  688. package/dist/observability/experience/report-codec.d.ts +33 -0
  689. package/dist/observability/experience/report-codec.js +235 -0
  690. package/dist/observability/experience/report-derivations.d.ts +35 -0
  691. package/dist/observability/experience/report-derivations.js +283 -0
  692. package/dist/observability/experience/report-reference-validator.d.ts +18 -0
  693. package/dist/observability/experience/report-reference-validator.js +596 -0
  694. package/dist/observability/experience/report-structure.d.ts +9 -0
  695. package/dist/observability/experience/report-structure.js +93 -0
  696. package/dist/observability/experience/report-value-guards.d.ts +65 -0
  697. package/dist/observability/experience/report-value-guards.js +1224 -0
  698. package/dist/observability/experience/review-checklist.d.ts +43 -0
  699. package/dist/observability/experience/review-checklist.js +630 -0
  700. package/dist/observability/experience/reviewer-report.d.ts +17 -0
  701. package/dist/observability/experience/reviewer-report.js +281 -0
  702. package/dist/observability/experience/session-story.d.ts +93 -0
  703. package/dist/observability/experience/session-story.js +1351 -0
  704. package/dist/observability/experience/text-signals.d.ts +7 -0
  705. package/dist/observability/experience/text-signals.js +30 -0
  706. package/dist/observability/experience/timeline.d.ts +29 -0
  707. package/dist/observability/experience/timeline.js +495 -0
  708. package/dist/observability/experience.d.ts +13 -43
  709. package/dist/observability/experience.js +177 -5378
  710. package/dist/observability/inbox/capture-coverage.d.ts +3 -0
  711. package/dist/observability/inbox/capture-coverage.js +34 -0
  712. package/dist/observability/inbox/explicit-capture.d.ts +50 -0
  713. package/dist/observability/inbox/explicit-capture.js +223 -0
  714. package/dist/observability/inbox/feedback-projection.d.ts +20 -0
  715. package/dist/observability/inbox/identity.d.ts +6 -0
  716. package/dist/observability/inbox/identity.js +44 -0
  717. package/dist/observability/inbox/index.d.ts +36 -0
  718. package/dist/observability/inbox/index.js +1339 -0
  719. package/dist/observability/inbox/paths.d.ts +10 -0
  720. package/dist/observability/inbox/paths.js +65 -0
  721. package/dist/observability/inbox/problem-patterns.d.ts +11 -0
  722. package/dist/observability/inbox/problem-patterns.js +246 -0
  723. package/dist/observability/inbox/resolved-review.d.ts +36 -0
  724. package/dist/observability/inbox/review-state.d.ts +25 -0
  725. package/dist/observability/inbox/review-state.js +352 -0
  726. package/dist/observability/inbox/source-record-archive.d.ts +14 -0
  727. package/dist/observability/inbox/source-record-archive.js +328 -0
  728. package/dist/observability/inbox/view-model.d.ts +44 -0
  729. package/dist/observability/inbox/view-model.js +186 -0
  730. package/dist/observability/prompts/document.js +21 -0
  731. package/dist/observability/skill-health/advisories.d.ts +15 -0
  732. package/dist/observability/skill-health/analyzer.d.ts +129 -0
  733. package/dist/observability/skill-health/analyzer.js +328 -0
  734. package/dist/observability/skill-health/experience-frontmatter.d.ts +36 -0
  735. package/dist/observability/skill-health/experience-frontmatter.js +99 -0
  736. package/dist/observability/skill-health/report.d.ts +10 -0
  737. package/dist/observability/skill-health/report.js +620 -0
  738. package/dist/observability/skill-health/skill-chain.d.ts +7 -0
  739. package/dist/observability/skill-health/skill-chain.js +486 -0
  740. package/dist/observability/soft-standards/llm-extractor.js +1 -1
  741. package/dist/observability/soft-standards/runtime-evaluator.d.ts +1 -1
  742. package/dist/observability/soft-standards/skill-standards-store.d.ts +1 -1
  743. package/dist/observability/soft-standards/skill-standards-store.js +4 -3
  744. package/dist/observability/soft-standards/types.d.ts +2 -2
  745. package/dist/observability/trace/adapters/codex/conversation-index.d.ts +92 -0
  746. package/dist/observability/trace/adapters/codex/conversation-index.js +600 -0
  747. package/dist/observability/trace/adapters/codex/tool-status.d.ts +16 -0
  748. package/dist/observability/trace/adapters/codex/tool-status.js +114 -0
  749. package/dist/observability/trace/adapters/codex/trace.d.ts +5 -0
  750. package/dist/observability/trace/adapters/codex/trace.js +1091 -0
  751. package/dist/observability/trace/attribution.d.ts +63 -0
  752. package/dist/observability/trace/attribution.js +397 -0
  753. package/dist/observability/trace/index.d.ts +26 -0
  754. package/dist/observability/trace/index.js +20 -0
  755. package/dist/observability/trace/ingestion.d.ts +9 -0
  756. package/dist/observability/trace/ingestion.js +80 -0
  757. package/dist/observability/trace/message-classification.d.ts +6 -0
  758. package/dist/observability/trace/message-classification.js +34 -0
  759. package/dist/observability/trace/projection.d.ts +5 -0
  760. package/dist/observability/trace/projection.js +20 -0
  761. package/dist/observability/trace/segmentation.d.ts +66 -0
  762. package/dist/observability/trace/segmentation.js +496 -0
  763. package/dist/observability/trace/source.d.ts +100 -0
  764. package/dist/observability/trace/source.js +1233 -0
  765. package/dist/observability/trace/tool-search.d.ts +8 -0
  766. package/dist/observability/trace/tool-search.js +160 -0
  767. package/dist/observability/trace/trace-ir.d.ts +187 -0
  768. package/dist/observability/trace/trace-ir.js +87 -0
  769. package/dist/observability/view-models/conversation.d.ts +51 -0
  770. package/dist/observability/view-models/conversation.js +1 -0
  771. package/dist/observability/view-models/index.d.ts +3 -0
  772. package/dist/observability/view-models/index.js +1 -0
  773. package/dist/observability/view-models/knowledge-debugger.d.ts +84 -0
  774. package/dist/observability/view-models/knowledge-debugger.js +1 -0
  775. package/dist/shared/content-hash.d.ts +1 -0
  776. package/dist/shared/content-hash.js +4 -0
  777. package/dist/shared/language.d.ts +2 -0
  778. package/dist/shared/language.js +1 -0
  779. package/dist/studio/application/index.d.ts +2 -0
  780. package/dist/studio/application/index.js +2 -0
  781. package/dist/studio/application/skill-index.d.ts +9 -0
  782. package/dist/studio/application/skill-index.js +347 -0
  783. package/dist/studio/application/skill-insights.d.ts +6 -0
  784. package/dist/studio/application/skill-insights.js +231 -0
  785. package/dist/studio/core-runs/catalog.d.ts +3 -0
  786. package/dist/studio/core-runs/catalog.js +15 -0
  787. package/dist/studio/core-runs/contracts.d.ts +227 -0
  788. package/dist/studio/core-runs/contracts.js +2 -0
  789. package/dist/studio/core-runs/index.d.ts +5 -0
  790. package/dist/studio/core-runs/index.js +5 -0
  791. package/dist/studio/core-runs/projection.d.ts +4 -0
  792. package/dist/studio/core-runs/projection.js +307 -0
  793. package/dist/studio/core-runs/renderer.d.ts +11 -0
  794. package/dist/studio/core-runs/renderer.js +414 -0
  795. package/dist/studio/core-runs/route-handler.d.ts +19 -0
  796. package/dist/studio/core-runs/route-handler.js +122 -0
  797. package/dist/studio/http/contracts.d.ts +28 -0
  798. package/dist/studio/http/contracts.js +1 -0
  799. package/dist/studio/http/errors.d.ts +1 -0
  800. package/dist/studio/http/errors.js +3 -0
  801. package/dist/studio/http/report-server.d.ts +4 -0
  802. package/dist/studio/http/report-server.js +106 -0
  803. package/dist/studio/http/request-errors.d.ts +8 -0
  804. package/dist/studio/http/request-errors.js +77 -0
  805. package/dist/studio/http/request-handler.d.ts +12 -0
  806. package/dist/studio/http/request-handler.js +137 -0
  807. package/dist/studio/http/routes/contracts.d.ts +14 -0
  808. package/dist/studio/http/routes/contracts.js +1 -0
  809. package/dist/studio/http/routes/conversations.d.ts +8 -0
  810. package/dist/studio/http/routes/conversations.js +220 -0
  811. package/dist/studio/http/routes/knowledge.d.ts +14 -0
  812. package/dist/studio/http/routes/knowledge.js +781 -0
  813. package/dist/studio/http/routes/observations.d.ts +13 -0
  814. package/dist/studio/http/routes/observations.js +193 -0
  815. package/dist/studio/index.d.ts +1 -0
  816. package/dist/studio/index.js +1 -0
  817. package/dist/studio/presentation/conversation-renderer.d.ts +17 -0
  818. package/dist/studio/presentation/conversation-renderer.js +526 -0
  819. package/dist/studio/presentation/doctor-detail-renderer.d.ts +10 -0
  820. package/dist/studio/presentation/knowledge-debugger-renderer.d.ts +9 -0
  821. package/dist/studio/presentation/knowledge-debugger-renderer.js +2393 -0
  822. package/dist/studio/presentation/layout.d.ts +16 -0
  823. package/dist/studio/presentation/layout.js +788 -0
  824. package/dist/studio/presentation/managed-history-renderer.d.ts +5 -0
  825. package/dist/studio/presentation/managed-history-renderer.js +333 -0
  826. package/dist/studio/presentation/observation-inbox/client-script.d.ts +2 -0
  827. package/dist/studio/presentation/observation-inbox/client-script.js +1795 -0
  828. package/dist/studio/presentation/observation-inbox/experience-workspace-renderer.d.ts +35 -0
  829. package/dist/studio/presentation/observation-inbox/experience-workspace-renderer.js +1799 -0
  830. package/dist/studio/presentation/observation-inbox/helpers.d.ts +13 -0
  831. package/dist/studio/presentation/observation-inbox/metric-renderer.d.ts +50 -0
  832. package/dist/studio/presentation/observation-inbox/metric-renderer.js +750 -0
  833. package/dist/studio/presentation/observation-inbox/page-renderer.d.ts +12 -0
  834. package/dist/studio/presentation/observation-inbox/page-renderer.js +275 -0
  835. package/dist/studio/presentation/observation-inbox/process-workspace-renderer.d.ts +52 -0
  836. package/dist/studio/presentation/observation-inbox/process-workspace-renderer.js +380 -0
  837. package/dist/studio/presentation/observation-inbox/review-renderer.d.ts +28 -0
  838. package/dist/studio/presentation/observation-inbox/review-renderer.js +323 -0
  839. package/dist/studio/presentation/observation-inbox/reviewer-report.d.ts +8 -0
  840. package/dist/studio/presentation/observation-inbox/reviewer-report.js +449 -0
  841. package/dist/studio/presentation/observation-inbox/signal-renderer.d.ts +20 -0
  842. package/dist/studio/presentation/observation-inbox/signal-renderer.js +133 -0
  843. package/dist/studio/presentation/observation-inbox/skill-chain-renderer.d.ts +17 -0
  844. package/dist/studio/presentation/observation-inbox/skill-chain-renderer.js +738 -0
  845. package/dist/studio/presentation/observation-inbox/timeline.d.ts +18 -0
  846. package/dist/studio/presentation/observation-inbox/timeline.js +772 -0
  847. package/dist/studio/presentation/observation-inbox-renderer.d.ts +4 -0
  848. package/dist/studio/presentation/observation-inbox-renderer.js +130 -0
  849. package/dist/studio/presentation/report-shell.d.ts +77 -0
  850. package/dist/studio/presentation/skill-detail-renderer.d.ts +12 -0
  851. package/dist/studio/presentation/skill-detail-renderer.js +71 -0
  852. package/dist/studio/presentation/skill-health-renderer.d.ts +19 -0
  853. package/dist/studio/presentation/skill-health-renderer.js +315 -0
  854. package/dist/studio/presentation/skill-list-renderer.d.ts +3 -0
  855. package/dist/studio/presentation/skill-list-renderer.js +36 -0
  856. package/dist/studio/presentation/trajectory-evidence.d.ts +8 -0
  857. package/dist/studio/presentation/trajectory-live.d.ts +43 -0
  858. package/dist/studio/presentation/trajectory-live.js +261 -0
  859. package/dist/studio/view-models/index.d.ts +2 -0
  860. package/dist/studio/view-models/index.js +1 -0
  861. package/dist/studio/view-models/insight.d.ts +68 -0
  862. package/dist/studio/view-models/insight.js +1 -0
  863. package/dist/studio/view-models/skill-index.d.ts +110 -0
  864. package/dist/studio/view-models/skill-index.js +1 -0
  865. package/package.json +52 -7
  866. package/dist/analysis/coverage-analyzer.d.ts +0 -57
  867. package/dist/analysis/coverage-analyzer.js +0 -324
  868. package/dist/analysis/failure-clusterer.d.ts +0 -95
  869. package/dist/analysis/failure-clusterer.js +0 -298
  870. package/dist/analysis/gap-analyzer.d.ts +0 -120
  871. package/dist/analysis/gap-analyzer.js +0 -480
  872. package/dist/analysis/hedging-classifier.d.ts +0 -33
  873. package/dist/analysis/report-diagnostics.d.ts +0 -40
  874. package/dist/analysis/report-diagnostics.js +0 -862
  875. package/dist/analysis/sample-diagnostics.d.ts +0 -84
  876. package/dist/analysis/sample-diagnostics.js +0 -457
  877. package/dist/analysis/saturation.d.ts +0 -92
  878. package/dist/analysis/saturation.js +0 -181
  879. package/dist/artifact-graph/doctor.d.ts +0 -21
  880. package/dist/artifact-graph/doctor.js +0 -577
  881. package/dist/artifact-graph/eval.d.ts +0 -16
  882. package/dist/artifact-graph/eval.js +0 -471
  883. package/dist/authoring/evolver.d.ts +0 -263
  884. package/dist/authoring/evolver.js +0 -1333
  885. package/dist/authoring/generator.d.ts +0 -99
  886. package/dist/authoring/generator.js +0 -1018
  887. package/dist/authoring/sample-fixer.d.ts +0 -54
  888. package/dist/authoring/sample-fixer.js +0 -297
  889. package/dist/cli/lib/run-tally.d.ts +0 -17
  890. package/dist/cli/lib/run-tally.js +0 -30
  891. package/dist/diagnosis/types.d.ts +0 -5
  892. package/dist/doctor/endpoint-rule.d.ts +0 -60
  893. package/dist/doctor/endpoint-rule.js +0 -382
  894. package/dist/doctor/fixer.d.ts +0 -11
  895. package/dist/doctor/fixer.js +0 -325
  896. package/dist/doctor/health/composer.d.ts +0 -18
  897. package/dist/doctor/health/composer.js +0 -407
  898. package/dist/doctor/health/dimension-spec.d.ts +0 -52
  899. package/dist/doctor/health/prompt-builder.d.ts +0 -2
  900. package/dist/doctor/health/prompt-builder.js +0 -1
  901. package/dist/doctor/index.d.ts +0 -18
  902. package/dist/doctor/index.js +0 -273
  903. package/dist/doctor/messages.d.ts +0 -20
  904. package/dist/doctor/preflight.d.ts +0 -31
  905. package/dist/doctor/preflight.js +0 -31
  906. package/dist/doctor/renderer.d.ts +0 -17
  907. package/dist/doctor/rules.d.ts +0 -32
  908. package/dist/doctor/rules.js +0 -290
  909. package/dist/eval-core/artifact-file-names.d.ts +0 -15
  910. package/dist/eval-core/artifact-file-names.js +0 -62
  911. package/dist/eval-core/artifact-index.d.ts +0 -102
  912. package/dist/eval-core/artifact-index.js +0 -336
  913. package/dist/eval-core/bootstrap.d.ts +0 -130
  914. package/dist/eval-core/bootstrap.js +0 -258
  915. package/dist/eval-core/cache.d.ts +0 -47
  916. package/dist/eval-core/cache.js +0 -205
  917. package/dist/eval-core/comparability.d.ts +0 -10
  918. package/dist/eval-core/comparability.js +0 -302
  919. package/dist/eval-core/default-dirs.d.ts +0 -34
  920. package/dist/eval-core/default-dirs.js +0 -36
  921. package/dist/eval-core/dependency-checker.d.ts +0 -36
  922. package/dist/eval-core/evaluation-execution.d.ts +0 -66
  923. package/dist/eval-core/evaluation-execution.js +0 -424
  924. package/dist/eval-core/evaluation-job.d.ts +0 -57
  925. package/dist/eval-core/evaluation-job.js +0 -121
  926. package/dist/eval-core/evaluation-reporting.d.ts +0 -48
  927. package/dist/eval-core/evaluation-reporting.js +0 -353
  928. package/dist/eval-core/execution-strategy.d.ts +0 -12
  929. package/dist/eval-core/execution-strategy.js +0 -174
  930. package/dist/eval-core/fact-checker.d.ts +0 -37
  931. package/dist/eval-core/fact-checker.js +0 -128
  932. package/dist/eval-core/holdout.d.ts +0 -66
  933. package/dist/eval-core/holdout.js +0 -119
  934. package/dist/eval-core/judge-independence.d.ts +0 -28
  935. package/dist/eval-core/judge-independence.js +0 -29
  936. package/dist/eval-core/layer-gates.d.ts +0 -16
  937. package/dist/eval-core/layer-gates.js +0 -41
  938. package/dist/eval-core/measurement-dirs.js +0 -82
  939. package/dist/eval-core/mock-hook.cjs +0 -271
  940. package/dist/eval-core/mocks-runtime.d.ts +0 -99
  941. package/dist/eval-core/mocks-runtime.js +0 -617
  942. package/dist/eval-core/report-document.d.ts +0 -12
  943. package/dist/eval-core/report-document.js +0 -1157
  944. package/dist/eval-core/report-extensions.d.ts +0 -4
  945. package/dist/eval-core/report-extensions.js +0 -500
  946. package/dist/eval-core/report-file-migration.d.ts +0 -10
  947. package/dist/eval-core/report-file-migration.js +0 -95
  948. package/dist/eval-core/resume-compatibility.d.ts +0 -32
  949. package/dist/eval-core/resume-compatibility.js +0 -142
  950. package/dist/eval-core/sample-fingerprint.d.ts +0 -12
  951. package/dist/eval-core/sample-fingerprint.js +0 -193
  952. package/dist/eval-core/schema.d.ts +0 -29
  953. package/dist/eval-core/schema.js +0 -365
  954. package/dist/eval-core/statistics.d.ts +0 -85
  955. package/dist/eval-core/statistics.js +0 -209
  956. package/dist/eval-core/task-planner.d.ts +0 -11
  957. package/dist/eval-core/task-planner.js +0 -72
  958. package/dist/eval-core/verdict.d.ts +0 -179
  959. package/dist/eval-core/verdict.js +0 -669
  960. package/dist/eval-workflows/batch-evaluation-workflow.d.ts +0 -146
  961. package/dist/eval-workflows/batch-evaluation-workflow.js +0 -259
  962. package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.d.ts +0 -26
  963. package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.js +0 -105
  964. package/dist/eval-workflows/evaluation-pipeline/report-finalize.d.ts +0 -27
  965. package/dist/eval-workflows/evaluation-pipeline/report-finalize.js +0 -69
  966. package/dist/eval-workflows/evaluation-pipeline/run-state.d.ts +0 -62
  967. package/dist/eval-workflows/evaluation-pipeline/run-state.js +0 -91
  968. package/dist/eval-workflows/evaluation-pipeline/test-set-hash.d.ts +0 -21
  969. package/dist/eval-workflows/evaluation-pipeline/test-set-hash.js +0 -52
  970. package/dist/eval-workflows/evaluation-pipeline.d.ts +0 -99
  971. package/dist/eval-workflows/evaluation-pipeline.js +0 -188
  972. package/dist/eval-workflows/evaluation-preparation.d.ts +0 -56
  973. package/dist/eval-workflows/evaluation-preparation.js +0 -83
  974. package/dist/eval-workflows/run-evaluation.d.ts +0 -152
  975. package/dist/eval-workflows/run-evaluation.js +0 -556
  976. package/dist/grading/assertions.d.ts +0 -38
  977. package/dist/grading/assertions.js +0 -475
  978. package/dist/grading/diagnostic.d.ts +0 -46
  979. package/dist/grading/diagnostic.js +0 -472
  980. package/dist/grading/gold-cli.d.ts +0 -84
  981. package/dist/grading/gold-cli.js +0 -246
  982. package/dist/grading/human-gold.d.ts +0 -103
  983. package/dist/grading/human-gold.js +0 -189
  984. package/dist/grading/index.d.ts +0 -60
  985. package/dist/grading/index.js +0 -150
  986. package/dist/grading/judge.d.ts +0 -67
  987. package/dist/grading/judge.js +0 -405
  988. package/dist/grading/layered-scores.d.ts +0 -26
  989. package/dist/grading/layered-scores.js +0 -87
  990. package/dist/inputs/content-hash.d.ts +0 -28
  991. package/dist/inputs/content-hash.js +0 -106
  992. package/dist/inputs/eval-config.d.ts +0 -12
  993. package/dist/inputs/eval-config.js +0 -295
  994. package/dist/inputs/load-samples.d.ts +0 -39
  995. package/dist/inputs/load-samples.js +0 -298
  996. package/dist/inputs/materialize-copy.js +0 -193
  997. package/dist/inputs/mcp-resolver.d.ts +0 -49
  998. package/dist/inputs/mcp-resolver.js +0 -309
  999. package/dist/inputs/sample-document.d.ts +0 -11
  1000. package/dist/inputs/sample-document.js +0 -96
  1001. package/dist/inputs/sample-locator.d.ts +0 -23
  1002. package/dist/inputs/sample-locator.js +0 -195
  1003. package/dist/inputs/skill-loader.d.ts +0 -190
  1004. package/dist/inputs/skill-loader.js +0 -852
  1005. package/dist/inputs/url-fetcher.d.ts +0 -18
  1006. package/dist/inputs/url-fetcher.js +0 -240
  1007. package/dist/managed/evidence.d.ts +0 -24
  1008. package/dist/managed/evidence.js +0 -155
  1009. package/dist/managed/index.d.ts +0 -12
  1010. package/dist/managed/index.js +0 -12
  1011. package/dist/managed/list-view.d.ts +0 -72
  1012. package/dist/managed/list-view.js +0 -78
  1013. package/dist/managed/observe-feedback.d.ts +0 -60
  1014. package/dist/managed/promote-gate.d.ts +0 -40
  1015. package/dist/managed/promote-gate.js +0 -37
  1016. package/dist/managed/source-probe.d.ts +0 -15
  1017. package/dist/managed/source-probe.js +0 -129
  1018. package/dist/managed/store.d.ts +0 -142
  1019. package/dist/managed/store.js +0 -595
  1020. package/dist/managed/version-scores.d.ts +0 -33
  1021. package/dist/managed/version-scores.js +0 -70
  1022. package/dist/observability/codex-conversation-index.d.ts +0 -92
  1023. package/dist/observability/codex-conversation-index.js +0 -600
  1024. package/dist/observability/codex-tool-status.d.ts +0 -16
  1025. package/dist/observability/codex-tool-status.js +0 -114
  1026. package/dist/observability/codex-trace-adapter.d.ts +0 -5
  1027. package/dist/observability/codex-trace-adapter.js +0 -1091
  1028. package/dist/observability/conversation-catalog.d.ts +0 -38
  1029. package/dist/observability/conversation-catalog.js +0 -575
  1030. package/dist/observability/conversation-index-process.js +0 -31
  1031. package/dist/observability/conversation-view-model.d.ts +0 -5
  1032. package/dist/observability/conversation-view-model.js +0 -100
  1033. package/dist/observability/experience-frontmatter.d.ts +0 -36
  1034. package/dist/observability/experience-frontmatter.js +0 -99
  1035. package/dist/observability/feedback-projection.d.ts +0 -20
  1036. package/dist/observability/inbox-view-model.d.ts +0 -43
  1037. package/dist/observability/inbox-view-model.js +0 -185
  1038. package/dist/observability/inbox.d.ts +0 -33
  1039. package/dist/observability/inbox.js +0 -1343
  1040. package/dist/observability/knowledge-debugger.d.ts +0 -4
  1041. package/dist/observability/knowledge-debugger.js +0 -397
  1042. package/dist/observability/problem-patterns.d.ts +0 -11
  1043. package/dist/observability/problem-patterns.js +0 -245
  1044. package/dist/observability/resolved-review.d.ts +0 -36
  1045. package/dist/observability/review-state.d.ts +0 -25
  1046. package/dist/observability/review-state.js +0 -351
  1047. package/dist/observability/skill-chain-advisories.d.ts +0 -15
  1048. package/dist/observability/skill-chain.d.ts +0 -6
  1049. package/dist/observability/skill-chain.js +0 -486
  1050. package/dist/observability/skill-health-analyzer.d.ts +0 -128
  1051. package/dist/observability/skill-health-analyzer.js +0 -328
  1052. package/dist/observability/skill-health-report.d.ts +0 -10
  1053. package/dist/observability/skill-health-report.js +0 -620
  1054. package/dist/observability/source-record-archive.d.ts +0 -13
  1055. package/dist/observability/source-record-archive.js +0 -324
  1056. package/dist/observability/task-semantic-projection.d.ts +0 -11
  1057. package/dist/observability/task-window.d.ts +0 -9
  1058. package/dist/observability/task-window.js +0 -57
  1059. package/dist/observability/text-signals.d.ts +0 -13
  1060. package/dist/observability/text-signals.js +0 -115
  1061. package/dist/observability/trace-adapter.d.ts +0 -27
  1062. package/dist/observability/trace-adapter.js +0 -22
  1063. package/dist/observability/trace-attribution.d.ts +0 -63
  1064. package/dist/observability/trace-attribution.js +0 -397
  1065. package/dist/observability/trace-ingestion.d.ts +0 -9
  1066. package/dist/observability/trace-ingestion.js +0 -80
  1067. package/dist/observability/trace-ir.d.ts +0 -184
  1068. package/dist/observability/trace-ir.js +0 -87
  1069. package/dist/observability/trace-segmenter.d.ts +0 -64
  1070. package/dist/observability/trace-segmenter.js +0 -502
  1071. package/dist/observability/trace-source.d.ts +0 -100
  1072. package/dist/observability/trace-source.js +0 -1232
  1073. package/dist/observability/turn-index.d.ts +0 -3
  1074. package/dist/observability/turn-index.js +0 -251
  1075. package/dist/renderer/conversation-renderer.d.ts +0 -16
  1076. package/dist/renderer/conversation-renderer.js +0 -512
  1077. package/dist/renderer/doctor-detail-renderer.d.ts +0 -9
  1078. package/dist/renderer/html-renderer.d.ts +0 -10
  1079. package/dist/renderer/html-renderer.js +0 -706
  1080. package/dist/renderer/knowledge-debugger-renderer.d.ts +0 -9
  1081. package/dist/renderer/knowledge-debugger-renderer.js +0 -2388
  1082. package/dist/renderer/layout.d.ts +0 -13
  1083. package/dist/renderer/layout.js +0 -788
  1084. package/dist/renderer/managed-history-renderer.d.ts +0 -5
  1085. package/dist/renderer/managed-history-renderer.js +0 -437
  1086. package/dist/renderer/observation-inbox/helpers.d.ts +0 -13
  1087. package/dist/renderer/observation-inbox-renderer.d.ts +0 -4
  1088. package/dist/renderer/observation-inbox-renderer.js +0 -7326
  1089. package/dist/renderer/report-shell.d.ts +0 -77
  1090. package/dist/renderer/skill-detail-renderer.d.ts +0 -12
  1091. package/dist/renderer/skill-detail-renderer.js +0 -3115
  1092. package/dist/renderer/skill-health-renderer.d.ts +0 -19
  1093. package/dist/renderer/skill-health-renderer.js +0 -315
  1094. package/dist/renderer/skill-list-renderer.d.ts +0 -2
  1095. package/dist/renderer/skill-list-renderer.js +0 -394
  1096. package/dist/renderer/summary.d.ts +0 -67
  1097. package/dist/renderer/summary.js +0 -2094
  1098. package/dist/renderer/table.d.ts +0 -2
  1099. package/dist/renderer/table.js +0 -257
  1100. package/dist/renderer/test-view.d.ts +0 -67
  1101. package/dist/renderer/test-view.js +0 -1190
  1102. package/dist/renderer/trajectory-evidence.d.ts +0 -8
  1103. package/dist/renderer/trajectory-live.d.ts +0 -42
  1104. package/dist/renderer/trajectory-live.js +0 -258
  1105. package/dist/renderer/trends.d.ts +0 -5
  1106. package/dist/renderer/trends.js +0 -130
  1107. package/dist/server/indexed-report-store.d.ts +0 -8
  1108. package/dist/server/indexed-report-store.js +0 -126
  1109. package/dist/server/job-store.d.ts +0 -2
  1110. package/dist/server/job-store.js +0 -103
  1111. package/dist/server/report-server.d.ts +0 -39
  1112. package/dist/server/report-server.js +0 -1610
  1113. package/dist/server/report-store.d.ts +0 -51
  1114. package/dist/server/report-store.js +0 -281
  1115. package/dist/server/skill-index.d.ts +0 -25
  1116. package/dist/server/skill-index.js +0 -955
  1117. package/dist/server/skill-insights.d.ts +0 -31
  1118. package/dist/server/skill-insights.js +0 -854
  1119. package/dist/shared/artifact-graph.d.ts +0 -3
  1120. package/dist/shared/artifact-graph.js +0 -224
  1121. package/dist/shared/assertion-types.d.ts +0 -8
  1122. package/dist/shared/diagnosis-schema.d.ts +0 -9
  1123. package/dist/shared/diagnosis-schema.js +0 -181
  1124. package/dist/shared/doctor-report.d.ts +0 -3
  1125. package/dist/shared/doctor-report.js +0 -103
  1126. package/dist/shared/evaluation-job.d.ts +0 -6
  1127. package/dist/shared/evaluation-job.js +0 -217
  1128. package/dist/shared/executor-result.d.ts +0 -17
  1129. package/dist/shared/executor-result.js +0 -221
  1130. package/dist/shared/hard-rules.d.ts +0 -41
  1131. package/dist/shared/llm-prompts/debias-instructions.js +0 -44
  1132. package/dist/shared/llm-prompts/index.js +0 -21
  1133. package/dist/shared/llm-prompts/judge-prompts.d.ts +0 -30
  1134. package/dist/shared/llm-prompts/judge-prompts.js +0 -205
  1135. package/dist/shared/llm-prompts/registry.d.ts +0 -27
  1136. package/dist/shared/llm-prompts/registry.js +0 -70
  1137. package/dist/shared/llm-prompts/skill-health-merge.d.ts +0 -22
  1138. package/dist/shared/llm-prompts/skill-health.d.ts +0 -21
  1139. package/dist/shared/sample-contract.d.ts +0 -4
  1140. package/dist/shared/sample-contract.js +0 -367
  1141. package/dist/shared/tool-call-status.d.ts +0 -8
  1142. package/dist/shared/tool-call-status.js +0 -28
  1143. package/dist/shared/tool-search.d.ts +0 -8
  1144. package/dist/shared/tool-search.js +0 -160
  1145. package/dist/shared/trace-projection.d.ts +0 -5
  1146. package/dist/shared/trace-projection.js +0 -20
  1147. package/dist/shared/trace-source-kind.d.ts +0 -3
  1148. package/dist/shared/trace-source-kind.js +0 -12
  1149. package/dist/types/artifact-graph.d.ts +0 -93
  1150. package/dist/types/dependencies.d.ts +0 -22
  1151. package/dist/types/doctor.d.ts +0 -202
  1152. package/dist/types/doctor.js +0 -6
  1153. package/dist/types/eval.d.ts +0 -413
  1154. package/dist/types/executor.d.ts +0 -191
  1155. package/dist/types/index.d.ts +0 -14
  1156. package/dist/types/index.js +0 -14
  1157. package/dist/types/judge.d.ts +0 -204
  1158. package/dist/types/judge.js +0 -3
  1159. package/dist/types/managed.d.ts +0 -164
  1160. package/dist/types/observability.d.ts +0 -1199
  1161. package/dist/types/observability.js +0 -13
  1162. package/dist/types/report.d.ts +0 -704
  1163. package/dist/types/shared.d.ts +0 -1
  1164. package/dist/types/skill-index.d.ts +0 -206
  1165. package/dist/types/storage.d.ts +0 -20
  1166. package/dist/types/trace.d.ts +0 -2
  1167. /package/dist/{types/diagnosis.d.ts → diagnosis/contracts.d.ts} +0 -0
  1168. /package/dist/{observability/conversation-index-process.d.ts → diagnosis/contracts.js} +0 -0
  1169. /package/dist/diagnosis/{types.js → lifecycle.js} +0 -0
  1170. /package/dist/{types/artifact-graph.js → eval-core/engine/types.js} +0 -0
  1171. /package/dist/{grading/gold-dataset.d.ts → eval-workflows/gold/dataset.d.ts} +0 -0
  1172. /package/dist/{grading/gold-dataset.js → eval-workflows/gold/dataset.js} +0 -0
  1173. /package/dist/{shared → eval-workflows/inputs}/assertion-types.js +0 -0
  1174. /package/dist/{types/dependencies.js → eval-workflows/inputs/contracts/assertion-kind.js} +0 -0
  1175. /package/dist/{types/diagnosis.js → eval-workflows/inputs/contracts/assertion.js} +0 -0
  1176. /package/dist/{types/eval.js → eval-workflows/inputs/contracts/config.js} +0 -0
  1177. /package/dist/{types/executor.js → eval-workflows/inputs/contracts/index.js} +0 -0
  1178. /package/dist/{types/managed.js → eval-workflows/inputs/contracts/sample.js} +0 -0
  1179. /package/dist/{types/report.js → eval-workflows/inputs/contracts/variant.js} +0 -0
  1180. /package/dist/{inputs → eval-workflows/inputs}/materialize-copy.d.ts +0 -0
  1181. /package/dist/{inputs → eval-workflows/inputs}/source-resolver.d.ts +0 -0
  1182. /package/dist/{inputs → eval-workflows/inputs}/source-resolver.js +0 -0
  1183. /package/dist/{types/shared.js → eval-workflows/instruments/contracts/config.js} +0 -0
  1184. /package/dist/{types/skill-index.js → eval-workflows/instruments/contracts/index.js} +0 -0
  1185. /package/dist/{types/storage.js → eval-workflows/instruments/contracts/result.js} +0 -0
  1186. /package/dist/{shared/llm-prompts → eval-workflows/instruments/prompts}/debias-instructions.d.ts +0 -0
  1187. /package/dist/{types/trace.js → evidence/graph/contracts.js} +0 -0
  1188. /package/dist/{eval-core/measurement-dirs.d.ts → evidence/storage/directories.d.ts} +0 -0
  1189. /package/dist/{shared → executors/core}/token-usage.d.ts +0 -0
  1190. /package/dist/{shared → executors/core}/token-usage.js +0 -0
  1191. /package/dist/{shared → executors/core}/tool-identity.d.ts +0 -0
  1192. /package/dist/{shared → executors/core}/tool-identity.js +0 -0
  1193. /package/dist/{eval-core/dependency-checker.js → executors/preflight/dependencies.js} +0 -0
  1194. /package/dist/{doctor → knowledge-artifacts/doctor}/health/builtin-dimensions.d.ts +0 -0
  1195. /package/dist/{doctor → knowledge-artifacts/doctor}/health/builtin-dimensions.js +0 -0
  1196. /package/dist/{doctor → knowledge-artifacts/doctor}/health/consensus.d.ts +0 -0
  1197. /package/dist/{doctor → knowledge-artifacts/doctor}/health/consensus.js +0 -0
  1198. /package/dist/{doctor → knowledge-artifacts/doctor}/health/dimension-registry.d.ts +0 -0
  1199. /package/dist/{doctor → knowledge-artifacts/doctor}/health/dimension-registry.js +0 -0
  1200. /package/dist/{doctor → knowledge-artifacts/doctor}/health/dimension-spec.js +0 -0
  1201. /package/dist/{doctor → knowledge-artifacts/doctor}/health/load-custom-dimensions.d.ts +0 -0
  1202. /package/dist/{doctor → knowledge-artifacts/doctor}/health/load-custom-dimensions.js +0 -0
  1203. /package/dist/{shared/llm-prompts/skill-health-merge.js → knowledge-artifacts/doctor/health/merge-prompt.js} +0 -0
  1204. /package/dist/{doctor → knowledge-artifacts/doctor}/health/parser.d.ts +0 -0
  1205. /package/dist/{doctor → knowledge-artifacts/doctor}/health/parser.js +0 -0
  1206. /package/dist/{shared/llm-prompts/skill-health.js → knowledge-artifacts/doctor/health/prompt-builder.js} +0 -0
  1207. /package/dist/{doctor → knowledge-artifacts/doctor}/health/register.d.ts +0 -0
  1208. /package/dist/{doctor → knowledge-artifacts/doctor}/health/register.js +0 -0
  1209. /package/dist/{doctor → knowledge-artifacts/doctor}/messages.js +0 -0
  1210. /package/dist/{doctor → knowledge-artifacts/doctor}/renderer.js +0 -0
  1211. /package/dist/{managed → knowledge-artifacts/governance}/list-query.d.ts +0 -0
  1212. /package/dist/{managed → knowledge-artifacts/governance}/list-query.js +0 -0
  1213. /package/dist/{managed → knowledge-artifacts/governance}/observe-feedback.js +0 -0
  1214. /package/dist/{shared → knowledge-artifacts/skills}/hard-rules.js +0 -0
  1215. /package/dist/{analysis → observability/analysis}/hedging-classifier.js +0 -0
  1216. /package/dist/observability/{polling-subscription-hub.d.ts → conversation/polling-subscription-hub.d.ts} +0 -0
  1217. /package/dist/observability/{polling-subscription-hub.js → conversation/polling-subscription-hub.js} +0 -0
  1218. /package/dist/observability/{task-semantic-projection.js → conversation/task-semantic-projection.js} +0 -0
  1219. /package/dist/observability/{feedback-matchers.d.ts → inbox/feedback-matchers.d.ts} +0 -0
  1220. /package/dist/observability/{feedback-matchers.js → inbox/feedback-matchers.js} +0 -0
  1221. /package/dist/observability/{feedback-projection.js → inbox/feedback-projection.js} +0 -0
  1222. /package/dist/observability/{resolved-review.js → inbox/resolved-review.js} +0 -0
  1223. /package/dist/{shared/llm-prompts/index.d.ts → observability/prompts/document.d.ts} +0 -0
  1224. /package/dist/observability/{skill-chain-advisories.js → skill-health/advisories.js} +0 -0
  1225. /package/dist/observability/{codex-exec-command.d.ts → trace/adapters/codex/exec-command.d.ts} +0 -0
  1226. /package/dist/observability/{codex-exec-command.js → trace/adapters/codex/exec-command.js} +0 -0
  1227. /package/dist/observability/{codex-protocol.d.ts → trace/adapters/codex/protocol.d.ts} +0 -0
  1228. /package/dist/observability/{codex-protocol.js → trace/adapters/codex/protocol.js} +0 -0
  1229. /package/dist/observability/{trace-session-index.d.ts → trace/session-index.d.ts} +0 -0
  1230. /package/dist/observability/{trace-session-index.js → trace/session-index.js} +0 -0
  1231. /package/dist/{util/safe-slice.d.ts → shared/json-safe-truncation.d.ts} +0 -0
  1232. /package/dist/{util/safe-slice.js → shared/json-safe-truncation.js} +0 -0
  1233. /package/dist/{renderer → studio/presentation}/doctor-detail-renderer.js +0 -0
  1234. /package/dist/{renderer → studio/presentation}/icons.d.ts +0 -0
  1235. /package/dist/{renderer → studio/presentation}/icons.js +0 -0
  1236. /package/dist/{renderer → studio/presentation}/inline-markdown.d.ts +0 -0
  1237. /package/dist/{renderer → studio/presentation}/inline-markdown.js +0 -0
  1238. /package/dist/{renderer → studio/presentation}/observation-inbox/helpers.js +0 -0
  1239. /package/dist/{renderer → studio/presentation}/observation-inbox/styles.d.ts +0 -0
  1240. /package/dist/{renderer → studio/presentation}/observation-inbox/styles.js +0 -0
  1241. /package/dist/{renderer → studio/presentation}/report-shell.js +0 -0
  1242. /package/dist/{renderer → studio/presentation}/trajectory-evidence.js +0 -0
  1243. /package/dist/{renderer → studio/presentation}/trajectory-routing.d.ts +0 -0
  1244. /package/dist/{renderer → studio/presentation}/trajectory-routing.js +0 -0
@@ -0,0 +1,352 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { existsSync, readFileSync, } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { writeJsonFileAtomic } from '../../shared/atomic-json.js';
5
+ import { withFileLock } from '../../shared/file-lock.js';
6
+ import { normalizeRfc3339Timestamp } from '../../shared/timestamp.js';
7
+ import { resolveObservationsDir } from './paths.js';
8
+ export class ObservationReviewStateValidationError extends Error {
9
+ name = 'ObservationReviewStateValidationError';
10
+ }
11
+ export function observationReviewStateKey(targetType, targetId) {
12
+ return `${targetType}:${targetId}`;
13
+ }
14
+ export function observationMetricScopeFor(metricKey) {
15
+ return metricKey === 'user_correction'
16
+ || metricKey === 'user_interruption'
17
+ || metricKey === 'user_follow_up'
18
+ || metricKey === 'hard_rule'
19
+ || metricKey === 'user_goal_shift'
20
+ ? 'skill_segment'
21
+ : 'message';
22
+ }
23
+ export function observationMetricAnnotationTargetId(ref, metricKey) {
24
+ const hasStableTraceRef = Boolean(ref.traceId
25
+ || ref.sourceTrace
26
+ || ref.sessionId
27
+ || ref.messageIndex !== undefined
28
+ || ref.messageUuid
29
+ || ref.callInstanceId
30
+ || ref.toolUseId);
31
+ const scope = observationMetricScopeFor(metricKey);
32
+ const stable = [
33
+ metricKey,
34
+ ...(scope === 'skill_segment' ? [scope, ref.metricScopeId ?? ''] : []),
35
+ ref.traceId ?? '',
36
+ ref.sourceTrace ?? '',
37
+ ref.sessionId ?? '',
38
+ ref.messageIndex === undefined ? '' : String(ref.messageIndex),
39
+ ref.messageUuid ?? '',
40
+ ref.callInstanceId ?? '',
41
+ ref.toolUseId ?? '',
42
+ hasStableTraceRef ? '' : ref.id ?? '',
43
+ ].join('\u0000');
44
+ return `metric:${metricKey}:${createHash('sha256').update(stable).digest('hex').slice(0, 16)}`;
45
+ }
46
+ export function observationMetricAnnotationVerdict(state, ref, metricKey) {
47
+ const entry = observationMetricAnnotationEntry(state, ref, metricKey);
48
+ return entry?.verdict === 'confirmed' || entry?.verdict === 'rejected'
49
+ ? entry.verdict
50
+ : undefined;
51
+ }
52
+ export function observationMetricAnnotationEntry(state, ref, metricKey) {
53
+ if (!state)
54
+ return undefined;
55
+ const candidates = [
56
+ ref,
57
+ ...(ref.callInstanceId ? [{ ...ref, callInstanceId: undefined }] : []),
58
+ ...(ref.traceId ? [{ ...ref, traceId: undefined }] : []),
59
+ ...(ref.traceId && ref.callInstanceId
60
+ ? [{ ...ref, traceId: undefined, callInstanceId: undefined }]
61
+ : []),
62
+ ];
63
+ const seen = new Set();
64
+ for (const candidate of candidates) {
65
+ const targetId = observationMetricAnnotationTargetId(candidate, metricKey);
66
+ if (seen.has(targetId))
67
+ continue;
68
+ seen.add(targetId);
69
+ const entry = state.entries[observationReviewStateKey('evidence_metric', targetId)];
70
+ if (entry)
71
+ return entry;
72
+ }
73
+ return undefined;
74
+ }
75
+ export function observationReviewStatePath(observationsDir) {
76
+ return join(observationsDir, 'review-state.json');
77
+ }
78
+ const OBSERVATION_REVIEW_STATE_SCHEMA_VERSION = 2;
79
+ export function emptyObservationReviewState(now = new Date().toISOString()) {
80
+ const updatedAt = normalizedTimestamp(now);
81
+ if (!updatedAt)
82
+ throw new ObservationReviewStateValidationError('invalid updatedAt');
83
+ return {
84
+ kind: 'observe-review-state',
85
+ schemaVersion: OBSERVATION_REVIEW_STATE_SCHEMA_VERSION,
86
+ updatedAt,
87
+ entries: {},
88
+ };
89
+ }
90
+ export function loadObservationReviewState(observationsDir) {
91
+ const path = observationReviewStatePath(resolveObservationsDir(observationsDir));
92
+ if (!existsSync(path))
93
+ return emptyObservationReviewState();
94
+ let parsed;
95
+ try {
96
+ parsed = JSON.parse(readFileSync(path, 'utf-8'));
97
+ }
98
+ catch (cause) {
99
+ throw new Error(`无法读取观测复核状态:${path}`, { cause });
100
+ }
101
+ const normalized = normalizeObservationReviewState(parsed);
102
+ if (!normalized)
103
+ throw new Error(`观测复核状态格式无效:${path}`);
104
+ return normalized;
105
+ }
106
+ export function updateObservationReviewState(observationsDir, update, now) {
107
+ assertReviewStateUpdate(update);
108
+ const path = observationReviewStatePath(observationsDir);
109
+ return withFileLock(`${path}.lock`, () => {
110
+ const reviewedAt = normalizedTimestamp(now ?? new Date().toISOString());
111
+ if (!reviewedAt) {
112
+ throw new ObservationReviewStateValidationError('invalid reviewedAt');
113
+ }
114
+ const hadPersistedState = existsSync(path);
115
+ const state = loadObservationReviewState(observationsDir);
116
+ if (hadPersistedState && reviewedAt < state.updatedAt) {
117
+ throw new ObservationReviewStateValidationError('reviewedAt cannot precede state updatedAt');
118
+ }
119
+ const key = observationReviewStateKey(update.targetType, update.targetId);
120
+ state.entries[key] = {
121
+ targetType: update.targetType,
122
+ targetId: update.targetId,
123
+ verdict: update.verdict,
124
+ reviewedAt,
125
+ ...(update.note ? { note: update.note.slice(0, 500) } : {}),
126
+ ...(update.reason ? { reason: update.reason.slice(0, 500) } : {}),
127
+ ...(update.metricKey ? { metricKey: update.metricKey } : {}),
128
+ ...(update.metricKey ? {
129
+ metricScope: update.metricScope ?? observationMetricScopeFor(update.metricKey),
130
+ } : {}),
131
+ ...(update.metricScopeId ? { metricScopeId: update.metricScopeId.slice(0, 200) } : {}),
132
+ ...(update.traceId ? { traceId: update.traceId } : {}),
133
+ ...(update.sourceTrace ? { sourceTrace: update.sourceTrace } : {}),
134
+ ...(update.sessionId ? { sessionId: update.sessionId } : {}),
135
+ ...(update.messageIndex !== undefined ? { messageIndex: update.messageIndex } : {}),
136
+ ...(update.messageUuid ? { messageUuid: update.messageUuid } : {}),
137
+ ...(update.callInstanceId ? { callInstanceId: update.callInstanceId } : {}),
138
+ ...(update.toolUseId ? { toolUseId: update.toolUseId } : {}),
139
+ ...(update.snippet ? { snippet: update.snippet.slice(0, 500) } : {}),
140
+ };
141
+ state.updatedAt = reviewedAt;
142
+ writeObservationReviewState(observationsDir, state);
143
+ return state;
144
+ }, { label: 'observation review state' });
145
+ }
146
+ function normalizeObservationReviewState(value) {
147
+ if (!value || typeof value !== 'object')
148
+ return null;
149
+ const parsed = value;
150
+ const kind = parsed.kind === 'observe-review-state' ? parsed.kind : null;
151
+ if (!kind)
152
+ return null;
153
+ if (parsed.schemaVersion !== OBSERVATION_REVIEW_STATE_SCHEMA_VERSION)
154
+ return null;
155
+ if (!parsed.entries || typeof parsed.entries !== 'object' || Array.isArray(parsed.entries))
156
+ return null;
157
+ const updatedAt = normalizedTimestamp(parsed.updatedAt);
158
+ if (!updatedAt)
159
+ return null;
160
+ const entries = {};
161
+ for (const [key, rawEntry] of Object.entries(parsed.entries)) {
162
+ const entry = normalizeReviewStateEntry(rawEntry);
163
+ if (!entry || key !== observationReviewStateKey(entry.targetType, entry.targetId))
164
+ return null;
165
+ entries[key] = entry;
166
+ }
167
+ if (Object.values(entries).some((entry) => entry.reviewedAt > updatedAt))
168
+ return null;
169
+ return {
170
+ kind: 'observe-review-state',
171
+ schemaVersion: OBSERVATION_REVIEW_STATE_SCHEMA_VERSION,
172
+ updatedAt,
173
+ entries,
174
+ };
175
+ }
176
+ export function deleteObservationReviewState(observationsDir, targetType, targetId, now) {
177
+ if (!isReviewTargetType(targetType))
178
+ throw new ObservationReviewStateValidationError('invalid review targetType');
179
+ if (typeof targetId !== 'string' || targetId.trim() === '')
180
+ throw new ObservationReviewStateValidationError('invalid review targetId');
181
+ const path = observationReviewStatePath(observationsDir);
182
+ return withFileLock(`${path}.lock`, () => {
183
+ const updatedAt = normalizedTimestamp(now ?? new Date().toISOString());
184
+ if (!updatedAt) {
185
+ throw new ObservationReviewStateValidationError('invalid updatedAt');
186
+ }
187
+ const hadPersistedState = existsSync(path);
188
+ const state = loadObservationReviewState(observationsDir);
189
+ if (hadPersistedState && updatedAt < state.updatedAt) {
190
+ throw new ObservationReviewStateValidationError('updatedAt cannot precede state updatedAt');
191
+ }
192
+ const key = observationReviewStateKey(targetType, targetId);
193
+ delete state.entries[key];
194
+ state.updatedAt = updatedAt;
195
+ writeObservationReviewState(observationsDir, state);
196
+ return state;
197
+ }, { label: 'observation review state' });
198
+ }
199
+ function assertReviewStateUpdate(value) {
200
+ if (!isReviewTargetType(value.targetType))
201
+ throw new ObservationReviewStateValidationError('invalid review targetType');
202
+ if (typeof value.targetId !== 'string' || value.targetId.trim() === '')
203
+ throw new ObservationReviewStateValidationError('invalid review targetId');
204
+ if (!isReviewVerdict(value.verdict))
205
+ throw new ObservationReviewStateValidationError('invalid review verdict');
206
+ const optionalStrings = [
207
+ value.note,
208
+ value.reason,
209
+ value.metricScopeId,
210
+ value.traceId,
211
+ value.sourceTrace,
212
+ value.sessionId,
213
+ value.messageUuid,
214
+ value.callInstanceId,
215
+ value.toolUseId,
216
+ value.snippet,
217
+ ];
218
+ if (!optionalStrings.every(optionalString))
219
+ throw new ObservationReviewStateValidationError('invalid review metadata');
220
+ if (value.messageIndex !== undefined
221
+ && (!Number.isSafeInteger(value.messageIndex) || value.messageIndex < 0))
222
+ throw new ObservationReviewStateValidationError('invalid messageIndex');
223
+ if (value.targetType === 'evidence_metric') {
224
+ if (!isObservationMetricKey(value.metricKey))
225
+ throw new ObservationReviewStateValidationError('invalid metricKey');
226
+ if (value.verdict !== 'confirmed' && value.verdict !== 'rejected') {
227
+ throw new ObservationReviewStateValidationError('evidence_metric requires confirmed or rejected verdict');
228
+ }
229
+ const expectedScope = observationMetricScopeFor(value.metricKey);
230
+ if (value.metricScope !== undefined && value.metricScope !== expectedScope) {
231
+ throw new ObservationReviewStateValidationError('metricScope does not match metricKey');
232
+ }
233
+ }
234
+ else {
235
+ if (value.verdict === 'confirmed' || value.verdict === 'rejected') {
236
+ throw new ObservationReviewStateValidationError('metric verdict requires evidence_metric targetType');
237
+ }
238
+ if (value.metricKey !== undefined || value.metricScope !== undefined || value.metricScopeId !== undefined) {
239
+ throw new ObservationReviewStateValidationError('metric metadata requires evidence_metric targetType');
240
+ }
241
+ }
242
+ }
243
+ function normalizeReviewStateEntry(value) {
244
+ if (!value || typeof value !== 'object')
245
+ return null;
246
+ const entry = value;
247
+ const reviewedAt = normalizedTimestamp(entry.reviewedAt);
248
+ if (!isReviewTargetType(entry.targetType)
249
+ || typeof entry.targetId !== 'string'
250
+ || entry.targetId.trim() === ''
251
+ || !isReviewVerdict(entry.verdict)
252
+ || !reviewedAt
253
+ || !optionalString(entry.note)
254
+ || !optionalString(entry.reason)
255
+ || !optionalString(entry.metricScopeId)
256
+ || !optionalString(entry.traceId)
257
+ || !optionalString(entry.sourceTrace)
258
+ || !optionalString(entry.sessionId)
259
+ || !optionalString(entry.messageUuid)
260
+ || !optionalString(entry.callInstanceId)
261
+ || !optionalString(entry.toolUseId)
262
+ || !optionalString(entry.snippet)
263
+ || (entry.messageIndex !== undefined
264
+ && (!Number.isSafeInteger(entry.messageIndex) || entry.messageIndex < 0))
265
+ || (entry.metricKey !== undefined && !isObservationMetricKey(entry.metricKey))
266
+ || (entry.metricScope !== undefined && !isObservationMetricScope(entry.metricScope)))
267
+ return null;
268
+ if (entry.targetType === 'evidence_metric') {
269
+ if (!isObservationMetricKey(entry.metricKey)
270
+ || (entry.verdict !== 'confirmed' && entry.verdict !== 'rejected'))
271
+ return null;
272
+ }
273
+ else if (entry.verdict === 'confirmed'
274
+ || entry.verdict === 'rejected'
275
+ || entry.metricKey !== undefined
276
+ || entry.metricScope !== undefined
277
+ || entry.metricScopeId !== undefined) {
278
+ return null;
279
+ }
280
+ const metricScope = entry.metricKey
281
+ ? entry.metricScope ?? observationMetricScopeFor(entry.metricKey)
282
+ : undefined;
283
+ if (entry.metricKey
284
+ && metricScope !== observationMetricScopeFor(entry.metricKey))
285
+ return null;
286
+ return {
287
+ targetType: entry.targetType,
288
+ targetId: entry.targetId,
289
+ verdict: entry.verdict,
290
+ reviewedAt,
291
+ ...(entry.note !== undefined ? { note: entry.note } : {}),
292
+ ...(entry.reason !== undefined ? { reason: entry.reason } : {}),
293
+ ...(entry.metricKey !== undefined ? { metricKey: entry.metricKey, metricScope } : {}),
294
+ ...(entry.metricScopeId !== undefined ? { metricScopeId: entry.metricScopeId } : {}),
295
+ ...(entry.traceId !== undefined ? { traceId: entry.traceId } : {}),
296
+ ...(entry.sourceTrace !== undefined ? { sourceTrace: entry.sourceTrace } : {}),
297
+ ...(entry.sessionId !== undefined ? { sessionId: entry.sessionId } : {}),
298
+ ...(entry.messageIndex !== undefined ? { messageIndex: entry.messageIndex } : {}),
299
+ ...(entry.messageUuid !== undefined ? { messageUuid: entry.messageUuid } : {}),
300
+ ...(entry.callInstanceId !== undefined ? { callInstanceId: entry.callInstanceId } : {}),
301
+ ...(entry.toolUseId !== undefined ? { toolUseId: entry.toolUseId } : {}),
302
+ ...(entry.snippet !== undefined ? { snippet: entry.snippet } : {}),
303
+ };
304
+ }
305
+ function normalizedTimestamp(value) {
306
+ return normalizeRfc3339Timestamp(value) ?? null;
307
+ }
308
+ function optionalString(value) {
309
+ return value === undefined || typeof value === 'string';
310
+ }
311
+ function writeObservationReviewState(observationsDir, state) {
312
+ const path = observationReviewStatePath(observationsDir);
313
+ writeJsonFileAtomic(path, state);
314
+ }
315
+ function isReviewTargetType(value) {
316
+ return value === 'experience_session'
317
+ || value === 'inbox_item'
318
+ || value === 'skill'
319
+ || value === 'goal_slice_correction'
320
+ || value === 'evidence_metric'
321
+ || value === 'reviewer_judgment'
322
+ || value === 'soft_standard'
323
+ || value === 'goal_keyword_correction'
324
+ || value === 'result_artifact_correction'
325
+ || value === 'completion_result_correction'
326
+ || value === 'deliverable_artifact_correction'
327
+ || value === 'skill_relevance_correction'
328
+ || value === 'workflow_completion_correction'
329
+ || value === 'hardrule_execution_correction'
330
+ || value === 'main_tool_execution_correction';
331
+ }
332
+ function isReviewVerdict(value) {
333
+ return value === 'reviewed' || value === 'real_issue' || value === 'not_issue' || value === 'needs_more_context' || value === 'confirmed' || value === 'rejected';
334
+ }
335
+ function isObservationMetricScope(value) {
336
+ return value === 'message' || value === 'skill_segment';
337
+ }
338
+ function isObservationMetricKey(value) {
339
+ return value === 'user_correction'
340
+ || value === 'user_interruption'
341
+ || value === 'user_follow_up'
342
+ || value === 'negative_feedback'
343
+ || value === 'positive_feedback'
344
+ || value === 'hard_rule'
345
+ || value === 'user_goal_shift'
346
+ || value === 'result_artifact'
347
+ || value === 'completion_result'
348
+ || value === 'deliverable_artifact'
349
+ || value === 'progress_update'
350
+ || value === 'self_correction'
351
+ || value === 'repeated_execution';
352
+ }
@@ -0,0 +1,14 @@
1
+ import type { ObservationInboxReport, ObservationSourceRecord, ObservationSourceRecordArchiveRef, ObservationSourceRecordArchiveView } from '../contracts/inbox.js';
2
+ /**
3
+ * Persist bounded source records in the observation archive. Absolute source
4
+ * paths are consumed only during trusted ingest; Studio later reads relative
5
+ * sidecars rooted in that archive.
6
+ */
7
+ export declare function writeObservationSourceRecordArchives(report: ObservationInboxReport, outDir: string, reportPath: string): ObservationSourceRecordArchiveRef[];
8
+ export declare function loadObservationSourceRecordArchive(ref: ObservationSourceRecordArchiveRef | undefined, observationsDir: string): ObservationSourceRecordArchiveView;
9
+ /**
10
+ * Build the page-safe archive metadata without reading the potentially large
11
+ * sidecar. The source-record endpoint resolves the same ref on demand.
12
+ */
13
+ export declare function summarizeObservationSourceRecordArchive(ref: ObservationSourceRecordArchiveRef | undefined): ObservationSourceRecordArchiveView;
14
+ export declare function observationSourceRecordFromLine(line: string, sourceIndex: number, traceId: string, sourceTrace: string): ObservationSourceRecord;