niceeval 0.16.2-canary.98 → 0.16.2

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 (40) hide show
  1. package/dist/inspection/facts.cjs +86 -31
  2. package/dist/inspection/facts.cjs.map +1 -1
  3. package/dist/inspection/facts.d.cts +2 -2
  4. package/dist/inspection/facts.d.mts +2 -2
  5. package/dist/inspection/facts.d.ts +2 -2
  6. package/dist/inspection/overview.cjs +2 -1
  7. package/dist/inspection/overview.cjs.map +1 -1
  8. package/dist/inspection/project-source.cjs +28 -19
  9. package/dist/inspection/project-source.cjs.map +1 -1
  10. package/dist/inspection/protocol.d.cts +17 -17
  11. package/dist/inspection/protocol.d.mts +17 -17
  12. package/dist/inspection/protocol.d.ts +17 -17
  13. package/dist/inspection/select.cjs +10 -6
  14. package/dist/inspection/select.cjs.map +1 -1
  15. package/dist/inspection/source.cjs +4 -2
  16. package/dist/inspection/source.cjs.map +1 -1
  17. package/dist/inspection/source.d.cts +1 -0
  18. package/dist/inspection/source.d.mts +1 -0
  19. package/dist/inspection/source.d.ts +1 -0
  20. package/dist/record/sqlite/database.cjs +2 -8
  21. package/dist/record/sqlite/database.cjs.map +1 -1
  22. package/dist/record/sqlite/index.cjs +13 -11
  23. package/dist/record/sqlite/index.cjs.map +1 -1
  24. package/dist/record/sqlite/index.d.cts +4 -2
  25. package/dist/record/sqlite/index.d.mts +4 -2
  26. package/dist/record/sqlite/index.d.ts +4 -2
  27. package/dist/record/sqlite/storage.cjs +118 -64
  28. package/dist/record/sqlite/storage.cjs.map +1 -1
  29. package/dist/record/sqlite/storage.d.cts +12 -5
  30. package/dist/record/sqlite/storage.d.mts +12 -5
  31. package/dist/record/sqlite/storage.d.ts +12 -5
  32. package/dist/record/sqlite/storage.js +48 -44
  33. package/dist/record/sqlite/types.cjs.map +1 -1
  34. package/dist/record/sqlite/types.d.cts +1 -1
  35. package/dist/record/sqlite/types.d.mts +1 -1
  36. package/dist/record/sqlite/types.d.ts +1 -1
  37. package/dist/view/cli/contribution.cjs +3 -2
  38. package/dist/view/cli/contribution.cjs.map +1 -1
  39. package/dist/view/function-runtime.mjs +251 -464
  40. package/package.json +1 -1
