clinkx 0.3.0 → 1.0.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 +33 -0
- package/LICENSE +10 -0
- package/README.md +82 -26
- package/clinkx-workflows/dist/allowed-roots.d.ts +1 -0
- package/clinkx-workflows/dist/allowed-roots.js +5 -0
- package/clinkx-workflows/dist/allowed-roots.js.map +1 -0
- package/clinkx-workflows/dist/artifacts.d.ts +20 -1
- package/clinkx-workflows/dist/artifacts.js +38 -9
- package/clinkx-workflows/dist/artifacts.js.map +1 -1
- package/clinkx-workflows/dist/backend.d.ts +4 -0
- package/clinkx-workflows/dist/citation-check.d.ts +40 -0
- package/clinkx-workflows/dist/citation-check.js +348 -0
- package/clinkx-workflows/dist/citation-check.js.map +1 -0
- package/clinkx-workflows/dist/clink-client.d.ts +2 -1
- package/clinkx-workflows/dist/clink-client.js +17 -4
- package/clinkx-workflows/dist/clink-client.js.map +1 -1
- package/clinkx-workflows/dist/config.d.ts +145 -16
- package/clinkx-workflows/dist/config.js +384 -26
- package/clinkx-workflows/dist/config.js.map +1 -1
- package/clinkx-workflows/dist/contained-file.d.ts +172 -0
- package/clinkx-workflows/dist/contained-file.js +483 -0
- package/clinkx-workflows/dist/contained-file.js.map +1 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-contract.d.ts +416 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-contract.js +328 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-contract.js.map +1 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-router.d.ts +24 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-router.js +39 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-router.js.map +1 -0
- package/clinkx-workflows/dist/context-cache-key.d.ts +53 -0
- package/clinkx-workflows/dist/context-cache-key.js +91 -0
- package/clinkx-workflows/dist/context-cache-key.js.map +1 -0
- package/clinkx-workflows/dist/context-mode-resolver.d.ts +27 -0
- package/clinkx-workflows/dist/context-mode-resolver.js +126 -0
- package/clinkx-workflows/dist/context-mode-resolver.js.map +1 -0
- package/clinkx-workflows/dist/context-preflight.d.ts +184 -0
- package/clinkx-workflows/dist/context-preflight.js +91 -0
- package/clinkx-workflows/dist/context-preflight.js.map +1 -0
- package/clinkx-workflows/dist/council-expander.d.ts +1 -1
- package/clinkx-workflows/dist/council-expander.js +2 -1
- package/clinkx-workflows/dist/council-expander.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +165 -0
- package/clinkx-workflows/dist/dashboard/activity-contract.js +105 -0
- package/clinkx-workflows/dist/dashboard/activity-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/activity-lease.d.ts +25 -0
- package/clinkx-workflows/dist/dashboard/activity-lease.js +34 -0
- package/clinkx-workflows/dist/dashboard/activity-lease.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.d.ts +86 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.js +480 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/api-routes.d.ts +36 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js +1047 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/artifact-index.d.ts +37 -0
- package/clinkx-workflows/dist/dashboard/artifact-index.js +145 -0
- package/clinkx-workflows/dist/dashboard/artifact-index.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.d.ts +31 -0
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.js +65 -0
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/controller.d.ts +26 -0
- package/clinkx-workflows/dist/dashboard/auth/controller.js +596 -0
- package/clinkx-workflows/dist/dashboard/auth/controller.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/credential-store.d.ts +60 -0
- package/clinkx-workflows/dist/dashboard/auth/credential-store.js +776 -0
- package/clinkx-workflows/dist/dashboard/auth/credential-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.d.ts +9 -0
- package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.js +44 -0
- package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/session-store.d.ts +17 -0
- package/clinkx-workflows/dist/dashboard/auth/session-store.js +77 -0
- package/clinkx-workflows/dist/dashboard/auth/session-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/webauthn-service.d.ts +25 -0
- package/clinkx-workflows/dist/dashboard/auth/webauthn-service.js +71 -0
- package/clinkx-workflows/dist/dashboard/auth/webauthn-service.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/context-run-liveness.d.ts +37 -0
- package/clinkx-workflows/dist/dashboard/context-run-liveness.js +49 -0
- package/clinkx-workflows/dist/dashboard/context-run-liveness.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.d.ts +222 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.js +1178 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/contracts.d.ts +8936 -0
- package/clinkx-workflows/dist/dashboard/contracts.js +1157 -0
- package/clinkx-workflows/dist/dashboard/contracts.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/generation.d.ts +14 -0
- package/clinkx-workflows/dist/dashboard/generation.js +41 -0
- package/clinkx-workflows/dist/dashboard/generation.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/index.d.ts +28 -0
- package/clinkx-workflows/dist/dashboard/index.js +16 -0
- package/clinkx-workflows/dist/dashboard/index.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.d.ts +101 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.js +748 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +303 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.js +221 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-reader.d.ts +50 -0
- package/clinkx-workflows/dist/dashboard/progress-report-reader.js +581 -0
- package/clinkx-workflows/dist/dashboard/progress-report-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.d.ts +89 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.js +71 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.d.ts +28 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js +110 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/read-model.d.ts +86 -0
- package/clinkx-workflows/dist/dashboard/read-model.js +440 -0
- package/clinkx-workflows/dist/dashboard/read-model.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/request-admission.d.ts +31 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js +126 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/scanner.d.ts +75 -0
- package/clinkx-workflows/dist/dashboard/scanner.js +1110 -0
- package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/server-factory.d.ts +50 -0
- package/clinkx-workflows/dist/dashboard/server-factory.js +431 -0
- package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +2611 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.js +480 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-identity.d.ts +21 -0
- package/clinkx-workflows/dist/dashboard/session-log-identity.js +101 -0
- package/clinkx-workflows/dist/dashboard/session-log-identity.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-journal.d.ts +43 -0
- package/clinkx-workflows/dist/dashboard/session-log-journal.js +522 -0
- package/clinkx-workflows/dist/dashboard/session-log-journal.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-reader.d.ts +61 -0
- package/clinkx-workflows/dist/dashboard/session-log-reader.js +378 -0
- package/clinkx-workflows/dist/dashboard/session-log-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.d.ts +6 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js +367 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-retention.d.ts +23 -0
- package/clinkx-workflows/dist/dashboard/session-log-retention.js +212 -0
- package/clinkx-workflows/dist/dashboard/session-log-retention.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/static-responses.d.ts +10 -0
- package/clinkx-workflows/dist/dashboard/static-responses.js +94 -0
- package/clinkx-workflows/dist/dashboard/static-responses.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/worker-lock-observer.d.ts +28 -0
- package/clinkx-workflows/dist/dashboard/worker-lock-observer.js +241 -0
- package/clinkx-workflows/dist/dashboard/worker-lock-observer.js.map +1 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/index-DOkMXTfB.js +25 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/style-ChJsn0KD.css +1 -0
- package/clinkx-workflows/dist/dashboard-ui/contracts/council-plan-review-input-v1.json +158 -0
- package/clinkx-workflows/dist/dashboard-ui/index.html +15 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/IBM-Plex-Mono-OFL.txt +93 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/IBM-Plex-Sans-OFL.txt +93 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/JetBrains-Mono-OFL.txt +93 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/NOTICE.md +32 -0
- package/clinkx-workflows/dist/dashboard-ui/theme-init.js +8 -0
- package/clinkx-workflows/dist/definition-normalizer.d.ts +19 -0
- package/clinkx-workflows/dist/definition-normalizer.js.map +1 -1
- package/clinkx-workflows/dist/delegate-validate.d.ts +78 -0
- package/clinkx-workflows/dist/delegate-validate.js +97 -0
- package/clinkx-workflows/dist/delegate-validate.js.map +1 -0
- package/clinkx-workflows/dist/engine.d.ts +141 -0
- package/clinkx-workflows/dist/engine.js +882 -28
- package/clinkx-workflows/dist/engine.js.map +1 -1
- package/clinkx-workflows/dist/errors.d.ts +2 -0
- package/clinkx-workflows/dist/errors.js.map +1 -1
- package/clinkx-workflows/dist/fingerprint.d.ts +1 -1
- package/clinkx-workflows/dist/fingerprint.js +1 -1
- package/clinkx-workflows/dist/index.d.ts +19 -0
- package/clinkx-workflows/dist/index.js +15 -0
- package/clinkx-workflows/dist/index.js.map +1 -1
- package/clinkx-workflows/dist/loader.d.ts +9 -3
- package/clinkx-workflows/dist/loader.js +92 -21
- package/clinkx-workflows/dist/loader.js.map +1 -1
- package/clinkx-workflows/dist/plan-review/admission.d.ts +160 -0
- package/clinkx-workflows/dist/plan-review/admission.js +290 -0
- package/clinkx-workflows/dist/plan-review/admission.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/context-policy.d.ts +55 -0
- package/clinkx-workflows/dist/plan-review/context-policy.js +146 -0
- package/clinkx-workflows/dist/plan-review/context-policy.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/contract.d.ts +763 -0
- package/clinkx-workflows/dist/plan-review/contract.js +289 -0
- package/clinkx-workflows/dist/plan-review/contract.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/digest.d.ts +68 -0
- package/clinkx-workflows/dist/plan-review/digest.js +241 -0
- package/clinkx-workflows/dist/plan-review/digest.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/discovery.d.ts +45 -0
- package/clinkx-workflows/dist/plan-review/discovery.js +36 -0
- package/clinkx-workflows/dist/plan-review/discovery.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/execution-contract.d.ts +298 -0
- package/clinkx-workflows/dist/plan-review/execution-contract.js +194 -0
- package/clinkx-workflows/dist/plan-review/execution-contract.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/expander.d.ts +48 -0
- package/clinkx-workflows/dist/plan-review/expander.js +243 -0
- package/clinkx-workflows/dist/plan-review/expander.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/projector.d.ts +126 -0
- package/clinkx-workflows/dist/plan-review/projector.js +437 -0
- package/clinkx-workflows/dist/plan-review/projector.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/publication.d.ts +95 -0
- package/clinkx-workflows/dist/plan-review/publication.js +182 -0
- package/clinkx-workflows/dist/plan-review/publication.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/ranking-reducer.d.ts +34 -0
- package/clinkx-workflows/dist/plan-review/ranking-reducer.js +139 -0
- package/clinkx-workflows/dist/plan-review/ranking-reducer.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/resume.d.ts +38 -0
- package/clinkx-workflows/dist/plan-review/resume.js +122 -0
- package/clinkx-workflows/dist/plan-review/resume.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/rubric.d.ts +7 -0
- package/clinkx-workflows/dist/plan-review/rubric.js +24 -0
- package/clinkx-workflows/dist/plan-review/rubric.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/run-state.d.ts +398 -0
- package/clinkx-workflows/dist/plan-review/run-state.js +183 -0
- package/clinkx-workflows/dist/plan-review/run-state.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/runtime-policy.d.ts +74 -0
- package/clinkx-workflows/dist/plan-review/runtime-policy.js +186 -0
- package/clinkx-workflows/dist/plan-review/runtime-policy.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/snapshot.d.ts +81 -0
- package/clinkx-workflows/dist/plan-review/snapshot.js +170 -0
- package/clinkx-workflows/dist/plan-review/snapshot.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/stage-error.d.ts +19 -0
- package/clinkx-workflows/dist/plan-review/stage-error.js +20 -0
- package/clinkx-workflows/dist/plan-review/stage-error.js.map +1 -0
- package/clinkx-workflows/dist/post-processors/index.d.ts +20 -0
- package/clinkx-workflows/dist/post-processors/index.js +21 -0
- package/clinkx-workflows/dist/post-processors/index.js.map +1 -0
- package/clinkx-workflows/dist/prompt-budget.d.ts +7 -0
- package/clinkx-workflows/dist/prompt-budget.js +7 -1
- package/clinkx-workflows/dist/prompt-budget.js.map +1 -1
- package/clinkx-workflows/dist/reducers/index.js +2 -0
- package/clinkx-workflows/dist/reducers/index.js.map +1 -1
- package/clinkx-workflows/dist/run-lock-heartbeat.d.ts +2 -0
- package/clinkx-workflows/dist/run-lock-heartbeat.js +3 -0
- package/clinkx-workflows/dist/run-lock-heartbeat.js.map +1 -0
- package/clinkx-workflows/dist/run-summary/cards/council-plan-review.d.ts +34 -0
- package/clinkx-workflows/dist/run-summary/cards/council-plan-review.js +74 -0
- package/clinkx-workflows/dist/run-summary/cards/council-plan-review.js.map +1 -0
- package/clinkx-workflows/dist/run-summary/cards/index.js +5 -0
- package/clinkx-workflows/dist/run-summary/cards/index.js.map +1 -1
- package/clinkx-workflows/dist/run-summary.d.ts +13 -0
- package/clinkx-workflows/dist/run-summary.js +29 -1
- package/clinkx-workflows/dist/run-summary.js.map +1 -1
- package/clinkx-workflows/dist/schema.d.ts +76 -21
- package/clinkx-workflows/dist/schema.js +10 -1
- package/clinkx-workflows/dist/schema.js.map +1 -1
- package/clinkx-workflows/dist/seed-terms.d.ts +30 -0
- package/clinkx-workflows/dist/seed-terms.js +176 -0
- package/clinkx-workflows/dist/seed-terms.js.map +1 -0
- package/clinkx-workflows/dist/server.d.ts +5 -2
- package/clinkx-workflows/dist/server.js +82 -52
- package/clinkx-workflows/dist/server.js.map +1 -1
- package/clinkx-workflows/dist/shutdown.d.ts +18 -20
- package/clinkx-workflows/dist/shutdown.js +43 -61
- package/clinkx-workflows/dist/shutdown.js.map +1 -1
- package/clinkx-workflows/dist/state-schema.d.ts +38 -0
- package/clinkx-workflows/dist/state.d.ts +170 -3
- package/clinkx-workflows/dist/state.js +1275 -28
- package/clinkx-workflows/dist/state.js.map +1 -1
- package/clinkx-workflows/dist/transport.d.ts +15 -0
- package/clinkx-workflows/dist/transport.js +19 -10
- package/clinkx-workflows/dist/transport.js.map +1 -1
- package/clinkx-workflows/dist/types.d.ts +14 -2
- package/clinkx-workflows/dist/validators/council.d.ts +318 -85
- package/clinkx-workflows/dist/validators/council.js +52 -13
- package/clinkx-workflows/dist/validators/council.js.map +1 -1
- package/clinkx-workflows/dist/validators/index.d.ts +1 -0
- package/clinkx-workflows/dist/validators/index.js +3 -0
- package/clinkx-workflows/dist/validators/index.js.map +1 -1
- package/clinkx-workflows/dist/validators/plan-review.d.ts +398 -0
- package/clinkx-workflows/dist/validators/plan-review.js +316 -0
- package/clinkx-workflows/dist/validators/plan-review.js.map +1 -0
- package/clinkx-workflows/dist/workflow-receipt.js +188 -4
- package/clinkx-workflows/dist/workflow-receipt.js.map +1 -1
- package/clinkx-workflows/dist/workflow-tools.d.ts +48 -3
- package/clinkx-workflows/dist/workflow-tools.js +1402 -59
- package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
- package/clinkx-workflows/dist/workspace-signature.d.ts +16 -0
- package/clinkx-workflows/dist/workspace-signature.js +388 -0
- package/clinkx-workflows/dist/workspace-signature.js.map +1 -0
- package/clinkx-workflows/templates/council/answer-specialist.txt +2 -1
- package/clinkx-workflows/templates/council/code-review-chairman.txt +13 -0
- package/clinkx-workflows/templates/council/code-review-cross-reviewer.txt +4 -1
- package/clinkx-workflows/templates/council/code-review-reviewer.txt +19 -3
- package/clinkx-workflows/templates/council/debug-debugger.txt +2 -1
- package/clinkx-workflows/templates/council/discover-analyst.txt +2 -1
- package/clinkx-workflows/templates/council/member.txt +2 -1
- package/clinkx-workflows/templates/council/plan-review-chairman.txt +68 -0
- package/clinkx-workflows/templates/council/plan-review-cross-reviewer.txt +51 -0
- package/clinkx-workflows/templates/council/plan-review-reviewer.txt +60 -0
- package/clinkx-workflows/templates/plan-review/chairman.txt +48 -0
- package/clinkx-workflows/templates/plan-review/cross-review.txt +52 -0
- package/clinkx-workflows/templates/plan-review/ranking.txt +16 -0
- package/clinkx-workflows/templates/plan-review/reviewer.txt +57 -0
- package/clinkx-workflows/workflows/council-answer.yaml +97 -8
- package/clinkx-workflows/workflows/council-code-review.yaml +103 -8
- package/clinkx-workflows/workflows/council-debug.yaml +97 -8
- package/clinkx-workflows/workflows/council-default.yaml +97 -8
- package/clinkx-workflows/workflows/council-discover.yaml +97 -8
- package/clinkx-workflows/workflows/council-plan-review.yaml +250 -0
- package/clinkx-workflows/workflows/plan-review-receipts.yaml +230 -0
- package/conf/adapters/agy.json +49 -0
- package/conf/adapters/claude.json +5 -0
- package/conf/adapters/codex-app-server.json +44 -0
- package/conf/adapters/codex.json +7 -2
- package/conf/adapters/glm.json +5 -0
- package/conf/adapters/grok.json +60 -0
- package/conf/adapters/hapi/agy.json +52 -0
- package/conf/adapters/hapi/claude.json +5 -0
- package/conf/adapters/hapi/codex.json +7 -2
- package/conf/adapters/hapi/glm.json +5 -0
- package/dist/activity-journal.d.ts +42 -0
- package/dist/activity-journal.js +381 -0
- package/dist/activity-journal.js.map +1 -0
- package/dist/allowed-roots.d.ts +41 -0
- package/dist/allowed-roots.js +125 -3
- package/dist/allowed-roots.js.map +1 -1
- package/dist/codex/activity-session-log.d.ts +14 -0
- package/dist/codex/activity-session-log.js +206 -0
- package/dist/codex/activity-session-log.js.map +1 -0
- package/dist/codex/agent-tools.d.ts +23 -0
- package/dist/codex/agent-tools.js +1270 -0
- package/dist/codex/agent-tools.js.map +1 -0
- package/dist/codex/app-server-client.d.ts +76 -0
- package/dist/codex/app-server-client.js +582 -0
- package/dist/codex/app-server-client.js.map +1 -0
- package/dist/codex/app-server-registry.d.ts +389 -0
- package/dist/codex/app-server-registry.js +1407 -0
- package/dist/codex/app-server-registry.js.map +1 -0
- package/dist/codex/client-types.d.ts +109 -0
- package/dist/codex/client-types.js +2 -0
- package/dist/codex/client-types.js.map +1 -0
- package/dist/codex/protocol.d.ts +5375 -0
- package/dist/codex/protocol.js +614 -0
- package/dist/codex/protocol.js.map +1 -0
- package/dist/codex/session.d.ts +263 -0
- package/dist/codex/session.js +466 -0
- package/dist/codex/session.js.map +1 -0
- package/dist/config.d.ts +185 -19
- package/dist/config.js +82 -16
- package/dist/config.js.map +1 -1
- package/dist/context-builder/anchors.d.ts +1 -0
- package/dist/context-builder/anchors.js +3 -0
- package/dist/context-builder/anchors.js.map +1 -1
- package/dist/context-builder/bundle.d.ts +35 -2
- package/dist/context-builder/bundle.js +342 -2417
- package/dist/context-builder/bundle.js.map +1 -1
- package/dist/context-builder/codemap.d.ts +5 -0
- package/dist/context-builder/codemap.js +387 -13
- package/dist/context-builder/codemap.js.map +1 -1
- package/dist/context-builder/config.d.ts +1 -0
- package/dist/context-builder/config.js +12 -0
- package/dist/context-builder/config.js.map +1 -1
- package/dist/context-builder/context-run-catalog.d.ts +17 -0
- package/dist/context-builder/context-run-catalog.js +99 -0
- package/dist/context-builder/context-run-catalog.js.map +1 -0
- package/dist/context-builder/delegate-packet.d.ts +37 -0
- package/dist/context-builder/delegate-packet.js +359 -67
- package/dist/context-builder/delegate-packet.js.map +1 -1
- package/dist/context-builder/delegate-validation.d.ts +10 -1
- package/dist/context-builder/delegate-validation.js +153 -41
- package/dist/context-builder/delegate-validation.js.map +1 -1
- package/dist/context-builder/delegate.d.ts +2 -0
- package/dist/context-builder/delegate.js +1 -0
- package/dist/context-builder/delegate.js.map +1 -1
- package/dist/context-builder/diagnostics.d.ts +11 -2
- package/dist/context-builder/diagnostics.js +39 -6
- package/dist/context-builder/diagnostics.js.map +1 -1
- package/dist/context-builder/discovery.d.ts +29 -1
- package/dist/context-builder/discovery.js +475 -175
- package/dist/context-builder/discovery.js.map +1 -1
- package/dist/context-builder/globs.js +10 -10
- package/dist/context-builder/globs.js.map +1 -1
- package/dist/context-builder/handler.d.ts +26 -2
- package/dist/context-builder/handler.js +1158 -2416
- package/dist/context-builder/handler.js.map +1 -1
- package/dist/context-builder/lifecycle-contract.d.ts +424 -0
- package/dist/context-builder/lifecycle-contract.js +523 -0
- package/dist/context-builder/lifecycle-contract.js.map +1 -0
- package/dist/context-builder/lifecycle-journal.d.ts +62 -0
- package/dist/context-builder/lifecycle-journal.js +88 -0
- package/dist/context-builder/lifecycle-journal.js.map +1 -0
- package/dist/context-builder/lifecycle-observer.d.ts +102 -0
- package/dist/context-builder/lifecycle-observer.js +258 -0
- package/dist/context-builder/lifecycle-observer.js.map +1 -0
- package/dist/context-builder/lifecycle-reconcile.d.ts +32 -0
- package/dist/context-builder/lifecycle-reconcile.js +191 -0
- package/dist/context-builder/lifecycle-reconcile.js.map +1 -0
- package/dist/context-builder/lifecycle-recovery.d.ts +2 -0
- package/dist/context-builder/lifecycle-recovery.js +14 -0
- package/dist/context-builder/lifecycle-recovery.js.map +1 -0
- package/dist/context-builder/path-signals.js +9 -5
- package/dist/context-builder/path-signals.js.map +1 -1
- package/dist/context-builder/progress.d.ts +3 -1
- package/dist/context-builder/progress.js +23 -0
- package/dist/context-builder/progress.js.map +1 -1
- package/dist/context-builder/receipt.d.ts +6 -4
- package/dist/context-builder/receipt.js +12 -1
- package/dist/context-builder/receipt.js.map +1 -1
- package/dist/context-builder/refine-handler.d.ts +14 -0
- package/dist/context-builder/refine-handler.js +790 -0
- package/dist/context-builder/refine-handler.js.map +1 -0
- package/dist/context-builder/review-coverage.d.ts +84 -0
- package/dist/context-builder/review-coverage.js +437 -0
- package/dist/context-builder/review-coverage.js.map +1 -0
- package/dist/context-builder/schema.d.ts +239 -1
- package/dist/context-builder/schema.js +112 -6
- package/dist/context-builder/schema.js.map +1 -1
- package/dist/context-builder/secrets.d.ts +28 -0
- package/dist/context-builder/secrets.js +1473 -44
- package/dist/context-builder/secrets.js.map +1 -1
- package/dist/context-builder/selection.d.ts +7 -3
- package/dist/context-builder/selection.js +200 -738
- package/dist/context-builder/selection.js.map +1 -1
- package/dist/context-builder/session-log-identity.d.ts +1 -0
- package/dist/context-builder/session-log-identity.js +66 -0
- package/dist/context-builder/session-log-identity.js.map +1 -0
- package/dist/context-builder/slice-range-math.d.ts +16 -0
- package/dist/context-builder/slice-range-math.js +137 -0
- package/dist/context-builder/slice-range-math.js.map +1 -0
- package/dist/context-builder/status.d.ts +22 -1
- package/dist/context-builder/status.js +59 -4
- package/dist/context-builder/status.js.map +1 -1
- package/dist/context-builder/storage.d.ts +35 -2
- package/dist/context-builder/storage.js +271 -14
- package/dist/context-builder/storage.js.map +1 -1
- package/dist/context-builder/token-estimate.d.ts +13 -2
- package/dist/context-builder/token-estimate.js +77 -4
- package/dist/context-builder/token-estimate.js.map +1 -1
- package/dist/context-builder/versions.d.ts +29 -0
- package/dist/context-builder/versions.js +30 -0
- package/dist/context-builder/versions.js.map +1 -0
- package/dist/context-builder/workflow-runner.d.ts +69 -0
- package/dist/context-builder/workflow-runner.js +1051 -0
- package/dist/context-builder/workflow-runner.js.map +1 -0
- package/dist/context-builder/write-watchdog.d.ts +14 -0
- package/dist/context-builder/write-watchdog.js +38 -0
- package/dist/context-builder/write-watchdog.js.map +1 -0
- package/dist/dashboard-adapter-catalog.d.ts +9 -0
- package/dist/dashboard-adapter-catalog.js +46 -0
- package/dist/dashboard-adapter-catalog.js.map +1 -0
- package/dist/dashboard-cli.d.ts +79 -0
- package/dist/dashboard-cli.js +585 -0
- package/dist/dashboard-cli.js.map +1 -0
- package/dist/dashboard-companion/client.d.ts +36 -0
- package/dist/dashboard-companion/client.js +210 -0
- package/dist/dashboard-companion/client.js.map +1 -0
- package/dist/dashboard-companion/config.d.ts +8 -0
- package/dist/dashboard-companion/config.js +52 -0
- package/dist/dashboard-companion/config.js.map +1 -0
- package/dist/dashboard-companion/http-proxy.d.ts +10 -0
- package/dist/dashboard-companion/http-proxy.js +234 -0
- package/dist/dashboard-companion/http-proxy.js.map +1 -0
- package/dist/dashboard-companion/protocol.d.ts +80 -0
- package/dist/dashboard-companion/protocol.js +455 -0
- package/dist/dashboard-companion/protocol.js.map +1 -0
- package/dist/dashboard-companion/standalone-assets.d.ts +12 -0
- package/dist/dashboard-companion/standalone-assets.js +72 -0
- package/dist/dashboard-companion/standalone-assets.js.map +1 -0
- package/dist/dashboard-companion/standalone-entry.d.ts +1 -0
- package/dist/dashboard-companion/standalone-entry.js +17 -0
- package/dist/dashboard-companion/standalone-entry.js.map +1 -0
- package/dist/dashboard-gateway/config.d.ts +9 -0
- package/dist/dashboard-gateway/config.js +44 -0
- package/dist/dashboard-gateway/config.js.map +1 -0
- package/dist/dashboard-gateway/index.d.ts +11 -0
- package/dist/dashboard-gateway/index.js +755 -0
- package/dist/dashboard-gateway/index.js.map +1 -0
- package/dist/dashboard-gateway/main.d.ts +1 -0
- package/dist/dashboard-gateway/main.js +25 -0
- package/dist/dashboard-gateway/main.js.map +1 -0
- package/dist/dashboard-pairing-token.d.ts +1 -0
- package/dist/dashboard-pairing-token.js +5 -0
- package/dist/dashboard-pairing-token.js.map +1 -0
- package/dist/elaris/client.d.ts +73 -0
- package/dist/elaris/client.js +825 -0
- package/dist/elaris/client.js.map +1 -0
- package/dist/elaris/config.d.ts +18 -0
- package/dist/elaris/config.js +75 -0
- package/dist/elaris/config.js.map +1 -0
- package/dist/elaris/errors.d.ts +41 -0
- package/dist/elaris/errors.js +205 -0
- package/dist/elaris/errors.js.map +1 -0
- package/dist/elaris/github-repo.d.ts +18 -0
- package/dist/elaris/github-repo.js +89 -0
- package/dist/elaris/github-repo.js.map +1 -0
- package/dist/elaris/index.d.ts +10 -0
- package/dist/elaris/index.js +11 -0
- package/dist/elaris/index.js.map +1 -0
- package/dist/elaris/redact.d.ts +89 -0
- package/dist/elaris/redact.js +423 -0
- package/dist/elaris/redact.js.map +1 -0
- package/dist/elaris/run-id.d.ts +5 -0
- package/dist/elaris/run-id.js +20 -0
- package/dist/elaris/run-id.js.map +1 -0
- package/dist/elaris/status.d.ts +45 -0
- package/dist/elaris/status.js +122 -0
- package/dist/elaris/status.js.map +1 -0
- package/dist/elaris/tool-schemas.d.ts +314 -0
- package/dist/elaris/tool-schemas.js +208 -0
- package/dist/elaris/tool-schemas.js.map +1 -0
- package/dist/elaris/tools.d.ts +73 -0
- package/dist/elaris/tools.js +1065 -0
- package/dist/elaris/tools.js.map +1 -0
- package/dist/elaris/types.d.ts +1541 -0
- package/dist/elaris/types.js +252 -0
- package/dist/elaris/types.js.map +1 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.js +19 -0
- package/dist/errors.js.map +1 -1
- package/dist/handler.d.ts +4 -0
- package/dist/handler.js +10 -1
- package/dist/handler.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/local-clink-backend.d.ts +3 -0
- package/dist/local-clink-backend.js +4 -0
- package/dist/local-clink-backend.js.map +1 -1
- package/dist/package-info.d.ts +2 -0
- package/dist/package-info.js +18 -0
- package/dist/package-info.js.map +1 -0
- package/dist/parsers/codex-jsonl.js +48 -3
- package/dist/parsers/codex-jsonl.js.map +1 -1
- package/dist/parsers/extract.d.ts +10 -1
- package/dist/parsers/extract.js +11 -3
- package/dist/parsers/extract.js.map +1 -1
- package/dist/pipeline.d.ts +4 -0
- package/dist/pipeline.js +129 -8
- package/dist/pipeline.js.map +1 -1
- package/dist/run-dir.d.ts +24 -0
- package/dist/run-dir.js +201 -2
- package/dist/run-dir.js.map +1 -1
- package/dist/runner.d.ts +13 -0
- package/dist/runner.js +184 -15
- package/dist/runner.js.map +1 -1
- package/dist/safety.d.ts +4 -4
- package/dist/safety.js +4 -4
- package/dist/schema.d.ts +7 -7
- package/dist/server.d.ts +1 -0
- package/dist/server.js +359 -17
- package/dist/server.js.map +1 -1
- package/dist/session-log-stream.d.ts +18 -0
- package/dist/session-log-stream.js +319 -0
- package/dist/session-log-stream.js.map +1 -0
- package/package.json +46 -5
- package/conf/adapters/gemini.json +0 -44
- package/conf/adapters/hapi/gemini.json +0 -47
- package/dist/parsers/gemini-json.d.ts +0 -2
- package/dist/parsers/gemini-json.js +0 -72
- package/dist/parsers/gemini-json.js.map +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const PLAN_REVIEW_DISCOVERY_SCHEMA_VERSION: "council-plan-review-discovery-v1";
|
|
2
|
+
export declare const PLAN_REVIEW_INTERCHANGE_SCHEMA_VERSION: "clinkx-plan-review-interchange-v1";
|
|
3
|
+
/**
|
|
4
|
+
* A configured provider this server can dispatch a plan-review seat to.
|
|
5
|
+
*
|
|
6
|
+
* Availability only. D8 is retracted: plan-review seats run adapter-default, so
|
|
7
|
+
* there is no read-only eligibility to project — admission admits any
|
|
8
|
+
* configured provider, and publishing an `eligible` bit here would advertise a
|
|
9
|
+
* gate the runtime does not apply.
|
|
10
|
+
*/
|
|
11
|
+
export interface PlanReviewProviderDiscovery {
|
|
12
|
+
readonly cli_name: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CouncilPlanReviewDiscovery {
|
|
15
|
+
readonly schema_version: typeof PLAN_REVIEW_DISCOVERY_SCHEMA_VERSION;
|
|
16
|
+
readonly interchange_schema_version: typeof PLAN_REVIEW_INTERCHANGE_SCHEMA_VERSION;
|
|
17
|
+
readonly input_schema_version: "council-plan-review-input-v1";
|
|
18
|
+
readonly result_schema_version: "council-plan-review-result-v1";
|
|
19
|
+
readonly execution_contract_schema_version: "execution-contract-v1";
|
|
20
|
+
readonly binding_schema_version: "clinkx-binding-v1";
|
|
21
|
+
readonly digest_profile: "checkpoint-text-v1";
|
|
22
|
+
readonly rubric_digest: string;
|
|
23
|
+
/**
|
|
24
|
+
* Positive declaration, matching the execution contract's own top-level
|
|
25
|
+
* field: reviewers are told not to mutate, and nothing enforces it. Published
|
|
26
|
+
* at discovery time so a consumer learns plan review is trusted-input-only
|
|
27
|
+
* BEFORE it submits a run.
|
|
28
|
+
*/
|
|
29
|
+
readonly mutation_enforcement: "prompt-only";
|
|
30
|
+
readonly providers: readonly PlanReviewProviderDiscovery[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Build the public, read-only discovery projection. The generic workflow
|
|
34
|
+
* catalog remains authoritative for names/descriptions/variables; this object
|
|
35
|
+
* is attached only to the plan-review-receipts entry.
|
|
36
|
+
*
|
|
37
|
+
* `configuredCliNames` is the host's full adapter inventory, which may include
|
|
38
|
+
* custom adapters outside plan review's closed v1 set. Providers are the
|
|
39
|
+
* INTERSECTION of that inventory with `PLAN_REVIEW_V1_CLI_NAMES`: a name must
|
|
40
|
+
* be both configured here AND bindable as a seat `cli_name`. Advertising a
|
|
41
|
+
* configured-but-non-v1 adapter would promise a seat that `CliNameSchema`
|
|
42
|
+
* rejects at contract parse; advertising an unconfigured v1 name would promise
|
|
43
|
+
* a provider this server cannot dispatch to.
|
|
44
|
+
*/
|
|
45
|
+
export declare function buildCouncilPlanReviewDiscovery(configuredCliNames: readonly string[]): CouncilPlanReviewDiscovery;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PLAN_REVIEW_V1_CLI_NAMES } from "./contract.js";
|
|
2
|
+
import { PACKAGED_PLAN_REVIEW_RUBRIC_DIGEST } from "./rubric.js";
|
|
3
|
+
export const PLAN_REVIEW_DISCOVERY_SCHEMA_VERSION = "council-plan-review-discovery-v1";
|
|
4
|
+
export const PLAN_REVIEW_INTERCHANGE_SCHEMA_VERSION = "clinkx-plan-review-interchange-v1";
|
|
5
|
+
/**
|
|
6
|
+
* Build the public, read-only discovery projection. The generic workflow
|
|
7
|
+
* catalog remains authoritative for names/descriptions/variables; this object
|
|
8
|
+
* is attached only to the plan-review-receipts entry.
|
|
9
|
+
*
|
|
10
|
+
* `configuredCliNames` is the host's full adapter inventory, which may include
|
|
11
|
+
* custom adapters outside plan review's closed v1 set. Providers are the
|
|
12
|
+
* INTERSECTION of that inventory with `PLAN_REVIEW_V1_CLI_NAMES`: a name must
|
|
13
|
+
* be both configured here AND bindable as a seat `cli_name`. Advertising a
|
|
14
|
+
* configured-but-non-v1 adapter would promise a seat that `CliNameSchema`
|
|
15
|
+
* rejects at contract parse; advertising an unconfigured v1 name would promise
|
|
16
|
+
* a provider this server cannot dispatch to.
|
|
17
|
+
*/
|
|
18
|
+
export function buildCouncilPlanReviewDiscovery(configuredCliNames) {
|
|
19
|
+
const v1CliNames = new Set(PLAN_REVIEW_V1_CLI_NAMES);
|
|
20
|
+
return {
|
|
21
|
+
schema_version: PLAN_REVIEW_DISCOVERY_SCHEMA_VERSION,
|
|
22
|
+
interchange_schema_version: PLAN_REVIEW_INTERCHANGE_SCHEMA_VERSION,
|
|
23
|
+
input_schema_version: "council-plan-review-input-v1",
|
|
24
|
+
result_schema_version: "council-plan-review-result-v1",
|
|
25
|
+
execution_contract_schema_version: "execution-contract-v1",
|
|
26
|
+
binding_schema_version: "clinkx-binding-v1",
|
|
27
|
+
digest_profile: "checkpoint-text-v1",
|
|
28
|
+
rubric_digest: PACKAGED_PLAN_REVIEW_RUBRIC_DIGEST,
|
|
29
|
+
mutation_enforcement: "prompt-only",
|
|
30
|
+
providers: [...new Set(configuredCliNames)]
|
|
31
|
+
.filter((cliName) => v1CliNames.has(cliName))
|
|
32
|
+
.sort()
|
|
33
|
+
.map((cliName) => ({ cli_name: cliName })),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/plan-review/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AAEjE,MAAM,CAAC,MAAM,oCAAoC,GAC/C,kCAA2C,CAAC;AAC9C,MAAM,CAAC,MAAM,sCAAsC,GACjD,mCAA4C,CAAC;AAiC/C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,+BAA+B,CAC7C,kBAAqC;IAErC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAS,wBAAwB,CAAC,CAAC;IAC7D,OAAO;QACL,cAAc,EAAE,oCAAoC;QACpD,0BAA0B,EAAE,sCAAsC;QAClE,oBAAoB,EAAE,8BAA8B;QACpD,qBAAqB,EAAE,+BAA+B;QACtD,iCAAiC,EAAE,uBAAuB;QAC1D,sBAAsB,EAAE,mBAAmB;QAC3C,cAAc,EAAE,oBAAoB;QACpC,aAAa,EAAE,kCAAkC;QACjD,oBAAoB,EAAE,aAAa;QACnC,SAAS,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC;aACxC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;aAC5C,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;KAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type CouncilPlanReviewResult } from "./contract.js";
|
|
3
|
+
/**
|
|
4
|
+
* Strict normalized Phase-0 model. It is data-only: runtime admission,
|
|
5
|
+
* capability probing, snapshots, state, and subprocess enforcement land later.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CouncilPlanReviewExecutionContractSchema: z.ZodEffects<z.ZodObject<{
|
|
8
|
+
schema_version: z.ZodLiteral<"execution-contract-v1">;
|
|
9
|
+
workspace_schema: z.ZodLiteral<"plan-workspace-v1">;
|
|
10
|
+
digest_profile: z.ZodLiteral<"checkpoint-text-v1">;
|
|
11
|
+
bindings: z.ZodObject<{
|
|
12
|
+
repository_id: z.ZodString;
|
|
13
|
+
review_id: z.ZodString;
|
|
14
|
+
iteration: z.ZodString;
|
|
15
|
+
plan_id: z.ZodString;
|
|
16
|
+
revision: z.ZodString;
|
|
17
|
+
plan_digest: z.ZodString;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
review_id: string;
|
|
20
|
+
repository_id: string;
|
|
21
|
+
iteration: string;
|
|
22
|
+
plan_id: string;
|
|
23
|
+
revision: string;
|
|
24
|
+
plan_digest: string;
|
|
25
|
+
}, {
|
|
26
|
+
review_id: string;
|
|
27
|
+
repository_id: string;
|
|
28
|
+
iteration: string;
|
|
29
|
+
plan_id: string;
|
|
30
|
+
revision: string;
|
|
31
|
+
plan_digest: string;
|
|
32
|
+
}>;
|
|
33
|
+
seats: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
34
|
+
seat_id: z.ZodString;
|
|
35
|
+
internal_call_id: z.ZodString;
|
|
36
|
+
cross_review_call_id: z.ZodString;
|
|
37
|
+
reviewer: z.ZodString;
|
|
38
|
+
cli_name: z.ZodEnum<["codex", "claude", "glm", "agy", "grok"]>;
|
|
39
|
+
stance: z.ZodEnum<["strict", "pragmatic", "adversarial"]>;
|
|
40
|
+
}, "strict", z.ZodTypeAny, {
|
|
41
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
42
|
+
seat_id: string;
|
|
43
|
+
reviewer: string;
|
|
44
|
+
stance: "strict" | "pragmatic" | "adversarial";
|
|
45
|
+
internal_call_id: string;
|
|
46
|
+
cross_review_call_id: string;
|
|
47
|
+
}, {
|
|
48
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
49
|
+
seat_id: string;
|
|
50
|
+
reviewer: string;
|
|
51
|
+
stance: "strict" | "pragmatic" | "adversarial";
|
|
52
|
+
internal_call_id: string;
|
|
53
|
+
cross_review_call_id: string;
|
|
54
|
+
}>, {
|
|
55
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
56
|
+
seat_id: string;
|
|
57
|
+
reviewer: string;
|
|
58
|
+
stance: "strict" | "pragmatic" | "adversarial";
|
|
59
|
+
internal_call_id: string;
|
|
60
|
+
cross_review_call_id: string;
|
|
61
|
+
}, {
|
|
62
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
63
|
+
seat_id: string;
|
|
64
|
+
reviewer: string;
|
|
65
|
+
stance: "strict" | "pragmatic" | "adversarial";
|
|
66
|
+
internal_call_id: string;
|
|
67
|
+
cross_review_call_id: string;
|
|
68
|
+
}>, "many">;
|
|
69
|
+
rubric: z.ZodObject<{
|
|
70
|
+
digest: z.ZodString;
|
|
71
|
+
}, "strict", z.ZodTypeAny, {
|
|
72
|
+
digest: string;
|
|
73
|
+
}, {
|
|
74
|
+
digest: string;
|
|
75
|
+
}>;
|
|
76
|
+
threshold: z.ZodEffects<z.ZodString, string, string>;
|
|
77
|
+
designated_editor: z.ZodString;
|
|
78
|
+
chairman_seat: z.ZodString;
|
|
79
|
+
/**
|
|
80
|
+
* D8 is RETRACTED: reviewers run adapter-default, so non-mutation is a
|
|
81
|
+
* PROMPT INSTRUCTION and nothing more. This field says exactly that and
|
|
82
|
+
* publishes no containment claim the runtime cannot back.
|
|
83
|
+
*/
|
|
84
|
+
mutation_enforcement: z.ZodLiteral<"prompt-only">;
|
|
85
|
+
/**
|
|
86
|
+
* D2/D3/D6. These previously rode inside the D8 `read_only_policy` struct;
|
|
87
|
+
* they are independent decisions and outlive it. Each stays pinned to the
|
|
88
|
+
* only value the runtime implements — a `true` here would assert a
|
|
89
|
+
* deliberation the transport does not perform.
|
|
90
|
+
*/
|
|
91
|
+
deliberation_policy: z.ZodObject<{
|
|
92
|
+
fallback_allowed: z.ZodLiteral<false>;
|
|
93
|
+
seat_substitution_allowed: z.ZodLiteral<false>;
|
|
94
|
+
deliberation_receipts_allowed: z.ZodLiteral<false>;
|
|
95
|
+
partial_transport_is_approval: z.ZodLiteral<false>;
|
|
96
|
+
}, "strict", z.ZodTypeAny, {
|
|
97
|
+
fallback_allowed: false;
|
|
98
|
+
seat_substitution_allowed: false;
|
|
99
|
+
deliberation_receipts_allowed: false;
|
|
100
|
+
partial_transport_is_approval: false;
|
|
101
|
+
}, {
|
|
102
|
+
fallback_allowed: false;
|
|
103
|
+
seat_substitution_allowed: false;
|
|
104
|
+
deliberation_receipts_allowed: false;
|
|
105
|
+
partial_transport_is_approval: false;
|
|
106
|
+
}>;
|
|
107
|
+
context_evidence_policy: z.ZodObject<{
|
|
108
|
+
immutable_snapshot_only: z.ZodLiteral<true>;
|
|
109
|
+
snapshot_digest: z.ZodString;
|
|
110
|
+
original_plan_context_allowed: z.ZodLiteral<false>;
|
|
111
|
+
plan_workspace_context_allowed: z.ZodLiteral<false>;
|
|
112
|
+
}, "strict", z.ZodTypeAny, {
|
|
113
|
+
immutable_snapshot_only: true;
|
|
114
|
+
snapshot_digest: string;
|
|
115
|
+
original_plan_context_allowed: false;
|
|
116
|
+
plan_workspace_context_allowed: false;
|
|
117
|
+
}, {
|
|
118
|
+
immutable_snapshot_only: true;
|
|
119
|
+
snapshot_digest: string;
|
|
120
|
+
original_plan_context_allowed: false;
|
|
121
|
+
plan_workspace_context_allowed: false;
|
|
122
|
+
}>;
|
|
123
|
+
}, "strict", z.ZodTypeAny, {
|
|
124
|
+
schema_version: "execution-contract-v1";
|
|
125
|
+
workspace_schema: "plan-workspace-v1";
|
|
126
|
+
digest_profile: "checkpoint-text-v1";
|
|
127
|
+
threshold: string;
|
|
128
|
+
designated_editor: string;
|
|
129
|
+
chairman_seat: string;
|
|
130
|
+
seats: {
|
|
131
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
132
|
+
seat_id: string;
|
|
133
|
+
reviewer: string;
|
|
134
|
+
stance: "strict" | "pragmatic" | "adversarial";
|
|
135
|
+
internal_call_id: string;
|
|
136
|
+
cross_review_call_id: string;
|
|
137
|
+
}[];
|
|
138
|
+
bindings: {
|
|
139
|
+
review_id: string;
|
|
140
|
+
repository_id: string;
|
|
141
|
+
iteration: string;
|
|
142
|
+
plan_id: string;
|
|
143
|
+
revision: string;
|
|
144
|
+
plan_digest: string;
|
|
145
|
+
};
|
|
146
|
+
rubric: {
|
|
147
|
+
digest: string;
|
|
148
|
+
};
|
|
149
|
+
mutation_enforcement: "prompt-only";
|
|
150
|
+
deliberation_policy: {
|
|
151
|
+
fallback_allowed: false;
|
|
152
|
+
seat_substitution_allowed: false;
|
|
153
|
+
deliberation_receipts_allowed: false;
|
|
154
|
+
partial_transport_is_approval: false;
|
|
155
|
+
};
|
|
156
|
+
context_evidence_policy: {
|
|
157
|
+
immutable_snapshot_only: true;
|
|
158
|
+
snapshot_digest: string;
|
|
159
|
+
original_plan_context_allowed: false;
|
|
160
|
+
plan_workspace_context_allowed: false;
|
|
161
|
+
};
|
|
162
|
+
}, {
|
|
163
|
+
schema_version: "execution-contract-v1";
|
|
164
|
+
workspace_schema: "plan-workspace-v1";
|
|
165
|
+
digest_profile: "checkpoint-text-v1";
|
|
166
|
+
threshold: string;
|
|
167
|
+
designated_editor: string;
|
|
168
|
+
chairman_seat: string;
|
|
169
|
+
seats: {
|
|
170
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
171
|
+
seat_id: string;
|
|
172
|
+
reviewer: string;
|
|
173
|
+
stance: "strict" | "pragmatic" | "adversarial";
|
|
174
|
+
internal_call_id: string;
|
|
175
|
+
cross_review_call_id: string;
|
|
176
|
+
}[];
|
|
177
|
+
bindings: {
|
|
178
|
+
review_id: string;
|
|
179
|
+
repository_id: string;
|
|
180
|
+
iteration: string;
|
|
181
|
+
plan_id: string;
|
|
182
|
+
revision: string;
|
|
183
|
+
plan_digest: string;
|
|
184
|
+
};
|
|
185
|
+
rubric: {
|
|
186
|
+
digest: string;
|
|
187
|
+
};
|
|
188
|
+
mutation_enforcement: "prompt-only";
|
|
189
|
+
deliberation_policy: {
|
|
190
|
+
fallback_allowed: false;
|
|
191
|
+
seat_substitution_allowed: false;
|
|
192
|
+
deliberation_receipts_allowed: false;
|
|
193
|
+
partial_transport_is_approval: false;
|
|
194
|
+
};
|
|
195
|
+
context_evidence_policy: {
|
|
196
|
+
immutable_snapshot_only: true;
|
|
197
|
+
snapshot_digest: string;
|
|
198
|
+
original_plan_context_allowed: false;
|
|
199
|
+
plan_workspace_context_allowed: false;
|
|
200
|
+
};
|
|
201
|
+
}>, {
|
|
202
|
+
schema_version: "execution-contract-v1";
|
|
203
|
+
workspace_schema: "plan-workspace-v1";
|
|
204
|
+
digest_profile: "checkpoint-text-v1";
|
|
205
|
+
threshold: string;
|
|
206
|
+
designated_editor: string;
|
|
207
|
+
chairman_seat: string;
|
|
208
|
+
seats: {
|
|
209
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
210
|
+
seat_id: string;
|
|
211
|
+
reviewer: string;
|
|
212
|
+
stance: "strict" | "pragmatic" | "adversarial";
|
|
213
|
+
internal_call_id: string;
|
|
214
|
+
cross_review_call_id: string;
|
|
215
|
+
}[];
|
|
216
|
+
bindings: {
|
|
217
|
+
review_id: string;
|
|
218
|
+
repository_id: string;
|
|
219
|
+
iteration: string;
|
|
220
|
+
plan_id: string;
|
|
221
|
+
revision: string;
|
|
222
|
+
plan_digest: string;
|
|
223
|
+
};
|
|
224
|
+
rubric: {
|
|
225
|
+
digest: string;
|
|
226
|
+
};
|
|
227
|
+
mutation_enforcement: "prompt-only";
|
|
228
|
+
deliberation_policy: {
|
|
229
|
+
fallback_allowed: false;
|
|
230
|
+
seat_substitution_allowed: false;
|
|
231
|
+
deliberation_receipts_allowed: false;
|
|
232
|
+
partial_transport_is_approval: false;
|
|
233
|
+
};
|
|
234
|
+
context_evidence_policy: {
|
|
235
|
+
immutable_snapshot_only: true;
|
|
236
|
+
snapshot_digest: string;
|
|
237
|
+
original_plan_context_allowed: false;
|
|
238
|
+
plan_workspace_context_allowed: false;
|
|
239
|
+
};
|
|
240
|
+
}, {
|
|
241
|
+
schema_version: "execution-contract-v1";
|
|
242
|
+
workspace_schema: "plan-workspace-v1";
|
|
243
|
+
digest_profile: "checkpoint-text-v1";
|
|
244
|
+
threshold: string;
|
|
245
|
+
designated_editor: string;
|
|
246
|
+
chairman_seat: string;
|
|
247
|
+
seats: {
|
|
248
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
249
|
+
seat_id: string;
|
|
250
|
+
reviewer: string;
|
|
251
|
+
stance: "strict" | "pragmatic" | "adversarial";
|
|
252
|
+
internal_call_id: string;
|
|
253
|
+
cross_review_call_id: string;
|
|
254
|
+
}[];
|
|
255
|
+
bindings: {
|
|
256
|
+
review_id: string;
|
|
257
|
+
repository_id: string;
|
|
258
|
+
iteration: string;
|
|
259
|
+
plan_id: string;
|
|
260
|
+
revision: string;
|
|
261
|
+
plan_digest: string;
|
|
262
|
+
};
|
|
263
|
+
rubric: {
|
|
264
|
+
digest: string;
|
|
265
|
+
};
|
|
266
|
+
mutation_enforcement: "prompt-only";
|
|
267
|
+
deliberation_policy: {
|
|
268
|
+
fallback_allowed: false;
|
|
269
|
+
seat_substitution_allowed: false;
|
|
270
|
+
deliberation_receipts_allowed: false;
|
|
271
|
+
partial_transport_is_approval: false;
|
|
272
|
+
};
|
|
273
|
+
context_evidence_policy: {
|
|
274
|
+
immutable_snapshot_only: true;
|
|
275
|
+
snapshot_digest: string;
|
|
276
|
+
original_plan_context_allowed: false;
|
|
277
|
+
plan_workspace_context_allowed: false;
|
|
278
|
+
};
|
|
279
|
+
}>;
|
|
280
|
+
export type CouncilPlanReviewExecutionContract = z.infer<typeof CouncilPlanReviewExecutionContractSchema>;
|
|
281
|
+
export interface ComputedCouncilPlanReviewExecutionContract {
|
|
282
|
+
readonly contract: CouncilPlanReviewExecutionContract;
|
|
283
|
+
readonly canonicalBytes: Buffer;
|
|
284
|
+
readonly digest: string;
|
|
285
|
+
}
|
|
286
|
+
export declare function computeCouncilPlanReviewExecutionContractDigest(input: unknown): ComputedCouncilPlanReviewExecutionContract;
|
|
287
|
+
export type ExecutionContractResultBindingRejection = "digest_mismatch" | "binding_mismatch" | "roster_mismatch";
|
|
288
|
+
export declare class ExecutionContractResultBindingError extends Error {
|
|
289
|
+
readonly code: ExecutionContractResultBindingRejection;
|
|
290
|
+
constructor(code: ExecutionContractResultBindingRejection, message: string);
|
|
291
|
+
}
|
|
292
|
+
export interface ValidatedCouncilPlanReviewExecutionResult {
|
|
293
|
+
readonly contract: CouncilPlanReviewExecutionContract;
|
|
294
|
+
readonly result: CouncilPlanReviewResult;
|
|
295
|
+
readonly execution_contract_digest: string;
|
|
296
|
+
}
|
|
297
|
+
/** Validate only the normalized contract/result relationship; performs no I/O. */
|
|
298
|
+
export declare function validateCouncilPlanReviewExecutionContractResult(contractInput: unknown, resultInput: unknown): ValidatedCouncilPlanReviewExecutionResult;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CliNameSchema, CouncilPlanReviewResultSchema, DigestSchema, PlanIdSchema, RepositoryIdSchema, ReviewIdSchema, } from "./contract.js";
|
|
3
|
+
import { computeExecutionContractDigest, executionContractDecimal, } from "./digest.js";
|
|
4
|
+
const PositiveDecimalIntegerSchema = z.string().regex(/^[1-9][0-9]*$/);
|
|
5
|
+
const ScoreDecimalSchema = z
|
|
6
|
+
.string()
|
|
7
|
+
.regex(/^(?:0|[1-9][0-9]*)(?:\.[0-9]*[1-9])?$/)
|
|
8
|
+
.refine((value) => Number(value) >= 0 && Number(value) <= 10, {
|
|
9
|
+
message: "threshold must be between 0 and 10",
|
|
10
|
+
});
|
|
11
|
+
const InternalSeatCallIdSchema = z.string().regex(/^seat_[0-9]{3,}$/);
|
|
12
|
+
const InternalCrossReviewCallIdSchema = z.string().regex(/^cross_[0-9]{3,}$/);
|
|
13
|
+
const ExecutionContractSeatSchema = z
|
|
14
|
+
.object({
|
|
15
|
+
seat_id: ReviewIdSchema,
|
|
16
|
+
internal_call_id: InternalSeatCallIdSchema,
|
|
17
|
+
cross_review_call_id: InternalCrossReviewCallIdSchema,
|
|
18
|
+
reviewer: z.string().min(1),
|
|
19
|
+
cli_name: CliNameSchema,
|
|
20
|
+
stance: z.enum(["strict", "pragmatic", "adversarial"]),
|
|
21
|
+
})
|
|
22
|
+
.strict()
|
|
23
|
+
.refine((seat) => seat.reviewer === seat.cli_name, {
|
|
24
|
+
message: "reviewer must equal cli_name",
|
|
25
|
+
path: ["reviewer"],
|
|
26
|
+
});
|
|
27
|
+
const ExecutionContractBindingsSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
repository_id: RepositoryIdSchema,
|
|
30
|
+
review_id: ReviewIdSchema,
|
|
31
|
+
iteration: PositiveDecimalIntegerSchema,
|
|
32
|
+
plan_id: PlanIdSchema,
|
|
33
|
+
revision: PositiveDecimalIntegerSchema,
|
|
34
|
+
plan_digest: DigestSchema,
|
|
35
|
+
})
|
|
36
|
+
.strict();
|
|
37
|
+
const ExecutionContractRubricSchema = z
|
|
38
|
+
.object({ digest: DigestSchema })
|
|
39
|
+
.strict();
|
|
40
|
+
/**
|
|
41
|
+
* Strict normalized Phase-0 model. It is data-only: runtime admission,
|
|
42
|
+
* capability probing, snapshots, state, and subprocess enforcement land later.
|
|
43
|
+
*/
|
|
44
|
+
export const CouncilPlanReviewExecutionContractSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
schema_version: z.literal("execution-contract-v1"),
|
|
47
|
+
workspace_schema: z.literal("plan-workspace-v1"),
|
|
48
|
+
digest_profile: z.literal("checkpoint-text-v1"),
|
|
49
|
+
bindings: ExecutionContractBindingsSchema,
|
|
50
|
+
seats: z.array(ExecutionContractSeatSchema).min(1).max(10),
|
|
51
|
+
rubric: ExecutionContractRubricSchema,
|
|
52
|
+
threshold: ScoreDecimalSchema,
|
|
53
|
+
designated_editor: z.string().min(1),
|
|
54
|
+
chairman_seat: ReviewIdSchema,
|
|
55
|
+
/**
|
|
56
|
+
* D8 is RETRACTED: reviewers run adapter-default, so non-mutation is a
|
|
57
|
+
* PROMPT INSTRUCTION and nothing more. This field says exactly that and
|
|
58
|
+
* publishes no containment claim the runtime cannot back.
|
|
59
|
+
*/
|
|
60
|
+
mutation_enforcement: z.literal("prompt-only"),
|
|
61
|
+
/**
|
|
62
|
+
* D2/D3/D6. These previously rode inside the D8 `read_only_policy` struct;
|
|
63
|
+
* they are independent decisions and outlive it. Each stays pinned to the
|
|
64
|
+
* only value the runtime implements — a `true` here would assert a
|
|
65
|
+
* deliberation the transport does not perform.
|
|
66
|
+
*/
|
|
67
|
+
deliberation_policy: z
|
|
68
|
+
.object({
|
|
69
|
+
fallback_allowed: z.literal(false),
|
|
70
|
+
seat_substitution_allowed: z.literal(false),
|
|
71
|
+
deliberation_receipts_allowed: z.literal(false),
|
|
72
|
+
partial_transport_is_approval: z.literal(false),
|
|
73
|
+
})
|
|
74
|
+
.strict(),
|
|
75
|
+
context_evidence_policy: z
|
|
76
|
+
.object({
|
|
77
|
+
immutable_snapshot_only: z.literal(true),
|
|
78
|
+
snapshot_digest: DigestSchema,
|
|
79
|
+
original_plan_context_allowed: z.literal(false),
|
|
80
|
+
plan_workspace_context_allowed: z.literal(false),
|
|
81
|
+
})
|
|
82
|
+
.strict(),
|
|
83
|
+
})
|
|
84
|
+
.strict()
|
|
85
|
+
.superRefine((contract, ctx) => {
|
|
86
|
+
const seatIds = new Set();
|
|
87
|
+
const internalCallIds = new Set();
|
|
88
|
+
for (const [index, seat] of contract.seats.entries()) {
|
|
89
|
+
if (seatIds.has(seat.seat_id)) {
|
|
90
|
+
ctx.addIssue({
|
|
91
|
+
code: z.ZodIssueCode.custom,
|
|
92
|
+
message: `Duplicate seat_id: ${seat.seat_id}`,
|
|
93
|
+
path: ["seats", index, "seat_id"],
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
seatIds.add(seat.seat_id);
|
|
97
|
+
if (internalCallIds.has(seat.internal_call_id)) {
|
|
98
|
+
ctx.addIssue({
|
|
99
|
+
code: z.ZodIssueCode.custom,
|
|
100
|
+
message: `Duplicate internal_call_id: ${seat.internal_call_id}`,
|
|
101
|
+
path: ["seats", index, "internal_call_id"],
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
internalCallIds.add(seat.internal_call_id);
|
|
105
|
+
if (internalCallIds.has(seat.cross_review_call_id)) {
|
|
106
|
+
ctx.addIssue({
|
|
107
|
+
code: z.ZodIssueCode.custom,
|
|
108
|
+
message: `Duplicate internal call ID: ${seat.cross_review_call_id}`,
|
|
109
|
+
path: ["seats", index, "cross_review_call_id"],
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
internalCallIds.add(seat.cross_review_call_id);
|
|
113
|
+
}
|
|
114
|
+
if (!seatIds.has(contract.chairman_seat)) {
|
|
115
|
+
ctx.addIssue({
|
|
116
|
+
code: z.ZodIssueCode.custom,
|
|
117
|
+
message: "chairman_seat must identify one execution-contract seat",
|
|
118
|
+
path: ["chairman_seat"],
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (contract.context_evidence_policy.snapshot_digest !==
|
|
122
|
+
contract.bindings.plan_digest) {
|
|
123
|
+
ctx.addIssue({
|
|
124
|
+
code: z.ZodIssueCode.custom,
|
|
125
|
+
message: "snapshot_digest must equal bindings.plan_digest",
|
|
126
|
+
path: ["context_evidence_policy", "snapshot_digest"],
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
function digestValue(contract) {
|
|
131
|
+
return {
|
|
132
|
+
...contract,
|
|
133
|
+
bindings: {
|
|
134
|
+
...contract.bindings,
|
|
135
|
+
iteration: executionContractDecimal(contract.bindings.iteration),
|
|
136
|
+
revision: executionContractDecimal(contract.bindings.revision),
|
|
137
|
+
},
|
|
138
|
+
threshold: executionContractDecimal(contract.threshold),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export function computeCouncilPlanReviewExecutionContractDigest(input) {
|
|
142
|
+
const contract = CouncilPlanReviewExecutionContractSchema.parse(input);
|
|
143
|
+
const computed = computeExecutionContractDigest(digestValue(contract));
|
|
144
|
+
return { contract, ...computed };
|
|
145
|
+
}
|
|
146
|
+
export class ExecutionContractResultBindingError extends Error {
|
|
147
|
+
code;
|
|
148
|
+
constructor(code, message) {
|
|
149
|
+
super(message);
|
|
150
|
+
this.name = "ExecutionContractResultBindingError";
|
|
151
|
+
this.code = code;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** Validate only the normalized contract/result relationship; performs no I/O. */
|
|
155
|
+
export function validateCouncilPlanReviewExecutionContractResult(contractInput, resultInput) {
|
|
156
|
+
const computed = computeCouncilPlanReviewExecutionContractDigest(contractInput);
|
|
157
|
+
const result = CouncilPlanReviewResultSchema.parse(resultInput);
|
|
158
|
+
if (result.execution_contract_digest !== computed.digest) {
|
|
159
|
+
throw new ExecutionContractResultBindingError("digest_mismatch", "result execution_contract_digest does not match the normalized contract");
|
|
160
|
+
}
|
|
161
|
+
const { contract } = computed;
|
|
162
|
+
const receiptIterationMismatch = result.seats.some((seat) => seat.execution_status === "completed" &&
|
|
163
|
+
String(seat.receipt_candidate.iteration) !== contract.bindings.iteration);
|
|
164
|
+
const bindingMismatch = result.bindings.repository_id !== contract.bindings.repository_id ||
|
|
165
|
+
result.bindings.review_id !== contract.bindings.review_id ||
|
|
166
|
+
result.bindings.plan_id !== contract.bindings.plan_id ||
|
|
167
|
+
String(result.bindings.revision) !== contract.bindings.revision ||
|
|
168
|
+
result.bindings.digest !== contract.bindings.plan_digest ||
|
|
169
|
+
String(result.bindings.threshold) !== contract.threshold ||
|
|
170
|
+
result.bindings.designated_editor !== contract.designated_editor ||
|
|
171
|
+
result.bindings.chairman_seat !== contract.chairman_seat ||
|
|
172
|
+
receiptIterationMismatch;
|
|
173
|
+
if (bindingMismatch) {
|
|
174
|
+
throw new ExecutionContractResultBindingError("binding_mismatch", "result bindings do not match the normalized contract");
|
|
175
|
+
}
|
|
176
|
+
const rosterMatches = result.seats.length === contract.seats.length &&
|
|
177
|
+
result.seats.every((resultSeat, index) => {
|
|
178
|
+
const contractSeat = contract.seats[index];
|
|
179
|
+
return (contractSeat !== undefined &&
|
|
180
|
+
resultSeat.seat_id === contractSeat.seat_id &&
|
|
181
|
+
resultSeat.internal_call_id === contractSeat.internal_call_id &&
|
|
182
|
+
resultSeat.reviewer === contractSeat.reviewer &&
|
|
183
|
+
resultSeat.cli_name === contractSeat.cli_name);
|
|
184
|
+
});
|
|
185
|
+
if (!rosterMatches) {
|
|
186
|
+
throw new ExecutionContractResultBindingError("roster_mismatch", "result seats must exactly match execution-contract order and identity");
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
contract,
|
|
190
|
+
result,
|
|
191
|
+
execution_contract_digest: computed.digest,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=execution-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-contract.js","sourceRoot":"","sources":["../../src/plan-review/execution-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,6BAA6B,EAC7B,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,cAAc,GAEf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,GAEzB,MAAM,aAAa,CAAC;AAErB,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AACvE,MAAM,kBAAkB,GAAG,CAAC;KACzB,MAAM,EAAE;KACR,KAAK,CAAC,uCAAuC,CAAC;KAC9C,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE;IAC5D,OAAO,EAAE,oCAAoC;CAC9C,CAAC,CAAC;AACL,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACtE,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAE9E,MAAM,2BAA2B,GAAG,CAAC;KAClC,MAAM,CAAC;IACN,OAAO,EAAE,cAAc;IACvB,gBAAgB,EAAE,wBAAwB;IAC1C,oBAAoB,EAAE,+BAA+B;IACrD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,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C,KAAK,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;YACvC,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC3C,OAAO,CACL,YAAY,KAAK,SAAS;gBAC1B,UAAU,CAAC,OAAO,KAAK,YAAY,CAAC,OAAO;gBAC3C,UAAU,CAAC,gBAAgB,KAAK,YAAY,CAAC,gBAAgB;gBAC7D,UAAU,CAAC,QAAQ,KAAK,YAAY,CAAC,QAAQ;gBAC7C,UAAU,CAAC,QAAQ,KAAK,YAAY,CAAC,QAAQ,CAC9C,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,mCAAmC,CAC3C,iBAAiB,EACjB,uEAAuE,CACxE,CAAC;IACJ,CAAC;IAED,OAAO;QACL,QAAQ;QACR,MAAM;QACN,yBAAyB,EAAE,QAAQ,CAAC,MAAM;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { NormalizedWorkflowDefinition } from "../definition-normalizer.js";
|
|
2
|
+
import { type CouncilPlanReviewExecutionContract } from "./execution-contract.js";
|
|
3
|
+
import type { CanonicalPlanSnapshot } from "./snapshot.js";
|
|
4
|
+
/**
|
|
5
|
+
* Delimits the inlined snapshot. Long and fixed on purpose: the plan is
|
|
6
|
+
* untrusted text that may itself contain markdown fences, and an actor must be
|
|
7
|
+
* able to tell where the bound revision ends and its instructions resume.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PLAN_SNAPSHOT_BEGIN = "-----BEGIN PLAN SNAPSHOT-----";
|
|
10
|
+
export declare const PLAN_SNAPSHOT_END = "-----END PLAN SNAPSHOT-----";
|
|
11
|
+
/**
|
|
12
|
+
* The exact snapshot block appended to every actor's prompt.
|
|
13
|
+
*
|
|
14
|
+
* Exported because it is the only thing a PERSISTED prepared input can be
|
|
15
|
+
* checked against on resume (D9). A resumed retry replays its persisted prompt
|
|
16
|
+
* verbatim — the expander never runs again for it — so the resume seam must
|
|
17
|
+
* re-derive these exact bytes and require them to be present. Two renderings
|
|
18
|
+
* would let the check pass against text no actor was ever sent.
|
|
19
|
+
*
|
|
20
|
+
* The result is appended by the ENGINE, after `renderCallPrompt` — never
|
|
21
|
+
* concatenated into a call's `prompt` template. See
|
|
22
|
+
* `NormalizedCall.plan_review_snapshot_text`: the plan is untrusted text that
|
|
23
|
+
* may contain `{{...}}`, and the renderer would rewrite or reject it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function renderPlanSnapshotBlock(planSnapshotText: string): string;
|
|
26
|
+
/** Remove plan/seat/provider bindings before a peer artifact is cross-reviewed. */
|
|
27
|
+
export declare function projectPlanReviewSemanticBody(value: unknown): unknown;
|
|
28
|
+
/**
|
|
29
|
+
* Expand the isolated four-stage plan-review seed. Existing council expansion
|
|
30
|
+
* is intentionally not reused or mutated.
|
|
31
|
+
*/
|
|
32
|
+
export declare function expandCouncilPlanReview(definition: NormalizedWorkflowDefinition, contractInput: CouncilPlanReviewExecutionContract,
|
|
33
|
+
/**
|
|
34
|
+
* The verified canonical plan snapshot (A-6/D9), inlined into every actor's
|
|
35
|
+
* prompt. Inlining TEXT rather than naming a path is what keeps D9 true now
|
|
36
|
+
* that actors run adapter-default: a path is a mutable thing an actor could
|
|
37
|
+
* re-read (or re-write) after verification, whereas the prompt bytes are
|
|
38
|
+
* fixed at dispatch.
|
|
39
|
+
*
|
|
40
|
+
* This takes the verified `CanonicalPlanSnapshot` rather than a bare `string`
|
|
41
|
+
* ON PURPOSE. A bare string accepts a PATHNAME just as happily as plan text,
|
|
42
|
+
* and a pathname would inline the path — reintroducing exactly the mutable
|
|
43
|
+
* indirection D9 exists to remove — while every existing test still passed,
|
|
44
|
+
* because none asserted on the rendered prompt. The nominal type makes that
|
|
45
|
+
* mistake unrepresentable for a reader; `assertVerifiedSnapshot` below makes
|
|
46
|
+
* it fail for the test suite.
|
|
47
|
+
*/
|
|
48
|
+
planSnapshot?: CanonicalPlanSnapshot): NormalizedWorkflowDefinition;
|