niceeval 0.16.3-canary.99 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/dist/cli/bootstrap.cjs +7 -1
  2. package/dist/cli/bootstrap.cjs.map +1 -1
  3. package/dist/cli/project-configuration.cjs +8 -11
  4. package/dist/cli/project-configuration.cjs.map +1 -1
  5. package/dist/expect/index.cjs.map +1 -1
  6. package/dist/expect/index.d.cts +2 -1
  7. package/dist/expect/index.d.mts +2 -1
  8. package/dist/expect/index.d.ts +2 -1
  9. package/dist/experiment/host/cli/contribution.cjs +6 -11
  10. package/dist/experiment/host/cli/contribution.cjs.map +1 -1
  11. package/dist/experiment/host/cli/contribution.d.cts +0 -16
  12. package/dist/experiment/host/cli/contribution.d.mts +0 -16
  13. package/dist/experiment/host/cli/contribution.d.ts +0 -16
  14. package/dist/experiment/host/operations.cjs +3 -3
  15. package/dist/experiment/host/operations.cjs.map +1 -1
  16. package/dist/experiment/host/types.cjs.map +1 -1
  17. package/dist/experiment/host/types.d.cts +0 -4
  18. package/dist/experiment/host/types.d.mts +0 -4
  19. package/dist/experiment/host/types.d.ts +0 -4
  20. package/dist/fresh-import.cjs +2 -2
  21. package/dist/fresh-import.cjs.map +1 -1
  22. package/dist/fresh-import.d.cts +3 -3
  23. package/dist/fresh-import.d.mts +3 -3
  24. package/dist/fresh-import.d.ts +3 -3
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +2 -1
  27. package/dist/index.d.mts +2 -1
  28. package/dist/index.d.ts +2 -1
  29. package/dist/inspection/codec.cjs.map +1 -1
  30. package/dist/inspection/codec.d.cts +1 -1
  31. package/dist/inspection/codec.d.mts +1 -1
  32. package/dist/inspection/codec.d.ts +1 -1
  33. package/dist/inspection/facts.cjs +66 -9
  34. package/dist/inspection/facts.cjs.map +1 -1
  35. package/dist/inspection/facts.d.cts +4 -0
  36. package/dist/inspection/facts.d.mts +4 -0
  37. package/dist/inspection/facts.d.ts +4 -0
  38. package/dist/inspection/facts.js +4 -2
  39. package/dist/inspection/index.cjs +1 -3
  40. package/dist/inspection/index.cjs.map +1 -1
  41. package/dist/inspection/index.d.cts +1 -1
  42. package/dist/inspection/index.d.mts +1 -1
  43. package/dist/inspection/index.d.ts +1 -1
  44. package/dist/inspection/index.js +44 -48
  45. package/dist/inspection/limits.cjs +3 -1
  46. package/dist/inspection/limits.cjs.map +1 -1
  47. package/dist/inspection/limits.d.cts +2 -0
  48. package/dist/inspection/limits.d.mts +2 -0
  49. package/dist/inspection/limits.d.ts +2 -0
  50. package/dist/inspection/limits.js +6 -4
  51. package/dist/inspection/project-source.cjs +4 -1
  52. package/dist/inspection/project-source.cjs.map +1 -1
  53. package/dist/inspection/protocol.cjs +10 -18
  54. package/dist/inspection/protocol.cjs.map +1 -1
  55. package/dist/inspection/protocol.d.cts +111 -173
  56. package/dist/inspection/protocol.d.mts +111 -173
  57. package/dist/inspection/protocol.d.ts +111 -173
  58. package/dist/inspection/public.mjs +73 -109
  59. package/dist/inspection/results.cjs +12 -48
  60. package/dist/inspection/results.cjs.map +1 -1
  61. package/dist/inspection/results.d.cts +124 -122
  62. package/dist/inspection/results.d.mts +124 -122
  63. package/dist/inspection/results.d.ts +124 -122
  64. package/dist/inspection/results.js +16 -20
  65. package/dist/inspection/select.cjs +80 -117
  66. package/dist/inspection/select.cjs.map +1 -1
  67. package/dist/inspection/source.cjs +14 -15
  68. package/dist/inspection/source.cjs.map +1 -1
  69. package/dist/inspection/source.d.cts +6 -3
  70. package/dist/inspection/source.d.mts +6 -3
  71. package/dist/inspection/source.d.ts +6 -3
  72. package/dist/inspection/trace.cjs +1 -1
  73. package/dist/inspection/trace.cjs.map +1 -1
  74. package/dist/load-config.cjs +17 -11
  75. package/dist/load-config.cjs.map +1 -1
  76. package/dist/load-config.d.cts +3 -2
  77. package/dist/load-config.d.mts +3 -2
  78. package/dist/load-config.d.ts +3 -2
  79. package/dist/o11y/adapter-usage-projection.cjs +5 -1
  80. package/dist/o11y/adapter-usage-projection.cjs.map +1 -1
  81. package/dist/o11y/adapter-usage-projection.d.cts +109 -1
  82. package/dist/o11y/adapter-usage-projection.d.mts +109 -1
  83. package/dist/o11y/adapter-usage-projection.d.ts +109 -1
  84. package/dist/o11y/cache-read.cjs +113 -0
  85. package/dist/o11y/cache-read.cjs.map +1 -0
  86. package/dist/o11y/cache-read.d.cts +80 -0
  87. package/dist/o11y/cache-read.d.mts +80 -0
  88. package/dist/o11y/cache-read.d.ts +80 -0
  89. package/dist/o11y/cache-read.js +8 -0
  90. package/dist/o11y/cache-read.js.map +1 -0
  91. package/dist/o11y/eval-usage.cjs +22 -1
  92. package/dist/o11y/eval-usage.cjs.map +1 -1
  93. package/dist/o11y/eval-usage.d.cts +9 -1
  94. package/dist/o11y/eval-usage.d.mts +9 -1
  95. package/dist/o11y/eval-usage.d.ts +9 -1
  96. package/dist/record/host/sqlite-host.cjs +188 -53
  97. package/dist/record/host/sqlite-host.cjs.map +1 -1
  98. package/dist/record/host/sqlite-host.d.cts +37 -1
  99. package/dist/record/host/sqlite-host.d.mts +37 -1
  100. package/dist/record/host/sqlite-host.d.ts +37 -1
  101. package/dist/record/host/sqlite-host.js +16 -8
  102. package/dist/record/maintenance/runtime.cjs +3 -3
  103. package/dist/record/maintenance/runtime.cjs.map +1 -1
  104. package/dist/record/sqlite/admission-repository.cjs +18 -18
  105. package/dist/record/sqlite/admission-repository.cjs.map +1 -1
  106. package/dist/record/sqlite/case-repository.cjs +6 -6
  107. package/dist/record/sqlite/case-repository.cjs.map +1 -1
  108. package/dist/record/sqlite/coordination-repository.cjs +25 -25
  109. package/dist/record/sqlite/coordination-repository.cjs.map +1 -1
  110. package/dist/record/sqlite/current-schema.cjs +115 -111
  111. package/dist/record/sqlite/current-schema.cjs.map +1 -1
  112. package/dist/record/sqlite/current-schema.d.cts +3 -3
  113. package/dist/record/sqlite/current-schema.d.mts +3 -3
  114. package/dist/record/sqlite/current-schema.d.ts +3 -3
  115. package/dist/record/sqlite/database.cjs +56 -53
  116. package/dist/record/sqlite/database.cjs.map +1 -1
  117. package/dist/record/sqlite/index.cjs +3 -1
  118. package/dist/record/sqlite/index.cjs.map +1 -1
  119. package/dist/record/sqlite/index.d.cts +5 -2
  120. package/dist/record/sqlite/index.d.mts +5 -2
  121. package/dist/record/sqlite/index.d.ts +5 -2
  122. package/dist/record/sqlite/legacy-schema-018.cjs +443 -0
  123. package/dist/record/sqlite/legacy-schema-018.cjs.map +1 -0
  124. package/dist/record/sqlite/legacy-schema-018.d.cts +6 -0
  125. package/dist/record/sqlite/legacy-schema-018.d.mts +6 -0
  126. package/dist/record/sqlite/legacy-schema-018.d.ts +6 -0
  127. package/dist/record/sqlite/legacy-schema-018.js +6 -0
  128. package/dist/record/sqlite/legacy-schema-018.js.map +1 -0
  129. package/dist/record/sqlite/migration.cjs +105 -46
  130. package/dist/record/sqlite/migration.cjs.map +1 -1
  131. package/dist/record/sqlite/migration.d.cts +2 -1
  132. package/dist/record/sqlite/migration.d.mts +2 -1
  133. package/dist/record/sqlite/migration.d.ts +2 -1
  134. package/dist/record/sqlite/portable-capture.cjs +13 -13
  135. package/dist/record/sqlite/portable-capture.cjs.map +1 -1
  136. package/dist/record/sqlite/registry-repository.cjs +22 -22
  137. package/dist/record/sqlite/registry-repository.cjs.map +1 -1
  138. package/dist/record/sqlite/schema.cjs +10 -2
  139. package/dist/record/sqlite/schema.cjs.map +1 -1
  140. package/dist/record/sqlite/schema.d.cts +4 -1
  141. package/dist/record/sqlite/schema.d.mts +4 -1
  142. package/dist/record/sqlite/schema.d.ts +4 -1
  143. package/dist/record/sqlite/schema.js +20 -14
  144. package/dist/record/sqlite/storage-worker.cjs +1 -1
  145. package/dist/record/sqlite/storage-worker.cjs.map +1 -1
  146. package/dist/record/sqlite/storage.cjs +316 -232
  147. package/dist/record/sqlite/storage.cjs.map +1 -1
  148. package/dist/record/sqlite/storage.d.cts +10 -2
  149. package/dist/record/sqlite/storage.d.mts +10 -2
  150. package/dist/record/sqlite/storage.d.ts +10 -2
  151. package/dist/record/sqlite/storage.js +54 -50
  152. package/dist/record/sqlite/types.cjs +1 -1
  153. package/dist/record/sqlite/types.cjs.map +1 -1
  154. package/dist/record/sqlite/types.d.cts +13 -1
  155. package/dist/record/sqlite/types.d.mts +13 -1
  156. package/dist/record/sqlite/types.d.ts +13 -1
  157. package/dist/run/cli/contribution.cjs +17 -12
  158. package/dist/run/cli/contribution.cjs.map +1 -1
  159. package/dist/run/host/lifecycle-adapter.cjs +1 -1
  160. package/dist/run/host/lifecycle-adapter.cjs.map +1 -1
  161. package/dist/run/storage/owner-identity.cjs +78 -16
  162. package/dist/run/storage/owner-identity.cjs.map +1 -1
  163. package/dist/run/storage/owner-identity.d.cts +2 -1
  164. package/dist/run/storage/owner-identity.d.mts +2 -1
  165. package/dist/run/storage/owner-identity.d.ts +2 -1
  166. package/dist/run/storage/sqlite.cjs +55 -55
  167. package/dist/run/storage/sqlite.cjs.map +1 -1
  168. package/dist/runner/accept.cjs +12 -42
  169. package/dist/runner/accept.cjs.map +1 -1
  170. package/dist/runner/accept.d.cts +2 -3
  171. package/dist/runner/accept.d.mts +2 -3
  172. package/dist/runner/accept.d.ts +2 -3
  173. package/dist/runner/adapter-usage.cjs +2 -2
  174. package/dist/runner/adapter-usage.cjs.map +1 -1
  175. package/dist/runner/adoption.cjs +14 -26
  176. package/dist/runner/adoption.cjs.map +1 -1
  177. package/dist/runner/adoption.d.cts +5 -13
  178. package/dist/runner/adoption.d.mts +5 -13
  179. package/dist/runner/adoption.d.ts +5 -13
  180. package/dist/runner/adoption.js +2 -4
  181. package/dist/runner/record.cjs +24 -18
  182. package/dist/runner/record.cjs.map +1 -1
  183. package/dist/runner/rename-experiment.cjs +5 -7
  184. package/dist/runner/rename-experiment.cjs.map +1 -1
  185. package/dist/runner/reuse-plan.cjs +37 -18
  186. package/dist/runner/reuse-plan.cjs.map +1 -1
  187. package/dist/runner/reuse-plan.d.cts +4 -1
  188. package/dist/runner/reuse-plan.d.mts +4 -1
  189. package/dist/runner/reuse-plan.d.ts +4 -1
  190. package/dist/runner/setup-prefix-plan.cjs +17 -12
  191. package/dist/runner/setup-prefix-plan.cjs.map +1 -1
  192. package/dist/runner/setup-prefix-plan.d.cts +0 -2
  193. package/dist/runner/setup-prefix-plan.d.mts +0 -2
  194. package/dist/runner/setup-prefix-plan.d.ts +0 -2
  195. package/dist/runner/setup-prefix-plan.js +8 -12
  196. package/dist/sandbox/backend.cjs +10 -1
  197. package/dist/sandbox/backend.cjs.map +1 -1
  198. package/dist/sandbox/backend.d.cts +16 -8
  199. package/dist/sandbox/backend.d.mts +16 -8
  200. package/dist/sandbox/backend.d.ts +16 -8
  201. package/dist/sandbox/backend.js +28 -26
  202. package/dist/sandbox/docker.cjs +7 -1
  203. package/dist/sandbox/docker.cjs.map +1 -1
  204. package/dist/sandbox/e2b-cache-repository.cjs +13 -3
  205. package/dist/sandbox/e2b-cache-repository.cjs.map +1 -1
  206. package/dist/sandbox/e2b-cache-repository.d.cts +3 -0
  207. package/dist/sandbox/e2b-cache-repository.d.mts +3 -0
  208. package/dist/sandbox/e2b-cache-repository.d.ts +3 -0
  209. package/dist/sandbox/e2b-cache-repository.js +16 -12
  210. package/dist/sandbox/e2b.cjs +2 -2
  211. package/dist/sandbox/e2b.cjs.map +1 -1
  212. package/dist/sandbox/incus/materialize.cjs +1 -1
  213. package/dist/sandbox/incus/materialize.cjs.map +1 -1
  214. package/dist/show/contribution.cjs +3 -3
  215. package/dist/show/contribution.cjs.map +1 -1
  216. package/dist/show/model.cjs +14 -13
  217. package/dist/show/model.cjs.map +1 -1
  218. package/dist/show/model.d.cts +7 -7
  219. package/dist/show/model.d.mts +7 -7
  220. package/dist/show/model.d.ts +7 -7
  221. package/dist/show/render.cjs +14 -0
  222. package/dist/show/render.cjs.map +1 -1
  223. package/dist/user-database/storage-worker.cjs +13 -3
  224. package/dist/user-database/storage-worker.cjs.map +1 -1
  225. package/dist/view/app-dist/.vite/manifest.json +2 -2
  226. package/dist/view/app-dist/assets/{index-CmVoXbwG.js → index-B3ijZRph.js} +17 -17
  227. package/dist/view/app-dist/assets/{quality-cost-scatter-BuLISaH4.js → quality-cost-scatter-B--DfJ9s.js} +1 -1
  228. package/dist/view/app-dist/index.html +1 -1
  229. package/dist/view/application-runtime.cjs +8 -0
  230. package/dist/view/application-runtime.cjs.map +1 -0
  231. package/dist/view/application-runtime.d.cts +9 -0
  232. package/dist/view/application-runtime.d.mts +9 -0
  233. package/dist/view/application-runtime.d.ts +9 -0
  234. package/dist/view/application-runtime.js +6 -0
  235. package/dist/view/application-runtime.js.map +1 -0
  236. package/dist/view/cli/contribution.cjs +5 -2
  237. package/dist/view/cli/contribution.cjs.map +1 -1
  238. package/dist/view/cli/contribution.d.cts +2 -1
  239. package/dist/view/cli/contribution.d.mts +2 -1
  240. package/dist/view/cli/contribution.d.ts +2 -1
  241. package/dist/view/function-runtime.mjs +1019 -456
  242. package/dist/view/http-protocol.d.cts +1 -9
  243. package/dist/view/http-protocol.d.mts +1 -9
  244. package/dist/view/http-protocol.d.ts +1 -9
  245. package/dist/view/inspection-host.cjs +39 -30
  246. package/dist/view/inspection-host.cjs.map +1 -1
  247. package/dist/view/inspection-host.d.cts +7545 -2
  248. package/dist/view/inspection-host.d.mts +7545 -2
  249. package/dist/view/inspection-host.d.ts +7545 -2
  250. package/dist/view/server.cjs +8 -5
  251. package/dist/view/server.cjs.map +1 -1
  252. package/dist/view/server.d.cts +4 -2
  253. package/dist/view/server.d.mts +4 -2
  254. package/dist/view/server.d.ts +4 -2
  255. package/docs-site/zh/reference/cli.mdx +1 -2
  256. package/docs-site/zh/tutorials/control-run-cost.mdx +61 -0
  257. package/docs-site/zh/tutorials/niceeval-taste-application.mdx +21 -0
  258. package/package.json +1 -1
