clinkx 0.2.3 → 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 +113 -18
- 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/conf/prompts/json-codereviewer.txt +1 -0
- package/conf/prompts/json.txt +1 -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 +53 -0
- package/dist/allowed-roots.js +216 -0
- package/dist/allowed-roots.js.map +1 -0
- 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 +12 -0
- package/dist/context-builder/anchors.js +22 -0
- package/dist/context-builder/anchors.js.map +1 -0
- package/dist/context-builder/bundle.d.ts +109 -0
- package/dist/context-builder/bundle.js +1498 -0
- package/dist/context-builder/bundle.js.map +1 -0
- package/dist/context-builder/codemap.d.ts +22 -0
- package/dist/context-builder/codemap.js +675 -0
- package/dist/context-builder/codemap.js.map +1 -0
- package/dist/context-builder/config.d.ts +61 -0
- package/dist/context-builder/config.js +216 -0
- package/dist/context-builder/config.js.map +1 -0
- 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 +219 -0
- package/dist/context-builder/delegate-packet.js +1190 -0
- package/dist/context-builder/delegate-packet.js.map +1 -0
- package/dist/context-builder/delegate-reconstruction.d.ts +13 -0
- package/dist/context-builder/delegate-reconstruction.js +220 -0
- package/dist/context-builder/delegate-reconstruction.js.map +1 -0
- package/dist/context-builder/delegate-validation.d.ts +27 -0
- package/dist/context-builder/delegate-validation.js +479 -0
- package/dist/context-builder/delegate-validation.js.map +1 -0
- package/dist/context-builder/delegate.d.ts +26 -0
- package/dist/context-builder/delegate.js +134 -0
- package/dist/context-builder/delegate.js.map +1 -0
- package/dist/context-builder/diagnostics.d.ts +36 -0
- package/dist/context-builder/diagnostics.js +107 -0
- package/dist/context-builder/diagnostics.js.map +1 -0
- package/dist/context-builder/discovery.d.ts +146 -0
- package/dist/context-builder/discovery.js +2129 -0
- package/dist/context-builder/discovery.js.map +1 -0
- package/dist/context-builder/globs.d.ts +14 -0
- package/dist/context-builder/globs.js +175 -0
- package/dist/context-builder/globs.js.map +1 -0
- package/dist/context-builder/handler.d.ts +41 -0
- package/dist/context-builder/handler.js +2590 -0
- package/dist/context-builder/handler.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/context-builder/path-signals.js +70 -0
- package/dist/context-builder/path-signals.js.map +1 -0
- package/dist/context-builder/paths.d.ts +30 -0
- package/dist/context-builder/paths.js +153 -0
- package/dist/context-builder/paths.js.map +1 -0
- package/dist/context-builder/progress.d.ts +17 -0
- package/dist/context-builder/progress.js +93 -0
- package/dist/context-builder/progress.js.map +1 -0
- package/dist/context-builder/receipt.d.ts +91 -0
- package/dist/context-builder/receipt.js +180 -0
- package/dist/context-builder/receipt.js.map +1 -0
- 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/run-id.d.ts +7 -0
- package/dist/context-builder/run-id.js +31 -0
- package/dist/context-builder/run-id.js.map +1 -0
- package/dist/context-builder/schema.d.ts +669 -0
- package/dist/context-builder/schema.js +399 -0
- package/dist/context-builder/schema.js.map +1 -0
- package/dist/context-builder/secrets.d.ts +41 -0
- package/dist/context-builder/secrets.js +1651 -0
- package/dist/context-builder/secrets.js.map +1 -0
- package/dist/context-builder/selection.d.ts +56 -0
- package/dist/context-builder/selection.js +1111 -0
- package/dist/context-builder/selection.js.map +1 -0
- 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 +66 -0
- package/dist/context-builder/status.js +160 -0
- package/dist/context-builder/status.js.map +1 -0
- package/dist/context-builder/storage.d.ts +118 -0
- package/dist/context-builder/storage.js +1003 -0
- package/dist/context-builder/storage.js.map +1 -0
- package/dist/context-builder/token-estimate.d.ts +19 -0
- package/dist/context-builder/token-estimate.js +90 -0
- package/dist/context-builder/token-estimate.js.map +1 -0
- 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/paths.d.ts +8 -0
- package/dist/paths.js +31 -43
- package/dist/paths.js.map +1 -1
- package/dist/pipeline.d.ts +51 -3
- package/dist/pipeline.js +264 -47
- 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 +2 -0
- package/dist/server.js +396 -24
- 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 +47 -5
- package/conf/adapters/gemini.json +0 -44
- package/conf/adapters/hapi/gemini.json +0 -47
- package/dist/artifacts.d.ts +0 -9
- package/dist/artifacts.js +0 -24
- package/dist/artifacts.js.map +0 -1
- 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,398 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A-5 — the strict, optional `plan_review_state` subtree on RunState.
|
|
3
|
+
*
|
|
4
|
+
* This is deliberately a TYPED subtree, not a generic aux blob: everything a
|
|
5
|
+
* resumed run needs to re-derive its execution contract, its immutable plan
|
|
6
|
+
* snapshot, its ordered seat mapping, and its per-call bindings lives
|
|
7
|
+
* here, and nothing else does. Resume reads ONLY this (never `plan_file`, never
|
|
8
|
+
* re-parsed caller input), so anything absent from this schema is, by
|
|
9
|
+
* construction, not resumable.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import type { CouncilPlanReviewExecutionContract } from "./execution-contract.js";
|
|
13
|
+
/** Ordered external seat_id ↔ opaque internal call id mapping (A-4). */
|
|
14
|
+
export declare const PlanReviewSeatMappingSchema: z.ZodObject<{
|
|
15
|
+
seat_id: z.ZodString;
|
|
16
|
+
cli_name: z.ZodEnum<["codex", "claude", "glm", "agy", "grok"]>;
|
|
17
|
+
reviewer_call_id: z.ZodString;
|
|
18
|
+
cross_review_call_id: z.ZodString;
|
|
19
|
+
}, "strict", z.ZodTypeAny, {
|
|
20
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
21
|
+
seat_id: string;
|
|
22
|
+
cross_review_call_id: string;
|
|
23
|
+
reviewer_call_id: string;
|
|
24
|
+
}, {
|
|
25
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
26
|
+
seat_id: string;
|
|
27
|
+
cross_review_call_id: string;
|
|
28
|
+
reviewer_call_id: string;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Per-call binding. One entry per DISPATCHABLE call (reviewer, cross-review,
|
|
32
|
+
* chairman) — reconstructed on resume so a resumed run cannot silently
|
|
33
|
+
* re-provider a call. It is also the SOLE carrier of the chairman's call_id:
|
|
34
|
+
* `PlanReviewSeatMappingSchema` maps reviewer/cross-review calls only.
|
|
35
|
+
*/
|
|
36
|
+
export declare const PlanReviewCallBindingSchema: z.ZodObject<{
|
|
37
|
+
call_id: z.ZodString;
|
|
38
|
+
stage_id: z.ZodEnum<["reviewers", "cross_review", "chairman"]>;
|
|
39
|
+
seat_id: z.ZodString;
|
|
40
|
+
cli_name: z.ZodEnum<["codex", "claude", "glm", "agy", "grok"]>;
|
|
41
|
+
}, "strict", z.ZodTypeAny, {
|
|
42
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
43
|
+
seat_id: string;
|
|
44
|
+
stage_id: "reviewers" | "cross_review" | "chairman";
|
|
45
|
+
call_id: string;
|
|
46
|
+
}, {
|
|
47
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
48
|
+
seat_id: string;
|
|
49
|
+
stage_id: "reviewers" | "cross_review" | "chairman";
|
|
50
|
+
call_id: string;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const PlanReviewContextPolicySchema: z.ZodObject<{
|
|
53
|
+
immutable_snapshot_only: z.ZodLiteral<true>;
|
|
54
|
+
original_plan_context_allowed: z.ZodLiteral<false>;
|
|
55
|
+
plan_workspace_context_allowed: z.ZodLiteral<false>;
|
|
56
|
+
/** The original caller `plan_file`, recorded ONLY to keep excluding it. */
|
|
57
|
+
original_plan_absolute_path: z.ZodEffects<z.ZodString, string, string>;
|
|
58
|
+
/** Forced exclusion globs folded in before curator dispatch (A-7a). */
|
|
59
|
+
enforced_exclude_globs: z.ZodArray<z.ZodString, "many">;
|
|
60
|
+
/** Absolute paths force-excluded regardless of caller globs/focus (A-7b). */
|
|
61
|
+
excluded_absolute_paths: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
62
|
+
}, "strict", z.ZodTypeAny, {
|
|
63
|
+
immutable_snapshot_only: true;
|
|
64
|
+
original_plan_context_allowed: false;
|
|
65
|
+
plan_workspace_context_allowed: false;
|
|
66
|
+
original_plan_absolute_path: string;
|
|
67
|
+
enforced_exclude_globs: string[];
|
|
68
|
+
excluded_absolute_paths: string[];
|
|
69
|
+
}, {
|
|
70
|
+
immutable_snapshot_only: true;
|
|
71
|
+
original_plan_context_allowed: false;
|
|
72
|
+
plan_workspace_context_allowed: false;
|
|
73
|
+
original_plan_absolute_path: string;
|
|
74
|
+
enforced_exclude_globs: string[];
|
|
75
|
+
excluded_absolute_paths: string[];
|
|
76
|
+
}>;
|
|
77
|
+
/** Written once the preflight seam has actually enforced the policy. */
|
|
78
|
+
export declare const PlanReviewContextProvenanceSchema: z.ZodObject<{
|
|
79
|
+
enforced: z.ZodLiteral<true>;
|
|
80
|
+
context_mode: z.ZodOptional<z.ZodString>;
|
|
81
|
+
copied_paths: z.ZodArray<z.ZodString, "many">;
|
|
82
|
+
/** Paths the post-filter stripped from the finalized selection. */
|
|
83
|
+
filtered_out_paths: z.ZodArray<z.ZodString, "many">;
|
|
84
|
+
}, "strict", z.ZodTypeAny, {
|
|
85
|
+
copied_paths: string[];
|
|
86
|
+
enforced: true;
|
|
87
|
+
filtered_out_paths: string[];
|
|
88
|
+
context_mode?: string | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
copied_paths: string[];
|
|
91
|
+
enforced: true;
|
|
92
|
+
filtered_out_paths: string[];
|
|
93
|
+
context_mode?: string | undefined;
|
|
94
|
+
}>;
|
|
95
|
+
export declare const PlanReviewRunStateSchema: z.ZodEffects<z.ZodObject<{
|
|
96
|
+
schema_version: z.ZodLiteral<"council-plan-review-state-v1">;
|
|
97
|
+
/** Run-relative path to the persisted normalized execution contract. */
|
|
98
|
+
execution_contract_path: z.ZodEffects<z.ZodString, string, string>;
|
|
99
|
+
/** SHA-256 of the persisted contract FILE BYTES (corruption check). */
|
|
100
|
+
execution_contract_sha256: z.ZodString;
|
|
101
|
+
/** The P0-4 digest recomputed from the normalized contract (identity). */
|
|
102
|
+
execution_contract_digest: z.ZodString;
|
|
103
|
+
/** Run-relative path to the canonical, runtime-owned plan snapshot. */
|
|
104
|
+
snapshot_path: z.ZodEffects<z.ZodString, string, string>;
|
|
105
|
+
/** SHA-256 of the canonical snapshot FILE BYTES. */
|
|
106
|
+
snapshot_sha256: z.ZodString;
|
|
107
|
+
/** checkpoint-text-v1 digest of the canonical snapshot (== plan digest). */
|
|
108
|
+
plan_digest: z.ZodString;
|
|
109
|
+
seat_mappings: z.ZodArray<z.ZodObject<{
|
|
110
|
+
seat_id: z.ZodString;
|
|
111
|
+
cli_name: z.ZodEnum<["codex", "claude", "glm", "agy", "grok"]>;
|
|
112
|
+
reviewer_call_id: z.ZodString;
|
|
113
|
+
cross_review_call_id: z.ZodString;
|
|
114
|
+
}, "strict", z.ZodTypeAny, {
|
|
115
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
116
|
+
seat_id: string;
|
|
117
|
+
cross_review_call_id: string;
|
|
118
|
+
reviewer_call_id: string;
|
|
119
|
+
}, {
|
|
120
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
121
|
+
seat_id: string;
|
|
122
|
+
cross_review_call_id: string;
|
|
123
|
+
reviewer_call_id: string;
|
|
124
|
+
}>, "many">;
|
|
125
|
+
call_bindings: z.ZodArray<z.ZodObject<{
|
|
126
|
+
call_id: z.ZodString;
|
|
127
|
+
stage_id: z.ZodEnum<["reviewers", "cross_review", "chairman"]>;
|
|
128
|
+
seat_id: z.ZodString;
|
|
129
|
+
cli_name: z.ZodEnum<["codex", "claude", "glm", "agy", "grok"]>;
|
|
130
|
+
}, "strict", z.ZodTypeAny, {
|
|
131
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
132
|
+
seat_id: string;
|
|
133
|
+
stage_id: "reviewers" | "cross_review" | "chairman";
|
|
134
|
+
call_id: string;
|
|
135
|
+
}, {
|
|
136
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
137
|
+
seat_id: string;
|
|
138
|
+
stage_id: "reviewers" | "cross_review" | "chairman";
|
|
139
|
+
call_id: string;
|
|
140
|
+
}>, "many">;
|
|
141
|
+
context_policy: z.ZodObject<{
|
|
142
|
+
immutable_snapshot_only: z.ZodLiteral<true>;
|
|
143
|
+
original_plan_context_allowed: z.ZodLiteral<false>;
|
|
144
|
+
plan_workspace_context_allowed: z.ZodLiteral<false>;
|
|
145
|
+
/** The original caller `plan_file`, recorded ONLY to keep excluding it. */
|
|
146
|
+
original_plan_absolute_path: z.ZodEffects<z.ZodString, string, string>;
|
|
147
|
+
/** Forced exclusion globs folded in before curator dispatch (A-7a). */
|
|
148
|
+
enforced_exclude_globs: z.ZodArray<z.ZodString, "many">;
|
|
149
|
+
/** Absolute paths force-excluded regardless of caller globs/focus (A-7b). */
|
|
150
|
+
excluded_absolute_paths: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
151
|
+
}, "strict", z.ZodTypeAny, {
|
|
152
|
+
immutable_snapshot_only: true;
|
|
153
|
+
original_plan_context_allowed: false;
|
|
154
|
+
plan_workspace_context_allowed: false;
|
|
155
|
+
original_plan_absolute_path: string;
|
|
156
|
+
enforced_exclude_globs: string[];
|
|
157
|
+
excluded_absolute_paths: string[];
|
|
158
|
+
}, {
|
|
159
|
+
immutable_snapshot_only: true;
|
|
160
|
+
original_plan_context_allowed: false;
|
|
161
|
+
plan_workspace_context_allowed: false;
|
|
162
|
+
original_plan_absolute_path: string;
|
|
163
|
+
enforced_exclude_globs: string[];
|
|
164
|
+
excluded_absolute_paths: string[];
|
|
165
|
+
}>;
|
|
166
|
+
context_provenance: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
enforced: z.ZodLiteral<true>;
|
|
168
|
+
context_mode: z.ZodOptional<z.ZodString>;
|
|
169
|
+
copied_paths: z.ZodArray<z.ZodString, "many">;
|
|
170
|
+
/** Paths the post-filter stripped from the finalized selection. */
|
|
171
|
+
filtered_out_paths: z.ZodArray<z.ZodString, "many">;
|
|
172
|
+
}, "strict", z.ZodTypeAny, {
|
|
173
|
+
copied_paths: string[];
|
|
174
|
+
enforced: true;
|
|
175
|
+
filtered_out_paths: string[];
|
|
176
|
+
context_mode?: string | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
copied_paths: string[];
|
|
179
|
+
enforced: true;
|
|
180
|
+
filtered_out_paths: string[];
|
|
181
|
+
context_mode?: string | undefined;
|
|
182
|
+
}>>;
|
|
183
|
+
publication: z.ZodOptional<z.ZodDiscriminatedUnion<"committed", [z.ZodObject<{
|
|
184
|
+
committed: z.ZodLiteral<false>;
|
|
185
|
+
}, "strict", z.ZodTypeAny, {
|
|
186
|
+
committed: false;
|
|
187
|
+
}, {
|
|
188
|
+
committed: false;
|
|
189
|
+
}>, z.ZodObject<{
|
|
190
|
+
committed: z.ZodLiteral<true>;
|
|
191
|
+
sidecar_relpath: z.ZodString;
|
|
192
|
+
sidecar_sha256: z.ZodString;
|
|
193
|
+
bytes: z.ZodNumber;
|
|
194
|
+
}, "strict", z.ZodTypeAny, {
|
|
195
|
+
bytes: number;
|
|
196
|
+
committed: true;
|
|
197
|
+
sidecar_relpath: string;
|
|
198
|
+
sidecar_sha256: string;
|
|
199
|
+
}, {
|
|
200
|
+
bytes: number;
|
|
201
|
+
committed: true;
|
|
202
|
+
sidecar_relpath: string;
|
|
203
|
+
sidecar_sha256: string;
|
|
204
|
+
}>]>>;
|
|
205
|
+
}, "strict", z.ZodTypeAny, {
|
|
206
|
+
schema_version: "council-plan-review-state-v1";
|
|
207
|
+
execution_contract_digest: string;
|
|
208
|
+
plan_digest: string;
|
|
209
|
+
execution_contract_path: string;
|
|
210
|
+
execution_contract_sha256: string;
|
|
211
|
+
snapshot_path: string;
|
|
212
|
+
snapshot_sha256: string;
|
|
213
|
+
seat_mappings: {
|
|
214
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
215
|
+
seat_id: string;
|
|
216
|
+
cross_review_call_id: string;
|
|
217
|
+
reviewer_call_id: string;
|
|
218
|
+
}[];
|
|
219
|
+
call_bindings: {
|
|
220
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
221
|
+
seat_id: string;
|
|
222
|
+
stage_id: "reviewers" | "cross_review" | "chairman";
|
|
223
|
+
call_id: string;
|
|
224
|
+
}[];
|
|
225
|
+
context_policy: {
|
|
226
|
+
immutable_snapshot_only: true;
|
|
227
|
+
original_plan_context_allowed: false;
|
|
228
|
+
plan_workspace_context_allowed: false;
|
|
229
|
+
original_plan_absolute_path: string;
|
|
230
|
+
enforced_exclude_globs: string[];
|
|
231
|
+
excluded_absolute_paths: string[];
|
|
232
|
+
};
|
|
233
|
+
publication?: {
|
|
234
|
+
committed: false;
|
|
235
|
+
} | {
|
|
236
|
+
bytes: number;
|
|
237
|
+
committed: true;
|
|
238
|
+
sidecar_relpath: string;
|
|
239
|
+
sidecar_sha256: string;
|
|
240
|
+
} | undefined;
|
|
241
|
+
context_provenance?: {
|
|
242
|
+
copied_paths: string[];
|
|
243
|
+
enforced: true;
|
|
244
|
+
filtered_out_paths: string[];
|
|
245
|
+
context_mode?: string | undefined;
|
|
246
|
+
} | undefined;
|
|
247
|
+
}, {
|
|
248
|
+
schema_version: "council-plan-review-state-v1";
|
|
249
|
+
execution_contract_digest: string;
|
|
250
|
+
plan_digest: string;
|
|
251
|
+
execution_contract_path: string;
|
|
252
|
+
execution_contract_sha256: string;
|
|
253
|
+
snapshot_path: string;
|
|
254
|
+
snapshot_sha256: string;
|
|
255
|
+
seat_mappings: {
|
|
256
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
257
|
+
seat_id: string;
|
|
258
|
+
cross_review_call_id: string;
|
|
259
|
+
reviewer_call_id: string;
|
|
260
|
+
}[];
|
|
261
|
+
call_bindings: {
|
|
262
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
263
|
+
seat_id: string;
|
|
264
|
+
stage_id: "reviewers" | "cross_review" | "chairman";
|
|
265
|
+
call_id: string;
|
|
266
|
+
}[];
|
|
267
|
+
context_policy: {
|
|
268
|
+
immutable_snapshot_only: true;
|
|
269
|
+
original_plan_context_allowed: false;
|
|
270
|
+
plan_workspace_context_allowed: false;
|
|
271
|
+
original_plan_absolute_path: string;
|
|
272
|
+
enforced_exclude_globs: string[];
|
|
273
|
+
excluded_absolute_paths: string[];
|
|
274
|
+
};
|
|
275
|
+
publication?: {
|
|
276
|
+
committed: false;
|
|
277
|
+
} | {
|
|
278
|
+
bytes: number;
|
|
279
|
+
committed: true;
|
|
280
|
+
sidecar_relpath: string;
|
|
281
|
+
sidecar_sha256: string;
|
|
282
|
+
} | undefined;
|
|
283
|
+
context_provenance?: {
|
|
284
|
+
copied_paths: string[];
|
|
285
|
+
enforced: true;
|
|
286
|
+
filtered_out_paths: string[];
|
|
287
|
+
context_mode?: string | undefined;
|
|
288
|
+
} | undefined;
|
|
289
|
+
}>, {
|
|
290
|
+
schema_version: "council-plan-review-state-v1";
|
|
291
|
+
execution_contract_digest: string;
|
|
292
|
+
plan_digest: string;
|
|
293
|
+
execution_contract_path: string;
|
|
294
|
+
execution_contract_sha256: string;
|
|
295
|
+
snapshot_path: string;
|
|
296
|
+
snapshot_sha256: string;
|
|
297
|
+
seat_mappings: {
|
|
298
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
299
|
+
seat_id: string;
|
|
300
|
+
cross_review_call_id: string;
|
|
301
|
+
reviewer_call_id: string;
|
|
302
|
+
}[];
|
|
303
|
+
call_bindings: {
|
|
304
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
305
|
+
seat_id: string;
|
|
306
|
+
stage_id: "reviewers" | "cross_review" | "chairman";
|
|
307
|
+
call_id: string;
|
|
308
|
+
}[];
|
|
309
|
+
context_policy: {
|
|
310
|
+
immutable_snapshot_only: true;
|
|
311
|
+
original_plan_context_allowed: false;
|
|
312
|
+
plan_workspace_context_allowed: false;
|
|
313
|
+
original_plan_absolute_path: string;
|
|
314
|
+
enforced_exclude_globs: string[];
|
|
315
|
+
excluded_absolute_paths: string[];
|
|
316
|
+
};
|
|
317
|
+
publication?: {
|
|
318
|
+
committed: false;
|
|
319
|
+
} | {
|
|
320
|
+
bytes: number;
|
|
321
|
+
committed: true;
|
|
322
|
+
sidecar_relpath: string;
|
|
323
|
+
sidecar_sha256: string;
|
|
324
|
+
} | undefined;
|
|
325
|
+
context_provenance?: {
|
|
326
|
+
copied_paths: string[];
|
|
327
|
+
enforced: true;
|
|
328
|
+
filtered_out_paths: string[];
|
|
329
|
+
context_mode?: string | undefined;
|
|
330
|
+
} | undefined;
|
|
331
|
+
}, {
|
|
332
|
+
schema_version: "council-plan-review-state-v1";
|
|
333
|
+
execution_contract_digest: string;
|
|
334
|
+
plan_digest: string;
|
|
335
|
+
execution_contract_path: string;
|
|
336
|
+
execution_contract_sha256: string;
|
|
337
|
+
snapshot_path: string;
|
|
338
|
+
snapshot_sha256: string;
|
|
339
|
+
seat_mappings: {
|
|
340
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
341
|
+
seat_id: string;
|
|
342
|
+
cross_review_call_id: string;
|
|
343
|
+
reviewer_call_id: string;
|
|
344
|
+
}[];
|
|
345
|
+
call_bindings: {
|
|
346
|
+
cli_name: "codex" | "claude" | "glm" | "agy" | "grok";
|
|
347
|
+
seat_id: string;
|
|
348
|
+
stage_id: "reviewers" | "cross_review" | "chairman";
|
|
349
|
+
call_id: string;
|
|
350
|
+
}[];
|
|
351
|
+
context_policy: {
|
|
352
|
+
immutable_snapshot_only: true;
|
|
353
|
+
original_plan_context_allowed: false;
|
|
354
|
+
plan_workspace_context_allowed: false;
|
|
355
|
+
original_plan_absolute_path: string;
|
|
356
|
+
enforced_exclude_globs: string[];
|
|
357
|
+
excluded_absolute_paths: string[];
|
|
358
|
+
};
|
|
359
|
+
publication?: {
|
|
360
|
+
committed: false;
|
|
361
|
+
} | {
|
|
362
|
+
bytes: number;
|
|
363
|
+
committed: true;
|
|
364
|
+
sidecar_relpath: string;
|
|
365
|
+
sidecar_sha256: string;
|
|
366
|
+
} | undefined;
|
|
367
|
+
context_provenance?: {
|
|
368
|
+
copied_paths: string[];
|
|
369
|
+
enforced: true;
|
|
370
|
+
filtered_out_paths: string[];
|
|
371
|
+
context_mode?: string | undefined;
|
|
372
|
+
} | undefined;
|
|
373
|
+
}>;
|
|
374
|
+
export type PlanReviewRunState = z.infer<typeof PlanReviewRunStateSchema>;
|
|
375
|
+
export type PlanReviewCallBinding = z.infer<typeof PlanReviewCallBindingSchema>;
|
|
376
|
+
export type PlanReviewSeatMapping = z.infer<typeof PlanReviewSeatMappingSchema>;
|
|
377
|
+
export type PlanReviewContextPolicy = z.infer<typeof PlanReviewContextPolicySchema>;
|
|
378
|
+
export type PlanReviewContextProvenance = z.infer<typeof PlanReviewContextProvenanceSchema>;
|
|
379
|
+
/**
|
|
380
|
+
* Derive the ordered seat mapping from the normalized execution contract.
|
|
381
|
+
* The contract — not caller input — is the sole source.
|
|
382
|
+
*/
|
|
383
|
+
export declare function deriveSeatMappings(contract: CouncilPlanReviewExecutionContract): PlanReviewSeatMapping[];
|
|
384
|
+
/**
|
|
385
|
+
* Reconstruct the per-call bindings from the normalized execution contract.
|
|
386
|
+
* This is the ONLY constructor — the same function runs at admission and on
|
|
387
|
+
* resume, so a resumed run reconstructs byte-identical bindings or the
|
|
388
|
+
* contract is corrupt.
|
|
389
|
+
*/
|
|
390
|
+
export declare function reconstructPlanReviewCallBindings(contract: CouncilPlanReviewExecutionContract,
|
|
391
|
+
/**
|
|
392
|
+
* The chairman stage's call id. It is a property of the workflow definition
|
|
393
|
+
* (itself persisted + hash-verified as `workflow.snapshot.json`), NOT of the
|
|
394
|
+
* digest-bound contract, so it is threaded in rather than invented here.
|
|
395
|
+
*/
|
|
396
|
+
chairmanCallId: string): PlanReviewCallBinding[];
|
|
397
|
+
/** Strictly validate the subtree. Throws a ZodError on any deviation. */
|
|
398
|
+
export declare function parsePlanReviewRunState(value: unknown): PlanReviewRunState;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A-5 — the strict, optional `plan_review_state` subtree on RunState.
|
|
3
|
+
*
|
|
4
|
+
* This is deliberately a TYPED subtree, not a generic aux blob: everything a
|
|
5
|
+
* resumed run needs to re-derive its execution contract, its immutable plan
|
|
6
|
+
* snapshot, its ordered seat mapping, and its per-call bindings lives
|
|
7
|
+
* here, and nothing else does. Resume reads ONLY this (never `plan_file`, never
|
|
8
|
+
* re-parsed caller input), so anything absent from this schema is, by
|
|
9
|
+
* construction, not resumable.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import { CliNameSchema, DigestSchema, ReviewIdSchema } from "./contract.js";
|
|
13
|
+
import { PlanReviewPublicationMarkerSchema } from "./publication.js";
|
|
14
|
+
/** Run-relative path: never absolute, never an upward traversal. */
|
|
15
|
+
const RunRelativePathSchema = z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1)
|
|
18
|
+
.refine((value) => !value.startsWith("/") &&
|
|
19
|
+
!value.startsWith("\\") &&
|
|
20
|
+
!/^[A-Za-z]:[\\/]/.test(value) &&
|
|
21
|
+
!value.split(/[\\/]/).includes(".."), { message: "must be a run-relative path with no '..' segment" });
|
|
22
|
+
const AbsolutePathSchema = z.string().min(1).refine((value) => value.startsWith("/") || /^[A-Za-z]:[\\/]/.test(value), { message: "must be an absolute path" });
|
|
23
|
+
/** Ordered external seat_id ↔ opaque internal call id mapping (A-4). */
|
|
24
|
+
export const PlanReviewSeatMappingSchema = z
|
|
25
|
+
.object({
|
|
26
|
+
seat_id: ReviewIdSchema,
|
|
27
|
+
cli_name: CliNameSchema,
|
|
28
|
+
reviewer_call_id: z.string().regex(/^seat_[0-9]{3,}$/),
|
|
29
|
+
cross_review_call_id: z.string().regex(/^cross_[0-9]{3,}$/),
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
/**
|
|
33
|
+
* Per-call binding. One entry per DISPATCHABLE call (reviewer, cross-review,
|
|
34
|
+
* chairman) — reconstructed on resume so a resumed run cannot silently
|
|
35
|
+
* re-provider a call. It is also the SOLE carrier of the chairman's call_id:
|
|
36
|
+
* `PlanReviewSeatMappingSchema` maps reviewer/cross-review calls only.
|
|
37
|
+
*/
|
|
38
|
+
export const PlanReviewCallBindingSchema = z
|
|
39
|
+
.object({
|
|
40
|
+
call_id: z.string().regex(/^[A-Za-z0-9_-]+$/),
|
|
41
|
+
stage_id: z.enum(["reviewers", "cross_review", "chairman"]),
|
|
42
|
+
seat_id: ReviewIdSchema,
|
|
43
|
+
cli_name: CliNameSchema,
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
46
|
+
export const PlanReviewContextPolicySchema = z
|
|
47
|
+
.object({
|
|
48
|
+
immutable_snapshot_only: z.literal(true),
|
|
49
|
+
original_plan_context_allowed: z.literal(false),
|
|
50
|
+
plan_workspace_context_allowed: z.literal(false),
|
|
51
|
+
/** The original caller `plan_file`, recorded ONLY to keep excluding it. */
|
|
52
|
+
original_plan_absolute_path: AbsolutePathSchema,
|
|
53
|
+
/** Forced exclusion globs folded in before curator dispatch (A-7a). */
|
|
54
|
+
enforced_exclude_globs: z.array(z.string().min(1)).min(1),
|
|
55
|
+
/** Absolute paths force-excluded regardless of caller globs/focus (A-7b). */
|
|
56
|
+
excluded_absolute_paths: z.array(AbsolutePathSchema),
|
|
57
|
+
})
|
|
58
|
+
.strict();
|
|
59
|
+
/** Written once the preflight seam has actually enforced the policy. */
|
|
60
|
+
export const PlanReviewContextProvenanceSchema = z
|
|
61
|
+
.object({
|
|
62
|
+
enforced: z.literal(true),
|
|
63
|
+
context_mode: z.string().min(1).optional(),
|
|
64
|
+
copied_paths: z.array(z.string().min(1)),
|
|
65
|
+
/** Paths the post-filter stripped from the finalized selection. */
|
|
66
|
+
filtered_out_paths: z.array(z.string().min(1)),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
export const PlanReviewRunStateSchema = z
|
|
70
|
+
.object({
|
|
71
|
+
schema_version: z.literal("council-plan-review-state-v1"),
|
|
72
|
+
/** Run-relative path to the persisted normalized execution contract. */
|
|
73
|
+
execution_contract_path: RunRelativePathSchema,
|
|
74
|
+
/** SHA-256 of the persisted contract FILE BYTES (corruption check). */
|
|
75
|
+
execution_contract_sha256: DigestSchema,
|
|
76
|
+
/** The P0-4 digest recomputed from the normalized contract (identity). */
|
|
77
|
+
execution_contract_digest: DigestSchema,
|
|
78
|
+
/** Run-relative path to the canonical, runtime-owned plan snapshot. */
|
|
79
|
+
snapshot_path: RunRelativePathSchema,
|
|
80
|
+
/** SHA-256 of the canonical snapshot FILE BYTES. */
|
|
81
|
+
snapshot_sha256: DigestSchema,
|
|
82
|
+
/** checkpoint-text-v1 digest of the canonical snapshot (== plan digest). */
|
|
83
|
+
plan_digest: DigestSchema,
|
|
84
|
+
seat_mappings: z.array(PlanReviewSeatMappingSchema).min(1).max(10),
|
|
85
|
+
call_bindings: z.array(PlanReviewCallBindingSchema).min(1),
|
|
86
|
+
context_policy: PlanReviewContextPolicySchema,
|
|
87
|
+
context_provenance: PlanReviewContextProvenanceSchema.optional(),
|
|
88
|
+
publication: PlanReviewPublicationMarkerSchema.optional(),
|
|
89
|
+
})
|
|
90
|
+
.strict()
|
|
91
|
+
.superRefine((state, ctx) => {
|
|
92
|
+
const seatIds = new Set();
|
|
93
|
+
const callIds = new Set();
|
|
94
|
+
for (const [index, mapping] of state.seat_mappings.entries()) {
|
|
95
|
+
if (seatIds.has(mapping.seat_id)) {
|
|
96
|
+
ctx.addIssue({
|
|
97
|
+
code: z.ZodIssueCode.custom,
|
|
98
|
+
message: `Duplicate seat_id: ${mapping.seat_id}`,
|
|
99
|
+
path: ["seat_mappings", index, "seat_id"],
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
seatIds.add(mapping.seat_id);
|
|
103
|
+
for (const callId of [mapping.reviewer_call_id, mapping.cross_review_call_id]) {
|
|
104
|
+
if (callIds.has(callId)) {
|
|
105
|
+
ctx.addIssue({
|
|
106
|
+
code: z.ZodIssueCode.custom,
|
|
107
|
+
message: `Duplicate internal call id: ${callId}`,
|
|
108
|
+
path: ["seat_mappings", index],
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
callIds.add(callId);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
for (const [index, binding] of state.call_bindings.entries()) {
|
|
115
|
+
if (!seatIds.has(binding.seat_id)) {
|
|
116
|
+
ctx.addIssue({
|
|
117
|
+
code: z.ZodIssueCode.custom,
|
|
118
|
+
message: `call_bindings references unknown seat_id: ${binding.seat_id}`,
|
|
119
|
+
path: ["call_bindings", index, "seat_id"],
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* Derive the ordered seat mapping from the normalized execution contract.
|
|
126
|
+
* The contract — not caller input — is the sole source.
|
|
127
|
+
*/
|
|
128
|
+
export function deriveSeatMappings(contract) {
|
|
129
|
+
return contract.seats.map((seat) => {
|
|
130
|
+
if (seat.cross_review_call_id === undefined) {
|
|
131
|
+
throw new Error(`Execution contract seat "${seat.seat_id}" has no cross-review call mapping`);
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
seat_id: seat.seat_id,
|
|
135
|
+
cli_name: seat.cli_name,
|
|
136
|
+
reviewer_call_id: seat.internal_call_id,
|
|
137
|
+
cross_review_call_id: seat.cross_review_call_id,
|
|
138
|
+
};
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Reconstruct the per-call bindings from the normalized execution contract.
|
|
143
|
+
* This is the ONLY constructor — the same function runs at admission and on
|
|
144
|
+
* resume, so a resumed run reconstructs byte-identical bindings or the
|
|
145
|
+
* contract is corrupt.
|
|
146
|
+
*/
|
|
147
|
+
export function reconstructPlanReviewCallBindings(contract,
|
|
148
|
+
/**
|
|
149
|
+
* The chairman stage's call id. It is a property of the workflow definition
|
|
150
|
+
* (itself persisted + hash-verified as `workflow.snapshot.json`), NOT of the
|
|
151
|
+
* digest-bound contract, so it is threaded in rather than invented here.
|
|
152
|
+
*/
|
|
153
|
+
chairmanCallId) {
|
|
154
|
+
const bindings = [];
|
|
155
|
+
for (const seat of contract.seats) {
|
|
156
|
+
if (seat.cross_review_call_id === undefined) {
|
|
157
|
+
throw new Error(`Execution contract seat "${seat.seat_id}" has no cross-review call mapping`);
|
|
158
|
+
}
|
|
159
|
+
const shared = { seat_id: seat.seat_id, cli_name: seat.cli_name };
|
|
160
|
+
bindings.push({ ...shared, call_id: seat.internal_call_id, stage_id: "reviewers" });
|
|
161
|
+
bindings.push({
|
|
162
|
+
...shared,
|
|
163
|
+
call_id: seat.cross_review_call_id,
|
|
164
|
+
stage_id: "cross_review",
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const chairmanSeat = contract.seats.find((seat) => seat.seat_id === contract.chairman_seat);
|
|
168
|
+
if (chairmanSeat === undefined) {
|
|
169
|
+
throw new Error(`Execution contract chairman_seat "${contract.chairman_seat}" is not in the roster`);
|
|
170
|
+
}
|
|
171
|
+
bindings.push({
|
|
172
|
+
call_id: chairmanCallId,
|
|
173
|
+
stage_id: "chairman",
|
|
174
|
+
seat_id: chairmanSeat.seat_id,
|
|
175
|
+
cli_name: chairmanSeat.cli_name,
|
|
176
|
+
});
|
|
177
|
+
return bindings;
|
|
178
|
+
}
|
|
179
|
+
/** Strictly validate the subtree. Throws a ZodError on any deviation. */
|
|
180
|
+
export function parsePlanReviewRunState(value) {
|
|
181
|
+
return PlanReviewRunStateSchema.parse(value);
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=run-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-state.js","sourceRoot":"","sources":["../../src/plan-review/run-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,kBAAkB,CAAC;AAErE,oEAAoE;AACpE,MAAM,qBAAqB,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,CACR,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;IACtB,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;IACvB,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC;IAC9B,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EACtC,EAAE,OAAO,EAAE,kDAAkD,EAAE,CAChE,CAAC;AAEJ,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CACjD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EACjE,EAAE,OAAO,EAAE,0BAA0B,EAAE,CACxC,CAAC;AAEF,wEAAwE;AACxE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC;IACN,OAAO,EAAE,cA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ClC,QAAQ,EAAE,cAAc;SACzB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,aAAa,CAClD,CAAC;IACF,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,qCAAqC,QAAQ,CAAC,aAAa,wBAAwB,CACpF,CAAC;IACJ,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC;QACZ,OAAO,EAAE,cAAc;QACvB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,QAAQ,EAAE,YAAY,CAAC,QAAQ;KAChC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,OAAO,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { NormalizedWorkflowDefinition } from "../definition-normalizer.js";
|
|
2
|
+
import type { PlanReviewCallBinding, PlanReviewContextPolicy } from "./run-state.js";
|
|
3
|
+
/**
|
|
4
|
+
* Bind the verified persisted bindings to the persisted normalized definition.
|
|
5
|
+
* Exact coverage is required: a missing, extra, renamed, or re-providered call
|
|
6
|
+
* is a corrupt execution contract and must fail pre-backend (D3 — no fallback,
|
|
7
|
+
* no seat substitution).
|
|
8
|
+
*/
|
|
9
|
+
export declare function validatePlanReviewCallBindings(definition: NormalizedWorkflowDefinition, bindings: readonly PlanReviewCallBinding[]): ReadonlyMap<string, PlanReviewCallBinding>;
|
|
10
|
+
export interface PlanReviewPreparedInputPolicyInput {
|
|
11
|
+
/**
|
|
12
|
+
* The canonical text of the RE-VERIFIED persisted snapshot. Required whenever
|
|
13
|
+
* a bound call has a persisted prepared input; see the D9 note below.
|
|
14
|
+
*/
|
|
15
|
+
readonly snapshotText?: string | undefined;
|
|
16
|
+
/** The persisted, non-overridable context policy (A-7). Required likewise. */
|
|
17
|
+
readonly contextPolicy?: PlanReviewContextPolicy | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Validate persisted retry identity AND D9 before any provider/backend is created.
|
|
21
|
+
*
|
|
22
|
+
* ## Why the prompt is checked here and not left to the definition
|
|
23
|
+
*
|
|
24
|
+
* `WorkflowEngine.buildCallInput` replays a persisted prepared input verbatim —
|
|
25
|
+
* `structuredClone(resumedInput)` with only `cli_name` re-pinned. The expanded
|
|
26
|
+
* DEFINITION is not what reaches an actor on a resumed retry, so asserting D9
|
|
27
|
+
* against the definition proves nothing about that dispatch. The plan text now
|
|
28
|
+
* lives in the prompt bytes, which means the prompt is the D9 surface and this
|
|
29
|
+
* is the seam that must hold it: it already runs on the resume path, before any
|
|
30
|
+
* backend is created.
|
|
31
|
+
*
|
|
32
|
+
* A LEGITIMATE persisted input always passes, because `buildCallInput` appended
|
|
33
|
+
* the bound snapshot block at original dispatch and persisted that exact prompt.
|
|
34
|
+
* So this rejects only state that was tampered with, hand-written, or carried
|
|
35
|
+
* over from a different plan revision.
|
|
36
|
+
*
|
|
37
|
+
* ## What this check ESTABLISHES — and what it does not
|
|
38
|
+
*
|
|
39
|
+
* It establishes exactly two things: the verified snapshot block is the prompt's
|
|
40
|
+
* SUFFIX, and no other block opens before it. POSITION is what makes this exact.
|
|
41
|
+
* Mere presence is satisfied by a prompt carrying the verified block beside a
|
|
42
|
+
* second, different plan revision — the resumed dispatch replays the whole
|
|
43
|
+
* persisted prompt, so an actor would see both and could not know which binds.
|
|
44
|
+
* The suffix rule rejects a revision appended AFTER the verified block; the
|
|
45
|
+
* prefix scan rejects one spliced in BEFORE it.
|
|
46
|
+
*
|
|
47
|
+
* Both rules are stated against what `buildCallInput` actually composes —
|
|
48
|
+
* `renderedPrompt + renderPlanSnapshotBlock(text)` — so every honest persisted
|
|
49
|
+
* input passes BY CONSTRUCTION rather than by luck, including one rendered from
|
|
50
|
+
* the shipped templates, whose prose quotes the delimiter inline.
|
|
51
|
+
*
|
|
52
|
+
* It does NOT establish prompt EXCLUSIVITY, and must not be read as doing so.
|
|
53
|
+
* Raw plan text appended WITHOUT delimiters is not detectable here: there is no
|
|
54
|
+
* way to distinguish it from legitimate instruction prose, and pretending
|
|
55
|
+
* otherwise would republish precisely the kind of unbacked claim this file's
|
|
56
|
+
* surrounding work exists to delete. What bounds that residue is the trust
|
|
57
|
+
* model, not this function: plan review is TRUSTED-INPUT-ONLY, and an actor who
|
|
58
|
+
* can rewrite `state.json` to append a plan can equally rewrite it
|
|
59
|
+
* self-consistently. This is a fail-closed integrity check on honest state, not
|
|
60
|
+
* a boundary against an adversary who already owns the state directory.
|
|
61
|
+
*
|
|
62
|
+
* ## What is NOT checked, and why
|
|
63
|
+
*
|
|
64
|
+
* NOT `absolute_file_paths === []`. That is true of the expanded call
|
|
65
|
+
* DEFINITION, and there it is load-bearing. It is NOT true of a dispatched
|
|
66
|
+
* input: the engine composes `absolute_file_paths` from anonymized peer
|
|
67
|
+
* artifacts (cross-review, chairman) plus `absolute_file_paths_from:
|
|
68
|
+
* [context_files, context_bundle_files]` — the caller's repo evidence
|
|
69
|
+
* (`workflows/plan-review-receipts.yaml:124,147,196`). Requiring an empty list
|
|
70
|
+
* would reject every legitimate cross-review and chairman resume. The honest
|
|
71
|
+
* file-side invariant is the one the policy already defines: no attached path
|
|
72
|
+
* may be the original plan or any plan-workspace `PLAN.md`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function validatePlanReviewPreparedInputPolicy(preparedInputs: ReadonlyMap<string, Readonly<Record<string, unknown>>>, bindingsByCall: ReadonlyMap<string, PlanReviewCallBinding>, input?: PlanReviewPreparedInputPolicyInput): void;
|