@gpustack/loopwright 0.0.0-stage → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +191 -0
- package/README.md +356 -2
- package/bin/loopwright.js +3 -0
- package/node_modules/@loopwright/agent-pi/dist/adapter-v2.d.ts +9 -0
- package/node_modules/@loopwright/agent-pi/dist/adapter-v2.js +122 -0
- package/node_modules/@loopwright/agent-pi/dist/adapter.d.ts +30 -0
- package/node_modules/@loopwright/agent-pi/dist/adapter.js +340 -0
- package/node_modules/@loopwright/agent-pi/dist/admission.d.ts +25 -0
- package/node_modules/@loopwright/agent-pi/dist/admission.js +65 -0
- package/node_modules/@loopwright/agent-pi/dist/artifacts.d.ts +15 -0
- package/node_modules/@loopwright/agent-pi/dist/artifacts.js +76 -0
- package/node_modules/@loopwright/agent-pi/dist/boundary.d.ts +18 -0
- package/node_modules/@loopwright/agent-pi/dist/boundary.js +113 -0
- package/node_modules/@loopwright/agent-pi/dist/broker-channel.d.ts +4 -0
- package/node_modules/@loopwright/agent-pi/dist/broker-channel.js +121 -0
- package/node_modules/@loopwright/agent-pi/dist/candidate.d.ts +96 -0
- package/node_modules/@loopwright/agent-pi/dist/candidate.js +1712 -0
- package/node_modules/@loopwright/agent-pi/dist/capture.d.ts +39 -0
- package/node_modules/@loopwright/agent-pi/dist/capture.js +146 -0
- package/node_modules/@loopwright/agent-pi/dist/cas.d.ts +51 -0
- package/node_modules/@loopwright/agent-pi/dist/cas.js +836 -0
- package/node_modules/@loopwright/agent-pi/dist/catalog-api.d.ts +3 -0
- package/node_modules/@loopwright/agent-pi/dist/catalog-api.js +2 -0
- package/node_modules/@loopwright/agent-pi/dist/catalog.d.ts +39 -0
- package/node_modules/@loopwright/agent-pi/dist/catalog.js +280 -0
- package/node_modules/@loopwright/agent-pi/dist/circuit-breaker-limits.d.ts +9 -0
- package/node_modules/@loopwright/agent-pi/dist/circuit-breaker-limits.js +12 -0
- package/node_modules/@loopwright/agent-pi/dist/containers.d.ts +29 -0
- package/node_modules/@loopwright/agent-pi/dist/containers.js +160 -0
- package/node_modules/@loopwright/agent-pi/dist/context.d.ts +56 -0
- package/node_modules/@loopwright/agent-pi/dist/context.js +351 -0
- package/node_modules/@loopwright/agent-pi/dist/daemon.d.ts +8 -0
- package/node_modules/@loopwright/agent-pi/dist/daemon.js +52 -0
- package/node_modules/@loopwright/agent-pi/dist/deadline.d.ts +6 -0
- package/node_modules/@loopwright/agent-pi/dist/deadline.js +18 -0
- package/node_modules/@loopwright/agent-pi/dist/decode-capture.d.ts +39 -0
- package/node_modules/@loopwright/agent-pi/dist/decode-capture.js +287 -0
- package/node_modules/@loopwright/agent-pi/dist/descriptor.d.ts +12 -0
- package/node_modules/@loopwright/agent-pi/dist/descriptor.js +17 -0
- package/node_modules/@loopwright/agent-pi/dist/docker-absence.d.ts +2 -0
- package/node_modules/@loopwright/agent-pi/dist/docker-absence.js +9 -0
- package/node_modules/@loopwright/agent-pi/dist/errors.d.ts +7 -0
- package/node_modules/@loopwright/agent-pi/dist/errors.js +19 -0
- package/node_modules/@loopwright/agent-pi/dist/event-sequence.d.ts +6 -0
- package/node_modules/@loopwright/agent-pi/dist/event-sequence.js +64 -0
- package/node_modules/@loopwright/agent-pi/dist/events.d.ts +19 -0
- package/node_modules/@loopwright/agent-pi/dist/events.js +132 -0
- package/node_modules/@loopwright/agent-pi/dist/execution-guard.d.ts +9 -0
- package/node_modules/@loopwright/agent-pi/dist/execution-guard.js +25 -0
- package/node_modules/@loopwright/agent-pi/dist/execution-lease.d.ts +24 -0
- package/node_modules/@loopwright/agent-pi/dist/execution-lease.js +316 -0
- package/node_modules/@loopwright/agent-pi/dist/execution.d.ts +32 -0
- package/node_modules/@loopwright/agent-pi/dist/execution.js +476 -0
- package/node_modules/@loopwright/agent-pi/dist/external-mcp.d.ts +87 -0
- package/node_modules/@loopwright/agent-pi/dist/external-mcp.js +526 -0
- package/node_modules/@loopwright/agent-pi/dist/factory-bootstrap.d.ts +15 -0
- package/node_modules/@loopwright/agent-pi/dist/factory-bootstrap.js +74 -0
- package/node_modules/@loopwright/agent-pi/dist/host-session.d.ts +51 -0
- package/node_modules/@loopwright/agent-pi/dist/host-session.js +2083 -0
- package/node_modules/@loopwright/agent-pi/dist/http-mcp.d.ts +32 -0
- package/node_modules/@loopwright/agent-pi/dist/http-mcp.js +353 -0
- package/node_modules/@loopwright/agent-pi/dist/index.d.ts +7 -0
- package/node_modules/@loopwright/agent-pi/dist/index.js +4 -0
- package/node_modules/@loopwright/agent-pi/dist/lifecycle.d.ts +13 -0
- package/node_modules/@loopwright/agent-pi/dist/lifecycle.js +11 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp-process.d.ts +35 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp-process.js +92 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp-transport.d.ts +25 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp-transport.js +63 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp.d.ts +23 -0
- package/node_modules/@loopwright/agent-pi/dist/mcp.js +212 -0
- package/node_modules/@loopwright/agent-pi/dist/operation.d.ts +5 -0
- package/node_modules/@loopwright/agent-pi/dist/operation.js +28 -0
- package/node_modules/@loopwright/agent-pi/dist/policy-v2.d.ts +10 -0
- package/node_modules/@loopwright/agent-pi/dist/policy-v2.js +64 -0
- package/node_modules/@loopwright/agent-pi/dist/policy.d.ts +13 -0
- package/node_modules/@loopwright/agent-pi/dist/policy.js +260 -0
- package/node_modules/@loopwright/agent-pi/dist/preflight.d.ts +60 -0
- package/node_modules/@loopwright/agent-pi/dist/preflight.js +700 -0
- package/node_modules/@loopwright/agent-pi/dist/progress-summary.d.ts +1 -0
- package/node_modules/@loopwright/agent-pi/dist/progress-summary.js +119 -0
- package/node_modules/@loopwright/agent-pi/dist/protocol.d.ts +17 -0
- package/node_modules/@loopwright/agent-pi/dist/protocol.js +131 -0
- package/node_modules/@loopwright/agent-pi/dist/provider.d.ts +62 -0
- package/node_modules/@loopwright/agent-pi/dist/provider.js +217 -0
- package/node_modules/@loopwright/agent-pi/dist/receipt.d.ts +3 -0
- package/node_modules/@loopwright/agent-pi/dist/receipt.js +64 -0
- package/node_modules/@loopwright/agent-pi/dist/recovery.d.ts +6 -0
- package/node_modules/@loopwright/agent-pi/dist/recovery.js +188 -0
- package/node_modules/@loopwright/agent-pi/dist/resources.d.ts +13 -0
- package/node_modules/@loopwright/agent-pi/dist/resources.js +81 -0
- package/node_modules/@loopwright/agent-pi/dist/response.d.ts +20 -0
- package/node_modules/@loopwright/agent-pi/dist/response.js +259 -0
- package/node_modules/@loopwright/agent-pi/dist/runtime-profile.d.ts +6 -0
- package/node_modules/@loopwright/agent-pi/dist/runtime-profile.js +37 -0
- package/node_modules/@loopwright/agent-pi/dist/sdk-worker.d.ts +14 -0
- package/node_modules/@loopwright/agent-pi/dist/sdk-worker.js +633 -0
- package/node_modules/@loopwright/agent-pi/dist/sender.d.ts +46 -0
- package/node_modules/@loopwright/agent-pi/dist/sender.js +553 -0
- package/node_modules/@loopwright/agent-pi/dist/session-host.d.ts +21 -0
- package/node_modules/@loopwright/agent-pi/dist/session-host.js +315 -0
- package/node_modules/@loopwright/agent-pi/dist/snapshot-transfer.d.ts +14 -0
- package/node_modules/@loopwright/agent-pi/dist/snapshot-transfer.js +102 -0
- package/node_modules/@loopwright/agent-pi/dist/snapshot.d.ts +19 -0
- package/node_modules/@loopwright/agent-pi/dist/snapshot.js +121 -0
- package/node_modules/@loopwright/agent-pi/dist/tool-process.d.ts +32 -0
- package/node_modules/@loopwright/agent-pi/dist/tool-process.js +85 -0
- package/node_modules/@loopwright/agent-pi/dist/tool-worker.d.ts +2 -0
- package/node_modules/@loopwright/agent-pi/dist/tool-worker.js +105 -0
- package/node_modules/@loopwright/agent-pi/dist/tools.d.ts +36 -0
- package/node_modules/@loopwright/agent-pi/dist/tools.js +128 -0
- package/node_modules/@loopwright/agent-pi/dist/types-v2.d.ts +71 -0
- package/node_modules/@loopwright/agent-pi/dist/types-v2.js +1 -0
- package/node_modules/@loopwright/agent-pi/dist/types.d.ts +314 -0
- package/node_modules/@loopwright/agent-pi/dist/types.js +1 -0
- package/node_modules/@loopwright/agent-pi/dist/usage.d.ts +18 -0
- package/node_modules/@loopwright/agent-pi/dist/usage.js +314 -0
- package/node_modules/@loopwright/agent-pi/dist/workspace-mcp.d.ts +27 -0
- package/node_modules/@loopwright/agent-pi/dist/workspace-mcp.js +142 -0
- package/node_modules/@loopwright/agent-pi/package.json +24 -0
- package/node_modules/@loopwright/agent-pi/runtime/Dockerfile +8 -0
- package/node_modules/@loopwright/agent-pi/runtime/seccomp.json +1 -0
- package/node_modules/@loopwright/cli/dist/arguments.d.ts +19 -0
- package/node_modules/@loopwright/cli/dist/arguments.js +358 -0
- package/node_modules/@loopwright/cli/dist/closure.d.ts +93 -0
- package/node_modules/@loopwright/cli/dist/closure.js +230 -0
- package/node_modules/@loopwright/cli/dist/draft.d.ts +9 -0
- package/node_modules/@loopwright/cli/dist/draft.js +106 -0
- package/node_modules/@loopwright/cli/dist/failure-matrix.d.ts +9 -0
- package/node_modules/@loopwright/cli/dist/failure-matrix.js +701 -0
- package/node_modules/@loopwright/cli/dist/index.d.ts +6 -0
- package/node_modules/@loopwright/cli/dist/index.js +5 -0
- package/node_modules/@loopwright/cli/dist/main.d.ts +22 -0
- package/node_modules/@loopwright/cli/dist/main.js +1855 -0
- package/node_modules/@loopwright/cli/package.json +16 -0
- package/node_modules/@loopwright/controller/dist/acceptance.d.ts +43 -0
- package/node_modules/@loopwright/controller/dist/acceptance.js +446 -0
- package/node_modules/@loopwright/controller/dist/benchmark-gate.d.ts +273 -0
- package/node_modules/@loopwright/controller/dist/benchmark-gate.js +3147 -0
- package/node_modules/@loopwright/controller/dist/budget-observations.d.ts +25 -0
- package/node_modules/@loopwright/controller/dist/budget-observations.js +139 -0
- package/node_modules/@loopwright/controller/dist/bundle.d.ts +26 -0
- package/node_modules/@loopwright/controller/dist/bundle.js +64 -0
- package/node_modules/@loopwright/controller/dist/capture.d.ts +89 -0
- package/node_modules/@loopwright/controller/dist/capture.js +587 -0
- package/node_modules/@loopwright/controller/dist/compile.d.ts +3 -0
- package/node_modules/@loopwright/controller/dist/compile.js +402 -0
- package/node_modules/@loopwright/controller/dist/config.d.ts +22 -0
- package/node_modules/@loopwright/controller/dist/config.js +255 -0
- package/node_modules/@loopwright/controller/dist/controller.d.ts +177 -0
- package/node_modules/@loopwright/controller/dist/controller.js +2135 -0
- package/node_modules/@loopwright/controller/dist/credentials.d.ts +29 -0
- package/node_modules/@loopwright/controller/dist/credentials.js +189 -0
- package/node_modules/@loopwright/controller/dist/deadlines.d.ts +18 -0
- package/node_modules/@loopwright/controller/dist/deadlines.js +71 -0
- package/node_modules/@loopwright/controller/dist/errors.d.ts +27 -0
- package/node_modules/@loopwright/controller/dist/errors.js +41 -0
- package/node_modules/@loopwright/controller/dist/events.d.ts +52 -0
- package/node_modules/@loopwright/controller/dist/events.js +228 -0
- package/node_modules/@loopwright/controller/dist/files.d.ts +51 -0
- package/node_modules/@loopwright/controller/dist/files.js +386 -0
- package/node_modules/@loopwright/controller/dist/finalize.d.ts +25 -0
- package/node_modules/@loopwright/controller/dist/finalize.js +32 -0
- package/node_modules/@loopwright/controller/dist/gate.d.ts +84 -0
- package/node_modules/@loopwright/controller/dist/gate.js +640 -0
- package/node_modules/@loopwright/controller/dist/git-objects.d.ts +11 -0
- package/node_modules/@loopwright/controller/dist/git-objects.js +59 -0
- package/node_modules/@loopwright/controller/dist/git-reader.d.ts +17 -0
- package/node_modules/@loopwright/controller/dist/git-reader.js +40 -0
- package/node_modules/@loopwright/controller/dist/handlers.d.ts +6 -0
- package/node_modules/@loopwright/controller/dist/handlers.js +45 -0
- package/node_modules/@loopwright/controller/dist/handoff.d.ts +71 -0
- package/node_modules/@loopwright/controller/dist/handoff.js +554 -0
- package/node_modules/@loopwright/controller/dist/index.d.ts +41 -0
- package/node_modules/@loopwright/controller/dist/index.js +21 -0
- package/node_modules/@loopwright/controller/dist/inspect.d.ts +30 -0
- package/node_modules/@loopwright/controller/dist/inspect.js +372 -0
- package/node_modules/@loopwright/controller/dist/interpolation.d.ts +9 -0
- package/node_modules/@loopwright/controller/dist/interpolation.js +79 -0
- package/node_modules/@loopwright/controller/dist/ownership.d.ts +41 -0
- package/node_modules/@loopwright/controller/dist/ownership.js +666 -0
- package/node_modules/@loopwright/controller/dist/parser.d.ts +5 -0
- package/node_modules/@loopwright/controller/dist/parser.js +200 -0
- package/node_modules/@loopwright/controller/dist/progress.d.ts +41 -0
- package/node_modules/@loopwright/controller/dist/progress.js +904 -0
- package/node_modules/@loopwright/controller/dist/publication.d.ts +60 -0
- package/node_modules/@loopwright/controller/dist/publication.js +329 -0
- package/node_modules/@loopwright/controller/dist/reconcile.d.ts +26 -0
- package/node_modules/@loopwright/controller/dist/reconcile.js +1378 -0
- package/node_modules/@loopwright/controller/dist/recovery.d.ts +10 -0
- package/node_modules/@loopwright/controller/dist/recovery.js +315 -0
- package/node_modules/@loopwright/controller/dist/refusal-record.d.ts +43 -0
- package/node_modules/@loopwright/controller/dist/refusal-record.js +150 -0
- package/node_modules/@loopwright/controller/dist/registry.d.ts +6 -0
- package/node_modules/@loopwright/controller/dist/registry.js +374 -0
- package/node_modules/@loopwright/controller/dist/repair.d.ts +31 -0
- package/node_modules/@loopwright/controller/dist/repair.js +102 -0
- package/node_modules/@loopwright/controller/dist/report.d.ts +64 -0
- package/node_modules/@loopwright/controller/dist/report.js +596 -0
- package/node_modules/@loopwright/controller/dist/retained.d.ts +284 -0
- package/node_modules/@loopwright/controller/dist/retained.js +193 -0
- package/node_modules/@loopwright/controller/dist/rules.d.ts +31 -0
- package/node_modules/@loopwright/controller/dist/rules.js +110 -0
- package/node_modules/@loopwright/controller/dist/run-eval.d.ts +115 -0
- package/node_modules/@loopwright/controller/dist/run-eval.js +959 -0
- package/node_modules/@loopwright/controller/dist/scheduler.d.ts +10 -0
- package/node_modules/@loopwright/controller/dist/scheduler.js +41 -0
- package/node_modules/@loopwright/controller/dist/schema.d.ts +17 -0
- package/node_modules/@loopwright/controller/dist/schema.js +78 -0
- package/node_modules/@loopwright/controller/dist/source.d.ts +69 -0
- package/node_modules/@loopwright/controller/dist/source.js +872 -0
- package/node_modules/@loopwright/controller/dist/step.d.ts +38 -0
- package/node_modules/@loopwright/controller/dist/step.js +1776 -0
- package/node_modules/@loopwright/controller/dist/storage.d.ts +90 -0
- package/node_modules/@loopwright/controller/dist/storage.js +1345 -0
- package/node_modules/@loopwright/controller/dist/submission.d.ts +51 -0
- package/node_modules/@loopwright/controller/dist/submission.js +292 -0
- package/node_modules/@loopwright/controller/dist/types.d.ts +585 -0
- package/node_modules/@loopwright/controller/dist/types.js +9 -0
- package/node_modules/@loopwright/controller/dist/verification.d.ts +124 -0
- package/node_modules/@loopwright/controller/dist/verification.js +1308 -0
- package/node_modules/@loopwright/controller/dist/verifier-protocol.d.ts +105 -0
- package/node_modules/@loopwright/controller/dist/verifier-protocol.js +1312 -0
- package/node_modules/@loopwright/controller/dist/verifier-worker.d.ts +1 -0
- package/node_modules/@loopwright/controller/dist/verifier-worker.js +33 -0
- package/node_modules/@loopwright/controller/package.json +12 -0
- package/node_modules/@loopwright/core/dist/acceptance.d.ts +108 -0
- package/node_modules/@loopwright/core/dist/acceptance.js +327 -0
- package/node_modules/@loopwright/core/dist/artifacts.d.ts +63 -0
- package/node_modules/@loopwright/core/dist/artifacts.js +356 -0
- package/node_modules/@loopwright/core/dist/boundary.d.ts +21 -0
- package/node_modules/@loopwright/core/dist/boundary.js +484 -0
- package/node_modules/@loopwright/core/dist/contracts.d.ts +287 -0
- package/node_modules/@loopwright/core/dist/contracts.js +694 -0
- package/node_modules/@loopwright/core/dist/diagnostics.d.ts +21 -0
- package/node_modules/@loopwright/core/dist/diagnostics.js +51 -0
- package/node_modules/@loopwright/core/dist/evidence.d.ts +92 -0
- package/node_modules/@loopwright/core/dist/evidence.js +85 -0
- package/node_modules/@loopwright/core/dist/graph.d.ts +8 -0
- package/node_modules/@loopwright/core/dist/graph.js +44 -0
- package/node_modules/@loopwright/core/dist/identity.d.ts +162 -0
- package/node_modules/@loopwright/core/dist/identity.js +80 -0
- package/node_modules/@loopwright/core/dist/index.d.ts +30 -0
- package/node_modules/@loopwright/core/dist/index.js +39 -0
- package/node_modules/@loopwright/core/dist/limits.d.ts +99 -0
- package/node_modules/@loopwright/core/dist/limits.js +59 -0
- package/node_modules/@loopwright/core/dist/results.d.ts +161 -0
- package/node_modules/@loopwright/core/dist/results.js +98 -0
- package/node_modules/@loopwright/core/dist/scope.d.ts +13 -0
- package/node_modules/@loopwright/core/dist/scope.js +154 -0
- package/node_modules/@loopwright/core/dist/scrubber.d.ts +13 -0
- package/node_modules/@loopwright/core/dist/scrubber.js +63 -0
- package/node_modules/@loopwright/core/dist/usage.d.ts +68 -0
- package/node_modules/@loopwright/core/dist/usage.js +56 -0
- package/node_modules/@loopwright/core/package.json +12 -0
- package/node_modules/@loopwright/decisions/dist/benchmark.d.ts +23 -0
- package/node_modules/@loopwright/decisions/dist/benchmark.js +337 -0
- package/node_modules/@loopwright/decisions/dist/client.d.ts +74 -0
- package/node_modules/@loopwright/decisions/dist/client.js +292 -0
- package/node_modules/@loopwright/decisions/dist/index.d.ts +15 -0
- package/node_modules/@loopwright/decisions/dist/index.js +8 -0
- package/node_modules/@loopwright/decisions/dist/nodes.d.ts +63 -0
- package/node_modules/@loopwright/decisions/dist/nodes.js +282 -0
- package/node_modules/@loopwright/decisions/dist/primitives.d.ts +36 -0
- package/node_modules/@loopwright/decisions/dist/primitives.js +300 -0
- package/node_modules/@loopwright/decisions/dist/redaction.d.ts +23 -0
- package/node_modules/@loopwright/decisions/dist/redaction.js +146 -0
- package/node_modules/@loopwright/decisions/dist/router.d.ts +55 -0
- package/node_modules/@loopwright/decisions/dist/router.js +248 -0
- package/node_modules/@loopwright/decisions/dist/schema.d.ts +25 -0
- package/node_modules/@loopwright/decisions/dist/schema.js +536 -0
- package/node_modules/@loopwright/decisions/dist/types.d.ts +394 -0
- package/node_modules/@loopwright/decisions/dist/types.js +80 -0
- package/node_modules/@loopwright/decisions/package.json +12 -0
- package/node_modules/@loopwright/github-app/dist/action.d.ts +90 -0
- package/node_modules/@loopwright/github-app/dist/action.js +2429 -0
- package/node_modules/@loopwright/github-app/dist/config.d.ts +23 -0
- package/node_modules/@loopwright/github-app/dist/config.js +297 -0
- package/node_modules/@loopwright/github-app/dist/digests.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/digests.js +1 -0
- package/node_modules/@loopwright/github-app/dist/index.d.ts +14 -0
- package/node_modules/@loopwright/github-app/dist/index.js +13 -0
- package/node_modules/@loopwright/github-app/dist/models-config.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/models-config.js +1 -0
- package/node_modules/@loopwright/github-app/dist/output-format.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/output-format.js +1 -0
- package/node_modules/@loopwright/github-app/dist/preflight.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/preflight.js +1 -0
- package/node_modules/@loopwright/github-app/dist/publisher.d.ts +58 -0
- package/node_modules/@loopwright/github-app/dist/publisher.js +1368 -0
- package/node_modules/@loopwright/github-app/dist/qualification.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/qualification.js +1 -0
- package/node_modules/@loopwright/github-app/dist/sandbox.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/sandbox.js +1 -0
- package/node_modules/@loopwright/github-app/dist/schema.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/schema.js +1 -0
- package/node_modules/@loopwright/github-app/dist/service.d.ts +52 -0
- package/node_modules/@loopwright/github-app/dist/service.js +1658 -0
- package/node_modules/@loopwright/github-app/dist/suite-pr-lookup.d.ts +90 -0
- package/node_modules/@loopwright/github-app/dist/suite-pr-lookup.js +392 -0
- package/node_modules/@loopwright/github-app/dist/taskpack.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/taskpack.js +1 -0
- package/node_modules/@loopwright/github-app/dist/tenant-queue.d.ts +44 -0
- package/node_modules/@loopwright/github-app/dist/tenant-queue.js +423 -0
- package/node_modules/@loopwright/github-app/dist/token-broker.d.ts +50 -0
- package/node_modules/@loopwright/github-app/dist/token-broker.js +262 -0
- package/node_modules/@loopwright/github-app/dist/turnkey-memory.d.ts +35 -0
- package/node_modules/@loopwright/github-app/dist/turnkey-memory.js +1654 -0
- package/node_modules/@loopwright/github-app/dist/turnkey.d.ts +16 -0
- package/node_modules/@loopwright/github-app/dist/turnkey.js +34 -0
- package/node_modules/@loopwright/github-app/dist/types.d.ts +220 -0
- package/node_modules/@loopwright/github-app/dist/types.js +14 -0
- package/node_modules/@loopwright/github-app/dist/upstreams.d.ts +13 -0
- package/node_modules/@loopwright/github-app/dist/upstreams.js +65 -0
- package/node_modules/@loopwright/github-app/dist/webhook.d.ts +34 -0
- package/node_modules/@loopwright/github-app/dist/webhook.js +241 -0
- package/node_modules/@loopwright/github-app/dist/yaml.d.ts +1 -0
- package/node_modules/@loopwright/github-app/dist/yaml.js +1 -0
- package/node_modules/@loopwright/github-app/package.json +12 -0
- package/node_modules/@loopwright/hardware-runner/dist/config.d.ts +48 -0
- package/node_modules/@loopwright/hardware-runner/dist/config.js +719 -0
- package/node_modules/@loopwright/hardware-runner/dist/evaluator.d.ts +230 -0
- package/node_modules/@loopwright/hardware-runner/dist/evaluator.js +3178 -0
- package/node_modules/@loopwright/hardware-runner/dist/index.d.ts +13 -0
- package/node_modules/@loopwright/hardware-runner/dist/index.js +9 -0
- package/node_modules/@loopwright/hardware-runner/dist/provenance.d.ts +128 -0
- package/node_modules/@loopwright/hardware-runner/dist/provenance.js +1500 -0
- package/node_modules/@loopwright/hardware-runner/dist/queue.d.ts +81 -0
- package/node_modules/@loopwright/hardware-runner/dist/queue.js +1081 -0
- package/node_modules/@loopwright/hardware-runner/dist/relay-server.d.ts +13 -0
- package/node_modules/@loopwright/hardware-runner/dist/relay-server.js +2997 -0
- package/node_modules/@loopwright/hardware-runner/dist/types.d.ts +239 -0
- package/node_modules/@loopwright/hardware-runner/dist/types.js +12 -0
- package/node_modules/@loopwright/hardware-runner/dist/worker.d.ts +49 -0
- package/node_modules/@loopwright/hardware-runner/dist/worker.js +1646 -0
- package/node_modules/@loopwright/hardware-runner/package.json +12 -0
- package/node_modules/@loopwright/memory/dist/cas.d.ts +21 -0
- package/node_modules/@loopwright/memory/dist/cas.js +510 -0
- package/node_modules/@loopwright/memory/dist/compaction.d.ts +18 -0
- package/node_modules/@loopwright/memory/dist/compaction.js +110 -0
- package/node_modules/@loopwright/memory/dist/finalizer.d.ts +23 -0
- package/node_modules/@loopwright/memory/dist/finalizer.js +538 -0
- package/node_modules/@loopwright/memory/dist/index.d.ts +9 -0
- package/node_modules/@loopwright/memory/dist/index.js +8 -0
- package/node_modules/@loopwright/memory/dist/schema.d.ts +36 -0
- package/node_modules/@loopwright/memory/dist/schema.js +510 -0
- package/node_modules/@loopwright/memory/dist/selector.d.ts +7 -0
- package/node_modules/@loopwright/memory/dist/selector.js +157 -0
- package/node_modules/@loopwright/memory/dist/store.d.ts +51 -0
- package/node_modules/@loopwright/memory/dist/store.js +554 -0
- package/node_modules/@loopwright/memory/dist/types.d.ts +442 -0
- package/node_modules/@loopwright/memory/dist/types.js +8 -0
- package/node_modules/@loopwright/memory/dist/verifier.d.ts +5 -0
- package/node_modules/@loopwright/memory/dist/verifier.js +328 -0
- package/node_modules/@loopwright/memory/package.json +12 -0
- package/node_modules/@loopwright/state/dist/admission.d.ts +321 -0
- package/node_modules/@loopwright/state/dist/admission.js +199 -0
- package/node_modules/@loopwright/state/dist/boundary.d.ts +53 -0
- package/node_modules/@loopwright/state/dist/boundary.js +194 -0
- package/node_modules/@loopwright/state/dist/checkpoint.d.ts +16 -0
- package/node_modules/@loopwright/state/dist/checkpoint.js +84 -0
- package/node_modules/@loopwright/state/dist/clock.d.ts +8 -0
- package/node_modules/@loopwright/state/dist/clock.js +27 -0
- package/node_modules/@loopwright/state/dist/connection.d.ts +55 -0
- package/node_modules/@loopwright/state/dist/connection.js +391 -0
- package/node_modules/@loopwright/state/dist/errors.d.ts +13 -0
- package/node_modules/@loopwright/state/dist/errors.js +34 -0
- package/node_modules/@loopwright/state/dist/index.d.ts +3 -0
- package/node_modules/@loopwright/state/dist/index.js +1 -0
- package/node_modules/@loopwright/state/dist/journal.d.ts +119 -0
- package/node_modules/@loopwright/state/dist/journal.js +72 -0
- package/node_modules/@loopwright/state/dist/model.d.ts +40 -0
- package/node_modules/@loopwright/state/dist/model.js +58 -0
- package/node_modules/@loopwright/state/dist/ownership.d.ts +14 -0
- package/node_modules/@loopwright/state/dist/ownership.js +45 -0
- package/node_modules/@loopwright/state/dist/pages.d.ts +11 -0
- package/node_modules/@loopwright/state/dist/pages.js +41 -0
- package/node_modules/@loopwright/state/dist/receipts.d.ts +33 -0
- package/node_modules/@loopwright/state/dist/receipts.js +97 -0
- package/node_modules/@loopwright/state/dist/schema.d.ts +28 -0
- package/node_modules/@loopwright/state/dist/schema.js +41 -0
- package/node_modules/@loopwright/state/dist/settlement.d.ts +10 -0
- package/node_modules/@loopwright/state/dist/settlement.js +129 -0
- package/node_modules/@loopwright/state/dist/store.d.ts +52 -0
- package/node_modules/@loopwright/state/dist/store.js +100 -0
- package/node_modules/@loopwright/state/dist/types.d.ts +315 -0
- package/node_modules/@loopwright/state/dist/types.js +1 -0
- package/node_modules/@loopwright/state/package.json +12 -0
- package/node_modules/@loopwright/taskpack/dist/baseline-align.d.ts +195 -0
- package/node_modules/@loopwright/taskpack/dist/baseline-align.js +1847 -0
- package/node_modules/@loopwright/taskpack/dist/digests.d.ts +61 -0
- package/node_modules/@loopwright/taskpack/dist/digests.js +715 -0
- package/node_modules/@loopwright/taskpack/dist/index.d.ts +18 -0
- package/node_modules/@loopwright/taskpack/dist/index.js +17 -0
- package/node_modules/@loopwright/taskpack/dist/models-config.d.ts +112 -0
- package/node_modules/@loopwright/taskpack/dist/models-config.js +1026 -0
- package/node_modules/@loopwright/taskpack/dist/output-format.d.ts +28 -0
- package/node_modules/@loopwright/taskpack/dist/output-format.js +157 -0
- package/node_modules/@loopwright/taskpack/dist/preflight.d.ts +130 -0
- package/node_modules/@loopwright/taskpack/dist/preflight.js +1497 -0
- package/node_modules/@loopwright/taskpack/dist/qualification.d.ts +23 -0
- package/node_modules/@loopwright/taskpack/dist/qualification.js +120 -0
- package/node_modules/@loopwright/taskpack/dist/sandbox.d.ts +121 -0
- package/node_modules/@loopwright/taskpack/dist/sandbox.js +2605 -0
- package/node_modules/@loopwright/taskpack/dist/schema.d.ts +197 -0
- package/node_modules/@loopwright/taskpack/dist/schema.js +4189 -0
- package/node_modules/@loopwright/taskpack/dist/scrubber.d.ts +47 -0
- package/node_modules/@loopwright/taskpack/dist/scrubber.js +283 -0
- package/node_modules/@loopwright/taskpack/dist/suite.d.ts +124 -0
- package/node_modules/@loopwright/taskpack/dist/suite.js +3256 -0
- package/node_modules/@loopwright/taskpack/dist/taskpack.d.ts +154 -0
- package/node_modules/@loopwright/taskpack/dist/taskpack.js +3634 -0
- package/node_modules/@loopwright/taskpack/dist/turnkey-memory.d.ts +122 -0
- package/node_modules/@loopwright/taskpack/dist/turnkey-memory.js +483 -0
- package/node_modules/@loopwright/taskpack/dist/turnkey.d.ts +437 -0
- package/node_modules/@loopwright/taskpack/dist/turnkey.js +7313 -0
- package/node_modules/@loopwright/taskpack/dist/types.d.ts +1274 -0
- package/node_modules/@loopwright/taskpack/dist/types.js +99 -0
- package/node_modules/@loopwright/taskpack/dist/upstreams.d.ts +261 -0
- package/node_modules/@loopwright/taskpack/dist/upstreams.js +2242 -0
- package/node_modules/@loopwright/taskpack/dist/yaml.d.ts +18 -0
- package/node_modules/@loopwright/taskpack/dist/yaml.js +167 -0
- package/node_modules/@loopwright/taskpack/package.json +12 -0
- package/node_modules/@loopwright/taskpack-runner/dist/compile-taskpack.d.ts +137 -0
- package/node_modules/@loopwright/taskpack-runner/dist/compile-taskpack.js +474 -0
- package/node_modules/@loopwright/taskpack-runner/dist/corpus.d.ts +8 -0
- package/node_modules/@loopwright/taskpack-runner/dist/corpus.js +129 -0
- package/node_modules/@loopwright/taskpack-runner/dist/index.d.ts +13 -0
- package/node_modules/@loopwright/taskpack-runner/dist/index.js +7 -0
- package/node_modules/@loopwright/taskpack-runner/dist/intake.d.ts +149 -0
- package/node_modules/@loopwright/taskpack-runner/dist/intake.js +135 -0
- package/node_modules/@loopwright/taskpack-runner/dist/parity.d.ts +130 -0
- package/node_modules/@loopwright/taskpack-runner/dist/parity.js +927 -0
- package/node_modules/@loopwright/taskpack-runner/dist/python-bridge.d.ts +68 -0
- package/node_modules/@loopwright/taskpack-runner/dist/python-bridge.js +517 -0
- package/node_modules/@loopwright/taskpack-runner/dist/service.d.ts +149 -0
- package/node_modules/@loopwright/taskpack-runner/dist/service.js +1796 -0
- package/node_modules/@loopwright/taskpack-runner/dist/types.d.ts +29 -0
- package/node_modules/@loopwright/taskpack-runner/dist/types.js +11 -0
- package/node_modules/@loopwright/taskpack-runner/package.json +12 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/README.md +77 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/docs/support-records.md +57 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/docs/supported-runners.md +98 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/manifest.json +205 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pack/expand_matrix.sh +273 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pack/matrix.yaml +280 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pack/resolve_dockerfile.sh +24 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pyproject.toml +46 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/runtime_runner/runner.py.json +5270 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/discovery/legacy-support.md +86 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/github/service.py +401 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/proposals/analysis.json +95 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/proposals/ready.json +109 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_assemble.py +263 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_check_draft.py +333 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_checks.py +1099 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_discovery.py +817 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_proposal.py +658 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_publish.py +987 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_summary.py +107 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/agent.py +610 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/assemble.py +84 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/check_draft.py +94 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/checks.py +1002 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/discovery.py +789 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/model.py +557 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/progress.py +174 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/prompts/analysis.md +40 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/prompts/proposal.md +65 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/prompts/repair.md +17 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/proposal.py +903 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/publish.py +997 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/summary.py +131 -0
- package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/tool-versions.json +133 -0
- package/node_modules/package-lock.json +3021 -0
- package/package-lock.json +3021 -0
- package/package.json +52 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { parentPort, workerData } from 'node:worker_threads';
|
|
2
|
+
import { evaluatePacket, AllocationQuota, packetAllocationLimit } from './verifier-protocol.js';
|
|
3
|
+
import { canonical } from './schema.js';
|
|
4
|
+
// Fixed trusted code only. The sole payload is a transferred packet; no repository/module path is accepted.
|
|
5
|
+
if (parentPort) {
|
|
6
|
+
try {
|
|
7
|
+
const rawPacket = workerData;
|
|
8
|
+
const observed = evaluatePacket(rawPacket);
|
|
9
|
+
const quota = new AllocationQuota(packetAllocationLimit(rawPacket));
|
|
10
|
+
let reply = observed;
|
|
11
|
+
let size = Buffer.byteLength(canonical(reply));
|
|
12
|
+
for (let index = 0; index < 3; index++) {
|
|
13
|
+
reply = { ...observed, allocationBytes: observed.allocationBytes + size };
|
|
14
|
+
const next = Buffer.byteLength(canonical(reply));
|
|
15
|
+
if (next === size)
|
|
16
|
+
break;
|
|
17
|
+
size = next;
|
|
18
|
+
}
|
|
19
|
+
const text = canonical(reply);
|
|
20
|
+
quota.charge(observed.allocationBytes);
|
|
21
|
+
if (size > 65536 || Buffer.byteLength(text) !== size)
|
|
22
|
+
throw new Error('output');
|
|
23
|
+
const bytes = quota.allocate(size);
|
|
24
|
+
Buffer.from(bytes.buffer).write(text, 'utf8');
|
|
25
|
+
parentPort.postMessage(bytes, [bytes.buffer]);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
parentPort.postMessage({ version: 1, error: 'INVALID_JOB' });
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
parentPort.close();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { type Json } from './boundary.js';
|
|
2
|
+
import { matchesDriverConstraint, type HardwareTargetSpec, type Infer, type MetricValue } from './contracts.js';
|
|
3
|
+
import { type Result } from './diagnostics.js';
|
|
4
|
+
import { type ArtifactManifest, type ResolvedArtifactInput } from './artifacts.js';
|
|
5
|
+
import { type Evidence, type SubmittedCheck } from './evidence.js';
|
|
6
|
+
import { type TaskLock } from './identity.js';
|
|
7
|
+
import { type OverlayLimitOptions } from './limits.js';
|
|
8
|
+
export { matchesDriverConstraint };
|
|
9
|
+
export declare function matchesHardwareTarget(expected: HardwareTargetSpec, expectedCellId: string, allowSyntheticProbe: boolean, observed: Evidence['spec']['hardwareProvenance']): boolean;
|
|
10
|
+
export interface EvaluationInput {
|
|
11
|
+
readonly trusted: {
|
|
12
|
+
readonly expectedLock: TaskLock;
|
|
13
|
+
readonly candidateManifest: ArtifactManifest;
|
|
14
|
+
readonly eligibleEvidence: readonly Evidence[];
|
|
15
|
+
};
|
|
16
|
+
readonly claims: readonly SubmittedCheck[];
|
|
17
|
+
}
|
|
18
|
+
export declare const diagnosticSchema: import("./contracts.js").Schema<{
|
|
19
|
+
readonly path: string;
|
|
20
|
+
readonly code: "INPUT_TYPE" | "INPUT_UNSUPPORTED" | "INPUT_CYCLE" | "INPUT_ALIAS" | "LIMIT_BYTES" | "LIMIT_DEPTH" | "LIMIT_STRING" | "LIMIT_COLLECTION" | "LIMIT_NODES" | "JSON_SYNTAX" | "JSON_DUPLICATE_MEMBER" | "VERSION_UNSUPPORTED" | "KIND_MISMATCH" | "FIELD_REQUIRED" | "FIELD_UNKNOWN" | "VALUE_TYPE" | "VALUE_ENUM" | "VALUE_RANGE" | "IDENTIFIER_INVALID" | "PATH_INVALID" | "PATTERN_UNSUPPORTED" | "DUPLICATE_ID" | "DUPLICATE_EDGE" | "REFERENCE_UNKNOWN" | "GRAPH_CYCLE" | "LIMIT_GRAPH_NODES" | "LIMIT_GRAPH_EDGES" | "BUDGET_INCONSISTENT" | "HASH_MISMATCH" | "MANIFEST_AMBIGUOUS" | "IDENTITY_MISMATCH" | "EVIDENCE_DUPLICATE" | "EVIDENCE_CONTRADICTORY" | "ARTIFACT_DUPLICATE" | "LIMIT_ARTIFACT_BYTES" | "LIMIT_RESOLVED_BYTES" | "USAGE_OVERFLOW" | "RUN_ACCEPTANCE_REQUIRED" | "RUN_NO_CHANGE_REQUIRED" | "RUN_RECONCILIATION_REQUIRED" | "CHECK_MISSING" | "EVIDENCE_MISSING" | "EVIDENCE_LEVEL_DISALLOWED" | "ARTIFACT_MISSING" | "ARTIFACT_LENGTH_MISMATCH" | "ARTIFACT_DIGEST_MISMATCH" | "HARDWARE_PROVENANCE_MISMATCH" | "METRIC_THRESHOLD_FAILED";
|
|
21
|
+
readonly checkId: string | null;
|
|
22
|
+
}>;
|
|
23
|
+
declare const rowSchema: import("./contracts.js").Schema<{
|
|
24
|
+
readonly checkId: string;
|
|
25
|
+
readonly detail: string | null;
|
|
26
|
+
readonly reason: "observed_pass" | "submitted_failed" | "submitted_blocked" | "submitted_not_run" | "missing_submission" | "missing_evidence" | "evidence_level_disallowed" | "artifact_missing" | "artifact_length_mismatch" | "artifact_digest_mismatch" | "hardware_provenance_mismatch" | "metric_threshold_failed";
|
|
27
|
+
readonly status: "passed" | "failed" | "blocked" | "not_run";
|
|
28
|
+
readonly evidenceId: string | null;
|
|
29
|
+
readonly findings?: readonly {
|
|
30
|
+
readonly evidence: string;
|
|
31
|
+
readonly title: string;
|
|
32
|
+
readonly severity: "critical" | "high" | "medium" | "low";
|
|
33
|
+
readonly path?: string | null;
|
|
34
|
+
readonly line?: number | null;
|
|
35
|
+
}[];
|
|
36
|
+
readonly metrics?: Readonly<Record<string, MetricValue>>;
|
|
37
|
+
}>;
|
|
38
|
+
export type EvaluatedCheck = Infer<typeof rowSchema>;
|
|
39
|
+
declare const verificationShape: (value: Json, path: string) => {
|
|
40
|
+
readonly kind: "VerificationResult";
|
|
41
|
+
readonly apiVersion: "loopwright.dev/v1alpha1";
|
|
42
|
+
readonly metadata: {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
};
|
|
45
|
+
readonly spec: {
|
|
46
|
+
readonly required: readonly {
|
|
47
|
+
readonly checkId: string;
|
|
48
|
+
readonly detail: string | null;
|
|
49
|
+
readonly reason: "observed_pass" | "submitted_failed" | "submitted_blocked" | "submitted_not_run" | "missing_submission" | "missing_evidence" | "evidence_level_disallowed" | "artifact_missing" | "artifact_length_mismatch" | "artifact_digest_mismatch" | "hardware_provenance_mismatch" | "metric_threshold_failed";
|
|
50
|
+
readonly status: "passed" | "failed" | "blocked" | "not_run";
|
|
51
|
+
readonly evidenceId: string | null;
|
|
52
|
+
readonly findings?: readonly {
|
|
53
|
+
readonly evidence: string;
|
|
54
|
+
readonly title: string;
|
|
55
|
+
readonly severity: "critical" | "high" | "medium" | "low";
|
|
56
|
+
readonly path?: string | null;
|
|
57
|
+
readonly line?: number | null;
|
|
58
|
+
}[];
|
|
59
|
+
readonly metrics?: Readonly<Record<string, MetricValue>>;
|
|
60
|
+
}[];
|
|
61
|
+
readonly subject: {
|
|
62
|
+
readonly repository: string;
|
|
63
|
+
readonly baseRevision: string;
|
|
64
|
+
readonly sourceRevision: string;
|
|
65
|
+
readonly contractHash: {
|
|
66
|
+
readonly hex: string;
|
|
67
|
+
readonly algorithm: "sha256";
|
|
68
|
+
};
|
|
69
|
+
readonly lockHash: {
|
|
70
|
+
readonly hex: string;
|
|
71
|
+
readonly algorithm: "sha256";
|
|
72
|
+
};
|
|
73
|
+
readonly candidateDigest: {
|
|
74
|
+
readonly hex: string;
|
|
75
|
+
readonly algorithm: "sha256";
|
|
76
|
+
};
|
|
77
|
+
readonly targetMatrixDigest: {
|
|
78
|
+
readonly hex: string;
|
|
79
|
+
readonly algorithm: "sha256";
|
|
80
|
+
} | null;
|
|
81
|
+
};
|
|
82
|
+
readonly optional: readonly {
|
|
83
|
+
readonly checkId: string;
|
|
84
|
+
readonly detail: string | null;
|
|
85
|
+
readonly reason: "observed_pass" | "submitted_failed" | "submitted_blocked" | "submitted_not_run" | "missing_submission" | "missing_evidence" | "evidence_level_disallowed" | "artifact_missing" | "artifact_length_mismatch" | "artifact_digest_mismatch" | "hardware_provenance_mismatch" | "metric_threshold_failed";
|
|
86
|
+
readonly status: "passed" | "failed" | "blocked" | "not_run";
|
|
87
|
+
readonly evidenceId: string | null;
|
|
88
|
+
readonly findings?: readonly {
|
|
89
|
+
readonly evidence: string;
|
|
90
|
+
readonly title: string;
|
|
91
|
+
readonly severity: "critical" | "high" | "medium" | "low";
|
|
92
|
+
readonly path?: string | null;
|
|
93
|
+
readonly line?: number | null;
|
|
94
|
+
}[];
|
|
95
|
+
readonly metrics?: Readonly<Record<string, MetricValue>>;
|
|
96
|
+
}[];
|
|
97
|
+
readonly satisfied: boolean;
|
|
98
|
+
readonly diagnostics: readonly {
|
|
99
|
+
readonly path: string;
|
|
100
|
+
readonly code: "INPUT_TYPE" | "INPUT_UNSUPPORTED" | "INPUT_CYCLE" | "INPUT_ALIAS" | "LIMIT_BYTES" | "LIMIT_DEPTH" | "LIMIT_STRING" | "LIMIT_COLLECTION" | "LIMIT_NODES" | "JSON_SYNTAX" | "JSON_DUPLICATE_MEMBER" | "VERSION_UNSUPPORTED" | "KIND_MISMATCH" | "FIELD_REQUIRED" | "FIELD_UNKNOWN" | "VALUE_TYPE" | "VALUE_ENUM" | "VALUE_RANGE" | "IDENTIFIER_INVALID" | "PATH_INVALID" | "PATTERN_UNSUPPORTED" | "DUPLICATE_ID" | "DUPLICATE_EDGE" | "REFERENCE_UNKNOWN" | "GRAPH_CYCLE" | "LIMIT_GRAPH_NODES" | "LIMIT_GRAPH_EDGES" | "BUDGET_INCONSISTENT" | "HASH_MISMATCH" | "MANIFEST_AMBIGUOUS" | "IDENTITY_MISMATCH" | "EVIDENCE_DUPLICATE" | "EVIDENCE_CONTRADICTORY" | "ARTIFACT_DUPLICATE" | "LIMIT_ARTIFACT_BYTES" | "LIMIT_RESOLVED_BYTES" | "USAGE_OVERFLOW" | "RUN_ACCEPTANCE_REQUIRED" | "RUN_NO_CHANGE_REQUIRED" | "RUN_RECONCILIATION_REQUIRED" | "CHECK_MISSING" | "EVIDENCE_MISSING" | "EVIDENCE_LEVEL_DISALLOWED" | "ARTIFACT_MISSING" | "ARTIFACT_LENGTH_MISMATCH" | "ARTIFACT_DIGEST_MISMATCH" | "HARDWARE_PROVENANCE_MISMATCH" | "METRIC_THRESHOLD_FAILED";
|
|
101
|
+
readonly checkId: string | null;
|
|
102
|
+
}[];
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export type VerificationResult = Infer<typeof verificationShape>;
|
|
106
|
+
export declare function verificationSchema(input: Json, path?: string): VerificationResult;
|
|
107
|
+
export declare function evaluateValidated(input: EvaluationInput, artifacts: readonly ResolvedArtifactInput[], claimsPath: string, options?: OverlayLimitOptions): VerificationResult;
|
|
108
|
+
export declare function evaluateAcceptance(input: unknown, artifacts: readonly ResolvedArtifactInput[], options?: OverlayLimitOptions): Result<VerificationResult>;
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { overlaySnapshotBounds, snapshotWithDeferredManifest } from './boundary.js';
|
|
2
|
+
import { arrayOf, boolean, checkStatus, document, enumeration, findingsSchema, identifier, matchesDriverConstraint, metricsSchema, nullable, object, optional, record, resolveOverlayOptions, text, } from './contracts.js';
|
|
3
|
+
import { DIAGNOSTIC_CODES, attempt, fail } from './diagnostics.js';
|
|
4
|
+
import { artifactIssue, manifestSchema, resolveInventory } from './artifacts.js';
|
|
5
|
+
import { claimSchema, evidenceSchema } from './evidence.js';
|
|
6
|
+
import { unique } from './graph.js';
|
|
7
|
+
import { deriveSubject, lockSchema, matchSubject, subjectSchema } from './identity.js';
|
|
8
|
+
import { LIMITS } from './limits.js';
|
|
9
|
+
export { matchesDriverConstraint };
|
|
10
|
+
export function matchesHardwareTarget(expected, expectedCellId, allowSyntheticProbe, observed) {
|
|
11
|
+
if (observed === undefined)
|
|
12
|
+
return false;
|
|
13
|
+
if (!allowSyntheticProbe && observed.probeKind !== 'physical')
|
|
14
|
+
return false;
|
|
15
|
+
if (observed.targetCellId !== expectedCellId)
|
|
16
|
+
return false;
|
|
17
|
+
if (observed.accelerator !== expected.accelerator)
|
|
18
|
+
return false;
|
|
19
|
+
if (observed.isolationMode !== expected.isolationMode)
|
|
20
|
+
return false;
|
|
21
|
+
if (expected.deviceCount !== undefined && observed.deviceCount !== expected.deviceCount)
|
|
22
|
+
return false;
|
|
23
|
+
if (expected.topology !== undefined && observed.topology !== expected.topology)
|
|
24
|
+
return false;
|
|
25
|
+
if (expected.driverConstraint !== undefined && !matchesDriverConstraint(expected.driverConstraint, observed.driverVersion)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
function readFiniteMetric(metrics, key) {
|
|
31
|
+
if (!Object.hasOwn(metrics, key))
|
|
32
|
+
return undefined;
|
|
33
|
+
const raw = metrics[key];
|
|
34
|
+
if (typeof raw !== 'number' || !Number.isFinite(raw))
|
|
35
|
+
return undefined;
|
|
36
|
+
return Object.is(raw, -0) ? 0 : raw;
|
|
37
|
+
}
|
|
38
|
+
function evaluateMetricThresholds(rules, metrics) {
|
|
39
|
+
if (rules.length === 0)
|
|
40
|
+
return true;
|
|
41
|
+
if (metrics === undefined)
|
|
42
|
+
return false;
|
|
43
|
+
for (const rule of rules) {
|
|
44
|
+
const value = readFiniteMetric(metrics, rule.metric);
|
|
45
|
+
if (value === undefined)
|
|
46
|
+
return false;
|
|
47
|
+
if (rule.kind === 'bounds') {
|
|
48
|
+
if (rule.min !== undefined && value < rule.min)
|
|
49
|
+
return false;
|
|
50
|
+
if (rule.max !== undefined && value > rule.max)
|
|
51
|
+
return false;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const baseline = readFiniteMetric(metrics, rule.baselineMetric);
|
|
55
|
+
if (baseline === undefined)
|
|
56
|
+
return false;
|
|
57
|
+
if (rule.operator === 'min_ratio') {
|
|
58
|
+
if (!(baseline > 0))
|
|
59
|
+
return false;
|
|
60
|
+
const ratio = value / baseline;
|
|
61
|
+
if (Number.isNaN(ratio) || ratio < rule.threshold)
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
else if (rule.operator === 'max_ratio') {
|
|
65
|
+
if (!(baseline > 0))
|
|
66
|
+
return false;
|
|
67
|
+
const ratio = value / baseline;
|
|
68
|
+
if (Number.isNaN(ratio) || ratio > rule.threshold)
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const delta = value - baseline;
|
|
73
|
+
if (Number.isNaN(delta) || delta > rule.threshold)
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
function parseEvaluationTrusted(value, path, resolveManifest, explicitOverlay) {
|
|
80
|
+
const input = object(value, path);
|
|
81
|
+
for (const key of ['expectedLock', 'candidateManifest', 'eligibleEvidence']) {
|
|
82
|
+
if (!Object.hasOwn(input, key))
|
|
83
|
+
fail('FIELD_REQUIRED', `${path}/${key}`);
|
|
84
|
+
}
|
|
85
|
+
for (const key of Object.keys(input).sort()) {
|
|
86
|
+
if (key !== 'expectedLock' && key !== 'candidateManifest' && key !== 'eligibleEvidence')
|
|
87
|
+
fail('FIELD_UNKNOWN', path);
|
|
88
|
+
}
|
|
89
|
+
const expectedLock = lockSchema(input.expectedLock, `${path}/expectedLock`);
|
|
90
|
+
const effectiveOverlay = explicitOverlay ?? expectedLock.spec.contract.spec.budgets.overlay;
|
|
91
|
+
const manifestJson = resolveManifest(overlaySnapshotBounds(effectiveOverlay?.maxFiles));
|
|
92
|
+
const candidateManifest = manifestSchema(manifestJson, `${path}/candidateManifest`, effectiveOverlay?.maxFiles);
|
|
93
|
+
const eligibleEvidence = arrayOf(evidenceSchema, 0, LIMITS.evidence)(input.eligibleEvidence, `${path}/eligibleEvidence`);
|
|
94
|
+
const output = Object.create(null);
|
|
95
|
+
output.expectedLock = expectedLock;
|
|
96
|
+
output.candidateManifest = candidateManifest;
|
|
97
|
+
output.eligibleEvidence = eligibleEvidence;
|
|
98
|
+
return output;
|
|
99
|
+
}
|
|
100
|
+
function parseEvaluationInput(value, path, resolveManifest, explicitOverlay) {
|
|
101
|
+
return record({
|
|
102
|
+
trusted: (trustedValue, trustedPath) => parseEvaluationTrusted(trustedValue, trustedPath, resolveManifest, explicitOverlay),
|
|
103
|
+
claims: arrayOf(claimSchema, 0, LIMITS.checks),
|
|
104
|
+
})(value, path);
|
|
105
|
+
}
|
|
106
|
+
export const diagnosticSchema = record({ code: enumeration(...DIAGNOSTIC_CODES), path: text(0, LIMITS.path), checkId: nullable(identifier) });
|
|
107
|
+
const reasonSchema = enumeration('observed_pass', 'submitted_failed', 'submitted_blocked', 'submitted_not_run', 'missing_submission', 'missing_evidence', 'evidence_level_disallowed', 'artifact_missing', 'artifact_length_mismatch', 'artifact_digest_mismatch', 'hardware_provenance_mismatch', 'metric_threshold_failed');
|
|
108
|
+
const BLOCKED_REASONS = new Set([
|
|
109
|
+
'submitted_blocked', 'missing_evidence', 'evidence_level_disallowed',
|
|
110
|
+
'artifact_missing', 'artifact_length_mismatch', 'artifact_digest_mismatch',
|
|
111
|
+
'hardware_provenance_mismatch', 'metric_threshold_failed',
|
|
112
|
+
]);
|
|
113
|
+
const rowSchema = record({
|
|
114
|
+
checkId: identifier, status: checkStatus, evidenceId: nullable(identifier), reason: reasonSchema, detail: nullable(text()),
|
|
115
|
+
metrics: optional(metricsSchema),
|
|
116
|
+
findings: optional(findingsSchema),
|
|
117
|
+
});
|
|
118
|
+
const verificationShape = document('VerificationResult', record({ subject: subjectSchema,
|
|
119
|
+
required: arrayOf(rowSchema, 1, LIMITS.checks), optional: arrayOf(rowSchema, 0, LIMITS.checks),
|
|
120
|
+
satisfied: boolean, diagnostics: arrayOf(diagnosticSchema),
|
|
121
|
+
}));
|
|
122
|
+
function cloneMetrics(metrics) {
|
|
123
|
+
const copy = Object.create(null);
|
|
124
|
+
for (const key of Object.keys(metrics).sort())
|
|
125
|
+
copy[key] = metrics[key];
|
|
126
|
+
return copy;
|
|
127
|
+
}
|
|
128
|
+
function cloneFindings(findings) {
|
|
129
|
+
return findings.map(finding => {
|
|
130
|
+
const copy = Object.create(null);
|
|
131
|
+
copy.title = finding.title;
|
|
132
|
+
copy.severity = finding.severity;
|
|
133
|
+
if (Object.hasOwn(finding, 'path'))
|
|
134
|
+
copy.path = finding.path;
|
|
135
|
+
if (Object.hasOwn(finding, 'line'))
|
|
136
|
+
copy.line = finding.line;
|
|
137
|
+
copy.evidence = finding.evidence;
|
|
138
|
+
return copy;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function withMetadata(base, metrics, findings) {
|
|
142
|
+
if (metrics === undefined && findings === undefined)
|
|
143
|
+
return base;
|
|
144
|
+
return {
|
|
145
|
+
...base,
|
|
146
|
+
...(metrics !== undefined ? { metrics: cloneMetrics(metrics) } : {}),
|
|
147
|
+
...(findings !== undefined ? { findings: cloneFindings(findings) } : {}),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
export function verificationSchema(input, path = '') {
|
|
151
|
+
const result = verificationShape(input, path), spec = result.spec;
|
|
152
|
+
const rows = [...spec.required, ...spec.optional];
|
|
153
|
+
if (rows.length > LIMITS.checks)
|
|
154
|
+
fail('VALUE_RANGE', `${path}/spec/required`);
|
|
155
|
+
const ids = new Set();
|
|
156
|
+
rows.forEach((row, index) => {
|
|
157
|
+
if (ids.has(row.checkId)) {
|
|
158
|
+
const collection = index < spec.required.length ? 'required' : 'optional';
|
|
159
|
+
const localIndex = index < spec.required.length ? index : index - spec.required.length;
|
|
160
|
+
fail('DUPLICATE_ID', `${path}/spec/${collection}/${localIndex}`);
|
|
161
|
+
}
|
|
162
|
+
ids.add(row.checkId);
|
|
163
|
+
});
|
|
164
|
+
if (spec.satisfied !== spec.required.every(row => row.status === 'passed'))
|
|
165
|
+
fail('VALUE_ENUM', `${path}/spec/satisfied`);
|
|
166
|
+
for (const [index, row] of rows.entries()) {
|
|
167
|
+
const location = `${path}/spec/${index < spec.required.length ? 'required' : 'optional'}/${index < spec.required.length ? index : index - spec.required.length}`;
|
|
168
|
+
if (row.status === 'passed' && (row.reason !== 'observed_pass' || row.evidenceId === null))
|
|
169
|
+
fail('VALUE_ENUM', location);
|
|
170
|
+
if (row.status === 'failed' && row.reason !== 'submitted_failed')
|
|
171
|
+
fail('VALUE_ENUM', location);
|
|
172
|
+
if (row.status === 'not_run' && (row.evidenceId !== null || !['missing_submission', 'submitted_not_run'].includes(row.reason)))
|
|
173
|
+
fail('VALUE_ENUM', location);
|
|
174
|
+
if (row.status === 'blocked' && !BLOCKED_REASONS.has(row.reason))
|
|
175
|
+
fail('VALUE_ENUM', location);
|
|
176
|
+
if (row.reason.startsWith('submitted_') && row.detail === null)
|
|
177
|
+
fail('VALUE_RANGE', `${location}/detail`);
|
|
178
|
+
if (!row.reason.startsWith('submitted_') && row.reason !== 'observed_pass') {
|
|
179
|
+
if (row.detail !== null)
|
|
180
|
+
fail('VALUE_RANGE', `${location}/detail`);
|
|
181
|
+
if (row.metrics !== undefined)
|
|
182
|
+
fail('VALUE_RANGE', `${location}/metrics`);
|
|
183
|
+
if (row.findings !== undefined)
|
|
184
|
+
fail('VALUE_RANGE', `${location}/findings`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
spec.diagnostics.forEach((diagnostic, index) => {
|
|
188
|
+
if (diagnostic.checkId !== null && !ids.has(diagnostic.checkId))
|
|
189
|
+
fail('REFERENCE_UNKNOWN', `${path}/spec/diagnostics/${index}/checkId`);
|
|
190
|
+
});
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
export function evaluateValidated(input, artifacts, claimsPath, options) {
|
|
194
|
+
const { expectedLock: lock, candidateManifest: manifest, eligibleEvidence } = input.trusted;
|
|
195
|
+
const effectiveOverlay = resolveOverlayOptions(options) ?? lock.spec.contract.spec.budgets.overlay;
|
|
196
|
+
const subject = deriveSubject(lock, manifest), acceptance = lock.spec.contract.spec.acceptance;
|
|
197
|
+
const requirements = new Map(acceptance.checks.map(check => [check.id, check]));
|
|
198
|
+
const matrixCells = new Map((lock.spec.contract.spec.target.matrix ?? []).map(cell => [cell.id, cell]));
|
|
199
|
+
unique(input.claims.map(claim => claim.checkId), claimsPath);
|
|
200
|
+
const claims = new Map(input.claims.map(claim => [claim.checkId, claim]));
|
|
201
|
+
const evidenceById = new Map();
|
|
202
|
+
const evidenceIndexById = new Map();
|
|
203
|
+
const evidenceByCheck = new Map();
|
|
204
|
+
eligibleEvidence.forEach((evidence, index) => {
|
|
205
|
+
const path = `/trusted/eligibleEvidence/${index}`, observation = evidence.spec;
|
|
206
|
+
const checkId = requirements.has(observation.checkId) ? observation.checkId : null;
|
|
207
|
+
if (evidenceById.has(evidence.metadata.id))
|
|
208
|
+
fail('EVIDENCE_DUPLICATE', `${path}/metadata/id`, checkId);
|
|
209
|
+
const previous = evidenceByCheck.get(observation.checkId);
|
|
210
|
+
if (previous)
|
|
211
|
+
fail(previous.spec.observedStatus === observation.observedStatus ? 'EVIDENCE_DUPLICATE' : 'EVIDENCE_CONTRADICTORY', `${path}/spec/checkId`, checkId);
|
|
212
|
+
evidenceById.set(evidence.metadata.id, evidence);
|
|
213
|
+
evidenceIndexById.set(evidence.metadata.id, index);
|
|
214
|
+
evidenceByCheck.set(observation.checkId, evidence);
|
|
215
|
+
});
|
|
216
|
+
// Complete each validation phase before advancing to the next observation phase.
|
|
217
|
+
input.claims.forEach((claim, index) => {
|
|
218
|
+
if (!requirements.has(claim.checkId))
|
|
219
|
+
fail('REFERENCE_UNKNOWN', `${claimsPath}/${index}/checkId`);
|
|
220
|
+
});
|
|
221
|
+
eligibleEvidence.forEach((evidence, index) => {
|
|
222
|
+
if (!requirements.has(evidence.spec.checkId))
|
|
223
|
+
fail('REFERENCE_UNKNOWN', `/trusted/eligibleEvidence/${index}/spec/checkId`);
|
|
224
|
+
});
|
|
225
|
+
eligibleEvidence.forEach((evidence, index) => {
|
|
226
|
+
matchSubject(subject, evidence.spec.subject, `/trusted/eligibleEvidence/${index}/spec/subject`, evidence.spec.checkId);
|
|
227
|
+
});
|
|
228
|
+
input.claims.forEach((claim, index) => {
|
|
229
|
+
const sameCheck = evidenceByCheck.get(claim.checkId);
|
|
230
|
+
if (sameCheck && sameCheck.spec.observedStatus !== claim.status)
|
|
231
|
+
fail('EVIDENCE_CONTRADICTORY', `${claimsPath}/${index}/status`, claim.checkId);
|
|
232
|
+
const evidence = claim.evidenceId === null ? undefined : evidenceById.get(claim.evidenceId);
|
|
233
|
+
if (claim.evidenceId !== null && !evidence && claim.status !== 'passed')
|
|
234
|
+
fail('REFERENCE_UNKNOWN', `${claimsPath}/${index}/evidenceId`, claim.checkId);
|
|
235
|
+
if (evidence && (evidence.spec.checkId !== claim.checkId || evidence.spec.observedStatus !== claim.status))
|
|
236
|
+
fail('EVIDENCE_CONTRADICTORY', `${claimsPath}/${index}/evidenceId`, claim.checkId);
|
|
237
|
+
});
|
|
238
|
+
const inventory = resolveInventory(artifacts, effectiveOverlay ? { overlay: effectiveOverlay } : undefined);
|
|
239
|
+
if (effectiveOverlay !== undefined && manifest.spec.baseTree !== undefined) {
|
|
240
|
+
let candidateOverlayTotal = 0;
|
|
241
|
+
for (let index = 0; index < manifest.spec.entries.length; index++) {
|
|
242
|
+
const entry = manifest.spec.entries[index];
|
|
243
|
+
if (entry.byteLength > effectiveOverlay.maxBytes - candidateOverlayTotal) {
|
|
244
|
+
fail('LIMIT_RESOLVED_BYTES', `/trusted/candidateManifest/spec/entries/${index}`);
|
|
245
|
+
}
|
|
246
|
+
candidateOverlayTotal += entry.byteLength;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
const candidateIssue = artifactIssue(manifest.spec.entries, inventory, '/trusted/candidateManifest/spec/entries');
|
|
250
|
+
const issues = new Map(eligibleEvidence.map((evidence, index) => [evidence.metadata.id,
|
|
251
|
+
artifactIssue(evidence.spec.artifacts, inventory, `/trusted/eligibleEvidence/${index}/spec/artifacts`)]));
|
|
252
|
+
const diagnostics = [];
|
|
253
|
+
const row = (checkId) => {
|
|
254
|
+
const claim = claims.get(checkId);
|
|
255
|
+
if (!claim) {
|
|
256
|
+
diagnostics.push({ code: 'CHECK_MISSING', path: claimsPath, checkId });
|
|
257
|
+
return { checkId, status: 'not_run', evidenceId: null, reason: 'missing_submission', detail: null };
|
|
258
|
+
}
|
|
259
|
+
const evidence = claim.evidenceId === null ? undefined : evidenceById.get(claim.evidenceId);
|
|
260
|
+
const trustedEvidence = evidence ?? evidenceByCheck.get(checkId);
|
|
261
|
+
if (claim.status !== 'passed') {
|
|
262
|
+
const reasons = { failed: 'submitted_failed', blocked: 'submitted_blocked', not_run: 'submitted_not_run' };
|
|
263
|
+
if (trustedEvidence) {
|
|
264
|
+
const trustedIssue = issues.get(trustedEvidence.metadata.id) ?? null;
|
|
265
|
+
if (trustedIssue)
|
|
266
|
+
diagnostics.push({ ...trustedIssue, checkId });
|
|
267
|
+
return withMetadata({
|
|
268
|
+
checkId,
|
|
269
|
+
status: claim.status,
|
|
270
|
+
evidenceId: claim.status === 'not_run' ? null : trustedEvidence.metadata.id,
|
|
271
|
+
reason: reasons[claim.status],
|
|
272
|
+
detail: trustedEvidence.spec.detail ?? trustedEvidence.spec.reason,
|
|
273
|
+
}, trustedEvidence.spec.metrics, trustedEvidence.spec.findings);
|
|
274
|
+
}
|
|
275
|
+
return withMetadata({
|
|
276
|
+
checkId,
|
|
277
|
+
status: claim.status,
|
|
278
|
+
evidenceId: claim.evidenceId,
|
|
279
|
+
reason: reasons[claim.status],
|
|
280
|
+
detail: claim.detail ?? claim.reason,
|
|
281
|
+
}, claim.metrics, claim.findings);
|
|
282
|
+
}
|
|
283
|
+
const issue = evidence ? issues.get(evidence.metadata.id) ?? null : null;
|
|
284
|
+
const blocked = (code, reason, path) => {
|
|
285
|
+
diagnostics.push({ code, path, checkId });
|
|
286
|
+
return { checkId, status: 'blocked', evidenceId: claim.evidenceId, reason, detail: null };
|
|
287
|
+
};
|
|
288
|
+
if (!evidence)
|
|
289
|
+
return blocked('EVIDENCE_MISSING', 'missing_evidence', claimsPath);
|
|
290
|
+
const requirement = requirements.get(checkId);
|
|
291
|
+
if (!requirement.allowedEvidenceLevels.includes(evidence.spec.level))
|
|
292
|
+
return blocked('EVIDENCE_LEVEL_DISALLOWED', 'evidence_level_disallowed', claimsPath);
|
|
293
|
+
const invalidArtifact = candidateIssue ?? issue;
|
|
294
|
+
if (invalidArtifact) {
|
|
295
|
+
const reasons = { ARTIFACT_MISSING: 'artifact_missing', ARTIFACT_LENGTH_MISMATCH: 'artifact_length_mismatch', ARTIFACT_DIGEST_MISMATCH: 'artifact_digest_mismatch' };
|
|
296
|
+
return blocked(invalidArtifact.code, reasons[invalidArtifact.code], invalidArtifact.path);
|
|
297
|
+
}
|
|
298
|
+
const evidenceIndex = evidenceIndexById.get(evidence.metadata.id);
|
|
299
|
+
const evidenceSpecPath = `/trusted/eligibleEvidence/${evidenceIndex}/spec`;
|
|
300
|
+
if (requirement.allowedEvidenceLevels.includes('hardware_execution')) {
|
|
301
|
+
const cell = requirement.targetCellId === undefined ? undefined : matrixCells.get(requirement.targetCellId);
|
|
302
|
+
if (!cell || !cell.hardware || requirement.targetCellId === undefined
|
|
303
|
+
|| !matchesHardwareTarget(cell.hardware, requirement.targetCellId, requirement.allowSyntheticHardwareProbe === true, evidence.spec.hardwareProvenance)) {
|
|
304
|
+
return blocked('HARDWARE_PROVENANCE_MISMATCH', 'hardware_provenance_mismatch', `${evidenceSpecPath}/hardwareProvenance`);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (requirement.metricThresholds !== undefined && requirement.metricThresholds.length > 0) {
|
|
308
|
+
if (!evaluateMetricThresholds(requirement.metricThresholds, evidence.spec.metrics)) {
|
|
309
|
+
return blocked('METRIC_THRESHOLD_FAILED', 'metric_threshold_failed', `${evidenceSpecPath}/metrics`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return withMetadata({ checkId, status: 'passed', evidenceId: evidence.metadata.id, reason: 'observed_pass', detail: evidence.spec.detail ?? null }, evidence.spec.metrics, evidence.spec.findings);
|
|
313
|
+
};
|
|
314
|
+
const requiredSet = new Set(acceptance.required);
|
|
315
|
+
const required = acceptance.required.map(row);
|
|
316
|
+
const optional = acceptance.checks.filter(check => !requiredSet.has(check.id) && claims.has(check.id)).map(check => row(check.id));
|
|
317
|
+
return { apiVersion: 'loopwright.dev/v1alpha1', kind: 'VerificationResult', metadata: { id: lock.metadata.id },
|
|
318
|
+
spec: { subject, required, optional, satisfied: required.every(check => check.status === 'passed'), diagnostics } };
|
|
319
|
+
}
|
|
320
|
+
export function evaluateAcceptance(input, artifacts, options) {
|
|
321
|
+
return attempt(() => {
|
|
322
|
+
const explicitOverlay = resolveOverlayOptions(options);
|
|
323
|
+
const deferred = snapshotWithDeferredManifest(input);
|
|
324
|
+
const parsed = parseEvaluationInput(deferred.root, '', deferred.resolveManifest, explicitOverlay);
|
|
325
|
+
return evaluateValidated(parsed, artifacts, '/claims', explicitOverlay ? { overlay: explicitOverlay } : undefined);
|
|
326
|
+
});
|
|
327
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type Json } from './boundary.js';
|
|
2
|
+
import { type ArtifactRef, type Digest, type Infer } from './contracts.js';
|
|
3
|
+
import { type DiagnosticCode, type Result } from './diagnostics.js';
|
|
4
|
+
import { type OverlayLimitOptions } from './limits.js';
|
|
5
|
+
import { isVerifierNamespacePath, parseVerifierArtifactPath, type VerifierArtifactPath } from './scope.js';
|
|
6
|
+
export { isVerifierNamespacePath, parseVerifierArtifactPath, type VerifierArtifactPath };
|
|
7
|
+
export declare function byteDigest(bytes: Uint8Array): Digest;
|
|
8
|
+
export interface ArtifactRefOptions {
|
|
9
|
+
readonly uri?: string | null;
|
|
10
|
+
readonly mediaType?: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface ArtifactMetadataInput {
|
|
13
|
+
readonly digest: Digest;
|
|
14
|
+
readonly byteLength: number;
|
|
15
|
+
readonly uri?: string | null | undefined;
|
|
16
|
+
readonly mediaType?: string | null | undefined;
|
|
17
|
+
}
|
|
18
|
+
export declare function digestArtifact(name: unknown, bytes: Uint8Array, options?: ArtifactRefOptions): Result<ArtifactRef>;
|
|
19
|
+
export declare function digestArtifactFromMetadata(name: unknown, metadata: ArtifactMetadataInput): Result<ArtifactRef>;
|
|
20
|
+
export interface BaseTreeAnchor {
|
|
21
|
+
readonly objectFormat: 'sha1' | 'sha256';
|
|
22
|
+
readonly commitOid: string;
|
|
23
|
+
readonly treeOid: string;
|
|
24
|
+
}
|
|
25
|
+
declare const defaultManifestShape: (value: Json, path: string) => {
|
|
26
|
+
readonly kind: "ArtifactManifest";
|
|
27
|
+
readonly apiVersion: "loopwright.dev/v1alpha1";
|
|
28
|
+
readonly metadata: {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
};
|
|
31
|
+
readonly spec: {
|
|
32
|
+
readonly entries: readonly ArtifactRef[];
|
|
33
|
+
readonly baseTree?: undefined;
|
|
34
|
+
readonly deleted?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
readonly baseTree: BaseTreeAnchor;
|
|
37
|
+
readonly entries: readonly ArtifactRef[];
|
|
38
|
+
readonly deleted: readonly string[];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type ArtifactManifest = Infer<typeof defaultManifestShape>;
|
|
42
|
+
export declare function manifestSchema(value: Json, path?: string, maxOverlayEntries?: number): ArtifactManifest;
|
|
43
|
+
export interface ResolvedArtifact {
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly bytes: Uint8Array;
|
|
46
|
+
}
|
|
47
|
+
export interface VerifiedArtifactDescriptor {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly byteLength: number;
|
|
50
|
+
readonly digest: Digest;
|
|
51
|
+
}
|
|
52
|
+
export type ResolvedArtifactInput = ResolvedArtifact | VerifiedArtifactDescriptor;
|
|
53
|
+
export interface ArtifactBytes {
|
|
54
|
+
readonly byteLength: number;
|
|
55
|
+
readonly digest: Digest;
|
|
56
|
+
}
|
|
57
|
+
/** Validate inventory shape and all byte limits before copying or hashing. */
|
|
58
|
+
export declare function resolveInventory(input: readonly ResolvedArtifactInput[], options?: OverlayLimitOptions): ReadonlyMap<string, ArtifactBytes>;
|
|
59
|
+
export interface ArtifactIssue {
|
|
60
|
+
readonly code: Extract<DiagnosticCode, 'ARTIFACT_MISSING' | 'ARTIFACT_LENGTH_MISMATCH' | 'ARTIFACT_DIGEST_MISMATCH'>;
|
|
61
|
+
readonly path: string;
|
|
62
|
+
}
|
|
63
|
+
export declare function artifactIssue(refs: readonly ArtifactRef[], inventory: ReadonlyMap<string, ArtifactBytes>, path: string): ArtifactIssue | null;
|