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
@@ -52,10 +52,10 @@ function selectInspectionOperation(facts, operation) {
52
52
  // @concord-implements docs/feature/inspection/use-case/inspection-check-completeness.md
53
53
  function explainInspectionOperation(facts, operation) {
54
54
  return evaluateInspectionOperation(operation.kind, () => {
55
- if (operation.kind === "runs.list") {
55
+ if (operation.kind === "run.list") {
56
56
  return runsListExplanation(facts, operation);
57
57
  }
58
- if (operation.kind === "run.get" || operation.kind === "run.overview") {
58
+ if (operation.kind === "run.get") {
59
59
  const run = requireRunResource(facts, operation.kind, operation.runId);
60
60
  const supporting = supportingRunFacts(facts, run);
61
61
  return Object.freeze({
@@ -167,34 +167,13 @@ function selectOperation(source, operation) {
167
167
  experiment: decodeRequiredResult(operation.kind, results_ts_1.InspectionExperimentResultSchema, experimentResult()),
168
168
  }));
169
169
  }
170
- case "runs.list": return runsListDocument(source, operation);
170
+ case "run.list": return runsListDocument(source, operation);
171
171
  case "run.get": {
172
172
  const run = requireRunResource(source, operation.kind, operation.runId);
173
173
  const supporting = supportingRunFacts(source, run);
174
174
  return Object.freeze({
175
175
  ...runResourceMetadata(source, operation.kind, run, supporting),
176
- run: decodeRequiredResult(operation.kind, results_ts_1.InspectionRunResultSchema, Object.freeze({
177
- value: inspectionRunValue(run),
178
- members: run.published?.members ?? Object.freeze([]),
179
- attempts: run.published?.attempts ?? Object.freeze([]),
180
- })),
181
- });
182
- }
183
- case "run.summary": {
184
- const selected = selectRuns(loadRuns(source, [operation.runId]), [operation.runId]);
185
- const run = requireOne(operation.kind, selected.selected, operation.runId);
186
- const all = loadSummaryFacts(source, run);
187
- return Object.freeze({
188
- ...resultMetadata(source, operation.kind, all, [operation.runId], selected.missing, locators(all)),
189
- summary: decodeRequiredResult(operation.kind, results_ts_1.InspectionRunSummaryResultSchema, runSummary(all, run)),
190
- });
191
- }
192
- case "run.overview": {
193
- const run = requireRunResource(source, operation.kind, operation.runId);
194
- const all = supportingRunFacts(source, run);
195
- return Object.freeze({
196
- ...runResourceMetadata(source, operation.kind, run, all),
197
- runOverview: decodeRequiredResult(operation.kind, results_ts_1.InspectionRunOverviewResultSchema, runOverview(all, run)),
176
+ run: decodeRequiredResult(operation.kind, results_ts_1.InspectionRunResultSchema, runDetail(supporting, run)),
198
177
  });
199
178
  }
200
179
  case "attempt.get": {
@@ -269,7 +248,7 @@ function selectOperation(source, operation) {
269
248
  const resolved = requireAttemptFromSource(source, operation.kind, operation.locator);
270
249
  const metadata = resultMetadata(source, operation.kind, attemptRuns(resolved), [], [], [operation.locator]);
271
250
  let usage = (0, trace_ts_1.projectAttemptUsage)(traceAttachments(resolved));
272
- while ((0, bytes_ts_1.utf8ByteLength)(JSON.stringify({ ...metadata, usage })) > limits_ts_1.INSPECTION_RESULT_BYTE_LIMIT &&
251
+ while ((0, bytes_ts_1.utf8ByteLength)(JSON.stringify({ ...metadata, usage })) > limits_ts_1.INSPECTION_ATTEMPT_USAGE_RESULT_BYTE_LIMIT &&
273
252
  (usage.judgeUsage.state === "complete" || usage.judgeUsage.state === "partial") && usage.judgeUsage.calls.length > 0) {
274
253
  usage = Object.freeze({ ...usage,
275
254
  judgeUsage: (0, judge_usage_projection_ts_1.takeJudgeUsagePreview)(usage.judgeUsage, usage.judgeUsage.calls.length - 1) });
@@ -372,7 +351,7 @@ function selectOperation(source, operation) {
372
351
  function runsListExplanation(source, operation) {
373
352
  const page = runSummaryPage(source, operation.continuation);
374
353
  return Object.freeze({
375
- ...runsListBase(source, page.cutoff, page.items, page.truncated),
354
+ ...runsListBase(source, source.cutoff(), page.items, page.truncated),
376
355
  outcome: "explanation",
377
356
  factKinds: protocol_ts_1.inspectionProtocolRegistry[operation.kind].factKinds,
378
357
  ...(page.continuation === undefined ? {} : { continuation: page.continuation }),
@@ -381,27 +360,38 @@ function runsListExplanation(source, operation) {
381
360
  function runsListDocument(source, operation) {
382
361
  const page = runSummaryPage(source, operation.continuation);
383
362
  return Object.freeze({
384
- ...runsListBase(source, page.cutoff, page.items, page.truncated),
363
+ ...runsListBase(source, source.cutoff(), page.items, page.truncated),
385
364
  runs: closeJson(page.items),
386
365
  ...(page.continuation === undefined ? {} : { continuation: page.continuation }),
387
366
  });
388
367
  }
389
368
  function runSummaryPage(source, continuation) {
390
369
  const binding = continuation === undefined ? undefined : decodeContinuation(continuation);
370
+ const cutoff = source.cutoff();
391
371
  let page;
392
372
  try {
393
- page = source.readSealedRunSummaryPage(binding?.afterRunId ?? "", RUN_LIST_PAGE_SIZE, binding?.cutoffIdentity);
373
+ if (binding !== undefined && binding.cutoffIdentity !== cutoff.identity)
374
+ throw new Error("Publication cutoff changed");
375
+ page = source.readRunResourcePage(binding?.afterRunId ?? "", RUN_LIST_PAGE_SIZE);
394
376
  }
395
377
  catch (cause) {
396
- throw operationFailure("runs.list", "Continuation is invalid or its sealed cutoff changed; restart runs.list", cause);
378
+ throw operationFailure("run.list", "Continuation is invalid or its publication cutoff changed; restart run.list", cause);
397
379
  }
398
380
  return Object.freeze({
399
- cutoff: page.cutoff,
400
- items: page.summaries,
381
+ cutoff,
382
+ items: Object.freeze(page.runs.map((run) => Object.freeze({
383
+ runId: run.runId,
384
+ invocationId: run.invocationId,
385
+ experimentId: run.experimentId,
386
+ state: run.state,
387
+ startedAt: run.startedAt,
388
+ ...(run.completedAt === undefined ? {} : { completedAt: run.completedAt }),
389
+ coverage: Object.freeze({ expected: run.expected, published: run.published, missing: run.missing }),
390
+ }))),
401
391
  truncated: page.nextAfterRunId !== null,
402
392
  continuation: page.nextAfterRunId === null
403
393
  ? undefined
404
- : encodeContinuation(page.nextAfterRunId, page.cutoff.identity),
394
+ : encodeContinuation(page.nextAfterRunId, cutoff.identity),
405
395
  });
406
396
  }
407
397
  function runsListBase(source, cutoff, selected, truncated) {
@@ -409,19 +399,17 @@ function runsListBase(source, cutoff, selected, truncated) {
409
399
  protocol: codec_ts_1.QUERY_PROTOCOL,
410
400
  behaviorVersion: codec_ts_1.INSPECTION_BEHAVIOR_VERSION,
411
401
  outcome: "success",
412
- operation: "runs.list",
402
+ operation: "run.list",
413
403
  source: sourceProvenance(source, cutoff),
414
- sealedCutoff: Object.freeze({
415
- kind: "inspection-sealed-cutoff",
416
- identity: cutoff.identity,
417
- runCount: cutoff.runCount,
404
+ publicationCutoff: Object.freeze({
405
+ storeGeneration: cutoff.storeGeneration,
406
+ revision: cutoff.revision,
418
407
  }),
419
408
  selection: Object.freeze({
420
409
  requestedRunIds: Object.freeze([]),
421
410
  selectedRunIds: Object.freeze(selected.map(({ runId }) => runId)),
422
411
  missingRunIds: Object.freeze([]),
423
412
  returnedRunCount: selected.length,
424
- totalRunCount: cutoff.runCount,
425
413
  truncated,
426
414
  }),
427
415
  issues: Object.freeze([]),
@@ -430,7 +418,7 @@ function runsListBase(source, cutoff, selected, truncated) {
430
418
  }
431
419
  function encodeContinuation(afterRunId, cutoffIdentity) {
432
420
  return (0, bytes_ts_1.encodeBase64UrlUtf8)(JSON.stringify([
433
- "runs.list",
421
+ "run.list",
434
422
  cutoffIdentity,
435
423
  afterRunId,
436
424
  ]));
@@ -438,14 +426,14 @@ function encodeContinuation(afterRunId, cutoffIdentity) {
438
426
  function decodeContinuation(token) {
439
427
  try {
440
428
  const decoded = JSON.parse((0, bytes_ts_1.decodeBase64UrlUtf8)(token));
441
- if (!Array.isArray(decoded) || decoded.length !== 3 || decoded[0] !== "runs.list" ||
429
+ if (!Array.isArray(decoded) || decoded.length !== 3 || decoded[0] !== "run.list" ||
442
430
  typeof decoded[1] !== "string" || typeof decoded[2] !== "string") {
443
431
  throw new Error("continuation binding changed");
444
432
  }
445
433
  return Object.freeze({ cutoffIdentity: decoded[1], afterRunId: decoded[2] });
446
434
  }
447
435
  catch (cause) {
448
- throw operationFailure("runs.list", "Continuation is invalid or its sealed cutoff changed; restart runs.list", cause);
436
+ throw operationFailure("run.list", "Continuation is invalid or its sealed cutoff changed; restart run.list", cause);
449
437
  }
450
438
  }
451
439
  function loadForOperation(source, operation) {
@@ -465,7 +453,7 @@ function loadForOperation(source, operation) {
465
453
  if (operation.kind === "experiment.get") {
466
454
  return { selected: loadReferencedOrigins(source, (0, facts_ts_1.loadSelectedInspectionRuns)(source, source.findExperimentRunIds(operation.experimentId))), requestedRunIds: [], missingRunIds: [] };
467
455
  }
468
- if (operation.kind === "runs.list")
456
+ if (operation.kind === "run.list")
469
457
  return { selected: [], requestedRunIds: [], missingRunIds: [] };
470
458
  if (operation.kind === "runs.compare") {
471
459
  const requested = Object.freeze([...operation.leftRunIds, ...operation.rightRunIds]);
@@ -480,9 +468,7 @@ function loadForOperation(source, operation) {
480
468
  const selected = selectRuns(loadRuns(source, [operation.runId]), [operation.runId]);
481
469
  requireOne(operation.kind, selected.selected, operation.runId);
482
470
  return {
483
- selected: operation.kind === "run.summary" || operation.kind === "run.overview"
484
- ? loadSummaryFacts(source, selected.selected[0])
485
- : selected.selected,
471
+ selected: loadSummaryFacts(source, selected.selected[0]),
486
472
  requestedRunIds: [operation.runId],
487
473
  missingRunIds: selected.missing,
488
474
  };
@@ -540,8 +526,8 @@ function inspectionRunValue(run) {
540
526
  })),
541
527
  }));
542
528
  }
543
- function supportingRunFacts(source, run) {
544
- return run.published === undefined ? Object.freeze([]) : loadSummaryFacts(source, run.published);
529
+ function supportingRunFacts(_source, run) {
530
+ return run.supporting;
545
531
  }
546
532
  function runResourceMetadata(source, operation, run, supporting) {
547
533
  const metadata = resultMetadata(source, operation, supporting, [run.resource.runId], [], locators(supporting));
@@ -759,39 +745,11 @@ function containsState(value, expected) {
759
745
  const record = value;
760
746
  return record.state === expected || Object.values(record).some((entry) => containsState(entry, expected));
761
747
  }
762
- function runSummary(all, selected) {
763
- const slots = selected.run.expectedSlots.map((slot) => {
764
- const member = selected.members.find((candidate) => candidate.slotId === slot.slotId);
765
- if (member === undefined || member.attempt === null) {
766
- return Object.freeze({
767
- runId: selected.run.runId, ...slot, state: member?.action ?? "missing", locator: null,
768
- outcome: null, verdict: null,
769
- });
770
- }
771
- const resolved = (0, facts_ts_1.resolveInspectionMemberAttempt)(all, selected, member);
772
- if (resolved === undefined) {
773
- return Object.freeze({
774
- runId: selected.run.runId, ...slot, state: "missing", locator: null,
775
- outcome: null, verdict: null,
776
- });
777
- }
778
- const assertions = (0, facts_ts_1.readInspectionAssertions)(resolved);
779
- return Object.freeze({
780
- runId: selected.run.runId, ...slot, state: member.action, locator: resolved.locator,
781
- outcome: resolved.attempt.outcome,
782
- verdict: attemptVerdict(resolved, assertions),
783
- score: assertionScore(assertions.state === "available" ? assertions.value.entries : []),
784
- });
785
- });
786
- return Object.freeze({
787
- runs: Object.freeze([selected.run]),
788
- denominator: Object.freeze({ expected: slots.length, observed: slots.filter(({ locator }) => locator !== null).length }),
789
- members: Object.freeze(slots),
790
- });
791
- }
792
- function runOverview(all, selectedResource) {
748
+ function runDetail(_all, selectedResource) {
793
749
  const selected = selectedResource.published;
794
750
  const value = inspectionRunValue(selectedResource);
751
+ const publications = new Map(selectedResource.resource.slots.map((slot) => [slot.slotId, slot.publication]));
752
+ const bindings = new Map(selectedResource.members.map((member) => [member.slotId, member]));
795
753
  const unavailableUsage = () => Object.freeze({
796
754
  state: "unavailable",
797
755
  summary: null,
@@ -806,19 +764,33 @@ function runOverview(all, selectedResource) {
806
764
  limitations: Object.freeze([]),
807
765
  });
808
766
  const projected = value.expectedSlots.map((slot) => {
809
- const targetMember = selected?.members.find((candidate) => candidate.slotId === slot.slotId);
767
+ const binding = publications.get(slot.slotId);
768
+ if (binding === undefined)
769
+ throw new Error(`Run ${value.runId} has no Slot ${slot.slotId}`);
770
+ const publication = binding.state === "published"
771
+ ? Object.freeze({
772
+ state: "published", action: binding.action, attemptId: binding.attemptId,
773
+ attemptLocator: binding.attemptLocator, originRunId: binding.originRunId, originSlotId: binding.originSlotId,
774
+ })
775
+ : binding.state === "absent"
776
+ ? Object.freeze({ state: "absent", reason: binding.reason })
777
+ : Object.freeze({ state: "pending" });
778
+ const targetMember = bindings.get(slot.slotId);
810
779
  if (targetMember === undefined) {
811
- if (value.state !== "active") {
780
+ if (publication.state !== "pending" && publication.state !== "absent") {
812
781
  throw new Error(`Terminal Run ${value.runId} has no binding or absence for Slot ${slot.slotId}`);
813
782
  }
814
783
  const limitation = Object.freeze({
815
784
  kind: "member-not-observed",
816
- state: "pending",
785
+ state: publication.state === "absent"
786
+ ? publication.reason === "interrupted-before-publication" ? "interrupted" : "not-dispatched"
787
+ : "pending",
817
788
  });
818
789
  return Object.freeze({
819
790
  member: Object.freeze({
820
- slot,
821
- state: "pending",
791
+ ...slot,
792
+ publication,
793
+ state: limitation.state,
822
794
  locator: null,
823
795
  relation: null,
824
796
  outcome: null,
@@ -837,7 +809,8 @@ function runOverview(all, selectedResource) {
837
809
  });
838
810
  return Object.freeze({
839
811
  member: Object.freeze({
840
- slot,
812
+ ...slot,
813
+ publication,
841
814
  state: targetMember.action,
842
815
  locator: null,
843
816
  relation: null,
@@ -850,10 +823,7 @@ function runOverview(all, selectedResource) {
850
823
  }),
851
824
  });
852
825
  }
853
- if (selected === undefined) {
854
- throw new Error(`Run ${value.runId} has a Member without a published Core`);
855
- }
856
- const resolved = (0, facts_ts_1.resolveInspectionMemberAttempt)(all, selected, targetMember);
826
+ const resolved = (0, facts_ts_1.resolveInspectionResourceMemberAttempt)(selectedResource, targetMember);
857
827
  if (resolved === undefined) {
858
828
  const limitation = Object.freeze({
859
829
  kind: "attempt-unresolved",
@@ -862,7 +832,8 @@ function runOverview(all, selectedResource) {
862
832
  });
863
833
  return Object.freeze({
864
834
  member: Object.freeze({
865
- slot,
835
+ ...slot,
836
+ publication,
866
837
  state: targetMember.action,
867
838
  locator: null,
868
839
  relation: null,
@@ -895,7 +866,8 @@ function runOverview(all, selectedResource) {
895
866
  return Object.freeze({
896
867
  usage,
897
868
  member: Object.freeze({
898
- slot,
869
+ ...slot,
870
+ publication,
899
871
  state: targetMember.action,
900
872
  locator: resolved.locator,
901
873
  relation: resolved.attempt.originRunId === value.runId ? "origin" : "reference",
@@ -926,7 +898,7 @@ function runOverview(all, selectedResource) {
926
898
  });
927
899
  const members = Object.freeze(projected.map(({ member }) => member));
928
900
  const locatedLimitations = Object.freeze(members.flatMap((member) => member.limitations.map((limitation) => Object.freeze({
929
- slotId: member.slot.slotId,
901
+ slotId: member.slotId,
930
902
  locator: member.locator,
931
903
  limitation,
932
904
  }))));
@@ -937,16 +909,15 @@ function runOverview(all, selectedResource) {
937
909
  const coverageLimitations = Object.freeze(locatedLimitations.filter(({ limitation }) => limitation.kind !== "usage"));
938
910
  const usageLimitations = Object.freeze(locatedLimitations.filter(({ limitation }) => limitation.kind !== "coverage"));
939
911
  return Object.freeze({
940
- identity: Object.freeze({
941
- runId: value.runId,
942
- experimentId: value.experimentId,
943
- adapter: value.context?.execution.adapter ?? null,
912
+ value,
913
+ members: selectedResource.members,
914
+ attempts: selected?.attempts ?? Object.freeze([]),
915
+ denominator: Object.freeze({
916
+ expected: selectedResource.resource.expected,
917
+ published: selectedResource.resource.published,
918
+ missing: selectedResource.resource.missing,
944
919
  }),
945
- state: value.state,
946
- startedAt: value.startedAt,
947
- ...(value.completedAt === undefined ? {} : { completedAt: value.completedAt }),
948
- denominator: Object.freeze({ expected: members.length, observed }),
949
- members,
920
+ slots: members,
950
921
  coverage: Object.freeze({
951
922
  state: aggregateRunOverviewState(members.map(({ coverage }) => coverage.state)),
952
923
  expectedMemberCount: members.length,
@@ -1220,7 +1191,6 @@ function comparisonMembers(all, runs) {
1220
1191
  }
1221
1192
  function baseDocument(source, operation, selectedInput, requestedRunIds, missingRunIds, evidence, issues = []) {
1222
1193
  const selected = uniqueRuns(selectedInput);
1223
- const seals = selected.map(({ run, physical }) => Object.freeze({ runId: run.runId, logicalSealIdentity: physical.logicalSealIdentity }));
1224
1194
  const cutoff = source.cutoff();
1225
1195
  return Object.freeze({
1226
1196
  protocol: codec_ts_1.QUERY_PROTOCOL,
@@ -1228,11 +1198,9 @@ function baseDocument(source, operation, selectedInput, requestedRunIds, missing
1228
1198
  outcome: "success",
1229
1199
  operation,
1230
1200
  source: sourceProvenance(source, cutoff),
1231
- sealedCutoff: Object.freeze({
1232
- kind: "inspection-sealed-cutoff",
1233
- identity: cutoff.identity,
1234
- runCount: cutoff.runCount,
1235
- runs: Object.freeze(seals),
1201
+ publicationCutoff: Object.freeze({
1202
+ storeGeneration: cutoff.storeGeneration,
1203
+ revision: cutoff.revision,
1236
1204
  }),
1237
1205
  selection: Object.freeze({
1238
1206
  requestedRunIds: Object.freeze([...requestedRunIds]),
@@ -1252,14 +1220,9 @@ function resultMetadata(source, operation, selectedInput, requestedRunIds, missi
1252
1220
  outcome: "success",
1253
1221
  operation,
1254
1222
  source: sourceProvenance(source, cutoff),
1255
- sealedCutoff: Object.freeze({
1256
- kind: "inspection-sealed-cutoff",
1257
- identity: cutoff.identity,
1258
- runCount: cutoff.runCount,
1259
- runs: Object.freeze(selected.map(({ run, physical }) => Object.freeze({
1260
- runId: run.runId,
1261
- logicalSealIdentity: physical.logicalSealIdentity,
1262
- }))),
1223
+ publicationCutoff: Object.freeze({
1224
+ storeGeneration: cutoff.storeGeneration,
1225
+ revision: cutoff.revision,
1263
1226
  }),
1264
1227
  selection: Object.freeze({
1265
1228
  requestedRunIds: Object.freeze([...requestedRunIds]),
@@ -1286,7 +1249,7 @@ function decodeRequiredResult(operation, schema, input) {
1286
1249
  return decoded.success;
1287
1250
  }
1288
1251
  function requireInspectionResultBudget(operation, value) {
1289
- const byteLimit = operation === "experiment.get" ? limits_ts_1.INSPECTION_EXPERIMENT_RESULT_BYTE_LIMIT : limits_ts_1.INSPECTION_RESULT_BYTE_LIMIT;
1252
+ const byteLimit = operation === "experiment.get" ? limits_ts_1.INSPECTION_EXPERIMENT_RESULT_BYTE_LIMIT : operation === "attempt.usage" ? limits_ts_1.INSPECTION_ATTEMPT_USAGE_RESULT_BYTE_LIMIT : limits_ts_1.INSPECTION_RESULT_BYTE_LIMIT;
1290
1253
  if ((0, bytes_ts_1.utf8ByteLength)(JSON.stringify(value)) > byteLimit) {
1291
1254
  throw new InspectionOperationError({ code: "evidence-budget-exceeded", operation,
1292
1255
  reason: "Inspection result cannot fit in the result byte limit." });
@@ -1322,7 +1285,7 @@ function arraysEqual(left, right) {
1322
1285
  function sourceProvenance(source, cutoff) {
1323
1286
  return Object.freeze({
1324
1287
  kind: source.kind,
1325
- sealedCutoffIdentity: cutoff.identity,
1288
+ publicationCutoffIdentity: cutoff.identity,
1326
1289
  });
1327
1290
  }
1328
1291
  function evaluateInspectionOperation(operation, evaluate) {