@bjoernrochel/sevro 0.1.0-rc.8 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/CONTRIBUTING.md +22 -6
  2. package/README.md +5 -1
  3. package/docs/README.md +19 -15
  4. package/docs/architecture.md +138 -17
  5. package/docs/assets/README.md +5 -4
  6. package/docs/builtin-graders-v1.md +9 -2
  7. package/docs/codex-host.md +155 -57
  8. package/docs/contracts.md +2 -1
  9. package/docs/creating-cases.md +9 -2
  10. package/docs/development-cli.md +187 -19
  11. package/docs/documentation-quality.md +12 -2
  12. package/docs/evaluation-workflow.md +110 -0
  13. package/docs/extension-protocol-v1.md +26 -3
  14. package/docs/getting-started.md +23 -2
  15. package/docs/guide-evaluation.md +33 -1
  16. package/docs/identity-v1.md +25 -2
  17. package/docs/installing.md +11 -11
  18. package/docs/native-controls.md +76 -5
  19. package/docs/native-hosts.md +196 -7
  20. package/docs/reading-results.md +102 -0
  21. package/docs/recipes.md +489 -0
  22. package/docs/releases.md +31 -12
  23. package/docs/report-v1.md +29 -1
  24. package/docs/results-v1.md +122 -4
  25. package/docs/run-settings-v1.md +147 -0
  26. package/docs/runtime-v1.md +255 -22
  27. package/docs/troubleshooting.md +12 -12
  28. package/docs/typescript-quality.md +89 -26
  29. package/examples/recipes/candidate.ts +26 -0
  30. package/examples/recipes/cases/coding-change.json +21 -0
  31. package/examples/recipes/cases/host-tools.json +21 -0
  32. package/examples/recipes/cases/mise.json +21 -0
  33. package/examples/recipes/cases/node.json +21 -0
  34. package/examples/recipes/cases/python-uv.json +21 -0
  35. package/examples/recipes/cases/semantic.json +17 -0
  36. package/examples/recipes/coding-change/check.ts +23 -0
  37. package/examples/recipes/extension-artifacts.ts +65 -0
  38. package/examples/recipes/extension-methods.ts +174 -0
  39. package/examples/recipes/extension.ts +37 -0
  40. package/examples/recipes/repository-skill/.agents/skills/startup-guide/SKILL.md +7 -0
  41. package/examples/recipes/repository-skill/.claude/skills/startup-guide/SKILL.md +7 -0
  42. package/examples/recipes/repository-skill/README.md +3 -0
  43. package/examples/recipes/run-inputs.ts +188 -0
  44. package/examples/recipes/run-options.ts +131 -0
  45. package/examples/recipes/run.ts +63 -0
  46. package/examples/recipes/runtime/empty.json +1 -0
  47. package/examples/recipes/runtime/goals.json +1 -0
  48. package/examples/recipes/runtime/mise.json +6 -0
  49. package/examples/recipes/runtime/path.json +1 -0
  50. package/examples/recipes/runtime/plugins.json +4 -0
  51. package/examples/recipes/runtime/python-uv.json +10 -0
  52. package/examples/recipes/semantic-judge.ts +29 -0
  53. package/examples/templates/coding/adapter.ts +17 -0
  54. package/examples/templates/coding/case.json +15 -0
  55. package/examples/templates/repository-skill/.agents/skills/startup-guide/SKILL.md +6 -0
  56. package/examples/templates/repository-skill/extension-data.ts +64 -0
  57. package/examples/templates/repository-skill/extension.ts +31 -0
  58. package/examples/templates/response/adapter.ts +12 -0
  59. package/examples/templates/response/case.json +13 -0
  60. package/package.json +11 -5
  61. package/schemas/report-v1.schema.json +9 -0
  62. package/schemas/run-evidence-v1.schema.json +2 -1
  63. package/schemas/runtime-v1.schema.json +43 -7
  64. package/src/advisory.ts +2 -2
  65. package/src/candidate-artifacts.ts +42 -11
  66. package/src/candidate-codex-state.ts +185 -0
  67. package/src/case-validation.ts +73 -50
  68. package/src/cli/cancellation.ts +20 -0
  69. package/src/cli/command.ts +87 -0
  70. package/src/cli/completion.ts +15 -0
  71. package/src/cli/demo.ts +60 -0
  72. package/src/cli/evaluation.ts +55 -0
  73. package/src/cli/extension.ts +79 -0
  74. package/src/cli/help.ts +198 -0
  75. package/src/cli/hosts.ts +55 -0
  76. package/src/cli/init-settings.ts +30 -0
  77. package/src/cli/init.ts +111 -0
  78. package/src/{cli-invocation.ts → cli/invocation.ts} +214 -218
  79. package/src/cli/loading.ts +151 -0
  80. package/src/cli/preparation.ts +154 -0
  81. package/src/cli/presentation.ts +93 -0
  82. package/src/cli/progress.ts +6 -0
  83. package/src/cli/run-manifest.ts +128 -0
  84. package/src/cli/run-options.ts +403 -0
  85. package/src/cli/run-overrides.ts +69 -0
  86. package/src/cli/settings.ts +154 -0
  87. package/src/cli/summary.ts +43 -0
  88. package/src/cli.ts +13 -591
  89. package/src/contract-types.ts +94 -0
  90. package/src/engine.ts +9 -5
  91. package/src/evaluation/advisory.ts +150 -0
  92. package/src/{evaluation-check-plan.ts → evaluation/check-plan.ts} +103 -67
  93. package/src/evaluation/collection.ts +88 -0
  94. package/src/evaluation/context.ts +10 -0
  95. package/src/{evaluation-grading-host.ts → evaluation/grading-host.ts} +5 -5
  96. package/src/evaluation/grading.ts +235 -0
  97. package/src/{evaluation-invocation-plan.ts → evaluation/invocation-plan.ts} +147 -58
  98. package/src/{evaluation-plan.ts → evaluation/plan.ts} +208 -141
  99. package/src/evaluation/progress.ts +19 -0
  100. package/src/evaluation/resources.ts +241 -0
  101. package/src/evaluation/run.ts +206 -0
  102. package/src/{evaluation-semantic.ts → evaluation/semantic.ts} +77 -87
  103. package/src/evaluation/trial.ts +800 -0
  104. package/src/{evaluation-types.ts → evaluation/types.ts} +79 -29
  105. package/src/evidence/host-results.ts +85 -0
  106. package/src/evidence/retained-artifacts.ts +18 -0
  107. package/src/evidence/trial-writer.ts +203 -0
  108. package/src/evidence/usage.ts +17 -0
  109. package/src/extension-client.ts +34 -96
  110. package/src/extension-session.ts +24 -48
  111. package/src/{advisory-fixture.ts → fixtures/advisory.ts} +12 -72
  112. package/src/{fixture-bin.ts → fixtures/bin.ts} +1 -1
  113. package/src/{fixture-cleanup.ts → fixtures/cleanup.ts} +13 -7
  114. package/src/fixtures/create.ts +183 -0
  115. package/src/{generated-fixture.ts → fixtures/generated.ts} +10 -53
  116. package/src/{git-hooks.ts → fixtures/git-hooks.ts} +1 -1
  117. package/src/{preparation.ts → fixtures/preparation.ts} +6 -16
  118. package/src/{repository-fixture.ts → fixtures/repository.ts} +30 -64
  119. package/src/{fixture-setup.ts → fixtures/setup.ts} +33 -51
  120. package/src/{fixture-tools.ts → fixtures/tools.ts} +1 -1
  121. package/src/{workspace-state.ts → fixtures/workspace-state.ts} +5 -5
  122. package/src/generated/cli-result.d.cts +2 -1
  123. package/src/generated/extension.d.cts +2 -1
  124. package/src/generated/report.cjs +1 -1
  125. package/src/generated/report.d.cts +2 -1
  126. package/src/generated/run-evidence.cjs +1 -1
  127. package/src/generated/run-evidence.d.cts +2 -1
  128. package/src/generated/runtime.cjs +1 -1
  129. package/src/generated/runtime.d.cts +2 -1
  130. package/src/git.ts +93 -0
  131. package/src/graders/git-head.ts +29 -84
  132. package/src/graders/shell.ts +50 -68
  133. package/src/host-diagnostic-redaction.ts +52 -0
  134. package/src/host-diagnostics.ts +331 -0
  135. package/src/hosts/claude-continuation.ts +57 -40
  136. package/src/hosts/claude-credential.ts +160 -63
  137. package/src/hosts/claude-events.ts +34 -18
  138. package/src/hosts/claude-keychain.ts +78 -21
  139. package/src/hosts/claude-login-recovery.ts +85 -0
  140. package/src/hosts/claude-login-refresh.ts +178 -0
  141. package/src/hosts/claude-login-store.ts +162 -0
  142. package/src/hosts/claude-login.ts +107 -0
  143. package/src/hosts/claude-native-goal.ts +15 -12
  144. package/src/hosts/claude-process.ts +10 -50
  145. package/src/hosts/claude-refresh-lock.ts +81 -0
  146. package/src/hosts/claude-repository-invocation.ts +9 -34
  147. package/src/hosts/claude-settings.ts +46 -9
  148. package/src/hosts/claude-skill-activations.ts +169 -0
  149. package/src/hosts/claude-state.ts +28 -15
  150. package/src/hosts/claude-tool-calls.ts +13 -10
  151. package/src/hosts/claude.ts +121 -81
  152. package/src/hosts/codex-app-server.ts +78 -52
  153. package/src/hosts/codex-configuration.ts +5 -10
  154. package/src/hosts/codex-exec-controls.ts +516 -0
  155. package/src/hosts/codex-marketplace.ts +12 -10
  156. package/src/hosts/codex-native-calls.ts +15 -122
  157. package/src/hosts/codex-process.ts +10 -183
  158. package/src/hosts/codex-profile.ts +36 -21
  159. package/src/hosts/codex-session-files.ts +1 -9
  160. package/src/hosts/codex-state.ts +134 -18
  161. package/src/hosts/codex.ts +210 -183
  162. package/src/hosts/isolation-common.ts +8 -11
  163. package/src/hosts/isolation-roots.ts +2 -2
  164. package/src/hosts/linux-sandbox.ts +15 -2
  165. package/src/hosts/mac-sandbox.ts +87 -18
  166. package/src/hosts/native-controls.ts +72 -22
  167. package/src/hosts/native-request.ts +55 -0
  168. package/src/hosts/process-lifecycle.ts +216 -48
  169. package/src/hosts/protected-worktrees.ts +1 -1
  170. package/src/hosts/skill-hook-catalog.ts +131 -0
  171. package/src/hosts/skill-hook-handler.ts +374 -0
  172. package/src/hosts/skill-hooks.ts +577 -0
  173. package/src/instrumentation.ts +7 -8
  174. package/src/native-transcript-state.ts +22 -3
  175. package/src/native-transcript-view.ts +52 -13
  176. package/src/native-transcripts.ts +26 -11
  177. package/src/paths.ts +22 -0
  178. package/src/process-lifecycle.ts +150 -0
  179. package/src/provenance.ts +27 -7
  180. package/src/prune.ts +300 -0
  181. package/src/report.ts +63 -36
  182. package/src/resolved-case.ts +1 -1
  183. package/src/results-lock.ts +42 -0
  184. package/src/results.ts +14 -18
  185. package/src/{runtime-config.ts → runtime/config.ts} +160 -46
  186. package/src/{runtime-discovery-apple.ts → runtime/discovery-apple.ts} +3 -3
  187. package/src/{runtime-discovery-providers.ts → runtime/discovery-providers.ts} +3 -9
  188. package/src/{runtime-discovery.ts → runtime/discovery.ts} +4 -4
  189. package/src/{runtime-hook-processes.ts → runtime/hook-processes.ts} +1 -1
  190. package/src/{runtime-hooks.ts → runtime/hooks.ts} +32 -22
  191. package/src/{runtime-paths.ts → runtime/paths.ts} +5 -19
  192. package/src/{runtime-query.ts → runtime/query.ts} +5 -5
  193. package/src/{runtime-seeds.ts → runtime/seeds.ts} +3 -3
  194. package/src/runtime/shared-cache.ts +130 -0
  195. package/src/{runtime-state.ts → runtime/state.ts} +28 -11
  196. package/src/schema-types.ts +73 -161
  197. package/src/shell.ts +4 -0
  198. package/src/transcript-retention.ts +146 -0
  199. package/src/value-guards.ts +22 -0
  200. package/docs/assets/sevro-logo.png +0 -0
  201. package/docs/assets/sevro-symbol.svg +0 -1
  202. package/docs/assets/sevro-wordmark.svg +0 -1
  203. package/docs/cache-ownership-validation.md +0 -49
  204. package/docs/claude-continuation-validation.md +0 -47
  205. package/docs/concurrency-validation.md +0 -86
  206. package/docs/configuration-root-validation.md +0 -70
  207. package/docs/engine-slice.md +0 -114
  208. package/docs/evidence/runtime-startup-30/README.md +0 -185
  209. package/docs/evidence/runtime-startup-30/after.json +0 -319
  210. package/docs/evidence/runtime-startup-30/baseline-timeout.jsonl +0 -2
  211. package/docs/evidence/runtime-startup-30/before.json +0 -403
  212. package/docs/evidence/runtime-startup-30/consumer-smoke.json +0 -63
  213. package/docs/evidence/runtime-startup-30/full-policy-diagnostic.jsonl +0 -3
  214. package/docs/evidence/runtime-startup-30/minimal-policy-diagnostic.jsonl +0 -3
  215. package/docs/evidence/runtime-startup-30/plugin-template-assessment.json +0 -20
  216. package/docs/evidence/runtime-startup-30/seedless-timeout.jsonl +0 -2
  217. package/docs/evidence.md +0 -17
  218. package/docs/fixture-cleanup-validation.md +0 -73
  219. package/docs/guide-verification.json +0 -239
  220. package/src/evaluation-context.ts +0 -259
  221. package/src/evaluation-fixture.ts +0 -302
  222. package/src/evaluation-run.ts +0 -200
  223. package/src/evaluation-trial.ts +0 -1016
  224. package/src/hosts/claude-nested-skills.ts +0 -272
  225. package/src/hosts/codex-command-output.ts +0 -510
  226. package/src/hosts/codex-executor-command.ts +0 -291
  227. package/src/hosts/codex-skill-reads.ts +0 -783
  228. /package/src/{trial-scheduler.ts → evaluation/scheduler.ts} +0 -0