@@ -62,12 +62,6 @@ declare const CompareSuccessMetadataSchema: Schema.Struct<{
62
62
  readonly evidence: Schema.Struct<{
63
63
  readonly refs: Schema.$Array<Schema.String>;
64
64
  }>;
65
- readonly selection: Schema.Struct<{
66
- readonly requestedRunIds: Schema.$Array<Schema.String>;
67
- readonly selectedRunIds: Schema.$Array<Schema.String>;
68
- readonly missingRunIds: Schema.$Array<Schema.String>;
69
- }>;
70
- readonly behaviorVersion: Schema.Literal<"2.0.0">;
71
65
  readonly sealedCutoff: Schema.Struct<{
72
66
  readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
73
67
  readonly identity: Schema.String;
@@ -77,6 +71,12 @@ declare const CompareSuccessMetadataSchema: Schema.Struct<{
77
71
  readonly logicalSealIdentity: Schema.String;
78
72
  }>>;
79
73
  }>;
74
+ readonly selection: Schema.Struct<{
75
+ readonly requestedRunIds: Schema.$Array<Schema.String>;
76
+ readonly selectedRunIds: Schema.$Array<Schema.String>;
77
+ readonly missingRunIds: Schema.$Array<Schema.String>;
78
+ }>;
79
+ readonly behaviorVersion: Schema.Literal<"2.0.0">;
80
80
  readonly issues: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
81
81
  readonly code: Schema.Literal<"selection-run-missing">;
82
82
  readonly side: Schema.Literals<readonly ["left", "right"]>;
@@ -7533,6 +7533,11 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7533
7533
  readonly evidence: Schema.Struct<{
7534
7534
  readonly refs: Schema.$Array<Schema.String>;
7535
7535
  }>;
7536
+ readonly sealedCutoff: Schema.Struct<{
7537
+ readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
7538
+ readonly identity: Schema.String;
7539
+ readonly runCount: Schema.Number;
7540
+ }>;
7536
7541
  readonly selection: Schema.Struct<{
7537
7542
  readonly requestedRunIds: Schema.$Array<Schema.String>;
7538
7543
  readonly selectedRunIds: Schema.$Array<Schema.String>;
@@ -7542,11 +7547,6 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7542
7547
  readonly truncated: Schema.Boolean;
7543
7548
  }>;
7544
7549
  readonly behaviorVersion: Schema.Literal<"2.0.0">;
7545
- readonly sealedCutoff: Schema.Struct<{
7546
- readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
7547
- readonly identity: Schema.String;
7548
- readonly runCount: Schema.Number;
7549
- }>;
7550
7550
  readonly outcome: Schema.Literal<"explanation">;
7551
7551
  readonly operation: Schema.Literal<"run.get" | "project.get" | "overview.get" | "experiment.get" | "runs.list" | "run.summary" | "run.overview" | "attempt.get" | "attempt.assertion.detail" | "attempt.assertion.image" | "attempt.trace" | "attempt.trace.detail" | "attempt.timing" | "attempt.usage" | "attempt.diff" | "attempt.sources" | "attempt.artifacts" | "attempt.artifact" | "runs.compare">;
7552
7552
  readonly factKinds: Schema.Tuple<Schema.Literal<"assertions" | "core" | "artifacts" | "sources" | "adapter-usage" | "file-changes" | "agent-turns" | "sandbox-commands" | "runner-activities" | "runner-diagnostics" | "turn-contexts" | "current-project" | "attempt-cost" | "judge-usage" | "execution-traces">[]>;
@@ -7560,12 +7560,6 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7560
7560
  readonly evidence: Schema.Struct<{
7561
7561
  readonly refs: Schema.$Array<Schema.String>;
7562
7562
  }>;
7563
- readonly selection: Schema.Struct<{
7564
- readonly requestedRunIds: Schema.$Array<Schema.String>;
7565
- readonly selectedRunIds: Schema.$Array<Schema.String>;
7566
- readonly missingRunIds: Schema.$Array<Schema.String>;
7567
- }>;
7568
- readonly behaviorVersion: Schema.Literal<"2.0.0">;
7569
7563
  readonly sealedCutoff: Schema.Struct<{
7570
7564
  readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
7571
7565
  readonly identity: Schema.String;
@@ -7575,6 +7569,12 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7575
7569
  readonly logicalSealIdentity: Schema.String;
7576
7570
  }>>;
7577
7571
  }>;
7572
+ readonly selection: Schema.Struct<{
7573
+ readonly requestedRunIds: Schema.$Array<Schema.String>;
7574
+ readonly selectedRunIds: Schema.$Array<Schema.String>;
7575
+ readonly missingRunIds: Schema.$Array<Schema.String>;
7576
+ }>;
7577
+ readonly behaviorVersion: Schema.Literal<"2.0.0">;
7578
7578
  readonly outcome: Schema.Literal<"explanation">;
7579
7579
  readonly operation: Schema.Literal<"run.get" | "project.get" | "overview.get" | "experiment.get" | "runs.list" | "run.summary" | "run.overview" | "attempt.get" | "attempt.assertion.detail" | "attempt.assertion.image" | "attempt.trace" | "attempt.trace.detail" | "attempt.timing" | "attempt.usage" | "attempt.diff" | "attempt.sources" | "attempt.artifacts" | "attempt.artifact" | "runs.compare">;
7580
7580
  readonly factKinds: Schema.Tuple<Schema.Literal<"assertions" | "core" | "artifacts" | "sources" | "adapter-usage" | "file-changes" | "agent-turns" | "sandbox-commands" | "runner-activities" | "runner-diagnostics" | "turn-contexts" | "current-project" | "attempt-cost" | "judge-usage" | "execution-traces">[]>;
