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,437 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C-2/C-3 — the deterministic plan-review projector.
|
|
3
|
+
*
|
|
4
|
+
* This module answers exactly one question: given what a run DURABLY persisted,
|
|
5
|
+
* what `council-plan-review-result-v1` envelope does that run project? It never
|
|
6
|
+
* decides approval, never repairs a receipt, and never invents a seat.
|
|
7
|
+
*
|
|
8
|
+
* The split is load-bearing:
|
|
9
|
+
*
|
|
10
|
+
* - {@link projectCouncilPlanReviewResult} is PURE. It takes observations and
|
|
11
|
+
* returns an envelope. No filesystem, no clock, no adapter registry. Every
|
|
12
|
+
* projection rule (roster order, trusted identity, complete-vs-partial, the
|
|
13
|
+
* 1 MiB ceiling) is testable without touching disk.
|
|
14
|
+
* - {@link projectPlanReviewRun} is the bounded I/O adapter. It is the ONLY
|
|
15
|
+
* part that reads, and it reads exclusively through the shared C-1
|
|
16
|
+
* no-follow contained reader with a byte ceiling.
|
|
17
|
+
*
|
|
18
|
+
* Three invariants the shape enforces rather than documents:
|
|
19
|
+
*
|
|
20
|
+
* 1. IDENTITY IS NEVER MODEL-SOURCED. A seat's `seat_id`/`reviewer`/`cli_name`
|
|
21
|
+
* and every receipt binding come from the normalized execution contract and
|
|
22
|
+
* the persisted mappings. The model contributes only the six semantic fields
|
|
23
|
+
* that `PlanReviewReviewerBodySchema` admits; because that schema is
|
|
24
|
+
* non-strict, an echoed `seat_id`/`digest` is dropped before assembly and
|
|
25
|
+
* cannot reach a candidate.
|
|
26
|
+
* 2. UNREADABLE IS NOT UNTRUE, AND NEITHER IS FABRICATED. Containment, symlink,
|
|
27
|
+
* size, parse, schema, duplicate, and absence failures all project the seat
|
|
28
|
+
* as `missing`/`failed` with a reason. There is no code path from "the
|
|
29
|
+
* artifact was bad" to "here is a receipt".
|
|
30
|
+
* 3. DISPATCH IS NOT VALIDITY. `attemptsConsumed >= 1` is the durable witness
|
|
31
|
+
* that a reviewer was ever dispatched, and it decides ONLY publication
|
|
32
|
+
* eligibility ({@link isPlanReviewPublicationEligible}). It is structurally
|
|
33
|
+
* unavailable to the projection core, which never sees a `CallStateEntry`.
|
|
34
|
+
*/
|
|
35
|
+
import { CouncilPlanReviewResultSchema, } from "./contract.js";
|
|
36
|
+
import { computeCouncilPlanReviewExecutionContractDigest, } from "./execution-contract.js";
|
|
37
|
+
import { parsePlanReviewRunState } from "./run-state.js";
|
|
38
|
+
import { PlanReviewStageError } from "./stage-error.js";
|
|
39
|
+
import { readContainedRelativeFile } from "../contained-file.js";
|
|
40
|
+
import { assemblePlanReviewReceiptCandidate, PlanReviewChairmanOutputSchema, PLAN_REVIEW_CHAIRMAN_MAX_BYTES, PLAN_REVIEW_REVIEWER_MAX_BYTES, } from "../validators/plan-review.js";
|
|
41
|
+
/** The seat `error.detail` bound from the compiled contract. */
|
|
42
|
+
const MAX_ERROR_DETAIL_CHARS = 2_048;
|
|
43
|
+
/** The reviewer stage id stamped by `reconstructPlanReviewCallBindings`. */
|
|
44
|
+
const REVIEWERS_STAGE_ID = "reviewers";
|
|
45
|
+
const CHAIRMAN_STAGE_ID = "chairman";
|
|
46
|
+
function projectionFailure(message, reason = "internal_error") {
|
|
47
|
+
throw new PlanReviewStageError("publication", message, reason);
|
|
48
|
+
}
|
|
49
|
+
/** Diagnostics are bounded to stay schema-valid; evidence never is. */
|
|
50
|
+
function boundDetail(detail) {
|
|
51
|
+
if (detail === undefined || detail === "")
|
|
52
|
+
return undefined;
|
|
53
|
+
return detail.length <= MAX_ERROR_DETAIL_CHARS
|
|
54
|
+
? detail
|
|
55
|
+
: detail.slice(0, MAX_ERROR_DETAIL_CHARS);
|
|
56
|
+
}
|
|
57
|
+
function errorObject(reason, detail) {
|
|
58
|
+
const bounded = boundDetail(detail);
|
|
59
|
+
return bounded === undefined ? { reason } : { reason, detail: bounded };
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Index observations by seat. A seat observed twice is AMBIGUOUS, not
|
|
63
|
+
* first-wins: picking either one would be a guess about which artifact the run
|
|
64
|
+
* actually produced, so the seat projects `missing`.
|
|
65
|
+
*/
|
|
66
|
+
function indexObservations(observations) {
|
|
67
|
+
const index = new Map();
|
|
68
|
+
for (const observation of observations) {
|
|
69
|
+
index.set(observation.seat_id, index.has(observation.seat_id) ? "duplicate" : observation.outcome);
|
|
70
|
+
}
|
|
71
|
+
return index;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Project the envelope from observations alone.
|
|
75
|
+
*
|
|
76
|
+
* Deterministic by construction: output depends only on `input`, and seat order
|
|
77
|
+
* is the contract's roster order — never observation arrival order. An
|
|
78
|
+
* observation for a seat outside the roster cannot appear in the output because
|
|
79
|
+
* the roster, not the observation list, drives iteration.
|
|
80
|
+
*
|
|
81
|
+
* @throws PlanReviewStageError on a digest that is not the contract identity, or
|
|
82
|
+
* an envelope that fails its own compiled contract (including the 1 MiB
|
|
83
|
+
* ceiling). Oversize is an explicit error — never truncation.
|
|
84
|
+
*/
|
|
85
|
+
export function projectCouncilPlanReviewResult(input) {
|
|
86
|
+
const { contract } = input;
|
|
87
|
+
// Recompute rather than accept: an envelope stamped with a digest its own
|
|
88
|
+
// contract does not produce would bind receipts to a review that never ran.
|
|
89
|
+
// This is the whole point of the P0-4 identity, and it is pure — no I/O.
|
|
90
|
+
let recomputed;
|
|
91
|
+
try {
|
|
92
|
+
recomputed = computeCouncilPlanReviewExecutionContractDigest(contract).digest;
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
projectionFailure(`Execution contract could not be canonicalized: ${err instanceof Error ? err.message : String(err)}`, "schema_mismatch");
|
|
96
|
+
}
|
|
97
|
+
if (recomputed !== input.execution_contract_digest) {
|
|
98
|
+
projectionFailure(`Recomputed execution_contract_digest ${recomputed} does not match the asserted ${input.execution_contract_digest}`, "schema_mismatch");
|
|
99
|
+
}
|
|
100
|
+
const observed = indexObservations(input.seats);
|
|
101
|
+
const seats = contract.seats.map((rosterSeat) => {
|
|
102
|
+
const identity = {
|
|
103
|
+
seat_id: rosterSeat.seat_id,
|
|
104
|
+
internal_call_id: rosterSeat.internal_call_id,
|
|
105
|
+
reviewer: rosterSeat.reviewer,
|
|
106
|
+
cli_name: rosterSeat.cli_name,
|
|
107
|
+
};
|
|
108
|
+
const outcome = observed.get(rosterSeat.seat_id);
|
|
109
|
+
if (outcome === undefined) {
|
|
110
|
+
return {
|
|
111
|
+
...identity,
|
|
112
|
+
execution_status: "missing",
|
|
113
|
+
error: errorObject("no_artifact", "No persisted artifact for this seat"),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
if (outcome === "duplicate") {
|
|
117
|
+
return {
|
|
118
|
+
...identity,
|
|
119
|
+
execution_status: "missing",
|
|
120
|
+
error: errorObject("internal_error", `Seat ${rosterSeat.seat_id} was observed more than once; refusing to choose between artifacts`),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (outcome.kind === "failed" || outcome.kind === "missing") {
|
|
124
|
+
return {
|
|
125
|
+
...identity,
|
|
126
|
+
execution_status: outcome.kind,
|
|
127
|
+
error: errorObject(outcome.reason, outcome.detail),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
// The only path to a candidate: assemble trusted identity + the model's
|
|
131
|
+
// semantic body, then validate the assembled object against the compiled
|
|
132
|
+
// 17-field receipt contract. Any rejection is a `missing` seat.
|
|
133
|
+
try {
|
|
134
|
+
const receipt = assemblePlanReviewReceiptCandidate({
|
|
135
|
+
review_id: contract.bindings.review_id,
|
|
136
|
+
repository_id: contract.bindings.repository_id,
|
|
137
|
+
iteration: Number(contract.bindings.iteration),
|
|
138
|
+
plan_id: contract.bindings.plan_id,
|
|
139
|
+
revision: Number(contract.bindings.revision),
|
|
140
|
+
digest: contract.bindings.plan_digest,
|
|
141
|
+
seat_id: rosterSeat.seat_id,
|
|
142
|
+
reviewer: rosterSeat.reviewer,
|
|
143
|
+
}, outcome.body);
|
|
144
|
+
return {
|
|
145
|
+
...identity,
|
|
146
|
+
execution_status: "completed",
|
|
147
|
+
receipt_candidate: receipt,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
return {
|
|
152
|
+
...identity,
|
|
153
|
+
execution_status: "missing",
|
|
154
|
+
error: errorObject("schema_mismatch", `Artifact failed review-receipt-v1 validation: ${err instanceof Error ? err.message : String(err)}`),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
const chairmanSeat = contract.seats.find((candidate) => candidate.seat_id === contract.chairman_seat);
|
|
159
|
+
if (chairmanSeat === undefined) {
|
|
160
|
+
// Unreachable through the contract schema, which refines chairman_seat into
|
|
161
|
+
// the roster. Fail loudly rather than emit a chairman-less envelope.
|
|
162
|
+
projectionFailure(`Execution contract chairman_seat "${contract.chairman_seat}" is not in the roster`, "schema_mismatch");
|
|
163
|
+
}
|
|
164
|
+
const chairman = projectChairman(input.chairman, chairmanSeat.seat_id, chairmanSeat.cli_name);
|
|
165
|
+
const envelope = {
|
|
166
|
+
schema_version: "council-plan-review-result-v1",
|
|
167
|
+
execution_contract_digest: recomputed,
|
|
168
|
+
execution_status: seats.every((entry) => entry.execution_status === "completed")
|
|
169
|
+
? "complete"
|
|
170
|
+
: "partial",
|
|
171
|
+
bindings: {
|
|
172
|
+
repository_id: contract.bindings.repository_id,
|
|
173
|
+
review_id: contract.bindings.review_id,
|
|
174
|
+
plan_id: contract.bindings.plan_id,
|
|
175
|
+
revision: Number(contract.bindings.revision),
|
|
176
|
+
digest: contract.bindings.plan_digest,
|
|
177
|
+
threshold: Number(contract.threshold),
|
|
178
|
+
designated_editor: contract.designated_editor,
|
|
179
|
+
chairman_seat: contract.chairman_seat,
|
|
180
|
+
},
|
|
181
|
+
seats,
|
|
182
|
+
chairman,
|
|
183
|
+
};
|
|
184
|
+
// Validate through the compiled contract rather than trusting the assembly
|
|
185
|
+
// above: it is the same seam every other producer passes, and it owns the
|
|
186
|
+
// binding/duplicate/ceiling refinements. A rejection here is a bug or an
|
|
187
|
+
// over-ceiling envelope, and either way it must surface, not truncate.
|
|
188
|
+
const parsed = CouncilPlanReviewResultSchema.safeParse(envelope);
|
|
189
|
+
if (!parsed.success) {
|
|
190
|
+
projectionFailure(`Projected envelope failed council-plan-review-result-v1 validation: ${parsed.error.issues
|
|
191
|
+
.map((issue) => `${issue.path.join(".")}: ${issue.message}`)
|
|
192
|
+
.join("; ")}`, "invalid_output");
|
|
193
|
+
}
|
|
194
|
+
return parsed.data;
|
|
195
|
+
}
|
|
196
|
+
function projectChairman(observation, seatId, cliName) {
|
|
197
|
+
if (observation.kind === "skipped") {
|
|
198
|
+
return { seat_id: seatId, cli_name: cliName, execution_status: "skipped" };
|
|
199
|
+
}
|
|
200
|
+
if (observation.kind === "failed") {
|
|
201
|
+
return { seat_id: seatId, cli_name: cliName, execution_status: "failed" };
|
|
202
|
+
}
|
|
203
|
+
const parsed = PlanReviewChairmanOutputSchema.safeParse(observation.body);
|
|
204
|
+
if (!parsed.success) {
|
|
205
|
+
// A chairman synthesis is advisory; an unusable one is reported as failed
|
|
206
|
+
// rather than salvaged, and never blocks a complete seat set.
|
|
207
|
+
return { seat_id: seatId, cli_name: cliName, execution_status: "failed" };
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
seat_id: seatId,
|
|
211
|
+
cli_name: cliName,
|
|
212
|
+
execution_status: "completed",
|
|
213
|
+
synthesis: parsed.data.synthesis,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
// ---------------------------------------------------------------------------
|
|
217
|
+
// Durable dispatch witness
|
|
218
|
+
// ---------------------------------------------------------------------------
|
|
219
|
+
function planReviewSubtree(state) {
|
|
220
|
+
if (state.plan_review_state === undefined)
|
|
221
|
+
return undefined;
|
|
222
|
+
const parsed = parsePlanReviewRunState(state.plan_review_state);
|
|
223
|
+
return parsed;
|
|
224
|
+
}
|
|
225
|
+
function findStage(state, stageId) {
|
|
226
|
+
return state.stages.find((stage) => stage.stageId === stageId);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Whether this run ever dispatched a reviewer, and therefore owes a result
|
|
230
|
+
* sidecar (C-5 eligibility).
|
|
231
|
+
*
|
|
232
|
+
* Reads ONLY the durable `attemptsConsumed` witness, never the call's current
|
|
233
|
+
* state: a run that dispatched three seats and then had every one of them fail,
|
|
234
|
+
* time out, or be cancelled still owes an envelope reporting exactly that. The
|
|
235
|
+
* inverse — treating this witness as evidence a candidate exists — is precisely
|
|
236
|
+
* the fabrication this module forbids, which is why the projection core takes
|
|
237
|
+
* observations and cannot see a `CallStateEntry` at all.
|
|
238
|
+
*/
|
|
239
|
+
export function isPlanReviewPublicationEligible(state) {
|
|
240
|
+
let subtree;
|
|
241
|
+
try {
|
|
242
|
+
subtree = planReviewSubtree(state);
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
if (subtree === undefined)
|
|
248
|
+
return false;
|
|
249
|
+
const reviewerCallIds = new Set(subtree.seat_mappings.map((mapping) => mapping.reviewer_call_id));
|
|
250
|
+
const reviewers = findStage(state, REVIEWERS_STAGE_ID);
|
|
251
|
+
if (reviewers === undefined)
|
|
252
|
+
return false;
|
|
253
|
+
return reviewers.calls.some((call) => reviewerCallIds.has(call.callId) && (call.attemptsConsumed ?? 0) >= 1);
|
|
254
|
+
}
|
|
255
|
+
function lookupCall(stage, callId) {
|
|
256
|
+
if (stage === undefined)
|
|
257
|
+
return { kind: "absent" };
|
|
258
|
+
const matches = stage.calls.filter((call) => call.callId === callId);
|
|
259
|
+
if (matches.length === 0)
|
|
260
|
+
return { kind: "absent" };
|
|
261
|
+
if (matches.length > 1)
|
|
262
|
+
return { kind: "duplicate" };
|
|
263
|
+
return { kind: "found", call: matches[0] };
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Classify a terminally-failed call from durable evidence only.
|
|
267
|
+
*
|
|
268
|
+
* A persisted exit code is direct evidence of `nonzero_exit`. Timeouts are
|
|
269
|
+
* deliberately NOT inferred: no typed witness survives in state, and guessing a
|
|
270
|
+
* reason from an error string would be exactly the kind of repair this module
|
|
271
|
+
* refuses. Unclassifiable failures stay `internal_error` with the persisted
|
|
272
|
+
* message as detail.
|
|
273
|
+
*/
|
|
274
|
+
function classifyFailure(call) {
|
|
275
|
+
if (call.state === "cancelled")
|
|
276
|
+
return "cancelled";
|
|
277
|
+
const exitCode = call.childDebugMetadata?.exit_code;
|
|
278
|
+
if (typeof exitCode === "number" && exitCode !== 0)
|
|
279
|
+
return "nonzero_exit";
|
|
280
|
+
return "internal_error";
|
|
281
|
+
}
|
|
282
|
+
/** Read + parse one artifact through the shared no-follow contained reader. */
|
|
283
|
+
async function readArtifact(runDir, relPath, maxBytes) {
|
|
284
|
+
let content;
|
|
285
|
+
try {
|
|
286
|
+
const read = await readContainedRelativeFile(runDir, relPath, {
|
|
287
|
+
wantContent: true,
|
|
288
|
+
requireRegular: true,
|
|
289
|
+
maxBytes,
|
|
290
|
+
containerLabel: "run directory",
|
|
291
|
+
pathLabel: "artifactPath",
|
|
292
|
+
});
|
|
293
|
+
content = read.content;
|
|
294
|
+
}
|
|
295
|
+
catch (err) {
|
|
296
|
+
// Containment, symlink, size, race, and absence collapse here on purpose:
|
|
297
|
+
// each one means "this artifact cannot be trusted as evidence", and the
|
|
298
|
+
// envelope's answer to that is identical.
|
|
299
|
+
return {
|
|
300
|
+
ok: false,
|
|
301
|
+
reason: "no_artifact",
|
|
302
|
+
detail: `Artifact ${relPath} is unreadable: ${err instanceof Error ? err.message : String(err)}`,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
try {
|
|
306
|
+
return { ok: true, body: JSON.parse(content) };
|
|
307
|
+
}
|
|
308
|
+
catch (err) {
|
|
309
|
+
return {
|
|
310
|
+
ok: false,
|
|
311
|
+
reason: "invalid_output",
|
|
312
|
+
detail: `Artifact ${relPath} is not valid JSON: ${err instanceof Error ? err.message : String(err)}`,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
async function observeSeat(runDir, reviewers, callId) {
|
|
317
|
+
const lookup = lookupCall(reviewers, callId);
|
|
318
|
+
if (lookup.kind === "absent") {
|
|
319
|
+
return { kind: "missing", reason: "no_artifact", detail: `No persisted call ${callId}` };
|
|
320
|
+
}
|
|
321
|
+
if (lookup.kind === "duplicate") {
|
|
322
|
+
return {
|
|
323
|
+
kind: "missing",
|
|
324
|
+
reason: "internal_error",
|
|
325
|
+
detail: `Persisted state holds more than one call ${callId}`,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
const { call } = lookup;
|
|
329
|
+
// Retries reuse one call identity, so this single entry IS the seat's final
|
|
330
|
+
// word — there is no per-attempt history to reconcile and nothing to count
|
|
331
|
+
// twice.
|
|
332
|
+
if (call.state === "failed" || call.state === "cancelled") {
|
|
333
|
+
return {
|
|
334
|
+
kind: "failed",
|
|
335
|
+
reason: classifyFailure(call),
|
|
336
|
+
detail: call.errorMessage ?? `Call ${callId} ended ${call.state}`,
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
if (call.state !== "succeeded") {
|
|
340
|
+
// pending/running at terminal time: never dispatched, or died mid-flight.
|
|
341
|
+
// An artifact on disk for such a call is not a result the run stands behind.
|
|
342
|
+
return {
|
|
343
|
+
kind: "missing",
|
|
344
|
+
reason: "no_artifact",
|
|
345
|
+
detail: `Call ${callId} is ${call.state}, not a final succeeded call`,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
if (call.artifactPath === undefined) {
|
|
349
|
+
return {
|
|
350
|
+
kind: "missing",
|
|
351
|
+
reason: "no_artifact",
|
|
352
|
+
detail: `Succeeded call ${callId} persisted no artifact`,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
const read = await readArtifact(runDir, call.artifactPath, PLAN_REVIEW_REVIEWER_MAX_BYTES);
|
|
356
|
+
return read.ok
|
|
357
|
+
? { kind: "artifact", body: read.body }
|
|
358
|
+
: { kind: "missing", reason: read.reason, detail: read.detail };
|
|
359
|
+
}
|
|
360
|
+
async function observeChairman(runDir, state, subtree) {
|
|
361
|
+
// `call_bindings` is the SOLE carrier of the chairman's call_id — the seat
|
|
362
|
+
// mappings cover reviewer/cross-review calls only.
|
|
363
|
+
const bindings = subtree.call_bindings.filter((binding) => binding.stage_id === CHAIRMAN_STAGE_ID);
|
|
364
|
+
// Zero or ambiguous chairman binding: the chairman is advisory, so this
|
|
365
|
+
// degrades the chairman rather than the whole envelope.
|
|
366
|
+
if (bindings.length !== 1)
|
|
367
|
+
return { kind: "failed" };
|
|
368
|
+
const lookup = lookupCall(findStage(state, CHAIRMAN_STAGE_ID), bindings[0].call_id);
|
|
369
|
+
if (lookup.kind !== "found")
|
|
370
|
+
return { kind: "failed" };
|
|
371
|
+
const { call } = lookup;
|
|
372
|
+
if (call.state === "failed" || call.state === "cancelled")
|
|
373
|
+
return { kind: "failed" };
|
|
374
|
+
if (call.state !== "succeeded") {
|
|
375
|
+
return (call.attemptsConsumed ?? 0) >= 1 ? { kind: "failed" } : { kind: "skipped" };
|
|
376
|
+
}
|
|
377
|
+
if (call.artifactPath === undefined)
|
|
378
|
+
return { kind: "failed" };
|
|
379
|
+
const read = await readArtifact(runDir, call.artifactPath, PLAN_REVIEW_CHAIRMAN_MAX_BYTES);
|
|
380
|
+
return read.ok ? { kind: "artifact", body: read.body } : { kind: "failed" };
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Project a run's envelope from its persisted state and artifacts.
|
|
384
|
+
*
|
|
385
|
+
* The contract is threaded in already-restored (`resume.ts` owns decode +
|
|
386
|
+
* hash-verify + recompute) but is NOT taken on faith: it must be the identity
|
|
387
|
+
* the run persisted, and its roster must agree with the persisted mappings.
|
|
388
|
+
* Otherwise this would happily project a run under a contract it never ran.
|
|
389
|
+
*
|
|
390
|
+
* @throws PlanReviewStageError when the persisted subtree is absent/corrupt, the
|
|
391
|
+
* contract is not the persisted identity, or the projection itself fails.
|
|
392
|
+
*/
|
|
393
|
+
export async function projectPlanReviewRun(source) {
|
|
394
|
+
const { runDir, state, contract } = source;
|
|
395
|
+
if (state.plan_review_state === undefined) {
|
|
396
|
+
throw new PlanReviewStageError("execution_contract", "Run has no persisted plan_review_state to project", "no_artifact");
|
|
397
|
+
}
|
|
398
|
+
let subtree;
|
|
399
|
+
try {
|
|
400
|
+
subtree = parsePlanReviewRunState(state.plan_review_state);
|
|
401
|
+
}
|
|
402
|
+
catch (err) {
|
|
403
|
+
throw new PlanReviewStageError("execution_contract", `Persisted plan_review_state failed validation: ${err instanceof Error ? err.message : String(err)}`, "schema_mismatch");
|
|
404
|
+
}
|
|
405
|
+
if (source.execution_contract_digest !== subtree.execution_contract_digest) {
|
|
406
|
+
throw new PlanReviewStageError("execution_contract", `Contract digest ${source.execution_contract_digest} is not the persisted identity ${subtree.execution_contract_digest}`, "schema_mismatch");
|
|
407
|
+
}
|
|
408
|
+
// The mappings are the run's own record of which internal call served which
|
|
409
|
+
// seat. If the contract's roster and that record disagree, there is no
|
|
410
|
+
// trustworthy seat→call binding left to project from.
|
|
411
|
+
const rosterMatches = subtree.seat_mappings.length === contract.seats.length &&
|
|
412
|
+
contract.seats.every((rosterSeat, index) => {
|
|
413
|
+
const mapping = subtree.seat_mappings[index];
|
|
414
|
+
return (mapping !== undefined &&
|
|
415
|
+
mapping.seat_id === rosterSeat.seat_id &&
|
|
416
|
+
mapping.cli_name === rosterSeat.cli_name &&
|
|
417
|
+
mapping.reviewer_call_id === rosterSeat.internal_call_id);
|
|
418
|
+
});
|
|
419
|
+
if (!rosterMatches) {
|
|
420
|
+
throw new PlanReviewStageError("execution_contract", "Persisted seat mappings do not match the execution-contract roster", "schema_mismatch");
|
|
421
|
+
}
|
|
422
|
+
const reviewers = findStage(state, REVIEWERS_STAGE_ID);
|
|
423
|
+
const seats = [];
|
|
424
|
+
for (const mapping of subtree.seat_mappings) {
|
|
425
|
+
seats.push({
|
|
426
|
+
seat_id: mapping.seat_id,
|
|
427
|
+
outcome: await observeSeat(runDir, reviewers, mapping.reviewer_call_id),
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
return projectCouncilPlanReviewResult({
|
|
431
|
+
contract,
|
|
432
|
+
execution_contract_digest: source.execution_contract_digest,
|
|
433
|
+
seats,
|
|
434
|
+
chairman: await observeChairman(runDir, state, subtree),
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
//# sourceMappingURL=projector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projector.js","sourceRoot":"","sources":["../../src/plan-review/projector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EACL,6BAA6B,GAE9B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,+CAA+C,GAEhD,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAA2B,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAA8B,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,8BAA8B,CAAC;AAGtC,gEAAgE;AAChE,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAErC,4EAA4E;AAC5E,MAAM,kBAAkB,GAAG,WAAW,CAAC;AACvC,MAAM,iBAAiB,GAAG,UAAU,CAAC;AA+CrC,SAAS,iBAAiB,CACxB,OAAe,EACf,SAAgC,gBAAgB;IAEhD,MAAM,IAAI,oBAAoB,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC;AAED,uEAAuE;AACvE,SAAS,WAAW,CAAC,MAA0B;IAC7C,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAC5D,OAAO,MAAM,CAAC,MAAM,IAAI,sBAAsB;QAC5C,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,MAAM,CAAC,KA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C,KAAK,CAAC,IAAI,CAAC;YACT,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO,EAAE,MAAM,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC;SACxE,CAAC,CAAC;IACL,CAAC;IAED,OAAO,8BAA8B,CAAC;QACpC,QAAQ;QACR,yBAAyB,EAAE,MAAM,CAAC,yBAAyB;QAC3D,KAAK;QACL,QAAQ,EAAE,MAAM,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;KACxD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type CouncilPlanReviewResult } from "./contract.js";
|
|
3
|
+
import type { PlanReviewErrorReason } from "./stage-error.js";
|
|
4
|
+
export declare const PLAN_REVIEW_RESULT_RELPATH = "results/council-plan-review-result.json";
|
|
5
|
+
/** Atomic state marker written only by the later Track-C publication path. */
|
|
6
|
+
export declare const PlanReviewPublicationMarkerSchema: z.ZodDiscriminatedUnion<"committed", [z.ZodObject<{
|
|
7
|
+
committed: z.ZodLiteral<false>;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
committed: false;
|
|
10
|
+
}, {
|
|
11
|
+
committed: false;
|
|
12
|
+
}>, z.ZodObject<{
|
|
13
|
+
committed: z.ZodLiteral<true>;
|
|
14
|
+
sidecar_relpath: z.ZodString;
|
|
15
|
+
sidecar_sha256: z.ZodString;
|
|
16
|
+
bytes: z.ZodNumber;
|
|
17
|
+
}, "strict", z.ZodTypeAny, {
|
|
18
|
+
bytes: number;
|
|
19
|
+
committed: true;
|
|
20
|
+
sidecar_relpath: string;
|
|
21
|
+
sidecar_sha256: string;
|
|
22
|
+
}, {
|
|
23
|
+
bytes: number;
|
|
24
|
+
committed: true;
|
|
25
|
+
sidecar_relpath: string;
|
|
26
|
+
sidecar_sha256: string;
|
|
27
|
+
}>]>;
|
|
28
|
+
export type PlanReviewPublicationMarker = z.infer<typeof PlanReviewPublicationMarkerSchema>;
|
|
29
|
+
export declare const CouncilPlanReviewErrorSchema: z.ZodObject<{
|
|
30
|
+
schema_version: z.ZodLiteral<"council-plan-review-error-v1">;
|
|
31
|
+
run_id: z.ZodString;
|
|
32
|
+
execution_status: z.ZodEnum<["succeeded", "failed", "cancelled"]>;
|
|
33
|
+
stage: z.ZodEnum<["snapshot", "digest", "context_preflight", "execution_contract", "publication"]>;
|
|
34
|
+
error: z.ZodObject<{
|
|
35
|
+
reason: z.ZodEnum<["timeout", "nonzero_exit", "invalid_output", "schema_mismatch", "no_artifact", "cancelled", "internal_error"]>;
|
|
36
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, "strict", z.ZodTypeAny, {
|
|
38
|
+
reason: "cancelled" | "timeout" | "nonzero_exit" | "invalid_output" | "schema_mismatch" | "no_artifact" | "internal_error";
|
|
39
|
+
detail?: string | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
reason: "cancelled" | "timeout" | "nonzero_exit" | "invalid_output" | "schema_mismatch" | "no_artifact" | "internal_error";
|
|
42
|
+
detail?: string | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
}, "strict", z.ZodTypeAny, {
|
|
45
|
+
stage: "digest" | "snapshot" | "context_preflight" | "execution_contract" | "publication";
|
|
46
|
+
run_id: string;
|
|
47
|
+
schema_version: "council-plan-review-error-v1";
|
|
48
|
+
execution_status: "succeeded" | "failed" | "cancelled";
|
|
49
|
+
error: {
|
|
50
|
+
reason: "cancelled" | "timeout" | "nonzero_exit" | "invalid_output" | "schema_mismatch" | "no_artifact" | "internal_error";
|
|
51
|
+
detail?: string | undefined;
|
|
52
|
+
};
|
|
53
|
+
}, {
|
|
54
|
+
stage: "digest" | "snapshot" | "context_preflight" | "execution_contract" | "publication";
|
|
55
|
+
run_id: string;
|
|
56
|
+
schema_version: "council-plan-review-error-v1";
|
|
57
|
+
execution_status: "succeeded" | "failed" | "cancelled";
|
|
58
|
+
error: {
|
|
59
|
+
reason: "cancelled" | "timeout" | "nonzero_exit" | "invalid_output" | "schema_mismatch" | "no_artifact" | "internal_error";
|
|
60
|
+
detail?: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
}>;
|
|
63
|
+
export type CouncilPlanReviewError = z.infer<typeof CouncilPlanReviewErrorSchema>;
|
|
64
|
+
type TerminalExecutionStatus = CouncilPlanReviewError["execution_status"];
|
|
65
|
+
export declare function createPlanReviewPublicationError(runId: string, executionStatus: TerminalExecutionStatus, reason: PlanReviewErrorReason, detail: string): CouncilPlanReviewError;
|
|
66
|
+
/** Canonical transport/sidecar bytes. The envelope schema owns the 1 MiB cap. */
|
|
67
|
+
export declare function serializePlanReviewResult(value: CouncilPlanReviewResult): string;
|
|
68
|
+
/**
|
|
69
|
+
* Atomically publish bytes already produced by the validated terminal
|
|
70
|
+
* projector. Re-parse and canonicalize only as a fail-closed assertion: the
|
|
71
|
+
* exact supplied bytes are what reach disk.
|
|
72
|
+
*/
|
|
73
|
+
export declare function writeSerializedPlanReviewResultSidecar(runDir: string, serialized: string): Promise<Extract<PlanReviewPublicationMarker, {
|
|
74
|
+
committed: true;
|
|
75
|
+
}>>;
|
|
76
|
+
export interface PlanReviewPublicationInspection {
|
|
77
|
+
readonly result_available: boolean;
|
|
78
|
+
readonly result_bytes: number;
|
|
79
|
+
readonly result?: string | undefined;
|
|
80
|
+
readonly error?: CouncilPlanReviewError | undefined;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Validate already-admitted plan-review sidecar bytes without performing any
|
|
84
|
+
* filesystem access. Callers with a different trust root (the dashboard) must
|
|
85
|
+
* contain/read first, then reuse these producer-owned size/hash/schema checks.
|
|
86
|
+
*/
|
|
87
|
+
export declare function validatePlanReviewPublicationBytes(runId: string, executionStatus: TerminalExecutionStatus | undefined, publication: Extract<PlanReviewPublicationMarker, {
|
|
88
|
+
committed: true;
|
|
89
|
+
}>, body: Uint8Array): PlanReviewPublicationInspection;
|
|
90
|
+
/**
|
|
91
|
+
* Inspect the committed sidecar. Cheap mode opens/stats/contains the file but
|
|
92
|
+
* never reads its body; authoritative mode performs exactly one bounded read.
|
|
93
|
+
*/
|
|
94
|
+
export declare function inspectPlanReviewPublication(runDir: string, runId: string, executionStatus: TerminalExecutionStatus | undefined, publication: PlanReviewPublicationMarker | undefined, includeResult: boolean): Promise<PlanReviewPublicationInspection>;
|
|
95
|
+
export {};
|