@@ -1,10 +1,12 @@
1
- import { isRecord, isStringArray } from "./value-guards";
2
- import { isMissingFile } from "./fixture-tools";
1
+ import { isRecord, isStringArray } from "../value-guards";
2
+ import { isMissingFile } from "./tools";
3
3
  import { lstat, mkdir, realpath, stat, writeFile } from "node:fs/promises";
4
- import { isAbsolute, join, relative, sep } from "node:path";
4
+ import { isAbsolute, join } from "node:path";
5
+ import { insideRoot } from "../paths";
6
+ import { runGit } from "../git";
5
7
  import { fileURLToPath } from "node:url";
6
- import { canonicalJson } from "./identity";
7
- import { prepareFixtureBin } from "./fixture-bin";
8
+ import { canonicalJson } from "../identity";
9
+ import { prepareFixtureBin } from "./bin";
8
10
  import { prepareGitHooks } from "./git-hooks";
9
11
  import type { PreparationSources } from "./preparation";
10
12
  import { fixtureParts } from "./preparation";
@@ -167,53 +169,16 @@ export interface RepositorySource {
167
169
  revision: string;
168
170
  }
169
171
 
170
- async function boundedText(
171
- stream: ReadableStream<Uint8Array>,
172
- ): Promise<string> {
173
- const chunks: Uint8Array[] = [];
174
- let size = 0;
175
- for await (const chunk of stream) {
176
- size += chunk.byteLength;
177
- if (size > MAX_GIT_OUTPUT_BYTES)
178
- throw new Error("repository fixture Git output is too large");
179
- chunks.push(chunk);
180
- }
181
- return new TextDecoder("utf-8", { fatal: true }).decode(
182
- Buffer.concat(chunks),
183
- );
184
- }
185
-
186
172
  async function git(args: string[], cwd: string): Promise<string> {
187
- const proc = Bun.spawn(["git", ...args], {
173
+ const stdout = await runGit({
188
174
  cwd,
189
- stdout: "pipe",
190
- stderr: "pipe",
191
- env: {
192
- ...process.env,
193
- GIT_CONFIG_NOSYSTEM: "1",
194
- GIT_CONFIG_GLOBAL: process.platform === "win32" ? "NUL" : "/dev/null",
195
- GIT_TERMINAL_PROMPT: "0",
196
- GIT_AUTHOR_NAME: "Sevro Fixture",
197
- GIT_AUTHOR_EMAIL: "fixture@sevro.invalid",
198
- GIT_COMMITTER_NAME: "Sevro Fixture",
199
- GIT_COMMITTER_EMAIL: "fixture@sevro.invalid",
200
- GIT_AUTHOR_DATE: "2000-01-01T00:00:00+00:00",
201
- GIT_COMMITTER_DATE: "2000-01-01T00:00:00+00:00",
202
- },
175
+ args,
176
+ identity: "fixture",
177
+ label: "repository fixture",
178
+ maxOutputBytes: MAX_GIT_OUTPUT_BYTES,
179
+ validateUtf8: true,
203
180
  });
204
- try {
205
- const [stdout, , code] = await Promise.all([
206
- boundedText(proc.stdout),
207
- boundedText(proc.stderr),
208
- proc.exited,
209
- ]);
210
- if (code !== 0) throw new Error("repository fixture Git operation failed");
211
- return stdout.trim();
212
- } catch (error) {
213
- proc.kill("SIGKILL");
214
- await proc.exited;
215
- throw error;
216
- }
181
+ return new TextDecoder("utf-8", { fatal: true }).decode(stdout).trim();
217
182
  }
218
183
 
219
184
  /** Resolve a declared local repository without accepting a dirty source tree. */
@@ -261,8 +226,7 @@ async function canonicalRepositorySource(selected: {
261
226
  }
262
227
  }
263
228
  function requireContainedRepository(root: string, path: string): void {
264
- const child = relative(root, path);
265
- if (child === ".." || child.startsWith(`..${sep}`) || isAbsolute(child))
229
+ if (!insideRoot(root, path))
266
230
  throw new Error("repository source escapes its declared root");
267
231
  }
268
232
  async function repositoryCommit(path: string): Promise<string> {
@@ -272,10 +236,18 @@ async function repositoryCommit(path: string): Promise<string> {
272
236
  const revision = await git(["rev-parse", "--verify", "HEAD^{commit}"], path);
273
237
  if (!/^[a-f0-9]{40,64}$/.test(revision))
274
238
  throw new Error("repository source has no valid commit");
275
- if (await git(["status", "--porcelain=v1", "--untracked-files=all"], path))
239
+ if (
240
+ await git(
241
+ [
242
+ "status",
243
+ "--porcelain=v1",
244
+ "--untracked-files=all",
245
+ "--ignore-submodules=none",
246
+ ],
247
+ path,
248
+ )
249
+ )
276
250
  throw new Error("repository source has uncommitted changes");
277
- if (await git(["submodule", "status"], path))
278
- throw new Error("repository submodules are not supported");
279
251
  return revision;
280
252
  }
281
253
  function requireRepositorySnapshot(
@@ -306,6 +278,7 @@ export async function cloneRepositorySource(
306
278
  "--local",
307
279
  "--no-hardlinks",
308
280
  "--no-checkout",
281
+ "--no-recurse-submodules",
309
282
  "--quiet",
310
283
  current.path,
311
284
  workspace,
@@ -375,25 +348,18 @@ export async function applyRepositoryOverlay(
375
348
  });
376
349
  await stageRepositoryOverlay(fixture, workspace, Object.keys(files));
377
350
  }
378
- function disabledHooksArgs(): string[] {
379
- return [
380
- "-c",
381
- `core.hooksPath=${process.platform === "win32" ? "NUL" : "/dev/null"}`,
382
- ];
383
- }
384
351
  async function stageRepositoryOverlay(
385
352
  fixture: RepositoryFixture,
386
353
  workspace: string,
387
354
  paths: string[],
388
355
  ): Promise<void> {
389
- const noHooks = disabledHooksArgs();
390
356
  if (fixture.commitFiles) {
391
- await git([...noHooks, "add", "--", ...paths], workspace);
357
+ await git(["add", "--", ...paths], workspace);
392
358
  await git(
393
- [...noHooks, "commit", "--quiet", "-m", "Add evaluation scaffolding"],
359
+ ["commit", "--quiet", "-m", "Add evaluation scaffolding"],
394
360
  workspace,
395
361
  );
396
362
  }
397
363
  if (fixture.staged?.length)
398
- await git([...noHooks, "add", "--", ...fixture.staged], workspace);
364
+ await git(["add", "--", ...fixture.staged], workspace);
399
365
  }
@@ -1,7 +1,12 @@
1
- import { mkdtemp, rm } from "node:fs/promises";
1
+ import { mkdir, mkdtemp, rm } from "node:fs/promises";
2
2
  import { tmpdir } from "node:os";
3
3
  import { delimiter, isAbsolute, join } from "node:path";
4
- import { isRecord } from "./value-guards";
4
+ import { isRecord } from "../value-guards";
5
+ import { requireCandidateRuntime } from "../candidate-artifacts";
6
+ import {
7
+ ProcessDeadline,
8
+ terminateOwnedProcessGroup,
9
+ } from "../process-lifecycle";
5
10
 
6
11
  const MAX_COMMAND_BYTES = 64 * 1024;
7
12
  const MAX_ENV_BYTES = 16 * 1024;
@@ -103,27 +108,12 @@ export function prepareFixtureSetup(value: unknown): FixtureSetup | null {
103
108
  return { command, environment };
104
109
  }
105
110
 
106
- function stopProcess(proc: Bun.Subprocess): void {
107
- if (process.platform !== "win32") {
108
- try {
109
- process.kill(-proc.pid, "SIGKILL");
110
- return;
111
- } catch {
112
- // The process group may already be gone.
113
- }
114
- }
115
- try {
116
- proc.kill("SIGKILL");
117
- } catch {
118
- // The process already exited.
119
- }
120
- }
121
-
122
111
  interface FixtureSetupOptions {
123
112
  workspace: string;
124
113
  projectRoot: string;
125
114
  fixtureBinDir?: string;
126
115
  signal?: AbortSignal;
116
+ candidateRuntimeRoot?: string;
127
117
  }
128
118
 
129
119
  function setupPath(directory: string | undefined): string {
@@ -146,7 +136,9 @@ function executionEnvironment(
146
136
  );
147
137
  return {
148
138
  PATH: setupPath(options.fixtureBinDir),
149
- HOME: home,
139
+ HOME: options.candidateRuntimeRoot
140
+ ? join(options.candidateRuntimeRoot, "home")
141
+ : home,
150
142
  TMPDIR: home,
151
143
  LANG: process.env.LANG ?? "C",
152
144
  GIT_CONFIG_GLOBAL: process.platform === "win32" ? "NUL" : "/dev/null",
@@ -164,13 +156,23 @@ function executionEnvironment(
164
156
 
165
157
  class FixtureSetupExecution {
166
158
  private proc: Bun.Subprocess | undefined;
167
- private timer: ReturnType<typeof setTimeout> | undefined;
168
- private cancel: (() => void) | undefined;
159
+ private readonly deadline: ProcessDeadline;
169
160
  constructor(
170
161
  private readonly setup: FixtureSetup,
171
162
  private readonly options: FixtureSetupOptions,
172
163
  private readonly home: string,
173
- ) {}
164
+ ) {
165
+ this.deadline = new ProcessDeadline({
166
+ timeoutMs: TIMEOUT_MS,
167
+ signal: options.signal,
168
+ interruption: (reason) =>
169
+ new Error(
170
+ reason === "timeout"
171
+ ? "fixture setup timed out"
172
+ : "fixture setup cancelled",
173
+ ),
174
+ });
175
+ }
174
176
 
175
177
  async run(): Promise<void> {
176
178
  this.proc = Bun.spawn(this.setup.command, {
@@ -181,44 +183,18 @@ class FixtureSetupExecution {
181
183
  stdout: "ignore",
182
184
  stderr: "ignore",
183
185
  });
184
- const code = await Promise.race([
185
- this.proc.exited,
186
- this.timeout(),
187
- this.aborted(),
188
- ]);
186
+ const code = await this.deadline.wait(this.proc.exited);
189
187
  if (code !== 0) throw new Error(`fixture setup failed (${code})`);
190
188
  }
191
189
 
192
- private timeout(): Promise<never> {
193
- return new Promise((_resolve, reject) => {
194
- this.timer = setTimeout(() => {
195
- reject(new Error("fixture setup timed out"));
196
- }, TIMEOUT_MS);
197
- });
198
- }
199
-
200
- private aborted(): Promise<never> {
201
- return new Promise((_resolve, reject) => {
202
- const signal = this.options.signal;
203
- if (!signal) return;
204
- this.cancel = () => {
205
- reject(new Error("fixture setup cancelled"));
206
- };
207
- if (signal.aborted) this.cancel();
208
- else signal.addEventListener("abort", this.cancel, { once: true });
209
- });
210
- }
211
-
212
190
  async stop(): Promise<void> {
213
191
  if (!this.proc) return;
214
- stopProcess(this.proc);
192
+ terminateOwnedProcessGroup(this.proc);
215
193
  await this.proc.exited;
216
194
  }
217
195
 
218
196
  async dispose(): Promise<void> {
219
- if (this.timer) clearTimeout(this.timer);
220
- if (this.cancel)
221
- this.options.signal?.removeEventListener("abort", this.cancel);
197
+ this.deadline.dispose();
222
198
  await rm(this.home, { recursive: true, force: true });
223
199
  }
224
200
  }
@@ -229,6 +205,12 @@ export async function runFixtureSetup(
229
205
  options: FixtureSetupOptions,
230
206
  ): Promise<void> {
231
207
  if (options.signal?.aborted) throw new Error("fixture setup cancelled");
208
+ await requireCandidateRuntime(options.candidateRuntimeRoot);
209
+ if (options.candidateRuntimeRoot)
210
+ await mkdir(join(options.candidateRuntimeRoot, "home"), {
211
+ recursive: true,
212
+ mode: 0o700,
213
+ });
232
214
  const home = await mkdtemp(join(tmpdir(), "sevro-setup-"));
233
215
  const execution = new FixtureSetupExecution(setup, options, home);
234
216
  try {
@@ -1,6 +1,6 @@
1
1
  import { chmod, lstat, writeFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
- import { isRecord } from "./value-guards";
3
+ import { isRecord } from "../value-guards";
4
4
 
5
5
  export function isMissingFile(error: unknown): boolean {
6
6
  return error instanceof Error && "code" in error && error.code === "ENOENT";
@@ -17,11 +17,11 @@ import {
17
17
  processIdentity,
18
18
  validProcessIdentity,
19
19
  type ProcessIdentity,
20
- } from "./run-owner";
21
- import { isRecord } from "./value-guards";
22
- import { isMissingFile } from "./fixture-tools";
23
- import { atomicWriteJson } from "./storage";
24
- import { clearFixtureContents } from "./fixture-cleanup";
20
+ } from "../run-owner";
21
+ import { isRecord } from "../value-guards";
22
+ import { isMissingFile } from "./tools";
23
+ import { atomicWriteJson } from "../storage";
24
+ import { clearFixtureContents } from "./cleanup";
25
25
 
26
26
  const RETENTION_MS = 24 * 60 * 60_000;
27
27
  interface WorkspaceOwner {
@@ -1,3 +1,4 @@
1
1
  // Generated by bun run schemas:generate; do not edit.
2
- declare function validate(value: unknown): boolean;
2
+ import type { ValidateFunction } from "ajv";
3
+ declare const validate: ValidateFunction;
3
4
  export = validate;
@@ -1,3 +1,4 @@
1
1
  // Generated by bun run schemas:generate; do not edit.
2
- declare function validate(value: unknown): boolean;
2
+ import type { ValidateFunction } from "ajv";
3
+ declare const validate: ValidateFunction;
3
4
  export = validate;
@@ -1,2 +1,2 @@
1
1
  // Generated by bun run schemas:generate; do not edit.
2
- "use strict";module.exports = validate35;module.exports.default = validate35;const schema90 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"urn:sevro:schema:report:v1","title":"Sevro report v1","type":"object","required":["format","inputs","rows","summary"],"properties":{"format":{"const":"sevro.report.v1"},"inputs":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/input"}},"rows":{"type":"array","items":{"$ref":"#/$defs/row"}},"summary":{"type":"object","required":["cases","passed","failed","notAssessed"],"properties":{"cases":{"type":"integer","minimum":0},"passed":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"notAssessed":{"type":"integer","minimum":0}},"additionalProperties":false}},"additionalProperties":false,"$defs":{"path":{"type":"string","minLength":1},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"state":{"enum":["completed","failed","cancelled","not_run","error","unavailable","not_requested"]},"verdict":{"enum":["passed","failed","not_assessed"]},"input":{"type":"object","required":["resultFile","execution","grading","task","exitCode","caseCount"],"properties":{"resultFile":{"$ref":"#/$defs/path"},"execution":{"enum":["completed","failed","cancelled","not_run"]},"grading":{"enum":["completed","error","unavailable","not_requested"]},"task":{"$ref":"#/$defs/verdict"},"exitCode":{"enum":[0,1,2,3,4,64,70,130,143]},"caseCount":{"type":"integer","minimum":0}},"additionalProperties":false},"route":{"type":"object","required":["host","model","effort"],"properties":{"host":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1}},"additionalProperties":false},"outcome":{"type":"object","required":["trial","id","status"],"properties":{"trial":{"type":"integer","minimum":1},"id":{"type":"string","minLength":1},"status":{"enum":["passed","failed","unavailable"]}},"additionalProperties":false},"row":{"type":"object","required":["resultFile","evidencePath","runId","caseId","execution","grading","task","exitCode","trialCount","taskPassRate","candidateDurationMs","inputTokens","outputTokens","costUsd","runnerBuildDigest","evaluationDigest","requestedCondition","actualCondition","candidateRoute","routes","domainOutcomes"],"properties":{"resultFile":{"$ref":"#/$defs/path"},"evidencePath":{"type":["string","null"]},"runId":{"type":["string","null"]},"caseId":{"type":"string","minLength":1},"execution":{"$ref":"#/$defs/state"},"grading":{"$ref":"#/$defs/state"},"task":{"$ref":"#/$defs/verdict"},"exitCode":{"enum":[0,1,2,3,4,64,70,130,143]},"trialCount":{"type":"integer","minimum":0},"taskPassRate":{"type":["number","null"],"minimum":0,"maximum":1},"candidateDurationMs":{"type":["number","null"],"minimum":0},"inputTokens":{"type":["integer","null"],"minimum":0},"outputTokens":{"type":["integer","null"],"minimum":0},"costUsd":{"type":["number","null"],"minimum":0},"runnerBuildDigest":{"oneOf":[{"$ref":"#/$defs/digest"},{"type":"null"}]},"evaluationDigest":{"oneOf":[{"$ref":"#/$defs/digest"},{"type":"null"}]},"requestedCondition":{"enum":["passive","enforced",null]},"actualCondition":{"enum":["passive","enforced","unknown",null]},"candidateRoute":{"oneOf":[{"$ref":"#/$defs/route"},{"type":"null"}]},"routes":{"type":"array","items":{"type":"object","required":["role","host","model","effort"],"properties":{"role":{"enum":["candidate","semantic","advisory"]},"host":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1}},"additionalProperties":false}},"domainOutcomes":{"type":"array","items":{"$ref":"#/$defs/outcome"}}},"additionalProperties":false}}};const schema91 = {"type":"object","required":["resultFile","execution","grading","task","exitCode","caseCount"],"properties":{"resultFile":{"$ref":"#/$defs/path"},"execution":{"enum":["completed","failed","cancelled","not_run"]},"grading":{"enum":["completed","error","unavailable","not_requested"]},"task":{"$ref":"#/$defs/verdict"},"exitCode":{"enum":[0,1,2,3,4,64,70,130,143]},"caseCount":{"type":"integer","minimum":0}},"additionalProperties":false};const schema92 = {"type":"string","minLength":1};const schema93 = {"enum":["passed","failed","not_assessed"]};const func2 = require("ajv/dist/runtime/ucs2length").default;function validate36(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate36.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((((((data.resultFile === undefined) && (missing0 = "resultFile")) || ((data.execution === undefined) && (missing0 = "execution"))) || ((data.grading === undefined) && (missing0 = "grading"))) || ((data.task === undefined) && (missing0 = "task"))) || ((data.exitCode === undefined) && (missing0 = "exitCode"))) || ((data.caseCount === undefined) && (missing0 = "caseCount"))){validate36.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs1 = errors;for(const key0 in data){if(!((((((key0 === "resultFile") || (key0 === "execution")) || (key0 === "grading")) || (key0 === "task")) || (key0 === "exitCode")) || (key0 === "caseCount"))){validate36.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.resultFile !== undefined){let data0 = data.resultFile;const _errs2 = errors;const _errs3 = errors;if(errors === _errs3){if(typeof data0 === "string"){if(func2(data0) < 1){validate36.errors = [{instancePath:instancePath+"/resultFile",schemaPath:"#/$defs/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate36.errors = [{instancePath:instancePath+"/resultFile",schemaPath:"#/$defs/path/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.execution !== undefined){let data1 = data.execution;const _errs5 = errors;if(!((((data1 === "completed") || (data1 === "failed")) || (data1 === "cancelled")) || (data1 === "not_run"))){validate36.errors = [{instancePath:instancePath+"/execution",schemaPath:"#/properties/execution/enum",keyword:"enum",params:{allowedValues: schema91.properties.execution.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs5 === errors;}else {var valid0 = true;}if(valid0){if(data.grading !== undefined){let data2 = data.grading;const _errs6 = errors;if(!((((data2 === "completed") || (data2 === "error")) || (data2 === "unavailable")) || (data2 === "not_requested"))){validate36.errors = [{instancePath:instancePath+"/grading",schemaPath:"#/properties/grading/enum",keyword:"enum",params:{allowedValues: schema91.properties.grading.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs6 === errors;}else {var valid0 = true;}if(valid0){if(data.task !== undefined){let data3 = data.task;const _errs7 = errors;if(!(((data3 === "passed") || (data3 === "failed")) || (data3 === "not_assessed"))){validate36.errors = [{instancePath:instancePath+"/task",schemaPath:"#/$defs/verdict/enum",keyword:"enum",params:{allowedValues: schema93.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs7 === errors;}else {var valid0 = true;}if(valid0){if(data.exitCode !== undefined){let data4 = data.exitCode;const _errs9 = errors;if(!(((((((((data4 === 0) || (data4 === 1)) || (data4 === 2)) || (data4 === 3)) || (data4 === 4)) || (data4 === 64)) || (data4 === 70)) || (data4 === 130)) || (data4 === 143))){validate36.errors = [{instancePath:instancePath+"/exitCode",schemaPath:"#/properties/exitCode/enum",keyword:"enum",params:{allowedValues: schema91.properties.exitCode.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.caseCount !== undefined){let data5 = data.caseCount;const _errs10 = errors;if(!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))){validate36.errors = [{instancePath:instancePath+"/caseCount",schemaPath:"#/properties/caseCount/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs10){if((typeof data5 == "number") && (isFinite(data5))){if(data5 < 0 || isNaN(data5)){validate36.errors = [{instancePath:instancePath+"/caseCount",schemaPath:"#/properties/caseCount/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs10 === errors;}else {var valid0 = true;}}}}}}}}}else {validate36.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate36.errors = vErrors;return errors === 0;}validate36.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema94 = {"type":"object","required":["resultFile","evidencePath","runId","caseId","execution","grading","task","exitCode","trialCount","taskPassRate","candidateDurationMs","inputTokens","outputTokens","costUsd","runnerBuildDigest","evaluationDigest","requestedCondition","actualCondition","candidateRoute","routes","domainOutcomes"],"properties":{"resultFile":{"$ref":"#/$defs/path"},"evidencePath":{"type":["string","null"]},"runId":{"type":["string","null"]},"caseId":{"type":"string","minLength":1},"execution":{"$ref":"#/$defs/state"},"grading":{"$ref":"#/$defs/state"},"task":{"$ref":"#/$defs/verdict"},"exitCode":{"enum":[0,1,2,3,4,64,70,130,143]},"trialCount":{"type":"integer","minimum":0},"taskPassRate":{"type":["number","null"],"minimum":0,"maximum":1},"candidateDurationMs":{"type":["number","null"],"minimum":0},"inputTokens":{"type":["integer","null"],"minimum":0},"outputTokens":{"type":["integer","null"],"minimum":0},"costUsd":{"type":["number","null"],"minimum":0},"runnerBuildDigest":{"oneOf":[{"$ref":"#/$defs/digest"},{"type":"null"}]},"evaluationDigest":{"oneOf":[{"$ref":"#/$defs/digest"},{"type":"null"}]},"requestedCondition":{"enum":["passive","enforced",null]},"actualCondition":{"enum":["passive","enforced","unknown",null]},"candidateRoute":{"oneOf":[{"$ref":"#/$defs/route"},{"type":"null"}]},"routes":{"type":"array","items":{"type":"object","required":["role","host","model","effort"],"properties":{"role":{"enum":["candidate","semantic","advisory"]},"host":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1}},"additionalProperties":false}},"domainOutcomes":{"type":"array","items":{"$ref":"#/$defs/outcome"}}},"additionalProperties":false};const schema96 = {"enum":["completed","failed","cancelled","not_run","error","unavailable","not_requested"]};const schema99 = {"type":"string","pattern":"^[a-f0-9]{64}$"};const schema101 = {"type":"object","required":["host","model","effort"],"properties":{"host":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1}},"additionalProperties":false};const schema102 = {"type":"object","required":["trial","id","status"],"properties":{"trial":{"type":"integer","minimum":1},"id":{"type":"string","minLength":1},"status":{"enum":["passed","failed","unavailable"]}},"additionalProperties":false};const func1 = Object.prototype.hasOwnProperty;const pattern5 = new RegExp("^[a-f0-9]{64}$", "u");function validate38(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate38.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((((((((((((((((((((((data.resultFile === undefined) && (missing0 = "resultFile")) || ((data.evidencePath === undefined) && (missing0 = "evidencePath"))) || ((data.runId === undefined) && (missing0 = "runId"))) || ((data.caseId === undefined) && (missing0 = "caseId"))) || ((data.execution === undefined) && (missing0 = "execution"))) || ((data.grading === undefined) && (missing0 = "grading"))) || ((data.task === undefined) && (missing0 = "task"))) || ((data.exitCode === undefined) && (missing0 = "exitCode"))) || ((data.trialCount === undefined) && (missing0 = "trialCount"))) || ((data.taskPassRate === undefined) && (missing0 = "taskPassRate"))) || ((data.candidateDurationMs === undefined) && (missing0 = "candidateDurationMs"))) || ((data.inputTokens === undefined) && (missing0 = "inputTokens"))) || ((data.outputTokens === undefined) && (missing0 = "outputTokens"))) || ((data.costUsd === undefined) && (missing0 = "costUsd"))) || ((data.runnerBuildDigest === undefined) && (missing0 = "runnerBuildDigest"))) || ((data.evaluationDigest === undefined) && (missing0 = "evaluationDigest"))) || ((data.requestedCondition === undefined) && (missing0 = "requestedCondition"))) || ((data.actualCondition === undefined) && (missing0 = "actualCondition"))) || ((data.candidateRoute === undefined) && (missing0 = "candidateRoute"))) || ((data.routes === undefined) && (missing0 = "routes"))) || ((data.domainOutcomes === undefined) && (missing0 = "domainOutcomes"))){validate38.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs1 = errors;for(const key0 in data){if(!(func1.call(schema94.properties, key0))){validate38.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.resultFile !== undefined){let data0 = data.resultFile;const _errs2 = errors;const _errs3 = errors;if(errors === _errs3){if(typeof data0 === "string"){if(func2(data0) < 1){validate38.errors = [{instancePath:instancePath+"/resultFile",schemaPath:"#/$defs/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/resultFile",schemaPath:"#/$defs/path/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.evidencePath !== undefined){let data1 = data.evidencePath;const _errs5 = errors;if((typeof data1 !== "string") && (data1 !== null)){validate38.errors = [{instancePath:instancePath+"/evidencePath",schemaPath:"#/properties/evidencePath/type",keyword:"type",params:{type: schema94.properties.evidencePath.type},message:"must be string,null"}];return false;}var valid0 = _errs5 === errors;}else {var valid0 = true;}if(valid0){if(data.runId !== undefined){let data2 = data.runId;const _errs7 = errors;if((typeof data2 !== "string") && (data2 !== null)){validate38.errors = [{instancePath:instancePath+"/runId",schemaPath:"#/properties/runId/type",keyword:"type",params:{type: schema94.properties.runId.type},message:"must be string,null"}];return false;}var valid0 = _errs7 === errors;}else {var valid0 = true;}if(valid0){if(data.caseId !== undefined){let data3 = data.caseId;const _errs9 = errors;if(errors === _errs9){if(typeof data3 === "string"){if(func2(data3) < 1){validate38.errors = [{instancePath:instancePath+"/caseId",schemaPath:"#/properties/caseId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/caseId",schemaPath:"#/properties/caseId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.execution !== undefined){let data4 = data.execution;const _errs11 = errors;if(!(((((((data4 === "completed") || (data4 === "failed")) || (data4 === "cancelled")) || (data4 === "not_run")) || (data4 === "error")) || (data4 === "unavailable")) || (data4 === "not_requested"))){validate38.errors = [{instancePath:instancePath+"/execution",schemaPath:"#/$defs/state/enum",keyword:"enum",params:{allowedValues: schema96.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs11 === errors;}else {var valid0 = true;}if(valid0){if(data.grading !== undefined){let data5 = data.grading;const _errs13 = errors;if(!(((((((data5 === "completed") || (data5 === "failed")) || (data5 === "cancelled")) || (data5 === "not_run")) || (data5 === "error")) || (data5 === "unavailable")) || (data5 === "not_requested"))){validate38.errors = [{instancePath:instancePath+"/grading",schemaPath:"#/$defs/state/enum",keyword:"enum",params:{allowedValues: schema96.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs13 === errors;}else {var valid0 = true;}if(valid0){if(data.task !== undefined){let data6 = data.task;const _errs15 = errors;if(!(((data6 === "passed") || (data6 === "failed")) || (data6 === "not_assessed"))){validate38.errors = [{instancePath:instancePath+"/task",schemaPath:"#/$defs/verdict/enum",keyword:"enum",params:{allowedValues: schema93.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs15 === errors;}else {var valid0 = true;}if(valid0){if(data.exitCode !== undefined){let data7 = data.exitCode;const _errs17 = errors;if(!(((((((((data7 === 0) || (data7 === 1)) || (data7 === 2)) || (data7 === 3)) || (data7 === 4)) || (data7 === 64)) || (data7 === 70)) || (data7 === 130)) || (data7 === 143))){validate38.errors = [{instancePath:instancePath+"/exitCode",schemaPath:"#/properties/exitCode/enum",keyword:"enum",params:{allowedValues: schema94.properties.exitCode.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs17 === errors;}else {var valid0 = true;}if(valid0){if(data.trialCount !== undefined){let data8 = data.trialCount;const _errs18 = errors;if(!(((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8))) && (isFinite(data8)))){validate38.errors = [{instancePath:instancePath+"/trialCount",schemaPath:"#/properties/trialCount/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs18){if((typeof data8 == "number") && (isFinite(data8))){if(data8 < 0 || isNaN(data8)){validate38.errors = [{instancePath:instancePath+"/trialCount",schemaPath:"#/properties/trialCount/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs18 === errors;}else {var valid0 = true;}if(valid0){if(data.taskPassRate !== undefined){let data9 = data.taskPassRate;const _errs20 = errors;if((!((typeof data9 == "number") && (isFinite(data9)))) && (data9 !== null)){validate38.errors = [{instancePath:instancePath+"/taskPassRate",schemaPath:"#/properties/taskPassRate/type",keyword:"type",params:{type: schema94.properties.taskPassRate.type},message:"must be number,null"}];return false;}if(errors === _errs20){if((typeof data9 == "number") && (isFinite(data9))){if(data9 > 1 || isNaN(data9)){validate38.errors = [{instancePath:instancePath+"/taskPassRate",schemaPath:"#/properties/taskPassRate/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1},message:"must be <= 1"}];return false;}else {if(data9 < 0 || isNaN(data9)){validate38.errors = [{instancePath:instancePath+"/taskPassRate",schemaPath:"#/properties/taskPassRate/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}}var valid0 = _errs20 === errors;}else {var valid0 = true;}if(valid0){if(data.candidateDurationMs !== undefined){let data10 = data.candidateDurationMs;const _errs22 = errors;if((!((typeof data10 == "number") && (isFinite(data10)))) && (data10 !== null)){validate38.errors = [{instancePath:instancePath+"/candidateDurationMs",schemaPath:"#/properties/candidateDurationMs/type",keyword:"type",params:{type: schema94.properties.candidateDurationMs.type},message:"must be number,null"}];return false;}if(errors === _errs22){if((typeof data10 == "number") && (isFinite(data10))){if(data10 < 0 || isNaN(data10)){validate38.errors = [{instancePath:instancePath+"/candidateDurationMs",schemaPath:"#/properties/candidateDurationMs/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs22 === errors;}else {var valid0 = true;}if(valid0){if(data.inputTokens !== undefined){let data11 = data.inputTokens;const _errs24 = errors;if((!(((typeof data11 == "number") && (!(data11 % 1) && !isNaN(data11))) && (isFinite(data11)))) && (data11 !== null)){validate38.errors = [{instancePath:instancePath+"/inputTokens",schemaPath:"#/properties/inputTokens/type",keyword:"type",params:{type: schema94.properties.inputTokens.type},message:"must be integer,null"}];return false;}if(errors === _errs24){if((typeof data11 == "number") && (isFinite(data11))){if(data11 < 0 || isNaN(data11)){validate38.errors = [{instancePath:instancePath+"/inputTokens",schemaPath:"#/properties/inputTokens/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs24 === errors;}else {var valid0 = true;}if(valid0){if(data.outputTokens !== undefined){let data12 = data.outputTokens;const _errs26 = errors;if((!(((typeof data12 == "number") && (!(data12 % 1) && !isNaN(data12))) && (isFinite(data12)))) && (data12 !== null)){validate38.errors = [{instancePath:instancePath+"/outputTokens",schemaPath:"#/properties/outputTokens/type",keyword:"type",params:{type: schema94.properties.outputTokens.type},message:"must be integer,null"}];return false;}if(errors === _errs26){if((typeof data12 == "number") && (isFinite(data12))){if(data12 < 0 || isNaN(data12)){validate38.errors = [{instancePath:instancePath+"/outputTokens",schemaPath:"#/properties/outputTokens/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs26 === errors;}else {var valid0 = true;}if(valid0){if(data.costUsd !== undefined){let data13 = data.costUsd;const _errs28 = errors;if((!((typeof data13 == "number") && (isFinite(data13)))) && (data13 !== null)){validate38.errors = [{instancePath:instancePath+"/costUsd",schemaPath:"#/properties/costUsd/type",keyword:"type",params:{type: schema94.properties.costUsd.type},message:"must be number,null"}];return false;}if(errors === _errs28){if((typeof data13 == "number") && (isFinite(data13))){if(data13 < 0 || isNaN(data13)){validate38.errors = [{instancePath:instancePath+"/costUsd",schemaPath:"#/properties/costUsd/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs28 === errors;}else {var valid0 = true;}if(valid0){if(data.runnerBuildDigest !== undefined){let data14 = data.runnerBuildDigest;const _errs30 = errors;const _errs31 = errors;let valid5 = false;let passing0 = null;const _errs32 = errors;const _errs33 = errors;if(errors === _errs33){if(typeof data14 === "string"){if(!pattern5.test(data14)){const err0 = {instancePath:instancePath+"/runnerBuildDigest",schemaPath:"#/$defs/digest/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath:instancePath+"/runnerBuildDigest",schemaPath:"#/$defs/digest/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var _valid0 = _errs32 === errors;if(_valid0){valid5 = true;passing0 = 0;}const _errs35 = errors;if(data14 !== null){const err2 = {instancePath:instancePath+"/runnerBuildDigest",schemaPath:"#/properties/runnerBuildDigest/oneOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}var _valid0 = _errs35 === errors;if(_valid0 && valid5){valid5 = false;passing0 = [passing0, 1];}else {if(_valid0){valid5 = true;passing0 = 1;}}if(!valid5){const err3 = {instancePath:instancePath+"/runnerBuildDigest",schemaPath:"#/properties/runnerBuildDigest/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;validate38.errors = vErrors;return false;}else {errors = _errs31;if(vErrors !== null){if(_errs31){vErrors.length = _errs31;}else {vErrors = null;}}}var valid0 = _errs30 === errors;}else {var valid0 = true;}if(valid0){if(data.evaluationDigest !== undefined){let data15 = data.evaluationDigest;const _errs37 = errors;const _errs38 = errors;let valid7 = false;let passing1 = null;const _errs39 = errors;const _errs40 = errors;if(errors === _errs40){if(typeof data15 === "string"){if(!pattern5.test(data15)){const err4 = {instancePath:instancePath+"/evaluationDigest",schemaPath:"#/$defs/digest/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/evaluationDigest",schemaPath:"#/$defs/digest/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}var _valid1 = _errs39 === errors;if(_valid1){valid7 = true;passing1 = 0;}const _errs42 = errors;if(data15 !== null){const err6 = {instancePath:instancePath+"/evaluationDigest",schemaPath:"#/properties/evaluationDigest/oneOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid1 = _errs42 === errors;if(_valid1 && valid7){valid7 = false;passing1 = [passing1, 1];}else {if(_valid1){valid7 = true;passing1 = 1;}}if(!valid7){const err7 = {instancePath:instancePath+"/evaluationDigest",schemaPath:"#/properties/evaluationDigest/oneOf",keyword:"oneOf",params:{passingSchemas: passing1},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;validate38.errors = vErrors;return false;}else {errors = _errs38;if(vErrors !== null){if(_errs38){vErrors.length = _errs38;}else {vErrors = null;}}}var valid0 = _errs37 === errors;}else {var valid0 = true;}if(valid0){if(data.requestedCondition !== undefined){let data16 = data.requestedCondition;const _errs44 = errors;if(!(((data16 === "passive") || (data16 === "enforced")) || (data16 === null))){validate38.errors = [{instancePath:instancePath+"/requestedCondition",schemaPath:"#/properties/requestedCondition/enum",keyword:"enum",params:{allowedValues: schema94.properties.requestedCondition.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs44 === errors;}else {var valid0 = true;}if(valid0){if(data.actualCondition !== undefined){let data17 = data.actualCondition;const _errs45 = errors;if(!((((data17 === "passive") || (data17 === "enforced")) || (data17 === "unknown")) || (data17 === null))){validate38.errors = [{instancePath:instancePath+"/actualCondition",schemaPath:"#/properties/actualCondition/enum",keyword:"enum",params:{allowedValues: schema94.properties.actualCondition.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs45 === errors;}else {var valid0 = true;}if(valid0){if(data.candidateRoute !== undefined){let data18 = data.candidateRoute;const _errs46 = errors;const _errs47 = errors;let valid9 = false;let passing2 = null;const _errs48 = errors;const _errs49 = errors;if(errors === _errs49){if(data18 && typeof data18 == "object" && !Array.isArray(data18)){let missing1;if((((data18.host === undefined) && (missing1 = "host")) || ((data18.model === undefined) && (missing1 = "model"))) || ((data18.effort === undefined) && (missing1 = "effort"))){const err8 = {instancePath:instancePath+"/candidateRoute",schemaPath:"#/$defs/route/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {const _errs51 = errors;for(const key1 in data18){if(!(((key1 === "host") || (key1 === "model")) || (key1 === "effort"))){const err9 = {instancePath:instancePath+"/candidateRoute",schemaPath:"#/$defs/route/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;break;}}if(_errs51 === errors){if(data18.host !== undefined){let data19 = data18.host;const _errs52 = errors;if(errors === _errs52){if(typeof data19 === "string"){if(func2(data19) < 1){const err10 = {instancePath:instancePath+"/candidateRoute/host",schemaPath:"#/$defs/route/properties/host/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/candidateRoute/host",schemaPath:"#/$defs/route/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}var valid11 = _errs52 === errors;}else {var valid11 = true;}if(valid11){if(data18.model !== undefined){let data20 = data18.model;const _errs54 = errors;if(errors === _errs54){if(typeof data20 === "string"){if(func2(data20) < 1){const err12 = {instancePath:instancePath+"/candidateRoute/model",schemaPath:"#/$defs/route/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+"/candidateRoute/model",schemaPath:"#/$defs/route/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}var valid11 = _errs54 === errors;}else {var valid11 = true;}if(valid11){if(data18.effort !== undefined){let data21 = data18.effort;const _errs56 = errors;if(errors === _errs56){if(typeof data21 === "string"){if(func2(data21) < 1){const err14 = {instancePath:instancePath+"/candidateRoute/effort",schemaPath:"#/$defs/route/properties/effort/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/candidateRoute/effort",schemaPath:"#/$defs/route/properties/effort/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}var valid11 = _errs56 === errors;}else {var valid11 = true;}}}}}}else {const err16 = {instancePath:instancePath+"/candidateRoute",schemaPath:"#/$defs/route/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}var _valid2 = _errs48 === errors;if(_valid2){valid9 = true;passing2 = 0;}const _errs58 = errors;if(data18 !== null){const err17 = {instancePath:instancePath+"/candidateRoute",schemaPath:"#/properties/candidateRoute/oneOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}var _valid2 = _errs58 === errors;if(_valid2 && valid9){valid9 = false;passing2 = [passing2, 1];}else {if(_valid2){valid9 = true;passing2 = 1;}}if(!valid9){const err18 = {instancePath:instancePath+"/candidateRoute",schemaPath:"#/properties/candidateRoute/oneOf",keyword:"oneOf",params:{passingSchemas: passing2},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;validate38.errors = vErrors;return false;}else {errors = _errs47;if(vErrors !== null){if(_errs47){vErrors.length = _errs47;}else {vErrors = null;}}}var valid0 = _errs46 === errors;}else {var valid0 = true;}if(valid0){if(data.routes !== undefined){let data22 = data.routes;const _errs60 = errors;if(errors === _errs60){if(Array.isArray(data22)){var valid12 = true;const len0 = data22.length;for(let i0=0; i0<len0; i0++){let data23 = data22[i0];const _errs62 = errors;if(errors === _errs62){if(data23 && typeof data23 == "object" && !Array.isArray(data23)){let missing2;if(((((data23.role === undefined) && (missing2 = "role")) || ((data23.host === undefined) && (missing2 = "host"))) || ((data23.model === undefined) && (missing2 = "model"))) || ((data23.effort === undefined) && (missing2 = "effort"))){validate38.errors = [{instancePath:instancePath+"/routes/" + i0,schemaPath:"#/properties/routes/items/required",keyword:"required",params:{missingProperty: missing2},message:"must have required property '"+missing2+"'"}];return false;}else {const _errs64 = errors;for(const key2 in data23){if(!((((key2 === "role") || (key2 === "host")) || (key2 === "model")) || (key2 === "effort"))){validate38.errors = [{instancePath:instancePath+"/routes/" + i0,schemaPath:"#/properties/routes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"}];return false;break;}}if(_errs64 === errors){if(data23.role !== undefined){let data24 = data23.role;const _errs65 = errors;if(!(((data24 === "candidate") || (data24 === "semantic")) || (data24 === "advisory"))){validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/role",schemaPath:"#/properties/routes/items/properties/role/enum",keyword:"enum",params:{allowedValues: schema94.properties.routes.items.properties.role.enum},message:"must be equal to one of the allowed values"}];return false;}var valid13 = _errs65 === errors;}else {var valid13 = true;}if(valid13){if(data23.host !== undefined){let data25 = data23.host;const _errs66 = errors;if(errors === _errs66){if(typeof data25 === "string"){if(func2(data25) < 1){validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/host",schemaPath:"#/properties/routes/items/properties/host/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/host",schemaPath:"#/properties/routes/items/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid13 = _errs66 === errors;}else {var valid13 = true;}if(valid13){if(data23.model !== undefined){let data26 = data23.model;const _errs68 = errors;if(errors === _errs68){if(typeof data26 === "string"){if(func2(data26) < 1){validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/model",schemaPath:"#/properties/routes/items/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/model",schemaPath:"#/properties/routes/items/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid13 = _errs68 === errors;}else {var valid13 = true;}if(valid13){if(data23.effort !== undefined){let data27 = data23.effort;const _errs70 = errors;if(errors === _errs70){if(typeof data27 === "string"){if(func2(data27) < 1){validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/effort",schemaPath:"#/properties/routes/items/properties/effort/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/effort",schemaPath:"#/properties/routes/items/properties/effort/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid13 = _errs70 === errors;}else {var valid13 = true;}}}}}}}else {validate38.errors = [{instancePath:instancePath+"/routes/" + i0,schemaPath:"#/properties/routes/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid12 = _errs62 === errors;if(!valid12){break;}}}else {validate38.errors = [{instancePath:instancePath+"/routes",schemaPath:"#/properties/routes/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs60 === errors;}else {var valid0 = true;}if(valid0){if(data.domainOutcomes !== undefined){let data28 = data.domainOutcomes;const _errs72 = errors;if(errors === _errs72){if(Array.isArray(data28)){var valid14 = true;const len1 = data28.length;for(let i1=0; i1<len1; i1++){let data29 = data28[i1];const _errs74 = errors;const _errs75 = errors;if(errors === _errs75){if(data29 && typeof data29 == "object" && !Array.isArray(data29)){let missing3;if((((data29.trial === undefined) && (missing3 = "trial")) || ((data29.id === undefined) && (missing3 = "id"))) || ((data29.status === undefined) && (missing3 = "status"))){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1,schemaPath:"#/$defs/outcome/required",keyword:"required",params:{missingProperty: missing3},message:"must have required property '"+missing3+"'"}];return false;}else {const _errs77 = errors;for(const key3 in data29){if(!(((key3 === "trial") || (key3 === "id")) || (key3 === "status"))){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1,schemaPath:"#/$defs/outcome/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs77 === errors){if(data29.trial !== undefined){let data30 = data29.trial;const _errs78 = errors;if(!(((typeof data30 == "number") && (!(data30 % 1) && !isNaN(data30))) && (isFinite(data30)))){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1+"/trial",schemaPath:"#/$defs/outcome/properties/trial/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs78){if((typeof data30 == "number") && (isFinite(data30))){if(data30 < 1 || isNaN(data30)){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1+"/trial",schemaPath:"#/$defs/outcome/properties/trial/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}}var valid16 = _errs78 === errors;}else {var valid16 = true;}if(valid16){if(data29.id !== undefined){let data31 = data29.id;const _errs80 = errors;if(errors === _errs80){if(typeof data31 === "string"){if(func2(data31) < 1){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1+"/id",schemaPath:"#/$defs/outcome/properties/id/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1+"/id",schemaPath:"#/$defs/outcome/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid16 = _errs80 === errors;}else {var valid16 = true;}if(valid16){if(data29.status !== undefined){let data32 = data29.status;const _errs82 = errors;if(!(((data32 === "passed") || (data32 === "failed")) || (data32 === "unavailable"))){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1+"/status",schemaPath:"#/$defs/outcome/properties/status/enum",keyword:"enum",params:{allowedValues: schema102.properties.status.enum},message:"must be equal to one of the allowed values"}];return false;}var valid16 = _errs82 === errors;}else {var valid16 = true;}}}}}}else {validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1,schemaPath:"#/$defs/outcome/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid14 = _errs74 === errors;if(!valid14){break;}}}else {validate38.errors = [{instancePath:instancePath+"/domainOutcomes",schemaPath:"#/properties/domainOutcomes/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs72 === errors;}else {var valid0 = true;}}}}}}}}}}}}}}}}}}}}}}}}else {validate38.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate38.errors = vErrors;return errors === 0;}validate38.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate35(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="urn:sevro:schema:report:v1" */;let vErrors = null;let errors = 0;const evaluated0 = validate35.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((((data.format === undefined) && (missing0 = "format")) || ((data.inputs === undefined) && (missing0 = "inputs"))) || ((data.rows === undefined) && (missing0 = "rows"))) || ((data.summary === undefined) && (missing0 = "summary"))){validate35.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs1 = errors;for(const key0 in data){if(!((((key0 === "format") || (key0 === "inputs")) || (key0 === "rows")) || (key0 === "summary"))){validate35.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.format !== undefined){const _errs2 = errors;if("sevro.report.v1" !== data.format){validate35.errors = [{instancePath:instancePath+"/format",schemaPath:"#/properties/format/const",keyword:"const",params:{allowedValue: "sevro.report.v1"},message:"must be equal to constant"}];return false;}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.inputs !== undefined){let data1 = data.inputs;const _errs3 = errors;if(errors === _errs3){if(Array.isArray(data1)){if(data1.length < 1){validate35.errors = [{instancePath:instancePath+"/inputs",schemaPath:"#/properties/inputs/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"}];return false;}else {var valid1 = true;const len0 = data1.length;for(let i0=0; i0<len0; i0++){const _errs5 = errors;if(!(validate36(data1[i0], {instancePath:instancePath+"/inputs/" + i0,parentData:data1,parentDataProperty:i0,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate36.errors : vErrors.concat(validate36.errors);errors = vErrors.length;}var valid1 = _errs5 === errors;if(!valid1){break;}}}}else {validate35.errors = [{instancePath:instancePath+"/inputs",schemaPath:"#/properties/inputs/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.rows !== undefined){let data3 = data.rows;const _errs6 = errors;if(errors === _errs6){if(Array.isArray(data3)){var valid2 = true;const len1 = data3.length;for(let i1=0; i1<len1; i1++){const _errs8 = errors;if(!(validate38(data3[i1], {instancePath:instancePath+"/rows/" + i1,parentData:data3,parentDataProperty:i1,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);errors = vErrors.length;}var valid2 = _errs8 === errors;if(!valid2){break;}}}else {validate35.errors = [{instancePath:instancePath+"/rows",schemaPath:"#/properties/rows/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs6 === errors;}else {var valid0 = true;}if(valid0){if(data.summary !== undefined){let data5 = data.summary;const _errs9 = errors;if(errors === _errs9){if(data5 && typeof data5 == "object" && !Array.isArray(data5)){let missing1;if(((((data5.cases === undefined) && (missing1 = "cases")) || ((data5.passed === undefined) && (missing1 = "passed"))) || ((data5.failed === undefined) && (missing1 = "failed"))) || ((data5.notAssessed === undefined) && (missing1 = "notAssessed"))){validate35.errors = [{instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {const _errs11 = errors;for(const key1 in data5){if(!((((key1 === "cases") || (key1 === "passed")) || (key1 === "failed")) || (key1 === "notAssessed"))){validate35.errors = [{instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs11 === errors){if(data5.cases !== undefined){let data6 = data5.cases;const _errs12 = errors;if(!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))){validate35.errors = [{instancePath:instancePath+"/summary/cases",schemaPath:"#/properties/summary/properties/cases/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs12){if((typeof data6 == "number") && (isFinite(data6))){if(data6 < 0 || isNaN(data6)){validate35.errors = [{instancePath:instancePath+"/summary/cases",schemaPath:"#/properties/summary/properties/cases/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid3 = _errs12 === errors;}else {var valid3 = true;}if(valid3){if(data5.passed !== undefined){let data7 = data5.passed;const _errs14 = errors;if(!(((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))){validate35.errors = [{instancePath:instancePath+"/summary/passed",schemaPath:"#/properties/summary/properties/passed/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs14){if((typeof data7 == "number") && (isFinite(data7))){if(data7 < 0 || isNaN(data7)){validate35.errors = [{instancePath:instancePath+"/summary/passed",schemaPath:"#/properties/summary/properties/passed/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid3 = _errs14 === errors;}else {var valid3 = true;}if(valid3){if(data5.failed !== undefined){let data8 = data5.failed;const _errs16 = errors;if(!(((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8))) && (isFinite(data8)))){validate35.errors = [{instancePath:instancePath+"/summary/failed",schemaPath:"#/properties/summary/properties/failed/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs16){if((typeof data8 == "number") && (isFinite(data8))){if(data8 < 0 || isNaN(data8)){validate35.errors = [{instancePath:instancePath+"/summary/failed",schemaPath:"#/properties/summary/properties/failed/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid3 = _errs16 === errors;}else {var valid3 = true;}if(valid3){if(data5.notAssessed !== undefined){let data9 = data5.notAssessed;const _errs18 = errors;if(!(((typeof data9 == "number") && (!(data9 % 1) && !isNaN(data9))) && (isFinite(data9)))){validate35.errors = [{instancePath:instancePath+"/summary/notAssessed",schemaPath:"#/properties/summary/properties/notAssessed/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs18){if((typeof data9 == "number") && (isFinite(data9))){if(data9 < 0 || isNaN(data9)){validate35.errors = [{instancePath:instancePath+"/summary/notAssessed",schemaPath:"#/properties/summary/properties/notAssessed/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid3 = _errs18 === errors;}else {var valid3 = true;}}}}}}}else {validate35.errors = [{instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs9 === errors;}else {var valid0 = true;}}}}}}}else {validate35.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate35.errors = vErrors;return errors === 0;}validate35.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};
2
+ "use strict";module.exports = validate35;module.exports.default = validate35;const schema90 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"urn:sevro:schema:report:v1","title":"Sevro report v1","type":"object","required":["format","inputs","rows","summary"],"properties":{"format":{"const":"sevro.report.v1"},"inputs":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/input"}},"rows":{"type":"array","items":{"$ref":"#/$defs/row"}},"summary":{"type":"object","required":["cases","passed","failed","notAssessed"],"properties":{"cases":{"type":"integer","minimum":0},"passed":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"notAssessed":{"type":"integer","minimum":0}},"additionalProperties":false}},"additionalProperties":false,"$defs":{"path":{"type":"string","minLength":1},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"state":{"enum":["completed","failed","cancelled","not_run","error","unavailable","not_requested"]},"verdict":{"enum":["passed","failed","not_assessed"]},"input":{"type":"object","required":["resultFile","execution","grading","task","exitCode","caseCount"],"properties":{"resultFile":{"$ref":"#/$defs/path"},"execution":{"enum":["completed","failed","cancelled","not_run"]},"grading":{"enum":["completed","error","unavailable","not_requested"]},"task":{"$ref":"#/$defs/verdict"},"exitCode":{"enum":[0,1,2,3,4,64,70,130,143]},"caseCount":{"type":"integer","minimum":0}},"additionalProperties":false},"route":{"type":"object","required":["host","model","effort"],"properties":{"host":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1}},"additionalProperties":false},"outcome":{"type":"object","required":["trial","id","status"],"properties":{"trial":{"type":"integer","minimum":1},"id":{"type":"string","minLength":1},"status":{"enum":["passed","failed","unavailable"]}},"additionalProperties":false},"row":{"type":"object","required":["resultFile","evidencePath","runId","caseId","execution","grading","task","exitCode","trialCount","taskPassRate","candidateDurationMs","inputTokens","outputTokens","costUsd","runnerBuildDigest","evaluationDigest","requestedCondition","actualCondition","candidateRoute","routes","domainOutcomes"],"properties":{"nativeTranscripts":{"type":"object","required":["retained","pruned"],"properties":{"retained":{"type":"integer","minimum":0},"pruned":{"type":"integer","minimum":0}},"additionalProperties":false},"resultFile":{"$ref":"#/$defs/path"},"evidencePath":{"type":["string","null"]},"runId":{"type":["string","null"]},"caseId":{"type":"string","minLength":1},"execution":{"$ref":"#/$defs/state"},"grading":{"$ref":"#/$defs/state"},"task":{"$ref":"#/$defs/verdict"},"exitCode":{"enum":[0,1,2,3,4,64,70,130,143]},"trialCount":{"type":"integer","minimum":0},"taskPassRate":{"type":["number","null"],"minimum":0,"maximum":1},"candidateDurationMs":{"type":["number","null"],"minimum":0},"inputTokens":{"type":["integer","null"],"minimum":0},"outputTokens":{"type":["integer","null"],"minimum":0},"costUsd":{"type":["number","null"],"minimum":0},"runnerBuildDigest":{"oneOf":[{"$ref":"#/$defs/digest"},{"type":"null"}]},"evaluationDigest":{"oneOf":[{"$ref":"#/$defs/digest"},{"type":"null"}]},"requestedCondition":{"enum":["passive","enforced",null]},"actualCondition":{"enum":["passive","enforced","unknown",null]},"candidateRoute":{"oneOf":[{"$ref":"#/$defs/route"},{"type":"null"}]},"routes":{"type":"array","items":{"type":"object","required":["role","host","model","effort"],"properties":{"role":{"enum":["candidate","semantic","advisory"]},"host":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1}},"additionalProperties":false}},"domainOutcomes":{"type":"array","items":{"$ref":"#/$defs/outcome"}}},"additionalProperties":false}}};const schema91 = {"type":"object","required":["resultFile","execution","grading","task","exitCode","caseCount"],"properties":{"resultFile":{"$ref":"#/$defs/path"},"execution":{"enum":["completed","failed","cancelled","not_run"]},"grading":{"enum":["completed","error","unavailable","not_requested"]},"task":{"$ref":"#/$defs/verdict"},"exitCode":{"enum":[0,1,2,3,4,64,70,130,143]},"caseCount":{"type":"integer","minimum":0}},"additionalProperties":false};const schema92 = {"type":"string","minLength":1};const schema93 = {"enum":["passed","failed","not_assessed"]};const func2 = require("ajv/dist/runtime/ucs2length").default;function validate36(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate36.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((((((data.resultFile === undefined) && (missing0 = "resultFile")) || ((data.execution === undefined) && (missing0 = "execution"))) || ((data.grading === undefined) && (missing0 = "grading"))) || ((data.task === undefined) && (missing0 = "task"))) || ((data.exitCode === undefined) && (missing0 = "exitCode"))) || ((data.caseCount === undefined) && (missing0 = "caseCount"))){validate36.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs1 = errors;for(const key0 in data){if(!((((((key0 === "resultFile") || (key0 === "execution")) || (key0 === "grading")) || (key0 === "task")) || (key0 === "exitCode")) || (key0 === "caseCount"))){validate36.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.resultFile !== undefined){let data0 = data.resultFile;const _errs2 = errors;const _errs3 = errors;if(errors === _errs3){if(typeof data0 === "string"){if(func2(data0) < 1){validate36.errors = [{instancePath:instancePath+"/resultFile",schemaPath:"#/$defs/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate36.errors = [{instancePath:instancePath+"/resultFile",schemaPath:"#/$defs/path/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.execution !== undefined){let data1 = data.execution;const _errs5 = errors;if(!((((data1 === "completed") || (data1 === "failed")) || (data1 === "cancelled")) || (data1 === "not_run"))){validate36.errors = [{instancePath:instancePath+"/execution",schemaPath:"#/properties/execution/enum",keyword:"enum",params:{allowedValues: schema91.properties.execution.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs5 === errors;}else {var valid0 = true;}if(valid0){if(data.grading !== undefined){let data2 = data.grading;const _errs6 = errors;if(!((((data2 === "completed") || (data2 === "error")) || (data2 === "unavailable")) || (data2 === "not_requested"))){validate36.errors = [{instancePath:instancePath+"/grading",schemaPath:"#/properties/grading/enum",keyword:"enum",params:{allowedValues: schema91.properties.grading.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs6 === errors;}else {var valid0 = true;}if(valid0){if(data.task !== undefined){let data3 = data.task;const _errs7 = errors;if(!(((data3 === "passed") || (data3 === "failed")) || (data3 === "not_assessed"))){validate36.errors = [{instancePath:instancePath+"/task",schemaPath:"#/$defs/verdict/enum",keyword:"enum",params:{allowedValues: schema93.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs7 === errors;}else {var valid0 = true;}if(valid0){if(data.exitCode !== undefined){let data4 = data.exitCode;const _errs9 = errors;if(!(((((((((data4 === 0) || (data4 === 1)) || (data4 === 2)) || (data4 === 3)) || (data4 === 4)) || (data4 === 64)) || (data4 === 70)) || (data4 === 130)) || (data4 === 143))){validate36.errors = [{instancePath:instancePath+"/exitCode",schemaPath:"#/properties/exitCode/enum",keyword:"enum",params:{allowedValues: schema91.properties.exitCode.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.caseCount !== undefined){let data5 = data.caseCount;const _errs10 = errors;if(!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))){validate36.errors = [{instancePath:instancePath+"/caseCount",schemaPath:"#/properties/caseCount/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs10){if((typeof data5 == "number") && (isFinite(data5))){if(data5 < 0 || isNaN(data5)){validate36.errors = [{instancePath:instancePath+"/caseCount",schemaPath:"#/properties/caseCount/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs10 === errors;}else {var valid0 = true;}}}}}}}}}else {validate36.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate36.errors = vErrors;return errors === 0;}validate36.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema94 = {"type":"object","required":["resultFile","evidencePath","runId","caseId","execution","grading","task","exitCode","trialCount","taskPassRate","candidateDurationMs","inputTokens","outputTokens","costUsd","runnerBuildDigest","evaluationDigest","requestedCondition","actualCondition","candidateRoute","routes","domainOutcomes"],"properties":{"nativeTranscripts":{"type":"object","required":["retained","pruned"],"properties":{"retained":{"type":"integer","minimum":0},"pruned":{"type":"integer","minimum":0}},"additionalProperties":false},"resultFile":{"$ref":"#/$defs/path"},"evidencePath":{"type":["string","null"]},"runId":{"type":["string","null"]},"caseId":{"type":"string","minLength":1},"execution":{"$ref":"#/$defs/state"},"grading":{"$ref":"#/$defs/state"},"task":{"$ref":"#/$defs/verdict"},"exitCode":{"enum":[0,1,2,3,4,64,70,130,143]},"trialCount":{"type":"integer","minimum":0},"taskPassRate":{"type":["number","null"],"minimum":0,"maximum":1},"candidateDurationMs":{"type":["number","null"],"minimum":0},"inputTokens":{"type":["integer","null"],"minimum":0},"outputTokens":{"type":["integer","null"],"minimum":0},"costUsd":{"type":["number","null"],"minimum":0},"runnerBuildDigest":{"oneOf":[{"$ref":"#/$defs/digest"},{"type":"null"}]},"evaluationDigest":{"oneOf":[{"$ref":"#/$defs/digest"},{"type":"null"}]},"requestedCondition":{"enum":["passive","enforced",null]},"actualCondition":{"enum":["passive","enforced","unknown",null]},"candidateRoute":{"oneOf":[{"$ref":"#/$defs/route"},{"type":"null"}]},"routes":{"type":"array","items":{"type":"object","required":["role","host","model","effort"],"properties":{"role":{"enum":["candidate","semantic","advisory"]},"host":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1}},"additionalProperties":false}},"domainOutcomes":{"type":"array","items":{"$ref":"#/$defs/outcome"}}},"additionalProperties":false};const schema96 = {"enum":["completed","failed","cancelled","not_run","error","unavailable","not_requested"]};const schema99 = {"type":"string","pattern":"^[a-f0-9]{64}$"};const schema101 = {"type":"object","required":["host","model","effort"],"properties":{"host":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1}},"additionalProperties":false};const schema102 = {"type":"object","required":["trial","id","status"],"properties":{"trial":{"type":"integer","minimum":1},"id":{"type":"string","minLength":1},"status":{"enum":["passed","failed","unavailable"]}},"additionalProperties":false};const func1 = Object.prototype.hasOwnProperty;const pattern5 = new RegExp("^[a-f0-9]{64}$", "u");function validate38(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate38.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((((((((((((((((((((((data.resultFile === undefined) && (missing0 = "resultFile")) || ((data.evidencePath === undefined) && (missing0 = "evidencePath"))) || ((data.runId === undefined) && (missing0 = "runId"))) || ((data.caseId === undefined) && (missing0 = "caseId"))) || ((data.execution === undefined) && (missing0 = "execution"))) || ((data.grading === undefined) && (missing0 = "grading"))) || ((data.task === undefined) && (missing0 = "task"))) || ((data.exitCode === undefined) && (missing0 = "exitCode"))) || ((data.trialCount === undefined) && (missing0 = "trialCount"))) || ((data.taskPassRate === undefined) && (missing0 = "taskPassRate"))) || ((data.candidateDurationMs === undefined) && (missing0 = "candidateDurationMs"))) || ((data.inputTokens === undefined) && (missing0 = "inputTokens"))) || ((data.outputTokens === undefined) && (missing0 = "outputTokens"))) || ((data.costUsd === undefined) && (missing0 = "costUsd"))) || ((data.runnerBuildDigest === undefined) && (missing0 = "runnerBuildDigest"))) || ((data.evaluationDigest === undefined) && (missing0 = "evaluationDigest"))) || ((data.requestedCondition === undefined) && (missing0 = "requestedCondition"))) || ((data.actualCondition === undefined) && (missing0 = "actualCondition"))) || ((data.candidateRoute === undefined) && (missing0 = "candidateRoute"))) || ((data.routes === undefined) && (missing0 = "routes"))) || ((data.domainOutcomes === undefined) && (missing0 = "domainOutcomes"))){validate38.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs1 = errors;for(const key0 in data){if(!(func1.call(schema94.properties, key0))){validate38.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.nativeTranscripts !== undefined){let data0 = data.nativeTranscripts;const _errs2 = errors;if(errors === _errs2){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){let missing1;if(((data0.retained === undefined) && (missing1 = "retained")) || ((data0.pruned === undefined) && (missing1 = "pruned"))){validate38.errors = [{instancePath:instancePath+"/nativeTranscripts",schemaPath:"#/properties/nativeTranscripts/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {const _errs4 = errors;for(const key1 in data0){if(!((key1 === "retained") || (key1 === "pruned"))){validate38.errors = [{instancePath:instancePath+"/nativeTranscripts",schemaPath:"#/properties/nativeTranscripts/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs4 === errors){if(data0.retained !== undefined){let data1 = data0.retained;const _errs5 = errors;if(!(((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){validate38.errors = [{instancePath:instancePath+"/nativeTranscripts/retained",schemaPath:"#/properties/nativeTranscripts/properties/retained/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs5){if((typeof data1 == "number") && (isFinite(data1))){if(data1 < 0 || isNaN(data1)){validate38.errors = [{instancePath:instancePath+"/nativeTranscripts/retained",schemaPath:"#/properties/nativeTranscripts/properties/retained/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid1 = _errs5 === errors;}else {var valid1 = true;}if(valid1){if(data0.pruned !== undefined){let data2 = data0.pruned;const _errs7 = errors;if(!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))){validate38.errors = [{instancePath:instancePath+"/nativeTranscripts/pruned",schemaPath:"#/properties/nativeTranscripts/properties/pruned/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs7){if((typeof data2 == "number") && (isFinite(data2))){if(data2 < 0 || isNaN(data2)){validate38.errors = [{instancePath:instancePath+"/nativeTranscripts/pruned",schemaPath:"#/properties/nativeTranscripts/properties/pruned/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid1 = _errs7 === errors;}else {var valid1 = true;}}}}}else {validate38.errors = [{instancePath:instancePath+"/nativeTranscripts",schemaPath:"#/properties/nativeTranscripts/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.resultFile !== undefined){let data3 = data.resultFile;const _errs9 = errors;const _errs10 = errors;if(errors === _errs10){if(typeof data3 === "string"){if(func2(data3) < 1){validate38.errors = [{instancePath:instancePath+"/resultFile",schemaPath:"#/$defs/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/resultFile",schemaPath:"#/$defs/path/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.evidencePath !== undefined){let data4 = data.evidencePath;const _errs12 = errors;if((typeof data4 !== "string") && (data4 !== null)){validate38.errors = [{instancePath:instancePath+"/evidencePath",schemaPath:"#/properties/evidencePath/type",keyword:"type",params:{type: schema94.properties.evidencePath.type},message:"must be string,null"}];return false;}var valid0 = _errs12 === errors;}else {var valid0 = true;}if(valid0){if(data.runId !== undefined){let data5 = data.runId;const _errs14 = errors;if((typeof data5 !== "string") && (data5 !== null)){validate38.errors = [{instancePath:instancePath+"/runId",schemaPath:"#/properties/runId/type",keyword:"type",params:{type: schema94.properties.runId.type},message:"must be string,null"}];return false;}var valid0 = _errs14 === errors;}else {var valid0 = true;}if(valid0){if(data.caseId !== undefined){let data6 = data.caseId;const _errs16 = errors;if(errors === _errs16){if(typeof data6 === "string"){if(func2(data6) < 1){validate38.errors = [{instancePath:instancePath+"/caseId",schemaPath:"#/properties/caseId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/caseId",schemaPath:"#/properties/caseId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs16 === errors;}else {var valid0 = true;}if(valid0){if(data.execution !== undefined){let data7 = data.execution;const _errs18 = errors;if(!(((((((data7 === "completed") || (data7 === "failed")) || (data7 === "cancelled")) || (data7 === "not_run")) || (data7 === "error")) || (data7 === "unavailable")) || (data7 === "not_requested"))){validate38.errors = [{instancePath:instancePath+"/execution",schemaPath:"#/$defs/state/enum",keyword:"enum",params:{allowedValues: schema96.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs18 === errors;}else {var valid0 = true;}if(valid0){if(data.grading !== undefined){let data8 = data.grading;const _errs20 = errors;if(!(((((((data8 === "completed") || (data8 === "failed")) || (data8 === "cancelled")) || (data8 === "not_run")) || (data8 === "error")) || (data8 === "unavailable")) || (data8 === "not_requested"))){validate38.errors = [{instancePath:instancePath+"/grading",schemaPath:"#/$defs/state/enum",keyword:"enum",params:{allowedValues: schema96.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs20 === errors;}else {var valid0 = true;}if(valid0){if(data.task !== undefined){let data9 = data.task;const _errs22 = errors;if(!(((data9 === "passed") || (data9 === "failed")) || (data9 === "not_assessed"))){validate38.errors = [{instancePath:instancePath+"/task",schemaPath:"#/$defs/verdict/enum",keyword:"enum",params:{allowedValues: schema93.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs22 === errors;}else {var valid0 = true;}if(valid0){if(data.exitCode !== undefined){let data10 = data.exitCode;const _errs24 = errors;if(!(((((((((data10 === 0) || (data10 === 1)) || (data10 === 2)) || (data10 === 3)) || (data10 === 4)) || (data10 === 64)) || (data10 === 70)) || (data10 === 130)) || (data10 === 143))){validate38.errors = [{instancePath:instancePath+"/exitCode",schemaPath:"#/properties/exitCode/enum",keyword:"enum",params:{allowedValues: schema94.properties.exitCode.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs24 === errors;}else {var valid0 = true;}if(valid0){if(data.trialCount !== undefined){let data11 = data.trialCount;const _errs25 = errors;if(!(((typeof data11 == "number") && (!(data11 % 1) && !isNaN(data11))) && (isFinite(data11)))){validate38.errors = [{instancePath:instancePath+"/trialCount",schemaPath:"#/properties/trialCount/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs25){if((typeof data11 == "number") && (isFinite(data11))){if(data11 < 0 || isNaN(data11)){validate38.errors = [{instancePath:instancePath+"/trialCount",schemaPath:"#/properties/trialCount/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs25 === errors;}else {var valid0 = true;}if(valid0){if(data.taskPassRate !== undefined){let data12 = data.taskPassRate;const _errs27 = errors;if((!((typeof data12 == "number") && (isFinite(data12)))) && (data12 !== null)){validate38.errors = [{instancePath:instancePath+"/taskPassRate",schemaPath:"#/properties/taskPassRate/type",keyword:"type",params:{type: schema94.properties.taskPassRate.type},message:"must be number,null"}];return false;}if(errors === _errs27){if((typeof data12 == "number") && (isFinite(data12))){if(data12 > 1 || isNaN(data12)){validate38.errors = [{instancePath:instancePath+"/taskPassRate",schemaPath:"#/properties/taskPassRate/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1},message:"must be <= 1"}];return false;}else {if(data12 < 0 || isNaN(data12)){validate38.errors = [{instancePath:instancePath+"/taskPassRate",schemaPath:"#/properties/taskPassRate/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}}var valid0 = _errs27 === errors;}else {var valid0 = true;}if(valid0){if(data.candidateDurationMs !== undefined){let data13 = data.candidateDurationMs;const _errs29 = errors;if((!((typeof data13 == "number") && (isFinite(data13)))) && (data13 !== null)){validate38.errors = [{instancePath:instancePath+"/candidateDurationMs",schemaPath:"#/properties/candidateDurationMs/type",keyword:"type",params:{type: schema94.properties.candidateDurationMs.type},message:"must be number,null"}];return false;}if(errors === _errs29){if((typeof data13 == "number") && (isFinite(data13))){if(data13 < 0 || isNaN(data13)){validate38.errors = [{instancePath:instancePath+"/candidateDurationMs",schemaPath:"#/properties/candidateDurationMs/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs29 === errors;}else {var valid0 = true;}if(valid0){if(data.inputTokens !== undefined){let data14 = data.inputTokens;const _errs31 = errors;if((!(((typeof data14 == "number") && (!(data14 % 1) && !isNaN(data14))) && (isFinite(data14)))) && (data14 !== null)){validate38.errors = [{instancePath:instancePath+"/inputTokens",schemaPath:"#/properties/inputTokens/type",keyword:"type",params:{type: schema94.properties.inputTokens.type},message:"must be integer,null"}];return false;}if(errors === _errs31){if((typeof data14 == "number") && (isFinite(data14))){if(data14 < 0 || isNaN(data14)){validate38.errors = [{instancePath:instancePath+"/inputTokens",schemaPath:"#/properties/inputTokens/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs31 === errors;}else {var valid0 = true;}if(valid0){if(data.outputTokens !== undefined){let data15 = data.outputTokens;const _errs33 = errors;if((!(((typeof data15 == "number") && (!(data15 % 1) && !isNaN(data15))) && (isFinite(data15)))) && (data15 !== null)){validate38.errors = [{instancePath:instancePath+"/outputTokens",schemaPath:"#/properties/outputTokens/type",keyword:"type",params:{type: schema94.properties.outputTokens.type},message:"must be integer,null"}];return false;}if(errors === _errs33){if((typeof data15 == "number") && (isFinite(data15))){if(data15 < 0 || isNaN(data15)){validate38.errors = [{instancePath:instancePath+"/outputTokens",schemaPath:"#/properties/outputTokens/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs33 === errors;}else {var valid0 = true;}if(valid0){if(data.costUsd !== undefined){let data16 = data.costUsd;const _errs35 = errors;if((!((typeof data16 == "number") && (isFinite(data16)))) && (data16 !== null)){validate38.errors = [{instancePath:instancePath+"/costUsd",schemaPath:"#/properties/costUsd/type",keyword:"type",params:{type: schema94.properties.costUsd.type},message:"must be number,null"}];return false;}if(errors === _errs35){if((typeof data16 == "number") && (isFinite(data16))){if(data16 < 0 || isNaN(data16)){validate38.errors = [{instancePath:instancePath+"/costUsd",schemaPath:"#/properties/costUsd/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs35 === errors;}else {var valid0 = true;}if(valid0){if(data.runnerBuildDigest !== undefined){let data17 = data.runnerBuildDigest;const _errs37 = errors;const _errs38 = errors;let valid6 = false;let passing0 = null;const _errs39 = errors;const _errs40 = errors;if(errors === _errs40){if(typeof data17 === "string"){if(!pattern5.test(data17)){const err0 = {instancePath:instancePath+"/runnerBuildDigest",schemaPath:"#/$defs/digest/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath:instancePath+"/runnerBuildDigest",schemaPath:"#/$defs/digest/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var _valid0 = _errs39 === errors;if(_valid0){valid6 = true;passing0 = 0;}const _errs42 = errors;if(data17 !== null){const err2 = {instancePath:instancePath+"/runnerBuildDigest",schemaPath:"#/properties/runnerBuildDigest/oneOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}var _valid0 = _errs42 === errors;if(_valid0 && valid6){valid6 = false;passing0 = [passing0, 1];}else {if(_valid0){valid6 = true;passing0 = 1;}}if(!valid6){const err3 = {instancePath:instancePath+"/runnerBuildDigest",schemaPath:"#/properties/runnerBuildDigest/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;validate38.errors = vErrors;return false;}else {errors = _errs38;if(vErrors !== null){if(_errs38){vErrors.length = _errs38;}else {vErrors = null;}}}var valid0 = _errs37 === errors;}else {var valid0 = true;}if(valid0){if(data.evaluationDigest !== undefined){let data18 = data.evaluationDigest;const _errs44 = errors;const _errs45 = errors;let valid8 = false;let passing1 = null;const _errs46 = errors;const _errs47 = errors;if(errors === _errs47){if(typeof data18 === "string"){if(!pattern5.test(data18)){const err4 = {instancePath:instancePath+"/evaluationDigest",schemaPath:"#/$defs/digest/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/evaluationDigest",schemaPath:"#/$defs/digest/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}var _valid1 = _errs46 === errors;if(_valid1){valid8 = true;passing1 = 0;}const _errs49 = errors;if(data18 !== null){const err6 = {instancePath:instancePath+"/evaluationDigest",schemaPath:"#/properties/evaluationDigest/oneOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid1 = _errs49 === errors;if(_valid1 && valid8){valid8 = false;passing1 = [passing1, 1];}else {if(_valid1){valid8 = true;passing1 = 1;}}if(!valid8){const err7 = {instancePath:instancePath+"/evaluationDigest",schemaPath:"#/properties/evaluationDigest/oneOf",keyword:"oneOf",params:{passingSchemas: passing1},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;validate38.errors = vErrors;return false;}else {errors = _errs45;if(vErrors !== null){if(_errs45){vErrors.length = _errs45;}else {vErrors = null;}}}var valid0 = _errs44 === errors;}else {var valid0 = true;}if(valid0){if(data.requestedCondition !== undefined){let data19 = data.requestedCondition;const _errs51 = errors;if(!(((data19 === "passive") || (data19 === "enforced")) || (data19 === null))){validate38.errors = [{instancePath:instancePath+"/requestedCondition",schemaPath:"#/properties/requestedCondition/enum",keyword:"enum",params:{allowedValues: schema94.properties.requestedCondition.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs51 === errors;}else {var valid0 = true;}if(valid0){if(data.actualCondition !== undefined){let data20 = data.actualCondition;const _errs52 = errors;if(!((((data20 === "passive") || (data20 === "enforced")) || (data20 === "unknown")) || (data20 === null))){validate38.errors = [{instancePath:instancePath+"/actualCondition",schemaPath:"#/properties/actualCondition/enum",keyword:"enum",params:{allowedValues: schema94.properties.actualCondition.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs52 === errors;}else {var valid0 = true;}if(valid0){if(data.candidateRoute !== undefined){let data21 = data.candidateRoute;const _errs53 = errors;const _errs54 = errors;let valid10 = false;let passing2 = null;const _errs55 = errors;const _errs56 = errors;if(errors === _errs56){if(data21 && typeof data21 == "object" && !Array.isArray(data21)){let missing2;if((((data21.host === undefined) && (missing2 = "host")) || ((data21.model === undefined) && (missing2 = "model"))) || ((data21.effort === undefined) && (missing2 = "effort"))){const err8 = {instancePath:instancePath+"/candidateRoute",schemaPath:"#/$defs/route/required",keyword:"required",params:{missingProperty: missing2},message:"must have required property '"+missing2+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {const _errs58 = errors;for(const key2 in data21){if(!(((key2 === "host") || (key2 === "model")) || (key2 === "effort"))){const err9 = {instancePath:instancePath+"/candidateRoute",schemaPath:"#/$defs/route/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;break;}}if(_errs58 === errors){if(data21.host !== undefined){let data22 = data21.host;const _errs59 = errors;if(errors === _errs59){if(typeof data22 === "string"){if(func2(data22) < 1){const err10 = {instancePath:instancePath+"/candidateRoute/host",schemaPath:"#/$defs/route/properties/host/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/candidateRoute/host",schemaPath:"#/$defs/route/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}var valid12 = _errs59 === errors;}else {var valid12 = true;}if(valid12){if(data21.model !== undefined){let data23 = data21.model;const _errs61 = errors;if(errors === _errs61){if(typeof data23 === "string"){if(func2(data23) < 1){const err12 = {instancePath:instancePath+"/candidateRoute/model",schemaPath:"#/$defs/route/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+"/candidateRoute/model",schemaPath:"#/$defs/route/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}var valid12 = _errs61 === errors;}else {var valid12 = true;}if(valid12){if(data21.effort !== undefined){let data24 = data21.effort;const _errs63 = errors;if(errors === _errs63){if(typeof data24 === "string"){if(func2(data24) < 1){const err14 = {instancePath:instancePath+"/candidateRoute/effort",schemaPath:"#/$defs/route/properties/effort/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/candidateRoute/effort",schemaPath:"#/$defs/route/properties/effort/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}var valid12 = _errs63 === errors;}else {var valid12 = true;}}}}}}else {const err16 = {instancePath:instancePath+"/candidateRoute",schemaPath:"#/$defs/route/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}var _valid2 = _errs55 === errors;if(_valid2){valid10 = true;passing2 = 0;}const _errs65 = errors;if(data21 !== null){const err17 = {instancePath:instancePath+"/candidateRoute",schemaPath:"#/properties/candidateRoute/oneOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}var _valid2 = _errs65 === errors;if(_valid2 && valid10){valid10 = false;passing2 = [passing2, 1];}else {if(_valid2){valid10 = true;passing2 = 1;}}if(!valid10){const err18 = {instancePath:instancePath+"/candidateRoute",schemaPath:"#/properties/candidateRoute/oneOf",keyword:"oneOf",params:{passingSchemas: passing2},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;validate38.errors = vErrors;return false;}else {errors = _errs54;if(vErrors !== null){if(_errs54){vErrors.length = _errs54;}else {vErrors = null;}}}var valid0 = _errs53 === errors;}else {var valid0 = true;}if(valid0){if(data.routes !== undefined){let data25 = data.routes;const _errs67 = errors;if(errors === _errs67){if(Array.isArray(data25)){var valid13 = true;const len0 = data25.length;for(let i0=0; i0<len0; i0++){let data26 = data25[i0];const _errs69 = errors;if(errors === _errs69){if(data26 && typeof data26 == "object" && !Array.isArray(data26)){let missing3;if(((((data26.role === undefined) && (missing3 = "role")) || ((data26.host === undefined) && (missing3 = "host"))) || ((data26.model === undefined) && (missing3 = "model"))) || ((data26.effort === undefined) && (missing3 = "effort"))){validate38.errors = [{instancePath:instancePath+"/routes/" + i0,schemaPath:"#/properties/routes/items/required",keyword:"required",params:{missingProperty: missing3},message:"must have required property '"+missing3+"'"}];return false;}else {const _errs71 = errors;for(const key3 in data26){if(!((((key3 === "role") || (key3 === "host")) || (key3 === "model")) || (key3 === "effort"))){validate38.errors = [{instancePath:instancePath+"/routes/" + i0,schemaPath:"#/properties/routes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs71 === errors){if(data26.role !== undefined){let data27 = data26.role;const _errs72 = errors;if(!(((data27 === "candidate") || (data27 === "semantic")) || (data27 === "advisory"))){validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/role",schemaPath:"#/properties/routes/items/properties/role/enum",keyword:"enum",params:{allowedValues: schema94.properties.routes.items.properties.role.enum},message:"must be equal to one of the allowed values"}];return false;}var valid14 = _errs72 === errors;}else {var valid14 = true;}if(valid14){if(data26.host !== undefined){let data28 = data26.host;const _errs73 = errors;if(errors === _errs73){if(typeof data28 === "string"){if(func2(data28) < 1){validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/host",schemaPath:"#/properties/routes/items/properties/host/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/host",schemaPath:"#/properties/routes/items/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid14 = _errs73 === errors;}else {var valid14 = true;}if(valid14){if(data26.model !== undefined){let data29 = data26.model;const _errs75 = errors;if(errors === _errs75){if(typeof data29 === "string"){if(func2(data29) < 1){validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/model",schemaPath:"#/properties/routes/items/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/model",schemaPath:"#/properties/routes/items/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid14 = _errs75 === errors;}else {var valid14 = true;}if(valid14){if(data26.effort !== undefined){let data30 = data26.effort;const _errs77 = errors;if(errors === _errs77){if(typeof data30 === "string"){if(func2(data30) < 1){validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/effort",schemaPath:"#/properties/routes/items/properties/effort/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/routes/" + i0+"/effort",schemaPath:"#/properties/routes/items/properties/effort/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid14 = _errs77 === errors;}else {var valid14 = true;}}}}}}}else {validate38.errors = [{instancePath:instancePath+"/routes/" + i0,schemaPath:"#/properties/routes/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid13 = _errs69 === errors;if(!valid13){break;}}}else {validate38.errors = [{instancePath:instancePath+"/routes",schemaPath:"#/properties/routes/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs67 === errors;}else {var valid0 = true;}if(valid0){if(data.domainOutcomes !== undefined){let data31 = data.domainOutcomes;const _errs79 = errors;if(errors === _errs79){if(Array.isArray(data31)){var valid15 = true;const len1 = data31.length;for(let i1=0; i1<len1; i1++){let data32 = data31[i1];const _errs81 = errors;const _errs82 = errors;if(errors === _errs82){if(data32 && typeof data32 == "object" && !Array.isArray(data32)){let missing4;if((((data32.trial === undefined) && (missing4 = "trial")) || ((data32.id === undefined) && (missing4 = "id"))) || ((data32.status === undefined) && (missing4 = "status"))){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1,schemaPath:"#/$defs/outcome/required",keyword:"required",params:{missingProperty: missing4},message:"must have required property '"+missing4+"'"}];return false;}else {const _errs84 = errors;for(const key4 in data32){if(!(((key4 === "trial") || (key4 === "id")) || (key4 === "status"))){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1,schemaPath:"#/$defs/outcome/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"}];return false;break;}}if(_errs84 === errors){if(data32.trial !== undefined){let data33 = data32.trial;const _errs85 = errors;if(!(((typeof data33 == "number") && (!(data33 % 1) && !isNaN(data33))) && (isFinite(data33)))){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1+"/trial",schemaPath:"#/$defs/outcome/properties/trial/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs85){if((typeof data33 == "number") && (isFinite(data33))){if(data33 < 1 || isNaN(data33)){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1+"/trial",schemaPath:"#/$defs/outcome/properties/trial/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}}var valid17 = _errs85 === errors;}else {var valid17 = true;}if(valid17){if(data32.id !== undefined){let data34 = data32.id;const _errs87 = errors;if(errors === _errs87){if(typeof data34 === "string"){if(func2(data34) < 1){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1+"/id",schemaPath:"#/$defs/outcome/properties/id/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1+"/id",schemaPath:"#/$defs/outcome/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid17 = _errs87 === errors;}else {var valid17 = true;}if(valid17){if(data32.status !== undefined){let data35 = data32.status;const _errs89 = errors;if(!(((data35 === "passed") || (data35 === "failed")) || (data35 === "unavailable"))){validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1+"/status",schemaPath:"#/$defs/outcome/properties/status/enum",keyword:"enum",params:{allowedValues: schema102.properties.status.enum},message:"must be equal to one of the allowed values"}];return false;}var valid17 = _errs89 === errors;}else {var valid17 = true;}}}}}}else {validate38.errors = [{instancePath:instancePath+"/domainOutcomes/" + i1,schemaPath:"#/$defs/outcome/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid15 = _errs81 === errors;if(!valid15){break;}}}else {validate38.errors = [{instancePath:instancePath+"/domainOutcomes",schemaPath:"#/properties/domainOutcomes/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs79 === errors;}else {var valid0 = true;}}}}}}}}}}}}}}}}}}}}}}}}}else {validate38.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate38.errors = vErrors;return errors === 0;}validate38.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate35(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="urn:sevro:schema:report:v1" */;let vErrors = null;let errors = 0;const evaluated0 = validate35.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((((data.format === undefined) && (missing0 = "format")) || ((data.inputs === undefined) && (missing0 = "inputs"))) || ((data.rows === undefined) && (missing0 = "rows"))) || ((data.summary === undefined) && (missing0 = "summary"))){validate35.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs1 = errors;for(const key0 in data){if(!((((key0 === "format") || (key0 === "inputs")) || (key0 === "rows")) || (key0 === "summary"))){validate35.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.format !== undefined){const _errs2 = errors;if("sevro.report.v1" !== data.format){validate35.errors = [{instancePath:instancePath+"/format",schemaPath:"#/properties/format/const",keyword:"const",params:{allowedValue: "sevro.report.v1"},message:"must be equal to constant"}];return false;}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.inputs !== undefined){let data1 = data.inputs;const _errs3 = errors;if(errors === _errs3){if(Array.isArray(data1)){if(data1.length < 1){validate35.errors = [{instancePath:instancePath+"/inputs",schemaPath:"#/properties/inputs/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"}];return false;}else {var valid1 = true;const len0 = data1.length;for(let i0=0; i0<len0; i0++){const _errs5 = errors;if(!(validate36(data1[i0], {instancePath:instancePath+"/inputs/" + i0,parentData:data1,parentDataProperty:i0,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate36.errors : vErrors.concat(validate36.errors);errors = vErrors.length;}var valid1 = _errs5 === errors;if(!valid1){break;}}}}else {validate35.errors = [{instancePath:instancePath+"/inputs",schemaPath:"#/properties/inputs/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.rows !== undefined){let data3 = data.rows;const _errs6 = errors;if(errors === _errs6){if(Array.isArray(data3)){var valid2 = true;const len1 = data3.length;for(let i1=0; i1<len1; i1++){const _errs8 = errors;if(!(validate38(data3[i1], {instancePath:instancePath+"/rows/" + i1,parentData:data3,parentDataProperty:i1,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);errors = vErrors.length;}var valid2 = _errs8 === errors;if(!valid2){break;}}}else {validate35.errors = [{instancePath:instancePath+"/rows",schemaPath:"#/properties/rows/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs6 === errors;}else {var valid0 = true;}if(valid0){if(data.summary !== undefined){let data5 = data.summary;const _errs9 = errors;if(errors === _errs9){if(data5 && typeof data5 == "object" && !Array.isArray(data5)){let missing1;if(((((data5.cases === undefined) && (missing1 = "cases")) || ((data5.passed === undefined) && (missing1 = "passed"))) || ((data5.failed === undefined) && (missing1 = "failed"))) || ((data5.notAssessed === undefined) && (missing1 = "notAssessed"))){validate35.errors = [{instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {const _errs11 = errors;for(const key1 in data5){if(!((((key1 === "cases") || (key1 === "passed")) || (key1 === "failed")) || (key1 === "notAssessed"))){validate35.errors = [{instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs11 === errors){if(data5.cases !== undefined){let data6 = data5.cases;const _errs12 = errors;if(!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))){validate35.errors = [{instancePath:instancePath+"/summary/cases",schemaPath:"#/properties/summary/properties/cases/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs12){if((typeof data6 == "number") && (isFinite(data6))){if(data6 < 0 || isNaN(data6)){validate35.errors = [{instancePath:instancePath+"/summary/cases",schemaPath:"#/properties/summary/properties/cases/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid3 = _errs12 === errors;}else {var valid3 = true;}if(valid3){if(data5.passed !== undefined){let data7 = data5.passed;const _errs14 = errors;if(!(((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))){validate35.errors = [{instancePath:instancePath+"/summary/passed",schemaPath:"#/properties/summary/properties/passed/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs14){if((typeof data7 == "number") && (isFinite(data7))){if(data7 < 0 || isNaN(data7)){validate35.errors = [{instancePath:instancePath+"/summary/passed",schemaPath:"#/properties/summary/properties/passed/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid3 = _errs14 === errors;}else {var valid3 = true;}if(valid3){if(data5.failed !== undefined){let data8 = data5.failed;const _errs16 = errors;if(!(((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8))) && (isFinite(data8)))){validate35.errors = [{instancePath:instancePath+"/summary/failed",schemaPath:"#/properties/summary/properties/failed/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs16){if((typeof data8 == "number") && (isFinite(data8))){if(data8 < 0 || isNaN(data8)){validate35.errors = [{instancePath:instancePath+"/summary/failed",schemaPath:"#/properties/summary/properties/failed/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid3 = _errs16 === errors;}else {var valid3 = true;}if(valid3){if(data5.notAssessed !== undefined){let data9 = data5.notAssessed;const _errs18 = errors;if(!(((typeof data9 == "number") && (!(data9 % 1) && !isNaN(data9))) && (isFinite(data9)))){validate35.errors = [{instancePath:instancePath+"/summary/notAssessed",schemaPath:"#/properties/summary/properties/notAssessed/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(errors === _errs18){if((typeof data9 == "number") && (isFinite(data9))){if(data9 < 0 || isNaN(data9)){validate35.errors = [{instancePath:instancePath+"/summary/notAssessed",schemaPath:"#/properties/summary/properties/notAssessed/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid3 = _errs18 === errors;}else {var valid3 = true;}}}}}}}else {validate35.errors = [{instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs9 === errors;}else {var valid0 = true;}}}}}}}else {validate35.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate35.errors = vErrors;return errors === 0;}validate35.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};