@@ -3937,6 +3937,54 @@ var AssertionDetailResultSchema = Schema.toType(Schema.Union([Schema.Struct({
3937
3937
  check: DiagnosticNodeSchema,
3938
3938
  matcher: MatcherProjectionSchema
3939
3939
  })]));
3940
+ //#endregion
3941
+ //#region src/o11y/cache-read.ts
3942
+ var Reason = Schema.Literals([
3943
+ "usage-not-recorded",
3944
+ "source-invalid",
3945
+ "adapter-usage-required",
3946
+ "collection-incomplete",
3947
+ "call-status-unknown",
3948
+ "no-calls",
3949
+ "cache-read-missing",
3950
+ "input-total-missing",
3951
+ "zero-input-total",
3952
+ "unsafe-token-total"
3953
+ ]);
3954
+ var fields = {
3955
+ rate: Schema.Union([Schema.Struct({
3956
+ state: Schema.Literal("exact"),
3957
+ value: Schema.Number.check(Schema.makeFilter((value) => Number.isFinite(value) && value >= 0 && value <= 1))
3958
+ }), Schema.Struct({
3959
+ state: Schema.Literal("unavailable"),
3960
+ reason: Reason
3961
+ })]),
3962
+ recordedCalls: NonNegativeSafeIntegerSchema$2,
3963
+ coveredCalls: NonNegativeSafeIntegerSchema$2,
3964
+ missingCacheReadCalls: NonNegativeSafeIntegerSchema$2,
3965
+ missingInputTotalCalls: NonNegativeSafeIntegerSchema$2,
3966
+ unknownStatusCalls: NonNegativeSafeIntegerSchema$2,
3967
+ collectionComplete: Schema.Boolean,
3968
+ reasons: Schema.Array(Reason)
3969
+ };
3970
+ var consistent = (value) => {
3971
+ const count = value.recordedCalls;
3972
+ return count <= 4e3 && value.coveredCalls <= count && value.unknownStatusCalls <= count && value.missingCacheReadCalls <= count && value.missingInputTotalCalls <= count && value.coveredCalls <= count - Math.max(value.missingCacheReadCalls, value.missingInputTotalCalls) && value.coveredCalls >= count - value.missingCacheReadCalls - value.missingInputTotalCalls && new Set(value.reasons).size === value.reasons.length && (value.rate.state === "exact" ? value.reasons.length === 0 && value.collectionComplete && count > 0 && value.coveredCalls === count && value.unknownStatusCalls === 0 : value.rate.reason === value.reasons[0]);
3973
+ };
3974
+ var Summary = Schema.Struct(fields).check(Schema.makeFilter(consistent));
3975
+ var CacheReadReportSchema = Schema.Struct({
3976
+ total: Summary,
3977
+ modelSlots: Schema.Array(Schema.Struct({
3978
+ modelSlot: Schema.NullOr(Schema.String),
3979
+ ...fields
3980
+ }).check(Schema.makeFilter(consistent))),
3981
+ models: Schema.Array(Schema.Struct({
3982
+ modelSlot: Schema.NullOr(Schema.String),
3983
+ provider: Schema.NullOr(Schema.String),
3984
+ model: Schema.NullOr(Schema.String),
3985
+ ...fields
3986
+ }).check(Schema.makeFilter(consistent)))
3987
+ }).check(Schema.makeFilter((value) => value.modelSlots.length <= 65 && value.models.length <= 4e3));
3940
3988
  Object.freeze({
3941
3989
  errors: "all",
3942
3990
  onExcessProperty: "error"
@@ -5846,23 +5894,7 @@ var InspectionRunValueSchema = Schema.Struct({
5846
5894
  completedAt: Schema.optional(UtcMillisSchema),
5847
5895
  expectedSlots: Schema.Array(RecordSlotIdentitySchema)
5848
5896
  });
5849
- var InspectionRunResultSchema = Schema.Struct({
5850
- value: InspectionRunValueSchema,
5851
- members: Schema.Array(MemberDocumentSchema),
5852
- attempts: Schema.Array(AttemptDocumentSchema)
5853
- });
5854
- Schema.Array(Schema.Struct({
5855
- runId: RunIdSchema,
5856
- state: Schema.Literal("completed"),
5857
- experimentId: ExperimentIdSchema,
5858
- invocationId: Schema.Null,
5859
- startedAt: UtcMillisSchema,
5860
- completedAt: UtcMillisSchema,
5861
- coverage: Schema.Struct({
5862
- published: Schema.Number,
5863
- expected: Schema.Number
5864
- })
5865
- }));
5897
+ var InspectionRunListResultSchema = Schema.Array(RunSummarySchema);
5866
5898
  var InspectionScoredValueSchema = Schema.Union([
5867
5899
  Schema.Struct({ state: Schema.Literal("not-scored") }),
5868
5900
  Schema.Struct({
@@ -5883,37 +5915,6 @@ var VerdictSchema = Schema.NullOr(Schema.Literals([
5883
5915
  "errored",
5884
5916
  "skipped"
5885
5917
  ]));
5886
- var InspectionRunSummaryResultSchema = Schema.Struct({
5887
- runs: Schema.Array(RunDocumentSchema),
5888
- denominator: Schema.Struct({
5889
- expected: Schema.Number,
5890
- observed: Schema.Number
5891
- }),
5892
- members: Schema.Array(Schema.Struct({
5893
- runId: Schema.String,
5894
- slotId: Schema.String,
5895
- evalId: Schema.String,
5896
- attemptOrdinal: Schema.Number,
5897
- executionIdentityDigest: Schema.String,
5898
- state: Schema.Literals([
5899
- "executed",
5900
- "carried",
5901
- "accepted",
5902
- "not-dispatched",
5903
- "interrupted",
5904
- "missing"
5905
- ]),
5906
- locator: Schema.NullOr(Schema.String),
5907
- outcome: Schema.NullOr(Schema.Literals([
5908
- "completed",
5909
- "errored",
5910
- "cancelled",
5911
- "interrupted"
5912
- ])),
5913
- verdict: VerdictSchema,
5914
- score: Schema.optional(InspectionScoredValueSchema)
5915
- }))
5916
- });
5917
5918
  var AttemptCoverageFactSchema = Schema.Struct({
5918
5919
  channel: Schema.Literals([
5919
5920
  "events",
@@ -6893,6 +6894,7 @@ var UsageTotalsSchema = Schema.Struct({
6893
6894
  costs: Schema.optional(EffectiveCostTotalSchema)
6894
6895
  });
6895
6896
  var InspectionAttemptUsageResultSchema = Schema.Struct({
6897
+ cacheRead: CacheReadReportSchema,
6896
6898
  configuredModels: ConfiguredModelsSchema,
6897
6899
  modelGroups: ModelGroupsSchema,
6898
6900
  judgeUsage: JudgeUsageSchema,
@@ -6965,7 +6967,8 @@ var RunOverviewMemberLimitationSchema = Schema.Union([
6965
6967
  })
6966
6968
  ]);
6967
6969
  var RunOverviewMemberSchema = Schema.Struct({
6968
- slot: RecordSlotIdentitySchema,
6970
+ ...RecordSlotIdentitySchema.fields,
6971
+ publication: RunSlotPublicationSchema,
6969
6972
  state: Schema.Literals([
6970
6973
  "executed",
6971
6974
  "carried",
@@ -6993,20 +6996,16 @@ var RunOverviewLocatedLimitationSchema = Schema.Struct({
6993
6996
  locator: Schema.NullOr(Schema.String),
6994
6997
  limitation: RunOverviewMemberLimitationSchema
6995
6998
  });
6996
- var InspectionRunOverviewResultSchema = Schema.Struct({
6997
- identity: Schema.Struct({
6998
- runId: RunIdSchema,
6999
- experimentId: ExperimentIdSchema,
7000
- adapter: Schema.NullOr(AdapterIdentitySchema)
7001
- }),
7002
- state: RunStateSchema,
7003
- startedAt: UtcMillisSchema,
7004
- completedAt: Schema.optional(UtcMillisSchema),
6999
+ var InspectionRunResultSchema = Schema.Struct({
7000
+ value: InspectionRunValueSchema,
7001
+ members: Schema.Array(MemberDocumentSchema),
7002
+ attempts: Schema.Array(AttemptDocumentSchema),
7005
7003
  denominator: Schema.Struct({
7006
7004
  expected: Schema.Number,
7007
- observed: Schema.Number
7005
+ published: Schema.Number,
7006
+ missing: Schema.Number
7008
7007
  }),
7009
- members: Schema.Array(RunOverviewMemberSchema),
7008
+ slots: Schema.Array(RunOverviewMemberSchema),
7010
7009
  coverage: Schema.Struct({
7011
7010
  state: RunOverviewStateSchema,
7012
7011
  expectedMemberCount: Schema.Number,
@@ -7183,16 +7182,11 @@ var operation = (kind, fields) => Schema.Struct({
7183
7182
  });
7184
7183
  var SourceSchema = Schema.Struct({
7185
7184
  kind: Schema.Literals(["project-record", "external-record"]),
7186
- sealedCutoffIdentity: Schema.String
7185
+ publicationCutoffIdentity: Schema.String
7187
7186
  });
7188
- var SealedCutoffSchema = Schema.Struct({
7189
- kind: Schema.Literal("inspection-sealed-cutoff"),
7190
- identity: Schema.String,
7191
- runCount: Schema.Number,
7192
- runs: Schema.Array(Schema.Struct({
7193
- runId: Schema.String,
7194
- logicalSealIdentity: Schema.String
7195
- }))
7187
+ var PublicationCutoffSchema = Schema.Struct({
7188
+ storeGeneration: Schema.String,
7189
+ revision: Schema.Number.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0))
7196
7190
  });
7197
7191
  var SelectionSchema = Schema.Struct({
7198
7192
  requestedRunIds: Schema.Array(Schema.String),
@@ -7204,7 +7198,7 @@ var SuccessMetadataSchema = Schema.Struct({
7204
7198
  outcome: Schema.Literal("success"),
7205
7199
  behaviorVersion: Schema.Literal(INSPECTION_BEHAVIOR_VERSION),
7206
7200
  source: SourceSchema,
7207
- sealedCutoff: SealedCutoffSchema,
7201
+ publicationCutoff: PublicationCutoffSchema,
7208
7202
  selection: SelectionSchema,
7209
7203
  issues: Schema.Tuple([]),
7210
7204
  evidence: Schema.Struct({ refs: Schema.Array(Schema.String) })
@@ -7214,17 +7208,12 @@ var RunsListSuccessMetadataSchema = Schema.Struct({
7214
7208
  outcome: Schema.Literal("success"),
7215
7209
  behaviorVersion: Schema.Literal(INSPECTION_BEHAVIOR_VERSION),
7216
7210
  source: SourceSchema,
7217
- sealedCutoff: Schema.Struct({
7218
- kind: Schema.Literal("inspection-sealed-cutoff"),
7219
- identity: Schema.String,
7220
- runCount: Schema.Number
7221
- }),
7211
+ publicationCutoff: PublicationCutoffSchema,
7222
7212
  selection: Schema.Struct({
7223
7213
  requestedRunIds: Schema.Array(Schema.String),
7224
7214
  selectedRunIds: Schema.Array(Schema.String),
7225
7215
  missingRunIds: Schema.Array(Schema.String),
7226
7216
  returnedRunCount: Schema.Number,
7227
- totalRunCount: Schema.Number,
7228
7217
  truncated: Schema.Boolean
7229
7218
  }),
7230
7219
  issues: Schema.Tuple([]),
@@ -7253,19 +7242,6 @@ var ArtifactsResultSchema = Schema.Union([Schema.Struct({ state: Schema.Literal(
7253
7242
  })),
7254
7243
  contentsTruncated: Schema.Boolean
7255
7244
  })]);
7256
- var SealedRunSummarySchema = Schema.Struct({
7257
- runId: Schema.String,
7258
- writerGeneration: Schema.String,
7259
- startedAt: Schema.String,
7260
- logicalSealIdentity: Schema.String,
7261
- slotCount: Schema.Number,
7262
- memberCount: Schema.Number,
7263
- attemptCount: Schema.Number,
7264
- attachmentCount: Schema.Number,
7265
- contentCount: Schema.Number,
7266
- contentByteLength: Schema.Number,
7267
- sealEntryCount: Schema.Number
7268
- });
7269
7245
  var ComparisonMemberSchema = Schema.Struct({
7270
7246
  key: Schema.String,
7271
7247
  runId: Schema.String,
@@ -7329,10 +7305,10 @@ var inspectionProtocolRegistry = Object.freeze({
7329
7305
  "judge-usage"
7330
7306
  ]
7331
7307
  }),
7332
- "runs.list": spec({
7333
- request: operation("runs.list", { continuation: Schema.optional(Schema.String) }),
7308
+ "run.list": spec({
7309
+ request: operation("run.list", { continuation: Schema.optional(Schema.String) }),
7334
7310
  result: {
7335
- runs: Schema.Array(SealedRunSummarySchema),
7311
+ runs: InspectionRunListResultSchema,
7336
7312
  continuation: Schema.optional(Schema.String)
7337
7313
  },
7338
7314
  factKinds: ["core"]
@@ -7340,24 +7316,12 @@ var inspectionProtocolRegistry = Object.freeze({
7340
7316
  "run.get": spec({
7341
7317
  request: operation("run.get", { runId: RunIdSchema }),
7342
7318
  result: { run: InspectionRunResultSchema },
7343
- factKinds: ["core"]
7344
- }),
7345
- "run.summary": spec({
7346
- request: operation("run.summary", { runId: RunIdSchema }),
7347
- result: { summary: InspectionRunSummaryResultSchema },
7348
7319
  factKinds: [
7349
7320
  "core",
7350
7321
  "assertions",
7351
- "agent-turns"
7352
- ]
7353
- }),
7354
- "run.overview": spec({
7355
- request: operation("run.overview", { runId: RunIdSchema }),
7356
- result: { runOverview: InspectionRunOverviewResultSchema },
7357
- factKinds: [
7358
- "core",
7359
- "assertions",
7360
- "agent-turns"
7322
+ "agent-turns",
7323
+ "adapter-usage",
7324
+ "judge-usage"
7361
7325
  ]
7362
7326
  }),
7363
7327
  "attempt.get": spec({
@@ -7512,7 +7476,7 @@ var successSchema = (id, entry) => {
7512
7476
  operation: Schema.Literal(id),
7513
7477
  ...entry.result
7514
7478
  });
7515
- return id === "runs.list" ? RunsListSuccessMetadataSchema.pipe(fields) : id === "runs.compare" ? CompareSuccessMetadataSchema.pipe(fields) : SuccessMetadataSchema.pipe(fields);
7479
+ return id === "run.list" ? RunsListSuccessMetadataSchema.pipe(fields) : id === "runs.compare" ? CompareSuccessMetadataSchema.pipe(fields) : SuccessMetadataSchema.pipe(fields);
7516
7480
  };
7517
7481
  var InspectionSuccessDocumentSchema = Schema.Union(specs.map(([id, entry]) => successSchema(id, entry)));
7518
7482
  var explanationSchema = (id, entry) => {
@@ -7521,7 +7485,7 @@ var explanationSchema = (id, entry) => {
7521
7485
  operation: Schema.Literal(id),
7522
7486
  factKinds: Schema.Tuple(entry.factKinds.map((value) => Schema.Literal(value)))
7523
7487
  });
7524
- if (id === "runs.list") return RunsListSuccessMetadataSchema.pipe(fields);
7488
+ if (id === "run.list") return RunsListSuccessMetadataSchema.pipe(fields);
7525
7489
  return SuccessMetadataSchema.pipe(fields);
7526
7490
  };
7527
7491
  var InspectionExplanationDocumentSchema = Schema.Union(specs.map(([id, entry]) => explanationSchema(id, entry)));
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InspectionAttemptDiffResultSchema = exports.InspectionAttemptTimingResultSchema = exports.InspectionRunOverviewResultSchema = exports.InspectionAttemptUsageResultSchema = exports.InspectionTraceDetailResultSchema = exports.InspectionTraceDetailItemSchema = exports.InspectionTraceResultSchema = exports.InspectionTraceItemSchema = exports.ExecutionDisplayPreviewSchema = exports.InspectionSourcesResultSchema = exports.InspectionAttemptResultSchema = exports.InspectionRunSummaryResultSchema = exports.InspectionScoredValueSchema = exports.InspectionRunListResultSchema = exports.InspectionRunResultSchema = exports.InspectionRunValueSchema = exports.InspectionExperimentResultSchema = exports.InspectionOverviewResultSchema = void 0;
3
+ exports.InspectionAttemptDiffResultSchema = exports.InspectionAttemptTimingResultSchema = exports.InspectionRunResultSchema = exports.InspectionAttemptUsageResultSchema = exports.InspectionTraceDetailResultSchema = exports.InspectionTraceDetailItemSchema = exports.InspectionTraceResultSchema = exports.InspectionTraceItemSchema = exports.ExecutionDisplayPreviewSchema = exports.InspectionSourcesResultSchema = exports.InspectionAttemptResultSchema = exports.InspectionScoredValueSchema = exports.InspectionRunListResultSchema = exports.InspectionRunValueSchema = exports.InspectionExperimentResultSchema = exports.InspectionOverviewResultSchema = void 0;
4
+ const cache_read_ts_1 = require("../o11y/cache-read.cjs");
4
5
  const effect_1 = require("effect");
5
6
  const schema_ts_1 = require("../record/family/adapter-usage/schema.cjs");
6
7
  const common_ts_1 = require("../record/family/common.cjs");
@@ -198,23 +199,7 @@ exports.InspectionRunValueSchema = effect_1.Schema.Struct({
198
199
  completedAt: effect_1.Schema.optional(identifiers_ts_1.UtcMillisSchema),
199
200
  expectedSlots: effect_1.Schema.Array(core_ts_1.RecordSlotIdentitySchema),
200
201
  });
201
- exports.InspectionRunResultSchema = effect_1.Schema.Struct({
202
- value: exports.InspectionRunValueSchema,
203
- members: effect_1.Schema.Array(core_ts_1.MemberDocumentSchema),
204
- attempts: effect_1.Schema.Array(core_ts_1.AttemptDocumentSchema),
205
- });
206
- exports.InspectionRunListResultSchema = effect_1.Schema.Array(effect_1.Schema.Struct({
207
- runId: identifiers_ts_1.RunIdSchema,
208
- state: effect_1.Schema.Literal("completed"),
209
- experimentId: identifiers_ts_1.ExperimentIdSchema,
210
- invocationId: effect_1.Schema.Null,
211
- startedAt: identifiers_ts_1.UtcMillisSchema,
212
- completedAt: identifiers_ts_1.UtcMillisSchema,
213
- coverage: effect_1.Schema.Struct({
214
- published: effect_1.Schema.Number,
215
- expected: effect_1.Schema.Number,
216
- }),
217
- }));
202
+ exports.InspectionRunListResultSchema = effect_1.Schema.Array(index_ts_2.RunSummarySchema);
218
203
  exports.InspectionScoredValueSchema = effect_1.Schema.Union([
219
204
  effect_1.Schema.Struct({ state: effect_1.Schema.Literal("not-scored") }),
220
205
  effect_1.Schema.Struct({ state: effect_1.Schema.Literal("complete"), earned: effect_1.Schema.Number, possible: effect_1.Schema.Number }),
@@ -226,24 +211,6 @@ exports.InspectionScoredValueSchema = effect_1.Schema.Union([
226
211
  }),
227
212
  ]);
228
213
  const VerdictSchema = effect_1.Schema.NullOr(effect_1.Schema.Literals(["passed", "failed", "errored", "skipped"]));
229
- exports.InspectionRunSummaryResultSchema = effect_1.Schema.Struct({
230
- runs: effect_1.Schema.Array(core_ts_1.RunDocumentSchema),
231
- denominator: effect_1.Schema.Struct({ expected: effect_1.Schema.Number, observed: effect_1.Schema.Number }),
232
- members: effect_1.Schema.Array(effect_1.Schema.Struct({
233
- runId: effect_1.Schema.String,
234
- slotId: effect_1.Schema.String,
235
- evalId: effect_1.Schema.String,
236
- attemptOrdinal: effect_1.Schema.Number,
237
- executionIdentityDigest: effect_1.Schema.String,
238
- state: effect_1.Schema.Literals([
239
- "executed", "carried", "accepted", "not-dispatched", "interrupted", "missing",
240
- ]),
241
- locator: effect_1.Schema.NullOr(effect_1.Schema.String),
242
- outcome: effect_1.Schema.NullOr(effect_1.Schema.Literals(["completed", "errored", "cancelled", "interrupted"])),
243
- verdict: VerdictSchema,
244
- score: effect_1.Schema.optional(exports.InspectionScoredValueSchema),
245
- })),
246
- });
247
214
  const AttemptCoverageFactSchema = effect_1.Schema.Struct({
248
215
  channel: effect_1.Schema.Literals(["events", "actions", "messages", "usage", "status", "data"]),
249
216
  status: effect_1.Schema.Literals(["complete", "partial", "unavailable"]),
@@ -927,6 +894,7 @@ const UsageTotalsSchema = effect_1.Schema.Struct({
927
894
  costs: effect_1.Schema.optional(EffectiveCostTotalSchema),
928
895
  });
929
896
  exports.InspectionAttemptUsageResultSchema = effect_1.Schema.Struct({
897
+ cacheRead: cache_read_ts_1.CacheReadReportSchema,
930
898
  configuredModels: ConfiguredModelsSchema,
931
899
  modelGroups: ModelGroupsSchema,
932
900
  judgeUsage: JudgeUsageSchema,
@@ -982,7 +950,8 @@ const RunOverviewMemberLimitationSchema = effect_1.Schema.Union([
982
950
  effect_1.Schema.Struct({ kind: effect_1.Schema.Literal("usage"), detail: UsageLimitationSchema }),
983
951
  ]);
984
952
  const RunOverviewMemberSchema = effect_1.Schema.Struct({
985
- slot: core_ts_1.RecordSlotIdentitySchema,
953
+ ...core_ts_1.RecordSlotIdentitySchema.fields,
954
+ publication: index_ts_2.RunSlotPublicationSchema,
986
955
  state: effect_1.Schema.Literals([
987
956
  "executed", "carried", "accepted", "not-dispatched", "interrupted", "pending",
988
957
  ]),
@@ -1000,17 +969,12 @@ const RunOverviewLocatedLimitationSchema = effect_1.Schema.Struct({
1000
969
  locator: effect_1.Schema.NullOr(effect_1.Schema.String),
1001
970
  limitation: RunOverviewMemberLimitationSchema,
1002
971
  });
1003
- exports.InspectionRunOverviewResultSchema = effect_1.Schema.Struct({
1004
- identity: effect_1.Schema.Struct({
1005
- runId: identifiers_ts_1.RunIdSchema,
1006
- experimentId: identifiers_ts_1.ExperimentIdSchema,
1007
- adapter: effect_1.Schema.NullOr(run_context_ts_1.AdapterIdentitySchema),
1008
- }),
1009
- state: index_ts_2.RunStateSchema,
1010
- startedAt: identifiers_ts_1.UtcMillisSchema,
1011
- completedAt: effect_1.Schema.optional(identifiers_ts_1.UtcMillisSchema),
1012
- denominator: effect_1.Schema.Struct({ expected: effect_1.Schema.Number, observed: effect_1.Schema.Number }),
1013
- members: effect_1.Schema.Array(RunOverviewMemberSchema),
972
+ exports.InspectionRunResultSchema = effect_1.Schema.Struct({
973
+ value: exports.InspectionRunValueSchema,
974
+ members: effect_1.Schema.Array(core_ts_1.MemberDocumentSchema),
975
+ attempts: effect_1.Schema.Array(core_ts_1.AttemptDocumentSchema),
976
+ denominator: effect_1.Schema.Struct({ expected: effect_1.Schema.Number, published: effect_1.Schema.Number, missing: effect_1.Schema.Number }),
977
+ slots: effect_1.Schema.Array(RunOverviewMemberSchema),
1014
978
  coverage: effect_1.Schema.Struct({
1015
979
  state: RunOverviewStateSchema,
1016
980
  expectedMemberCount: effect_1.Schema.Number,