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,182 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mkdir, rename, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { readContainedRelativeFile } from "../contained-file.js";
|
|
6
|
+
import { CouncilPlanReviewResultSchema, MAX_RESULT_ENVELOPE_BYTES, PlanReviewErrorReasonSchema, } from "./contract.js";
|
|
7
|
+
const SHA256_PATTERN = /^[0-9a-f]{64}$/;
|
|
8
|
+
const RUN_ID_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
|
|
9
|
+
export const PLAN_REVIEW_RESULT_RELPATH = "results/council-plan-review-result.json";
|
|
10
|
+
/** Atomic state marker written only by the later Track-C publication path. */
|
|
11
|
+
export const PlanReviewPublicationMarkerSchema = z
|
|
12
|
+
.discriminatedUnion("committed", [
|
|
13
|
+
z.object({ committed: z.literal(false) }).strict(),
|
|
14
|
+
z
|
|
15
|
+
.object({
|
|
16
|
+
committed: z.literal(true),
|
|
17
|
+
sidecar_relpath: z.string().min(1),
|
|
18
|
+
sidecar_sha256: z.string().regex(SHA256_PATTERN),
|
|
19
|
+
bytes: z.number().int().min(0).max(MAX_RESULT_ENVELOPE_BYTES).finite(),
|
|
20
|
+
})
|
|
21
|
+
.strict(),
|
|
22
|
+
]);
|
|
23
|
+
export const CouncilPlanReviewErrorSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
schema_version: z.literal("council-plan-review-error-v1"),
|
|
26
|
+
run_id: z.string().regex(RUN_ID_PATTERN),
|
|
27
|
+
execution_status: z.enum(["succeeded", "failed", "cancelled"]),
|
|
28
|
+
stage: z.enum([
|
|
29
|
+
"snapshot",
|
|
30
|
+
"digest",
|
|
31
|
+
"context_preflight",
|
|
32
|
+
"execution_contract",
|
|
33
|
+
"publication",
|
|
34
|
+
]),
|
|
35
|
+
error: z
|
|
36
|
+
.object({
|
|
37
|
+
reason: PlanReviewErrorReasonSchema,
|
|
38
|
+
detail: z.string().max(2_048).optional(),
|
|
39
|
+
})
|
|
40
|
+
.strict(),
|
|
41
|
+
})
|
|
42
|
+
.strict();
|
|
43
|
+
function boundedDetail(detail) {
|
|
44
|
+
return detail.slice(0, 2_048);
|
|
45
|
+
}
|
|
46
|
+
export function createPlanReviewPublicationError(runId, executionStatus, reason, detail) {
|
|
47
|
+
return CouncilPlanReviewErrorSchema.parse({
|
|
48
|
+
schema_version: "council-plan-review-error-v1",
|
|
49
|
+
run_id: runId,
|
|
50
|
+
execution_status: executionStatus,
|
|
51
|
+
stage: "publication",
|
|
52
|
+
error: { reason, detail: boundedDetail(detail) },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/** Canonical transport/sidecar bytes. The envelope schema owns the 1 MiB cap. */
|
|
56
|
+
export function serializePlanReviewResult(value) {
|
|
57
|
+
const validated = CouncilPlanReviewResultSchema.parse(value);
|
|
58
|
+
const serialized = JSON.stringify(validated);
|
|
59
|
+
if (Buffer.byteLength(serialized, "utf-8") > MAX_RESULT_ENVELOPE_BYTES) {
|
|
60
|
+
throw new Error(`Serialized result envelope exceeds ${String(MAX_RESULT_ENVELOPE_BYTES)} bytes`);
|
|
61
|
+
}
|
|
62
|
+
return serialized;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Atomically publish bytes already produced by the validated terminal
|
|
66
|
+
* projector. Re-parse and canonicalize only as a fail-closed assertion: the
|
|
67
|
+
* exact supplied bytes are what reach disk.
|
|
68
|
+
*/
|
|
69
|
+
export async function writeSerializedPlanReviewResultSidecar(runDir, serialized) {
|
|
70
|
+
let decoded;
|
|
71
|
+
try {
|
|
72
|
+
decoded = JSON.parse(serialized);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
throw new Error(`Serialized result envelope is not valid JSON: ${err instanceof Error ? err.message : String(err)}`);
|
|
76
|
+
}
|
|
77
|
+
const canonical = serializePlanReviewResult(CouncilPlanReviewResultSchema.parse(decoded));
|
|
78
|
+
if (canonical !== serialized) {
|
|
79
|
+
throw new Error("Serialized result envelope does not match canonical validated bytes");
|
|
80
|
+
}
|
|
81
|
+
const bytes = Buffer.byteLength(serialized, "utf-8");
|
|
82
|
+
const absolutePath = join(runDir, PLAN_REVIEW_RESULT_RELPATH);
|
|
83
|
+
const tmpPath = `${absolutePath}.tmp`;
|
|
84
|
+
await mkdir(dirname(absolutePath), { recursive: true });
|
|
85
|
+
await writeFile(tmpPath, serialized, "utf-8");
|
|
86
|
+
await rename(tmpPath, absolutePath);
|
|
87
|
+
return PlanReviewPublicationMarkerSchema.parse({
|
|
88
|
+
committed: true,
|
|
89
|
+
sidecar_relpath: PLAN_REVIEW_RESULT_RELPATH,
|
|
90
|
+
sidecar_sha256: createHash("sha256").update(serialized, "utf-8").digest("hex"),
|
|
91
|
+
bytes,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Validate already-admitted plan-review sidecar bytes without performing any
|
|
96
|
+
* filesystem access. Callers with a different trust root (the dashboard) must
|
|
97
|
+
* contain/read first, then reuse these producer-owned size/hash/schema checks.
|
|
98
|
+
*/
|
|
99
|
+
export function validatePlanReviewPublicationBytes(runId, executionStatus, publication, body) {
|
|
100
|
+
const bytes = publication.bytes;
|
|
101
|
+
const failure = (reason, detail) => ({
|
|
102
|
+
result_available: false,
|
|
103
|
+
result_bytes: bytes,
|
|
104
|
+
...(executionStatus === undefined
|
|
105
|
+
? {}
|
|
106
|
+
: {
|
|
107
|
+
error: createPlanReviewPublicationError(runId, executionStatus, reason, detail),
|
|
108
|
+
}),
|
|
109
|
+
});
|
|
110
|
+
if (body.byteLength !== bytes) {
|
|
111
|
+
return failure("schema_mismatch", "Plan-review result sidecar failed its committed size check.");
|
|
112
|
+
}
|
|
113
|
+
const actualHash = createHash("sha256").update(body).digest("hex");
|
|
114
|
+
if (actualHash !== publication.sidecar_sha256) {
|
|
115
|
+
return failure("schema_mismatch", "Plan-review result sidecar failed its SHA-256 check.");
|
|
116
|
+
}
|
|
117
|
+
const text = Buffer.from(body).toString("utf-8");
|
|
118
|
+
let decoded;
|
|
119
|
+
try {
|
|
120
|
+
decoded = JSON.parse(text);
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
return failure("invalid_output", `Plan-review result sidecar is not valid JSON: ${err instanceof Error ? err.message : String(err)}`);
|
|
124
|
+
}
|
|
125
|
+
const parsed = CouncilPlanReviewResultSchema.safeParse(decoded);
|
|
126
|
+
if (!parsed.success) {
|
|
127
|
+
return failure("schema_mismatch", `Plan-review result sidecar failed schema validation: ${parsed.error.issues
|
|
128
|
+
.map((issue) => `${issue.path.join(".")}: ${issue.message}`)
|
|
129
|
+
.join("; ")}`);
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
result_available: true,
|
|
133
|
+
result_bytes: bytes,
|
|
134
|
+
result: text,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Inspect the committed sidecar. Cheap mode opens/stats/contains the file but
|
|
139
|
+
* never reads its body; authoritative mode performs exactly one bounded read.
|
|
140
|
+
*/
|
|
141
|
+
export async function inspectPlanReviewPublication(runDir, runId, executionStatus, publication, includeResult) {
|
|
142
|
+
const bytes = publication?.committed === true ? publication.bytes : 0;
|
|
143
|
+
if (publication === undefined) {
|
|
144
|
+
return { result_available: false, result_bytes: 0 };
|
|
145
|
+
}
|
|
146
|
+
if (!publication.committed) {
|
|
147
|
+
return {
|
|
148
|
+
result_available: false,
|
|
149
|
+
result_bytes: 0,
|
|
150
|
+
...(executionStatus === undefined
|
|
151
|
+
? {}
|
|
152
|
+
: {
|
|
153
|
+
error: createPlanReviewPublicationError(runId, executionStatus, "no_artifact", "Plan-review result publication was not committed."),
|
|
154
|
+
}),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
try {
|
|
158
|
+
const read = await readContainedRelativeFile(runDir, publication.sidecar_relpath, {
|
|
159
|
+
...(includeResult ? { wantBytes: true } : {}),
|
|
160
|
+
requireRegular: true,
|
|
161
|
+
maxBytes: MAX_RESULT_ENVELOPE_BYTES,
|
|
162
|
+
containerLabel: "run directory",
|
|
163
|
+
pathLabel: "sidecar_relpath",
|
|
164
|
+
});
|
|
165
|
+
if (!includeResult) {
|
|
166
|
+
return { result_available: true, result_bytes: bytes };
|
|
167
|
+
}
|
|
168
|
+
return validatePlanReviewPublicationBytes(runId, executionStatus, publication, read.bytes);
|
|
169
|
+
}
|
|
170
|
+
catch (err) {
|
|
171
|
+
return {
|
|
172
|
+
result_available: false,
|
|
173
|
+
result_bytes: bytes,
|
|
174
|
+
...(executionStatus === undefined
|
|
175
|
+
? {}
|
|
176
|
+
: {
|
|
177
|
+
error: createPlanReviewPublicationError(runId, executionStatus, "no_artifact", `Plan-review result sidecar is missing, unreadable, or uncontained: ${err instanceof Error ? err.message : String(err)}`),
|
|
178
|
+
}),
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=publication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publication.js","sourceRoot":"","sources":["../../src/plan-review/publication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,2BAA2B,GAE5B,MAAM,eAAe,CAAC;AAGvB,MAAM,cAAc,GAAG,gBAAgB,CAAC;AACxC,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAC/C,MAAM,CAAC,MAAM,0BAA0B,GACrC,yCAAyC,CAAC;AAE5C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iCAAiC,GAA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,IAAI,CAAC,KAAM,CACZ,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,gBAAgB,EAAE,KAAK;YACvB,YAAY,EAAE,KAAK;YACnB,GAAG,CAAC,eAAe,KAAK,SAAS;gBAC/B,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACE,KAAK,EAAE,gCAAgC,CACrC,KAAK,EACL,eAAe,EACf,aAAa,EACb,sEACE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CACjD,EAAE,CACH;iBACF,CAAC;SACP,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic plan-review ranking reducer (B-5).
|
|
3
|
+
*
|
|
4
|
+
* Runs in place of an LLM call for the `ranking_analysis` stage. It consumes the
|
|
5
|
+
* frozen `cross_review` output contract (A-3): one advisory call per roster
|
|
6
|
+
* seat, opaque `cross_000…` call IDs, peers anonymized to opaque ordinals.
|
|
7
|
+
*
|
|
8
|
+
* Why this is not `council_ranking_v1`. The generic council reducer is retained
|
|
9
|
+
* unchanged for the five existing councils, but it is not compatible here:
|
|
10
|
+
*
|
|
11
|
+
* - It reads scores only from the council collection keys
|
|
12
|
+
* (`member_evaluations`, `per_review_feedback`, …) on a 0-100 integer scale.
|
|
13
|
+
* The plan-review domain quantity is the `review-receipt-v1` `score`: a finite
|
|
14
|
+
* 0-10 number. Reshaping the plan cross-review to `overall_score_100` would
|
|
15
|
+
* contort the domain to fit the reducer.
|
|
16
|
+
* - Its `quorum.total_reviewers` is `artifacts.length` — it conflates "artifacts
|
|
17
|
+
* present" with "reviewers", and its output schema has no way to record a
|
|
18
|
+
* degenerate no-op cross-review, which the FIXED-cardinality A-3 composition
|
|
19
|
+
* makes an expected, first-class outcome rather than an anomaly.
|
|
20
|
+
*
|
|
21
|
+
* Determinism and fail-closed rules:
|
|
22
|
+
*
|
|
23
|
+
* - An artifact that does not parse as a plan-review cross-review is SKIPPED and
|
|
24
|
+
* counted in `participation.cross_reviews_unreadable`. It is never repaired,
|
|
25
|
+
* guessed at, or fabricated.
|
|
26
|
+
* - Zero artifacts is a valid input: it yields empty rankings and zeroed
|
|
27
|
+
* participation, not an error.
|
|
28
|
+
* - The output is advisory. It carries no verdict, score override, or receipt,
|
|
29
|
+
* so it cannot upgrade a candidate (D2).
|
|
30
|
+
* - All ordering is by explicit numeric comparison then code-unit comparison of
|
|
31
|
+
* `candidate_id`; no locale-dependent collation.
|
|
32
|
+
*/
|
|
33
|
+
import type { ArtifactRecord } from "../artifacts.js";
|
|
34
|
+
export declare function planReviewRankingReducer(artifacts: readonly ArtifactRecord[]): string;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic plan-review ranking reducer (B-5).
|
|
3
|
+
*
|
|
4
|
+
* Runs in place of an LLM call for the `ranking_analysis` stage. It consumes the
|
|
5
|
+
* frozen `cross_review` output contract (A-3): one advisory call per roster
|
|
6
|
+
* seat, opaque `cross_000…` call IDs, peers anonymized to opaque ordinals.
|
|
7
|
+
*
|
|
8
|
+
* Why this is not `council_ranking_v1`. The generic council reducer is retained
|
|
9
|
+
* unchanged for the five existing councils, but it is not compatible here:
|
|
10
|
+
*
|
|
11
|
+
* - It reads scores only from the council collection keys
|
|
12
|
+
* (`member_evaluations`, `per_review_feedback`, …) on a 0-100 integer scale.
|
|
13
|
+
* The plan-review domain quantity is the `review-receipt-v1` `score`: a finite
|
|
14
|
+
* 0-10 number. Reshaping the plan cross-review to `overall_score_100` would
|
|
15
|
+
* contort the domain to fit the reducer.
|
|
16
|
+
* - Its `quorum.total_reviewers` is `artifacts.length` — it conflates "artifacts
|
|
17
|
+
* present" with "reviewers", and its output schema has no way to record a
|
|
18
|
+
* degenerate no-op cross-review, which the FIXED-cardinality A-3 composition
|
|
19
|
+
* makes an expected, first-class outcome rather than an anomaly.
|
|
20
|
+
*
|
|
21
|
+
* Determinism and fail-closed rules:
|
|
22
|
+
*
|
|
23
|
+
* - An artifact that does not parse as a plan-review cross-review is SKIPPED and
|
|
24
|
+
* counted in `participation.cross_reviews_unreadable`. It is never repaired,
|
|
25
|
+
* guessed at, or fabricated.
|
|
26
|
+
* - Zero artifacts is a valid input: it yields empty rankings and zeroed
|
|
27
|
+
* participation, not an error.
|
|
28
|
+
* - The output is advisory. It carries no verdict, score override, or receipt,
|
|
29
|
+
* so it cannot upgrade a candidate (D2).
|
|
30
|
+
* - All ordering is by explicit numeric comparison then code-unit comparison of
|
|
31
|
+
* `candidate_id`; no locale-dependent collation.
|
|
32
|
+
*/
|
|
33
|
+
import { PlanReviewCrossReviewOutputSchema, PlanReviewRankingReducerOutputSchema, } from "../validators/plan-review.js";
|
|
34
|
+
/** Locale-independent, code-unit ordering. `localeCompare` is not deterministic across ICU data. */
|
|
35
|
+
function compareCandidateIds(a, b) {
|
|
36
|
+
if (a < b)
|
|
37
|
+
return -1;
|
|
38
|
+
if (a > b)
|
|
39
|
+
return 1;
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
/** Keep the first entry per candidate; a model may rank one candidate twice at different ranks. */
|
|
43
|
+
function dedupeByCandidate(entries) {
|
|
44
|
+
const seen = new Set();
|
|
45
|
+
const deduped = [];
|
|
46
|
+
for (const entry of entries) {
|
|
47
|
+
if (seen.has(entry.candidate_id))
|
|
48
|
+
continue;
|
|
49
|
+
seen.add(entry.candidate_id);
|
|
50
|
+
deduped.push(entry);
|
|
51
|
+
}
|
|
52
|
+
return deduped;
|
|
53
|
+
}
|
|
54
|
+
export function planReviewRankingReducer(artifacts) {
|
|
55
|
+
const rankingsByArtifact = [];
|
|
56
|
+
const scoresByCandidate = new Map();
|
|
57
|
+
const agreementByCandidate = new Map();
|
|
58
|
+
let present = 0;
|
|
59
|
+
let unreadable = 0;
|
|
60
|
+
let degenerate = 0;
|
|
61
|
+
for (const artifact of artifacts) {
|
|
62
|
+
const parsed = PlanReviewCrossReviewOutputSchema.safeParse(artifact.parsed);
|
|
63
|
+
if (!parsed.success) {
|
|
64
|
+
unreadable += 1;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
present += 1;
|
|
68
|
+
const body = parsed.data;
|
|
69
|
+
if (body.peer_assessments.length === 0 && body.ranking.length === 0) {
|
|
70
|
+
degenerate += 1;
|
|
71
|
+
}
|
|
72
|
+
const ranking = dedupeByCandidate(body.ranking);
|
|
73
|
+
if (ranking.length > 0) {
|
|
74
|
+
rankingsByArtifact.push(ranking);
|
|
75
|
+
}
|
|
76
|
+
for (const assessment of body.peer_assessments) {
|
|
77
|
+
const scores = scoresByCandidate.get(assessment.candidate_id) ?? [];
|
|
78
|
+
scores.push(assessment.assessment_score);
|
|
79
|
+
scoresByCandidate.set(assessment.candidate_id, scores);
|
|
80
|
+
const counts = agreementByCandidate.get(assessment.candidate_id) ?? {
|
|
81
|
+
agree: 0,
|
|
82
|
+
partial: 0,
|
|
83
|
+
disagree: 0,
|
|
84
|
+
};
|
|
85
|
+
counts[assessment.agreement_level] += 1;
|
|
86
|
+
agreementByCandidate.set(assessment.candidate_id, counts);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const candidateSet = new Set();
|
|
90
|
+
for (const ranking of rankingsByArtifact) {
|
|
91
|
+
for (const entry of ranking)
|
|
92
|
+
candidateSet.add(entry.candidate_id);
|
|
93
|
+
}
|
|
94
|
+
const candidateCount = candidateSet.size;
|
|
95
|
+
const bordaScores = new Map();
|
|
96
|
+
for (const candidate of candidateSet)
|
|
97
|
+
bordaScores.set(candidate, 0);
|
|
98
|
+
for (const ranking of rankingsByArtifact) {
|
|
99
|
+
for (const entry of ranking) {
|
|
100
|
+
// Rank 1 scores `candidateCount` points, rank N scores 1. A rank beyond
|
|
101
|
+
// the candidate count scores 0 rather than going negative.
|
|
102
|
+
const points = Math.max(candidateCount - entry.rank + 1, 0);
|
|
103
|
+
bordaScores.set(entry.candidate_id, (bordaScores.get(entry.candidate_id) ?? 0) + points);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const consensusRanking = [...bordaScores.entries()]
|
|
107
|
+
.sort((a, b) => b[1] !== a[1] ? b[1] - a[1] : compareCandidateIds(a[0], b[0]))
|
|
108
|
+
.map(([candidate_id, borda_score], index) => ({
|
|
109
|
+
candidate_id,
|
|
110
|
+
borda_score,
|
|
111
|
+
rank: index + 1,
|
|
112
|
+
}));
|
|
113
|
+
const scoreSummary = [...scoresByCandidate.entries()]
|
|
114
|
+
.sort((a, b) => compareCandidateIds(a[0], b[0]))
|
|
115
|
+
.map(([candidate_id, scores]) => ({
|
|
116
|
+
candidate_id,
|
|
117
|
+
mean_score: scores.reduce((sum, score) => sum + score, 0) / scores.length,
|
|
118
|
+
score_count: scores.length,
|
|
119
|
+
spread: Math.max(...scores) - Math.min(...scores),
|
|
120
|
+
}));
|
|
121
|
+
const agreementSummary = [...agreementByCandidate.entries()]
|
|
122
|
+
.sort((a, b) => compareCandidateIds(a[0], b[0]))
|
|
123
|
+
.map(([candidate_id, counts]) => ({ candidate_id, ...counts }));
|
|
124
|
+
const output = {
|
|
125
|
+
schema_version: "plan-review-ranking-v1",
|
|
126
|
+
consensus_ranking: consensusRanking,
|
|
127
|
+
score_summary: scoreSummary,
|
|
128
|
+
agreement_summary: agreementSummary,
|
|
129
|
+
participation: {
|
|
130
|
+
cross_reviews_present: present,
|
|
131
|
+
cross_reviews_with_rankings: rankingsByArtifact.length,
|
|
132
|
+
degenerate_no_op_cross_reviews: degenerate,
|
|
133
|
+
cross_reviews_unreadable: unreadable,
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
// Fail closed rather than emit an artifact the registered validator would reject.
|
|
137
|
+
return JSON.stringify(PlanReviewRankingReducerOutputSchema.parse(output), null, 2);
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=ranking-reducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE,UAAU;YAC1C,wBAAwB,EAAE,UAAU;SACrC;KACF,CAAC;IAEF,kFAAkF;IAClF,OAAO,IAAI,CAAC,SAAS,CAAC,oCAAoC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A-5 — resume fidelity.
|
|
3
|
+
*
|
|
4
|
+
* The persisted plan-review contract + immutable snapshot are the SOLE resume
|
|
5
|
+
* inputs. This module never reads `plan_file` and never sees caller input: it
|
|
6
|
+
* decodes, hash-verifies, and RECOMPUTES the digest of the persisted contract,
|
|
7
|
+
* re-verifies the persisted snapshot, and reconstructs the per-call bindings —
|
|
8
|
+
* all BEFORE the engine exists.
|
|
9
|
+
*
|
|
10
|
+
* Every failure here is a post-state pre-seat failure with
|
|
11
|
+
* `stage:"execution_contract"` (or `snapshot`/`digest` for the snapshot leg) —
|
|
12
|
+
* a `failed` RunState with no result sidecar, NOT the pre-mutex `-32602` that
|
|
13
|
+
* a type-(a) admission mismatch produces.
|
|
14
|
+
*/
|
|
15
|
+
import { type CouncilPlanReviewExecutionContract } from "./execution-contract.js";
|
|
16
|
+
import { type PlanReviewCallBinding, type PlanReviewRunState } from "./run-state.js";
|
|
17
|
+
import { type CanonicalPlanSnapshot } from "./snapshot.js";
|
|
18
|
+
export interface RestoredPlanReviewRun {
|
|
19
|
+
readonly state: PlanReviewRunState;
|
|
20
|
+
readonly contract: CouncilPlanReviewExecutionContract;
|
|
21
|
+
readonly execution_contract_digest: string;
|
|
22
|
+
readonly call_bindings: readonly PlanReviewCallBinding[];
|
|
23
|
+
readonly snapshot_absolute_path: string;
|
|
24
|
+
/**
|
|
25
|
+
* The re-verified canonical snapshot, from the SAME read that verified it.
|
|
26
|
+
* Resume needs the text to check what a persisted prepared retry will
|
|
27
|
+
* actually dispatch (D9); re-reading it later would reopen the TOCTOU that
|
|
28
|
+
* read-and-verify-once exists to close.
|
|
29
|
+
*/
|
|
30
|
+
readonly snapshot: CanonicalPlanSnapshot;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Restore + verify a plan-review run from persisted artifacts alone.
|
|
34
|
+
*
|
|
35
|
+
* @param chairmanCallId the chairman stage's call id from the persisted,
|
|
36
|
+
* hash-verified workflow snapshot — the contract does not carry it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function restorePlanReviewRun(runDir: string, persisted: unknown, chairmanCallId: string): Promise<RestoredPlanReviewRun>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A-5 — resume fidelity.
|
|
3
|
+
*
|
|
4
|
+
* The persisted plan-review contract + immutable snapshot are the SOLE resume
|
|
5
|
+
* inputs. This module never reads `plan_file` and never sees caller input: it
|
|
6
|
+
* decodes, hash-verifies, and RECOMPUTES the digest of the persisted contract,
|
|
7
|
+
* re-verifies the persisted snapshot, and reconstructs the per-call bindings —
|
|
8
|
+
* all BEFORE the engine exists.
|
|
9
|
+
*
|
|
10
|
+
* Every failure here is a post-state pre-seat failure with
|
|
11
|
+
* `stage:"execution_contract"` (or `snapshot`/`digest` for the snapshot leg) —
|
|
12
|
+
* a `failed` RunState with no result sidecar, NOT the pre-mutex `-32602` that
|
|
13
|
+
* a type-(a) admission mismatch produces.
|
|
14
|
+
*/
|
|
15
|
+
import { createHash } from "node:crypto";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
import { z } from "zod";
|
|
18
|
+
import { readContainedRelativeFile } from "../contained-file.js";
|
|
19
|
+
import { CouncilPlanReviewExecutionContractSchema, computeCouncilPlanReviewExecutionContractDigest, } from "./execution-contract.js";
|
|
20
|
+
import { PlanReviewCallBindingSchema, parsePlanReviewRunState, reconstructPlanReviewCallBindings, } from "./run-state.js";
|
|
21
|
+
import { MAX_EXECUTION_CONTRACT_BYTES, verifyPersistedPlanSnapshot, } from "./snapshot.js";
|
|
22
|
+
import { PlanReviewStageError } from "./stage-error.js";
|
|
23
|
+
function contractFailure(message, reason) {
|
|
24
|
+
throw new PlanReviewStageError("execution_contract", message, reason);
|
|
25
|
+
}
|
|
26
|
+
/** Key-order-independent serialization for call-binding equality. */
|
|
27
|
+
function canonicalBindings(bindings) {
|
|
28
|
+
return JSON.stringify(z.array(PlanReviewCallBindingSchema).parse([...bindings]));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Restore + verify a plan-review run from persisted artifacts alone.
|
|
32
|
+
*
|
|
33
|
+
* @param chairmanCallId the chairman stage's call id from the persisted,
|
|
34
|
+
* hash-verified workflow snapshot — the contract does not carry it.
|
|
35
|
+
*/
|
|
36
|
+
export async function restorePlanReviewRun(runDir, persisted, chairmanCallId) {
|
|
37
|
+
// 1. The subtree itself must be strictly valid — a corrupt subtree cannot be
|
|
38
|
+
// trusted to name the artifacts we are about to verify against.
|
|
39
|
+
let state;
|
|
40
|
+
try {
|
|
41
|
+
state = parsePlanReviewRunState(persisted);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
contractFailure(`Persisted plan_review_state failed validation: ${err instanceof Error ? err.message : String(err)}`, "schema_mismatch");
|
|
45
|
+
}
|
|
46
|
+
// 2. Decode the persisted contract through the contained no-follow reader.
|
|
47
|
+
let bytes;
|
|
48
|
+
try {
|
|
49
|
+
const read = await readContainedRelativeFile(runDir, state.execution_contract_path, {
|
|
50
|
+
wantBytes: true,
|
|
51
|
+
requireRegular: true,
|
|
52
|
+
maxBytes: MAX_EXECUTION_CONTRACT_BYTES,
|
|
53
|
+
});
|
|
54
|
+
bytes = read.bytes;
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
contractFailure(`Persisted execution contract at ${state.execution_contract_path} is unreadable: ${err instanceof Error ? err.message : String(err)}`, "no_artifact");
|
|
58
|
+
}
|
|
59
|
+
// 3. Hash-verify the FILE BYTES before parsing them.
|
|
60
|
+
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
61
|
+
if (sha256 !== state.execution_contract_sha256) {
|
|
62
|
+
contractFailure(`Persisted execution contract at ${state.execution_contract_path} failed its hash check`, "schema_mismatch");
|
|
63
|
+
}
|
|
64
|
+
let decoded;
|
|
65
|
+
try {
|
|
66
|
+
decoded = JSON.parse(bytes.toString("utf-8"));
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
contractFailure(`Persisted execution contract is not valid JSON: ${err instanceof Error ? err.message : String(err)}`, "invalid_output");
|
|
70
|
+
}
|
|
71
|
+
const parsed = CouncilPlanReviewExecutionContractSchema.safeParse(decoded);
|
|
72
|
+
if (!parsed.success) {
|
|
73
|
+
contractFailure(`Persisted execution contract failed schema validation: ${parsed.error.issues
|
|
74
|
+
.map((issue) => `${issue.path.join(".")}: ${issue.message}`)
|
|
75
|
+
.join("; ")}`, "schema_mismatch");
|
|
76
|
+
}
|
|
77
|
+
// 4. RECOMPUTE the identity digest. A matching file hash only proves the file
|
|
78
|
+
// did not rot; recomputation proves the contract still normalizes to the
|
|
79
|
+
// identity this run was admitted under.
|
|
80
|
+
let recomputed;
|
|
81
|
+
try {
|
|
82
|
+
recomputed = computeCouncilPlanReviewExecutionContractDigest(parsed.data);
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
contractFailure(`Persisted execution contract could not be canonicalized: ${err instanceof Error ? err.message : String(err)}`, "invalid_output");
|
|
86
|
+
}
|
|
87
|
+
if (recomputed.digest !== state.execution_contract_digest) {
|
|
88
|
+
contractFailure(`Recomputed execution_contract_digest ${recomputed.digest} does not match the persisted ${state.execution_contract_digest}`, "schema_mismatch");
|
|
89
|
+
}
|
|
90
|
+
// 5. The contract must still agree with the persisted snapshot binding.
|
|
91
|
+
if (recomputed.contract.context_evidence_policy.snapshot_digest !== state.plan_digest) {
|
|
92
|
+
contractFailure("Persisted execution contract snapshot_digest does not match the persisted plan snapshot digest", "schema_mismatch");
|
|
93
|
+
}
|
|
94
|
+
// 6. Re-verify the immutable snapshot from run-owned storage (never plan_file).
|
|
95
|
+
const snapshot = await verifyPersistedPlanSnapshot(runDir, state.snapshot_path, state.snapshot_sha256, state.plan_digest);
|
|
96
|
+
// 7. Reconstruct the per-call bindings from the verified contract and require
|
|
97
|
+
// them to reproduce what was persisted — a resumed run that would dispatch
|
|
98
|
+
// a call to a different (or absent) provider fails closed here (D3).
|
|
99
|
+
let bindings;
|
|
100
|
+
try {
|
|
101
|
+
bindings = reconstructPlanReviewCallBindings(recomputed.contract, chairmanCallId);
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
contractFailure(`Per-call bindings could not be reconstructed: ${err instanceof Error ? err.message : String(err)}`, "schema_mismatch");
|
|
105
|
+
}
|
|
106
|
+
// Normalize BOTH sides through the same schema before comparing: a Zod parse
|
|
107
|
+
// emits keys in schema order, so a raw JSON.stringify of a reconstructed
|
|
108
|
+
// literal would differ from the persisted-and-parsed value purely by key
|
|
109
|
+
// order — a false mismatch that would brick every resume.
|
|
110
|
+
if (canonicalBindings(bindings) !== canonicalBindings(state.call_bindings)) {
|
|
111
|
+
contractFailure("Reconstructed per-call bindings do not match the persisted bindings", "schema_mismatch");
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
state,
|
|
115
|
+
contract: recomputed.contract,
|
|
116
|
+
execution_contract_digest: recomputed.digest,
|
|
117
|
+
call_bindings: bindings,
|
|
118
|
+
snapshot_absolute_path: join(runDir, state.snapshot_path),
|
|
119
|
+
snapshot,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=resume.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume.js","sourceRoot":"","sources":["../../src/plan-review/resume.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,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AAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CACjD,EAAE,EACF,iBAAiB,CAClB,CAAC;IACJ,CAAC;IACD,6EAA6E;IAC7E,yEAAyE;IACzE,yEAAyE;IACzE,0DAA0D;IAC1D,IAAI,iBAAiB,CAAC,QAAQ,CAAC,KAAK,iBAAiB,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;QAC3E,eAAe,CACb,qEAAqE,EACrE,iBAAiB,CAClB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,KAAK;QACL,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,yBAAyB,EAAE,UAAU,CAAC,MAAM;QAC5C,aAAa,EAAE,QAAQ;QACvB,sBAAsB,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC;QACzD,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Canonical machine-readable identity of the rubric baked into reviewer.txt. */
|
|
2
|
+
export declare const PACKAGED_PLAN_REVIEW_RUBRIC: {
|
|
3
|
+
readonly schema_version: "plan-review-rubric-v1";
|
|
4
|
+
readonly dimensions: readonly ["scope_and_non_goals", "evidence_anchors", "cross_repo_ownership", "dependency_graph", "runnable_verification", "rollback_where_relevant", "risks", "undisguised_blockers"];
|
|
5
|
+
readonly rules: readonly ["unverified_is_not_approved", "deliberation_is_advisory", "chairman_is_not_approval"];
|
|
6
|
+
};
|
|
7
|
+
export declare const PACKAGED_PLAN_REVIEW_RUBRIC_DIGEST: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
/** Canonical machine-readable identity of the rubric baked into reviewer.txt. */
|
|
3
|
+
export const PACKAGED_PLAN_REVIEW_RUBRIC = {
|
|
4
|
+
schema_version: "plan-review-rubric-v1",
|
|
5
|
+
dimensions: [
|
|
6
|
+
"scope_and_non_goals",
|
|
7
|
+
"evidence_anchors",
|
|
8
|
+
"cross_repo_ownership",
|
|
9
|
+
"dependency_graph",
|
|
10
|
+
"runnable_verification",
|
|
11
|
+
"rollback_where_relevant",
|
|
12
|
+
"risks",
|
|
13
|
+
"undisguised_blockers",
|
|
14
|
+
],
|
|
15
|
+
rules: [
|
|
16
|
+
"unverified_is_not_approved",
|
|
17
|
+
"deliberation_is_advisory",
|
|
18
|
+
"chairman_is_not_approval",
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
export const PACKAGED_PLAN_REVIEW_RUBRIC_DIGEST = createHash("sha256")
|
|
22
|
+
.update(JSON.stringify(PACKAGED_PLAN_REVIEW_RUBRIC), "utf-8")
|
|
23
|
+
.digest("hex");
|
|
24
|
+
//# sourceMappingURL=rubric.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rubric.js","sourceRoot":"","sources":["../../src/plan-review/rubric.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,iFAAiF;AACjF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,cAAc,EAAE,uBAAuB;IACvC,UAAU,EAAE;QACV,qBAAqB;QACrB,kBAAkB;QAClB,sBAAsB;QACtB,kBAAkB;QAClB,uBAAuB;QACvB,yBAAyB;QACzB,OAAO;QACP,sBAAsB;KACvB;IACD,KAAK,EAAE;QACL,4BAA4B;QAC5B,0BAA0B;QAC1B,0BAA0B;KAC3B;CACO,CAAC;AAEX,MAAM,CAAC,MAAM,kCAAkC,GAAG,UAAU,CAAC,QAAQ,CAAC;KACnE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,2BAA2B,CAAC,EAAE,OAAO,CAAC;KAC5D,MAAM,CAAC,KAAK,CAAC,CAAC"}
|