clinkx 1.2.0 → 1.4.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/CHANGELOG.md +60 -0
- package/README.md +17 -8
- package/clinkx-workflows/dist/architecture-arena/admission.d.ts +16 -0
- package/clinkx-workflows/dist/architecture-arena/admission.js +107 -0
- package/clinkx-workflows/dist/architecture-arena/admission.js.map +1 -0
- package/clinkx-workflows/dist/architecture-arena/contract.d.ts +1368 -0
- package/clinkx-workflows/dist/architecture-arena/contract.js +254 -0
- package/clinkx-workflows/dist/architecture-arena/contract.js.map +1 -0
- package/clinkx-workflows/dist/architecture-arena/runtime.d.ts +53 -0
- package/clinkx-workflows/dist/architecture-arena/runtime.js +511 -0
- package/clinkx-workflows/dist/architecture-arena/runtime.js.map +1 -0
- package/clinkx-workflows/dist/architecture-comparison/admission.d.ts +17 -1
- package/clinkx-workflows/dist/architecture-comparison/admission.js +27 -4
- package/clinkx-workflows/dist/architecture-comparison/admission.js.map +1 -1
- package/clinkx-workflows/dist/architecture-comparison/contract.d.ts +59 -62
- package/clinkx-workflows/dist/architecture-comparison/contract.js +4 -21
- package/clinkx-workflows/dist/architecture-comparison/contract.js.map +1 -1
- package/clinkx-workflows/dist/architecture-comparison/runtime.d.ts +4 -3
- package/clinkx-workflows/dist/architecture-comparison/runtime.js +22 -67
- package/clinkx-workflows/dist/architecture-comparison/runtime.js.map +1 -1
- package/clinkx-workflows/dist/artifacts.d.ts +19 -4
- package/clinkx-workflows/dist/artifacts.js +16 -7
- package/clinkx-workflows/dist/artifacts.js.map +1 -1
- package/clinkx-workflows/dist/backend.d.ts +30 -0
- package/clinkx-workflows/dist/child-env.d.ts +3 -0
- package/clinkx-workflows/dist/child-env.js +11 -0
- package/clinkx-workflows/dist/child-env.js.map +1 -1
- package/clinkx-workflows/dist/clink-client.d.ts +8 -2
- package/clinkx-workflows/dist/clink-client.js +4 -2
- package/clinkx-workflows/dist/clink-client.js.map +1 -1
- package/clinkx-workflows/dist/context-preflight.d.ts +6 -0
- package/clinkx-workflows/dist/context-preflight.js.map +1 -1
- package/clinkx-workflows/dist/council-execution-policy.d.ts +3 -1
- package/clinkx-workflows/dist/council-execution-policy.js +4 -0
- package/clinkx-workflows/dist/council-execution-policy.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/api-routes.d.ts +21 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js +27 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.d.ts +13 -0
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/auth/controller.d.ts +27 -0
- package/clinkx-workflows/dist/dashboard/auth/controller.js +262 -23
- package/clinkx-workflows/dist/dashboard/auth/controller.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/auth/settings-step-up.d.ts +62 -0
- package/clinkx-workflows/dist/dashboard/auth/settings-step-up.js +70 -0
- package/clinkx-workflows/dist/dashboard/auth/settings-step-up.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/contracts.d.ts +586 -586
- package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +28 -28
- package/clinkx-workflows/dist/dashboard/request-admission.d.ts +6 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js +9 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/server-factory.js +15 -1
- package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +32 -32
- package/clinkx-workflows/dist/dashboard/settings-contract.d.ts +1806 -0
- package/clinkx-workflows/dist/dashboard/settings-contract.js +630 -0
- package/clinkx-workflows/dist/dashboard/settings-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/settings-process-reader.d.ts +48 -0
- package/clinkx-workflows/dist/dashboard/settings-process-reader.js +195 -0
- package/clinkx-workflows/dist/dashboard/settings-process-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/settings-routes.d.ts +87 -0
- package/clinkx-workflows/dist/dashboard/settings-routes.js +690 -0
- package/clinkx-workflows/dist/dashboard/settings-routes.js.map +1 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/index-DSOtuS0p.js +122 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/style-C5guUjwN.css +1 -0
- package/clinkx-workflows/dist/dashboard-ui/index.html +2 -2
- package/clinkx-workflows/dist/delegate-signature.d.ts +4 -3
- package/clinkx-workflows/dist/delegate-signature.js +4 -3
- package/clinkx-workflows/dist/delegate-signature.js.map +1 -1
- package/clinkx-workflows/dist/durable-file-core.d.ts +76 -0
- package/clinkx-workflows/dist/durable-file-core.js +146 -0
- package/clinkx-workflows/dist/durable-file-core.js.map +1 -0
- package/clinkx-workflows/dist/durable-file.d.ts +13 -0
- package/clinkx-workflows/dist/durable-file.js +22 -0
- package/clinkx-workflows/dist/durable-file.js.map +1 -0
- package/clinkx-workflows/dist/engine.d.ts +42 -7
- package/clinkx-workflows/dist/engine.js +196 -24
- package/clinkx-workflows/dist/engine.js.map +1 -1
- package/clinkx-workflows/dist/index.js +68 -2
- package/clinkx-workflows/dist/index.js.map +1 -1
- package/clinkx-workflows/dist/ping-pong/admission.d.ts +127 -0
- package/clinkx-workflows/dist/ping-pong/admission.js +522 -0
- package/clinkx-workflows/dist/ping-pong/admission.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/contract.d.ts +2539 -0
- package/clinkx-workflows/dist/ping-pong/contract.js +819 -0
- package/clinkx-workflows/dist/ping-pong/contract.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/control.d.ts +67 -0
- package/clinkx-workflows/dist/ping-pong/control.js +12 -0
- package/clinkx-workflows/dist/ping-pong/control.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/runtime-handle.d.ts +24 -0
- package/clinkx-workflows/dist/ping-pong/runtime-handle.js +55 -0
- package/clinkx-workflows/dist/ping-pong/runtime-handle.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/runtime.d.ts +235 -0
- package/clinkx-workflows/dist/ping-pong/runtime.js +1183 -0
- package/clinkx-workflows/dist/ping-pong/runtime.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/settle.d.ts +57 -0
- package/clinkx-workflows/dist/ping-pong/settle.js +58 -0
- package/clinkx-workflows/dist/ping-pong/settle.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/sidecar.d.ts +65 -0
- package/clinkx-workflows/dist/ping-pong/sidecar.js +138 -0
- package/clinkx-workflows/dist/ping-pong/sidecar.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/publication.d.ts +2 -1
- package/clinkx-workflows/dist/plan-review/publication.js +5 -6
- package/clinkx-workflows/dist/plan-review/publication.js.map +1 -1
- package/clinkx-workflows/dist/plan-review/snapshot.d.ts +3 -2
- package/clinkx-workflows/dist/plan-review/snapshot.js +8 -8
- package/clinkx-workflows/dist/plan-review/snapshot.js.map +1 -1
- package/clinkx-workflows/dist/recipe-host.d.ts +315 -0
- package/clinkx-workflows/dist/recipe-host.js +183 -0
- package/clinkx-workflows/dist/recipe-host.js.map +1 -0
- package/clinkx-workflows/dist/recipe-seats.d.ts +96 -0
- package/clinkx-workflows/dist/recipe-seats.js +163 -0
- package/clinkx-workflows/dist/recipe-seats.js.map +1 -0
- package/clinkx-workflows/dist/recipe-shared/evidence.d.ts +67 -0
- package/clinkx-workflows/dist/recipe-shared/evidence.js +111 -0
- package/clinkx-workflows/dist/recipe-shared/evidence.js.map +1 -0
- package/clinkx-workflows/dist/reducers/index.d.ts +9 -1
- package/clinkx-workflows/dist/reducers/index.js +30 -0
- package/clinkx-workflows/dist/reducers/index.js.map +1 -1
- package/clinkx-workflows/dist/run-lock-reclaim.d.ts +44 -0
- package/clinkx-workflows/dist/run-lock-reclaim.js +86 -0
- package/clinkx-workflows/dist/run-lock-reclaim.js.map +1 -0
- package/clinkx-workflows/dist/settings/audit.d.ts +101 -0
- package/clinkx-workflows/dist/settings/audit.js +318 -0
- package/clinkx-workflows/dist/settings/audit.js.map +1 -0
- package/clinkx-workflows/dist/settings/bootstrap.d.ts +35 -0
- package/clinkx-workflows/dist/settings/bootstrap.js +52 -0
- package/clinkx-workflows/dist/settings/bootstrap.js.map +1 -0
- package/clinkx-workflows/dist/settings/codec.d.ts +51 -0
- package/clinkx-workflows/dist/settings/codec.js +410 -0
- package/clinkx-workflows/dist/settings/codec.js.map +1 -0
- package/clinkx-workflows/dist/settings/durable-write.d.ts +48 -0
- package/clinkx-workflows/dist/settings/durable-write.js +31 -0
- package/clinkx-workflows/dist/settings/durable-write.js.map +1 -0
- package/clinkx-workflows/dist/settings/index.d.ts +20 -0
- package/clinkx-workflows/dist/settings/index.js +23 -0
- package/clinkx-workflows/dist/settings/index.js.map +1 -0
- package/clinkx-workflows/dist/settings/loader.d.ts +80 -0
- package/clinkx-workflows/dist/settings/loader.js +577 -0
- package/clinkx-workflows/dist/settings/loader.js.map +1 -0
- package/clinkx-workflows/dist/settings/lock.d.ts +108 -0
- package/clinkx-workflows/dist/settings/lock.js +344 -0
- package/clinkx-workflows/dist/settings/lock.js.map +1 -0
- package/clinkx-workflows/dist/settings/paths.d.ts +65 -0
- package/clinkx-workflows/dist/settings/paths.js +173 -0
- package/clinkx-workflows/dist/settings/paths.js.map +1 -0
- package/clinkx-workflows/dist/settings/process-heartbeat.d.ts +47 -0
- package/clinkx-workflows/dist/settings/process-heartbeat.js +305 -0
- package/clinkx-workflows/dist/settings/process-heartbeat.js.map +1 -0
- package/clinkx-workflows/dist/settings/registry.d.ts +178 -0
- package/clinkx-workflows/dist/settings/registry.js +1285 -0
- package/clinkx-workflows/dist/settings/registry.js.map +1 -0
- package/clinkx-workflows/dist/settings/schema.d.ts +404 -0
- package/clinkx-workflows/dist/settings/schema.js +415 -0
- package/clinkx-workflows/dist/settings/schema.js.map +1 -0
- package/clinkx-workflows/dist/settings/store.d.ts +157 -0
- package/clinkx-workflows/dist/settings/store.js +842 -0
- package/clinkx-workflows/dist/settings/store.js.map +1 -0
- package/clinkx-workflows/dist/state-schema.d.ts +11 -0
- package/clinkx-workflows/dist/state-schema.js +4 -1
- package/clinkx-workflows/dist/state-schema.js.map +1 -1
- package/clinkx-workflows/dist/state.d.ts +178 -3
- package/clinkx-workflows/dist/state.js +618 -83
- package/clinkx-workflows/dist/state.js.map +1 -1
- package/clinkx-workflows/dist/stdio-entry.d.ts +2 -0
- package/clinkx-workflows/dist/stdio-entry.js +52 -0
- package/clinkx-workflows/dist/stdio-entry.js.map +1 -0
- package/clinkx-workflows/dist/transport.d.ts +2 -1
- package/clinkx-workflows/dist/transport.js +5 -0
- package/clinkx-workflows/dist/transport.js.map +1 -1
- package/clinkx-workflows/dist/validators/architecture-arena.d.ts +6 -0
- package/clinkx-workflows/dist/validators/architecture-arena.js +16 -0
- package/clinkx-workflows/dist/validators/architecture-arena.js.map +1 -0
- package/clinkx-workflows/dist/validators/index.js +4 -0
- package/clinkx-workflows/dist/validators/index.js.map +1 -1
- package/clinkx-workflows/dist/validators/ping-pong.d.ts +6 -0
- package/clinkx-workflows/dist/validators/ping-pong.js +10 -0
- package/clinkx-workflows/dist/validators/ping-pong.js.map +1 -0
- package/clinkx-workflows/dist/workflow-tools.d.ts +51 -5
- package/clinkx-workflows/dist/workflow-tools.js +785 -34
- package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
- package/clinkx-workflows/dist/workflow-verification-contract.d.ts +4 -4
- package/clinkx-workflows/templates/architecture-arena/candidate.txt +39 -0
- package/clinkx-workflows/templates/architecture-arena/judge.txt +34 -0
- package/clinkx-workflows/templates/ping-pong/implement.txt +14 -0
- package/clinkx-workflows/templates/ping-pong/remediate.txt +14 -0
- package/clinkx-workflows/templates/ping-pong/review.txt +27 -0
- package/clinkx-workflows/workflows/architecture-arena.yaml +127 -0
- package/clinkx-workflows/workflows/ping-pong.yaml +158 -0
- package/dist/context-builder/bundle.js +4 -3
- package/dist/context-builder/bundle.js.map +1 -1
- package/dist/context-builder/delegate-packet.d.ts +1 -0
- package/dist/context-builder/delegate-packet.js +66 -7
- package/dist/context-builder/delegate-packet.js.map +1 -1
- package/dist/context-builder/delegate-validation.d.ts +12 -3
- package/dist/context-builder/delegate-validation.js +23 -13
- package/dist/context-builder/delegate-validation.js.map +1 -1
- package/dist/context-builder/external-gaps.d.ts +14 -3
- package/dist/context-builder/external-gaps.js +124 -18
- package/dist/context-builder/external-gaps.js.map +1 -1
- package/dist/context-builder/handler.js +108 -191
- package/dist/context-builder/handler.js.map +1 -1
- package/dist/context-builder/review-coverage.js +27 -1
- package/dist/context-builder/review-coverage.js.map +1 -1
- package/dist/context-builder/secrets.js +1 -1
- package/dist/context-builder/secrets.js.map +1 -1
- package/dist/context-builder/versions.d.ts +10 -4
- package/dist/context-builder/versions.js +10 -4
- package/dist/context-builder/versions.js.map +1 -1
- package/dist/context-builder/workflow-runner.js +33 -24
- package/dist/context-builder/workflow-runner.js.map +1 -1
- package/dist/dashboard-cli.d.ts +2 -0
- package/dist/dashboard-cli.js +197 -58
- package/dist/dashboard-cli.js.map +1 -1
- package/dist/dashboard-companion/client.d.ts +10 -0
- package/dist/dashboard-companion/client.js +43 -1
- package/dist/dashboard-companion/client.js.map +1 -1
- package/dist/dashboard-companion/config.d.ts +19 -1
- package/dist/dashboard-companion/config.js +104 -3
- package/dist/dashboard-companion/config.js.map +1 -1
- package/dist/dashboard-companion/protocol.d.ts +16 -0
- package/dist/dashboard-companion/protocol.js +55 -1
- package/dist/dashboard-companion/protocol.js.map +1 -1
- package/dist/dashboard-companion/workstation-binding.d.ts +69 -0
- package/dist/dashboard-companion/workstation-binding.js +192 -0
- package/dist/dashboard-companion/workstation-binding.js.map +1 -0
- package/dist/dashboard-gateway/admin-cli.d.ts +10 -0
- package/dist/dashboard-gateway/admin-cli.js +266 -0
- package/dist/dashboard-gateway/admin-cli.js.map +1 -0
- package/dist/dashboard-gateway/config.d.ts +50 -0
- package/dist/dashboard-gateway/config.js +235 -1
- package/dist/dashboard-gateway/config.js.map +1 -1
- package/dist/dashboard-gateway/connection-registry.d.ts +100 -0
- package/dist/dashboard-gateway/connection-registry.js +228 -0
- package/dist/dashboard-gateway/connection-registry.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/account-auth.d.ts +78 -0
- package/dist/dashboard-gateway/control-plane/account-auth.js +198 -0
- package/dist/dashboard-gateway/control-plane/account-auth.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/billing.d.ts +264 -0
- package/dist/dashboard-gateway/control-plane/billing.js +787 -0
- package/dist/dashboard-gateway/control-plane/billing.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/contracts.d.ts +1293 -0
- package/dist/dashboard-gateway/control-plane/contracts.js +280 -0
- package/dist/dashboard-gateway/control-plane/contracts.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/cookies.d.ts +13 -0
- package/dist/dashboard-gateway/control-plane/cookies.js +46 -0
- package/dist/dashboard-gateway/control-plane/cookies.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/credentials.d.ts +63 -0
- package/dist/dashboard-gateway/control-plane/credentials.js +66 -0
- package/dist/dashboard-gateway/control-plane/credentials.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/entitlements.d.ts +118 -0
- package/dist/dashboard-gateway/control-plane/entitlements.js +329 -0
- package/dist/dashboard-gateway/control-plane/entitlements.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/errors.d.ts +17 -0
- package/dist/dashboard-gateway/control-plane/errors.js +23 -0
- package/dist/dashboard-gateway/control-plane/errors.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/hosts.d.ts +6 -0
- package/dist/dashboard-gateway/control-plane/hosts.js +16 -0
- package/dist/dashboard-gateway/control-plane/hosts.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/http.d.ts +34 -0
- package/dist/dashboard-gateway/control-plane/http.js +331 -0
- package/dist/dashboard-gateway/control-plane/http.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/schema.d.ts +9 -0
- package/dist/dashboard-gateway/control-plane/schema.js +247 -0
- package/dist/dashboard-gateway/control-plane/schema.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/secrets.d.ts +20 -0
- package/dist/dashboard-gateway/control-plane/secrets.js +39 -0
- package/dist/dashboard-gateway/control-plane/secrets.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/store.d.ts +579 -0
- package/dist/dashboard-gateway/control-plane/store.js +1115 -0
- package/dist/dashboard-gateway/control-plane/store.js.map +1 -0
- package/dist/dashboard-gateway/cookie-boundary.d.ts +60 -0
- package/dist/dashboard-gateway/cookie-boundary.js +205 -0
- package/dist/dashboard-gateway/cookie-boundary.js.map +1 -0
- package/dist/dashboard-gateway/index.js +271 -494
- package/dist/dashboard-gateway/index.js.map +1 -1
- package/dist/dashboard-gateway/main.js +7 -2
- package/dist/dashboard-gateway/main.js.map +1 -1
- package/dist/dashboard-gateway/routing.d.ts +43 -0
- package/dist/dashboard-gateway/routing.js +65 -0
- package/dist/dashboard-gateway/routing.js.map +1 -0
- package/dist/dashboard-gateway/tenant-gateway.d.ts +56 -0
- package/dist/dashboard-gateway/tenant-gateway.js +989 -0
- package/dist/dashboard-gateway/tenant-gateway.js.map +1 -0
- package/dist/dashboard-gateway/tenant-main.d.ts +41 -0
- package/dist/dashboard-gateway/tenant-main.js +303 -0
- package/dist/dashboard-gateway/tenant-main.js.map +1 -0
- package/dist/dashboard-gateway/tunnel-errors.d.ts +16 -0
- package/dist/dashboard-gateway/tunnel-errors.js +22 -0
- package/dist/dashboard-gateway/tunnel-errors.js.map +1 -0
- package/dist/dashboard-gateway/tunnel-http.d.ts +21 -0
- package/dist/dashboard-gateway/tunnel-http.js +195 -0
- package/dist/dashboard-gateway/tunnel-http.js.map +1 -0
- package/dist/elaris/config.d.ts +10 -0
- package/dist/elaris/config.js +27 -1
- package/dist/elaris/config.js.map +1 -1
- package/dist/elaris/tools.js +4 -1
- package/dist/elaris/tools.js.map +1 -1
- package/dist/handler.d.ts +6 -0
- package/dist/handler.js +17 -1
- package/dist/handler.js.map +1 -1
- package/dist/index.d.ts +0 -31
- package/dist/index.js +41 -404
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +17 -0
- package/dist/lib.js +17 -0
- package/dist/lib.js.map +1 -0
- package/dist/local-clink-backend.d.ts +2 -1
- package/dist/local-clink-backend.js +28 -4
- package/dist/local-clink-backend.js.map +1 -1
- package/dist/parsers/extract.d.ts +19 -1
- package/dist/parsers/extract.js +68 -3
- package/dist/parsers/extract.js.map +1 -1
- package/dist/pipeline.d.ts +17 -1
- package/dist/pipeline.js +34 -6
- package/dist/pipeline.js.map +1 -1
- package/dist/process-group.d.ts +65 -0
- package/dist/process-group.js +153 -0
- package/dist/process-group.js.map +1 -0
- package/dist/progress-report/lock.d.ts +17 -59
- package/dist/progress-report/lock.js +25 -329
- package/dist/progress-report/lock.js.map +1 -1
- package/dist/progress-report/schema.d.ts +23 -23
- package/dist/project-verification/files.js +1 -1
- package/dist/project-verification/files.js.map +1 -1
- package/dist/project-verification/process.js +23 -44
- package/dist/project-verification/process.js.map +1 -1
- package/dist/project-verification/service.js +9 -1
- package/dist/project-verification/service.js.map +1 -1
- package/dist/prompt.d.ts +7 -0
- package/dist/prompt.js +18 -1
- package/dist/prompt.js.map +1 -1
- package/dist/recipe-host/git-trust.d.ts +43 -0
- package/dist/recipe-host/git-trust.js +360 -0
- package/dist/recipe-host/git-trust.js.map +1 -0
- package/dist/recipe-host/git.d.ts +42 -0
- package/dist/recipe-host/git.js +207 -0
- package/dist/recipe-host/git.js.map +1 -0
- package/dist/recipe-host/native-recipe-host.d.ts +127 -0
- package/dist/recipe-host/native-recipe-host.js +880 -0
- package/dist/recipe-host/native-recipe-host.js.map +1 -0
- package/dist/recipe-host/seat-cwd.d.ts +16 -0
- package/dist/recipe-host/seat-cwd.js +170 -0
- package/dist/recipe-host/seat-cwd.js.map +1 -0
- package/dist/runner.d.ts +43 -1
- package/dist/runner.js +234 -35
- package/dist/runner.js.map +1 -1
- package/dist/server.js +84 -5
- package/dist/server.js.map +1 -1
- package/dist/settings-cli/clients.d.ts +137 -0
- package/dist/settings-cli/clients.js +1124 -0
- package/dist/settings-cli/clients.js.map +1 -0
- package/dist/settings-cli/commands.d.ts +67 -0
- package/dist/settings-cli/commands.js +726 -0
- package/dist/settings-cli/commands.js.map +1 -0
- package/dist/settings-cli/format.d.ts +34 -0
- package/dist/settings-cli/format.js +40 -0
- package/dist/settings-cli/format.js.map +1 -0
- package/dist/settings-cli/main.d.ts +18 -0
- package/dist/settings-cli/main.js +256 -0
- package/dist/settings-cli/main.js.map +1 -0
- package/dist/stdio-main.d.ts +73 -0
- package/dist/stdio-main.js +455 -0
- package/dist/stdio-main.js.map +1 -0
- package/docs/configuration.md +362 -40
- package/docs/engineering-recipes.md +291 -0
- package/docs/security.md +234 -6
- package/docs/verification/project-checks.md +24 -2
- package/package.json +6 -2
- package/clinkx-workflows/dist/dashboard-ui/assets/index-BdpmbPps.js +0 -115
- package/clinkx-workflows/dist/dashboard-ui/assets/style-Im5i1iAs.css +0 -1
|
@@ -67,6 +67,7 @@ import { stat as fsStat } from "node:fs/promises";
|
|
|
67
67
|
import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
|
|
68
68
|
import { basename, isAbsolute, join, resolve, sep } from "node:path";
|
|
69
69
|
import { callClink, extractObservedInvocation } from "./clink-client.js";
|
|
70
|
+
import { resolveFileWriter } from "./durable-file.js";
|
|
70
71
|
import { getArtifactsDir, getChildMaxConcurrent, getWorkflowsContextDefault, getWorkflowsContextDefaultCurator, getMaxParallel, getMaxPromptBytes, getStateDir, resolveWorkspaceRoot, } from "./config.js";
|
|
71
72
|
import { validatePlanReviewCallBindings, validatePlanReviewPreparedInputPolicy, } from "./plan-review/runtime-policy.js";
|
|
72
73
|
import { CouncilPlanReviewErrorSchema, } from "./plan-review/publication.js";
|
|
@@ -85,8 +86,13 @@ import { filterExcludedPlanPaths, foldPlanReviewExcludeGlobs, } from "./plan-rev
|
|
|
85
86
|
import { getReducer } from "./reducers/index.js";
|
|
86
87
|
import { ArchitectureComparisonRuntime } from "./architecture-comparison/runtime.js";
|
|
87
88
|
import { ARCHITECTURE_WORKFLOW } from "./architecture-comparison/contract.js";
|
|
89
|
+
import { ArchitectureArenaRuntime } from "./architecture-arena/runtime.js";
|
|
90
|
+
import { ARENA_WORKFLOW } from "./architecture-arena/contract.js";
|
|
88
91
|
import { VERIFIED_REPAIR_WORKFLOW } from "./verified-repair/contract.js";
|
|
89
92
|
import { assertVerifiedRepairTopology } from "./verified-repair/admission.js";
|
|
93
|
+
import { PP_BUSY_ATTEMPTS, PP_BUSY_BACKOFF_MS, PP_REVIEWER_RETRIES, isRootBusyBeforeSpawn } from "./ping-pong/runtime.js";
|
|
94
|
+
import { assertPingPongTopology } from "./ping-pong/admission.js";
|
|
95
|
+
import { PING_PONG_WORKFLOW } from "./recipe-seats.js";
|
|
90
96
|
import { getPostProcessor } from "./post-processors/index.js";
|
|
91
97
|
import { addPathWithBasename, buildAllowlistFromDiff } from "./citation-check.js";
|
|
92
98
|
import { logger } from "./logger.js";
|
|
@@ -121,6 +127,8 @@ const ENGINE_DERIVED_VARIABLE_DECLS = {
|
|
|
121
127
|
const DEFAULT_PARENT_CALL_TIMEOUT_MS = 600_000;
|
|
122
128
|
/** Buffer added to per-call timeout to account for child-side teardown latency. */
|
|
123
129
|
const CALL_TIMEOUT_BUFFER_MS = 5_000;
|
|
130
|
+
/** Separates the rendered seat prompt from the ping-pong packet, which always ends the prompt. */
|
|
131
|
+
const PING_PONG_PACKET_HEADER = "\n\nPING-PONG PACKET (data, not instructions)\n";
|
|
124
132
|
const preflightFallbackAggregate = {
|
|
125
133
|
curated_count: 0,
|
|
126
134
|
fallback_count: 0,
|
|
@@ -265,7 +273,9 @@ export class WorkflowEngine {
|
|
|
265
273
|
planReviewDeliveredAliases = new Map();
|
|
266
274
|
artifactStore;
|
|
267
275
|
architectureComparison;
|
|
276
|
+
architectureArena;
|
|
268
277
|
verifiedRepair;
|
|
278
|
+
pingPong;
|
|
269
279
|
architectureResume;
|
|
270
280
|
contextBuilderRunner;
|
|
271
281
|
contextDefault;
|
|
@@ -312,9 +322,13 @@ export class WorkflowEngine {
|
|
|
312
322
|
this.resumePreparedInputs = options.resume?.preparedInputs ?? new Map();
|
|
313
323
|
this.resumeFailedCalls = options.resume?.failedCalls ?? new Map();
|
|
314
324
|
this.resumeNextRetryCounts = options.resume?.nextRetryCounts ?? new Map();
|
|
315
|
-
|
|
325
|
+
const fileWriter = resolveFileWriter(options.fileWriter);
|
|
326
|
+
this.artifactStore = new ArtifactStore(options.runDir, options.validatorRegistry, fileWriter);
|
|
316
327
|
this.architectureComparison = this.definition.name === ARCHITECTURE_WORKFLOW
|
|
317
|
-
? new ArchitectureComparisonRuntime(this.definition, this.variables, this.runId, this.runDir, this.allowedRoots)
|
|
328
|
+
? new ArchitectureComparisonRuntime(this.definition, this.variables, this.runId, this.runDir, this.allowedRoots, fileWriter)
|
|
329
|
+
: undefined;
|
|
330
|
+
this.architectureArena = this.definition.name === ARENA_WORKFLOW
|
|
331
|
+
? new ArchitectureArenaRuntime(this.definition, this.variables, this.runId, this.runDir, this.allowedRoots, fileWriter)
|
|
318
332
|
: undefined;
|
|
319
333
|
this.architectureResume = options.resume;
|
|
320
334
|
this.verifiedRepair = options.verifiedRepair;
|
|
@@ -325,6 +339,12 @@ export class WorkflowEngine {
|
|
|
325
339
|
if (options.resume !== undefined)
|
|
326
340
|
throw new WorkflowError("verified-repair mutation cannot be resumed; submit a fresh explicit contract");
|
|
327
341
|
}
|
|
342
|
+
this.pingPong = options.pingPong;
|
|
343
|
+
if (this.definition.name === PING_PONG_WORKFLOW || this.pingPong !== undefined) {
|
|
344
|
+
assertPingPongTopology(this.definition, this.variables);
|
|
345
|
+
if (this.pingPong === undefined)
|
|
346
|
+
throw new WorkflowError("ping-pong requires the root recipe runtime");
|
|
347
|
+
}
|
|
328
348
|
this.contextBuilderRunner = this.verifiedRepair === undefined ? options.contextBuilderRunner : undefined;
|
|
329
349
|
this.contextDefault = options.contextDefault ?? getWorkflowsContextDefault();
|
|
330
350
|
this.defaultCurator = options.defaultCurator ?? getWorkflowsContextDefaultCurator();
|
|
@@ -349,9 +369,12 @@ export class WorkflowEngine {
|
|
|
349
369
|
this.seedResumedArtifacts();
|
|
350
370
|
}
|
|
351
371
|
async execute() {
|
|
372
|
+
// Ping-pong: min(remaining active budget, remaining wall deadline) + grace
|
|
373
|
+
// per execution, a backstop behind the runtime's own budget checks (D3).
|
|
374
|
+
const timeoutSeconds = this.pingPong?.executionTimeoutSeconds() ?? this.definition.settings.timeout_seconds;
|
|
352
375
|
this.workflowDeadlineAtMonoMs =
|
|
353
|
-
monotonicNowMs() +
|
|
354
|
-
const deadlineController = this.createDeadlineController(
|
|
376
|
+
monotonicNowMs() + timeoutSeconds * 1000;
|
|
377
|
+
const deadlineController = this.createDeadlineController(timeoutSeconds * 1000);
|
|
355
378
|
const stages = [];
|
|
356
379
|
const startedAt = new Date().toISOString();
|
|
357
380
|
try {
|
|
@@ -369,11 +392,17 @@ export class WorkflowEngine {
|
|
|
369
392
|
message: `Workflow ${this.definition.name} is running`,
|
|
370
393
|
});
|
|
371
394
|
await this.architectureComparison?.restore(this.architectureResume);
|
|
395
|
+
await this.architectureArena?.restore(this.architectureResume);
|
|
372
396
|
this.throwIfAborted(deadlineController.signal);
|
|
373
397
|
await this.prepareContextPreflight(deadlineController.signal);
|
|
398
|
+
let paused = false;
|
|
374
399
|
for (let stageIndex = 0; stageIndex < this.definition.stages.length; stageIndex += 1) {
|
|
375
400
|
this.throwIfAborted(deadlineController.signal);
|
|
376
401
|
const stage = this.definition.stages[stageIndex];
|
|
402
|
+
// Ping-pong: the runtime names the one stage that runs next; every
|
|
403
|
+
// other stage stays pending (D1 fixed topology).
|
|
404
|
+
if (this.pingPong?.stageDisposition(stage.id) === "skip")
|
|
405
|
+
continue;
|
|
377
406
|
logger.info({ run_id: this.runId, stage_id: stage.id }, "executing workflow stage");
|
|
378
407
|
await this.emitProgress({
|
|
379
408
|
runId: this.runId,
|
|
@@ -401,6 +430,13 @@ export class WorkflowEngine {
|
|
|
401
430
|
state: executedStage.ok ? "succeeded" : "failed",
|
|
402
431
|
message: `Stage ${stage.id} ${executedStage.ok ? "succeeded" : "failed"}`,
|
|
403
432
|
});
|
|
433
|
+
if (this.pingPong !== undefined) {
|
|
434
|
+
const directive = this.pingPong.afterStage(stage.id, executedStage.ok);
|
|
435
|
+
if (directive === "pause") {
|
|
436
|
+
paused = true;
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
404
440
|
if (!executedStage.ok && stage.on_failure === "abort") {
|
|
405
441
|
// Generic boundary for ALL stage aborts, so it must stay permanent by
|
|
406
442
|
// default — a stage that aborts on an ordinary permanent call failure
|
|
@@ -412,7 +448,11 @@ export class WorkflowEngine {
|
|
|
412
448
|
throw new WorkflowError(`Stage ${stage.id} failed and on_failure=abort`, this.isWorkflowDeadlineExhausted() ? "transient" : undefined);
|
|
413
449
|
}
|
|
414
450
|
}
|
|
415
|
-
|
|
451
|
+
// A pause publishes a terminal succeeded envelope for this execution;
|
|
452
|
+
// the recipe phase lives in the sidecar (D2).
|
|
453
|
+
const outputText = paused && this.pingPong !== undefined
|
|
454
|
+
? this.pingPong.pauseOutput()
|
|
455
|
+
: await this.resolveTerminalResult(stages);
|
|
416
456
|
const completedAt = new Date().toISOString();
|
|
417
457
|
await this.emitRunStateChange({
|
|
418
458
|
runId: this.runId,
|
|
@@ -568,6 +608,9 @@ export class WorkflowEngine {
|
|
|
568
608
|
this.throwIfAborted(signal);
|
|
569
609
|
const executedCall = await this.executeSingleCall(stage, stage.calls[callIndex], stageIndex, callIndex, signal);
|
|
570
610
|
calls.push(executedCall);
|
|
611
|
+
if (stage.calls[callIndex].reducer == null) {
|
|
612
|
+
this.pingPong?.afterCall(`${stage.id}.${stage.calls[callIndex].id}`, executedCall.ok, executedCall.error);
|
|
613
|
+
}
|
|
571
614
|
if (!executedCall.ok && stage.on_failure === "abort") {
|
|
572
615
|
return { stageId: stage.id, ok: false, calls };
|
|
573
616
|
}
|
|
@@ -620,9 +663,9 @@ export class WorkflowEngine {
|
|
|
620
663
|
}
|
|
621
664
|
try {
|
|
622
665
|
const contextArtifacts = this.artifactStore.buildContext(this.definition, call.context_from);
|
|
623
|
-
const outputText = await reducer(contextArtifacts.artifacts, { variables: this.effectiveVariables, architectureComparison: this.architectureComparison, verifiedRepair: this.verifiedRepair, signal });
|
|
666
|
+
const outputText = await reducer(contextArtifacts.artifacts, { variables: this.effectiveVariables, architectureComparison: this.architectureComparison, architectureArena: this.architectureArena, omissions: contextArtifacts.omissions, verifiedRepair: this.verifiedRepair, pingPong: this.pingPong, stageId: stage.id, signal });
|
|
624
667
|
this.throwIfAborted(signal);
|
|
625
|
-
const artifact = this.maybeWriteArtifact(stage, call, stageIndex, callIndex, outputText);
|
|
668
|
+
const artifact = await this.maybeWriteArtifact(stage, call, stageIndex, callIndex, outputText);
|
|
626
669
|
const completedAt = new Date().toISOString();
|
|
627
670
|
const durationMs = Date.now() - startedAtMs;
|
|
628
671
|
await this.emitCallStateChange({
|
|
@@ -681,8 +724,10 @@ export class WorkflowEngine {
|
|
|
681
724
|
let input;
|
|
682
725
|
try {
|
|
683
726
|
await this.verifiedRepair?.prepareProvider(callKey, signal);
|
|
727
|
+
await this.pingPong?.prepareProvider(callKey, signal);
|
|
684
728
|
input = this.buildCallInput(stage, call, callKey, callIndex);
|
|
685
729
|
await this.architectureComparison?.beforeDispatch(callKey, input);
|
|
730
|
+
await this.architectureArena?.beforeDispatch(callKey, input);
|
|
686
731
|
this.throwIfAborted(signal);
|
|
687
732
|
}
|
|
688
733
|
catch (error) {
|
|
@@ -818,7 +863,7 @@ export class WorkflowEngine {
|
|
|
818
863
|
callId: call.id,
|
|
819
864
|
contextProducing,
|
|
820
865
|
});
|
|
821
|
-
const artifact = this.maybeWriteArtifact(stage, call, stageIndex, callIndex, result.outputText);
|
|
866
|
+
const artifact = await this.maybeWriteArtifact(stage, call, stageIndex, callIndex, result.outputText);
|
|
822
867
|
const completedAt = new Date().toISOString();
|
|
823
868
|
const durationMs = Date.now() - startedAtMs;
|
|
824
869
|
const observedInvocation = extractObservedInvocation(result.debugMetadata);
|
|
@@ -937,7 +982,9 @@ export class WorkflowEngine {
|
|
|
937
982
|
// parse problem on a transport failure still means delivery is incomplete.
|
|
938
983
|
this.verifiedRepair.noteInvalidArtifact(callKey, new SchemaValidationError("native provider output failed strict JSON validation"));
|
|
939
984
|
}
|
|
940
|
-
|
|
985
|
+
// Read from the in-process marker only; the message can be provider text.
|
|
986
|
+
const failureKind = isRootBusyBeforeSpawn(lastError) ? "busy_before_spawn" : undefined;
|
|
987
|
+
this.artifactStore.noteFailedCall(stage.id, call.id, message, { failureClass: lastFailureClass, failureKind });
|
|
941
988
|
logger.warn({ run_id: this.runId, stage_id: stage.id, call_id: call.id, err: message, retries: finalRetryCount }, "workflow call failed");
|
|
942
989
|
const completedAt = new Date().toISOString();
|
|
943
990
|
const durationMs = Date.now() - startedAtMs;
|
|
@@ -954,6 +1001,7 @@ export class WorkflowEngine {
|
|
|
954
1001
|
durationMs,
|
|
955
1002
|
error: message,
|
|
956
1003
|
failureClass: lastFailureClass,
|
|
1004
|
+
...(failureKind !== undefined ? { failureKind } : {}),
|
|
957
1005
|
childDebugMetadata: lastChildDebug,
|
|
958
1006
|
});
|
|
959
1007
|
await this.emitProgress({
|
|
@@ -1078,7 +1126,9 @@ export class WorkflowEngine {
|
|
|
1078
1126
|
if (detail == null) {
|
|
1079
1127
|
return undefined;
|
|
1080
1128
|
}
|
|
1081
|
-
const suffix = buildCorrectiveSuffixText(detail, error instanceof OutputSizeError ? CORRECTIVE_SIZE_SUFFIX_HEADER : CORRECTIVE_SUFFIX_HEADER)
|
|
1129
|
+
const suffix = buildCorrectiveSuffixText(detail, error instanceof OutputSizeError ? CORRECTIVE_SIZE_SUFFIX_HEADER : CORRECTIVE_SUFFIX_HEADER, failedViaResultContract(error)
|
|
1130
|
+
? `${CORRECTIVE_SUFFIX_FOOTER}${CORRECTIVE_RESULT_FILE_FOOTER}`
|
|
1131
|
+
: CORRECTIVE_SUFFIX_FOOTER);
|
|
1082
1132
|
try {
|
|
1083
1133
|
const basePrompt = typeof input["prompt"] === "string" ? input["prompt"] : "";
|
|
1084
1134
|
const files = Array.isArray(input["absolute_file_paths"])
|
|
@@ -1133,8 +1183,96 @@ export class WorkflowEngine {
|
|
|
1133
1183
|
await this.verifiedRepair?.beforeDispatch(`${stage.id}.${call.id}`, dispatchInput, signal);
|
|
1134
1184
|
this.throwIfAborted(signal);
|
|
1135
1185
|
const finalDispatchDeadline = this.computeDispatchDeadline(call);
|
|
1186
|
+
if (this.pingPong !== undefined) {
|
|
1187
|
+
return await this.invokePingPongCall(stage, call, dispatchInput, signal, finalDispatchDeadline.timeoutMs, sessionLogOwner);
|
|
1188
|
+
}
|
|
1136
1189
|
return await callClink(this.session, dispatchInput, signal, { stageId: stage.id, callId: call.id }, finalDispatchDeadline.timeoutMs, sessionLogOwner);
|
|
1137
1190
|
}
|
|
1191
|
+
/**
|
|
1192
|
+
* Ping-pong seat dispatch: recipe call options (worktree cwd, confirmed
|
|
1193
|
+
* exit), operation intent before and result after every attempt, and two
|
|
1194
|
+
* in-place retry arms with independent counters: busy-before-spawn,
|
|
1195
|
+
* bounded by PP_BUSY_ATTEMPTS, and the runtime-decided reviewer retry
|
|
1196
|
+
* (D-C), bounded by PP_REVIEWER_RETRIES and dispatched with the rebuilt
|
|
1197
|
+
* packet.
|
|
1198
|
+
*/
|
|
1199
|
+
async invokePingPongCall(stage, call, dispatchInput, signal, timeoutMs, sessionLogOwner) {
|
|
1200
|
+
const pingPong = this.pingPong;
|
|
1201
|
+
const callKey = `${stage.id}.${call.id}`;
|
|
1202
|
+
let input = dispatchInput;
|
|
1203
|
+
let busyAttempts = 0;
|
|
1204
|
+
let reviewerRetries = 0;
|
|
1205
|
+
// Only the runtime's "retry" after a dispatch that ran is a reviewer retry.
|
|
1206
|
+
const reviewerRetry = (decision, dispatchedPacket) => {
|
|
1207
|
+
if (decision !== "retry" || reviewerRetries >= PP_REVIEWER_RETRIES)
|
|
1208
|
+
return false;
|
|
1209
|
+
reviewerRetries += 1;
|
|
1210
|
+
input = this.rebuildPingPongInput(input, dispatchedPacket, pingPong.providerPacket(callKey));
|
|
1211
|
+
return true;
|
|
1212
|
+
};
|
|
1213
|
+
for (;;) {
|
|
1214
|
+
const dispatchedPacket = pingPong.providerPacket(callKey);
|
|
1215
|
+
await pingPong.beforeDispatch(callKey, signal);
|
|
1216
|
+
let observed = false;
|
|
1217
|
+
let exit;
|
|
1218
|
+
let result;
|
|
1219
|
+
// Only the dispatch is guarded: a throw from settling a successful
|
|
1220
|
+
// result must not be settled a second time as a failed dispatch.
|
|
1221
|
+
try {
|
|
1222
|
+
result = await callClink(this.session, input, signal, { stageId: stage.id, callId: call.id }, timeoutMs,
|
|
1223
|
+
// A retried reviewer dispatch is its own session-log lane.
|
|
1224
|
+
sessionLogOwner?.family === "workflow" && reviewerRetries > 0
|
|
1225
|
+
? { ...sessionLogOwner, attempt: (sessionLogOwner.attempt ?? 1) + reviewerRetries }
|
|
1226
|
+
: sessionLogOwner, {
|
|
1227
|
+
options: pingPong.recipeCallOptions(callKey),
|
|
1228
|
+
onResult: (processGroupExit) => { observed = true; exit = processGroupExit; },
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
catch (error) {
|
|
1232
|
+
// A recipe call that is cancelled throws carrying the same
|
|
1233
|
+
// processGroupExit evidence a result would; absent means unconfirmed.
|
|
1234
|
+
const thrownExit = error?.processGroupExit;
|
|
1235
|
+
if (!observed && thrownExit !== null && typeof thrownExit === "object" &&
|
|
1236
|
+
typeof thrownExit.exited === "boolean") {
|
|
1237
|
+
observed = true;
|
|
1238
|
+
exit = { exited: thrownExit.exited };
|
|
1239
|
+
}
|
|
1240
|
+
if (!observed && isRootBusyBeforeSpawn(error)) {
|
|
1241
|
+
busyAttempts += 1;
|
|
1242
|
+
const final = busyAttempts >= PP_BUSY_ATTEMPTS;
|
|
1243
|
+
await pingPong.afterDispatch(callKey, { kind: "busy", final }, signal);
|
|
1244
|
+
if (!final) {
|
|
1245
|
+
await abortableDelay(PP_BUSY_BACKOFF_MS[busyAttempts - 1] ?? PP_BUSY_BACKOFF_MS.at(-1), signal);
|
|
1246
|
+
continue;
|
|
1247
|
+
}
|
|
1248
|
+
throw error;
|
|
1249
|
+
}
|
|
1250
|
+
const decision = await pingPong.afterDispatch(callKey, observed ? { kind: "result", outputText: "", isError: true, exit, error } : { kind: "thrown", error }, signal);
|
|
1251
|
+
if (reviewerRetry(decision, dispatchedPacket))
|
|
1252
|
+
continue;
|
|
1253
|
+
throw error;
|
|
1254
|
+
}
|
|
1255
|
+
const decision = await pingPong.afterDispatch(callKey, { kind: "result", outputText: result.outputText, isError: false, exit }, signal);
|
|
1256
|
+
if (reviewerRetry(decision, dispatchedPacket))
|
|
1257
|
+
continue;
|
|
1258
|
+
return result;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* The dispatched prompt with its trailing ping-pong packet replaced by the
|
|
1263
|
+
* rebuilt one, re-checked against the prompt budget. Fails closed when the
|
|
1264
|
+
* prompt does not end with the packet it was dispatched with.
|
|
1265
|
+
*/
|
|
1266
|
+
rebuildPingPongInput(input, dispatchedPacket, nextPacket) {
|
|
1267
|
+
const prompt = input["prompt"];
|
|
1268
|
+
const dispatchedTail = `${PING_PONG_PACKET_HEADER}${dispatchedPacket ?? ""}`;
|
|
1269
|
+
if (dispatchedPacket === undefined || nextPacket === undefined || typeof prompt !== "string" || !prompt.endsWith(dispatchedTail)) {
|
|
1270
|
+
throw new WorkflowError("ping-pong reviewer retry cannot rebuild the dispatched prompt");
|
|
1271
|
+
}
|
|
1272
|
+
const rebuilt = { ...input, prompt: `${prompt.slice(0, prompt.length - dispatchedTail.length)}${PING_PONG_PACKET_HEADER}${nextPacket}` };
|
|
1273
|
+
enforcePromptBudget(this.estimateInputPromptBudget(rebuilt));
|
|
1274
|
+
return rebuilt;
|
|
1275
|
+
}
|
|
1138
1276
|
computeDispatchDeadline(call) {
|
|
1139
1277
|
const configuredCallTimeoutMs = call.timeout_seconds != null
|
|
1140
1278
|
? Math.max((call.timeout_seconds * 1000) + CALL_TIMEOUT_BUFFER_MS, DEFAULT_PARENT_CALL_TIMEOUT_MS)
|
|
@@ -1175,24 +1313,31 @@ export class WorkflowEngine {
|
|
|
1175
1313
|
callRemainingMs,
|
|
1176
1314
|
})}`,
|
|
1177
1315
|
};
|
|
1316
|
+
enforcePromptBudget(this.estimateInputPromptBudget(guidedInput));
|
|
1317
|
+
return guidedInput;
|
|
1318
|
+
}
|
|
1319
|
+
/** Prompt-budget estimate of a fully built call input (prompt, context, files, images). */
|
|
1320
|
+
estimateInputPromptBudget(input) {
|
|
1178
1321
|
const filePaths = Array.isArray(input["absolute_file_paths"])
|
|
1179
1322
|
? input["absolute_file_paths"].filter((path) => typeof path === "string")
|
|
1180
1323
|
: [];
|
|
1181
1324
|
const imagePaths = Array.isArray(input["images"])
|
|
1182
1325
|
? input["images"].filter((path) => typeof path === "string")
|
|
1183
1326
|
: [];
|
|
1184
|
-
|
|
1185
|
-
promptText:
|
|
1327
|
+
return estimatePromptBudget({
|
|
1328
|
+
promptText: typeof input["prompt"] === "string" ? input["prompt"] : "",
|
|
1186
1329
|
contextText: typeof input["context"] === "string" ? input["context"] : undefined,
|
|
1187
1330
|
fileContributors: filePaths.map((path) => createPathContributor(`absolute_file_paths:${path}`, path, "file")),
|
|
1188
1331
|
imageContributors: imagePaths.map((path) => createPathContributor(`image:${path}`, path, "image")),
|
|
1189
1332
|
maxBytes: this.maxPromptBytes,
|
|
1190
1333
|
reserveBytes: this.promptReserveBytes,
|
|
1191
1334
|
});
|
|
1192
|
-
enforcePromptBudget(estimate);
|
|
1193
|
-
return guidedInput;
|
|
1194
1335
|
}
|
|
1195
|
-
|
|
1336
|
+
/**
|
|
1337
|
+
* The artifact (and any recipe evidence it updates) is durable before it
|
|
1338
|
+
* returns, so the succeeded call state that names it is published second.
|
|
1339
|
+
*/
|
|
1340
|
+
async maybeWriteArtifact(stage, call, stageIndex, callIndex, outputText) {
|
|
1196
1341
|
const requiresValidation = call.validator_schema_id != null;
|
|
1197
1342
|
if (!requiresValidation) {
|
|
1198
1343
|
return undefined;
|
|
@@ -1205,6 +1350,7 @@ export class WorkflowEngine {
|
|
|
1205
1350
|
try {
|
|
1206
1351
|
validated = this.artifactStore.validateJsonOutput(stage.id, call.id, validatorSchemaId, outputText);
|
|
1207
1352
|
this.architectureComparison?.validateOutput(`${stage.id}.${call.id}`, validated.parsed);
|
|
1353
|
+
this.architectureArena?.validateOutput(`${stage.id}.${call.id}`, validated.parsed);
|
|
1208
1354
|
this.verifiedRepair?.validateOutput(`${stage.id}.${call.id}`, validated.parsed);
|
|
1209
1355
|
}
|
|
1210
1356
|
catch (error) {
|
|
@@ -1259,14 +1405,15 @@ export class WorkflowEngine {
|
|
|
1259
1405
|
sizeBytes: Buffer.byteLength(serialized, "utf-8"),
|
|
1260
1406
|
};
|
|
1261
1407
|
}
|
|
1262
|
-
const artifact = this.artifactStore.writeCallArtifact({
|
|
1408
|
+
const artifact = await this.artifactStore.writeCallArtifact({
|
|
1263
1409
|
stage,
|
|
1264
1410
|
call,
|
|
1265
1411
|
stageIndex,
|
|
1266
1412
|
callIndex,
|
|
1267
1413
|
validated: persisted,
|
|
1268
1414
|
});
|
|
1269
|
-
this.architectureComparison?.recordWritten(artifact);
|
|
1415
|
+
await this.architectureComparison?.recordWritten(artifact);
|
|
1416
|
+
await this.architectureArena?.recordWritten(artifact);
|
|
1270
1417
|
this.verifiedRepair?.recordWritten(artifact);
|
|
1271
1418
|
return artifact;
|
|
1272
1419
|
}
|
|
@@ -1530,6 +1677,9 @@ export class WorkflowEngine {
|
|
|
1530
1677
|
...(this.definition.settings.include_selected_context_artifact === true
|
|
1531
1678
|
? { includeSelectedContext: true }
|
|
1532
1679
|
: {}),
|
|
1680
|
+
// D-B: ping-pong roots are its own baseline worktree; a cached bundle
|
|
1681
|
+
// keyed by a shared-checkout signature must never stand in for it.
|
|
1682
|
+
...(this.pingPong !== undefined ? { bypassCache: true } : {}),
|
|
1533
1683
|
...(contextBudgetAdapter == null || contextBudgetAdapter.trim() === ""
|
|
1534
1684
|
? {}
|
|
1535
1685
|
: { context_budget_adapter: contextBudgetAdapter }),
|
|
@@ -1916,9 +2066,12 @@ export class WorkflowEngine {
|
|
|
1916
2066
|
// Frozen source text is data, never template input; count every delivered
|
|
1917
2067
|
// byte in the same authoritative prompt budget as the rendered template.
|
|
1918
2068
|
const repairPacket = this.verifiedRepair?.providerPacket(callKey);
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1921
|
-
|
|
2069
|
+
const pingPongPacket = this.pingPong?.providerPacket(callKey);
|
|
2070
|
+
const prompt = repairPacket !== undefined
|
|
2071
|
+
? `${basePrompt}\n\nFROZEN REPAIR PACKET\n${repairPacket}`
|
|
2072
|
+
: pingPongPacket !== undefined
|
|
2073
|
+
? `${basePrompt}${PING_PONG_PACKET_HEADER}${pingPongPacket}`
|
|
2074
|
+
: basePrompt;
|
|
1922
2075
|
const contextArtifacts = call.anonymize_context === true
|
|
1923
2076
|
? this.artifactStore.buildAnonymizedContext(this.definition, call.context_from, callIndex, call.plan_review_semantic_context === true
|
|
1924
2077
|
? projectPlanReviewSemanticBody
|
|
@@ -2078,7 +2231,10 @@ export class WorkflowEngine {
|
|
|
2078
2231
|
}
|
|
2079
2232
|
for (const failedCall of this.resumeFailedCalls.values()) {
|
|
2080
2233
|
if (failedCall.terminal) {
|
|
2081
|
-
this.artifactStore.seedFailedCall(failedCall.stageId, failedCall.callId, failedCall.error
|
|
2234
|
+
this.artifactStore.seedFailedCall(failedCall.stageId, failedCall.callId, failedCall.error, {
|
|
2235
|
+
failureClass: failedCall.failureClass,
|
|
2236
|
+
failureKind: failedCall.failureKind,
|
|
2237
|
+
});
|
|
2082
2238
|
}
|
|
2083
2239
|
}
|
|
2084
2240
|
}
|
|
@@ -2268,6 +2424,22 @@ const CORRECTIVE_SUFFIX_HEADER = "\n\n---\nCORRECTION: Your previous response wa
|
|
|
2268
2424
|
const CORRECTIVE_SIZE_SUFFIX_HEADER = "\n\n---\nCORRECTION: Your previous response was rejected because the pretty-printed JSON exceeded the validator byte cap. Shrink the deliverable first. Failure: ";
|
|
2269
2425
|
const CORRECTIVE_SUFFIX_FOOTER = "\nReturn ONLY a single JSON object conforming to the declared contract — no prose, no markdown, " +
|
|
2270
2426
|
"no code fences, and nothing before or after the JSON object.";
|
|
2427
|
+
// The footer alone let a provider fix stdout while rewriting the result file
|
|
2428
|
+
// as Markdown. The filename never reaches the engine (ChildFailureMetadata
|
|
2429
|
+
// carries only parse_source), so the instruction refers to it generically.
|
|
2430
|
+
const CORRECTIVE_RESULT_FILE_FOOTER = "\nThe result file named in your instructions must contain only that single JSON value — " +
|
|
2431
|
+
"no Markdown, no prose, and no code fences.";
|
|
2432
|
+
/**
|
|
2433
|
+
* Whether the rejected output was read from the result file. A
|
|
2434
|
+
* TypedResultFidelityError is only ever raised for result-contract output.
|
|
2435
|
+
*/
|
|
2436
|
+
function failedViaResultContract(error) {
|
|
2437
|
+
if (error instanceof TypedResultFidelityError) {
|
|
2438
|
+
return true;
|
|
2439
|
+
}
|
|
2440
|
+
return error instanceof CallExecutionError &&
|
|
2441
|
+
error.childDebugMetadata?.parse_source === "result_contract";
|
|
2442
|
+
}
|
|
2271
2443
|
/**
|
|
2272
2444
|
* Detail text for a JSON/schema-shaped failure, or undefined when the failure
|
|
2273
2445
|
* is not one a corrective re-prompt could fix (transport death, timeout, …).
|
|
@@ -2308,14 +2480,14 @@ function foldExternalGapPolicy(delegate, policy) {
|
|
|
2308
2480
|
}
|
|
2309
2481
|
return { ...delegate, external_gap_policy: policy };
|
|
2310
2482
|
}
|
|
2311
|
-
function buildCorrectiveSuffixText(detail, header = CORRECTIVE_SUFFIX_HEADER) {
|
|
2483
|
+
function buildCorrectiveSuffixText(detail, header = CORRECTIVE_SUFFIX_HEADER, footer = CORRECTIVE_SUFFIX_FOOTER) {
|
|
2312
2484
|
const budget = CORRECTIVE_SUFFIX_MAX_CHARS -
|
|
2313
2485
|
header.length -
|
|
2314
|
-
|
|
2486
|
+
footer.length;
|
|
2315
2487
|
const bounded = detail.length > budget
|
|
2316
2488
|
? `${detail.slice(0, Math.max(0, budget - 1))}…`
|
|
2317
2489
|
: detail;
|
|
2318
|
-
return `${header}${bounded}${
|
|
2490
|
+
return `${header}${bounded}${footer}`;
|
|
2319
2491
|
}
|
|
2320
2492
|
/**
|
|
2321
2493
|
* Determine whether an error is retryable based on the retry mode (5-1, 5-2).
|