@@ -62,12 +62,6 @@ declare const CompareSuccessMetadataSchema: Schema.Struct<{
62
62
  readonly evidence: Schema.Struct<{
63
63
  readonly refs: Schema.$Array<Schema.String>;
64
64
  }>;
65
- readonly selection: Schema.Struct<{
66
- readonly requestedRunIds: Schema.$Array<Schema.String>;
67
- readonly selectedRunIds: Schema.$Array<Schema.String>;
68
- readonly missingRunIds: Schema.$Array<Schema.String>;
69
- }>;
70
- readonly behaviorVersion: Schema.Literal<"2.0.0">;
71
65
  readonly sealedCutoff: Schema.Struct<{
72
66
  readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
73
67
  readonly identity: Schema.String;
@@ -77,6 +71,12 @@ declare const CompareSuccessMetadataSchema: Schema.Struct<{
77
71
  readonly logicalSealIdentity: Schema.String;
78
72
  }>>;
79
73
  }>;
74
+ readonly selection: Schema.Struct<{
75
+ readonly requestedRunIds: Schema.$Array<Schema.String>;
76
+ readonly selectedRunIds: Schema.$Array<Schema.String>;
77
+ readonly missingRunIds: Schema.$Array<Schema.String>;
78
+ }>;
79
+ readonly behaviorVersion: Schema.Literal<"2.0.0">;
80
80
  readonly issues: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
81
81
  readonly code: Schema.Literal<"selection-run-missing">;
82
82
  readonly side: Schema.Literals<readonly ["left", "right"]>;
@@ -7533,6 +7533,11 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7533
7533
  readonly evidence: Schema.Struct<{
7534
7534
  readonly refs: Schema.$Array<Schema.String>;
7535
7535
  }>;
7536
+ readonly sealedCutoff: Schema.Struct<{
7537
+ readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
7538
+ readonly identity: Schema.String;
7539
+ readonly runCount: Schema.Number;
7540
+ }>;
7536
7541
  readonly selection: Schema.Struct<{
7537
7542
  readonly requestedRunIds: Schema.$Array<Schema.String>;
7538
7543
  readonly selectedRunIds: Schema.$Array<Schema.String>;
@@ -7542,11 +7547,6 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7542
7547
  readonly truncated: Schema.Boolean;
7543
7548
  }>;
7544
7549
  readonly behaviorVersion: Schema.Literal<"2.0.0">;
7545
- readonly sealedCutoff: Schema.Struct<{
7546
- readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
7547
- readonly identity: Schema.String;
7548
- readonly runCount: Schema.Number;
7549
- }>;
7550
7550
  readonly outcome: Schema.Literal<"explanation">;
7551
7551
  readonly operation: Schema.Literal<"run.get" | "project.get" | "overview.get" | "experiment.get" | "runs.list" | "run.summary" | "run.overview" | "attempt.get" | "attempt.assertion.detail" | "attempt.assertion.image" | "attempt.trace" | "attempt.trace.detail" | "attempt.timing" | "attempt.usage" | "attempt.diff" | "attempt.sources" | "attempt.artifacts" | "attempt.artifact" | "runs.compare">;
7552
7552
  readonly factKinds: Schema.Tuple<Schema.Literal<"assertions" | "core" | "artifacts" | "sources" | "adapter-usage" | "file-changes" | "agent-turns" | "sandbox-commands" | "runner-activities" | "runner-diagnostics" | "turn-contexts" | "current-project" | "attempt-cost" | "judge-usage" | "execution-traces">[]>;
@@ -7560,12 +7560,6 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7560
7560
  readonly evidence: Schema.Struct<{
7561
7561
  readonly refs: Schema.$Array<Schema.String>;
7562
7562
  }>;
7563
- readonly selection: Schema.Struct<{
7564
- readonly requestedRunIds: Schema.$Array<Schema.String>;
7565
- readonly selectedRunIds: Schema.$Array<Schema.String>;
7566
- readonly missingRunIds: Schema.$Array<Schema.String>;
7567
- }>;
7568
- readonly behaviorVersion: Schema.Literal<"2.0.0">;
7569
7563
  readonly sealedCutoff: Schema.Struct<{
7570
7564
  readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
7571
7565
  readonly identity: Schema.String;
@@ -7575,6 +7569,12 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7575
7569
  readonly logicalSealIdentity: Schema.String;
7576
7570
  }>>;
7577
7571
  }>;
7572
+ readonly selection: Schema.Struct<{
7573
+ readonly requestedRunIds: Schema.$Array<Schema.String>;
7574
+ readonly selectedRunIds: Schema.$Array<Schema.String>;
7575
+ readonly missingRunIds: Schema.$Array<Schema.String>;
7576
+ }>;
7577
+ readonly behaviorVersion: Schema.Literal<"2.0.0">;
7578
7578
  readonly outcome: Schema.Literal<"explanation">;
7579
7579
  readonly operation: Schema.Literal<"run.get" | "project.get" | "overview.get" | "experiment.get" | "runs.list" | "run.summary" | "run.overview" | "attempt.get" | "attempt.assertion.detail" | "attempt.assertion.image" | "attempt.trace" | "attempt.trace.detail" | "attempt.timing" | "attempt.usage" | "attempt.diff" | "attempt.sources" | "attempt.artifacts" | "attempt.artifact" | "runs.compare">;
