create-principles-disciple 1.154.4 → 1.155.1
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/codec/input-decoder.d.ts +17 -0
- package/codex-adapter/dist/codec/input-decoder.js +39 -0
- package/codex-adapter/dist/ingestion/explicit-owner-statement.js +125 -1
- package/codex-adapter/dist/ingestion/pain-receipt-fallback.d.ts +46 -0
- package/codex-adapter/dist/ingestion/pain-receipt-fallback.js +193 -0
- package/codex-adapter/dist/ingestion/turn-context.d.ts +10 -15
- package/codex-adapter/dist/ingestion/turn-context.js +35 -9
- package/codex-adapter/dist/pd-hook.js +57 -1
- package/codex-adapter/dist/worker/workspace-worker.d.ts +15 -0
- package/codex-adapter/dist/worker/workspace-worker.js +91 -12
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/index.js +10 -0
- package/console/dist/server/models/EvidenceChainConsoleModel.js +31 -0
- package/console/dist/server/routes/service-host.d.ts +19 -0
- package/console/dist/server/routes/service-host.js +129 -0
- package/console/dist/web/assets/app.js +37 -37
- package/core/dist/runtime/context-payload.d.ts +48 -0
- package/core/dist/runtime/context-payload.d.ts.map +1 -1
- package/core/dist/runtime/context-payload.js +12 -0
- package/core/dist/runtime/context-payload.js.map +1 -1
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.js +18 -0
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.js.map +1 -1
- package/core/dist/runtime/diagnostician-candidate.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician-candidate.js +18 -2
- package/core/dist/runtime/diagnostician-candidate.js.map +1 -1
- package/core/dist/runtime/evidence-guards.d.ts +7 -3
- package/core/dist/runtime/evidence-guards.d.ts.map +1 -1
- package/core/dist/runtime/evidence-guards.js +9 -7
- package/core/dist/runtime/evidence-guards.js.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-contract.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-contract.js +14 -0
- package/core/dist/runtime/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js +8 -0
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js.map +1 -1
- package/core/dist/runtime/host-submission-context.d.ts +83 -0
- package/core/dist/runtime/host-submission-context.d.ts.map +1 -0
- package/core/dist/runtime/host-submission-context.js +183 -0
- package/core/dist/runtime/host-submission-context.js.map +1 -0
- package/core/dist/runtime/index.d.ts +9 -2
- package/core/dist/runtime/index.d.ts.map +1 -1
- package/core/dist/runtime/index.js +29 -2
- package/core/dist/runtime/index.js.map +1 -1
- package/core/dist/runtime/intent/intent-doc.d.ts.map +1 -1
- package/core/dist/runtime/intent/intent-doc.js +29 -5
- package/core/dist/runtime/intent/intent-doc.js.map +1 -1
- package/core/dist/runtime/internalization/diag-distiller-runner.d.ts +9 -0
- package/core/dist/runtime/internalization/diag-distiller-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-distiller-runner.js +13 -0
- package/core/dist/runtime/internalization/diag-distiller-runner.js.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts +11 -0
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.js +10 -0
- package/core/dist/runtime/internalization/diag-rootcause-runner.js.map +1 -1
- package/core/dist/runtime/internalization/diag-router-runner.d.ts +9 -0
- package/core/dist/runtime/internalization/diag-router-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-router-runner.js +13 -0
- package/core/dist/runtime/internalization/diag-router-runner.js.map +1 -1
- package/core/dist/runtime/internalization/index.d.ts +1 -1
- package/core/dist/runtime/internalization/index.d.ts.map +1 -1
- package/core/dist/runtime/internalization/index.js +1 -1
- package/core/dist/runtime/internalization/index.js.map +1 -1
- package/core/dist/runtime/internalization/intake-to-internalization-bridge.d.ts +19 -0
- package/core/dist/runtime/internalization/intake-to-internalization-bridge.d.ts.map +1 -1
- package/core/dist/runtime/internalization/intake-to-internalization-bridge.js +24 -0
- package/core/dist/runtime/internalization/intake-to-internalization-bridge.js.map +1 -1
- package/core/dist/runtime/internalization/internalization-orchestrator.d.ts +8 -0
- package/core/dist/runtime/internalization/internalization-orchestrator.d.ts.map +1 -1
- package/core/dist/runtime/internalization/internalization-orchestrator.js +36 -4
- package/core/dist/runtime/internalization/internalization-orchestrator.js.map +1 -1
- package/core/dist/runtime/internalization/source-authorization-boundary.d.ts +39 -0
- package/core/dist/runtime/internalization/source-authorization-boundary.d.ts.map +1 -0
- package/core/dist/runtime/internalization/source-authorization-boundary.js +57 -0
- package/core/dist/runtime/internalization/source-authorization-boundary.js.map +1 -0
- package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.js +72 -5
- package/core/dist/runtime/internalization/split-diagnostician-runner.js.map +1 -1
- package/core/dist/runtime/pain-admission-disposition.d.ts +60 -0
- package/core/dist/runtime/pain-admission-disposition.d.ts.map +1 -0
- package/core/dist/runtime/pain-admission-disposition.js +37 -0
- package/core/dist/runtime/pain-admission-disposition.js.map +1 -0
- package/core/dist/runtime/pain-ingress-payload.d.ts +36 -2
- package/core/dist/runtime/pain-ingress-payload.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress-payload.js +63 -6
- package/core/dist/runtime/pain-ingress-payload.js.map +1 -1
- package/core/dist/runtime/pain-ingress.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress.js +28 -0
- package/core/dist/runtime/pain-ingress.js.map +1 -1
- package/core/dist/runtime/pain-recall-read-model.d.ts +13 -1
- package/core/dist/runtime/pain-recall-read-model.d.ts.map +1 -1
- package/core/dist/runtime/pain-recall-read-model.js +50 -7
- package/core/dist/runtime/pain-recall-read-model.js.map +1 -1
- package/core/dist/runtime/pain-receipt-recovery.d.ts +147 -0
- package/core/dist/runtime/pain-receipt-recovery.d.ts.map +1 -0
- package/core/dist/runtime/pain-receipt-recovery.js +475 -0
- package/core/dist/runtime/pain-receipt-recovery.js.map +1 -0
- package/core/dist/runtime/pain-signal-bridge.d.ts +13 -1
- package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.js +174 -0
- package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts +9 -0
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.js +8 -3
- package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime/pain-submit-capability.d.ts +11 -0
- package/core/dist/runtime/pain-submit-capability.d.ts.map +1 -1
- package/core/dist/runtime/pain-submit-capability.js +77 -3
- package/core/dist/runtime/pain-submit-capability.js.map +1 -1
- package/core/dist/runtime/pain-target-evidence-reconcile.d.ts +55 -0
- package/core/dist/runtime/pain-target-evidence-reconcile.d.ts.map +1 -0
- package/core/dist/runtime/pain-target-evidence-reconcile.js +164 -0
- package/core/dist/runtime/pain-target-evidence-reconcile.js.map +1 -0
- package/core/dist/runtime/pain-to-principle-service.d.ts +8 -0
- package/core/dist/runtime/pain-to-principle-service.d.ts.map +1 -1
- package/core/dist/runtime/pain-to-principle-service.js +1 -0
- package/core/dist/runtime/pain-to-principle-service.js.map +1 -1
- package/core/dist/runtime/source-material-authorization.d.ts +166 -0
- package/core/dist/runtime/source-material-authorization.d.ts.map +1 -0
- package/core/dist/runtime/source-material-authorization.js +250 -0
- package/core/dist/runtime/source-material-authorization.js.map +1 -0
- package/core/dist/runtime/store/context/index.d.ts +1 -0
- package/core/dist/runtime/store/context/index.d.ts.map +1 -1
- package/core/dist/runtime/store/context/index.js +1 -0
- package/core/dist/runtime/store/context/index.js.map +1 -1
- package/core/dist/runtime/store/context/promoted-evidence-reader.d.ts +8 -0
- package/core/dist/runtime/store/context/promoted-evidence-reader.d.ts.map +1 -1
- package/core/dist/runtime/store/context/promoted-evidence-reader.js +15 -1
- package/core/dist/runtime/store/context/promoted-evidence-reader.js.map +1 -1
- package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts +22 -0
- package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts.map +1 -1
- package/core/dist/runtime/store/context/sqlite-context-assembler.js +153 -3
- package/core/dist/runtime/store/context/sqlite-context-assembler.js.map +1 -1
- package/core/dist/runtime/store/context/trajectory-turn-reader.d.ts +13 -0
- package/core/dist/runtime/store/context/trajectory-turn-reader.d.ts.map +1 -1
- package/core/dist/runtime/store/lifecycle/lease-manager.d.ts +15 -0
- package/core/dist/runtime/store/lifecycle/lease-manager.d.ts.map +1 -1
- package/core/dist/runtime/store/lifecycle/lease-manager.js +16 -1
- package/core/dist/runtime/store/lifecycle/lease-manager.js.map +1 -1
- package/core/dist/runtime/store/runtime-state-manager.d.ts +2 -0
- package/core/dist/runtime/store/runtime-state-manager.d.ts.map +1 -1
- package/core/dist/runtime/store/runtime-state-manager.js.map +1 -1
- package/core/dist/runtime/store/task/memory-task-store.d.ts +1 -0
- package/core/dist/runtime/store/task/memory-task-store.d.ts.map +1 -1
- package/core/dist/runtime/store/task/memory-task-store.js +37 -0
- package/core/dist/runtime/store/task/memory-task-store.js.map +1 -1
- package/core/dist/runtime/store/task/sqlite-task-store.d.ts +10 -0
- package/core/dist/runtime/store/task/sqlite-task-store.d.ts.map +1 -1
- package/core/dist/runtime/store/task/sqlite-task-store.js +20 -0
- package/core/dist/runtime/store/task/sqlite-task-store.js.map +1 -1
- package/core/dist/runtime/store/task/task-store.d.ts +16 -0
- package/core/dist/runtime/store/task/task-store.d.ts.map +1 -1
- package/core/dist/runtime/task-status.d.ts +13 -0
- package/core/dist/runtime/task-status.d.ts.map +1 -1
- package/core/dist/runtime/task-status.js +9 -0
- package/core/dist/runtime/task-status.js.map +1 -1
- package/core/dist/runtime/types/evidence-chain-contract.d.ts +10 -0
- package/core/dist/runtime/types/evidence-chain-contract.d.ts.map +1 -1
- package/core/dist/runtime/types/evidence-chain-contract.js +7 -0
- package/core/dist/runtime/types/evidence-chain-contract.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +77 -30
- package/dist/installer.js.map +1 -1
- package/dist/installers/mcp-registration-conflict.d.ts +8 -0
- package/dist/installers/mcp-registration-conflict.d.ts.map +1 -1
- package/dist/installers/mcp-registration-conflict.js +34 -1
- package/dist/installers/mcp-registration-conflict.js.map +1 -1
- package/dist/installers/workbuddy-host-installer.d.ts +45 -13
- package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
- package/dist/installers/workbuddy-host-installer.js +284 -21
- package/dist/installers/workbuddy-host-installer.js.map +1 -1
- package/dist/prompts.d.ts +11 -0
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +4 -0
- package/dist/prompts.js.map +1 -1
- package/dist/service-host-bridge.d.ts +67 -0
- package/dist/service-host-bridge.d.ts.map +1 -0
- package/dist/service-host-bridge.js +292 -0
- package/dist/service-host-bridge.js.map +1 -0
- package/dist/uninstaller.d.ts.map +1 -1
- package/dist/uninstaller.js +26 -0
- package/dist/uninstaller.js.map +1 -1
- package/dist/update/install-layout.d.ts +0 -12
- package/dist/update/install-layout.d.ts.map +1 -1
- package/dist/update/install-layout.js +42 -15
- package/dist/update/install-layout.js.map +1 -1
- package/host-runtime/dist/diagnostician-auto-run.js +4 -1
- package/host-runtime/dist/governance-observation-store.d.ts +7 -0
- package/host-runtime/dist/governance-observation-store.js +15 -4
- package/host-runtime/dist/governance-signal-admission.d.ts +49 -0
- package/host-runtime/dist/governance-signal-admission.js +355 -94
- package/host-runtime/dist/governance-trajectory-turn-reader.d.ts +20 -4
- package/host-runtime/dist/governance-trajectory-turn-reader.js +77 -5
- package/host-runtime/dist/index.d.ts +2 -0
- package/host-runtime/dist/index.js +5 -0
- package/host-runtime/dist/internalization-consumer-cycle.js +4 -1
- package/host-runtime/dist/pd-config.d.ts +10 -0
- package/host-runtime/dist/pd-config.js +37 -0
- package/host-runtime/dist/signal-stage2-cycle.js +28 -1
- package/host-runtime/dist/source-material-authorization.d.ts +53 -0
- package/host-runtime/dist/source-material-authorization.js +67 -0
- package/host-runtime/dist/source-revocation-sweep.d.ts +172 -0
- package/host-runtime/dist/source-revocation-sweep.js +928 -0
- package/host-runtime/package.json +5 -1
- package/install-layout/dist/background-execution-transition.d.ts +258 -0
- package/install-layout/dist/background-execution-transition.js +836 -0
- package/install-layout/dist/index.d.ts +8 -0
- package/install-layout/dist/index.js +8 -0
- package/install-layout/package.json +6 -2
- package/package.json +4 -4
- package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
- package/pd-cli/dist/commands/candidate.js +16 -5
- package/pd-cli/dist/commands/candidate.js.map +1 -1
- package/pd-cli/dist/commands/codex-setup.d.ts.map +1 -1
- package/pd-cli/dist/commands/codex-setup.js +17 -1
- package/pd-cli/dist/commands/codex-setup.js.map +1 -1
- package/pd-cli/dist/commands/codex-worker.d.ts.map +1 -1
- package/pd-cli/dist/commands/codex-worker.js +8 -4
- package/pd-cli/dist/commands/codex-worker.js.map +1 -1
- package/pd-cli/dist/commands/consent-sweep-revoked.d.ts +20 -0
- package/pd-cli/dist/commands/consent-sweep-revoked.d.ts.map +1 -0
- package/pd-cli/dist/commands/consent-sweep-revoked.js +85 -0
- package/pd-cli/dist/commands/consent-sweep-revoked.js.map +1 -0
- package/pd-cli/dist/commands/context.d.ts.map +1 -1
- package/pd-cli/dist/commands/context.js +9 -1
- package/pd-cli/dist/commands/context.js.map +1 -1
- package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
- package/pd-cli/dist/commands/diagnose.js +12 -6
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/openclaw-worker.d.ts +11 -0
- package/pd-cli/dist/commands/openclaw-worker.d.ts.map +1 -0
- package/pd-cli/dist/commands/openclaw-worker.js +199 -0
- package/pd-cli/dist/commands/openclaw-worker.js.map +1 -0
- package/pd-cli/dist/commands/pain-explicit.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-explicit.js +1 -0
- package/pd-cli/dist/commands/pain-explicit.js.map +1 -1
- package/pd-cli/dist/commands/pain-recall.d.ts +2 -2
- package/pd-cli/dist/commands/pain-recall.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-recall.js +7 -1
- package/pd-cli/dist/commands/pain-recall.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +12 -6
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +2 -1
- package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts +1 -0
- package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.js +32 -8
- package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-wake-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-wake-once.js +2 -1
- package/pd-cli/dist/commands/runtime-internalization-wake-once.js.map +1 -1
- package/pd-cli/dist/commands/service-handover.d.ts +12 -0
- package/pd-cli/dist/commands/service-handover.d.ts.map +1 -0
- package/pd-cli/dist/commands/service-handover.js +117 -0
- package/pd-cli/dist/commands/service-handover.js.map +1 -0
- package/pd-cli/dist/commands/service-lifecycle.d.ts +31 -0
- package/pd-cli/dist/commands/service-lifecycle.d.ts.map +1 -0
- package/pd-cli/dist/commands/service-lifecycle.js +207 -0
- package/pd-cli/dist/commands/service-lifecycle.js.map +1 -0
- package/pd-cli/dist/commands/service-run-once.d.ts +96 -0
- package/pd-cli/dist/commands/service-run-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/service-run-once.js +432 -13
- package/pd-cli/dist/commands/service-run-once.js.map +1 -1
- package/pd-cli/dist/commands/workbuddy-setup.d.ts.map +1 -1
- package/pd-cli/dist/commands/workbuddy-setup.js +22 -2
- package/pd-cli/dist/commands/workbuddy-setup.js.map +1 -1
- package/pd-cli/dist/program.d.ts.map +1 -1
- package/pd-cli/dist/program.js +167 -9
- package/pd-cli/dist/program.js.map +1 -1
- package/pd-cli/dist/services/admission-write-gate.d.ts +3 -1
- package/pd-cli/dist/services/admission-write-gate.d.ts.map +1 -1
- package/pd-cli/dist/services/admission-write-gate.js +1 -0
- package/pd-cli/dist/services/admission-write-gate.js.map +1 -1
- package/pd-cli/dist/services/service-host/coordinator-common.d.ts +49 -0
- package/pd-cli/dist/services/service-host/coordinator-common.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/coordinator-common.js +158 -0
- package/pd-cli/dist/services/service-host/coordinator-common.js.map +1 -0
- package/pd-cli/dist/services/service-host/handover-claims.d.ts +14 -0
- package/pd-cli/dist/services/service-host/handover-claims.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/handover-claims.js +50 -0
- package/pd-cli/dist/services/service-host/handover-claims.js.map +1 -0
- package/pd-cli/dist/services/service-host/index.d.ts +19 -3
- package/pd-cli/dist/services/service-host/index.d.ts.map +1 -1
- package/pd-cli/dist/services/service-host/index.js +21 -3
- package/pd-cli/dist/services/service-host/index.js.map +1 -1
- package/pd-cli/dist/services/service-host/install-identity.d.ts +23 -3
- package/pd-cli/dist/services/service-host/install-identity.d.ts.map +1 -1
- package/pd-cli/dist/services/service-host/install-identity.js +15 -5
- package/pd-cli/dist/services/service-host/install-identity.js.map +1 -1
- package/pd-cli/dist/services/service-host/locking/service-run-lock.d.ts +130 -9
- package/pd-cli/dist/services/service-host/locking/service-run-lock.d.ts.map +1 -1
- package/pd-cli/dist/services/service-host/locking/service-run-lock.js +99 -19
- package/pd-cli/dist/services/service-host/locking/service-run-lock.js.map +1 -1
- package/pd-cli/dist/services/service-host/managed-run.d.ts +75 -0
- package/pd-cli/dist/services/service-host/managed-run.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/managed-run.js +550 -0
- package/pd-cli/dist/services/service-host/managed-run.js.map +1 -0
- package/pd-cli/dist/services/service-host/progress-evidence.d.ts +38 -0
- package/pd-cli/dist/services/service-host/progress-evidence.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/progress-evidence.js +155 -0
- package/pd-cli/dist/services/service-host/progress-evidence.js.map +1 -0
- package/pd-cli/dist/services/service-host/run-once.d.ts.map +1 -1
- package/pd-cli/dist/services/service-host/run-once.js +4 -136
- package/pd-cli/dist/services/service-host/run-once.js.map +1 -1
- package/pd-cli/dist/services/service-host/scheduler/contract.d.ts +184 -0
- package/pd-cli/dist/services/service-host/scheduler/contract.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/contract.js +86 -0
- package/pd-cli/dist/services/service-host/scheduler/contract.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/index.d.ts +76 -0
- package/pd-cli/dist/services/service-host/scheduler/index.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/index.js +128 -0
- package/pd-cli/dist/services/service-host/scheduler/index.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/linux.d.ts +27 -0
- package/pd-cli/dist/services/service-host/scheduler/linux.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/linux.js +1010 -0
- package/pd-cli/dist/services/service-host/scheduler/linux.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/macos.d.ts +13 -0
- package/pd-cli/dist/services/service-host/scheduler/macos.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/macos.js +819 -0
- package/pd-cli/dist/services/service-host/scheduler/macos.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/runtime-io.d.ts +13 -0
- package/pd-cli/dist/services/service-host/scheduler/runtime-io.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/runtime-io.js +141 -0
- package/pd-cli/dist/services/service-host/scheduler/runtime-io.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/service-status.d.ts +99 -0
- package/pd-cli/dist/services/service-host/scheduler/service-status.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/service-status.js +202 -0
- package/pd-cli/dist/services/service-host/scheduler/service-status.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/windows.d.ts +40 -0
- package/pd-cli/dist/services/service-host/scheduler/windows.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/windows.js +688 -0
- package/pd-cli/dist/services/service-host/scheduler/windows.js.map +1 -0
- package/pd-cli/dist/services/service-host/shadow-progress-store.d.ts +43 -0
- package/pd-cli/dist/services/service-host/shadow-progress-store.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/shadow-progress-store.js +156 -0
- package/pd-cli/dist/services/service-host/shadow-progress-store.js.map +1 -0
- package/pd-cli/dist/services/service-host/shadow-run.d.ts +87 -0
- package/pd-cli/dist/services/service-host/shadow-run.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/shadow-run.js +549 -0
- package/pd-cli/dist/services/service-host/shadow-run.js.map +1 -0
- package/pd-cli/dist/services/service-host/status/service-run-status.d.ts +114 -4
- package/pd-cli/dist/services/service-host/status/service-run-status.d.ts.map +1 -1
- package/pd-cli/dist/services/service-host/status/service-run-status.js +37 -0
- package/pd-cli/dist/services/service-host/status/service-run-status.js.map +1 -1
- package/pd-cli/dist/services/service-host/worker-adapter-codex.d.ts +2 -0
- package/pd-cli/dist/services/service-host/worker-adapter-codex.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter-codex.js +76 -0
- package/pd-cli/dist/services/service-host/worker-adapter-codex.js.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter-openclaw.d.ts +2 -0
- package/pd-cli/dist/services/service-host/worker-adapter-openclaw.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter-openclaw.js +49 -0
- package/pd-cli/dist/services/service-host/worker-adapter-openclaw.js.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.d.ts +2 -0
- package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.js +36 -0
- package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.js.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter.d.ts +187 -0
- package/pd-cli/dist/services/service-host/worker-adapter.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter.js +609 -0
- package/pd-cli/dist/services/service-host/worker-adapter.js.map +1 -0
- package/pd-cli/dist/services/service-host/worker-env.d.ts +84 -0
- package/pd-cli/dist/services/service-host/worker-env.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-env.js +195 -0
- package/pd-cli/dist/services/service-host/worker-env.js.map +1 -0
- package/pd-cli/dist/services/service-host/worker-process.d.ts +75 -0
- package/pd-cli/dist/services/service-host/worker-process.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-process.js +225 -0
- package/pd-cli/dist/services/service-host/worker-process.js.map +1 -0
- package/pd-cli/dist/services/service-host/workspace-dispatch.d.ts +61 -0
- package/pd-cli/dist/services/service-host/workspace-dispatch.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/workspace-dispatch.js +105 -0
- package/pd-cli/dist/services/service-host/workspace-dispatch.js.map +1 -0
- package/pd-cli/dist/services/service-host/workspace-handover.d.ts +190 -0
- package/pd-cli/dist/services/service-host/workspace-handover.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/workspace-handover.js +1393 -0
- package/pd-cli/dist/services/service-host/workspace-handover.js.map +1 -0
- package/pd-cli/package.json +6 -5
- package/pd-mcp-server/dist/submit-assembly.js +159 -42
- package/pd-mcp-server/dist/version.d.ts +1 -1
- package/pd-mcp-server/dist/version.js +1 -1
- package/pd-mcp-server/package.json +1 -1
- package/plugin/dist/bundle.js +586 -568
- package/plugin/dist/openclaw-worker.d.ts +92 -0
- package/plugin/dist/openclaw-worker.js +2439 -0
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/service/gateway-consumer-lease.d.ts +142 -0
- package/plugin/dist/service/gateway-quiesce-ack.d.ts +40 -0
- package/plugin/dist/service/internalization-auto-consumer-service.d.ts +68 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +5 -1
- package/release-manager/dist/installer.js +77 -30
- package/release-manager/dist/installers/mcp-registration-conflict.js +34 -1
- package/release-manager/dist/installers/workbuddy-host-installer.js +284 -21
- package/release-manager/dist/service-host-bridge.js +292 -0
- package/release-manager/dist/update/install-layout.js +42 -15
- package/release-manager/package.json +2 -2
- package/workbuddy-adapter/dist/index.d.ts +1 -1
- package/workbuddy-adapter/dist/index.js +1 -1
- package/workbuddy-adapter/dist/worker/workspace-worker.d.ts +7 -0
- package/workbuddy-adapter/dist/worker/workspace-worker.js +179 -10
- package/workbuddy-adapter/package.json +1 -1
- package/workbuddy-adapter/plugin/.codebuddy-plugin/plugin.json +2 -2
|
@@ -32,11 +32,62 @@
|
|
|
32
32
|
import fs from 'node:fs';
|
|
33
33
|
import path from 'node:path';
|
|
34
34
|
import { computeFeatureFlagsFromConfig, createRuntimeStateHandle, createPainSignalBridge, isRetryWaitBackoffElapsed, PrincipleTreeLedgerAdapter, resolveDiagnosticianCapability, } from '@principles/core/runtime';
|
|
35
|
-
import { loadPdConfigForPlugin, loadFeatureFlagFromConfig, reconcileGovernanceContinuation, runInternalizationConsumerCycle, runStage2CorrectionCycle, createSignalClassifierForWorkspace, createGovernanceTrajectoryTurnReader, createHostIntentDocReader, isAutomaticPainSubmissionAuthorized, saveHostToolDeclaration, HOST_TOOL_DECLARATION_VERSION, } from '@principles/host-runtime';
|
|
35
|
+
import { loadPdConfigForPlugin, loadFeatureFlagFromConfig, reconcileGovernanceContinuation, runInternalizationConsumerCycle, runStage2CorrectionCycle, createSignalClassifierForWorkspace, createGovernanceTrajectoryTurnReader, createConsentLedgerSourceMaterialAuthorization, createHostIntentDocReader, isAutomaticPainSubmissionAuthorized, saveHostToolDeclaration, HOST_TOOL_DECLARATION_VERSION, } from '@principles/host-runtime';
|
|
36
36
|
import { WORKBUDDY_TOOL_SEMANTICS, WORKBUDDY_TOOL_SEMANTIC_MAPPINGS } from '../tool-semantics.js';
|
|
37
37
|
import { catchUpWorkbuddyIngestion } from '../ingestion/catch-up.js';
|
|
38
38
|
const WORKER_OWNER = 'companion-worker';
|
|
39
39
|
const DEFAULT_DIAG_CANDIDATE_LIMIT = 5;
|
|
40
|
+
// ── Cycle liveness (Phase 2, SPEC §11 / TD §2.3: WorkBuddy had NO liveness
|
|
41
|
+
// record — FR-10 health was undecidable). Same shape and atomic-write
|
|
42
|
+
// discipline as the Codex worker's `.state/codex-worker-liveness.json`
|
|
43
|
+
// (CR-08 §9.3: liveness facts are worker-owned runtime state, never
|
|
44
|
+
// governance truth). ────────────────────────────────────────────────────
|
|
45
|
+
const LIVENESS_FILE = 'workbuddy-worker-liveness.json';
|
|
46
|
+
const LIVENESS_STAGE_DEADLINE_MS = {
|
|
47
|
+
catch_up: 5 * 60_000,
|
|
48
|
+
reconcile: 5 * 60_000,
|
|
49
|
+
diagnosis_execution: 15 * 60_000,
|
|
50
|
+
downstream_cycle: 10 * 60_000,
|
|
51
|
+
};
|
|
52
|
+
function isPlainRecord(value) {
|
|
53
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* WHO drove this cycle — same attribution contract as the Codex worker
|
|
57
|
+
* (PRI-1264 + Phase 2 `service_host` driver identity, TD §5.2).
|
|
58
|
+
*/
|
|
59
|
+
export function workbuddyWorkerCycleDriver() {
|
|
60
|
+
const source = process.env.PD_INVOCATION_SOURCE;
|
|
61
|
+
if (source === 'companion')
|
|
62
|
+
return 'companion';
|
|
63
|
+
if (source === 'service_host')
|
|
64
|
+
return 'service_host';
|
|
65
|
+
return 'manual';
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* F13 (TD §5.2): the coordinator passes a unique invocation id; when
|
|
69
|
+
* present it lands in the liveness record so the shared per-workspace file
|
|
70
|
+
* can be correlated back to the exact Service Host invocation.
|
|
71
|
+
* R5 review fix: a manual/companion cycle carries NO invocation id, so the
|
|
72
|
+
* patch must CLEAR the field — otherwise a completed manual run would keep
|
|
73
|
+
* masquerading under the previous shadow run's id.
|
|
74
|
+
*/
|
|
75
|
+
function invocationIdLivenessPatch() {
|
|
76
|
+
const invocationId = process.env.PD_INVOCATION_ID;
|
|
77
|
+
return typeof invocationId === 'string' && invocationId.length > 0
|
|
78
|
+
? { lastInvocationId: invocationId }
|
|
79
|
+
: { lastInvocationId: null };
|
|
80
|
+
}
|
|
81
|
+
/** Read the persisted liveness record, or null when absent/unreadable. */
|
|
82
|
+
export function readWorkbuddyWorkerLiveness(workspaceDir) {
|
|
83
|
+
try {
|
|
84
|
+
const parsed = JSON.parse(fs.readFileSync(path.join(path.resolve(workspaceDir), '.state', LIVENESS_FILE), 'utf8'));
|
|
85
|
+
return isPlainRecord(parsed) ? parsed : null;
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
40
91
|
function workerLogger(logger) {
|
|
41
92
|
return logger ?? {
|
|
42
93
|
info: () => undefined,
|
|
@@ -52,6 +103,59 @@ function directoryExists(dir) {
|
|
|
52
103
|
return false;
|
|
53
104
|
}
|
|
54
105
|
}
|
|
106
|
+
function writeLiveness(workspaceDir, patch) {
|
|
107
|
+
try {
|
|
108
|
+
const root = path.resolve(workspaceDir);
|
|
109
|
+
const stateDir = path.join(root, '.state');
|
|
110
|
+
const file = path.join(stateDir, LIVENESS_FILE);
|
|
111
|
+
if (!file.startsWith(root + path.sep))
|
|
112
|
+
return;
|
|
113
|
+
if (!directoryExists(stateDir))
|
|
114
|
+
fs.mkdirSync(stateDir, { recursive: true });
|
|
115
|
+
let current = {};
|
|
116
|
+
try {
|
|
117
|
+
const parsed = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
118
|
+
if (isPlainRecord(parsed))
|
|
119
|
+
current = parsed;
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
current = {};
|
|
123
|
+
}
|
|
124
|
+
const merged = { ...current, ...patch, updatedAt: new Date().toISOString() };
|
|
125
|
+
// Exclusive random temp + rename (same CodeQL-safe pattern as Codex).
|
|
126
|
+
const tmp = path.join(stateDir, `${LIVENESS_FILE}.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2, 10)}.tmp`);
|
|
127
|
+
const fd = fs.openSync(tmp, fs.constants.O_WRONLY | fs.constants.O_CREAT | fs.constants.O_EXCL, 0o600);
|
|
128
|
+
try {
|
|
129
|
+
fs.writeFileSync(fd, JSON.stringify(merged));
|
|
130
|
+
}
|
|
131
|
+
finally {
|
|
132
|
+
fs.closeSync(fd);
|
|
133
|
+
}
|
|
134
|
+
fs.renameSync(tmp, file);
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
// Liveness bookkeeping must never break the cycle (rc-9: the cycle
|
|
138
|
+
// report remains the observable degradation channel).
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* F9 review fix: settle the liveness record for EARLY returns (consumer
|
|
143
|
+
* pause, structured degradations). A cycle that stops after the `catch_up`
|
|
144
|
+
* stage write must not leave a stale runningStage + deadline behind —
|
|
145
|
+
* liveness readers would report the finished cycle as still mid-stage.
|
|
146
|
+
*/
|
|
147
|
+
function finalizeLiveness(workspaceDir, cycleStartedAt, settlement) {
|
|
148
|
+
writeLiveness(workspaceDir, {
|
|
149
|
+
runningStage: null,
|
|
150
|
+
stageDeadline: null,
|
|
151
|
+
lastCycleCompletedAt: new Date().toISOString(),
|
|
152
|
+
lastCycleDurationMs: Date.now() - cycleStartedAt.getTime(),
|
|
153
|
+
lastCycleMode: settlement.mode,
|
|
154
|
+
lastCycleDriver: workbuddyWorkerCycleDriver(),
|
|
155
|
+
...(settlement.reason !== undefined ? { lastDegradedReason: settlement.reason } : {}),
|
|
156
|
+
...invocationIdLivenessPatch(),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
55
159
|
/**
|
|
56
160
|
* Oldest pending diagnostician first; retry_wait candidates are filtered to
|
|
57
161
|
* those whose backoff window has ELAPSED (same discipline as the Codex
|
|
@@ -80,6 +184,7 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
|
|
|
80
184
|
const logger = workerLogger(options.logger);
|
|
81
185
|
const emitEvent = options.emitEvent ?? ((_event, _payload) => undefined);
|
|
82
186
|
const base = { workspaceDir };
|
|
187
|
+
const cycleStartedAt = new Date();
|
|
83
188
|
// Step 1 — Workspace eligibility.
|
|
84
189
|
if (!directoryExists(workspaceDir)) {
|
|
85
190
|
return { ...base, mode: 'degraded', reason: 'workspace_missing', nextAction: 'The governance workspace directory no longer exists; run the WorkBuddy setup flow to re-initialize it. No PD state was mutated.' };
|
|
@@ -91,9 +196,25 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
|
|
|
91
196
|
}
|
|
92
197
|
const { flags } = computeFeatureFlagsFromConfig(config.effective);
|
|
93
198
|
if (flags['host.workbuddy']?.enabled !== true) {
|
|
199
|
+
// Same PRI-1264 discipline as Codex: an intentional CONFIG pause keeps
|
|
200
|
+
// the heartbeat alive — the worker IS cycling, deliberately idle.
|
|
201
|
+
writeLiveness(workspaceDir, {
|
|
202
|
+
runningStage: 'paused',
|
|
203
|
+
stageDeadline: null,
|
|
204
|
+
lastCycleStartedAt: cycleStartedAt.toISOString(),
|
|
205
|
+
lastCycleDriver: workbuddyWorkerCycleDriver(),
|
|
206
|
+
});
|
|
94
207
|
// PRI-1063 (review fix): single-line flow mapping — see pd-hook.ts.
|
|
95
208
|
return { ...base, mode: 'paused', reason: 'host.workbuddy_disabled', nextAction: 'Enable WorkBuddy PD behavior in the governance workspace .pd/config.yaml — in the existing "features:" block set host.workbuddy: {enabled: true} (one flat key, not nested).' };
|
|
96
209
|
}
|
|
210
|
+
// Liveness bookkeeping starts only after eligibility (CR-08 ordering —
|
|
211
|
+
// writing into a missing workspace directory would fabricate it).
|
|
212
|
+
writeLiveness(workspaceDir, {
|
|
213
|
+
lastCycleStartedAt: cycleStartedAt.toISOString(),
|
|
214
|
+
runningStage: 'catch_up',
|
|
215
|
+
stageDeadline: new Date(cycleStartedAt.getTime() + LIVENESS_STAGE_DEADLINE_MS.catch_up).toISOString(),
|
|
216
|
+
lastCycleDriver: workbuddyWorkerCycleDriver(),
|
|
217
|
+
});
|
|
97
218
|
const consumerFlag = loadFeatureFlagFromConfig(workspaceDir, 'internalization_auto_consumer', { info: (m) => logger.info(m), warn: (m) => logger.warn(m) });
|
|
98
219
|
// The Diagnostician capability gate resolves from the same canonical
|
|
99
220
|
// authority as the runtime factory. An Owner-disabled agent is an
|
|
@@ -133,17 +254,46 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
|
|
|
133
254
|
};
|
|
134
255
|
}
|
|
135
256
|
else if (!consumerFlag.enabled) {
|
|
257
|
+
// F9: the cycle ENDED here (paused) — settle the liveness record so the
|
|
258
|
+
// in-flight `catch_up` stage and its deadline do not survive it.
|
|
259
|
+
// P2-01 (final-remediation review): EVERY earlier stage's failure must
|
|
260
|
+
// reach the result — not catch-up only. A reconcile failure under a
|
|
261
|
+
// consumer pause is a degraded cycle, never a clean paused + exit 0.
|
|
262
|
+
const prePauseDegradations = [];
|
|
263
|
+
if (catchUp.status === 'degraded') {
|
|
264
|
+
prePauseDegradations.push(`catch_up:${catchUp.reason ?? 'degraded'}`);
|
|
265
|
+
}
|
|
266
|
+
if (!reconcile.ok) {
|
|
267
|
+
prePauseDegradations.push(`reconcile:${reconcile.reason ?? 'failed'}`);
|
|
268
|
+
}
|
|
269
|
+
for (const d of reconcile.degradations) {
|
|
270
|
+
const tagged = `reconcile:${d}`;
|
|
271
|
+
if (!prePauseDegradations.includes(tagged))
|
|
272
|
+
prePauseDegradations.push(tagged);
|
|
273
|
+
}
|
|
274
|
+
if (prePauseDegradations.length > 0) {
|
|
275
|
+
const reason = `paused_stage_failures:${prePauseDegradations.join('|').slice(0, 160)}`;
|
|
276
|
+
finalizeLiveness(workspaceDir, cycleStartedAt, { mode: 'degraded', reason });
|
|
277
|
+
return {
|
|
278
|
+
...base,
|
|
279
|
+
mode: 'degraded',
|
|
280
|
+
reason,
|
|
281
|
+
// Keep the REAL failing stage's recovery guidance ahead of the
|
|
282
|
+
// generic pause hint (P2-01 §C: catchUp.nextAction must not be
|
|
283
|
+
// overwritten by a generic paused suggestion).
|
|
284
|
+
nextAction: catchUp.status === 'degraded' && catchUp.nextAction !== undefined
|
|
285
|
+
? catchUp.nextAction
|
|
286
|
+
: (reconcile.nextAction ?? 'Inspect the governance workspace trajectory store and transcript consent; the worker retries automatically on the next cycle.'),
|
|
287
|
+
degradations: prePauseDegradations,
|
|
288
|
+
report: { catchUp, reconcile, diagnostician: null, downstream: null },
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
finalizeLiveness(workspaceDir, cycleStartedAt, { mode: 'paused' });
|
|
136
292
|
return {
|
|
137
293
|
...base,
|
|
138
294
|
mode: 'paused',
|
|
139
295
|
reason: 'internalization_auto_consumer_disabled',
|
|
140
296
|
nextAction: 'Automatic internalization execution is paused for this governance workspace; manual commands remain available: pd diagnose, pd runtime internalization run-once.',
|
|
141
|
-
// Catch-up ran BEFORE this early return. Keeping its degradation on the
|
|
142
|
-
// paused result means `pd workbuddy worker --once` can still report a
|
|
143
|
-
// broken transcript catch-up instead of exiting as a clean pause.
|
|
144
|
-
...(catchUp.status === 'degraded'
|
|
145
|
-
? { degradations: [`catch_up:${catchUp.reason ?? 'degraded'}`] }
|
|
146
|
-
: {}),
|
|
147
297
|
report: { catchUp, reconcile, diagnostician: null, downstream: null },
|
|
148
298
|
};
|
|
149
299
|
}
|
|
@@ -171,7 +321,9 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
|
|
|
171
321
|
intentDocReader: createHostIntentDocReader({ workspaceDir, effectiveConfig: config.effective }),
|
|
172
322
|
// PRI-1265: the worker's Stage A gets the bound session's ORIGINAL
|
|
173
323
|
// turns from the workspace's own consent-tiered governance store.
|
|
174
|
-
trajectoryTurnReader: createGovernanceTrajectoryTurnReader({ workspaceDir }),
|
|
324
|
+
trajectoryTurnReader: createGovernanceTrajectoryTurnReader({ workspaceDir, sourceMaterialAuthorization: createConsentLedgerSourceMaterialAuthorization(workspaceDir) }),
|
|
325
|
+
// PRI-1283 R2: latest-consent gate consulted per assembly / model call.
|
|
326
|
+
sourceMaterialAuthorization: createConsentLedgerSourceMaterialAuthorization(workspaceDir),
|
|
175
327
|
// SPEC §9.6: lazy probe — a revoked flag stops persisted
|
|
176
328
|
// automatic_hook tasks at the bridge's execution boundary.
|
|
177
329
|
isAutoPainSubmissionAuthorized: () => isAutomaticPainSubmissionAuthorized(workspaceDir),
|
|
@@ -198,10 +350,13 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
|
|
|
198
350
|
}
|
|
199
351
|
catch (error) {
|
|
200
352
|
const detail = error instanceof Error ? error.message.slice(0, 200) : String(error).slice(0, 200);
|
|
353
|
+
const reason = `diagnostician_execution_failed:${detail}`;
|
|
354
|
+
// F9: settle the liveness record on the degraded early return.
|
|
355
|
+
finalizeLiveness(workspaceDir, cycleStartedAt, { mode: 'degraded', reason });
|
|
201
356
|
return {
|
|
202
357
|
...base,
|
|
203
358
|
mode: 'degraded',
|
|
204
|
-
reason
|
|
359
|
+
reason,
|
|
205
360
|
nextAction: 'Inspect the governance workspace runtime profile and provider configuration; the task keeps its pending/retry state and no evidence was mutated.',
|
|
206
361
|
report: { catchUp, reconcile, diagnostician: null, downstream: null },
|
|
207
362
|
};
|
|
@@ -218,14 +373,18 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
|
|
|
218
373
|
});
|
|
219
374
|
if (!declared.ok) {
|
|
220
375
|
logger.warn?.(`[PD:WorkbuddyWorker] Failed to persist WorkBuddy tool declaration: ${declared.reason} — host-neutral consumers will not find it (rc-9)`);
|
|
376
|
+
const reason = `host_tool_declaration_persist_failed:${declared.reason}`;
|
|
377
|
+
// F9: settle the liveness record on the degraded early return.
|
|
378
|
+
finalizeLiveness(workspaceDir, cycleStartedAt, { mode: 'degraded', reason });
|
|
221
379
|
return {
|
|
222
380
|
...base,
|
|
223
381
|
mode: 'degraded',
|
|
224
|
-
reason
|
|
382
|
+
reason,
|
|
225
383
|
nextAction: 'Repair WorkBuddy host declaration persistence (.pd/host-tool-semantics/workbuddy.json) before running the downstream internalization cycle; the worker retries automatically on the next cycle.',
|
|
226
384
|
report: { catchUp, reconcile, diagnostician, downstream: null },
|
|
227
385
|
};
|
|
228
386
|
}
|
|
387
|
+
writeLiveness(workspaceDir, { runningStage: 'downstream_cycle', stageDeadline: new Date(Date.now() + LIVENESS_STAGE_DEADLINE_MS.downstream_cycle).toISOString() });
|
|
229
388
|
const downstream = await runInternalizationConsumerCycle(workspaceDir, {
|
|
230
389
|
owner: WORKER_OWNER,
|
|
231
390
|
logLabel: 'WorkbuddyWorker',
|
|
@@ -261,6 +420,16 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
|
|
|
261
420
|
: downstream.skipReason === 'runtime_config_error' || downstream.skipReason === 'cycle_error' || downstream.skipReason === 'config_malformed' ? `downstream:${downstream.skipReason}`
|
|
262
421
|
: !stage2.ok ? `stage2:${stage2.reason ?? 'failed'}`
|
|
263
422
|
: undefined;
|
|
423
|
+
writeLiveness(workspaceDir, {
|
|
424
|
+
runningStage: null,
|
|
425
|
+
stageDeadline: null,
|
|
426
|
+
lastCycleCompletedAt: new Date().toISOString(),
|
|
427
|
+
lastCycleDurationMs: Date.now() - cycleStartedAt.getTime(),
|
|
428
|
+
lastCycleMode: degradedReason !== undefined ? 'degraded' : 'ready',
|
|
429
|
+
lastCycleDriver: workbuddyWorkerCycleDriver(),
|
|
430
|
+
...(degradedReason !== undefined ? { lastDegradedReason: degradedReason } : {}),
|
|
431
|
+
...invocationIdLivenessPatch(),
|
|
432
|
+
});
|
|
264
433
|
return {
|
|
265
434
|
...base,
|
|
266
435
|
mode: degradedReason !== undefined ? 'degraded' : 'ready',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principles/workbuddy-adapter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "WorkBuddy host adapter for Principles Disciple — implements the HostAdapter interface for WorkBuddy's Git Bash command-hook model (ADR-0020 third host, SPEC workbuddy-host-adapter v0.3.0).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "principles-disciple",
|
|
3
3
|
"version": "0.2.2",
|
|
4
|
-
"description": "Principles Disciple — Owner-governed behavior internalization for AI agents (WorkBuddy host adapter, ADR-0020 third host). Three independent states: (1) the PD installer registers this plugin and records enablement in settings.json (enabledPlugins[key]) — an existing Owner true/false choice
|
|
5
|
-
"defaultEnabled":
|
|
4
|
+
"description": "Principles Disciple — Owner-governed behavior internalization for AI agents (WorkBuddy host adapter, ADR-0020 third host). Three independent states: (1) the PD installer registers this plugin and records enablement in settings.json (enabledPlugins[key]) — an existing Owner true/false choice always wins, otherwise the manifest defaultEnabled=true applies, so a fresh install is ENABLED out of the box and both its hooks and the bundled pd-recall MCP server load on the next session (the Owner can still disable it at any time); (2) governance is ON by default at install (features.host.workbuddy.enabled=true) and an explicit false opt-out is preserved; (3) automatic pain detection/correction is NOT available in WorkBuddy — record pain only with the explicit \"PD记录痛苦:\" prefix. Ships the read-only pd-recall MCP server (Gate 4).",
|
|
5
|
+
"defaultEnabled": true
|
|
6
6
|
}
|