@bjoernrochel/sevro 0.1.0-rc.2 → 0.1.0-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +170 -0
- package/LICENSE +63 -136
- package/README.md +83 -66
- package/docs/README.md +44 -0
- package/docs/acknowledgements.md +14 -0
- package/docs/architecture.md +146 -0
- package/docs/assets/README.md +27 -0
- package/docs/assets/sevro-logo.png +0 -0
- package/docs/assets/sevro-symbol.svg +1 -0
- package/docs/assets/sevro-wordmark.svg +1 -0
- package/docs/builtin-graders-v1.md +41 -13
- package/docs/codex-host.md +184 -52
- package/docs/contracts.md +19 -0
- package/docs/creating-cases.md +139 -0
- package/docs/development-cli.md +190 -30
- package/docs/documentation-quality.md +61 -0
- package/docs/evaluation-workflow.md +110 -0
- package/docs/evidence/code-mode-controls-71.md +64 -0
- package/docs/evidence/code-mode-programs-85.md +64 -0
- package/docs/evidence/codex-state-73/README.md +204 -0
- package/docs/evidence/codex-state-73/darrow-migration.patch +182 -0
- package/docs/evidence/codex-state-73/results.json +661 -0
- package/docs/evidence/local-http-74.md +104 -0
- package/docs/evidence/runtime-startup-30/README.md +185 -0
- package/docs/evidence/runtime-startup-30/after.json +319 -0
- package/docs/evidence/runtime-startup-30/baseline-timeout.jsonl +2 -0
- package/docs/evidence/runtime-startup-30/before.json +403 -0
- package/docs/evidence/runtime-startup-30/consumer-smoke.json +63 -0
- package/docs/evidence/runtime-startup-30/full-policy-diagnostic.jsonl +3 -0
- package/docs/evidence/runtime-startup-30/minimal-policy-diagnostic.jsonl +3 -0
- package/docs/evidence/runtime-startup-30/plugin-template-assessment.json +20 -0
- package/docs/evidence/runtime-startup-30/seedless-timeout.jsonl +2 -0
- package/docs/evidence/skill-reads-70/results.json +823 -0
- package/docs/evidence.md +21 -0
- package/docs/extension-protocol-v1.md +50 -16
- package/docs/fixture-cleanup-validation.md +3 -0
- package/docs/getting-started.md +102 -0
- package/docs/guide-evaluation.md +89 -0
- package/docs/guide-verification.json +239 -0
- package/docs/identity-v1.md +35 -1
- package/docs/installing.md +88 -0
- package/docs/licenses/BUSL-1.1-0.1.0-rc.2.txt +159 -0
- package/docs/licensing.md +42 -0
- package/docs/native-controls.md +76 -5
- package/docs/native-hosts.md +228 -0
- package/docs/reading-results.md +141 -0
- package/docs/recipes.md +489 -0
- package/docs/releases.md +81 -40
- package/docs/report-v1.md +29 -1
- package/docs/results-v1.md +180 -0
- package/docs/run-settings-v1.md +147 -0
- package/docs/running-evaluations.md +31 -0
- package/docs/runtime-v1.md +614 -0
- package/docs/specs/repository-guide.md +58 -0
- package/docs/troubleshooting.md +30 -0
- package/docs/typescript-quality.md +234 -0
- package/docs/usability-study.md +114 -0
- package/examples/basic/host.ts +2 -2
- package/examples/recipes/candidate.ts +26 -0
- package/examples/recipes/cases/coding-change.json +21 -0
- package/examples/recipes/cases/host-tools.json +21 -0
- package/examples/recipes/cases/mise.json +21 -0
- package/examples/recipes/cases/node.json +21 -0
- package/examples/recipes/cases/python-uv.json +21 -0
- package/examples/recipes/cases/semantic.json +17 -0
- package/examples/recipes/coding-change/check.ts +23 -0
- package/examples/recipes/extension-artifacts.ts +65 -0
- package/examples/recipes/extension-methods.ts +174 -0
- package/examples/recipes/extension.ts +37 -0
- package/examples/recipes/repository-skill/.agents/skills/startup-guide/SKILL.md +7 -0
- package/examples/recipes/repository-skill/.claude/skills/startup-guide/SKILL.md +7 -0
- package/examples/recipes/repository-skill/README.md +3 -0
- package/examples/recipes/run-inputs.ts +188 -0
- package/examples/recipes/run-options.ts +131 -0
- package/examples/recipes/run.ts +63 -0
- package/examples/recipes/runtime/empty.json +1 -0
- package/examples/recipes/runtime/goals.json +1 -0
- package/examples/recipes/runtime/mise.json +6 -0
- package/examples/recipes/runtime/path.json +1 -0
- package/examples/recipes/runtime/plugins.json +4 -0
- package/examples/recipes/runtime/python-uv.json +10 -0
- package/examples/recipes/semantic-judge.ts +29 -0
- package/examples/templates/coding/adapter.ts +17 -0
- package/examples/templates/coding/case.json +15 -0
- package/examples/templates/repository-skill/.agents/skills/startup-guide/SKILL.md +6 -0
- package/examples/templates/repository-skill/extension-data.ts +64 -0
- package/examples/templates/repository-skill/extension.ts +31 -0
- package/examples/templates/response/adapter.ts +12 -0
- package/examples/templates/response/case.json +13 -0
- package/package.json +39 -6
- package/schemas/report-v1.schema.json +9 -0
- package/schemas/run-evidence-v1.schema.json +2 -1
- package/schemas/runtime-v1.schema.json +193 -0
- package/src/advisory.ts +10 -5
- package/src/candidate-artifacts.ts +208 -0
- package/src/candidate-codex-state.ts +185 -0
- package/src/case-validation.ts +105 -0
- package/src/cli/cancellation.ts +20 -0
- package/src/cli/command.ts +81 -0
- package/src/cli/completion.ts +15 -0
- package/src/cli/demo.ts +59 -0
- package/src/cli/evaluation.ts +55 -0
- package/src/cli/extension.ts +79 -0
- package/src/cli/help.ts +222 -0
- package/src/cli/hosts.ts +59 -0
- package/src/cli/init-settings.ts +30 -0
- package/src/cli/init.ts +111 -0
- package/src/cli/invocation.ts +627 -0
- package/src/cli/loading.ts +151 -0
- package/src/cli/preparation.ts +163 -0
- package/src/cli/presentation.ts +91 -0
- package/src/cli/progress.ts +6 -0
- package/src/cli/run-manifest.ts +133 -0
- package/src/cli/run-options.ts +101 -0
- package/src/cli/run-overrides.ts +83 -0
- package/src/cli/settings.ts +160 -0
- package/src/cli/summary.ts +43 -0
- package/src/cli.ts +13 -843
- package/src/contract-types.ts +94 -0
- package/src/engine.ts +19 -2373
- package/src/evaluation/advisory.ts +150 -0
- package/src/evaluation/check-plan.ts +510 -0
- package/src/evaluation/collection.ts +88 -0
- package/src/evaluation/context.ts +10 -0
- package/src/evaluation/grading-host.ts +39 -0
- package/src/evaluation/grading.ts +258 -0
- package/src/evaluation/invocation-plan.ts +548 -0
- package/src/evaluation/plan.ts +736 -0
- package/src/evaluation/progress.ts +19 -0
- package/src/evaluation/resources.ts +241 -0
- package/src/evaluation/run.ts +206 -0
- package/src/{trial-scheduler.ts → evaluation/scheduler.ts} +3 -1
- package/src/evaluation/semantic.ts +312 -0
- package/src/evaluation/trial.ts +866 -0
- package/src/evaluation/types.ts +207 -0
- package/src/evidence/host-results.ts +92 -0
- package/src/evidence/retained-artifacts.ts +18 -0
- package/src/evidence/trial-writer.ts +203 -0
- package/src/evidence/usage.ts +17 -0
- package/src/extension-client.ts +228 -148
- package/src/extension-session.ts +326 -195
- package/src/fixtures/advisory.ts +338 -0
- package/src/fixtures/bin.ts +57 -0
- package/src/{fixture-cleanup.ts → fixtures/cleanup.ts} +13 -7
- package/src/fixtures/create.ts +187 -0
- package/src/fixtures/generated.ts +300 -0
- package/src/fixtures/git-hooks.ts +24 -0
- package/src/fixtures/preparation.ts +270 -0
- package/src/{repository-fixture.ts → fixtures/repository.ts} +207 -85
- package/src/fixtures/setup.ts +224 -0
- package/src/fixtures/tools.ts +88 -0
- package/src/fixtures/workspace-state.ts +212 -0
- package/src/generated/cli-result.cjs +2 -0
- package/src/generated/cli-result.d.cts +3 -0
- package/src/generated/extension.cjs +2 -0
- package/src/generated/extension.d.cts +3 -0
- package/src/generated/report.cjs +2 -0
- package/src/generated/report.d.cts +3 -0
- package/src/generated/run-evidence.cjs +2 -0
- package/src/generated/run-evidence.d.cts +3 -0
- package/src/generated/runtime.cjs +2 -0
- package/src/generated/runtime.d.cts +3 -0
- package/src/graders/artifact.ts +56 -23
- package/src/graders/git-head.ts +79 -75
- package/src/graders/output.ts +222 -140
- package/src/graders/semantic.ts +102 -43
- package/src/graders/shell.ts +379 -207
- package/src/host-diagnostic-redaction.ts +52 -0
- package/src/host-diagnostics.ts +319 -0
- package/src/hosts/claude-continuation.ts +63 -18
- package/src/hosts/claude-credential.ts +43 -62
- package/src/hosts/claude-events.ts +86 -51
- package/src/hosts/claude-keychain.ts +59 -0
- package/src/hosts/claude-native-goal.ts +57 -33
- package/src/hosts/claude-process.ts +111 -0
- package/src/hosts/claude-repository-invocation.ts +208 -117
- package/src/hosts/claude-settings.ts +240 -21
- package/src/hosts/claude-skill-activations.ts +166 -0
- package/src/hosts/claude-state.ts +403 -0
- package/src/hosts/claude-tool-calls.ts +171 -106
- package/src/hosts/claude.ts +561 -451
- package/src/hosts/codex-app-server.ts +326 -178
- package/src/hosts/codex-configuration.ts +44 -18
- package/src/hosts/codex-events.ts +97 -60
- package/src/hosts/codex-exec-controls.ts +516 -0
- package/src/hosts/codex-invocation.ts +70 -0
- package/src/hosts/codex-marketplace.ts +283 -0
- package/src/hosts/codex-native-calls.ts +546 -500
- package/src/hosts/codex-process.ts +202 -0
- package/src/hosts/codex-profile.ts +257 -28
- package/src/hosts/codex-session-files.ts +106 -0
- package/src/hosts/codex-state.ts +492 -0
- package/src/hosts/codex.ts +783 -832
- package/src/hosts/isolation-common.ts +94 -0
- package/src/hosts/isolation-roots.ts +54 -27
- package/src/hosts/isolation.ts +10 -0
- package/src/hosts/linux-sandbox.ts +159 -0
- package/src/hosts/mac-sandbox.ts +187 -61
- package/src/hosts/native-controls.ts +152 -62
- package/src/hosts/process-lifecycle.ts +37 -0
- package/src/hosts/protected-worktrees.ts +51 -19
- package/src/hosts/skill-hook-catalog.ts +131 -0
- package/src/hosts/skill-hook-handler.ts +374 -0
- package/src/hosts/skill-hooks.ts +580 -0
- package/src/hosts/workspace-fingerprint.ts +55 -35
- package/src/identity.ts +102 -48
- package/src/instrumentation.ts +109 -48
- package/src/native-transcript-state.ts +131 -0
- package/src/native-transcript-view.ts +90 -0
- package/src/native-transcripts.ts +286 -0
- package/src/process-lifecycle.ts +150 -0
- package/src/provenance.ts +161 -81
- package/src/prune.ts +215 -0
- package/src/report.ts +172 -140
- package/src/resolved-case.ts +33 -0
- package/src/results-lock.ts +29 -0
- package/src/results.ts +133 -86
- package/src/run-owner.ts +154 -63
- package/src/runtime/config.ts +456 -0
- package/src/runtime/discovery-apple.ts +90 -0
- package/src/runtime/discovery-providers.ts +63 -0
- package/src/runtime/discovery.ts +70 -0
- package/src/runtime/hook-processes.ts +97 -0
- package/src/runtime/hooks.ts +476 -0
- package/src/runtime/paths.ts +313 -0
- package/src/runtime/query.ts +85 -0
- package/src/runtime/seeds.ts +134 -0
- package/src/runtime/shared-cache.ts +143 -0
- package/src/runtime/state.ts +143 -0
- package/src/schema-types.ts +198 -0
- package/src/schema.ts +15 -19
- package/src/transcript-retention.ts +146 -0
- package/src/value-guards.ts +20 -0
- package/src/advisory-fixture.ts +0 -282
- package/src/fixture-bin.ts +0 -87
- package/src/fixture-setup.ts +0 -163
- package/src/generated-fixture.ts +0 -220
- package/src/git-hooks.ts +0 -63
- package/src/hosts/claude-nested-skills.ts +0 -218
- package/src/hosts/codex-command-output.ts +0 -399
- package/src/hosts/codex-executor-command.ts +0 -195
- package/src/hosts/codex-skill-reads.ts +0 -391
- package/src/preparation.ts +0 -211
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Generated by bun run schemas:generate; do not edit.
|
|
2
|
+
"use strict";module.exports = validate104;module.exports.default = validate104;const schema164 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"urn:sevro:schema:runtime:v1","title":"Sevro runtime policy v1","type":"object","additionalProperties":false,"required":["format"],"properties":{"codexState":{"type":"boolean"},"network":{"type":"object","additionalProperties":false,"properties":{"localHttp":{"type":"boolean"}}},"nativeTranscripts":{"type":"boolean"},"hooks":{"type":"object","additionalProperties":false,"properties":{"nativeGoal":{"type":"boolean"},"plugins":{"type":"array","maxItems":64,"uniqueItems":true,"items":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","maxLength":128}}}},"runtime":{"type":"object","additionalProperties":false,"properties":{"artifactDirectories":{"type":"array","maxItems":16,"items":{"type":"object","additionalProperties":false,"required":["name","path"],"properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"path":{"type":"string","minLength":1,"maxLength":4096}}}},"sharedCacheDirectories":{"type":"array","maxItems":16,"items":{"type":"object","additionalProperties":false,"required":["source","target","roles"],"properties":{"source":{"type":"string","minLength":1,"maxLength":4096},"target":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$","not":{"enum":["home","tmp"]}},"roles":{"type":"array","minItems":1,"maxItems":5,"uniqueItems":true,"items":{"enum":["candidate","checks","hooks","semantic","advisory"]}}}}},"seedDirectories":{"type":"array","maxItems":16,"items":{"type":"object","additionalProperties":false,"required":["source","target"],"properties":{"source":{"type":"string","minLength":1,"maxLength":4096},"target":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$","not":{"enum":["home","tmp"]}},"roles":{"type":"array","minItems":1,"maxItems":5,"uniqueItems":true,"items":{"enum":["candidate","checks","hooks","semantic","advisory"]}}}}}}},"format":{"const":"sevro.runtime.v1"},"filesystem":{"type":"object","additionalProperties":false,"properties":{"optionalReadOnlyRoots":{"type":"array","maxItems":64,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":4096}},"readOnlyRoots":{"type":"array","maxItems":64,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":4096}}}},"environment":{"type":"object","additionalProperties":false,"properties":{"inherit":{"type":"array","maxItems":64,"uniqueItems":true,"items":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]{0,127}$"}},"set":{"type":"object","maxProperties":64,"propertyNames":{"pattern":"^[A-Za-z_][A-Za-z0-9_]{0,127}$"},"additionalProperties":{"type":"string","maxLength":8192}}}}}};const func2 = require("ajv/dist/runtime/ucs2length").default;const func0 = require("ajv/dist/runtime/equal").default;const pattern55 = new RegExp("^[a-z][a-z0-9-]*$", "u");const pattern56 = new RegExp("^[a-z][a-z0-9_]{0,63}$", "u");const pattern57 = new RegExp("^[a-z][a-z0-9-]{0,63}$", "u");const pattern59 = new RegExp("^[A-Za-z_][A-Za-z0-9_]{0,127}$", "u");function validate104(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="urn:sevro:schema:runtime:v1" */;let vErrors = null;let errors = 0;const evaluated0 = validate104.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")){validate104.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 === "codexState") || (key0 === "network")) || (key0 === "nativeTranscripts")) || (key0 === "hooks")) || (key0 === "runtime")) || (key0 === "format")) || (key0 === "filesystem")) || (key0 === "environment"))){validate104.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.codexState !== undefined){const _errs2 = errors;if(typeof data.codexState !== "boolean"){validate104.errors = [{instancePath:instancePath+"/codexState",schemaPath:"#/properties/codexState/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.network !== undefined){let data1 = data.network;const _errs4 = errors;if(errors === _errs4){if(data1 && typeof data1 == "object" && !Array.isArray(data1)){const _errs6 = errors;for(const key1 in data1){if(!(key1 === "localHttp")){validate104.errors = [{instancePath:instancePath+"/network",schemaPath:"#/properties/network/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs6 === errors){if(data1.localHttp !== undefined){if(typeof data1.localHttp !== "boolean"){validate104.errors = [{instancePath:instancePath+"/network/localHttp",schemaPath:"#/properties/network/properties/localHttp/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}}}}else {validate104.errors = [{instancePath:instancePath+"/network",schemaPath:"#/properties/network/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs4 === errors;}else {var valid0 = true;}if(valid0){if(data.nativeTranscripts !== undefined){const _errs9 = errors;if(typeof data.nativeTranscripts !== "boolean"){validate104.errors = [{instancePath:instancePath+"/nativeTranscripts",schemaPath:"#/properties/nativeTranscripts/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.hooks !== undefined){let data4 = data.hooks;const _errs11 = errors;if(errors === _errs11){if(data4 && typeof data4 == "object" && !Array.isArray(data4)){const _errs13 = errors;for(const key2 in data4){if(!((key2 === "nativeGoal") || (key2 === "plugins"))){validate104.errors = [{instancePath:instancePath+"/hooks",schemaPath:"#/properties/hooks/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"}];return false;break;}}if(_errs13 === errors){if(data4.nativeGoal !== undefined){const _errs14 = errors;if(typeof data4.nativeGoal !== "boolean"){validate104.errors = [{instancePath:instancePath+"/hooks/nativeGoal",schemaPath:"#/properties/hooks/properties/nativeGoal/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid2 = _errs14 === errors;}else {var valid2 = true;}if(valid2){if(data4.plugins !== undefined){let data6 = data4.plugins;const _errs16 = errors;if(errors === _errs16){if(Array.isArray(data6)){if(data6.length > 64){validate104.errors = [{instancePath:instancePath+"/hooks/plugins",schemaPath:"#/properties/hooks/properties/plugins/maxItems",keyword:"maxItems",params:{limit: 64},message:"must NOT have more than 64 items"}];return false;}else {var valid3 = true;const len0 = data6.length;for(let i0=0; i0<len0; i0++){let data7 = data6[i0];const _errs18 = errors;if(errors === _errs18){if(typeof data7 === "string"){if(func2(data7) > 128){validate104.errors = [{instancePath:instancePath+"/hooks/plugins/" + i0,schemaPath:"#/properties/hooks/properties/plugins/items/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"}];return false;}else {if(!pattern55.test(data7)){validate104.errors = [{instancePath:instancePath+"/hooks/plugins/" + i0,schemaPath:"#/properties/hooks/properties/plugins/items/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*$"+"\""}];return false;}}}else {validate104.errors = [{instancePath:instancePath+"/hooks/plugins/" + i0,schemaPath:"#/properties/hooks/properties/plugins/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid3 = _errs18 === errors;if(!valid3){break;}}if(valid3){let i1 = data6.length;let j0;if(i1 > 1){const indices0 = {};for(;i1--;){let item0 = data6[i1];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j0 = indices0[item0];validate104.errors = [{instancePath:instancePath+"/hooks/plugins",schemaPath:"#/properties/hooks/properties/plugins/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];return false;break;}indices0[item0] = i1;}}}}}else {validate104.errors = [{instancePath:instancePath+"/hooks/plugins",schemaPath:"#/properties/hooks/properties/plugins/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid2 = _errs16 === errors;}else {var valid2 = true;}}}}else {validate104.errors = [{instancePath:instancePath+"/hooks",schemaPath:"#/properties/hooks/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs11 === errors;}else {var valid0 = true;}if(valid0){if(data.runtime !== undefined){let data8 = data.runtime;const _errs20 = errors;if(errors === _errs20){if(data8 && typeof data8 == "object" && !Array.isArray(data8)){const _errs22 = errors;for(const key3 in data8){if(!(((key3 === "artifactDirectories") || (key3 === "sharedCacheDirectories")) || (key3 === "seedDirectories"))){validate104.errors = [{instancePath:instancePath+"/runtime",schemaPath:"#/properties/runtime/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs22 === errors){if(data8.artifactDirectories !== undefined){let data9 = data8.artifactDirectories;const _errs23 = errors;if(errors === _errs23){if(Array.isArray(data9)){if(data9.length > 16){validate104.errors = [{instancePath:instancePath+"/runtime/artifactDirectories",schemaPath:"#/properties/runtime/properties/artifactDirectories/maxItems",keyword:"maxItems",params:{limit: 16},message:"must NOT have more than 16 items"}];return false;}else {var valid6 = true;const len1 = data9.length;for(let i2=0; i2<len1; i2++){let data10 = data9[i2];const _errs25 = errors;if(errors === _errs25){if(data10 && typeof data10 == "object" && !Array.isArray(data10)){let missing1;if(((data10.name === undefined) && (missing1 = "name")) || ((data10.path === undefined) && (missing1 = "path"))){validate104.errors = [{instancePath:instancePath+"/runtime/artifactDirectories/" + i2,schemaPath:"#/properties/runtime/properties/artifactDirectories/items/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {const _errs27 = errors;for(const key4 in data10){if(!((key4 === "name") || (key4 === "path"))){validate104.errors = [{instancePath:instancePath+"/runtime/artifactDirectories/" + i2,schemaPath:"#/properties/runtime/properties/artifactDirectories/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"}];return false;break;}}if(_errs27 === errors){if(data10.name !== undefined){let data11 = data10.name;const _errs28 = errors;if(errors === _errs28){if(typeof data11 === "string"){if(!pattern56.test(data11)){validate104.errors = [{instancePath:instancePath+"/runtime/artifactDirectories/" + i2+"/name",schemaPath:"#/properties/runtime/properties/artifactDirectories/items/properties/name/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9_]{0,63}$"},message:"must match pattern \""+"^[a-z][a-z0-9_]{0,63}$"+"\""}];return false;}}else {validate104.errors = [{instancePath:instancePath+"/runtime/artifactDirectories/" + i2+"/name",schemaPath:"#/properties/runtime/properties/artifactDirectories/items/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid7 = _errs28 === errors;}else {var valid7 = true;}if(valid7){if(data10.path !== undefined){let data12 = data10.path;const _errs30 = errors;if(errors === _errs30){if(typeof data12 === "string"){if(func2(data12) > 4096){validate104.errors = [{instancePath:instancePath+"/runtime/artifactDirectories/" + i2+"/path",schemaPath:"#/properties/runtime/properties/artifactDirectories/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 4096},message:"must NOT have more than 4096 characters"}];return false;}else {if(func2(data12) < 1){validate104.errors = [{instancePath:instancePath+"/runtime/artifactDirectories/" + i2+"/path",schemaPath:"#/properties/runtime/properties/artifactDirectories/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/artifactDirectories/" + i2+"/path",schemaPath:"#/properties/runtime/properties/artifactDirectories/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid7 = _errs30 === errors;}else {var valid7 = true;}}}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/artifactDirectories/" + i2,schemaPath:"#/properties/runtime/properties/artifactDirectories/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid6 = _errs25 === errors;if(!valid6){break;}}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/artifactDirectories",schemaPath:"#/properties/runtime/properties/artifactDirectories/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid5 = _errs23 === errors;}else {var valid5 = true;}if(valid5){if(data8.sharedCacheDirectories !== undefined){let data13 = data8.sharedCacheDirectories;const _errs32 = errors;if(errors === _errs32){if(Array.isArray(data13)){if(data13.length > 16){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/maxItems",keyword:"maxItems",params:{limit: 16},message:"must NOT have more than 16 items"}];return false;}else {var valid8 = true;const len2 = data13.length;for(let i3=0; i3<len2; i3++){let data14 = data13[i3];const _errs34 = errors;if(errors === _errs34){if(data14 && typeof data14 == "object" && !Array.isArray(data14)){let missing2;if((((data14.source === undefined) && (missing2 = "source")) || ((data14.target === undefined) && (missing2 = "target"))) || ((data14.roles === undefined) && (missing2 = "roles"))){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3,schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/required",keyword:"required",params:{missingProperty: missing2},message:"must have required property '"+missing2+"'"}];return false;}else {const _errs36 = errors;for(const key5 in data14){if(!(((key5 === "source") || (key5 === "target")) || (key5 === "roles"))){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3,schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"}];return false;break;}}if(_errs36 === errors){if(data14.source !== undefined){let data15 = data14.source;const _errs37 = errors;if(errors === _errs37){if(typeof data15 === "string"){if(func2(data15) > 4096){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/source",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/source/maxLength",keyword:"maxLength",params:{limit: 4096},message:"must NOT have more than 4096 characters"}];return false;}else {if(func2(data15) < 1){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/source",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/source/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/source",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/source/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid9 = _errs37 === errors;}else {var valid9 = true;}if(valid9){if(data14.target !== undefined){let data16 = data14.target;const _errs39 = errors;const _errs41 = errors;const _errs42 = errors;if(!((data16 === "home") || (data16 === "tmp"))){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}var valid10 = _errs42 === errors;if(valid10){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/target",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/target/not",keyword:"not",params:{},message:"must NOT be valid"}];return false;}else {errors = _errs41;if(vErrors !== null){if(_errs41){vErrors.length = _errs41;}else {vErrors = null;}}}if(errors === _errs39){if(typeof data16 === "string"){if(!pattern57.test(data16)){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/target",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/target/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]{0,63}$"},message:"must match pattern \""+"^[a-z][a-z0-9-]{0,63}$"+"\""}];return false;}}else {validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/target",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/target/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid9 = _errs39 === errors;}else {var valid9 = true;}if(valid9){if(data14.roles !== undefined){let data17 = data14.roles;const _errs43 = errors;if(errors === _errs43){if(Array.isArray(data17)){if(data17.length > 5){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/roles",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/roles/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"}];return false;}else {if(data17.length < 1){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/roles",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/roles/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"}];return false;}else {var valid11 = true;const len3 = data17.length;for(let i4=0; i4<len3; i4++){let data18 = data17[i4];const _errs45 = errors;if(!(((((data18 === "candidate") || (data18 === "checks")) || (data18 === "hooks")) || (data18 === "semantic")) || (data18 === "advisory"))){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/roles/" + i4,schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/roles/items/enum",keyword:"enum",params:{allowedValues: schema164.properties.runtime.properties.sharedCacheDirectories.items.properties.roles.items.enum},message:"must be equal to one of the allowed values"}];return false;}var valid11 = _errs45 === errors;if(!valid11){break;}}if(valid11){let i5 = data17.length;let j1;if(i5 > 1){outer0:for(;i5--;){for(j1 = i5; j1--;){if(func0(data17[i5], data17[j1])){validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/roles",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/roles/uniqueItems",keyword:"uniqueItems",params:{i: i5, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i5+" are identical)"}];return false;break outer0;}}}}}}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3+"/roles",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/properties/roles/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid9 = _errs43 === errors;}else {var valid9 = true;}}}}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories/" + i3,schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid8 = _errs34 === errors;if(!valid8){break;}}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/sharedCacheDirectories",schemaPath:"#/properties/runtime/properties/sharedCacheDirectories/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid5 = _errs32 === errors;}else {var valid5 = true;}if(valid5){if(data8.seedDirectories !== undefined){let data19 = data8.seedDirectories;const _errs46 = errors;if(errors === _errs46){if(Array.isArray(data19)){if(data19.length > 16){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories",schemaPath:"#/properties/runtime/properties/seedDirectories/maxItems",keyword:"maxItems",params:{limit: 16},message:"must NOT have more than 16 items"}];return false;}else {var valid13 = true;const len4 = data19.length;for(let i6=0; i6<len4; i6++){let data20 = data19[i6];const _errs48 = errors;if(errors === _errs48){if(data20 && typeof data20 == "object" && !Array.isArray(data20)){let missing3;if(((data20.source === undefined) && (missing3 = "source")) || ((data20.target === undefined) && (missing3 = "target"))){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6,schemaPath:"#/properties/runtime/properties/seedDirectories/items/required",keyword:"required",params:{missingProperty: missing3},message:"must have required property '"+missing3+"'"}];return false;}else {const _errs50 = errors;for(const key6 in data20){if(!(((key6 === "source") || (key6 === "target")) || (key6 === "roles"))){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6,schemaPath:"#/properties/runtime/properties/seedDirectories/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"}];return false;break;}}if(_errs50 === errors){if(data20.source !== undefined){let data21 = data20.source;const _errs51 = errors;if(errors === _errs51){if(typeof data21 === "string"){if(func2(data21) > 4096){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/source",schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/source/maxLength",keyword:"maxLength",params:{limit: 4096},message:"must NOT have more than 4096 characters"}];return false;}else {if(func2(data21) < 1){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/source",schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/source/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/source",schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/source/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid14 = _errs51 === errors;}else {var valid14 = true;}if(valid14){if(data20.target !== undefined){let data22 = data20.target;const _errs53 = errors;const _errs55 = errors;const _errs56 = errors;if(!((data22 === "home") || (data22 === "tmp"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var valid15 = _errs56 === errors;if(valid15){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/target",schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/target/not",keyword:"not",params:{},message:"must NOT be valid"}];return false;}else {errors = _errs55;if(vErrors !== null){if(_errs55){vErrors.length = _errs55;}else {vErrors = null;}}}if(errors === _errs53){if(typeof data22 === "string"){if(!pattern57.test(data22)){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/target",schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/target/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]{0,63}$"},message:"must match pattern \""+"^[a-z][a-z0-9-]{0,63}$"+"\""}];return false;}}else {validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/target",schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/target/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid14 = _errs53 === errors;}else {var valid14 = true;}if(valid14){if(data20.roles !== undefined){let data23 = data20.roles;const _errs57 = errors;if(errors === _errs57){if(Array.isArray(data23)){if(data23.length > 5){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/roles",schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/roles/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"}];return false;}else {if(data23.length < 1){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/roles",schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/roles/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"}];return false;}else {var valid16 = true;const len5 = data23.length;for(let i7=0; i7<len5; i7++){let data24 = data23[i7];const _errs59 = errors;if(!(((((data24 === "candidate") || (data24 === "checks")) || (data24 === "hooks")) || (data24 === "semantic")) || (data24 === "advisory"))){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/roles/" + i7,schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/roles/items/enum",keyword:"enum",params:{allowedValues: schema164.properties.runtime.properties.seedDirectories.items.properties.roles.items.enum},message:"must be equal to one of the allowed values"}];return false;}var valid16 = _errs59 === errors;if(!valid16){break;}}if(valid16){let i8 = data23.length;let j2;if(i8 > 1){outer1:for(;i8--;){for(j2 = i8; j2--;){if(func0(data23[i8], data23[j2])){validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/roles",schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/roles/uniqueItems",keyword:"uniqueItems",params:{i: i8, j: j2},message:"must NOT have duplicate items (items ## "+j2+" and "+i8+" are identical)"}];return false;break outer1;}}}}}}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6+"/roles",schemaPath:"#/properties/runtime/properties/seedDirectories/items/properties/roles/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid14 = _errs57 === errors;}else {var valid14 = true;}}}}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories/" + i6,schemaPath:"#/properties/runtime/properties/seedDirectories/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid13 = _errs48 === errors;if(!valid13){break;}}}}else {validate104.errors = [{instancePath:instancePath+"/runtime/seedDirectories",schemaPath:"#/properties/runtime/properties/seedDirectories/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid5 = _errs46 === errors;}else {var valid5 = true;}}}}}else {validate104.errors = [{instancePath:instancePath+"/runtime",schemaPath:"#/properties/runtime/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs20 === errors;}else {var valid0 = true;}if(valid0){if(data.format !== undefined){const _errs60 = errors;if("sevro.runtime.v1" !== data.format){validate104.errors = [{instancePath:instancePath+"/format",schemaPath:"#/properties/format/const",keyword:"const",params:{allowedValue: "sevro.runtime.v1"},message:"must be equal to constant"}];return false;}var valid0 = _errs60 === errors;}else {var valid0 = true;}if(valid0){if(data.filesystem !== undefined){let data26 = data.filesystem;const _errs61 = errors;if(errors === _errs61){if(data26 && typeof data26 == "object" && !Array.isArray(data26)){const _errs63 = errors;for(const key7 in data26){if(!((key7 === "optionalReadOnlyRoots") || (key7 === "readOnlyRoots"))){validate104.errors = [{instancePath:instancePath+"/filesystem",schemaPath:"#/properties/filesystem/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"}];return false;break;}}if(_errs63 === errors){if(data26.optionalReadOnlyRoots !== undefined){let data27 = data26.optionalReadOnlyRoots;const _errs64 = errors;if(errors === _errs64){if(Array.isArray(data27)){if(data27.length > 64){validate104.errors = [{instancePath:instancePath+"/filesystem/optionalReadOnlyRoots",schemaPath:"#/properties/filesystem/properties/optionalReadOnlyRoots/maxItems",keyword:"maxItems",params:{limit: 64},message:"must NOT have more than 64 items"}];return false;}else {var valid19 = true;const len6 = data27.length;for(let i9=0; i9<len6; i9++){let data28 = data27[i9];const _errs66 = errors;if(errors === _errs66){if(typeof data28 === "string"){if(func2(data28) > 4096){validate104.errors = [{instancePath:instancePath+"/filesystem/optionalReadOnlyRoots/" + i9,schemaPath:"#/properties/filesystem/properties/optionalReadOnlyRoots/items/maxLength",keyword:"maxLength",params:{limit: 4096},message:"must NOT have more than 4096 characters"}];return false;}else {if(func2(data28) < 1){validate104.errors = [{instancePath:instancePath+"/filesystem/optionalReadOnlyRoots/" + i9,schemaPath:"#/properties/filesystem/properties/optionalReadOnlyRoots/items/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}}else {validate104.errors = [{instancePath:instancePath+"/filesystem/optionalReadOnlyRoots/" + i9,schemaPath:"#/properties/filesystem/properties/optionalReadOnlyRoots/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid19 = _errs66 === errors;if(!valid19){break;}}if(valid19){let i10 = data27.length;let j3;if(i10 > 1){const indices1 = {};for(;i10--;){let item1 = data27[i10];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j3 = indices1[item1];validate104.errors = [{instancePath:instancePath+"/filesystem/optionalReadOnlyRoots",schemaPath:"#/properties/filesystem/properties/optionalReadOnlyRoots/uniqueItems",keyword:"uniqueItems",params:{i: i10, j: j3},message:"must NOT have duplicate items (items ## "+j3+" and "+i10+" are identical)"}];return false;break;}indices1[item1] = i10;}}}}}else {validate104.errors = [{instancePath:instancePath+"/filesystem/optionalReadOnlyRoots",schemaPath:"#/properties/filesystem/properties/optionalReadOnlyRoots/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid18 = _errs64 === errors;}else {var valid18 = true;}if(valid18){if(data26.readOnlyRoots !== undefined){let data29 = data26.readOnlyRoots;const _errs68 = errors;if(errors === _errs68){if(Array.isArray(data29)){if(data29.length > 64){validate104.errors = [{instancePath:instancePath+"/filesystem/readOnlyRoots",schemaPath:"#/properties/filesystem/properties/readOnlyRoots/maxItems",keyword:"maxItems",params:{limit: 64},message:"must NOT have more than 64 items"}];return false;}else {var valid21 = true;const len7 = data29.length;for(let i11=0; i11<len7; i11++){let data30 = data29[i11];const _errs70 = errors;if(errors === _errs70){if(typeof data30 === "string"){if(func2(data30) > 4096){validate104.errors = [{instancePath:instancePath+"/filesystem/readOnlyRoots/" + i11,schemaPath:"#/properties/filesystem/properties/readOnlyRoots/items/maxLength",keyword:"maxLength",params:{limit: 4096},message:"must NOT have more than 4096 characters"}];return false;}else {if(func2(data30) < 1){validate104.errors = [{instancePath:instancePath+"/filesystem/readOnlyRoots/" + i11,schemaPath:"#/properties/filesystem/properties/readOnlyRoots/items/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}}else {validate104.errors = [{instancePath:instancePath+"/filesystem/readOnlyRoots/" + i11,schemaPath:"#/properties/filesystem/properties/readOnlyRoots/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid21 = _errs70 === errors;if(!valid21){break;}}if(valid21){let i12 = data29.length;let j4;if(i12 > 1){const indices2 = {};for(;i12--;){let item2 = data29[i12];if(typeof item2 !== "string"){continue;}if(typeof indices2[item2] == "number"){j4 = indices2[item2];validate104.errors = [{instancePath:instancePath+"/filesystem/readOnlyRoots",schemaPath:"#/properties/filesystem/properties/readOnlyRoots/uniqueItems",keyword:"uniqueItems",params:{i: i12, j: j4},message:"must NOT have duplicate items (items ## "+j4+" and "+i12+" are identical)"}];return false;break;}indices2[item2] = i12;}}}}}else {validate104.errors = [{instancePath:instancePath+"/filesystem/readOnlyRoots",schemaPath:"#/properties/filesystem/properties/readOnlyRoots/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid18 = _errs68 === errors;}else {var valid18 = true;}}}}else {validate104.errors = [{instancePath:instancePath+"/filesystem",schemaPath:"#/properties/filesystem/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs61 === errors;}else {var valid0 = true;}if(valid0){if(data.environment !== undefined){let data31 = data.environment;const _errs72 = errors;if(errors === _errs72){if(data31 && typeof data31 == "object" && !Array.isArray(data31)){const _errs74 = errors;for(const key8 in data31){if(!((key8 === "inherit") || (key8 === "set"))){validate104.errors = [{instancePath:instancePath+"/environment",schemaPath:"#/properties/environment/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"}];return false;break;}}if(_errs74 === errors){if(data31.inherit !== undefined){let data32 = data31.inherit;const _errs75 = errors;if(errors === _errs75){if(Array.isArray(data32)){if(data32.length > 64){validate104.errors = [{instancePath:instancePath+"/environment/inherit",schemaPath:"#/properties/environment/properties/inherit/maxItems",keyword:"maxItems",params:{limit: 64},message:"must NOT have more than 64 items"}];return false;}else {var valid24 = true;const len8 = data32.length;for(let i13=0; i13<len8; i13++){let data33 = data32[i13];const _errs77 = errors;if(errors === _errs77){if(typeof data33 === "string"){if(!pattern59.test(data33)){validate104.errors = [{instancePath:instancePath+"/environment/inherit/" + i13,schemaPath:"#/properties/environment/properties/inherit/items/pattern",keyword:"pattern",params:{pattern: "^[A-Za-z_][A-Za-z0-9_]{0,127}$"},message:"must match pattern \""+"^[A-Za-z_][A-Za-z0-9_]{0,127}$"+"\""}];return false;}}else {validate104.errors = [{instancePath:instancePath+"/environment/inherit/" + i13,schemaPath:"#/properties/environment/properties/inherit/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid24 = _errs77 === errors;if(!valid24){break;}}if(valid24){let i14 = data32.length;let j5;if(i14 > 1){const indices3 = {};for(;i14--;){let item3 = data32[i14];if(typeof item3 !== "string"){continue;}if(typeof indices3[item3] == "number"){j5 = indices3[item3];validate104.errors = [{instancePath:instancePath+"/environment/inherit",schemaPath:"#/properties/environment/properties/inherit/uniqueItems",keyword:"uniqueItems",params:{i: i14, j: j5},message:"must NOT have duplicate items (items ## "+j5+" and "+i14+" are identical)"}];return false;break;}indices3[item3] = i14;}}}}}else {validate104.errors = [{instancePath:instancePath+"/environment/inherit",schemaPath:"#/properties/environment/properties/inherit/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid23 = _errs75 === errors;}else {var valid23 = true;}if(valid23){if(data31.set !== undefined){let data34 = data31.set;const _errs79 = errors;if(errors === _errs79){if(data34 && typeof data34 == "object" && !Array.isArray(data34)){if(Object.keys(data34).length > 64){validate104.errors = [{instancePath:instancePath+"/environment/set",schemaPath:"#/properties/environment/properties/set/maxProperties",keyword:"maxProperties",params:{limit: 64},message:"must NOT have more than 64 properties"}];return false;}else {for(const key9 in data34){const _errs81 = errors;if(typeof key9 === "string"){if(!pattern59.test(key9)){const err2 = {instancePath:instancePath+"/environment/set",schemaPath:"#/properties/environment/properties/set/propertyNames/pattern",keyword:"pattern",params:{pattern: "^[A-Za-z_][A-Za-z0-9_]{0,127}$"},message:"must match pattern \""+"^[A-Za-z_][A-Za-z0-9_]{0,127}$"+"\"",propertyName:key9};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}var valid26 = _errs81 === errors;if(!valid26){const err3 = {instancePath:instancePath+"/environment/set",schemaPath:"#/properties/environment/properties/set/propertyNames",keyword:"propertyNames",params:{propertyName: key9},message:"property name must be valid"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;validate104.errors = vErrors;return false;break;}}if(valid26){for(const key10 in data34){let data35 = data34[key10];const _errs83 = errors;if(errors === _errs83){if(typeof data35 === "string"){if(func2(data35) > 8192){validate104.errors = [{instancePath:instancePath+"/environment/set/" + key10.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/environment/properties/set/additionalProperties/maxLength",keyword:"maxLength",params:{limit: 8192},message:"must NOT have more than 8192 characters"}];return false;}}else {validate104.errors = [{instancePath:instancePath+"/environment/set/" + key10.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/environment/properties/set/additionalProperties/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid27 = _errs83 === errors;if(!valid27){break;}}}}}else {validate104.errors = [{instancePath:instancePath+"/environment/set",schemaPath:"#/properties/environment/properties/set/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid23 = _errs79 === errors;}else {var valid23 = true;}}}}else {validate104.errors = [{instancePath:instancePath+"/environment",schemaPath:"#/properties/environment/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs72 === errors;}else {var valid0 = true;}}}}}}}}}}}else {validate104.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate104.errors = vErrors;return errors === 0;}validate104.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};
|
package/src/graders/artifact.ts
CHANGED
|
@@ -11,29 +11,37 @@ import {
|
|
|
11
11
|
const MAX_ARTIFACT_BYTES = 64 * 1024;
|
|
12
12
|
|
|
13
13
|
export function validateArtifactPath(path: unknown): asserts path is string {
|
|
14
|
-
if (
|
|
15
|
-
typeof path !== "string" ||
|
|
16
|
-
!path.trim() ||
|
|
17
|
-
path.includes("\\") ||
|
|
18
|
-
isAbsolute(path) ||
|
|
19
|
-
path.split("/").some((part) => part === ".." || part === ".git") ||
|
|
20
|
-
dirname(path).includes("*") ||
|
|
21
|
-
!/^[^*]*\*?[^*]*$/.test(basename(path))
|
|
22
|
-
)
|
|
14
|
+
if (typeof path !== "string" || !validArtifactPath(path))
|
|
23
15
|
throw new Error(
|
|
24
16
|
"semantic artifact path must be relative with at most one basename *",
|
|
25
17
|
);
|
|
26
18
|
}
|
|
19
|
+
|
|
20
|
+
function validArtifactPath(path: string): boolean {
|
|
21
|
+
return (
|
|
22
|
+
safeRelativePath(path) &&
|
|
23
|
+
!dirname(path).includes("*") &&
|
|
24
|
+
/^[^*]*\*?[^*]*$/.test(basename(path))
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function safeRelativePath(path: string): boolean {
|
|
29
|
+
return (
|
|
30
|
+
Boolean(path.trim()) &&
|
|
31
|
+
!path.includes("\\") &&
|
|
32
|
+
!isAbsolute(path) &&
|
|
33
|
+
!path.split("/").some((part) => part === ".." || part === ".git")
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
function within(root: string, path: string): boolean {
|
|
28
38
|
return path === root || path.startsWith(root + sep);
|
|
29
39
|
}
|
|
30
40
|
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
async function artifactDirectory(
|
|
42
|
+
root: string,
|
|
33
43
|
pattern: string,
|
|
34
|
-
): Promise<
|
|
35
|
-
validateArtifactPath(pattern);
|
|
36
|
-
const root = await realpath(repoDir);
|
|
44
|
+
): Promise<string> {
|
|
37
45
|
const dir = resolve(root, dirname(pattern));
|
|
38
46
|
if (!within(root, dir))
|
|
39
47
|
throw new Error("semantic artifact directory escapes the fixture");
|
|
@@ -42,18 +50,30 @@ export async function readSemanticArtifact(
|
|
|
42
50
|
throw new Error("semantic artifact directory escapes the fixture");
|
|
43
51
|
if (relative(root, directory).split(sep).includes(".git"))
|
|
44
52
|
throw new Error("semantic artifact directory resolves to Git metadata");
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
+
return directory;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function artifactMatches(
|
|
57
|
+
directory: string,
|
|
58
|
+
name: string,
|
|
59
|
+
): Promise<string[]> {
|
|
60
|
+
if (!name.includes("*")) return [name];
|
|
61
|
+
const [prefix = "", suffix = ""] = name.split("*");
|
|
62
|
+
return (await readdir(directory)).filter(
|
|
63
|
+
(entry) => entry.startsWith(prefix) && entry.endsWith(suffix),
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function selectedArtifact(directory: string, matches: string[]): string {
|
|
68
|
+
const [name] = matches;
|
|
69
|
+
if (matches.length !== 1 || name === undefined)
|
|
53
70
|
throw new Error(
|
|
54
71
|
`semantic artifact pattern matched ${matches.length} files`,
|
|
55
72
|
);
|
|
56
|
-
|
|
73
|
+
return join(directory, name);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function resolveArtifact(root: string, path: string): Promise<string> {
|
|
57
77
|
const stat = await lstat(path);
|
|
58
78
|
if (!stat.isFile() || stat.size > MAX_ARTIFACT_BYTES)
|
|
59
79
|
throw new Error(
|
|
@@ -64,6 +84,19 @@ export async function readSemanticArtifact(
|
|
|
64
84
|
throw new Error("semantic artifact escapes the fixture");
|
|
65
85
|
if (relative(root, resolved).split(sep).includes(".git"))
|
|
66
86
|
throw new Error("semantic artifact resolves to Git metadata");
|
|
87
|
+
return resolved;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export async function readSemanticArtifact(
|
|
91
|
+
repoDir: string,
|
|
92
|
+
pattern: string,
|
|
93
|
+
): Promise<{ path: string; content: string }> {
|
|
94
|
+
validateArtifactPath(pattern);
|
|
95
|
+
const root = await realpath(repoDir);
|
|
96
|
+
const directory = await artifactDirectory(root, pattern);
|
|
97
|
+
const matches = await artifactMatches(directory, basename(pattern));
|
|
98
|
+
const path = selectedArtifact(directory, matches);
|
|
99
|
+
const resolved = await resolveArtifact(root, path);
|
|
67
100
|
return {
|
|
68
101
|
path: relative(root, resolved),
|
|
69
102
|
content: await readFile(resolved, "utf8"),
|
package/src/graders/git-head.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { isRecord } from "../value-guards";
|
|
1
2
|
import { lstat } from "node:fs/promises";
|
|
2
3
|
import { join } from "node:path";
|
|
4
|
+
import {
|
|
5
|
+
captureBoundedText,
|
|
6
|
+
ProcessDeadline,
|
|
7
|
+
terminateOwnedProcessGroup,
|
|
8
|
+
} from "../process-lifecycle";
|
|
3
9
|
|
|
4
10
|
const MAX_OUTPUT_BYTES = 128;
|
|
5
11
|
const TIMEOUT_MS = 10_000;
|
|
@@ -20,53 +26,87 @@ export function prepareGitHeadChecks(
|
|
|
20
26
|
declarations: GitHeadCheckDeclaration[],
|
|
21
27
|
): PreparedGitHeadCheck[] {
|
|
22
28
|
return declarations.map(({ id, configuration }) => {
|
|
23
|
-
if (
|
|
24
|
-
!id ||
|
|
25
|
-
!configuration ||
|
|
26
|
-
typeof configuration !== "object" ||
|
|
27
|
-
Object.keys(configuration).some((key) => key !== "kind") ||
|
|
28
|
-
(configuration.kind !== "changed" &&
|
|
29
|
-
configuration.kind !== "unchanged" &&
|
|
30
|
-
configuration.kind !== "base-ancestor")
|
|
31
|
-
)
|
|
29
|
+
if (!id || !validGitHeadConfiguration(configuration))
|
|
32
30
|
throw new Error("invalid Git HEAD check declaration");
|
|
33
31
|
return { id, kind: configuration.kind };
|
|
34
32
|
});
|
|
35
33
|
}
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
):
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Buffer.concat(chunks),
|
|
35
|
+
function validGitHeadKind(
|
|
36
|
+
value: unknown,
|
|
37
|
+
): value is PreparedGitHeadCheck["kind"] {
|
|
38
|
+
return (
|
|
39
|
+
value === "changed" || value === "unchanged" || value === "base-ancestor"
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function validGitHeadConfiguration(
|
|
44
|
+
value: unknown,
|
|
45
|
+
): value is { kind: PreparedGitHeadCheck["kind"] } {
|
|
46
|
+
return (
|
|
47
|
+
isRecord(value) &&
|
|
48
|
+
!Object.keys(value).some((key) => key !== "kind") &&
|
|
49
|
+
validGitHeadKind(value.kind)
|
|
53
50
|
);
|
|
54
51
|
}
|
|
55
52
|
|
|
56
|
-
function
|
|
57
|
-
|
|
53
|
+
function gitEnvironment() {
|
|
54
|
+
return {
|
|
55
|
+
PATH: process.env.PATH ?? "/usr/bin:/bin",
|
|
56
|
+
...(process.env.SystemRoot ? { SystemRoot: process.env.SystemRoot } : {}),
|
|
57
|
+
GIT_CONFIG_NOSYSTEM: "1",
|
|
58
|
+
GIT_CONFIG_GLOBAL: process.platform === "win32" ? "NUL" : "/dev/null",
|
|
59
|
+
GIT_NO_REPLACE_OBJECTS: "1",
|
|
60
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function validateGitMetadata(workspace: string): Promise<void> {
|
|
65
|
+
const directory = await lstat(join(workspace, ".git"));
|
|
66
|
+
if (!directory.isDirectory() || directory.isSymbolicLink())
|
|
67
|
+
throw new Error("Git fixture metadata is not a directory");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
class GitHeadExecution {
|
|
71
|
+
private readonly deadline: ProcessDeadline;
|
|
72
|
+
constructor(
|
|
73
|
+
private readonly proc: Bun.Subprocess<"ignore", "pipe", "ignore">,
|
|
74
|
+
signal: AbortSignal | undefined,
|
|
75
|
+
) {
|
|
76
|
+
this.deadline = new ProcessDeadline({
|
|
77
|
+
timeoutMs: TIMEOUT_MS,
|
|
78
|
+
signal,
|
|
79
|
+
interruption: (reason) =>
|
|
80
|
+
new Error(
|
|
81
|
+
reason === "timeout"
|
|
82
|
+
? "Git HEAD check timed out"
|
|
83
|
+
: "Git HEAD check cancelled",
|
|
84
|
+
),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private complete() {
|
|
89
|
+
return Promise.all([
|
|
90
|
+
captureBoundedText(this.proc.stdout, {
|
|
91
|
+
limit: MAX_OUTPUT_BYTES,
|
|
92
|
+
overflow: "reject",
|
|
93
|
+
exceeded: () => new Error("Git HEAD output is oversized"),
|
|
94
|
+
}),
|
|
95
|
+
this.proc.exited,
|
|
96
|
+
]).then(([output, code]) => ({ output: output.trim(), code }));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async run(): Promise<{ output: string; code: number }> {
|
|
58
100
|
try {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
101
|
+
return await this.deadline.wait(this.complete());
|
|
102
|
+
} catch (error) {
|
|
103
|
+
terminateOwnedProcessGroup(this.proc);
|
|
104
|
+
await this.proc.exited;
|
|
105
|
+
throw error;
|
|
106
|
+
} finally {
|
|
107
|
+
this.deadline.dispose();
|
|
63
108
|
}
|
|
64
109
|
}
|
|
65
|
-
try {
|
|
66
|
-
proc.kill("SIGKILL");
|
|
67
|
-
} catch {
|
|
68
|
-
// The process already exited.
|
|
69
|
-
}
|
|
70
110
|
}
|
|
71
111
|
|
|
72
112
|
async function git(
|
|
@@ -75,52 +115,16 @@ async function git(
|
|
|
75
115
|
signal?: AbortSignal,
|
|
76
116
|
): Promise<{ code: number; output: string }> {
|
|
77
117
|
if (signal?.aborted) throw new Error("Git HEAD check cancelled");
|
|
78
|
-
|
|
79
|
-
if (!gitDirectory.isDirectory() || gitDirectory.isSymbolicLink())
|
|
80
|
-
throw new Error("Git fixture metadata is not a directory");
|
|
118
|
+
await validateGitMetadata(workspace);
|
|
81
119
|
const proc = Bun.spawn(["git", ...args], {
|
|
82
120
|
cwd: workspace,
|
|
83
121
|
stdin: "ignore",
|
|
84
122
|
stdout: "pipe",
|
|
85
123
|
stderr: "ignore",
|
|
86
124
|
detached: process.platform !== "win32",
|
|
87
|
-
env:
|
|
88
|
-
PATH: process.env.PATH ?? "/usr/bin:/bin",
|
|
89
|
-
...(process.env.SystemRoot ? { SystemRoot: process.env.SystemRoot } : {}),
|
|
90
|
-
GIT_CONFIG_NOSYSTEM: "1",
|
|
91
|
-
GIT_CONFIG_GLOBAL: process.platform === "win32" ? "NUL" : "/dev/null",
|
|
92
|
-
GIT_NO_REPLACE_OBJECTS: "1",
|
|
93
|
-
GIT_TERMINAL_PROMPT: "0",
|
|
94
|
-
},
|
|
125
|
+
env: gitEnvironment(),
|
|
95
126
|
});
|
|
96
|
-
|
|
97
|
-
let cancel: (() => void) | undefined;
|
|
98
|
-
try {
|
|
99
|
-
const complete = Promise.all([
|
|
100
|
-
boundedOutput(proc.stdout),
|
|
101
|
-
proc.exited,
|
|
102
|
-
]).then(([output, code]) => ({ output: output.trim(), code }));
|
|
103
|
-
const timeout = new Promise<never>((_resolve, reject) => {
|
|
104
|
-
timer = setTimeout(
|
|
105
|
-
() => reject(new Error("Git HEAD check timed out")),
|
|
106
|
-
TIMEOUT_MS,
|
|
107
|
-
);
|
|
108
|
-
});
|
|
109
|
-
const aborted = new Promise<never>((_resolve, reject) => {
|
|
110
|
-
if (!signal) return;
|
|
111
|
-
cancel = () => reject(new Error("Git HEAD check cancelled"));
|
|
112
|
-
signal.addEventListener("abort", cancel, { once: true });
|
|
113
|
-
if (signal.aborted) cancel();
|
|
114
|
-
});
|
|
115
|
-
return await Promise.race([complete, timeout, aborted]);
|
|
116
|
-
} catch (error) {
|
|
117
|
-
stopProcess(proc);
|
|
118
|
-
await proc.exited;
|
|
119
|
-
throw error;
|
|
120
|
-
} finally {
|
|
121
|
-
if (timer) clearTimeout(timer);
|
|
122
|
-
if (cancel) signal?.removeEventListener("abort", cancel);
|
|
123
|
-
}
|
|
127
|
+
return new GitHeadExecution(proc, signal).run();
|
|
124
128
|
}
|
|
125
129
|
|
|
126
130
|
export async function gitHeadRevision(
|