7580
7580
  readonly factKinds: Schema.Tuple<Schema.Literal<"assertions" | "core" | "artifacts" | "sources" | "adapter-usage" | "file-changes" | "agent-turns" | "sandbox-commands" | "runner-activities" | "runner-diagnostics" | "turn-contexts" | "current-project" | "attempt-cost" | "judge-usage" | "execution-traces">[]>;
@@ -62,12 +62,6 @@ declare const CompareSuccessMetadataSchema: Schema.Struct<{
62
62
  readonly evidence: Schema.Struct<{
63
63
  readonly refs: Schema.$Array<Schema.String>;
64
64
  }>;
65
- readonly selection: Schema.Struct<{
66
- readonly requestedRunIds: Schema.$Array<Schema.String>;
67
- readonly selectedRunIds: Schema.$Array<Schema.String>;
68
- readonly missingRunIds: Schema.$Array<Schema.String>;
69
- }>;
70
- readonly behaviorVersion: Schema.Literal<"2.0.0">;
71
65
  readonly sealedCutoff: Schema.Struct<{
72
66
  readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
73
67
  readonly identity: Schema.String;
@@ -77,6 +71,12 @@ declare const CompareSuccessMetadataSchema: Schema.Struct<{
77
71
  readonly logicalSealIdentity: Schema.String;
78
72
  }>>;
79
73
  }>;
74
+ readonly selection: Schema.Struct<{
75
+ readonly requestedRunIds: Schema.$Array<Schema.String>;
76
+ readonly selectedRunIds: Schema.$Array<Schema.String>;
77
+ readonly missingRunIds: Schema.$Array<Schema.String>;
78
+ }>;
79
+ readonly behaviorVersion: Schema.Literal<"2.0.0">;
80
80
  readonly issues: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
81
81
  readonly code: Schema.Literal<"selection-run-missing">;
82
82
  readonly side: Schema.Literals<readonly ["left", "right"]>;
@@ -7533,6 +7533,11 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7533
7533
  readonly evidence: Schema.Struct<{
7534
7534
  readonly refs: Schema.$Array<Schema.String>;
7535
7535
  }>;
7536
+ readonly sealedCutoff: Schema.Struct<{
7537
+ readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
7538
+ readonly identity: Schema.String;
7539
+ readonly runCount: Schema.Number;
7540
+ }>;
7536
7541
  readonly selection: Schema.Struct<{
7537
7542
  readonly requestedRunIds: Schema.$Array<Schema.String>;
7538
7543
  readonly selectedRunIds: Schema.$Array<Schema.String>;
@@ -7542,11 +7547,6 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7542
7547
  readonly truncated: Schema.Boolean;
7543
7548
  }>;
7544
7549
  readonly behaviorVersion: Schema.Literal<"2.0.0">;
7545
- readonly sealedCutoff: Schema.Struct<{
7546
- readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
7547
- readonly identity: Schema.String;
7548
- readonly runCount: Schema.Number;
7549
- }>;
7550
7550
  readonly outcome: Schema.Literal<"explanation">;
7551
7551
  readonly operation: Schema.Literal<"run.get" | "project.get" | "overview.get" | "experiment.get" | "runs.list" | "run.summary" | "run.overview" | "attempt.get" | "attempt.assertion.detail" | "attempt.assertion.image" | "attempt.trace" | "attempt.trace.detail" | "attempt.timing" | "attempt.usage" | "attempt.diff" | "attempt.sources" | "attempt.artifacts" | "attempt.artifact" | "runs.compare">;
7552
7552
  readonly factKinds: Schema.Tuple<Schema.Literal<"assertions" | "core" | "artifacts" | "sources" | "adapter-usage" | "file-changes" | "agent-turns" | "sandbox-commands" | "runner-activities" | "runner-diagnostics" | "turn-contexts" | "current-project" | "attempt-cost" | "judge-usage" | "execution-traces">[]>;
@@ -7560,12 +7560,6 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7560
7560
  readonly evidence: Schema.Struct<{
7561
7561
  readonly refs: Schema.$Array<Schema.String>;
7562
7562
  }>;
7563
- readonly selection: Schema.Struct<{
7564
- readonly requestedRunIds: Schema.$Array<Schema.String>;
7565
- readonly selectedRunIds: Schema.$Array<Schema.String>;
7566
- readonly missingRunIds: Schema.$Array<Schema.String>;
7567
- }>;
7568
- readonly behaviorVersion: Schema.Literal<"2.0.0">;
7569
7563
  readonly sealedCutoff: Schema.Struct<{
7570
7564
  readonly kind: Schema.Literal<"inspection-sealed-cutoff">;
7571
7565
  readonly identity: Schema.String;
@@ -7575,6 +7569,12 @@ export declare const InspectionExplanationDocumentSchema: Schema.Union<(Schema.S
7575
7569
  readonly logicalSealIdentity: Schema.String;
7576
7570
  }>>;
7577
7571
  }>;
7572
+ readonly selection: Schema.Struct<{
7573
+ readonly requestedRunIds: Schema.$Array<Schema.String>;
7574
+ readonly selectedRunIds: Schema.$Array<Schema.String>;
7575
+ readonly missingRunIds: Schema.$Array<Schema.String>;
7576
+ }>;
7577
+ readonly behaviorVersion: Schema.Literal<"2.0.0">;
7578
7578
  readonly outcome: Schema.Literal<"explanation">;
7579
7579
  readonly operation: Schema.Literal<"run.get" | "project.get" | "overview.get" | "experiment.get" | "runs.list" | "run.summary" | "run.overview" | "attempt.get" | "attempt.assertion.detail" | "attempt.assertion.image" | "attempt.trace" | "attempt.trace.detail" | "attempt.timing" | "attempt.usage" | "attempt.diff" | "attempt.sources" | "attempt.artifacts" | "attempt.artifact" | "runs.compare">;
7580
7580
  readonly factKinds: Schema.Tuple<Schema.Literal<"assertions" | "core" | "artifacts" | "sources" | "adapter-usage" | "file-changes" | "agent-turns" | "sandbox-commands" | "runner-activities" | "runner-diagnostics" | "turn-contexts" | "current-project" | "attempt-cost" | "judge-usage" | "execution-traces">[]>;
@@ -93,8 +93,9 @@ function selectOperation(source, operation) {
93
93
  });
