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,243 @@
|
|
|
1
|
+
import { WorkflowError } from "../errors.js";
|
|
2
|
+
import { CouncilPlanReviewExecutionContractSchema, } from "./execution-contract.js";
|
|
3
|
+
const STAGE_IDS = [
|
|
4
|
+
"reviewers",
|
|
5
|
+
"cross_review",
|
|
6
|
+
"ranking_analysis",
|
|
7
|
+
"chairman",
|
|
8
|
+
];
|
|
9
|
+
/**
|
|
10
|
+
* Delimits the inlined snapshot. Long and fixed on purpose: the plan is
|
|
11
|
+
* untrusted text that may itself contain markdown fences, and an actor must be
|
|
12
|
+
* able to tell where the bound revision ends and its instructions resume.
|
|
13
|
+
*/
|
|
14
|
+
export const PLAN_SNAPSHOT_BEGIN = "-----BEGIN PLAN SNAPSHOT-----";
|
|
15
|
+
export const PLAN_SNAPSHOT_END = "-----END PLAN SNAPSHOT-----";
|
|
16
|
+
/**
|
|
17
|
+
* The exact snapshot block appended to every actor's prompt.
|
|
18
|
+
*
|
|
19
|
+
* Exported because it is the only thing a PERSISTED prepared input can be
|
|
20
|
+
* checked against on resume (D9). A resumed retry replays its persisted prompt
|
|
21
|
+
* verbatim — the expander never runs again for it — so the resume seam must
|
|
22
|
+
* re-derive these exact bytes and require them to be present. Two renderings
|
|
23
|
+
* would let the check pass against text no actor was ever sent.
|
|
24
|
+
*
|
|
25
|
+
* The result is appended by the ENGINE, after `renderCallPrompt` — never
|
|
26
|
+
* concatenated into a call's `prompt` template. See
|
|
27
|
+
* `NormalizedCall.plan_review_snapshot_text`: the plan is untrusted text that
|
|
28
|
+
* may contain `{{...}}`, and the renderer would rewrite or reject it.
|
|
29
|
+
*/
|
|
30
|
+
export function renderPlanSnapshotBlock(planSnapshotText) {
|
|
31
|
+
return `\n\n## Plan snapshot (the bound revision under review)\n${PLAN_SNAPSHOT_BEGIN}\n${planSnapshotText}\n${PLAN_SNAPSHOT_END}`;
|
|
32
|
+
}
|
|
33
|
+
const NON_SEMANTIC_REVIEW_FIELDS = new Set([
|
|
34
|
+
"schema_version",
|
|
35
|
+
"workspace_schema",
|
|
36
|
+
"digest_profile",
|
|
37
|
+
"repository_id",
|
|
38
|
+
"review_id",
|
|
39
|
+
"iteration",
|
|
40
|
+
"plan_id",
|
|
41
|
+
"revision",
|
|
42
|
+
"digest",
|
|
43
|
+
"seat_id",
|
|
44
|
+
"reviewer",
|
|
45
|
+
"cli_name",
|
|
46
|
+
"internal_call_id",
|
|
47
|
+
"cross_review_call_id",
|
|
48
|
+
]);
|
|
49
|
+
/** Remove plan/seat/provider bindings before a peer artifact is cross-reviewed. */
|
|
50
|
+
export function projectPlanReviewSemanticBody(value) {
|
|
51
|
+
if (value == null || typeof value !== "object")
|
|
52
|
+
return value;
|
|
53
|
+
if (Array.isArray(value)) {
|
|
54
|
+
return value.map((item) => projectPlanReviewSemanticBody(item));
|
|
55
|
+
}
|
|
56
|
+
const projected = {};
|
|
57
|
+
for (const [key, child] of Object.entries(value)) {
|
|
58
|
+
if (!NON_SEMANTIC_REVIEW_FIELDS.has(key)) {
|
|
59
|
+
projected[key] = projectPlanReviewSemanticBody(child);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return projected;
|
|
63
|
+
}
|
|
64
|
+
function requireSeedStage(definition, id) {
|
|
65
|
+
const stage = definition.stages.find((candidate) => candidate.id === id);
|
|
66
|
+
if (stage === undefined) {
|
|
67
|
+
throw new WorkflowError(`Plan-review expander: missing stage "${id}"`);
|
|
68
|
+
}
|
|
69
|
+
if (stage.calls.length !== 1) {
|
|
70
|
+
throw new WorkflowError(`Plan-review expander: stage "${id}" must contain exactly one seed call`);
|
|
71
|
+
}
|
|
72
|
+
return stage;
|
|
73
|
+
}
|
|
74
|
+
function copyStage(stage, calls, policy) {
|
|
75
|
+
return {
|
|
76
|
+
id: stage.id,
|
|
77
|
+
...(stage.description !== undefined ? { description: stage.description } : {}),
|
|
78
|
+
parallel: policy?.parallel ?? stage.parallel,
|
|
79
|
+
retry: stage.retry,
|
|
80
|
+
on_failure: policy?.on_failure ?? stage.on_failure,
|
|
81
|
+
calls,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A RUNTIME shape check on the snapshot — deliberately not "belt and braces".
|
|
86
|
+
*
|
|
87
|
+
* Neither package typechecks its tests (both tsconfigs are `include: ["src"]`,
|
|
88
|
+
* and vitest transpiles without checking), so the parameter's type alone is
|
|
89
|
+
* IDE-only theater: a test could hand this function a pathname forever and the
|
|
90
|
+
* gate would stay green. That is not hypothetical — four test sites did exactly
|
|
91
|
+
* that. The type documents the contract for a reader; this guard is what makes
|
|
92
|
+
* a violation FAIL under `npm test`.
|
|
93
|
+
*/
|
|
94
|
+
function assertVerifiedSnapshot(snapshot) {
|
|
95
|
+
if (snapshot === undefined)
|
|
96
|
+
return;
|
|
97
|
+
if (typeof snapshot !== "object" || snapshot === null ||
|
|
98
|
+
typeof snapshot.text !== "string" || snapshot.text.length === 0) {
|
|
99
|
+
throw new WorkflowError("Plan-review expander: planSnapshot must be a verified CanonicalPlanSnapshot " +
|
|
100
|
+
"with non-empty `text` (A-6/D9). A pathname or bare string is not a snapshot: " +
|
|
101
|
+
"the expander inlines the plan TEXT and never reads a file.");
|
|
102
|
+
}
|
|
103
|
+
if (!/^[0-9a-f]{64}$/.test(snapshot.planDigest)) {
|
|
104
|
+
throw new WorkflowError("Plan-review expander: planSnapshot.planDigest must be a 64-hex checkpoint-text-v1 " +
|
|
105
|
+
"digest — the snapshot must come from the verified read, never reconstructed.");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function reviewerPrompt(prompt, seat) {
|
|
109
|
+
return `${prompt}\n\n## Bound review seat\nseat_id: ${seat.seat_id}\nreviewer: ${seat.reviewer}\nstance: ${seat.stance}`;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Expand the isolated four-stage plan-review seed. Existing council expansion
|
|
113
|
+
* is intentionally not reused or mutated.
|
|
114
|
+
*/
|
|
115
|
+
export function expandCouncilPlanReview(definition, contractInput,
|
|
116
|
+
/**
|
|
117
|
+
* The verified canonical plan snapshot (A-6/D9), inlined into every actor's
|
|
118
|
+
* prompt. Inlining TEXT rather than naming a path is what keeps D9 true now
|
|
119
|
+
* that actors run adapter-default: a path is a mutable thing an actor could
|
|
120
|
+
* re-read (or re-write) after verification, whereas the prompt bytes are
|
|
121
|
+
* fixed at dispatch.
|
|
122
|
+
*
|
|
123
|
+
* This takes the verified `CanonicalPlanSnapshot` rather than a bare `string`
|
|
124
|
+
* ON PURPOSE. A bare string accepts a PATHNAME just as happily as plan text,
|
|
125
|
+
* and a pathname would inline the path — reintroducing exactly the mutable
|
|
126
|
+
* indirection D9 exists to remove — while every existing test still passed,
|
|
127
|
+
* because none asserted on the rendered prompt. The nominal type makes that
|
|
128
|
+
* mistake unrepresentable for a reader; `assertVerifiedSnapshot` below makes
|
|
129
|
+
* it fail for the test suite.
|
|
130
|
+
*/
|
|
131
|
+
planSnapshot) {
|
|
132
|
+
assertVerifiedSnapshot(planSnapshot);
|
|
133
|
+
if (definition.name !== "plan-review-receipts") {
|
|
134
|
+
throw new WorkflowError(`Plan-review expander cannot expand workflow "${definition.name}"`);
|
|
135
|
+
}
|
|
136
|
+
if (definition.stages.length !== STAGE_IDS.length ||
|
|
137
|
+
definition.stages.some((stage, index) => stage.id !== STAGE_IDS[index])) {
|
|
138
|
+
throw new WorkflowError(`Plan-review expander requires stages in order: ${STAGE_IDS.join(", ")}`);
|
|
139
|
+
}
|
|
140
|
+
const contract = CouncilPlanReviewExecutionContractSchema.parse(contractInput);
|
|
141
|
+
const reviewersSeed = requireSeedStage(definition, "reviewers");
|
|
142
|
+
const crossReviewSeed = requireSeedStage(definition, "cross_review");
|
|
143
|
+
const rankingSeed = requireSeedStage(definition, "ranking_analysis");
|
|
144
|
+
const chairmanSeed = requireSeedStage(definition, "chairman");
|
|
145
|
+
const reviewerBlueprint = reviewersSeed.calls[0];
|
|
146
|
+
const crossReviewBlueprint = crossReviewSeed.calls[0];
|
|
147
|
+
const rankingCall = rankingSeed.calls[0];
|
|
148
|
+
const chairmanBlueprint = chairmanSeed.calls[0];
|
|
149
|
+
if (rankingCall.reducer === undefined) {
|
|
150
|
+
throw new WorkflowError("Plan-review expander: ranking_analysis must use a deterministic reducer");
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* A-6/D9: the verified snapshot is the ONLY plan text an actor receives.
|
|
154
|
+
*
|
|
155
|
+
* `absolute_file_paths: []` is SET, not merged, and that is the load-bearing
|
|
156
|
+
* half of this function. A seed blueprint that named the original plan would
|
|
157
|
+
* otherwise be re-admitted here and hand actors a MUTABLE plan alongside the
|
|
158
|
+
* inlined snapshot — silently retracting the exact decision the inlining
|
|
159
|
+
* exists to preserve. Emptying the list is what makes the snapshot the only
|
|
160
|
+
* plan text, now that it no longer occupies the file slot itself.
|
|
161
|
+
*
|
|
162
|
+
* The snapshot is attached as `plan_review_snapshot_text` DATA and is
|
|
163
|
+
* deliberately NOT concatenated into `prompt`. `prompt` is a template the
|
|
164
|
+
* engine renders; a plan is untrusted text that may contain `{{...}}`, so
|
|
165
|
+
* splicing it in would let the renderer rewrite the verified bytes (D9
|
|
166
|
+
* violation) or throw on a legitimate plan. The engine appends the block
|
|
167
|
+
* after rendering, so the actor gets the snapshot verbatim. Both halves are
|
|
168
|
+
* set together here, keeping "this call is an actor" ONE decision made in ONE
|
|
169
|
+
* place.
|
|
170
|
+
*
|
|
171
|
+
* ## On-disk footprint: duplicated per actor, and that is NOT new
|
|
172
|
+
*
|
|
173
|
+
* State this honestly, because it is easy to get backwards. The snapshot text
|
|
174
|
+
* IS copied into every actor call, and the whole normalized definition IS
|
|
175
|
+
* persisted — `WorkflowStateStore.create` writes it to `workflow.snapshot.json`
|
|
176
|
+
* and `resume` reads it back hash-verified (`state.ts:696-700,803-808`). So at
|
|
177
|
+
* a 6-seat roster with a 512 KiB plan this is ~6.6 MB on disk. It is NOT the
|
|
178
|
+
* case that "the definition is not persisted".
|
|
179
|
+
*
|
|
180
|
+
* This is nonetheless not a regression: the previous design spliced the same
|
|
181
|
+
* snapshot bytes into each `call.prompt`, which lands in the same persisted
|
|
182
|
+
* definition. The footprint is BYTE-IDENTICAL — the bytes moved fields, not
|
|
183
|
+
* volume. That, and only that, is the justification for accepting it here.
|
|
184
|
+
*/
|
|
185
|
+
const withSnapshotText = (call) => planSnapshot === undefined
|
|
186
|
+
? call
|
|
187
|
+
: {
|
|
188
|
+
...call,
|
|
189
|
+
absolute_file_paths: [],
|
|
190
|
+
plan_review_snapshot_text: planSnapshot.text,
|
|
191
|
+
};
|
|
192
|
+
const reviewerCalls = contract.seats.map((seat) => withSnapshotText({
|
|
193
|
+
...reviewerBlueprint,
|
|
194
|
+
id: seat.internal_call_id,
|
|
195
|
+
cli_name: seat.cli_name,
|
|
196
|
+
prompt: reviewerPrompt(reviewerBlueprint.prompt, seat),
|
|
197
|
+
}));
|
|
198
|
+
const globalAliases = Object.fromEntries(contract.seats.map((seat, index) => [
|
|
199
|
+
`reviewers.${seat.internal_call_id}`,
|
|
200
|
+
`candidate_${String(index).padStart(3, "0")}`,
|
|
201
|
+
]));
|
|
202
|
+
const crossReviewCalls = contract.seats.map((seat) => {
|
|
203
|
+
if (seat.cross_review_call_id === undefined) {
|
|
204
|
+
throw new WorkflowError(`Plan-review expander: seat "${seat.seat_id}" has no cross-review call mapping`);
|
|
205
|
+
}
|
|
206
|
+
return withSnapshotText({
|
|
207
|
+
...crossReviewBlueprint,
|
|
208
|
+
id: seat.cross_review_call_id,
|
|
209
|
+
cli_name: seat.cli_name,
|
|
210
|
+
context_from: contract.seats
|
|
211
|
+
.filter((peer) => peer.seat_id !== seat.seat_id)
|
|
212
|
+
.map((peer) => `reviewers.${peer.internal_call_id}`),
|
|
213
|
+
anonymize_context: true,
|
|
214
|
+
plan_review_semantic_context: true,
|
|
215
|
+
plan_review_anonymous_aliases: Object.fromEntries(Object.entries(globalAliases).filter(([reference]) => reference !== `reviewers.${seat.internal_call_id}`)),
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
const chairmanSeat = contract.seats.find((seat) => seat.seat_id === contract.chairman_seat);
|
|
219
|
+
const chairmanCall = withSnapshotText({
|
|
220
|
+
...chairmanBlueprint,
|
|
221
|
+
cli_name: chairmanSeat.cli_name,
|
|
222
|
+
});
|
|
223
|
+
return {
|
|
224
|
+
name: definition.name,
|
|
225
|
+
description: definition.description,
|
|
226
|
+
version: definition.version,
|
|
227
|
+
variables: definition.variables,
|
|
228
|
+
settings: definition.settings,
|
|
229
|
+
stages: [
|
|
230
|
+
copyStage(reviewersSeed, reviewerCalls, {
|
|
231
|
+
parallel: true,
|
|
232
|
+
on_failure: "continue",
|
|
233
|
+
}),
|
|
234
|
+
copyStage(crossReviewSeed, crossReviewCalls, {
|
|
235
|
+
parallel: true,
|
|
236
|
+
on_failure: "continue",
|
|
237
|
+
}),
|
|
238
|
+
copyStage(rankingSeed, [rankingCall]),
|
|
239
|
+
copyStage(chairmanSeed, [chairmanCall]),
|
|
240
|
+
],
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=expander.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expander.js","sourceRoot":"","sources":["../../src/plan-review/expander.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,wCAAwC,GAEzC,MAAM,yBAAyB,CAAC;AAGjC,MAAM,SAAS,GAAG;IAChB,WAAW;IACX,cAAc;IACd,kBAAkB;IAClB,UAAU;CACF,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,+BAA+B,CAAC;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAE/D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,uBAAuB,CAAC,gBAAwB;IAC9D,OAAO,2DAA2D,mBAAmB,KAAK,gBAAgB,KAAK,iBAAiB,EAAE,CAAC;AACrI,CAAC;AAED,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC;IACzC,gBAAgB;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AU;aACvB,CAAC;YACF,SAAS,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,CAAC;YACrC,SAAS,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,CAAC;SACxC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
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 { type CouncilPlanReviewResult } from "./contract.js";
|
|
36
|
+
import { type CouncilPlanReviewExecutionContract } from "./execution-contract.js";
|
|
37
|
+
import { type PlanReviewErrorReason } from "./stage-error.js";
|
|
38
|
+
import type { RunState } from "../state-schema.js";
|
|
39
|
+
/**
|
|
40
|
+
* What a run persisted about one seat. `body` is the RAW parsed artifact — the
|
|
41
|
+
* core, not the reader, decides whether it is a usable candidate, so a reader
|
|
42
|
+
* bug cannot promote junk to `completed`.
|
|
43
|
+
*/
|
|
44
|
+
export type PlanReviewSeatOutcome = {
|
|
45
|
+
readonly kind: "artifact";
|
|
46
|
+
readonly body: unknown;
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: "failed";
|
|
49
|
+
readonly reason: PlanReviewErrorReason;
|
|
50
|
+
readonly detail?: string | undefined;
|
|
51
|
+
} | {
|
|
52
|
+
readonly kind: "missing";
|
|
53
|
+
readonly reason: PlanReviewErrorReason;
|
|
54
|
+
readonly detail?: string | undefined;
|
|
55
|
+
};
|
|
56
|
+
export interface PlanReviewSeatObservation {
|
|
57
|
+
readonly seat_id: string;
|
|
58
|
+
readonly outcome: PlanReviewSeatOutcome;
|
|
59
|
+
}
|
|
60
|
+
export type PlanReviewChairmanObservation = {
|
|
61
|
+
readonly kind: "artifact";
|
|
62
|
+
readonly body: unknown;
|
|
63
|
+
} | {
|
|
64
|
+
readonly kind: "failed";
|
|
65
|
+
} | {
|
|
66
|
+
readonly kind: "skipped";
|
|
67
|
+
};
|
|
68
|
+
export interface PlanReviewProjectionInput {
|
|
69
|
+
/** The normalized, digest-bound roster and bindings. The sole identity source. */
|
|
70
|
+
readonly contract: CouncilPlanReviewExecutionContract;
|
|
71
|
+
/**
|
|
72
|
+
* The identity the caller believes it is projecting. Asserted, not trusted:
|
|
73
|
+
* the core recomputes the P0-4 digest from `contract` and refuses to stamp an
|
|
74
|
+
* envelope whose digest the contract does not actually produce.
|
|
75
|
+
*/
|
|
76
|
+
readonly execution_contract_digest: string;
|
|
77
|
+
readonly seats: readonly PlanReviewSeatObservation[];
|
|
78
|
+
readonly chairman: PlanReviewChairmanObservation;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Project the envelope from observations alone.
|
|
82
|
+
*
|
|
83
|
+
* Deterministic by construction: output depends only on `input`, and seat order
|
|
84
|
+
* is the contract's roster order — never observation arrival order. An
|
|
85
|
+
* observation for a seat outside the roster cannot appear in the output because
|
|
86
|
+
* the roster, not the observation list, drives iteration.
|
|
87
|
+
*
|
|
88
|
+
* @throws PlanReviewStageError on a digest that is not the contract identity, or
|
|
89
|
+
* an envelope that fails its own compiled contract (including the 1 MiB
|
|
90
|
+
* ceiling). Oversize is an explicit error — never truncation.
|
|
91
|
+
*/
|
|
92
|
+
export declare function projectCouncilPlanReviewResult(input: PlanReviewProjectionInput): CouncilPlanReviewResult;
|
|
93
|
+
/**
|
|
94
|
+
* Whether this run ever dispatched a reviewer, and therefore owes a result
|
|
95
|
+
* sidecar (C-5 eligibility).
|
|
96
|
+
*
|
|
97
|
+
* Reads ONLY the durable `attemptsConsumed` witness, never the call's current
|
|
98
|
+
* state: a run that dispatched three seats and then had every one of them fail,
|
|
99
|
+
* time out, or be cancelled still owes an envelope reporting exactly that. The
|
|
100
|
+
* inverse — treating this witness as evidence a candidate exists — is precisely
|
|
101
|
+
* the fabrication this module forbids, which is why the projection core takes
|
|
102
|
+
* observations and cannot see a `CallStateEntry` at all.
|
|
103
|
+
*/
|
|
104
|
+
export declare function isPlanReviewPublicationEligible(state: RunState): boolean;
|
|
105
|
+
export interface PlanReviewProjectionSource {
|
|
106
|
+
/** The run directory. Every read is contained to it. */
|
|
107
|
+
readonly runDir: string;
|
|
108
|
+
/** Final persisted state. The adapter reads it; it never writes. */
|
|
109
|
+
readonly state: RunState;
|
|
110
|
+
/** The restored, hash-verified contract (see `resume.ts`). */
|
|
111
|
+
readonly contract: CouncilPlanReviewExecutionContract;
|
|
112
|
+
/** The digest recomputed from that contract. */
|
|
113
|
+
readonly execution_contract_digest: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Project a run's envelope from its persisted state and artifacts.
|
|
117
|
+
*
|
|
118
|
+
* The contract is threaded in already-restored (`resume.ts` owns decode +
|
|
119
|
+
* hash-verify + recompute) but is NOT taken on faith: it must be the identity
|
|
120
|
+
* the run persisted, and its roster must agree with the persisted mappings.
|
|
121
|
+
* Otherwise this would happily project a run under a contract it never ran.
|
|
122
|
+
*
|
|
123
|
+
* @throws PlanReviewStageError when the persisted subtree is absent/corrupt, the
|
|
124
|
+
* contract is not the persisted identity, or the projection itself fails.
|
|
125
|
+
*/
|
|
126
|
+
export declare function projectPlanReviewRun(source: PlanReviewProjectionSource): Promise<CouncilPlanReviewResult>;
|