create-principles-disciple 1.144.27 → 1.145.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/_release/product-identity.json +2 -2
- package/codex-adapter/dist/index.d.ts +2 -2
- package/codex-adapter/dist/index.js +1 -1
- package/codex-adapter/dist/ingestion/admission.js +16 -0
- package/codex-adapter/dist/ingestion/codex-version.d.ts +10 -4
- package/codex-adapter/dist/ingestion/codex-version.js +10 -4
- package/codex-adapter/dist/ingestion/explicit-owner-statement.d.ts +48 -0
- package/codex-adapter/dist/ingestion/explicit-owner-statement.js +123 -0
- package/codex-adapter/dist/ingestion/ingestion.js +50 -1
- package/codex-adapter/dist/pd-hook.js +66 -3
- package/codex-adapter/dist/worker/workspace-worker.d.ts +14 -0
- package/codex-adapter/dist/worker/workspace-worker.js +194 -11
- package/codex-adapter/package.json +2 -2
- package/console/dist/server/models/ApprovalsConsoleModel.d.ts +2 -2
- package/console/dist/server/models/ApprovalsConsoleModel.js +1 -1
- package/console/dist/server/models/ApprovalsGroupedConsoleModel.js +1 -1
- package/console/dist/server/models/PrinciplesConsoleModel.d.ts +26 -1
- package/console/dist/server/models/PrinciplesConsoleModel.js +18 -1
- package/console/dist/server/routes/activations.js +4 -4
- package/console/dist/server/routes/approvals.js +2 -2
- package/console/dist/server/routes/failed-tasks.d.ts +9 -0
- package/console/dist/server/routes/failed-tasks.js +116 -7
- package/console/dist/server/routes/principles.js +73 -1
- package/console/dist/shared/prompt-injection-contract.d.ts +1 -1
- package/console/dist/ui/api.d.ts +5 -5
- package/console/dist/ui/i18n/en.json +13 -2
- package/console/dist/ui/i18n/zh-CN.json +13 -2
- package/console/dist/ui/pages/activation/ActivationPage.js +2 -1
- package/console/dist/ui/pages/failed-tasks/FailedTasksPage.js +42 -4
- package/console/dist/ui/pages/focus/FocusPage.js +3 -3
- package/console/dist/ui/pages/principles/PrinciplesPage.js +7 -2
- package/console/dist/ui/utils/validators.d.ts +6 -2
- package/console/dist/ui/utils/validators.js +19 -4
- package/console/dist/web/assets/app.css +26 -0
- package/console/dist/web/assets/app.js +24 -24
- package/console/package.json +4 -4
- package/core/dist/host/host-installer.d.ts +3 -1
- package/core/dist/host/host-installer.d.ts.map +1 -1
- package/core/dist/host/host-installer.js.map +1 -1
- package/core/dist/runtime-v2/admission-gate.d.ts +8 -0
- package/core/dist/runtime-v2/admission-gate.d.ts.map +1 -1
- package/core/dist/runtime-v2/admission-gate.js +3 -2
- package/core/dist/runtime-v2/admission-gate.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-defaults.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-defaults.js +16 -1
- package/core/dist/runtime-v2/config/pd-config-defaults.js.map +1 -1
- package/core/dist/runtime-v2/context-payload.d.ts +43 -3
- package/core/dist/runtime-v2/context-payload.d.ts.map +1 -1
- package/core/dist/runtime-v2/context-payload.js +15 -1
- package/core/dist/runtime-v2/context-payload.js.map +1 -1
- package/core/dist/runtime-v2/evidence-guards.d.ts +6 -0
- package/core/dist/runtime-v2/evidence-guards.d.ts.map +1 -1
- package/core/dist/runtime-v2/evidence-guards.js +11 -0
- package/core/dist/runtime-v2/evidence-guards.js.map +1 -1
- package/core/dist/runtime-v2/evolution/evolution-types.d.ts +4 -4
- package/core/dist/runtime-v2/evolution/evolution-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/evolution/evolution-types.js +1 -1
- package/core/dist/runtime-v2/evolution/evolution-types.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +6 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js +8 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js.map +1 -1
- package/core/dist/runtime-v2/index.d.ts +5 -2
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +3 -1
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-output.d.ts +11 -0
- package/core/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-output.js +10 -0
- package/core/dist/runtime-v2/internalization/evaluator-output.js.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts +3 -3
- package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js +49 -5
- package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-runner.js +13 -16
- package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/owner-decision-review.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/owner-decision-review.js +5 -1
- package/core/dist/runtime-v2/internalization/owner-decision-review.js.map +1 -1
- package/core/dist/runtime-v2/internalization/owner-review.d.ts +2 -2
- package/core/dist/runtime-v2/internalization/owner-review.js +2 -2
- package/core/dist/runtime-v2/internalization/scribe-output.d.ts +12 -0
- package/core/dist/runtime-v2/internalization/scribe-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-output.js +20 -0
- package/core/dist/runtime-v2/internalization/scribe-output.js.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts +32 -1
- package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js +38 -1
- package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization-queue-read-model.d.ts +6 -0
- package/core/dist/runtime-v2/internalization-queue-read-model.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization-queue-read-model.js +8 -1
- package/core/dist/runtime-v2/internalization-queue-read-model.js.map +1 -1
- package/core/dist/runtime-v2/intervention-evidence-normalizer.d.ts.map +1 -1
- package/core/dist/runtime-v2/intervention-evidence-normalizer.js +10 -3
- package/core/dist/runtime-v2/intervention-evidence-normalizer.js.map +1 -1
- package/core/dist/runtime-v2/pain-ingress.d.ts +1 -1
- package/core/dist/runtime-v2/pain-ingress.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-bridge.d.ts +68 -2
- package/core/dist/runtime-v2/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-bridge.js +541 -18
- package/core/dist/runtime-v2/pain-signal-bridge.js.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js +4 -0
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime-v2/product-telemetry/snapshot-contract.d.ts +2 -2
- package/core/dist/runtime-v2/product-telemetry/snapshot-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/product-telemetry/snapshot-contract.js +2 -2
- package/core/dist/runtime-v2/product-telemetry/snapshot-contract.js.map +1 -1
- package/core/dist/runtime-v2/store/candidate/admission-document.d.ts +90 -0
- package/core/dist/runtime-v2/store/candidate/admission-document.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/candidate/admission-document.js +142 -0
- package/core/dist/runtime-v2/store/candidate/admission-document.js.map +1 -0
- package/core/dist/runtime-v2/store/candidate/candidate-store.d.ts +53 -0
- package/core/dist/runtime-v2/store/candidate/candidate-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/candidate/memory-candidate-store.d.ts +35 -0
- package/core/dist/runtime-v2/store/candidate/memory-candidate-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/candidate/memory-candidate-store.js +48 -0
- package/core/dist/runtime-v2/store/candidate/memory-candidate-store.js.map +1 -1
- package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.d.ts +44 -0
- package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.js +136 -0
- package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.js.map +1 -1
- package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js.map +1 -1
- package/core/dist/runtime-v2/store/intervention-evidence-schema.js +1 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.d.ts +65 -0
- package/core/dist/runtime-v2/store/runtime-state-manager.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.js +46 -0
- package/core/dist/runtime-v2/store/runtime-state-manager.js.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-connection.js +42 -0
- package/core/dist/runtime-v2/store/sqlite-connection.js.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-intervention-evidence-store.d.ts +1 -1
- package/core/dist/runtime-v2/store/sqlite-intervention-evidence-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-intervention-evidence-store.js.map +1 -1
- package/core/dist/runtime-v2/store/task/sqlite-family-reopen.d.ts +19 -0
- package/core/dist/runtime-v2/store/task/sqlite-family-reopen.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/task/sqlite-family-reopen.js +36 -0
- package/core/dist/runtime-v2/store/task/sqlite-family-reopen.js.map +1 -0
- package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts +23 -0
- package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/task/sqlite-task-store.js +50 -0
- package/core/dist/runtime-v2/store/task/sqlite-task-store.js.map +1 -1
- package/core/dist/runtime-v2/task-status.d.ts +3 -1
- package/core/dist/runtime-v2/task-status.d.ts.map +1 -1
- package/core/dist/runtime-v2/task-status.js +1 -1
- package/core/dist/runtime-v2/task-status.js.map +1 -1
- package/core/dist/runtime-v2/trajectory-schema.d.ts.map +1 -1
- package/core/dist/runtime-v2/trajectory-schema.js +11 -0
- package/core/dist/runtime-v2/trajectory-schema.js.map +1 -1
- package/core/dist/runtime-v2/types/event-types.d.ts +2 -2
- package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/event-types.js +1 -1
- package/core/dist/runtime-v2/types/event-types.js.map +1 -1
- package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts +1 -1
- package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/evidence-chain-contract.js +2 -2
- package/core/dist/runtime-v2/types/evidence-chain-contract.js.map +1 -1
- package/core/dist/runtime-v2/types/intervention-evidence-contract.d.ts +3 -3
- package/core/dist/runtime-v2/types/intervention-evidence-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/intervention-evidence-contract.js +1 -0
- package/core/dist/runtime-v2/types/intervention-evidence-contract.js.map +1 -1
- package/core/dist/telemetry-event.d.ts +2 -2
- package/core/dist/telemetry-event.d.ts.map +1 -1
- package/core/dist/telemetry-event.js +4 -0
- package/core/dist/telemetry-event.js.map +1 -1
- package/core/dist/trajectory-types.d.ts +2 -2
- package/core/dist/trajectory-types.d.ts.map +1 -1
- package/core/package.json +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +84 -8
- package/dist/index.js.map +1 -1
- package/dist/installer.d.ts +42 -11
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +140 -36
- package/dist/installer.js.map +1 -1
- package/dist/installers/index.d.ts +18 -7
- package/dist/installers/index.d.ts.map +1 -1
- package/dist/installers/index.js +13 -4
- package/dist/installers/index.js.map +1 -1
- package/dist/installers/workbuddy-host-installer.d.ts +246 -0
- package/dist/installers/workbuddy-host-installer.d.ts.map +1 -0
- package/dist/installers/workbuddy-host-installer.js +1419 -0
- package/dist/installers/workbuddy-host-installer.js.map +1 -0
- package/dist/mvp-config.d.ts +24 -0
- package/dist/mvp-config.d.ts.map +1 -1
- package/dist/mvp-config.js +36 -0
- package/dist/mvp-config.js.map +1 -1
- package/dist/prompts.d.ts +13 -0
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +45 -8
- package/dist/prompts.js.map +1 -1
- package/dist/uninstaller.d.ts +1 -1
- package/dist/uninstaller.d.ts.map +1 -1
- package/dist/uninstaller.js +29 -4
- package/dist/uninstaller.js.map +1 -1
- package/host-runtime/dist/governance-signal-admission.d.ts +63 -0
- package/host-runtime/dist/governance-signal-admission.js +322 -53
- package/host-runtime/dist/host-liveness-contract.js +7 -1
- package/host-runtime/dist/index.d.ts +1 -0
- package/host-runtime/dist/index.js +5 -1
- package/host-runtime/dist/internalization-consumer-cycle.d.ts +12 -0
- package/host-runtime/dist/internalization-consumer-cycle.js +43 -1
- package/host-runtime/dist/intervention-evidence-ingress.d.ts +1 -1
- package/host-runtime/dist/product-telemetry/service.js +1 -1
- package/host-runtime/dist/production-pain-evidence.d.ts +59 -1
- package/host-runtime/dist/production-pain-evidence.js +200 -17
- package/host-runtime/dist/prompt-activation-deliverability.js +5 -4
- package/host-runtime/dist/prompt-injection-event-evidence.d.ts +1 -1
- package/host-runtime/dist/prompt-injection-event-evidence.js +5 -1
- package/host-runtime/dist/prompt-injection-projection.d.ts +14 -5
- package/host-runtime/dist/prompt-injection-projection.js +30 -16
- package/host-runtime/dist/workbuddy-worker-status.d.ts +24 -0
- package/host-runtime/dist/workbuddy-worker-status.js +52 -0
- package/host-runtime/package.json +3 -3
- package/install-layout/dist/index.d.ts +18 -1
- package/install-layout/dist/index.js +15 -2
- package/install-layout/package.json +1 -1
- package/package.json +6 -5
- package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
- package/pd-cli/dist/commands/candidate.js +44 -4
- package/pd-cli/dist/commands/candidate.js.map +1 -1
- package/pd-cli/dist/commands/codex-worker.d.ts.map +1 -1
- package/pd-cli/dist/commands/codex-worker.js +30 -1
- package/pd-cli/dist/commands/codex-worker.js.map +1 -1
- package/pd-cli/dist/commands/config-doctor.d.ts.map +1 -1
- package/pd-cli/dist/commands/config-doctor.js +19 -4
- package/pd-cli/dist/commands/config-doctor.js.map +1 -1
- package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
- package/pd-cli/dist/commands/diagnose.js +4 -1
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/health-codex-install.d.ts +85 -0
- package/pd-cli/dist/commands/health-codex-install.d.ts.map +1 -0
- package/pd-cli/dist/commands/health-codex-install.js +207 -0
- package/pd-cli/dist/commands/health-codex-install.js.map +1 -0
- package/pd-cli/dist/commands/health-codex.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-codex.js +78 -0
- package/pd-cli/dist/commands/health-codex.js.map +1 -1
- package/pd-cli/dist/commands/pain-list.d.ts +3 -2
- package/pd-cli/dist/commands/pain-list.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-list.js +10 -10
- package/pd-cli/dist/commands/pain-list.js.map +1 -1
- package/pd-cli/dist/commands/pain-record.d.ts +2 -0
- package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-record.js +36 -0
- package/pd-cli/dist/commands/pain-record.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts +6 -0
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +152 -5
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/dist/commands/runtime-activation.d.ts +1 -1
- package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-activation.js +3 -3
- package/pd-cli/dist/commands/runtime-activation.js.map +1 -1
- package/pd-cli/dist/commands/workbuddy-worker.d.ts +19 -0
- package/pd-cli/dist/commands/workbuddy-worker.d.ts.map +1 -0
- package/pd-cli/dist/commands/workbuddy-worker.js +168 -0
- package/pd-cli/dist/commands/workbuddy-worker.js.map +1 -0
- package/pd-cli/dist/index.js +29 -1
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/dist/resolve-workspace.d.ts +14 -2
- package/pd-cli/dist/resolve-workspace.d.ts.map +1 -1
- package/pd-cli/dist/resolve-workspace.js +88 -21
- package/pd-cli/dist/resolve-workspace.js.map +1 -1
- package/pd-cli/dist/services/admission-write-gate.d.ts +24 -0
- package/pd-cli/dist/services/admission-write-gate.d.ts.map +1 -0
- package/pd-cli/dist/services/admission-write-gate.js +41 -0
- package/pd-cli/dist/services/admission-write-gate.js.map +1 -0
- package/pd-cli/dist/services/pd-config-loader.d.ts +39 -7
- package/pd-cli/dist/services/pd-config-loader.d.ts.map +1 -1
- package/pd-cli/dist/services/pd-config-loader.js +111 -18
- package/pd-cli/dist/services/pd-config-loader.js.map +1 -1
- package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts +10 -0
- package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/rulehost-pipeline-runner.js +59 -4
- package/pd-cli/dist/services/rulehost-pipeline-runner.js.map +1 -1
- package/pd-cli/package.json +4 -3
- package/plugin/dist/bundle.js +564 -509
- package/plugin/dist/governance-audit.js +1 -1
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/rulehost-evidence.js +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +3 -3
- package/release-manager/dist/index.d.ts.map +1 -1
- package/release-manager/dist/index.js +84 -8
- package/release-manager/dist/index.js.map +1 -1
- package/release-manager/dist/installer.d.ts +42 -11
- package/release-manager/dist/installer.d.ts.map +1 -1
- package/release-manager/dist/installer.js +140 -36
- package/release-manager/dist/installer.js.map +1 -1
- package/release-manager/dist/installers/index.d.ts +18 -7
- package/release-manager/dist/installers/index.d.ts.map +1 -1
- package/release-manager/dist/installers/index.js +13 -4
- package/release-manager/dist/installers/index.js.map +1 -1
- package/release-manager/dist/installers/workbuddy-host-installer.d.ts +246 -0
- package/release-manager/dist/installers/workbuddy-host-installer.d.ts.map +1 -0
- package/release-manager/dist/installers/workbuddy-host-installer.js +1419 -0
- package/release-manager/dist/installers/workbuddy-host-installer.js.map +1 -0
- package/release-manager/dist/mvp-config.d.ts +24 -0
- package/release-manager/dist/mvp-config.d.ts.map +1 -1
- package/release-manager/dist/mvp-config.js +36 -0
- package/release-manager/dist/mvp-config.js.map +1 -1
- package/release-manager/dist/prompts.d.ts +13 -0
- package/release-manager/dist/prompts.d.ts.map +1 -1
- package/release-manager/dist/prompts.js +45 -8
- package/release-manager/dist/prompts.js.map +1 -1
- package/release-manager/dist/uninstaller.d.ts +1 -1
- package/release-manager/dist/uninstaller.d.ts.map +1 -1
- package/release-manager/dist/uninstaller.js +29 -4
- package/release-manager/dist/uninstaller.js.map +1 -1
- package/release-manager/package.json +5 -4
- package/workbuddy-adapter/dist/codec/index.d.ts +2 -0
- package/workbuddy-adapter/dist/codec/index.js +2 -0
- package/workbuddy-adapter/dist/codec/input-decoder.d.ts +30 -0
- package/workbuddy-adapter/dist/codec/input-decoder.js +232 -0
- package/workbuddy-adapter/dist/codec/output-encoder.d.ts +62 -0
- package/workbuddy-adapter/dist/codec/output-encoder.js +75 -0
- package/workbuddy-adapter/dist/host-adapter.d.ts +33 -0
- package/workbuddy-adapter/dist/host-adapter.js +23 -0
- package/workbuddy-adapter/dist/index.d.ts +16 -0
- package/workbuddy-adapter/dist/index.js +16 -0
- package/workbuddy-adapter/dist/pd-hook.d.ts +17 -0
- package/workbuddy-adapter/dist/pd-hook.js +505 -0
- package/workbuddy-adapter/dist/tool-semantics.d.ts +22 -0
- package/workbuddy-adapter/dist/tool-semantics.js +33 -0
- package/workbuddy-adapter/dist/workbuddy-evidence-recorder.d.ts +50 -0
- package/workbuddy-adapter/dist/workbuddy-evidence-recorder.js +238 -0
- package/workbuddy-adapter/dist/worker/workspace-worker.d.ts +41 -0
- package/workbuddy-adapter/dist/worker/workspace-worker.js +219 -0
- package/workbuddy-adapter/dist/workspace-resolution.d.ts +15 -0
- package/workbuddy-adapter/dist/workspace-resolution.js +53 -0
- package/workbuddy-adapter/package.json +62 -0
- package/workbuddy-adapter/plugin/.codebuddy-plugin/plugin.json +6 -0
- package/workbuddy-adapter/plugin/hooks/hooks.json +62 -0
- package/workbuddy-adapter/plugin/scripts/wrapper.cjs +79 -0
|
@@ -3,24 +3,32 @@ import { escapeXml } from '@principles/core/prompt-builder';
|
|
|
3
3
|
import { loadPdConfigForPlugin } from './pd-config.js';
|
|
4
4
|
import { buildActivePrinciplePromptContext, readPromptActivationCandidates, MAX_SHARED_DIAGNOSTIC_IDS } from './active-principle-prompt.js';
|
|
5
5
|
import { readWorkspaceHostKindFacts } from './host-liveness-contract.js';
|
|
6
|
-
|
|
6
|
+
/** Single host roster (review P2): every consumer derives from this list, so a
|
|
7
|
+
* new host cannot fork route-unconfirmed per-host forecasts from the routes. */
|
|
8
|
+
export const PROMPT_INJECTION_TARGET_HOSTS = ['openclaw', 'codex', 'workbuddy'];
|
|
9
|
+
/** Runtime membership test derived from the roster (rc-2): the ONE guard for
|
|
10
|
+
* "is this untrusted host-kind string a host with a known prompt-injection
|
|
11
|
+
* route". Every consumer narrows with this — never by re-typing the literals
|
|
12
|
+
* (review R1: each re-typed list forked the roster and dropped WorkBuddy). */
|
|
13
|
+
export function isPromptInjectionTargetHost(kind) {
|
|
14
|
+
return typeof kind === 'string' && PROMPT_INJECTION_TARGET_HOSTS.includes(kind);
|
|
15
|
+
}
|
|
7
16
|
export const PROMPT_INJECTION_UNIT = 'utf16_code_units';
|
|
8
17
|
/**
|
|
9
18
|
* THE one route formula (P4): Codex always injects through the shared route
|
|
10
|
-
* (codex-adapter has no flag branch);
|
|
11
|
-
*
|
|
12
|
-
*
|
|
19
|
+
* (codex-adapter has no flag branch); so does WorkBuddy (workbuddy-adapter
|
|
20
|
+
* renders through the shared runtime unconditionally — it has no legacy
|
|
21
|
+
* route); OpenClaw routes by its `abstraction_layer_v1` gate. Every consumer
|
|
22
|
+
* that needs "which route would host X take" must call this — never re-type
|
|
23
|
+
* the ternary.
|
|
13
24
|
*/
|
|
14
25
|
export function promptRouteForHost(hostKind, flagEnabled) {
|
|
15
|
-
if (hostKind === 'codex')
|
|
26
|
+
if (hostKind === 'codex' || hostKind === 'workbuddy')
|
|
16
27
|
return 'shared_render';
|
|
17
28
|
return flagEnabled ? 'shared_render' : 'legacy_trim';
|
|
18
29
|
}
|
|
19
30
|
function standardHostRoutes(flagEnabled) {
|
|
20
|
-
return
|
|
21
|
-
{ hostKind: 'openclaw', route: promptRouteForHost('openclaw', flagEnabled) },
|
|
22
|
-
{ hostKind: 'codex', route: promptRouteForHost('codex', flagEnabled) },
|
|
23
|
-
];
|
|
31
|
+
return PROMPT_INJECTION_TARGET_HOSTS.map((hostKind) => ({ hostKind, route: promptRouteForHost(hostKind, flagEnabled) }));
|
|
24
32
|
}
|
|
25
33
|
/**
|
|
26
34
|
* Resolve the effective route for this workspace. Pure read of existing
|
|
@@ -83,8 +91,8 @@ export function resolvePromptInjectionRouteDecision(input) {
|
|
|
83
91
|
perHost: standardHostRoutes(flagEnabled),
|
|
84
92
|
};
|
|
85
93
|
}
|
|
86
|
-
const knownKinds = facts.effectiveKinds.filter(
|
|
87
|
-
const unknownKinds = facts.effectiveKinds.filter((kind) => kind
|
|
94
|
+
const knownKinds = facts.effectiveKinds.filter(isPromptInjectionTargetHost);
|
|
95
|
+
const unknownKinds = facts.effectiveKinds.filter((kind) => !isPromptInjectionTargetHost(kind));
|
|
88
96
|
if (unknownKinds.length > 0) {
|
|
89
97
|
return {
|
|
90
98
|
status: 'unconfirmed',
|
|
@@ -92,7 +100,7 @@ export function resolvePromptInjectionRouteDecision(input) {
|
|
|
92
100
|
declaredHostKinds: facts.declaredKinds,
|
|
93
101
|
effectiveHostKinds: facts.effectiveKinds,
|
|
94
102
|
unconfirmedReason: `unknown_host_kind_declared: ${unknownKinds.join(', ')} has no known prompt-injection route`,
|
|
95
|
-
nextAction: 'pass an explicit target host (openclaw|codex) for this request, or remove the unknown host declaration',
|
|
103
|
+
nextAction: 'pass an explicit target host (openclaw|codex|workbuddy) for this request, or remove the unknown host declaration',
|
|
96
104
|
perHost: standardHostRoutes(flagEnabled),
|
|
97
105
|
};
|
|
98
106
|
}
|
|
@@ -117,7 +125,7 @@ export function resolvePromptInjectionRouteDecision(input) {
|
|
|
117
125
|
declaredHostKinds: facts.declaredKinds,
|
|
118
126
|
effectiveHostKinds: facts.effectiveKinds,
|
|
119
127
|
unconfirmedReason: 'no_host_facts_and_flag_off: no host declaration or host evidence exists, and the applicable hosts would take different routes',
|
|
120
|
-
nextAction: 'pass an explicit target host (openclaw|codex), or let a host run once in this workspace so it persists its declaration',
|
|
128
|
+
nextAction: 'pass an explicit target host (openclaw|codex|workbuddy), or let a host run once in this workspace so it persists its declaration',
|
|
121
129
|
perHost: standardHostRoutes(flagEnabled),
|
|
122
130
|
};
|
|
123
131
|
}
|
|
@@ -151,8 +159,8 @@ export function resolvePromptInjectionRouteDecision(input) {
|
|
|
151
159
|
flagEnabled,
|
|
152
160
|
declaredHostKinds: facts.declaredKinds,
|
|
153
161
|
effectiveHostKinds: facts.effectiveKinds,
|
|
154
|
-
unconfirmedReason: 'multi_host_routes_differ: openclaw would take the legacy list route
|
|
155
|
-
nextAction: 'pass an explicit target host (openclaw|codex) for this request, or enable abstraction_layer_v1 so
|
|
162
|
+
unconfirmedReason: 'multi_host_routes_differ: openclaw would take the legacy list route while codex/workbuddy would take the shared route under the current flag-off config',
|
|
163
|
+
nextAction: 'pass an explicit target host (openclaw|codex|workbuddy) for this request, or enable abstraction_layer_v1 so all hosts share one route',
|
|
156
164
|
perHost: standardHostRoutes(flagEnabled),
|
|
157
165
|
};
|
|
158
166
|
}
|
|
@@ -216,7 +224,13 @@ function isDiagnosticCapHit(ids) {
|
|
|
216
224
|
*/
|
|
217
225
|
export async function buildLivePromptInjectionProjection(input) {
|
|
218
226
|
const flagEnabled = computeFeatureFlagsFromConfig(loadPdConfigForPlugin(input.workspaceDir).effective).flags.abstraction_layer_v1?.enabled === true;
|
|
219
|
-
|
|
227
|
+
// Route face follows THE one route formula (review P2-2: a re-typed
|
|
228
|
+
// codex-only ternary forecast WorkBuddy as legacy_trim while its adapter
|
|
229
|
+
// renders shared unconditionally). No explicit target (console callers)
|
|
230
|
+
// keeps the flag-gated workspace default.
|
|
231
|
+
const sharedRoute = input.targetHost === undefined
|
|
232
|
+
? flagEnabled
|
|
233
|
+
: promptRouteForHost(input.targetHost, flagEnabled) === 'shared_render';
|
|
220
234
|
if (sharedRoute) {
|
|
221
235
|
const context = await buildActivePrinciplePromptContext(input);
|
|
222
236
|
const oversized = context.oversizedActivationIds ?? [];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkBuddy worker status-mode semantics — host-runtime authority (mirrors
|
|
3
|
+
* the Codex Slice D placement): the CLI worker --status and any health
|
|
4
|
+
* surface share ONE mode evaluation, which only depends on host-neutral
|
|
5
|
+
* inputs (governance workspace directory, .pd/config.yaml flags, install
|
|
6
|
+
* manifest registration). The WorkBuddy evaluation has NO ingestion step to
|
|
7
|
+
* gate — the hook is the only evidence producer in the WorkBuddy MVP
|
|
8
|
+
* (SPEC workbuddy-host-adapter §1 Excluded: no transcript reads).
|
|
9
|
+
*
|
|
10
|
+
* SPEC §15 worker mode, evaluated WITHOUT executing anything (no lease, no
|
|
11
|
+
* LLM). `manual_action_required` means no Companion-registered worker serves
|
|
12
|
+
* this governance workspace — manual `pd diagnose` / `pd runtime
|
|
13
|
+
* internalization run-once` is the recovery route.
|
|
14
|
+
*/
|
|
15
|
+
export type WorkbuddyWorkerMode = 'ready' | 'manual_action_required' | 'paused' | 'degraded';
|
|
16
|
+
export interface WorkbuddyWorkerStatusEvaluation {
|
|
17
|
+
readonly mode: WorkbuddyWorkerMode;
|
|
18
|
+
readonly reason?: string;
|
|
19
|
+
readonly nextAction?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function computeWorkbuddyWorkerStatusMode(input: {
|
|
22
|
+
workspaceDir: string;
|
|
23
|
+
registeredInInstallManifest: boolean;
|
|
24
|
+
}): WorkbuddyWorkerStatusEvaluation;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkBuddy worker status-mode semantics — host-runtime authority (mirrors
|
|
3
|
+
* the Codex Slice D placement): the CLI worker --status and any health
|
|
4
|
+
* surface share ONE mode evaluation, which only depends on host-neutral
|
|
5
|
+
* inputs (governance workspace directory, .pd/config.yaml flags, install
|
|
6
|
+
* manifest registration). The WorkBuddy evaluation has NO ingestion step to
|
|
7
|
+
* gate — the hook is the only evidence producer in the WorkBuddy MVP
|
|
8
|
+
* (SPEC workbuddy-host-adapter §1 Excluded: no transcript reads).
|
|
9
|
+
*
|
|
10
|
+
* SPEC §15 worker mode, evaluated WITHOUT executing anything (no lease, no
|
|
11
|
+
* LLM). `manual_action_required` means no Companion-registered worker serves
|
|
12
|
+
* this governance workspace — manual `pd diagnose` / `pd runtime
|
|
13
|
+
* internalization run-once` is the recovery route.
|
|
14
|
+
*/
|
|
15
|
+
import * as fs from 'node:fs';
|
|
16
|
+
import * as path from 'node:path';
|
|
17
|
+
import { loadPdConfigForPlugin } from './pd-config.js';
|
|
18
|
+
import { computeFeatureFlagsFromConfig } from '@principles/core/runtime-v2';
|
|
19
|
+
function directoryExists(dir) {
|
|
20
|
+
try {
|
|
21
|
+
return fs.statSync(dir).isDirectory();
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function computeWorkbuddyWorkerStatusMode(input) {
|
|
28
|
+
const workspaceDir = path.resolve(input.workspaceDir);
|
|
29
|
+
if (!directoryExists(workspaceDir)) {
|
|
30
|
+
return { mode: 'degraded', reason: 'workspace_missing', nextAction: 'The governance workspace directory does not exist; run the WorkBuddy setup flow to initialize it.' };
|
|
31
|
+
}
|
|
32
|
+
const config = loadPdConfigForPlugin(workspaceDir);
|
|
33
|
+
if (!config.ok) {
|
|
34
|
+
const [first] = config.errors;
|
|
35
|
+
return { mode: 'degraded', reason: `pd_config_invalid:${first?.reason ?? 'unknown'}`, nextAction: first?.nextAction ?? 'Repair the governance workspace .pd/config.yaml.' };
|
|
36
|
+
}
|
|
37
|
+
const { flags } = computeFeatureFlagsFromConfig(config.effective);
|
|
38
|
+
if (flags['host.workbuddy']?.enabled !== true) {
|
|
39
|
+
return { mode: 'paused', reason: 'host.workbuddy_disabled', nextAction: 'Set features.host.workbuddy.enabled=true in the governance workspace .pd/config.yaml to enable WorkBuddy PD behavior.' };
|
|
40
|
+
}
|
|
41
|
+
if (flags.internalization_auto_consumer?.enabled !== true) {
|
|
42
|
+
return { mode: 'paused', reason: 'internalization_auto_consumer_disabled', nextAction: 'Automatic execution is paused; manual commands remain available: pd diagnose, pd runtime internalization run-once.' };
|
|
43
|
+
}
|
|
44
|
+
if (!input.registeredInInstallManifest) {
|
|
45
|
+
return {
|
|
46
|
+
mode: 'manual_action_required',
|
|
47
|
+
reason: 'workspace_not_in_install_manifest',
|
|
48
|
+
nextAction: `No Companion worker is registered for this governance workspace. Manual path: pd diagnose --workspace "${workspaceDir}", then pd runtime internalization run-once.`,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return { mode: 'ready' };
|
|
52
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principles/host-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Shared host-neutral orchestration for Principles Disciple MVP-Core hook paths.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"@principles/core": "file:../core",
|
|
25
25
|
"@principles/install-layout": "file:../install-layout",
|
|
26
26
|
"better-sqlite3": "^13.0.3",
|
|
27
|
-
"js-yaml": "^5.4.
|
|
27
|
+
"js-yaml": "^5.4.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/better-sqlite3": "^9.6.0",
|
|
31
31
|
"@types/node": "^26.4.1",
|
|
32
32
|
"@types/js-yaml": "^4.0.9",
|
|
33
33
|
"typescript": "^7.0.2",
|
|
34
|
-
"vite": "^8.3.
|
|
34
|
+
"vite": "^8.3.4",
|
|
35
35
|
"vitest": "^5.0.0"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const INSTALL_LAYOUT_VERSION: 1;
|
|
2
2
|
export declare const INSTALL_LAYOUT_MODES: readonly ['canonical', 'legacy'];
|
|
3
3
|
export type InstallLayoutMode = (typeof INSTALL_LAYOUT_MODES)[number];
|
|
4
|
-
export declare const INSTALL_HOSTS: readonly ['codex', 'openclaw'];
|
|
4
|
+
export declare const INSTALL_HOSTS: readonly ['codex', 'openclaw', 'workbuddy'];
|
|
5
5
|
export type InstallHost = (typeof INSTALL_HOSTS)[number];
|
|
6
6
|
export interface InstallManifest {
|
|
7
7
|
layoutVersion: typeof INSTALL_LAYOUT_VERSION;
|
|
@@ -44,6 +44,13 @@ export interface InstallLayoutPaths {
|
|
|
44
44
|
* links like any other runtime component.
|
|
45
45
|
*/
|
|
46
46
|
codexAdapterDir: string;
|
|
47
|
+
/**
|
|
48
|
+
* WorkBuddy host adapter component (payload dir workbuddy-adapter/, npm
|
|
49
|
+
* name @principles/workbuddy-adapter; SPEC workbuddy-host-adapter §4.1).
|
|
50
|
+
* The WorkBuddy plugin wrapper resolves this dir to load the adapter entry
|
|
51
|
+
* the same way the Codex hook resolves the canonical runtime.
|
|
52
|
+
*/
|
|
53
|
+
workbuddyAdapterDir: string;
|
|
47
54
|
}
|
|
48
55
|
export interface LayoutResolution {
|
|
49
56
|
mode: InstallLayoutMode | 'missing';
|
|
@@ -65,6 +72,16 @@ export declare function parseInstallManifest(value: unknown): {
|
|
|
65
72
|
error?: string;
|
|
66
73
|
};
|
|
67
74
|
export declare function getInstallLayoutPaths(homeDir: string): InstallLayoutPaths;
|
|
75
|
+
/**
|
|
76
|
+
* WorkBuddy governance workspace (SPEC workbuddy-host-adapter §4.1 OD-07,
|
|
77
|
+
* frozen by Phase 0 probe P06 2026-10-12): an explicit user-level directory
|
|
78
|
+
* under the WorkBuddy config root, shared across projects, never auto-reused
|
|
79
|
+
* from Codex/OpenClaw state. projectDir stays the host cwd; this dir owns
|
|
80
|
+
* governance state (state.db / trajectory). The dir is CREATED only by the
|
|
81
|
+
* explicit setup flow — its absence means "not initialized", never a silent
|
|
82
|
+
* fallback to another host's database.
|
|
83
|
+
*/
|
|
84
|
+
export declare function getWorkbuddyWorkspaceDir(homeDir: string): string;
|
|
68
85
|
export declare function resolveInstallLayout(options: ResolveInstallLayoutOptions): LayoutResolution;
|
|
69
86
|
export declare function getConsoleServerEntry(paths: InstallLayoutPaths, mode: InstallLayoutMode): string;
|
|
70
87
|
export declare function getConsoleWebIndex(paths: InstallLayoutPaths, mode: InstallLayoutMode): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as path from 'node:path';
|
|
2
2
|
export const INSTALL_LAYOUT_VERSION = 1;
|
|
3
3
|
export const INSTALL_LAYOUT_MODES = ['canonical', 'legacy'];
|
|
4
|
-
export const INSTALL_HOSTS = ['codex', 'openclaw'];
|
|
4
|
+
export const INSTALL_HOSTS = ['codex', 'openclaw', 'workbuddy'];
|
|
5
5
|
function isRecord(value) {
|
|
6
6
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
7
|
}
|
|
@@ -48,7 +48,7 @@ export function parseInstallManifest(value) {
|
|
|
48
48
|
return { error: 'install_manifest_malformed: mode must be canonical or legacy' };
|
|
49
49
|
}
|
|
50
50
|
if (!Array.isArray(value.hosts) || value.hosts.length === 0 || !value.hosts.every(isHost)) {
|
|
51
|
-
return { error: 'install_manifest_malformed: hosts must contain codex and/or
|
|
51
|
+
return { error: 'install_manifest_malformed: hosts must contain codex, openclaw and/or workbuddy' };
|
|
52
52
|
}
|
|
53
53
|
const hosts = [...new Set(value.hosts)];
|
|
54
54
|
const workspaces = parseWorkspaceList(value.workspaces);
|
|
@@ -78,8 +78,21 @@ export function getInstallLayoutPaths(homeDir) {
|
|
|
78
78
|
openClawExtensionDir: path.join(openClawDir, 'extensions', 'principles-disciple'),
|
|
79
79
|
releaseManagerDir: path.join(runtimeDir, 'release-manager'),
|
|
80
80
|
codexAdapterDir: path.join(runtimeDir, 'codex-adapter'),
|
|
81
|
+
workbuddyAdapterDir: path.join(runtimeDir, 'workbuddy-adapter'),
|
|
81
82
|
};
|
|
82
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* WorkBuddy governance workspace (SPEC workbuddy-host-adapter §4.1 OD-07,
|
|
86
|
+
* frozen by Phase 0 probe P06 2026-10-12): an explicit user-level directory
|
|
87
|
+
* under the WorkBuddy config root, shared across projects, never auto-reused
|
|
88
|
+
* from Codex/OpenClaw state. projectDir stays the host cwd; this dir owns
|
|
89
|
+
* governance state (state.db / trajectory). The dir is CREATED only by the
|
|
90
|
+
* explicit setup flow — its absence means "not initialized", never a silent
|
|
91
|
+
* fallback to another host's database.
|
|
92
|
+
*/
|
|
93
|
+
export function getWorkbuddyWorkspaceDir(homeDir) {
|
|
94
|
+
return path.join(path.resolve(homeDir), '.workbuddy', 'pd-workspace');
|
|
95
|
+
}
|
|
83
96
|
export function resolveInstallLayout(options) {
|
|
84
97
|
const paths = getInstallLayoutPaths(options.homeDir);
|
|
85
98
|
const parsed = parseInstallManifest(options.manifest);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-principles-disciple",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.145.0",
|
|
4
4
|
"description": "Interactive CLI installer for Principles Disciple OpenClaw plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"core",
|
|
26
26
|
"host-runtime",
|
|
27
27
|
"codex-adapter",
|
|
28
|
+
"workbuddy-adapter",
|
|
28
29
|
"install-layout",
|
|
29
30
|
"release-manager",
|
|
30
31
|
"trust/root.json",
|
|
@@ -56,12 +57,12 @@
|
|
|
56
57
|
"author": "csuzngjh",
|
|
57
58
|
"license": "MIT",
|
|
58
59
|
"dependencies": {
|
|
59
|
-
"@principles/install-layout": "^0.
|
|
60
|
+
"@principles/install-layout": "^0.3.0",
|
|
60
61
|
"@tufjs/models": "3.0.1",
|
|
61
62
|
"@inquirer/prompts": "^8.7.2",
|
|
62
63
|
"commander": "^14.0.3",
|
|
63
64
|
"fs-extra": "^11.4.0",
|
|
64
|
-
"js-yaml": "^5.4.
|
|
65
|
+
"js-yaml": "^5.4.3",
|
|
65
66
|
"ora": "^9.4.1",
|
|
66
67
|
"picocolors": "^1.0.0",
|
|
67
68
|
"semver": "^7.8.5",
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
"@types/semver": "^7.8.0",
|
|
76
77
|
"@types/tar": "^7.0.87",
|
|
77
78
|
"typescript": "^7.0.2",
|
|
78
|
-
"vite": "^8.3.
|
|
79
|
+
"vite": "^8.3.4",
|
|
79
80
|
"vitest": "^5.0.0"
|
|
80
81
|
},
|
|
81
82
|
"engines": {
|
|
@@ -87,6 +88,6 @@
|
|
|
87
88
|
"directory": "packages/create-principles-disciple"
|
|
88
89
|
},
|
|
89
90
|
"pd": {
|
|
90
|
-
"bundledPluginVersion": "2.1.
|
|
91
|
+
"bundledPluginVersion": "2.1.3"
|
|
91
92
|
}
|
|
92
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate.d.ts","sourceRoot":"","sources":["../../src/commands/candidate.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,mBAAmB,EA0BpB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"candidate.d.ts","sourceRoot":"","sources":["../../src/commands/candidate.ts"],"names":[],"mappings":"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"}
|
|
@@ -27,6 +27,7 @@ import { resolveRuntimeAdapterFromConfig } from '../services/runtime-adapter-res
|
|
|
27
27
|
import { resolvePromptFullPipelineSeedMode } from '../services/pd-config-loader.js';
|
|
28
28
|
import { createRemediationResult, remediationAction } from './remediation-output.js';
|
|
29
29
|
import { checkAdmissionGate } from './admission-gate.js';
|
|
30
|
+
import { enforceFullAdmissionForWrite } from '../services/admission-write-gate.js';
|
|
30
31
|
async function updateCandidateStatus(opts) {
|
|
31
32
|
const { stateManager, candidateId, targetStatus, expectedCurrentStatus } = opts;
|
|
32
33
|
const db = stateManager.connection;
|
|
@@ -169,7 +170,11 @@ export async function handleCandidateList(opts) {
|
|
|
169
170
|
return;
|
|
170
171
|
}
|
|
171
172
|
if (result.candidates.length === 0) {
|
|
172
|
-
|
|
173
|
+
// An empty result must name the library it queried: with one .pd/state.db per
|
|
174
|
+
// host workspace, "no candidates" and "wrong workspace" are otherwise identical
|
|
175
|
+
// to the Owner (PRI-957). Resolved for display so a relative -w still reads as
|
|
176
|
+
// the absolute directory the query hit.
|
|
177
|
+
console.log(`No candidates found for task: ${opts.taskId} (workspace: ${path.resolve(workspaceDir)})`);
|
|
173
178
|
return;
|
|
174
179
|
}
|
|
175
180
|
console.log(`\nPrinciple Candidates for Task: ${opts.taskId}\n`);
|
|
@@ -710,6 +715,32 @@ export async function handleCandidateIntake(opts) {
|
|
|
710
715
|
}
|
|
711
716
|
// PRI-442 Stage 4: admission gate check — refuse non-admitted candidates
|
|
712
717
|
// to prevent CLI from bypassing the production admission gate.
|
|
718
|
+
// SPEC-CODEX-PAIN-CLOSURE-001 CR-03 (§7.2): the partial record check is a
|
|
719
|
+
// FAST pre-refusal only. The write permission itself comes from the
|
|
720
|
+
// persisted admission disposition; when it is missing (pre-CR-03 records)
|
|
721
|
+
// a full re-evaluation from the persisted materials runs and is saved.
|
|
722
|
+
// SPEC CR-03 §7.2 (review S1): the persisted/full admission gate owns the
|
|
723
|
+
// write permission; the partial record check below stays a fast pre-refusal.
|
|
724
|
+
const fullGate = await enforceFullAdmissionForWrite(stateManager, opts.candidateId);
|
|
725
|
+
if (fullGate !== null) {
|
|
726
|
+
const result = {
|
|
727
|
+
candidateId: opts.candidateId,
|
|
728
|
+
status: 'refused',
|
|
729
|
+
admissionDecision: fullGate.decision,
|
|
730
|
+
reason: fullGate.reason,
|
|
731
|
+
nextAction: fullGate.nextAction,
|
|
732
|
+
};
|
|
733
|
+
if (opts.json) {
|
|
734
|
+
console.log(JSON.stringify(result, null, 2));
|
|
735
|
+
}
|
|
736
|
+
else {
|
|
737
|
+
console.error(`Admission gate refused candidate ${opts.candidateId}: ${fullGate.decision}`);
|
|
738
|
+
console.error(` Reason: ${fullGate.reason}`);
|
|
739
|
+
console.error(` Next Action: ${fullGate.nextAction}`);
|
|
740
|
+
}
|
|
741
|
+
process.exit(1);
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
713
744
|
const admissionBlock = checkAdmissionGate(candidate);
|
|
714
745
|
if (admissionBlock) {
|
|
715
746
|
const result = {
|
|
@@ -888,7 +919,11 @@ export async function handleCandidateReview(opts) {
|
|
|
888
919
|
// `create` keeps the pre-check: a low-confidence candidate still cannot
|
|
889
920
|
// become a new Principle via the CLI.
|
|
890
921
|
if (opts.decide === 'create') {
|
|
891
|
-
|
|
922
|
+
// SPEC review S1: a CREATE decision is a governance write — it passes
|
|
923
|
+
// the full admission gate (the reuse verdict remains exempt by
|
|
924
|
+
// PRI-917 R5 F4: a reuse decision creates nothing).
|
|
925
|
+
const createFullGate = await enforceFullAdmissionForWrite(stateManager, opts.candidateId);
|
|
926
|
+
const admissionBlock = createFullGate ?? checkAdmissionGate(candidate);
|
|
892
927
|
if (admissionBlock) {
|
|
893
928
|
const payload = {
|
|
894
929
|
candidateId: opts.candidateId,
|
|
@@ -1188,7 +1223,10 @@ export async function handleCandidateRepair(opts) {
|
|
|
1188
1223
|
// re-verify admission before re-intaking to prevent bypassing the gate.
|
|
1189
1224
|
// A consumed candidate that would fail the gate indicates data corruption
|
|
1190
1225
|
// or a prior bypass; refuse and surface the reason.
|
|
1191
|
-
|
|
1226
|
+
// SPEC review S1: repair re-intake passes the SAME full write gate —
|
|
1227
|
+
// a corrupted admission document can never be repaired into the Ledger.
|
|
1228
|
+
const repairFullGate = await enforceFullAdmissionForWrite(stateManager, opts.candidateId);
|
|
1229
|
+
const admissionBlock = repairFullGate ?? checkAdmissionGate(candidate);
|
|
1192
1230
|
if (admissionBlock) {
|
|
1193
1231
|
const result = {
|
|
1194
1232
|
candidateId: opts.candidateId,
|
|
@@ -1457,7 +1495,9 @@ export async function handleCandidateInternalizationBackfill(opts) {
|
|
|
1457
1495
|
}
|
|
1458
1496
|
// PRI-442 Stage 4: admission gate check — refuse non-admitted pending
|
|
1459
1497
|
// candidates to prevent backfill from bypassing the admission gate.
|
|
1460
|
-
|
|
1498
|
+
// SPEC review S1: backfill writes pass the full admission gate too.
|
|
1499
|
+
const backfillFullGate = await enforceFullAdmissionForWrite(stateManager, candidateId);
|
|
1500
|
+
const admissionBlock = backfillFullGate ?? checkAdmissionGate(candidate);
|
|
1461
1501
|
if (admissionBlock) {
|
|
1462
1502
|
output.intakeFailed++;
|
|
1463
1503
|
output.results.push({ candidateId, route: 'unknown', status: 'intake_failed', reason: `Admission gate refused: ${admissionBlock.reason}`, statusBefore: 'pending', statusAfter: 'pending', intakeDecision: 'skipped', seedDecision: 'skipped', nextAction: admissionBlock.nextAction });
|