@oscharko-dev/keiko 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +7 -0
- package/README.md +621 -0
- package/TRADEMARKS.md +41 -0
- package/dist/audit/aggregate.d.ts +5 -0
- package/dist/audit/aggregate.js +25 -0
- package/dist/audit/build.d.ts +2 -0
- package/dist/audit/build.js +224 -0
- package/dist/audit/errors.d.ts +25 -0
- package/dist/audit/errors.js +39 -0
- package/dist/audit/index-api.d.ts +14 -0
- package/dist/audit/index-api.js +131 -0
- package/dist/audit/index.d.ts +12 -0
- package/dist/audit/index.js +17 -0
- package/dist/audit/persist.d.ts +8 -0
- package/dist/audit/persist.js +40 -0
- package/dist/audit/redaction.d.ts +3 -0
- package/dist/audit/redaction.js +61 -0
- package/dist/audit/report.d.ts +18 -0
- package/dist/audit/report.js +50 -0
- package/dist/audit/retention.d.ts +3 -0
- package/dist/audit/retention.js +95 -0
- package/dist/audit/runid.d.ts +1 -0
- package/dist/audit/runid.js +29 -0
- package/dist/audit/side-file.d.ts +12 -0
- package/dist/audit/side-file.js +82 -0
- package/dist/audit/store.d.ts +12 -0
- package/dist/audit/store.js +198 -0
- package/dist/audit/types.d.ts +188 -0
- package/dist/audit/types.js +8 -0
- package/dist/audit/workflow-evidence.d.ts +27 -0
- package/dist/audit/workflow-evidence.js +145 -0
- package/dist/cli/context.d.ts +2 -0
- package/dist/cli/context.js +102 -0
- package/dist/cli/evaluate.d.ts +7 -0
- package/dist/cli/evaluate.js +207 -0
- package/dist/cli/evidence.d.ts +8 -0
- package/dist/cli/evidence.js +88 -0
- package/dist/cli/gateway-config.d.ts +10 -0
- package/dist/cli/gateway-config.js +12 -0
- package/dist/cli/gen-tests.d.ts +7 -0
- package/dist/cli/gen-tests.js +208 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +14 -0
- package/dist/cli/investigate.d.ts +8 -0
- package/dist/cli/investigate.js +242 -0
- package/dist/cli/models.d.ts +3 -0
- package/dist/cli/models.js +64 -0
- package/dist/cli/run.d.ts +7 -0
- package/dist/cli/run.js +187 -0
- package/dist/cli/runner.d.ts +6 -0
- package/dist/cli/runner.js +83 -0
- package/dist/cli/ui.d.ts +31 -0
- package/dist/cli/ui.js +240 -0
- package/dist/cli/verify.d.ts +2 -0
- package/dist/cli/verify.js +103 -0
- package/dist/evaluations/fixtures/bug-investigation/happy-path.d.ts +2 -0
- package/dist/evaluations/fixtures/bug-investigation/happy-path.js +66 -0
- package/dist/evaluations/fixtures/bug-investigation/investigation-only.d.ts +2 -0
- package/dist/evaluations/fixtures/bug-investigation/investigation-only.js +39 -0
- package/dist/evaluations/fixtures/bug-investigation/unsafe-action.d.ts +2 -0
- package/dist/evaluations/fixtures/bug-investigation/unsafe-action.js +37 -0
- package/dist/evaluations/fixtures/index.d.ts +7 -0
- package/dist/evaluations/fixtures/index.js +35 -0
- package/dist/evaluations/fixtures/support.d.ts +5 -0
- package/dist/evaluations/fixtures/support.js +42 -0
- package/dist/evaluations/fixtures/unit-tests/happy-path.d.ts +2 -0
- package/dist/evaluations/fixtures/unit-tests/happy-path.js +40 -0
- package/dist/evaluations/fixtures/unit-tests/retry-then-accept.d.ts +2 -0
- package/dist/evaluations/fixtures/unit-tests/retry-then-accept.js +39 -0
- package/dist/evaluations/fixtures/unit-tests/unsafe-action.d.ts +2 -0
- package/dist/evaluations/fixtures/unit-tests/unsafe-action.js +32 -0
- package/dist/evaluations/index.d.ts +12 -0
- package/dist/evaluations/index.js +12 -0
- package/dist/evaluations/manifest-check.d.ts +1 -0
- package/dist/evaluations/manifest-check.js +48 -0
- package/dist/evaluations/model-provider.d.ts +12 -0
- package/dist/evaluations/model-provider.js +26 -0
- package/dist/evaluations/render.d.ts +2 -0
- package/dist/evaluations/render.js +59 -0
- package/dist/evaluations/runner-support.d.ts +27 -0
- package/dist/evaluations/runner-support.js +163 -0
- package/dist/evaluations/runner.d.ts +20 -0
- package/dist/evaluations/runner.js +174 -0
- package/dist/evaluations/scorer.d.ts +14 -0
- package/dist/evaluations/scorer.js +131 -0
- package/dist/evaluations/scripted-model.d.ts +6 -0
- package/dist/evaluations/scripted-model.js +26 -0
- package/dist/evaluations/surface-parity.d.ts +2 -0
- package/dist/evaluations/surface-parity.js +184 -0
- package/dist/evaluations/types.d.ts +74 -0
- package/dist/evaluations/types.js +16 -0
- package/dist/gateway/capabilities.d.ts +11 -0
- package/dist/gateway/capabilities.data.d.ts +2 -0
- package/dist/gateway/capabilities.data.js +203 -0
- package/dist/gateway/capabilities.js +41 -0
- package/dist/gateway/config.d.ts +15 -0
- package/dist/gateway/config.js +154 -0
- package/dist/gateway/errors.d.ts +72 -0
- package/dist/gateway/errors.js +82 -0
- package/dist/gateway/gateway.d.ts +19 -0
- package/dist/gateway/gateway.js +94 -0
- package/dist/gateway/index.d.ts +10 -0
- package/dist/gateway/index.js +11 -0
- package/dist/gateway/model-selection.d.ts +9 -0
- package/dist/gateway/model-selection.js +36 -0
- package/dist/gateway/normalize.d.ts +7 -0
- package/dist/gateway/normalize.js +93 -0
- package/dist/gateway/openai-adapter.d.ts +20 -0
- package/dist/gateway/openai-adapter.js +263 -0
- package/dist/gateway/redaction.d.ts +1 -0
- package/dist/gateway/redaction.js +51 -0
- package/dist/gateway/resilience.d.ts +24 -0
- package/dist/gateway/resilience.js +166 -0
- package/dist/gateway/types.d.ts +108 -0
- package/dist/gateway/types.js +2 -0
- package/dist/harness/adapters.d.ts +23 -0
- package/dist/harness/adapters.js +38 -0
- package/dist/harness/context.d.ts +33 -0
- package/dist/harness/context.js +21 -0
- package/dist/harness/emitter.d.ts +15 -0
- package/dist/harness/emitter.js +72 -0
- package/dist/harness/errors.d.ts +21 -0
- package/dist/harness/errors.js +39 -0
- package/dist/harness/executor.d.ts +3 -0
- package/dist/harness/executor.js +211 -0
- package/dist/harness/fingerprint.d.ts +6 -0
- package/dist/harness/fingerprint.js +43 -0
- package/dist/harness/index.d.ts +9 -0
- package/dist/harness/index.js +13 -0
- package/dist/harness/loop.d.ts +3 -0
- package/dist/harness/loop.js +159 -0
- package/dist/harness/patcher.d.ts +4 -0
- package/dist/harness/patcher.js +49 -0
- package/dist/harness/planner.d.ts +3 -0
- package/dist/harness/planner.js +21 -0
- package/dist/harness/ports.d.ts +61 -0
- package/dist/harness/ports.js +4 -0
- package/dist/harness/session.d.ts +25 -0
- package/dist/harness/session.js +116 -0
- package/dist/harness/sinks.d.ts +30 -0
- package/dist/harness/sinks.js +72 -0
- package/dist/harness/tasks/explain-plan.d.ts +3 -0
- package/dist/harness/tasks/explain-plan.js +29 -0
- package/dist/harness/tasks/generate-unit-tests.d.ts +3 -0
- package/dist/harness/tasks/generate-unit-tests.js +28 -0
- package/dist/harness/tasks/investigate-bug.d.ts +3 -0
- package/dist/harness/tasks/investigate-bug.js +31 -0
- package/dist/harness/tasks/policy.d.ts +11 -0
- package/dist/harness/tasks/policy.js +22 -0
- package/dist/harness/tasks/verify.d.ts +3 -0
- package/dist/harness/tasks/verify.js +16 -0
- package/dist/harness/types.d.ts +270 -0
- package/dist/harness/types.js +33 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +36 -0
- package/dist/sdk/index.d.ts +9 -0
- package/dist/sdk/index.js +37 -0
- package/dist/sdk/run-agent.d.ts +16 -0
- package/dist/sdk/run-agent.js +56 -0
- package/dist/tools/browser/cdp-client.d.ts +35 -0
- package/dist/tools/browser/cdp-client.js +218 -0
- package/dist/tools/browser/errors.d.ts +25 -0
- package/dist/tools/browser/errors.js +55 -0
- package/dist/tools/browser/index.d.ts +5 -0
- package/dist/tools/browser/index.js +6 -0
- package/dist/tools/browser/session.d.ts +44 -0
- package/dist/tools/browser/session.js +748 -0
- package/dist/tools/browser/types.d.ts +48 -0
- package/dist/tools/browser/types.js +2 -0
- package/dist/tools/browser/validators.d.ts +5 -0
- package/dist/tools/browser/validators.js +97 -0
- package/dist/tools/errors.d.ts +59 -0
- package/dist/tools/errors.js +94 -0
- package/dist/tools/exec.d.ts +42 -0
- package/dist/tools/exec.js +327 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.js +14 -0
- package/dist/tools/patch-content.d.ts +10 -0
- package/dist/tools/patch-content.js +126 -0
- package/dist/tools/patch-normalize.d.ts +1 -0
- package/dist/tools/patch-normalize.js +80 -0
- package/dist/tools/patch-parse.d.ts +8 -0
- package/dist/tools/patch-parse.js +201 -0
- package/dist/tools/patch.d.ts +18 -0
- package/dist/tools/patch.js +403 -0
- package/dist/tools/registry.d.ts +36 -0
- package/dist/tools/registry.js +231 -0
- package/dist/tools/sandbox.d.ts +8 -0
- package/dist/tools/sandbox.js +121 -0
- package/dist/tools/schemas.d.ts +2 -0
- package/dist/tools/schemas.js +51 -0
- package/dist/tools/terminal-policy.d.ts +9 -0
- package/dist/tools/terminal-policy.js +313 -0
- package/dist/tools/types.d.ts +99 -0
- package/dist/tools/types.js +103 -0
- package/dist/tools/writer.d.ts +7 -0
- package/dist/tools/writer.js +20 -0
- package/dist/ui/browser.d.ts +10 -0
- package/dist/ui/browser.js +231 -0
- package/dist/ui/chat-handlers.d.ts +4 -0
- package/dist/ui/chat-handlers.js +281 -0
- package/dist/ui/csp-hashes.json +17 -0
- package/dist/ui/csp.d.ts +2 -0
- package/dist/ui/csp.js +66 -0
- package/dist/ui/deps.d.ts +34 -0
- package/dist/ui/deps.js +137 -0
- package/dist/ui/evidence.d.ts +27 -0
- package/dist/ui/evidence.js +142 -0
- package/dist/ui/files-deny.d.ts +2 -0
- package/dist/ui/files-deny.js +12 -0
- package/dist/ui/files.d.ts +65 -0
- package/dist/ui/files.js +492 -0
- package/dist/ui/headers.d.ts +2 -0
- package/dist/ui/headers.js +21 -0
- package/dist/ui/host-check.d.ts +2 -0
- package/dist/ui/host-check.js +58 -0
- package/dist/ui/index.d.ts +20 -0
- package/dist/ui/index.js +23 -0
- package/dist/ui/load-csp.d.ts +1 -0
- package/dist/ui/load-csp.js +28 -0
- package/dist/ui/read-handlers.d.ts +8 -0
- package/dist/ui/read-handlers.js +247 -0
- package/dist/ui/routes.d.ts +36 -0
- package/dist/ui/routes.js +129 -0
- package/dist/ui/run-engine.d.ts +20 -0
- package/dist/ui/run-engine.js +345 -0
- package/dist/ui/run-handlers.d.ts +8 -0
- package/dist/ui/run-handlers.js +431 -0
- package/dist/ui/run-request.d.ts +13 -0
- package/dist/ui/run-request.js +219 -0
- package/dist/ui/runs.d.ts +43 -0
- package/dist/ui/runs.js +92 -0
- package/dist/ui/server.d.ts +11 -0
- package/dist/ui/server.js +143 -0
- package/dist/ui/sink.d.ts +27 -0
- package/dist/ui/sink.js +80 -0
- package/dist/ui/sse.d.ts +7 -0
- package/dist/ui/sse.js +27 -0
- package/dist/ui/static/404.html +1 -0
- package/dist/ui/static/_next/static/ca-A01hy9W98aRvMZKdAw/_buildManifest.js +1 -0
- package/dist/ui/static/_next/static/ca-A01hy9W98aRvMZKdAw/_ssgManifest.js +1 -0
- package/dist/ui/static/_next/static/chunks/255-d47fd57964443afe.js +1 -0
- package/dist/ui/static/_next/static/chunks/4-be1fef693af8e088.js +1 -0
- package/dist/ui/static/_next/static/chunks/4bd1b696-c023c6e3521b1417.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/_not-found/page-75825b09bcecad97.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/launch/page-9c86a13c29884245.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/layout-bdea63fe87947d50.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/page-4168c12c68b7a853.js +1 -0
- package/dist/ui/static/_next/static/chunks/framework-a6e0b7e30f98059a.js +1 -0
- package/dist/ui/static/_next/static/chunks/main-778a50aebff02192.js +1 -0
- package/dist/ui/static/_next/static/chunks/main-app-30679af7240d63e9.js +1 -0
- package/dist/ui/static/_next/static/chunks/pages/_app-7d307437aca18ad4.js +1 -0
- package/dist/ui/static/_next/static/chunks/pages/_error-cb2a52f75f2162e2.js +1 -0
- package/dist/ui/static/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/ui/static/_next/static/chunks/webpack-4a462cecab786e93.js +1 -0
- package/dist/ui/static/_next/static/css/be7cb54d5c5673b6.css +1 -0
- package/dist/ui/static/assets/editors/goland.svg +35 -0
- package/dist/ui/static/assets/editors/intellij.svg +39 -0
- package/dist/ui/static/assets/editors/pycharm.svg +58 -0
- package/dist/ui/static/assets/editors/rustrover.svg +19 -0
- package/dist/ui/static/assets/editors/vscode.svg +1 -0
- package/dist/ui/static/assets/editors/webstorm.svg +21 -0
- package/dist/ui/static/assets/icons/anthropic.svg +1 -0
- package/dist/ui/static/assets/icons/brave.svg +1 -0
- package/dist/ui/static/assets/icons/css3.svg +1 -0
- package/dist/ui/static/assets/icons/docker.svg +1 -0
- package/dist/ui/static/assets/icons/git.svg +1 -0
- package/dist/ui/static/assets/icons/github.svg +1 -0
- package/dist/ui/static/assets/icons/go.svg +1 -0
- package/dist/ui/static/assets/icons/gradle.svg +1 -0
- package/dist/ui/static/assets/icons/grafana.svg +1 -0
- package/dist/ui/static/assets/icons/graphql.svg +1 -0
- package/dist/ui/static/assets/icons/html5.svg +1 -0
- package/dist/ui/static/assets/icons/image.svg +1 -0
- package/dist/ui/static/assets/icons/java.svg +1 -0
- package/dist/ui/static/assets/icons/javascript.svg +1 -0
- package/dist/ui/static/assets/icons/json.svg +1 -0
- package/dist/ui/static/assets/icons/kafka.svg +1 -0
- package/dist/ui/static/assets/icons/kubernetes.svg +1 -0
- package/dist/ui/static/assets/icons/linear.svg +1 -0
- package/dist/ui/static/assets/icons/markdown.svg +1 -0
- package/dist/ui/static/assets/icons/nginx.svg +1 -0
- package/dist/ui/static/assets/icons/nodejs.svg +1 -0
- package/dist/ui/static/assets/icons/notion.svg +1 -0
- package/dist/ui/static/assets/icons/openai.svg +1 -0
- package/dist/ui/static/assets/icons/playwright.svg +1 -0
- package/dist/ui/static/assets/icons/postgresql.svg +1 -0
- package/dist/ui/static/assets/icons/prometheus.svg +1 -0
- package/dist/ui/static/assets/icons/properties.svg +1 -0
- package/dist/ui/static/assets/icons/puppeteer.svg +1 -0
- package/dist/ui/static/assets/icons/python.svg +1 -0
- package/dist/ui/static/assets/icons/react.svg +1 -0
- package/dist/ui/static/assets/icons/redis.svg +1 -0
- package/dist/ui/static/assets/icons/rust.svg +1 -0
- package/dist/ui/static/assets/icons/sentry.svg +1 -0
- package/dist/ui/static/assets/icons/slack.svg +1 -0
- package/dist/ui/static/assets/icons/spring.svg +1 -0
- package/dist/ui/static/assets/icons/typescript.svg +1 -0
- package/dist/ui/static/assets/icons/upstash.svg +1 -0
- package/dist/ui/static/assets/icons/yaml.svg +1 -0
- package/dist/ui/static/assets/keiko-logo.svg +10 -0
- package/dist/ui/static/index.html +1 -0
- package/dist/ui/static/index.txt +19 -0
- package/dist/ui/static/keiko-logo.svg +10 -0
- package/dist/ui/static/launch.html +1 -0
- package/dist/ui/static/launch.txt +19 -0
- package/dist/ui/static.d.ts +3 -0
- package/dist/ui/static.js +72 -0
- package/dist/ui/store/chats.d.ts +14 -0
- package/dist/ui/store/chats.js +110 -0
- package/dist/ui/store/db.d.ts +6 -0
- package/dist/ui/store/db.js +182 -0
- package/dist/ui/store/errors.d.ts +12 -0
- package/dist/ui/store/errors.js +30 -0
- package/dist/ui/store/index.d.ts +6 -0
- package/dist/ui/store/index.js +6 -0
- package/dist/ui/store/messages.d.ts +5 -0
- package/dist/ui/store/messages.js +137 -0
- package/dist/ui/store/paths.d.ts +4 -0
- package/dist/ui/store/paths.js +69 -0
- package/dist/ui/store/projects.d.ts +7 -0
- package/dist/ui/store/projects.js +61 -0
- package/dist/ui/store/schema.d.ts +3 -0
- package/dist/ui/store/schema.js +77 -0
- package/dist/ui/store/types.d.ts +80 -0
- package/dist/ui/store/types.js +3 -0
- package/dist/ui/store/validation.d.ts +4 -0
- package/dist/ui/store/validation.js +72 -0
- package/dist/ui/store-handlers.d.ts +16 -0
- package/dist/ui/store-handlers.js +465 -0
- package/dist/ui/terminal-errors.d.ts +21 -0
- package/dist/ui/terminal-errors.js +45 -0
- package/dist/ui/terminal-evidence.d.ts +20 -0
- package/dist/ui/terminal-evidence.js +65 -0
- package/dist/ui/terminal-routes.d.ts +9 -0
- package/dist/ui/terminal-routes.js +219 -0
- package/dist/ui/terminal.d.ts +67 -0
- package/dist/ui/terminal.js +835 -0
- package/dist/verification/classify.d.ts +10 -0
- package/dist/verification/classify.js +53 -0
- package/dist/verification/detect.d.ts +4 -0
- package/dist/verification/detect.js +81 -0
- package/dist/verification/errors.d.ts +11 -0
- package/dist/verification/errors.js +21 -0
- package/dist/verification/index.d.ts +17 -0
- package/dist/verification/index.js +13 -0
- package/dist/verification/limits.d.ts +3 -0
- package/dist/verification/limits.js +40 -0
- package/dist/verification/monitor.d.ts +4 -0
- package/dist/verification/monitor.js +58 -0
- package/dist/verification/orchestrator.d.ts +16 -0
- package/dist/verification/orchestrator.js +363 -0
- package/dist/verification/plan.d.ts +9 -0
- package/dist/verification/plan.js +125 -0
- package/dist/verification/summary.d.ts +40 -0
- package/dist/verification/summary.js +67 -0
- package/dist/verification/types.d.ts +63 -0
- package/dist/verification/types.js +13 -0
- package/dist/workflows/bug-investigation/context.d.ts +7 -0
- package/dist/workflows/bug-investigation/context.js +119 -0
- package/dist/workflows/bug-investigation/descriptor.d.ts +3 -0
- package/dist/workflows/bug-investigation/descriptor.js +46 -0
- package/dist/workflows/bug-investigation/emit.d.ts +12 -0
- package/dist/workflows/bug-investigation/emit.js +35 -0
- package/dist/workflows/bug-investigation/events.d.ts +81 -0
- package/dist/workflows/bug-investigation/events.js +9 -0
- package/dist/workflows/bug-investigation/failure-parse.d.ts +3 -0
- package/dist/workflows/bug-investigation/failure-parse.js +154 -0
- package/dist/workflows/bug-investigation/guard.d.ts +2 -0
- package/dist/workflows/bug-investigation/guard.js +69 -0
- package/dist/workflows/bug-investigation/index.d.ts +7 -0
- package/dist/workflows/bug-investigation/index.js +13 -0
- package/dist/workflows/bug-investigation/internal.d.ts +37 -0
- package/dist/workflows/bug-investigation/internal.js +64 -0
- package/dist/workflows/bug-investigation/model-loop.d.ts +4 -0
- package/dist/workflows/bug-investigation/model-loop.js +223 -0
- package/dist/workflows/bug-investigation/parse.d.ts +3 -0
- package/dist/workflows/bug-investigation/parse.js +123 -0
- package/dist/workflows/bug-investigation/prompt.d.ts +4 -0
- package/dist/workflows/bug-investigation/prompt.js +107 -0
- package/dist/workflows/bug-investigation/report.d.ts +23 -0
- package/dist/workflows/bug-investigation/report.js +151 -0
- package/dist/workflows/bug-investigation/stages.d.ts +13 -0
- package/dist/workflows/bug-investigation/stages.js +242 -0
- package/dist/workflows/bug-investigation/types.d.ts +91 -0
- package/dist/workflows/bug-investigation/types.js +14 -0
- package/dist/workflows/bug-investigation/verify-stage.d.ts +10 -0
- package/dist/workflows/bug-investigation/verify-stage.js +91 -0
- package/dist/workflows/bug-investigation/workflow.d.ts +2 -0
- package/dist/workflows/bug-investigation/workflow.js +74 -0
- package/dist/workflows/descriptor.d.ts +20 -0
- package/dist/workflows/descriptor.js +8 -0
- package/dist/workflows/index.d.ts +3 -0
- package/dist/workflows/index.js +2 -0
- package/dist/workflows/unit-tests/context.d.ts +7 -0
- package/dist/workflows/unit-tests/context.js +129 -0
- package/dist/workflows/unit-tests/conventions.d.ts +4 -0
- package/dist/workflows/unit-tests/conventions.js +87 -0
- package/dist/workflows/unit-tests/descriptor.d.ts +4 -0
- package/dist/workflows/unit-tests/descriptor.js +43 -0
- package/dist/workflows/unit-tests/emit.d.ts +12 -0
- package/dist/workflows/unit-tests/emit.js +35 -0
- package/dist/workflows/unit-tests/events.d.ts +78 -0
- package/dist/workflows/unit-tests/events.js +7 -0
- package/dist/workflows/unit-tests/index.d.ts +6 -0
- package/dist/workflows/unit-tests/index.js +10 -0
- package/dist/workflows/unit-tests/internal.d.ts +35 -0
- package/dist/workflows/unit-tests/internal.js +43 -0
- package/dist/workflows/unit-tests/model-loop.d.ts +4 -0
- package/dist/workflows/unit-tests/model-loop.js +95 -0
- package/dist/workflows/unit-tests/parse.d.ts +6 -0
- package/dist/workflows/unit-tests/parse.js +68 -0
- package/dist/workflows/unit-tests/prompt.d.ts +4 -0
- package/dist/workflows/unit-tests/prompt.js +71 -0
- package/dist/workflows/unit-tests/report.d.ts +21 -0
- package/dist/workflows/unit-tests/report.js +90 -0
- package/dist/workflows/unit-tests/stages.d.ts +9 -0
- package/dist/workflows/unit-tests/stages.js +155 -0
- package/dist/workflows/unit-tests/types.d.ts +70 -0
- package/dist/workflows/unit-tests/types.js +11 -0
- package/dist/workflows/unit-tests/verify-stage.d.ts +9 -0
- package/dist/workflows/unit-tests/verify-stage.js +56 -0
- package/dist/workflows/unit-tests/workflow.d.ts +2 -0
- package/dist/workflows/unit-tests/workflow.js +58 -0
- package/dist/workspace/contextPack.d.ts +9 -0
- package/dist/workspace/contextPack.js +94 -0
- package/dist/workspace/detect.d.ts +3 -0
- package/dist/workspace/detect.js +135 -0
- package/dist/workspace/discovery.d.ts +9 -0
- package/dist/workspace/discovery.js +167 -0
- package/dist/workspace/errors.d.ts +39 -0
- package/dist/workspace/errors.js +66 -0
- package/dist/workspace/fs.d.ts +21 -0
- package/dist/workspace/fs.js +36 -0
- package/dist/workspace/ignore.d.ts +14 -0
- package/dist/workspace/ignore.js +176 -0
- package/dist/workspace/index.d.ts +11 -0
- package/dist/workspace/index.js +13 -0
- package/dist/workspace/paths.d.ts +2 -0
- package/dist/workspace/paths.js +38 -0
- package/dist/workspace/realpath.d.ts +7 -0
- package/dist/workspace/realpath.js +72 -0
- package/dist/workspace/retrieval.d.ts +9 -0
- package/dist/workspace/retrieval.js +74 -0
- package/dist/workspace/summary.d.ts +3 -0
- package/dist/workspace/summary.js +54 -0
- package/dist/workspace/types.d.ts +103 -0
- package/dist/workspace/types.js +27 -0
- package/package.json +58 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandResult } from "../tools/index.js";
|
|
2
|
+
import type { VerificationStatus } from "./types.js";
|
|
3
|
+
export type AbortReason = "harness" | "memory" | undefined;
|
|
4
|
+
export interface OutcomeInput {
|
|
5
|
+
readonly skipped: boolean;
|
|
6
|
+
readonly result: CommandResult | undefined;
|
|
7
|
+
readonly error: unknown;
|
|
8
|
+
readonly abortReason: AbortReason;
|
|
9
|
+
}
|
|
10
|
+
export declare function classifyOutcome(input: OutcomeInput): VerificationStatus;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// PURE outcome classification (ADR-0007 D1). The single authority mapping a settled runCommand
|
|
2
|
+
// outcome — a resolved CommandResult OR a rejection — plus the orchestrator's abortReason to a
|
|
3
|
+
// VerificationStatus. No IO, no spawn, no clock: the orchestrator owns all effects and calls this
|
|
4
|
+
// once per step. The precedence is fixed and the first match wins; each branch is independently
|
|
5
|
+
// unit-tested so a single-line mutation is caught.
|
|
6
|
+
import { CommandCancelledError, CommandDeniedError, CommandTimeoutError } from "../tools/index.js";
|
|
7
|
+
function classifyError(error, abortReason) {
|
|
8
|
+
if (error instanceof CommandDeniedError) {
|
|
9
|
+
return "denied";
|
|
10
|
+
}
|
|
11
|
+
if (abortReason === "memory") {
|
|
12
|
+
return "resource-exceeded";
|
|
13
|
+
}
|
|
14
|
+
if (abortReason === "harness") {
|
|
15
|
+
return "cancelled";
|
|
16
|
+
}
|
|
17
|
+
if (error instanceof CommandTimeoutError) {
|
|
18
|
+
return "timed-out";
|
|
19
|
+
}
|
|
20
|
+
if (error instanceof CommandCancelledError) {
|
|
21
|
+
// D1 branch 6's `memory → resource-exceeded` sub-case is handled earlier by branch 3
|
|
22
|
+
// (`abortReason === "memory"` returns before we reach here), so a CommandCancelledError that
|
|
23
|
+
// survives to this point is, by construction, a harness/plain cancellation.
|
|
24
|
+
return "cancelled";
|
|
25
|
+
}
|
|
26
|
+
return "failed";
|
|
27
|
+
}
|
|
28
|
+
function classifyResult(result) {
|
|
29
|
+
if (result.timedOut) {
|
|
30
|
+
return "timed-out";
|
|
31
|
+
}
|
|
32
|
+
if (result.truncated) {
|
|
33
|
+
return "resource-exceeded";
|
|
34
|
+
}
|
|
35
|
+
if (result.exitCode === 0) {
|
|
36
|
+
return "passed";
|
|
37
|
+
}
|
|
38
|
+
return "failed";
|
|
39
|
+
}
|
|
40
|
+
export function classifyOutcome(input) {
|
|
41
|
+
if (input.skipped) {
|
|
42
|
+
return "skipped";
|
|
43
|
+
}
|
|
44
|
+
if (input.error !== undefined) {
|
|
45
|
+
return classifyError(input.error, input.abortReason);
|
|
46
|
+
}
|
|
47
|
+
if (input.result !== undefined) {
|
|
48
|
+
return classifyResult(input.result);
|
|
49
|
+
}
|
|
50
|
+
// No result and no error is not a reachable runCommand settle state; treat as failed defensively
|
|
51
|
+
// at this internal boundary so the function is total over its input type.
|
|
52
|
+
return "failed";
|
|
53
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkspaceFs, WorkspaceInfo } from "../workspace/index.js";
|
|
2
|
+
import type { ScriptCatalog, ScriptMapping } from "./types.js";
|
|
3
|
+
export declare function classifyScripts(scripts: Readonly<Record<string, string>>): ScriptMapping;
|
|
4
|
+
export declare function detectScripts(workspace: WorkspaceInfo, fs?: WorkspaceFs): ScriptCatalog;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// npm-script detection and kind classification. Reads package.json through the workspace
|
|
2
|
+
// WorkspaceFs boundary (never raw node:fs), mirroring the parseScripts approach in
|
|
3
|
+
// src/tools/registry.ts but adding the kind-mapping layer the plan consumes.
|
|
4
|
+
//
|
|
5
|
+
// All name matching is done with plain substring/equality checks (no regex), so there is no
|
|
6
|
+
// ReDoS surface at all (CodeQL js/polynomial-redos). Script NAMES are matched, never values.
|
|
7
|
+
import { readWorkspaceFile } from "../workspace/index.js";
|
|
8
|
+
// package.json is small; this cap is generous and prevents reading a pathological file.
|
|
9
|
+
const PACKAGE_READ_BYTES = 262_144;
|
|
10
|
+
function parseScripts(text) {
|
|
11
|
+
let parsed;
|
|
12
|
+
try {
|
|
13
|
+
parsed = JSON.parse(text);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
// A malformed package.json yields no scripts rather than throwing: detection is best-effort
|
|
17
|
+
// and the plan will mark every kind skipped, which is a visible, testable outcome (D4).
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
const scripts = parsed.scripts;
|
|
24
|
+
if (typeof scripts !== "object" || scripts === null) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
const out = {};
|
|
28
|
+
for (const [name, value] of Object.entries(scripts)) {
|
|
29
|
+
if (typeof value === "string") {
|
|
30
|
+
out[name] = value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
// Returns the first script name whose lowercased name satisfies `match`, preferring an exact-name
|
|
36
|
+
// hit over a substring hit so `test` wins over `pretest`/`test:watch` for the test kind.
|
|
37
|
+
function pickScript(names, exact, contains) {
|
|
38
|
+
for (const name of names) {
|
|
39
|
+
if (exact.includes(name.toLowerCase())) {
|
|
40
|
+
return name;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
for (const name of names) {
|
|
44
|
+
const lower = name.toLowerCase();
|
|
45
|
+
if (contains.some((needle) => lower.includes(needle)) &&
|
|
46
|
+
!contains.some((needle) => isLifecycleWrapper(lower, needle))) {
|
|
47
|
+
return name;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
function isLifecycleWrapper(lowerName, needle) {
|
|
53
|
+
return (lowerName === `pre${needle}` ||
|
|
54
|
+
lowerName === `post${needle}` ||
|
|
55
|
+
lowerName.startsWith(`pre${needle}:`) ||
|
|
56
|
+
lowerName.startsWith(`post${needle}:`));
|
|
57
|
+
}
|
|
58
|
+
// Maps script names to verification kinds via conventional heuristics. Exact-name matches win;
|
|
59
|
+
// otherwise a substring of the lowercased name. `typecheck`/`type-check`/`tsc` → typecheck;
|
|
60
|
+
// `lint`/`eslint` → lint; `build` → build; `test` → test.
|
|
61
|
+
export function classifyScripts(scripts) {
|
|
62
|
+
const names = Object.keys(scripts);
|
|
63
|
+
return {
|
|
64
|
+
test: pickScript(names, ["test"], ["test"]),
|
|
65
|
+
typecheck: pickScript(names, ["typecheck", "type-check", "tsc"], ["typecheck", "type-check"]),
|
|
66
|
+
lint: pickScript(names, ["lint"], ["lint", "eslint"]),
|
|
67
|
+
build: pickScript(names, ["build"], ["build"]),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export function detectScripts(workspace, fs) {
|
|
71
|
+
let scripts;
|
|
72
|
+
try {
|
|
73
|
+
const content = readWorkspaceFile(workspace, "package.json", { maxBytes: PACKAGE_READ_BYTES }, fs);
|
|
74
|
+
scripts = parseScripts(content.text);
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// No package.json or an unreadable one: no scripts detected. The plan marks kinds skipped (D4).
|
|
78
|
+
scripts = {};
|
|
79
|
+
}
|
|
80
|
+
return { scripts, mapping: classifyScripts(scripts) };
|
|
81
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const VERIFICATION_CODES: {
|
|
2
|
+
readonly PLAN_EMPTY: "VERIFICATION_PLAN_EMPTY";
|
|
3
|
+
};
|
|
4
|
+
export type VerificationCode = (typeof VERIFICATION_CODES)[keyof typeof VERIFICATION_CODES];
|
|
5
|
+
export declare abstract class VerificationError extends Error {
|
|
6
|
+
abstract readonly code: VerificationCode;
|
|
7
|
+
constructor(message: string, secrets?: readonly string[]);
|
|
8
|
+
}
|
|
9
|
+
export declare class EmptyPlanError extends VerificationError {
|
|
10
|
+
readonly code: "VERIFICATION_PLAN_EMPTY";
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Verification error taxonomy, mirroring the workspace/tools pattern (ADR-0005/0006). Errors
|
|
2
|
+
// carry a stable `code` discriminant; callers switch on `code`, never parse `message`. Every
|
|
3
|
+
// message is redacted at construction so errors are always safe to log. The only verification
|
|
4
|
+
// error surfaced today is at the CLI/IO boundary (workspace detection failures are surfaced by
|
|
5
|
+
// the workspace layer's own WorkspaceError); this base exists so later boundary failures have a
|
|
6
|
+
// typed home without re-deriving the pattern.
|
|
7
|
+
import { redact } from "../gateway/redaction.js";
|
|
8
|
+
export const VERIFICATION_CODES = {
|
|
9
|
+
PLAN_EMPTY: "VERIFICATION_PLAN_EMPTY",
|
|
10
|
+
};
|
|
11
|
+
export class VerificationError extends Error {
|
|
12
|
+
constructor(message, secrets = []) {
|
|
13
|
+
super(redact(message, secrets));
|
|
14
|
+
this.name = new.target.name;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// Raised when a verification run is requested but the plan contains no steps (e.g. --only with an
|
|
18
|
+
// empty selection). Surfaced as a non-green verification error at the CLI boundary.
|
|
19
|
+
export class EmptyPlanError extends VerificationError {
|
|
20
|
+
code = VERIFICATION_CODES.PLAN_EMPTY;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type { ResourceDimension, ResourceLimitDecision, ScriptCatalog, ScriptMapping, VerificationKind, VerificationPlan, VerificationReport, VerificationResourceLimits, VerificationResult, VerificationStatus, VerificationStep, } from "./types.js";
|
|
2
|
+
export { DEFAULT_VERIFICATION_LIMITS } from "./types.js";
|
|
3
|
+
export { VERIFICATION_CODES, VerificationError, EmptyPlanError } from "./errors.js";
|
|
4
|
+
export type { VerificationCode } from "./errors.js";
|
|
5
|
+
export { classifyScripts, detectScripts } from "./detect.js";
|
|
6
|
+
export { classifyOutcome } from "./classify.js";
|
|
7
|
+
export type { AbortReason, OutcomeInput } from "./classify.js";
|
|
8
|
+
export { buildVerificationPlan, resolveTargetedTests } from "./plan.js";
|
|
9
|
+
export type { PlanOptions } from "./plan.js";
|
|
10
|
+
export { nodeResourceMonitor } from "./monitor.js";
|
|
11
|
+
export type { ResourceMonitor } from "./monitor.js";
|
|
12
|
+
export { buildAppliedLimits } from "./limits.js";
|
|
13
|
+
export type { BreachedDimension } from "./limits.js";
|
|
14
|
+
export { runVerification } from "./orchestrator.js";
|
|
15
|
+
export type { VerificationDeps } from "./orchestrator.js";
|
|
16
|
+
export { buildVerificationSummary, renderMarkdownSummary, summarizeForAudit } from "./summary.js";
|
|
17
|
+
export type { AuditResultEntry, VerificationAuditSummary, VerificationResultSummary, VerificationSummary, } from "./summary.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Public barrel for the verification orchestrator layer (ADR-0007). Verification reuses the #6
|
|
2
|
+
// command boundary unchanged; this layer adds plan construction, per-command resource limits,
|
|
3
|
+
// best-effort memory monitoring, classified+redacted evidence, and audit/CLI/Markdown surfaces.
|
|
4
|
+
// Explicit named re-exports, `type` keyword for type-only, double quotes, `.js`.
|
|
5
|
+
export { DEFAULT_VERIFICATION_LIMITS } from "./types.js";
|
|
6
|
+
export { VERIFICATION_CODES, VerificationError, EmptyPlanError } from "./errors.js";
|
|
7
|
+
export { classifyScripts, detectScripts } from "./detect.js";
|
|
8
|
+
export { classifyOutcome } from "./classify.js";
|
|
9
|
+
export { buildVerificationPlan, resolveTargetedTests } from "./plan.js";
|
|
10
|
+
export { nodeResourceMonitor } from "./monitor.js";
|
|
11
|
+
export { buildAppliedLimits } from "./limits.js";
|
|
12
|
+
export { runVerification } from "./orchestrator.js";
|
|
13
|
+
export { buildVerificationSummary, renderMarkdownSummary, summarizeForAudit } from "./summary.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ResourceLimitDecision, VerificationResourceLimits } from "./types.js";
|
|
2
|
+
export type BreachedDimension = "wall-time" | "output-size" | "memory" | undefined;
|
|
3
|
+
export declare function buildAppliedLimits(limits: VerificationResourceLimits, breached: BreachedDimension): readonly ResourceLimitDecision[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Builds the four-dimension appliedLimits record for a step (ADR-0007 D2), with HONEST `enforced`
|
|
2
|
+
// flags: wall-time and output-size are enforced by #6; memory is enforced only on Linux with a
|
|
3
|
+
// ceiling set; network is documented-not-OS-enforced in Wave 1. `breached` is set only on the
|
|
4
|
+
// single dimension that actually fired for the step. Pure — no IO.
|
|
5
|
+
const NETWORK_NOTE = "documented; OS-level isolation deferred to container wave (ADR-0006)";
|
|
6
|
+
const MEMORY_OFF_NOTE = "best-effort; Linux /proc sampler only — not enforced on this run";
|
|
7
|
+
function memoryEnforced(limits) {
|
|
8
|
+
return process.platform === "linux" && limits.maxMemoryBytes !== undefined;
|
|
9
|
+
}
|
|
10
|
+
export function buildAppliedLimits(limits, breached) {
|
|
11
|
+
const memEnforced = memoryEnforced(limits);
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
dimension: "wall-time",
|
|
15
|
+
limit: limits.wallTimeMs,
|
|
16
|
+
enforced: true,
|
|
17
|
+
breached: breached === "wall-time" ? true : undefined,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
dimension: "output-size",
|
|
21
|
+
limit: limits.maxOutputBytes,
|
|
22
|
+
enforced: true,
|
|
23
|
+
breached: breached === "output-size" ? true : undefined,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
dimension: "memory",
|
|
27
|
+
limit: limits.maxMemoryBytes ?? 0,
|
|
28
|
+
enforced: memEnforced,
|
|
29
|
+
note: memEnforced ? undefined : MEMORY_OFF_NOTE,
|
|
30
|
+
breached: breached === "memory" ? true : undefined,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
dimension: "network",
|
|
34
|
+
limit: limits.network,
|
|
35
|
+
enforced: false,
|
|
36
|
+
note: NETWORK_NOTE,
|
|
37
|
+
breached: undefined,
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// The ResourceMonitor seam and its Node adapter (ADR-0007 D3). The orchestrator wraps the injected
|
|
2
|
+
// SpawnFn and calls watch(pid, maxBytes, onBreach) on the spawned child; the returned function
|
|
3
|
+
// clears the interval. This is the swap point the container wave replaces with a cgroup sampler.
|
|
4
|
+
//
|
|
5
|
+
// nodeResourceMonitor reads /proc/<pid>/status VmRSS — a SYSTEM path, not workspace content — so
|
|
6
|
+
// it uses raw node:fs (read-only, bounded, no secrets), NOT WorkspaceFs. VmRSS is reported by the
|
|
7
|
+
// kernel directly in kB, making it page-size-independent (correct on aarch64 with 16/64 KiB pages).
|
|
8
|
+
// On non-Linux, or when maxBytes is undefined, watch is a documented no-op and the memory dimension
|
|
9
|
+
// is recorded enforced:false.
|
|
10
|
+
import { readFileSync } from "node:fs";
|
|
11
|
+
const SAMPLE_INTERVAL_MS = 250;
|
|
12
|
+
const NO_OP = () => {
|
|
13
|
+
// Documented no-op: nothing to unwatch when monitoring is disabled or unavailable.
|
|
14
|
+
};
|
|
15
|
+
// Reads resident-set bytes from /proc/<pid>/status (VmRSS line). The kernel reports VmRSS
|
|
16
|
+
// directly in kB, so the result is page-size-independent. Returns undefined when the file is
|
|
17
|
+
// gone (process exited), when VmRSS is absent (zombie), or on any parse failure — so a transient
|
|
18
|
+
// read race or zombie process is never treated as a breach.
|
|
19
|
+
function readRssBytes(pid) {
|
|
20
|
+
let raw;
|
|
21
|
+
try {
|
|
22
|
+
raw = readFileSync(`/proc/${String(pid)}/status`, "utf8");
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
for (const line of raw.split("\n")) {
|
|
28
|
+
if (line.startsWith("VmRSS:")) {
|
|
29
|
+
const parts = line.split(/\s+/);
|
|
30
|
+
// Expected format: "VmRSS: 1234 kB" → parts = ["VmRSS:", "1234", "kB"]
|
|
31
|
+
const kb = Number.parseInt(parts[1] ?? "", 10);
|
|
32
|
+
if (!Number.isFinite(kb)) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
return kb * 1_024;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
export const nodeResourceMonitor = {
|
|
41
|
+
watch: (pid, maxBytes, onBreach) => {
|
|
42
|
+
if (process.platform !== "linux" || maxBytes === undefined || pid === undefined) {
|
|
43
|
+
return NO_OP;
|
|
44
|
+
}
|
|
45
|
+
let fired = false;
|
|
46
|
+
const timer = setInterval(() => {
|
|
47
|
+
const rss = readRssBytes(pid);
|
|
48
|
+
if (rss !== undefined && rss > maxBytes && !fired) {
|
|
49
|
+
fired = true;
|
|
50
|
+
onBreach();
|
|
51
|
+
}
|
|
52
|
+
}, SAMPLE_INTERVAL_MS);
|
|
53
|
+
timer.unref();
|
|
54
|
+
return () => {
|
|
55
|
+
clearInterval(timer);
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CommandRule, type SpawnFn } from "../tools/index.js";
|
|
2
|
+
import { type WorkspaceFs } from "../workspace/fs.js";
|
|
3
|
+
import type { WorkspaceInfo } from "../workspace/index.js";
|
|
4
|
+
import { type ResourceMonitor } from "./monitor.js";
|
|
5
|
+
import type { VerificationPlan, VerificationReport } from "./types.js";
|
|
6
|
+
export interface VerificationDeps {
|
|
7
|
+
readonly workspace: WorkspaceInfo;
|
|
8
|
+
readonly signal?: AbortSignal | undefined;
|
|
9
|
+
readonly spawn?: SpawnFn | undefined;
|
|
10
|
+
readonly monitor?: ResourceMonitor | undefined;
|
|
11
|
+
readonly processEnv?: NodeJS.ProcessEnv | undefined;
|
|
12
|
+
readonly now?: (() => number) | undefined;
|
|
13
|
+
readonly fs?: WorkspaceFs | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare const VERIFICATION_COMMAND_RULES: readonly CommandRule[];
|
|
16
|
+
export declare function runVerification(plan: VerificationPlan, deps: VerificationDeps): Promise<VerificationReport>;
|