@gpustack/loopwright 0.0.0-stage → 0.0.3
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 +2094 -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 +1648 -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 +2642 -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 +7335 -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 +3025 -0
- package/package-lock.json +3025 -0
- package/package.json +52 -4
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { describePiAdapterFiles } from '@loopwright/agent-pi';
|
|
5
|
+
import { OVERLAY_LIMITS, matchesScopePattern, resolveOverlayLimits, validateDocument, validateScopePattern, } from '@loopwright/core';
|
|
6
|
+
import { installedHandlerDigests } from '@loopwright/controller';
|
|
7
|
+
import { RunnerTaskpackError } from './types.js';
|
|
8
|
+
/** Runner's candidate patch surface using explicit Taskpack 2.0 directory (`/**`) and exact-file syntax. */
|
|
9
|
+
export const RUNNER_WRITABLE_PATHS = ['pack/**', 'docs/supported-runners.md', 'docs/support-records.md', 'runtime_runner/runner.py.json', '.autosync/proposal.json'];
|
|
10
|
+
/** Runner's default repository-level protected surface when `options.scope` is omitted. */
|
|
11
|
+
export const RUNNER_PROTECTED_PATHS = ['.github/**', 'tools/**', 'tests/**'];
|
|
12
|
+
/** Neutral built-in paths that always stay write-protected regardless of custom scope configuration. */
|
|
13
|
+
export const RUNNER_ALWAYS_PROTECTED_PATHS = ['.git/**'];
|
|
14
|
+
export const RUNNER_WORKFLOW_PROTECTED_PATH = '.github/workflows/**';
|
|
15
|
+
/** Runner research stage budget mapped onto controller pre-admitted caps: tokens soft, everything else hard. */
|
|
16
|
+
export const RUNNER_BUDGETS = {
|
|
17
|
+
wallTimeMs: 3300000,
|
|
18
|
+
totalTokens: 20000000,
|
|
19
|
+
perCallOutputTokens: 1024,
|
|
20
|
+
maxModelCalls: 12,
|
|
21
|
+
maxConcurrency: 1,
|
|
22
|
+
maxFormatRepairs: 2,
|
|
23
|
+
maxImplementationRepairs: 2,
|
|
24
|
+
maxTransportRetries: 2,
|
|
25
|
+
};
|
|
26
|
+
export const RUNNER_PROPOSAL_PATH = '.autosync/proposal.json';
|
|
27
|
+
export const RUNNER_PROPOSAL_REQUIRED_FIELDS = ['schema_version', 'identity', 'candidates', 'groups'];
|
|
28
|
+
function globSegmentsOverlap(a, b) {
|
|
29
|
+
const memo = new Map();
|
|
30
|
+
const dp = (i, j) => {
|
|
31
|
+
const key = i * (b.length + 1) + j;
|
|
32
|
+
const cached = memo.get(key);
|
|
33
|
+
if (cached !== undefined)
|
|
34
|
+
return cached;
|
|
35
|
+
let res = false;
|
|
36
|
+
if (i === a.length && j === b.length) {
|
|
37
|
+
res = true;
|
|
38
|
+
}
|
|
39
|
+
else if (i < a.length && a[i] === '*') {
|
|
40
|
+
res = dp(i + 1, j) || (j < b.length && dp(i, j + 1));
|
|
41
|
+
}
|
|
42
|
+
else if (j < b.length && b[j] === '*') {
|
|
43
|
+
res = dp(i, j + 1) || (i < a.length && dp(i + 1, j));
|
|
44
|
+
}
|
|
45
|
+
else if (i < a.length && j < b.length && (a[i] === '?' || b[j] === '?' || a[i] === b[j])) {
|
|
46
|
+
res = dp(i + 1, j + 1);
|
|
47
|
+
}
|
|
48
|
+
memo.set(key, res);
|
|
49
|
+
return res;
|
|
50
|
+
};
|
|
51
|
+
return dp(0, 0);
|
|
52
|
+
}
|
|
53
|
+
function scopePatternsOverlap(a, b) {
|
|
54
|
+
if (a === '**' || b === '**')
|
|
55
|
+
return true;
|
|
56
|
+
const aRec = a.endsWith('/**');
|
|
57
|
+
const bRec = b.endsWith('/**');
|
|
58
|
+
const aSegs = (aRec ? a.slice(0, -3) : a).split('/');
|
|
59
|
+
const bSegs = (bRec ? b.slice(0, -3) : b).split('/');
|
|
60
|
+
if (!aRec && !bRec && aSegs.length !== bSegs.length)
|
|
61
|
+
return false;
|
|
62
|
+
if (aRec && !bRec && bSegs.length < aSegs.length)
|
|
63
|
+
return false;
|
|
64
|
+
if (bRec && !aRec && aSegs.length < bSegs.length)
|
|
65
|
+
return false;
|
|
66
|
+
const minLen = Math.min(aSegs.length, bSegs.length);
|
|
67
|
+
for (let i = 0; i < minLen; i++) {
|
|
68
|
+
if (!globSegmentsOverlap(aSegs[i], bSegs[i]))
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
function validateAndDedupeScopePatterns(patterns, field) {
|
|
74
|
+
const seen = new Set();
|
|
75
|
+
const out = [];
|
|
76
|
+
for (const [index, entry] of patterns.entries()) {
|
|
77
|
+
const checked = validateScopePattern(entry);
|
|
78
|
+
if (!checked.ok) {
|
|
79
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `invalid scope.${field}[${index}] pattern "${entry}": ${checked.errors[0]?.code ?? 'PATTERN_UNSUPPORTED'}`);
|
|
80
|
+
}
|
|
81
|
+
if (!seen.has(checked.value)) {
|
|
82
|
+
seen.add(checked.value);
|
|
83
|
+
out.push(checked.value);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
88
|
+
async function runtimeIdentity() {
|
|
89
|
+
const described = await describePiAdapterFiles();
|
|
90
|
+
if (!described.ok)
|
|
91
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `pi adapter files could not be described: ${described.error.code}`);
|
|
92
|
+
const files = described.value;
|
|
93
|
+
const graphDigest = await readFile(fileURLToPath(new URL('../../../package-lock.json', import.meta.resolve('@loopwright/agent-pi'))));
|
|
94
|
+
const digest = (bytes) => ({ algorithm: 'sha256', hex: createHash('sha256').update(bytes).digest('hex') });
|
|
95
|
+
return {
|
|
96
|
+
sdkIntegrity: files.sdkIntegrity,
|
|
97
|
+
graphDigest: digest(graphDigest),
|
|
98
|
+
configDigest: files.restrictionDigest,
|
|
99
|
+
localMcpScriptDigest: files.localMcpScriptDigest,
|
|
100
|
+
limits: files.limits,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function digestOf(bytes) {
|
|
104
|
+
return { algorithm: 'sha256', hex: createHash('sha256').update(bytes).digest('hex') };
|
|
105
|
+
}
|
|
106
|
+
function controlRootCarveOutPattern(proposalPath, writablePatterns, protectedPatterns, mandatoryProtected) {
|
|
107
|
+
if (!/\.(?:json|ya?ml)$/i.test(proposalPath))
|
|
108
|
+
return null;
|
|
109
|
+
const segments = proposalPath.split('/');
|
|
110
|
+
if (segments.length < 2)
|
|
111
|
+
return null;
|
|
112
|
+
const root = segments[0];
|
|
113
|
+
if (!root.startsWith('.') || root === '.git' || root === '.github')
|
|
114
|
+
return null;
|
|
115
|
+
const rootPattern = `${root}/**`;
|
|
116
|
+
if (!protectedPatterns.includes(rootPattern))
|
|
117
|
+
return null;
|
|
118
|
+
if (mandatoryProtected.some(pattern => {
|
|
119
|
+
const matched = matchesScopePattern(pattern, proposalPath);
|
|
120
|
+
return matched.ok && matched.value;
|
|
121
|
+
})) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
for (const pattern of protectedPatterns) {
|
|
125
|
+
if (pattern === rootPattern)
|
|
126
|
+
continue;
|
|
127
|
+
const matched = matchesScopePattern(pattern, proposalPath);
|
|
128
|
+
if (matched.ok && matched.value)
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
if (!writablePatterns.includes(proposalPath))
|
|
132
|
+
return null;
|
|
133
|
+
for (const entry of writablePatterns) {
|
|
134
|
+
if (entry === proposalPath)
|
|
135
|
+
continue;
|
|
136
|
+
if (scopePatternsOverlap(entry, rootPattern))
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
return rootPattern;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Compile a Runner trigger into Loopwright documents accepted by `loadTrustedConfiguration` and `compilePlan`.
|
|
143
|
+
* Signing secrets appear only inside credential and environment bindings, never in handlers, steps, or the task.
|
|
144
|
+
*/
|
|
145
|
+
export async function compileRunnerTaskpack(options) {
|
|
146
|
+
const policyProfile = options.hostPolicy?.policyProfile ?? 'github';
|
|
147
|
+
if (policyProfile !== 'local' && policyProfile !== 'github') {
|
|
148
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `invalid hostPolicy.policyProfile "${String(policyProfile)}"`);
|
|
149
|
+
}
|
|
150
|
+
const enforceGitHubWorkflowProtection = policyProfile !== 'local';
|
|
151
|
+
const requestedWorkflowWrites = options.execution?.capabilities?.allowWorkflowWrites === true;
|
|
152
|
+
const hostWorkflowWrites = options.hostPolicy?.allowWorkflowWrites === true;
|
|
153
|
+
if (enforceGitHubWorkflowProtection && requestedWorkflowWrites && !hostWorkflowWrites) {
|
|
154
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', 'allowWorkflowWrites requires explicit hostPolicy.allowWorkflowWrites authorization');
|
|
155
|
+
}
|
|
156
|
+
const allowWorkflowWrites = requestedWorkflowWrites && hostWorkflowWrites;
|
|
157
|
+
let overlayLimits;
|
|
158
|
+
if (options.limits?.overlay !== undefined) {
|
|
159
|
+
const resolvedOverlay = resolveOverlayLimits(options.limits.overlay);
|
|
160
|
+
if (!resolvedOverlay.ok || resolvedOverlay.value.maxFiles > OVERLAY_LIMITS.maxMaxFiles) {
|
|
161
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `invalid overlay limits: ${!resolvedOverlay.ok ? (resolvedOverlay.errors[0]?.code ?? 'VALUE_RANGE') : 'VALUE_RANGE'}`);
|
|
162
|
+
}
|
|
163
|
+
overlayLimits = { maxFiles: resolvedOverlay.value.maxFiles, maxBytes: resolvedOverlay.value.maxBytes };
|
|
164
|
+
}
|
|
165
|
+
const proposalConfig = options.proposal === undefined
|
|
166
|
+
? { path: RUNNER_PROPOSAL_PATH, requiredFields: [...RUNNER_PROPOSAL_REQUIRED_FIELDS], schemaVersion: 1 }
|
|
167
|
+
: options.proposal;
|
|
168
|
+
const defaultWritable = proposalConfig === null
|
|
169
|
+
? RUNNER_WRITABLE_PATHS.filter(entry => entry !== RUNNER_PROPOSAL_PATH)
|
|
170
|
+
: proposalConfig.path === RUNNER_PROPOSAL_PATH
|
|
171
|
+
? [...RUNNER_WRITABLE_PATHS]
|
|
172
|
+
: [...RUNNER_WRITABLE_PATHS.filter(entry => entry !== RUNNER_PROPOSAL_PATH), proposalConfig.path];
|
|
173
|
+
const writablePatterns = validateAndDedupeScopePatterns(options.scope !== undefined ? options.scope.writable : defaultWritable, 'writable');
|
|
174
|
+
if (writablePatterns.length === 0) {
|
|
175
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', 'scope.writable must contain at least one pattern');
|
|
176
|
+
}
|
|
177
|
+
const mandatoryProtected = [
|
|
178
|
+
...RUNNER_ALWAYS_PROTECTED_PATHS,
|
|
179
|
+
...(enforceGitHubWorkflowProtection && !allowWorkflowWrites ? ['.github/**', RUNNER_WORKFLOW_PROTECTED_PATH] : []),
|
|
180
|
+
];
|
|
181
|
+
const baseProtected = options.scope !== undefined
|
|
182
|
+
? [...(options.scope.protected ?? []), ...mandatoryProtected]
|
|
183
|
+
: [
|
|
184
|
+
...(allowWorkflowWrites ? RUNNER_PROTECTED_PATHS.filter(entry => entry !== '.github/**') : RUNNER_PROTECTED_PATHS),
|
|
185
|
+
...mandatoryProtected,
|
|
186
|
+
];
|
|
187
|
+
let protectedPatterns = validateAndDedupeScopePatterns(baseProtected, 'protected');
|
|
188
|
+
for (const writableEntry of writablePatterns) {
|
|
189
|
+
const writableLower = writableEntry.toLowerCase();
|
|
190
|
+
const overlappingMandatory = mandatoryProtected.find(protectedEntry => scopePatternsOverlap(writableLower, protectedEntry.toLowerCase()));
|
|
191
|
+
if (overlappingMandatory !== undefined) {
|
|
192
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `writable path "${writableEntry}" overlaps protected path "${overlappingMandatory}"`);
|
|
193
|
+
}
|
|
194
|
+
if (enforceGitHubWorkflowProtection
|
|
195
|
+
&& allowWorkflowWrites
|
|
196
|
+
&& scopePatternsOverlap(writableLower, '.github/**')
|
|
197
|
+
&& writableLower !== RUNNER_WORKFLOW_PROTECTED_PATH
|
|
198
|
+
&& !writableLower.startsWith('.github/workflows/')) {
|
|
199
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `writable path "${writableEntry}" overlaps protected non-workflow .github/** surface; only .github/workflows/** may be unlocked via allowWorkflowWrites`);
|
|
200
|
+
}
|
|
201
|
+
if (protectedPatterns.some(protectedEntry => protectedEntry.toLowerCase() === writableLower)) {
|
|
202
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `writable path "${writableEntry}" is listed in scope.protected`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (proposalConfig !== null) {
|
|
206
|
+
const proposalWritable = writablePatterns.some(pattern => {
|
|
207
|
+
const matched = matchesScopePattern(pattern, proposalConfig.path);
|
|
208
|
+
return matched.ok && matched.value;
|
|
209
|
+
});
|
|
210
|
+
if (!proposalWritable) {
|
|
211
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `proposal.path "${proposalConfig.path}" must be covered by scope.writable`);
|
|
212
|
+
}
|
|
213
|
+
const carvedOutPattern = controlRootCarveOutPattern(proposalConfig.path, writablePatterns, protectedPatterns, mandatoryProtected);
|
|
214
|
+
if (carvedOutPattern !== null) {
|
|
215
|
+
protectedPatterns = protectedPatterns.filter(pattern => pattern !== carvedOutPattern);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
const proposalProtectedBy = protectedPatterns.find(pattern => {
|
|
219
|
+
const matched = matchesScopePattern(pattern, proposalConfig.path);
|
|
220
|
+
return matched.ok && matched.value;
|
|
221
|
+
});
|
|
222
|
+
if (proposalProtectedBy !== undefined) {
|
|
223
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `proposal.path "${proposalConfig.path}" is covered by protected pattern "${proposalProtectedBy}"`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
const installed = await installedHandlerDigests();
|
|
228
|
+
const runtime = await runtimeIdentity();
|
|
229
|
+
const registryId = options.registryId ?? 'runner-taskpack';
|
|
230
|
+
const resourceVersion = options.resourceVersion ?? 'runner-auto-sync-frozen';
|
|
231
|
+
const authorPrompt = options.authorPrompt ?? (proposalConfig === null
|
|
232
|
+
? 'Inspect the frozen repository snapshot and produce one structured submission.'
|
|
233
|
+
: 'Inspect the frozen repository snapshot and produce one structured submission with the candidate patch and proposal document.');
|
|
234
|
+
const publicationEnabled = options.mode === 'candidate' && options.publication?.mode !== 'disabled';
|
|
235
|
+
const publicationEndpoint = publicationEnabled ? options.publicationEndpoint : undefined;
|
|
236
|
+
if (publicationEnabled && publicationEndpoint === undefined)
|
|
237
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', 'candidate mode with publication requires a publication endpoint');
|
|
238
|
+
const gateEndpoint = options.mode === 'candidate' ? options.gateEndpoint : undefined;
|
|
239
|
+
const localChecks = options.localChecks ?? [];
|
|
240
|
+
if (options.mode === 'candidate' && gateEndpoint === undefined && localChecks.length === 0) {
|
|
241
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', 'candidate mode requires a gate endpoint or local checks');
|
|
242
|
+
}
|
|
243
|
+
const roleSelection = {
|
|
244
|
+
provider: options.roleSelection?.provider ?? 'github-copilot',
|
|
245
|
+
model: options.roleSelection?.model ?? 'claude-sonnet-5.5',
|
|
246
|
+
thinking: options.roleSelection?.thinking ?? 'xhigh',
|
|
247
|
+
api: options.roleSelection?.api ?? 'anthropic-messages',
|
|
248
|
+
};
|
|
249
|
+
const runtimeOptions = {
|
|
250
|
+
dockerExecutable: options.runtimeOptions?.dockerExecutable ?? '/usr/local/bin/docker',
|
|
251
|
+
dockerSocket: options.runtimeOptions?.dockerSocket ?? '/var/run/docker.sock',
|
|
252
|
+
imageDigest: options.runtimeOptions?.imageDigest ?? 'sha256:' + 'a'.repeat(64),
|
|
253
|
+
profile: options.runtimeOptions?.profile ?? 'linux/arm64',
|
|
254
|
+
};
|
|
255
|
+
const candidateLocalChecks = [];
|
|
256
|
+
if (proposalConfig !== null) {
|
|
257
|
+
candidateLocalChecks.push({
|
|
258
|
+
id: 'runner-proposal-json',
|
|
259
|
+
kind: 'check',
|
|
260
|
+
implementation: 'json-artifact.v1',
|
|
261
|
+
digest: installed['json-artifact.v1'],
|
|
262
|
+
parameters: {
|
|
263
|
+
checkId: 'runner-proposal-json',
|
|
264
|
+
path: proposalConfig.path,
|
|
265
|
+
required: [...(proposalConfig.requiredFields ?? RUNNER_PROPOSAL_REQUIRED_FIELDS)],
|
|
266
|
+
equals: { schema_version: proposalConfig.schemaVersion ?? 1 },
|
|
267
|
+
},
|
|
268
|
+
allowedEvidenceLevels: ['local_execution'],
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
for (const localCheck of localChecks) {
|
|
272
|
+
if (candidateLocalChecks.some(existing => existing.id === localCheck.id) || (gateEndpoint !== undefined && localCheck.id === 'runner-candidate-validation')) {
|
|
273
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `duplicate local check id "${localCheck.id}"`);
|
|
274
|
+
}
|
|
275
|
+
if (localCheck.implementation === 'json-artifact.v1') {
|
|
276
|
+
candidateLocalChecks.push({
|
|
277
|
+
id: localCheck.id,
|
|
278
|
+
kind: 'check',
|
|
279
|
+
implementation: 'json-artifact.v1',
|
|
280
|
+
digest: installed['json-artifact.v1'],
|
|
281
|
+
parameters: {
|
|
282
|
+
checkId: localCheck.id,
|
|
283
|
+
path: localCheck.parameters.path,
|
|
284
|
+
required: [...localCheck.parameters.required],
|
|
285
|
+
equals: { ...localCheck.parameters.equals },
|
|
286
|
+
},
|
|
287
|
+
allowedEvidenceLevels: ['local_execution'],
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
else if (localCheck.implementation === 'json-keys-guard.v1') {
|
|
291
|
+
candidateLocalChecks.push({
|
|
292
|
+
id: localCheck.id,
|
|
293
|
+
kind: 'check',
|
|
294
|
+
implementation: 'json-keys-guard.v1',
|
|
295
|
+
digest: installed['json-keys-guard.v1'],
|
|
296
|
+
parameters: {
|
|
297
|
+
checkId: localCheck.id,
|
|
298
|
+
path: localCheck.parameters.path,
|
|
299
|
+
allowedPointers: [...localCheck.parameters.allowedPointers],
|
|
300
|
+
},
|
|
301
|
+
allowedEvidenceLevels: ['local_execution'],
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
candidateLocalChecks.push({
|
|
306
|
+
id: localCheck.id,
|
|
307
|
+
kind: 'check',
|
|
308
|
+
implementation: 'line-section-guard.v1',
|
|
309
|
+
digest: installed['line-section-guard.v1'],
|
|
310
|
+
parameters: {
|
|
311
|
+
checkId: localCheck.id,
|
|
312
|
+
path: localCheck.parameters.path,
|
|
313
|
+
startMarker: localCheck.parameters.startMarker,
|
|
314
|
+
endMarker: localCheck.parameters.endMarker,
|
|
315
|
+
},
|
|
316
|
+
allowedEvidenceLevels: ['local_execution'],
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
const candidateChecks = [
|
|
321
|
+
...candidateLocalChecks,
|
|
322
|
+
...(gateEndpoint !== undefined
|
|
323
|
+
? [{
|
|
324
|
+
id: 'runner-candidate-validation',
|
|
325
|
+
kind: 'check',
|
|
326
|
+
implementation: 'gate.v1',
|
|
327
|
+
digest: installed['gate.v1'],
|
|
328
|
+
parameters: { checkId: 'runner-candidate-validation', endpointRef: gateEndpoint.id, gateId: 'runner-candidate-validation' },
|
|
329
|
+
allowedEvidenceLevels: ['external_service'],
|
|
330
|
+
}]
|
|
331
|
+
: []),
|
|
332
|
+
];
|
|
333
|
+
const noChangeChecks = [
|
|
334
|
+
{
|
|
335
|
+
id: 'runner-no-change', kind: 'check', implementation: 'no-change.v1',
|
|
336
|
+
digest: installed['no-change.v1'],
|
|
337
|
+
parameters: { checkId: 'runner-no-change' },
|
|
338
|
+
allowedEvidenceLevels: ['local_execution'],
|
|
339
|
+
},
|
|
340
|
+
];
|
|
341
|
+
const activeChecks = options.mode === 'candidate' ? candidateChecks : noChangeChecks;
|
|
342
|
+
const credentialBindings = [
|
|
343
|
+
{ id: 'runner-provider-token', consumer: 'provider', destinationRef: roleSelection.provider, environmentNames: ['RUNNER_PROVIDER_TOKEN'], template: '${RUNNER_PROVIDER_TOKEN}' },
|
|
344
|
+
...(gateEndpoint !== undefined ? [{ id: gateEndpoint.signingCredentialRef, consumer: 'gate', destinationRef: 'runner-gate-signing', environmentNames: ['RUNNER_GATE_SIGNING_SECRET'], template: '${RUNNER_GATE_SIGNING_SECRET}' }] : []),
|
|
345
|
+
...(publicationEndpoint === undefined ? [] : [{ id: publicationEndpoint.signingCredentialRef, consumer: 'publisher', destinationRef: 'runner-publication-signing', environmentNames: ['RUNNER_PUBLICATION_SIGNING_SECRET'], template: '${RUNNER_PUBLICATION_SIGNING_SECRET}' }]),
|
|
346
|
+
];
|
|
347
|
+
const environmentBindings = [
|
|
348
|
+
{ name: 'RUNNER_PROVIDER_TOKEN', classification: 'credential', paths: ['/spec/credentials/0/template'] },
|
|
349
|
+
...(gateEndpoint !== undefined ? [{ name: 'RUNNER_GATE_SIGNING_SECRET', classification: 'credential', paths: ['/spec/credentials/1/template'] }] : []),
|
|
350
|
+
...(publicationEndpoint === undefined ? [] : [{ name: 'RUNNER_PUBLICATION_SIGNING_SECRET', classification: 'credential', paths: [`/spec/credentials/${gateEndpoint !== undefined ? 2 : 1}/template`] }]),
|
|
351
|
+
];
|
|
352
|
+
const registry = {
|
|
353
|
+
apiVersion: 'loopwright.dev/v1alpha1',
|
|
354
|
+
kind: 'TrustedRegistry',
|
|
355
|
+
metadata: { name: registryId },
|
|
356
|
+
spec: {
|
|
357
|
+
version: 1,
|
|
358
|
+
resourceVersion,
|
|
359
|
+
handlers: [
|
|
360
|
+
{ id: 'runner-author', kind: 'agent', implementation: 'pi.agent.v1', version: 1, digest: installed['pi.agent.v1'], parameters: { prompt: authorPrompt, purpose: 'task' }, capabilities: ['pi'] },
|
|
361
|
+
...activeChecks.map(check => ({ id: check.id, kind: check.kind, implementation: check.implementation, version: 1, digest: check.digest, parameters: check.parameters, capabilities: check.implementation === 'gate.v1' ? ['external_service', 'read_only'] : ['inert_bytes', 'read_only'] })),
|
|
362
|
+
{ id: 'runner-scope', kind: 'check', implementation: 'scope.v1', version: 1, digest: installed['scope.v1'], parameters: { checkId: null }, capabilities: ['inert_bytes', 'read_only'] },
|
|
363
|
+
{ id: 'runner-no-change-implicit', kind: 'check', implementation: 'no-change.v1', version: 1, digest: installed['no-change.v1'], parameters: { checkId: null }, capabilities: ['inert_bytes', 'read_only'] },
|
|
364
|
+
],
|
|
365
|
+
roleProfiles: [{
|
|
366
|
+
id: 'runner-author-role',
|
|
367
|
+
selection: { provider: roleSelection.provider, model: roleSelection.model, thinking: roleSelection.thinking, api: roleSelection.api },
|
|
368
|
+
tools: ['read', 'write', 'edit', 'bash'],
|
|
369
|
+
context: { mode: 'estimated_guard', estimator: 'lw-pi-final-json-bytes-v1', proofId: null, version: 1, evidence: 'estimated', workingWindowCeiling: 98304, maxRequestBytes: 65536, serviceMargin: 32768, toolReserve: 16384, maxOutputTokens: RUNNER_BUDGETS.perCallOutputTokens },
|
|
370
|
+
runtimeRef: 'runner-runtime',
|
|
371
|
+
providerCredentialRef: 'runner-provider-token',
|
|
372
|
+
mcp: { serverId: 'workspace', scriptDigest: runtime.localMcpScriptDigest, names: [], effects: [], idleTimeoutSeconds: 2, absoluteTimeoutSeconds: 10 },
|
|
373
|
+
}],
|
|
374
|
+
resources: [],
|
|
375
|
+
runtimeProfiles: [{
|
|
376
|
+
id: 'runner-runtime',
|
|
377
|
+
dockerExecutable: runtimeOptions.dockerExecutable,
|
|
378
|
+
dockerSocket: runtimeOptions.dockerSocket,
|
|
379
|
+
identity: { sdkIntegrity: runtime.sdkIntegrity, graphDigest: runtime.graphDigest, imageDigest: runtimeOptions.imageDigest, configDigest: runtime.configDigest, profile: runtimeOptions.profile },
|
|
380
|
+
}],
|
|
381
|
+
credentialBindings,
|
|
382
|
+
environmentBindings,
|
|
383
|
+
gateEndpoints: gateEndpoint !== undefined ? [{
|
|
384
|
+
id: gateEndpoint.id,
|
|
385
|
+
url: gateEndpoint.url,
|
|
386
|
+
signingCredentialRef: gateEndpoint.signingCredentialRef,
|
|
387
|
+
authCredentialRef: gateEndpoint.authCredentialRef ?? null,
|
|
388
|
+
timeoutMs: gateEndpoint.timeoutMs ?? 30000,
|
|
389
|
+
maxPollMs: gateEndpoint.maxPollMs ?? 120000,
|
|
390
|
+
pollInitialMs: gateEndpoint.pollInitialMs ?? 200,
|
|
391
|
+
pollMaxMs: gateEndpoint.pollMaxMs ?? 5000,
|
|
392
|
+
jitter: gateEndpoint.jitter ?? 100,
|
|
393
|
+
}] : [],
|
|
394
|
+
publicationEndpoints: publicationEndpoint === undefined ? [] : [{
|
|
395
|
+
id: publicationEndpoint.id,
|
|
396
|
+
url: publicationEndpoint.url,
|
|
397
|
+
signingCredentialRef: publicationEndpoint.signingCredentialRef,
|
|
398
|
+
authCredentialRef: publicationEndpoint.authCredentialRef ?? null,
|
|
399
|
+
timeoutMs: publicationEndpoint.timeoutMs ?? 30000,
|
|
400
|
+
}],
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
const registryBytes = Buffer.from(JSON.stringify(registry));
|
|
404
|
+
const registrySha256 = createHash('sha256').update(registryBytes).digest('hex');
|
|
405
|
+
const checkIds = activeChecks.map(check => check.id);
|
|
406
|
+
const credentials = credentialBindings.map(binding => ({ ref: binding.id, template: binding.template }));
|
|
407
|
+
const candidateLocalIds = candidateLocalChecks.map(check => check.id);
|
|
408
|
+
const candidateSteps = [
|
|
409
|
+
{ id: 'author-candidate', kind: 'agent', uses: 'runner-author', roleId: 'author', dependsOn: [] },
|
|
410
|
+
...candidateLocalChecks.map(check => ({ id: check.id, kind: 'check', uses: check.id, roleId: null, dependsOn: ['author-candidate'] })),
|
|
411
|
+
...(gateEndpoint !== undefined
|
|
412
|
+
? [{ id: 'runner-candidate-validation', kind: 'check', uses: 'runner-candidate-validation', roleId: null, dependsOn: ['author-candidate', ...candidateLocalIds] }]
|
|
413
|
+
: []),
|
|
414
|
+
];
|
|
415
|
+
const noChangeSteps = [
|
|
416
|
+
{ id: 'author-assessment', kind: 'agent', uses: 'runner-author', roleId: 'author', dependsOn: [] },
|
|
417
|
+
{ id: 'runner-no-change', kind: 'check', uses: 'runner-no-change', roleId: null, dependsOn: ['author-assessment'] },
|
|
418
|
+
];
|
|
419
|
+
const steps = options.mode === 'candidate' ? candidateSteps : noChangeSteps;
|
|
420
|
+
const task = {
|
|
421
|
+
apiVersion: 'loopwright.dev/v1alpha1',
|
|
422
|
+
kind: 'TaskContract',
|
|
423
|
+
spec: {
|
|
424
|
+
goal: options.mode === 'candidate'
|
|
425
|
+
? (proposalConfig === null
|
|
426
|
+
? 'Assess upstream updates, assemble the candidate patch, and pass configured verification checks.'
|
|
427
|
+
: 'Assess upstream updates, assemble the candidate patch and proposal document, and pass external candidate validation so the managed publication boundary can publish it.')
|
|
428
|
+
: 'Confirm the frozen snapshot needs no change and settle the run as no change without any publication effect.',
|
|
429
|
+
taskpack: 'runner-auto-sync',
|
|
430
|
+
target: { repository: options.repository, baseRevision: options.baseRevision, sourceRevision: options.sourceRevision, matrix: options.targetMatrix ?? null },
|
|
431
|
+
scope: { writable: [...writablePatterns], protected: [...protectedPatterns] },
|
|
432
|
+
roles: [{ id: 'author', adapter: 'pi', provider: roleSelection.provider, model: roleSelection.model, thinking: roleSelection.thinking, tools: ['read', 'write', 'edit', 'bash'] }],
|
|
433
|
+
trustedContext: { revision: resourceVersion, discovery: 'disabled', resources: [] },
|
|
434
|
+
budgets: {
|
|
435
|
+
wallTimeMs: RUNNER_BUDGETS.wallTimeMs,
|
|
436
|
+
totalTokens: RUNNER_BUDGETS.totalTokens,
|
|
437
|
+
perCallOutputTokens: RUNNER_BUDGETS.perCallOutputTokens,
|
|
438
|
+
maxModelCalls: RUNNER_BUDGETS.maxModelCalls,
|
|
439
|
+
maxConcurrency: RUNNER_BUDGETS.maxConcurrency,
|
|
440
|
+
maxFormatRepairs: RUNNER_BUDGETS.maxFormatRepairs,
|
|
441
|
+
maxImplementationRepairs: RUNNER_BUDGETS.maxImplementationRepairs,
|
|
442
|
+
maxTransportRetries: RUNNER_BUDGETS.maxTransportRetries,
|
|
443
|
+
enforcement: { wallTime: 'hard_admission', tokens: 'soft_accounting', modelCalls: 'hard_admission', concurrency: 'hard_admission', formatRepairs: 'hard_admission', implementationRepairs: 'hard_admission', transportRetries: 'hard_admission' },
|
|
444
|
+
...(overlayLimits !== undefined ? { overlay: overlayLimits } : {}),
|
|
445
|
+
},
|
|
446
|
+
steps,
|
|
447
|
+
acceptance: {
|
|
448
|
+
required: [...checkIds],
|
|
449
|
+
checks: activeChecks.map(check => ({ id: check.id, allowedEvidenceLevels: check.allowedEvidenceLevels })),
|
|
450
|
+
},
|
|
451
|
+
},
|
|
452
|
+
};
|
|
453
|
+
const validated = validateDocument(task, 'TaskContract');
|
|
454
|
+
if (!validated.ok)
|
|
455
|
+
throw new RunnerTaskpackError('CONFIG_INVALID', `compiled task contract failed validation: ${JSON.stringify(validated.errors).slice(0, 256)}`);
|
|
456
|
+
const config = {
|
|
457
|
+
apiVersion: 'loopwright.dev/v1alpha1',
|
|
458
|
+
kind: 'ControllerConfig',
|
|
459
|
+
spec: {
|
|
460
|
+
task: validated.value,
|
|
461
|
+
registry: { name: registryId, digest: digestOf(registryBytes) },
|
|
462
|
+
profiles: {
|
|
463
|
+
roles: [{ roleId: 'author', profileRef: 'runner-author-role' }],
|
|
464
|
+
steps: steps.map(step => ({ stepId: step.id, handlerRef: step.uses })),
|
|
465
|
+
},
|
|
466
|
+
credentials,
|
|
467
|
+
controls: { drainReserveMs: 120000, maxAttempts: 3, repeatFailureLimit: 2, submission: { mode: 'artifact_or_assistant', path: options.submission?.path ?? null } },
|
|
468
|
+
publication: publicationEnabled
|
|
469
|
+
? { mode: 'pull_request', endpointRef: publicationEndpoint.id, targetBranch: options.targetBranch ?? 'main', headBranchPrefix: options.headBranchPrefix ?? 'loopwright-runner-', titleTemplate: options.titleTemplate ?? 'runner: sync upstream runtime support' }
|
|
470
|
+
: { mode: 'disabled' },
|
|
471
|
+
},
|
|
472
|
+
};
|
|
473
|
+
return { registry, config, registrySha256, registryBytes };
|
|
474
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FrozenCorpusVerification } from './types.js';
|
|
2
|
+
/** Locate the vendored corpus next to this module in dist, or under the workspace layout when running compiled tests. */
|
|
3
|
+
export declare function defaultCorpusRoot(): string | null;
|
|
4
|
+
/**
|
|
5
|
+
* Verify the vendored frozen corpus bit-for-bit against its committed manifest before any Python helper runs.
|
|
6
|
+
* With no explicit root, the corpus is located relative to this module and then the workspace layout.
|
|
7
|
+
*/
|
|
8
|
+
export declare function verifyFrozenCorpus(corpusRoot?: string): Promise<FrozenCorpusVerification>;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { createHash, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
import { constants as fsConstants, lstatSync } from 'node:fs';
|
|
3
|
+
import { lstat, readdir, readFile } from 'node:fs/promises';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { RunnerTaskpackError } from './types.js';
|
|
7
|
+
const MAX_MANIFEST_BYTES = 262144;
|
|
8
|
+
/** Locate the vendored corpus next to this module in dist, or under the workspace layout when running compiled tests. */
|
|
9
|
+
export function defaultCorpusRoot() {
|
|
10
|
+
let directory = dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
for (;;) {
|
|
12
|
+
for (const candidate of [join(directory, 'vendor', 'runner-auto-sync'), join(directory, 'packages', 'taskpack-runner', 'vendor', 'runner-auto-sync')]) {
|
|
13
|
+
try {
|
|
14
|
+
lstatSync(join(candidate, 'manifest.json'));
|
|
15
|
+
return candidate;
|
|
16
|
+
}
|
|
17
|
+
catch { /* probe the next ancestor. */ }
|
|
18
|
+
}
|
|
19
|
+
const parent = dirname(directory);
|
|
20
|
+
if (parent === directory)
|
|
21
|
+
return null;
|
|
22
|
+
directory = parent;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Strict typed parse of the committed manifest document; malformed inventory is unavailable, not trusted. */
|
|
26
|
+
function parseManifest(bytes) {
|
|
27
|
+
let raw;
|
|
28
|
+
try {
|
|
29
|
+
raw = JSON.parse(bytes.toString('utf8'));
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
throw new RunnerTaskpackError('CORPUS_UNAVAILABLE', 'manifest.json is not valid JSON', 'manifest.json');
|
|
33
|
+
}
|
|
34
|
+
if (raw === null || typeof raw !== 'object' || Array.isArray(raw))
|
|
35
|
+
throw new RunnerTaskpackError('CORPUS_UNAVAILABLE', 'manifest.json is not an object', 'manifest.json');
|
|
36
|
+
const value = raw;
|
|
37
|
+
if (value.version !== 1 || typeof value.sourceRepository !== 'string' || typeof value.sourceRevision !== 'string'
|
|
38
|
+
|| !Array.isArray(value.files) || value.files.length === 0)
|
|
39
|
+
throw new RunnerTaskpackError('CORPUS_UNAVAILABLE', 'manifest.json has invalid header fields', 'manifest.json');
|
|
40
|
+
const seen = new Set();
|
|
41
|
+
const files = value.files.map((item) => {
|
|
42
|
+
if (item === null || typeof item !== 'object' || Array.isArray(item))
|
|
43
|
+
throw new RunnerTaskpackError('CORPUS_UNAVAILABLE', 'manifest entry is not an object', 'manifest.json');
|
|
44
|
+
const entry = item;
|
|
45
|
+
const path = entry.path, sha256 = entry.sha256, entryBytes = entry.bytes, executable = entry.executable;
|
|
46
|
+
if (typeof path !== 'string' || path.length === 0 || path.startsWith('/') || path.split('/').includes('..')
|
|
47
|
+
|| typeof sha256 !== 'string' || !/^[0-9a-f]{64}$/.test(sha256)
|
|
48
|
+
|| typeof entryBytes !== 'number' || !Number.isSafeInteger(entryBytes) || entryBytes < 0
|
|
49
|
+
|| typeof executable !== 'boolean')
|
|
50
|
+
throw new RunnerTaskpackError('CORPUS_UNAVAILABLE', 'manifest entry has invalid fields', typeof path === 'string' ? path : 'manifest.json');
|
|
51
|
+
if (seen.has(path))
|
|
52
|
+
throw new RunnerTaskpackError('CORPUS_UNAVAILABLE', 'manifest lists a path twice', path);
|
|
53
|
+
seen.add(path);
|
|
54
|
+
return { path, sha256, bytes: entryBytes, executable };
|
|
55
|
+
});
|
|
56
|
+
return { version: 1, sourceRepository: value.sourceRepository, sourceRevision: value.sourceRevision, files };
|
|
57
|
+
}
|
|
58
|
+
function sameDigest(expectedHex, observedHex) {
|
|
59
|
+
return expectedHex.length === observedHex.length && timingSafeEqual(Buffer.from(expectedHex, 'hex'), Buffer.from(observedHex, 'hex'));
|
|
60
|
+
}
|
|
61
|
+
/** Every file, symlink, or directory anywhere under the corpus root must be manifest-listed (or the manifest itself). */
|
|
62
|
+
async function scanExtraEntries(root, listed, allowedDirectories) {
|
|
63
|
+
const visit = async (relative) => {
|
|
64
|
+
const entries = await readdir(join(root, relative), { withFileTypes: true });
|
|
65
|
+
for (const entry of entries) {
|
|
66
|
+
const path = relative === '' ? entry.name : relative + '/' + entry.name;
|
|
67
|
+
if (entry.isDirectory()) {
|
|
68
|
+
if (!allowedDirectories.has(path))
|
|
69
|
+
throw new RunnerTaskpackError('CORPUS_TAMPERED', 'unlisted directory under the frozen corpus', path);
|
|
70
|
+
await visit(path);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (entry.name === 'manifest.json' && relative === '')
|
|
74
|
+
continue;
|
|
75
|
+
if (entry.isSymbolicLink())
|
|
76
|
+
throw new RunnerTaskpackError('CORPUS_TAMPERED', 'symlink present under the frozen corpus', path);
|
|
77
|
+
if (!listed.has(path))
|
|
78
|
+
throw new RunnerTaskpackError('CORPUS_TAMPERED', 'unlisted file under the frozen corpus', path);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
await visit('');
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Verify the vendored frozen corpus bit-for-bit against its committed manifest before any Python helper runs.
|
|
85
|
+
* With no explicit root, the corpus is located relative to this module and then the workspace layout.
|
|
86
|
+
*/
|
|
87
|
+
export async function verifyFrozenCorpus(corpusRoot) {
|
|
88
|
+
const root = corpusRoot !== undefined ? corpusRoot : defaultCorpusRoot();
|
|
89
|
+
if (root === undefined || root === null)
|
|
90
|
+
throw new RunnerTaskpackError('CORPUS_UNAVAILABLE', 'vendored frozen corpus directory is absent');
|
|
91
|
+
let manifestBytes;
|
|
92
|
+
try {
|
|
93
|
+
manifestBytes = await readFile(join(root, 'manifest.json'));
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
throw new RunnerTaskpackError('CORPUS_UNAVAILABLE', 'manifest.json cannot be read', 'manifest.json');
|
|
97
|
+
}
|
|
98
|
+
if (manifestBytes.byteLength > MAX_MANIFEST_BYTES)
|
|
99
|
+
throw new RunnerTaskpackError('CORPUS_UNAVAILABLE', 'manifest.json exceeds the bounded size', 'manifest.json');
|
|
100
|
+
const manifest = parseManifest(manifestBytes);
|
|
101
|
+
const corpusDigest = createHash('sha256').update(manifestBytes).digest('hex');
|
|
102
|
+
const listed = new Set(manifest.files.map(entry => entry.path));
|
|
103
|
+
const allowedDirectories = new Set();
|
|
104
|
+
for (const entry of manifest.files) {
|
|
105
|
+
const segments = entry.path.split('/');
|
|
106
|
+
for (let depth = 1; depth < segments.length; depth++)
|
|
107
|
+
allowedDirectories.add(segments.slice(0, depth).join('/'));
|
|
108
|
+
}
|
|
109
|
+
for (const entry of manifest.files) {
|
|
110
|
+
let stats;
|
|
111
|
+
try {
|
|
112
|
+
stats = await lstat(join(root, entry.path));
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
throw new RunnerTaskpackError('CORPUS_TAMPERED', 'manifest-listed file is missing', entry.path);
|
|
116
|
+
}
|
|
117
|
+
if (stats.isSymbolicLink() || !stats.isFile())
|
|
118
|
+
throw new RunnerTaskpackError('CORPUS_TAMPERED', 'manifest-listed file is a symlink or special file', entry.path);
|
|
119
|
+
if (stats.size !== entry.bytes)
|
|
120
|
+
throw new RunnerTaskpackError('CORPUS_TAMPERED', 'file byte length differs from the pinned manifest', entry.path);
|
|
121
|
+
const observed = createHash('sha256').update(await readFile(join(root, entry.path))).digest('hex');
|
|
122
|
+
if (!sameDigest(entry.sha256, observed))
|
|
123
|
+
throw new RunnerTaskpackError('CORPUS_TAMPERED', 'file digest differs from the pinned manifest', entry.path);
|
|
124
|
+
if (entry.executable && (stats.mode & fsConstants.S_IXUSR) === 0)
|
|
125
|
+
throw new RunnerTaskpackError('CORPUS_TAMPERED', 'executable bit is missing from a pinned script', entry.path);
|
|
126
|
+
}
|
|
127
|
+
await scanExtraEntries(root, listed, allowedDirectories);
|
|
128
|
+
return { root, manifest, fileCount: manifest.files.length, corpusDigest };
|
|
129
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { defaultCorpusRoot, verifyFrozenCorpus } from './corpus.js';
|
|
2
|
+
export { RUNNER_DISCOVERY_TABLES, RUNNER_PARITY_SCENARIOS, buildParityFixtureRepository, buildParityReport, corpusDigestOf, deterministicFakeAdapter, legacyCase, normalizeLegacyStatus, runLegacyScenario, runRunnerParitySuite, } from './parity.js';
|
|
3
|
+
export type { FakeAdapterAttempt, FakeAdapterPlan, LegacyScenarioContext, LegacyScenarioOutcome, RunnerParityCaseResult, RunnerParityReport, RunnerParityScenario, } from './parity.js';
|
|
4
|
+
export { startRunnerTaskpackService, computeRunnerCandidateDigest } from './service.js';
|
|
5
|
+
export type { ComputeRunnerCandidateDigestOptions, GateVerdictMetadata, OperatorReceiptInput, RunnerCandidateIdentity, RunnerCandidateRegistration, RunnerTaskpackService, RunnerTaskpackServiceOptions, } from './service.js';
|
|
6
|
+
export { RUNNER_ALWAYS_PROTECTED_PATHS, RUNNER_BUDGETS, RUNNER_PROPOSAL_PATH, RUNNER_PROPOSAL_REQUIRED_FIELDS, RUNNER_PROTECTED_PATHS, RUNNER_WORKFLOW_PROTECTED_PATH, RUNNER_WRITABLE_PATHS, compileRunnerTaskpack, } from './compile-taskpack.js';
|
|
7
|
+
export type { CompileRunnerTaskpackOptions, CompiledRunnerTaskpack, RunnerExecutionOptions, RunnerGateEndpointPlan, RunnerHostPolicy, RunnerLocalCheckPlan, RunnerProposalOptions, RunnerPublicationEndpointPlan, RunnerScopeOptions, } from './compile-taskpack.js';
|
|
8
|
+
export { AUTHORIZED_ASSOCIATIONS, GUIDANCE_CONTRACT_PREFIXES, GUIDANCE_MAX_BYTES, GUIDANCE_MAX_LINES, GUIDANCE_SENTINEL, JOB_LOG_LIMIT, PACK_RUN_URL_PATTERN, authorizeCommenter, boundJobLog, parsePackRunUrl, prepareRunnerIntake, validateGuidance, } from './intake.js';
|
|
9
|
+
export type { DiscoverIntakeInput, DiscoveryTables, PackRunUrlIntakeInput, ReviseIntakeInput, RunnerDiscoveryResult, RunnerIdentitySnapshot, RunnerIntakeInput, RunnerIntakeOutcome, RunnerPackRunDiagnostic, RunnerReviseBinding, UpstreamAcquisition, } from './intake.js';
|
|
10
|
+
export { DEFAULT_PATH_ALLOWLIST, DEFAULT_TIMEOUT_MS, FROZEN_MODULES, FROZEN_SUITE_TIMEOUT_MS, MAX_STREAM_BYTES, PythonBridge, SITE_GUARD_CODE, } from './python-bridge.js';
|
|
11
|
+
export type { FrozenUnitCheckResult, PythonBridgeOptions, PythonPreflight, PythonRunOptions, PythonRunResult, PythonSandboxOptions, } from './python-bridge.js';
|
|
12
|
+
export { RunnerTaskpackError } from './types.js';
|
|
13
|
+
export type * from './types.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { defaultCorpusRoot, verifyFrozenCorpus } from './corpus.js';
|
|
2
|
+
export { RUNNER_DISCOVERY_TABLES, RUNNER_PARITY_SCENARIOS, buildParityFixtureRepository, buildParityReport, corpusDigestOf, deterministicFakeAdapter, legacyCase, normalizeLegacyStatus, runLegacyScenario, runRunnerParitySuite, } from './parity.js';
|
|
3
|
+
export { startRunnerTaskpackService, computeRunnerCandidateDigest } from './service.js';
|
|
4
|
+
export { RUNNER_ALWAYS_PROTECTED_PATHS, RUNNER_BUDGETS, RUNNER_PROPOSAL_PATH, RUNNER_PROPOSAL_REQUIRED_FIELDS, RUNNER_PROTECTED_PATHS, RUNNER_WORKFLOW_PROTECTED_PATH, RUNNER_WRITABLE_PATHS, compileRunnerTaskpack, } from './compile-taskpack.js';
|
|
5
|
+
export { AUTHORIZED_ASSOCIATIONS, GUIDANCE_CONTRACT_PREFIXES, GUIDANCE_MAX_BYTES, GUIDANCE_MAX_LINES, GUIDANCE_SENTINEL, JOB_LOG_LIMIT, PACK_RUN_URL_PATTERN, authorizeCommenter, boundJobLog, parsePackRunUrl, prepareRunnerIntake, validateGuidance, } from './intake.js';
|
|
6
|
+
export { DEFAULT_PATH_ALLOWLIST, DEFAULT_TIMEOUT_MS, FROZEN_MODULES, FROZEN_SUITE_TIMEOUT_MS, MAX_STREAM_BYTES, PythonBridge, SITE_GUARD_CODE, } from './python-bridge.js';
|
|
7
|
+
export { RunnerTaskpackError } from './types.js';
|