94
94
  }
95
95
  case "experiment.get": {
96
- const selected = (0, facts_ts_1.loadInspectionRuns)(source);
97
- const overview = (0, overview_ts_1.selectInspectionOverview)(selected);
96
+ const matching = (0, facts_ts_1.loadSelectedInspectionRuns)(source, source.findExperimentRunIds(operation.experimentId));
97
+ const selected = loadReferencedOrigins(source, matching);
98
+ const overview = (0, overview_ts_1.selectInspectionOverview)(matching, selected);
98
99
  const experiment = overview.experiments.find(({ experimentId }) => experimentId === operation.experimentId);
99
100
  if (experiment === undefined) {
100
101
  throw selectionMissing(operation.kind, `Experiment ${operation.experimentId} was not found`);
@@ -104,6 +105,9 @@ function selectOperation(source, operation) {
104
105
  let unresolvedAttemptCount = 0;
105
106
  let selectedSlotCount = 0;
106
107
  let resolvedSlotCount = 0;
108
+ const origins = new Map(selected.map((origin) => [origin.run.runId, {
109
+ origin, attempts: new Map(origin.attempts.map((attempt) => [attempt.attemptId, attempt])),
110
+ }]));
107
111
  for (const cell of experimentCells) {
108
112
  for (const member of cell.members) {
109
113
  selectedSlotCount++;
@@ -112,9 +116,9 @@ function selectOperation(source, operation) {
112
116
  continue;
113
117
  }
114
118
  const identity = member.publication;
115
- const origin = selected.find(({ run }) => run.runId === identity.originRunId);
116
- const attempt = origin?.attempts.find((candidate) => candidate.attemptId === identity.attemptId &&
117
- candidate.originRunId === identity.originRunId);
119
+ const indexed = origins.get(identity.originRunId);
120
+ const origin = indexed?.origin;
121
+ const attempt = indexed?.attempts.get(identity.attemptId);
118
122
  if (origin === undefined || attempt === undefined) {
119
123
  unresolvedAttemptCount++;
120
124
  continue;
@@ -459,7 +463,7 @@ function loadForOperation(source, operation) {
459
463
  };
460
464
  }
461
465
  if (operation.kind === "experiment.get") {
462
- return { selected: (0, facts_ts_1.loadInspectionRuns)(source), requestedRunIds: [], missingRunIds: [] };
466
+ return { selected: loadReferencedOrigins(source, (0, facts_ts_1.loadSelectedInspectionRuns)(source, source.findExperimentRunIds(operation.experimentId))), requestedRunIds: [], missingRunIds: [] };
463
467
  }
464
468
  if (operation.kind === "runs.list")
465
469
  return { selected: [], requestedRunIds: [], missingRunIds: [] };