niceeval 0.16.3-canary.99 → 0.17.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.
- package/dist/cli/bootstrap.cjs +7 -1
- package/dist/cli/bootstrap.cjs.map +1 -1
- package/dist/cli/project-configuration.cjs +8 -11
- package/dist/cli/project-configuration.cjs.map +1 -1
- package/dist/expect/index.cjs.map +1 -1
- package/dist/expect/index.d.cts +1 -0
- package/dist/expect/index.d.mts +1 -0
- package/dist/expect/index.d.ts +1 -0
- package/dist/experiment/host/cli/contribution.cjs +6 -11
- package/dist/experiment/host/cli/contribution.cjs.map +1 -1
- package/dist/experiment/host/cli/contribution.d.cts +0 -16
- package/dist/experiment/host/cli/contribution.d.mts +0 -16
- package/dist/experiment/host/cli/contribution.d.ts +0 -16
- package/dist/experiment/host/operations.cjs +3 -3
- package/dist/experiment/host/operations.cjs.map +1 -1
- package/dist/experiment/host/types.cjs.map +1 -1
- package/dist/experiment/host/types.d.cts +0 -4
- package/dist/experiment/host/types.d.mts +0 -4
- package/dist/experiment/host/types.d.ts +0 -4
- package/dist/fresh-import.cjs +2 -2
- package/dist/fresh-import.cjs.map +1 -1
- package/dist/fresh-import.d.cts +3 -3
- package/dist/fresh-import.d.mts +3 -3
- package/dist/fresh-import.d.ts +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/inspection/codec.cjs.map +1 -1
- package/dist/inspection/codec.d.cts +1 -1
- package/dist/inspection/codec.d.mts +1 -1
- package/dist/inspection/codec.d.ts +1 -1
- package/dist/inspection/facts.cjs +66 -9
- package/dist/inspection/facts.cjs.map +1 -1
- package/dist/inspection/facts.d.cts +4 -0
- package/dist/inspection/facts.d.mts +4 -0
- package/dist/inspection/facts.d.ts +4 -0
- package/dist/inspection/facts.js +4 -2
- package/dist/inspection/index.cjs +1 -3
- package/dist/inspection/index.cjs.map +1 -1
- package/dist/inspection/index.d.cts +1 -1
- package/dist/inspection/index.d.mts +1 -1
- package/dist/inspection/index.d.ts +1 -1
- package/dist/inspection/index.js +44 -48
- package/dist/inspection/limits.cjs +3 -1
- package/dist/inspection/limits.cjs.map +1 -1
- package/dist/inspection/limits.d.cts +2 -0
- package/dist/inspection/limits.d.mts +2 -0
- package/dist/inspection/limits.d.ts +2 -0
- package/dist/inspection/limits.js +6 -4
- package/dist/inspection/project-source.cjs +4 -1
- package/dist/inspection/project-source.cjs.map +1 -1
- package/dist/inspection/protocol.cjs +10 -18
- package/dist/inspection/protocol.cjs.map +1 -1
- package/dist/inspection/protocol.d.cts +111 -173
- package/dist/inspection/protocol.d.mts +111 -173
- package/dist/inspection/protocol.d.ts +111 -173
- package/dist/inspection/public.mjs +73 -109
- package/dist/inspection/results.cjs +12 -48
- package/dist/inspection/results.cjs.map +1 -1
- package/dist/inspection/results.d.cts +124 -122
- package/dist/inspection/results.d.mts +124 -122
- package/dist/inspection/results.d.ts +124 -122
- package/dist/inspection/results.js +16 -20
- package/dist/inspection/select.cjs +80 -117
- package/dist/inspection/select.cjs.map +1 -1
- package/dist/inspection/source.cjs +14 -15
- package/dist/inspection/source.cjs.map +1 -1
- package/dist/inspection/source.d.cts +6 -3
- package/dist/inspection/source.d.mts +6 -3
- package/dist/inspection/source.d.ts +6 -3
- package/dist/inspection/trace.cjs +1 -1
- package/dist/inspection/trace.cjs.map +1 -1
- package/dist/load-config.cjs +17 -11
- package/dist/load-config.cjs.map +1 -1
- package/dist/load-config.d.cts +3 -2
- package/dist/load-config.d.mts +3 -2
- package/dist/load-config.d.ts +3 -2
- package/dist/o11y/adapter-usage-projection.cjs +5 -1
- package/dist/o11y/adapter-usage-projection.cjs.map +1 -1
- package/dist/o11y/adapter-usage-projection.d.cts +109 -1
- package/dist/o11y/adapter-usage-projection.d.mts +109 -1
- package/dist/o11y/adapter-usage-projection.d.ts +109 -1
- package/dist/o11y/cache-read.cjs +113 -0
- package/dist/o11y/cache-read.cjs.map +1 -0
- package/dist/o11y/cache-read.d.cts +80 -0
- package/dist/o11y/cache-read.d.mts +80 -0
- package/dist/o11y/cache-read.d.ts +80 -0
- package/dist/o11y/cache-read.js +8 -0
- package/dist/o11y/cache-read.js.map +1 -0
- package/dist/o11y/eval-usage.cjs +4 -1
- package/dist/o11y/eval-usage.cjs.map +1 -1
- package/dist/o11y/eval-usage.d.cts +4 -1
- package/dist/o11y/eval-usage.d.mts +4 -1
- package/dist/o11y/eval-usage.d.ts +4 -1
- package/dist/record/host/sqlite-host.cjs +188 -53
- package/dist/record/host/sqlite-host.cjs.map +1 -1
- package/dist/record/host/sqlite-host.d.cts +37 -1
- package/dist/record/host/sqlite-host.d.mts +37 -1
- package/dist/record/host/sqlite-host.d.ts +37 -1
- package/dist/record/host/sqlite-host.js +16 -8
- package/dist/record/maintenance/runtime.cjs +3 -3
- package/dist/record/maintenance/runtime.cjs.map +1 -1
- package/dist/record/sqlite/admission-repository.cjs +18 -18
- package/dist/record/sqlite/admission-repository.cjs.map +1 -1
- package/dist/record/sqlite/case-repository.cjs +6 -6
- package/dist/record/sqlite/case-repository.cjs.map +1 -1
- package/dist/record/sqlite/coordination-repository.cjs +25 -25
- package/dist/record/sqlite/coordination-repository.cjs.map +1 -1
- package/dist/record/sqlite/current-schema.cjs +115 -111
- package/dist/record/sqlite/current-schema.cjs.map +1 -1
- package/dist/record/sqlite/current-schema.d.cts +3 -3
- package/dist/record/sqlite/current-schema.d.mts +3 -3
- package/dist/record/sqlite/current-schema.d.ts +3 -3
- package/dist/record/sqlite/database.cjs +56 -53
- package/dist/record/sqlite/database.cjs.map +1 -1
- package/dist/record/sqlite/index.cjs +3 -1
- package/dist/record/sqlite/index.cjs.map +1 -1
- package/dist/record/sqlite/index.d.cts +5 -2
- package/dist/record/sqlite/index.d.mts +5 -2
- package/dist/record/sqlite/index.d.ts +5 -2
- package/dist/record/sqlite/legacy-schema-018.cjs +443 -0
- package/dist/record/sqlite/legacy-schema-018.cjs.map +1 -0
- package/dist/record/sqlite/legacy-schema-018.d.cts +6 -0
- package/dist/record/sqlite/legacy-schema-018.d.mts +6 -0
- package/dist/record/sqlite/legacy-schema-018.d.ts +6 -0
- package/dist/record/sqlite/legacy-schema-018.js +6 -0
- package/dist/record/sqlite/legacy-schema-018.js.map +1 -0
- package/dist/record/sqlite/migration.cjs +105 -46
- package/dist/record/sqlite/migration.cjs.map +1 -1
- package/dist/record/sqlite/migration.d.cts +2 -1
- package/dist/record/sqlite/migration.d.mts +2 -1
- package/dist/record/sqlite/migration.d.ts +2 -1
- package/dist/record/sqlite/portable-capture.cjs +13 -13
- package/dist/record/sqlite/portable-capture.cjs.map +1 -1
- package/dist/record/sqlite/registry-repository.cjs +22 -22
- package/dist/record/sqlite/registry-repository.cjs.map +1 -1
- package/dist/record/sqlite/schema.cjs +10 -2
- package/dist/record/sqlite/schema.cjs.map +1 -1
- package/dist/record/sqlite/schema.d.cts +4 -1
- package/dist/record/sqlite/schema.d.mts +4 -1
- package/dist/record/sqlite/schema.d.ts +4 -1
- package/dist/record/sqlite/schema.js +20 -14
- package/dist/record/sqlite/storage-worker.cjs +1 -1
- package/dist/record/sqlite/storage-worker.cjs.map +1 -1
- package/dist/record/sqlite/storage.cjs +316 -232
- package/dist/record/sqlite/storage.cjs.map +1 -1
- package/dist/record/sqlite/storage.d.cts +10 -2
- package/dist/record/sqlite/storage.d.mts +10 -2
- package/dist/record/sqlite/storage.d.ts +10 -2
- package/dist/record/sqlite/storage.js +54 -50
- package/dist/record/sqlite/types.cjs +1 -1
- package/dist/record/sqlite/types.cjs.map +1 -1
- package/dist/record/sqlite/types.d.cts +13 -1
- package/dist/record/sqlite/types.d.mts +13 -1
- package/dist/record/sqlite/types.d.ts +13 -1
- package/dist/run/cli/contribution.cjs +17 -12
- package/dist/run/cli/contribution.cjs.map +1 -1
- package/dist/run/host/lifecycle-adapter.cjs +1 -1
- package/dist/run/host/lifecycle-adapter.cjs.map +1 -1
- package/dist/run/storage/owner-identity.cjs +78 -16
- package/dist/run/storage/owner-identity.cjs.map +1 -1
- package/dist/run/storage/owner-identity.d.cts +2 -1
- package/dist/run/storage/owner-identity.d.mts +2 -1
- package/dist/run/storage/owner-identity.d.ts +2 -1
- package/dist/run/storage/sqlite.cjs +55 -55
- package/dist/run/storage/sqlite.cjs.map +1 -1
- package/dist/runner/accept.cjs +12 -42
- package/dist/runner/accept.cjs.map +1 -1
- package/dist/runner/accept.d.cts +2 -3
- package/dist/runner/accept.d.mts +2 -3
- package/dist/runner/accept.d.ts +2 -3
- package/dist/runner/adapter-usage.cjs +2 -2
- package/dist/runner/adapter-usage.cjs.map +1 -1
- package/dist/runner/adoption.cjs +14 -26
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/adoption.d.cts +5 -13
- package/dist/runner/adoption.d.mts +5 -13
- package/dist/runner/adoption.d.ts +5 -13
- package/dist/runner/adoption.js +2 -4
- package/dist/runner/record.cjs +24 -18
- package/dist/runner/record.cjs.map +1 -1
- package/dist/runner/rename-experiment.cjs +5 -7
- package/dist/runner/rename-experiment.cjs.map +1 -1
- package/dist/runner/reuse-plan.cjs +37 -18
- package/dist/runner/reuse-plan.cjs.map +1 -1
- package/dist/runner/reuse-plan.d.cts +4 -1
- package/dist/runner/reuse-plan.d.mts +4 -1
- package/dist/runner/reuse-plan.d.ts +4 -1
- package/dist/runner/setup-prefix-plan.cjs +17 -12
- package/dist/runner/setup-prefix-plan.cjs.map +1 -1
- package/dist/runner/setup-prefix-plan.d.cts +0 -2
- package/dist/runner/setup-prefix-plan.d.mts +0 -2
- package/dist/runner/setup-prefix-plan.d.ts +0 -2
- package/dist/runner/setup-prefix-plan.js +8 -12
- package/dist/sandbox/backend.cjs +10 -1
- package/dist/sandbox/backend.cjs.map +1 -1
- package/dist/sandbox/backend.d.cts +16 -8
- package/dist/sandbox/backend.d.mts +16 -8
- package/dist/sandbox/backend.d.ts +16 -8
- package/dist/sandbox/backend.js +28 -26
- package/dist/sandbox/docker.cjs +7 -1
- package/dist/sandbox/docker.cjs.map +1 -1
- package/dist/sandbox/e2b-cache-repository.cjs +13 -3
- package/dist/sandbox/e2b-cache-repository.cjs.map +1 -1
- package/dist/sandbox/e2b-cache-repository.d.cts +3 -0
- package/dist/sandbox/e2b-cache-repository.d.mts +3 -0
- package/dist/sandbox/e2b-cache-repository.d.ts +3 -0
- package/dist/sandbox/e2b-cache-repository.js +16 -12
- package/dist/sandbox/e2b.cjs +2 -2
- package/dist/sandbox/e2b.cjs.map +1 -1
- package/dist/sandbox/incus/materialize.cjs +1 -1
- package/dist/sandbox/incus/materialize.cjs.map +1 -1
- package/dist/show/contribution.cjs +3 -3
- package/dist/show/contribution.cjs.map +1 -1
- package/dist/show/model.cjs +14 -13
- package/dist/show/model.cjs.map +1 -1
- package/dist/show/model.d.cts +7 -7
- package/dist/show/model.d.mts +7 -7
- package/dist/show/model.d.ts +7 -7
- package/dist/show/render.cjs +14 -0
- package/dist/show/render.cjs.map +1 -1
- package/dist/user-database/storage-worker.cjs +13 -3
- package/dist/user-database/storage-worker.cjs.map +1 -1
- package/dist/view/app-dist/.vite/manifest.json +2 -2
- package/dist/view/app-dist/assets/{index-CmVoXbwG.js → index-B3ijZRph.js} +17 -17
- package/dist/view/app-dist/assets/{quality-cost-scatter-BuLISaH4.js → quality-cost-scatter-B--DfJ9s.js} +1 -1
- package/dist/view/app-dist/index.html +1 -1
- package/dist/view/application-runtime.cjs +8 -0
- package/dist/view/application-runtime.cjs.map +1 -0
- package/dist/view/application-runtime.d.cts +9 -0
- package/dist/view/application-runtime.d.mts +9 -0
- package/dist/view/application-runtime.d.ts +9 -0
- package/dist/view/application-runtime.js +6 -0
- package/dist/view/application-runtime.js.map +1 -0
- package/dist/view/cli/contribution.cjs +5 -2
- package/dist/view/cli/contribution.cjs.map +1 -1
- package/dist/view/cli/contribution.d.cts +2 -1
- package/dist/view/cli/contribution.d.mts +2 -1
- package/dist/view/cli/contribution.d.ts +2 -1
- package/dist/view/function-runtime.mjs +1019 -456
- package/dist/view/http-protocol.d.cts +1 -9
- package/dist/view/http-protocol.d.mts +1 -9
- package/dist/view/http-protocol.d.ts +1 -9
- package/dist/view/inspection-host.cjs +39 -30
- package/dist/view/inspection-host.cjs.map +1 -1
- package/dist/view/inspection-host.d.cts +7545 -2
- package/dist/view/inspection-host.d.mts +7545 -2
- package/dist/view/inspection-host.d.ts +7545 -2
- package/dist/view/server.cjs +8 -5
- package/dist/view/server.cjs.map +1 -1
- package/dist/view/server.d.cts +4 -2
- package/dist/view/server.d.mts +4 -2
- package/dist/view/server.d.ts +4 -2
- package/docs-site/zh/reference/cli.mdx +1 -2
- package/docs-site/zh/tutorials/control-run-cost.mdx +22 -0
- package/docs-site/zh/tutorials/niceeval-taste-application.mdx +21 -0
- 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 === "
|
|
55
|
+
if (operation.kind === "run.list") {
|
|
56
56
|
return runsListExplanation(facts, operation);
|
|
57
57
|
}
|
|
58
|
-
if (operation.kind === "run.get"
|
|
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 "
|
|
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,
|
|
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.
|
|
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,
|
|
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,
|
|
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
|
-
|
|
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("
|
|
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
|
|
400
|
-
items: page.
|
|
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,
|
|
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: "
|
|
402
|
+
operation: "run.list",
|
|
413
403
|
source: sourceProvenance(source, cutoff),
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
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
|
-
"
|
|
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] !== "
|
|
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("
|
|
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 === "
|
|
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:
|
|
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(
|
|
544
|
-
return run.
|
|
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
|
|
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
|
|
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 (
|
|
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: "
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
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
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
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
|
-
|
|
1288
|
+
publicationCutoffIdentity: cutoff.identity,
|
|
1326
1289
|
});
|
|
1327
1290
|
}
|
|
1328
1291
|
function evaluateInspectionOperation(operation, evaluate) {
|