create-principles-disciple 1.150.3 → 1.150.6
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 +1 -1
- package/codex-adapter/dist/ingestion/admission.js +2 -0
- package/codex-adapter/dist/ingestion/ingestion.js +25 -4
- package/codex-adapter/dist/ingestion/transcript-decoder.d.ts +5 -3
- package/codex-adapter/dist/ingestion/transcript-decoder.js +61 -5
- package/codex-adapter/dist/pd-hook.d.ts +7 -5
- package/codex-adapter/dist/pd-hook.js +18 -7
- package/codex-adapter/dist/tool-semantics.js +5 -1
- package/codex-adapter/dist/worker/workspace-worker.js +4 -2
- package/codex-adapter/package.json +1 -1
- package/console/dist/lib/utils.js +16 -1
- package/console/dist/server/index.js +14 -2
- package/console/dist/server/models/ActivationsConsoleModel.js +3 -2
- package/console/dist/server/models/ApprovalsConsoleModel.js +2 -1
- package/console/dist/server/models/ApprovalsGroupedConsoleModel.js +2 -1
- package/console/dist/server/models/EvidenceChainConsoleModel.d.ts +46 -0
- package/console/dist/server/models/EvidenceChainConsoleModel.js +121 -2
- package/console/dist/server/models/GovernanceConsoleModel.js +3 -2
- package/console/dist/server/models/GovernanceExperienceCollector.js +2 -1
- package/console/dist/server/models/GovernanceProjectionCollector.js +2 -1
- package/console/dist/server/models/IngestionHealthModel.d.ts +34 -0
- package/console/dist/server/models/IngestionHealthModel.js +254 -0
- package/console/dist/server/models/IntentDecisionModel.js +2 -2
- package/console/dist/server/models/IntentPageModel.js +2 -1
- package/console/dist/server/models/OwnerDecisionConsoleModel.js +3 -3
- package/console/dist/server/models/OwnerDecisionViewModel.js +2 -2
- package/console/dist/server/models/PrincipleTrajectoryModel.js +2 -1
- package/console/dist/server/models/ReceiptsConsoleModel.js +2 -2
- package/console/dist/server/models/RuleCandidateBindingConsoleModel.js +3 -2
- package/console/dist/server/routes/diagnostician.js +2 -1
- package/console/dist/server/routes/evidence-chain.d.ts +4 -0
- package/console/dist/server/routes/evidence-chain.js +22 -0
- package/console/dist/server/routes/failed-tasks.js +78 -2
- package/console/dist/server/routes/health.d.ts +8 -0
- package/console/dist/server/routes/health.js +72 -0
- package/console/dist/server/routes/owner-identity.d.ts +6 -0
- package/console/dist/server/routes/owner-identity.js +7 -3
- package/console/dist/server/routes/principles.js +3 -3
- package/console/dist/web/assets/app.css +150 -46
- package/console/dist/web/assets/app.js +37 -32
- package/console/package.json +2 -0
- package/core/dist/runtime/activation/adaptive-selection-output.d.ts +0 -21
- package/core/dist/runtime/activation/adaptive-selection-output.d.ts.map +1 -1
- package/core/dist/runtime/activation/adaptive-selection-output.js.map +1 -1
- package/core/dist/runtime/activation/index.d.ts +2 -6
- package/core/dist/runtime/activation/index.d.ts.map +1 -1
- package/core/dist/runtime/activation/index.js.map +1 -1
- package/core/dist/runtime/activation/production-gate-deps.d.ts +2 -1
- package/core/dist/runtime/activation/production-gate-deps.d.ts.map +1 -1
- package/core/dist/runtime/activation/prompt-activation-reader-contract.d.ts +2 -1
- package/core/dist/runtime/activation/prompt-activation-reader-contract.d.ts.map +1 -1
- package/core/dist/runtime/activation/writers/index.d.ts +0 -1
- package/core/dist/runtime/activation/writers/index.d.ts.map +1 -1
- package/core/dist/runtime/activation/writers/rule-host-writer.d.ts.map +1 -1
- package/core/dist/runtime/activation/writers/rule-host-writer.js +15 -6
- package/core/dist/runtime/activation/writers/rule-host-writer.js.map +1 -1
- package/core/dist/runtime/activation-compatibility-read-model.d.ts +3 -2
- package/core/dist/runtime/activation-compatibility-read-model.d.ts.map +1 -1
- package/core/dist/runtime/activation-compatibility-read-model.js +2 -1
- package/core/dist/runtime/activation-compatibility-read-model.js.map +1 -1
- package/core/dist/runtime/adapter/context-budget.d.ts +3 -14
- package/core/dist/runtime/adapter/context-budget.d.ts.map +1 -1
- package/core/dist/runtime/adapter/context-budget.js +2 -2
- package/core/dist/runtime/adapter/context-budget.js.map +1 -1
- package/core/dist/runtime/adapter/index.d.ts +1 -2
- package/core/dist/runtime/adapter/index.d.ts.map +1 -1
- package/core/dist/runtime/adapter/index.js +1 -1
- package/core/dist/runtime/adapter/index.js.map +1 -1
- package/core/dist/runtime/adapter/output-repair-contract.d.ts +18 -1
- package/core/dist/runtime/adapter/output-repair-contract.d.ts.map +1 -1
- package/core/dist/runtime/adapter/output-repair-contract.js +94 -0
- package/core/dist/runtime/adapter/output-repair-contract.js.map +1 -1
- package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts +2 -3
- package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
- package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js +111 -21
- package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js.map +1 -1
- package/core/dist/runtime/adapter/principle-tree-ledger-adapter.d.ts +1 -1
- package/core/dist/runtime/adapter/principle-tree-ledger-adapter.d.ts.map +1 -1
- package/core/dist/runtime/adapter/schema-prompt-adapter.d.ts +0 -1
- package/core/dist/runtime/adapter/schema-prompt-adapter.d.ts.map +1 -1
- package/core/dist/runtime/adapter/schema-prompt-adapter.js +43 -1
- package/core/dist/runtime/adapter/schema-prompt-adapter.js.map +1 -1
- package/core/dist/runtime/bridge-result-shaper.d.ts +1 -1
- package/core/dist/runtime/bridge-result-shaper.d.ts.map +1 -1
- package/core/dist/runtime/candidate-audit.d.ts.map +1 -1
- package/core/dist/runtime/candidate-audit.js +2 -1
- package/core/dist/runtime/candidate-audit.js.map +1 -1
- package/core/dist/runtime/candidate-intake-service.d.ts +2 -1
- package/core/dist/runtime/candidate-intake-service.d.ts.map +1 -1
- package/core/dist/runtime/cli/diagnose.d.ts +4 -3
- package/core/dist/runtime/cli/diagnose.d.ts.map +1 -1
- package/core/dist/runtime/config/index.d.ts +2 -2
- package/core/dist/runtime/config/index.d.ts.map +1 -1
- package/core/dist/runtime/config/index.js +3 -3
- package/core/dist/runtime/config/index.js.map +1 -1
- package/core/dist/runtime/config/pd-config-defaults.d.ts +0 -2
- package/core/dist/runtime/config/pd-config-defaults.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-defaults.js +2 -2
- package/core/dist/runtime/config/pd-config-defaults.js.map +1 -1
- package/core/dist/runtime/config/pd-config-effective.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-effective.js +2 -0
- package/core/dist/runtime/config/pd-config-effective.js.map +1 -1
- package/core/dist/runtime/config/pd-config-types.d.ts +54 -0
- package/core/dist/runtime/config/pd-config-types.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-types.js.map +1 -1
- package/core/dist/runtime/config/pd-config-validate.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-validate.js +143 -0
- package/core/dist/runtime/config/pd-config-validate.js.map +1 -1
- package/core/dist/runtime/config/pd-profile-constants.d.ts +1 -7
- package/core/dist/runtime/config/pd-profile-constants.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-profile-constants.js +5 -6
- package/core/dist/runtime/config/pd-profile-constants.js.map +1 -1
- package/core/dist/runtime/config/pd-validate-profile.d.ts +3 -2
- package/core/dist/runtime/config/pd-validate-profile.d.ts.map +1 -1
- package/core/dist/runtime/context-payload.d.ts +0 -7
- package/core/dist/runtime/context-payload.d.ts.map +1 -1
- package/core/dist/runtime/context-payload.js +1 -1
- package/core/dist/runtime/context-payload.js.map +1 -1
- package/core/dist/runtime/core-principles/index.d.ts +1 -1
- package/core/dist/runtime/core-principles/index.d.ts.map +1 -1
- package/core/dist/runtime/correction/correction-types.d.ts +0 -10
- package/core/dist/runtime/correction/correction-types.d.ts.map +1 -1
- package/core/dist/runtime/correction/correction-types.js.map +1 -1
- package/core/dist/runtime/diagnostician/diag-distiller-output.d.ts +0 -3
- package/core/dist/runtime/diagnostician/diag-distiller-output.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/diag-distiller-output.js +1 -1
- package/core/dist/runtime/diagnostician/diag-distiller-output.js.map +1 -1
- package/core/dist/runtime/diagnostician/diag-rootcause-output.d.ts +3 -11
- package/core/dist/runtime/diagnostician/diag-rootcause-output.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/diag-rootcause-output.js +3 -3
- package/core/dist/runtime/diagnostician/diag-rootcause-output.js.map +1 -1
- package/core/dist/runtime/diagnostician/distiller-prompt-builder.d.ts +5 -4
- package/core/dist/runtime/diagnostician/distiller-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/evidence-ref-binding.d.ts +2 -1
- package/core/dist/runtime/diagnostician/evidence-ref-binding.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.d.ts +2 -1
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/router-prompt-builder.d.ts +22 -3
- package/core/dist/runtime/diagnostician/router-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/router-prompt-builder.js +11 -1
- package/core/dist/runtime/diagnostician/router-prompt-builder.js.map +1 -1
- package/core/dist/runtime/diagnostician-association-shadow.d.ts +2 -2
- package/core/dist/runtime/diagnostician-association-shadow.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician-association-validation.d.ts +3 -2
- package/core/dist/runtime/diagnostician-association-validation.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician-output.d.ts +32 -5
- package/core/dist/runtime/diagnostician-output.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician-output.js +47 -4
- package/core/dist/runtime/diagnostician-output.js.map +1 -1
- package/core/dist/runtime/diagnostician-prompt-builder.d.ts +2 -1
- package/core/dist/runtime/diagnostician-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/error-categories.d.ts.map +1 -1
- package/core/dist/runtime/error-categories.js +10 -1
- package/core/dist/runtime/error-categories.js.map +1 -1
- package/core/dist/runtime/evidence-sanitizer.d.ts +8 -1
- package/core/dist/runtime/evidence-sanitizer.d.ts.map +1 -1
- package/core/dist/runtime/evidence-sanitizer.js +10 -3
- package/core/dist/runtime/evidence-sanitizer.js.map +1 -1
- package/core/dist/runtime/evolution/evolution-types.d.ts +0 -26
- package/core/dist/runtime/evolution/evolution-types.d.ts.map +1 -1
- package/core/dist/runtime/evolution/evolution-types.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 +8 -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 +24 -0
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js.map +1 -1
- package/core/dist/runtime/feature-flags/index.d.ts +0 -1
- package/core/dist/runtime/feature-flags/index.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/index.js.map +1 -1
- package/core/dist/runtime/golden-trace.d.ts +9 -1
- package/core/dist/runtime/golden-trace.d.ts.map +1 -1
- package/core/dist/runtime/golden-trace.js +7 -0
- package/core/dist/runtime/golden-trace.js.map +1 -1
- package/core/dist/runtime/governance-projection-contract.d.ts +0 -6
- package/core/dist/runtime/governance-projection-contract.d.ts.map +1 -1
- package/core/dist/runtime/governance-projection-contract.js +3 -3
- package/core/dist/runtime/governance-projection-contract.js.map +1 -1
- package/core/dist/runtime/index.d.ts +2 -0
- package/core/dist/runtime/index.d.ts.map +1 -1
- package/core/dist/runtime/index.js +2 -0
- package/core/dist/runtime/index.js.map +1 -1
- package/core/dist/runtime/internalization/artifact-summary.d.ts +5 -4
- package/core/dist/runtime/internalization/artifact-summary.d.ts.map +1 -1
- package/core/dist/runtime/internalization/artifact-summary.js +1 -1
- package/core/dist/runtime/internalization/artifact-summary.js.map +1 -1
- package/core/dist/runtime/internalization/artificer-intent-preflight.d.ts +1 -1
- package/core/dist/runtime/internalization/artificer-intent-preflight.d.ts.map +1 -1
- package/core/dist/runtime/internalization/artificer-output.d.ts +0 -2
- package/core/dist/runtime/internalization/artificer-output.d.ts.map +1 -1
- package/core/dist/runtime/internalization/artificer-output.js +17 -0
- package/core/dist/runtime/internalization/artificer-output.js.map +1 -1
- package/core/dist/runtime/internalization/artificer-prompt-builder.d.ts +14 -3
- package/core/dist/runtime/internalization/artificer-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/artificer-prompt-builder.js +13 -1
- package/core/dist/runtime/internalization/artificer-prompt-builder.js.map +1 -1
- package/core/dist/runtime/internalization/artificer-run-correlation.d.ts +3 -2
- package/core/dist/runtime/internalization/artificer-run-correlation.d.ts.map +1 -1
- package/core/dist/runtime/internalization/consumer-evidence-preflight.d.ts +2 -1
- package/core/dist/runtime/internalization/consumer-evidence-preflight.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-distiller-runner.d.ts +1 -1
- package/core/dist/runtime/internalization/diag-distiller-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-router-runner.d.ts +11 -1
- package/core/dist/runtime/internalization/diag-router-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-router-runner.js +105 -1
- package/core/dist/runtime/internalization/diag-router-runner.js.map +1 -1
- package/core/dist/runtime/internalization/dreamer-output.d.ts +0 -9
- package/core/dist/runtime/internalization/dreamer-output.d.ts.map +1 -1
- package/core/dist/runtime/internalization/dreamer-output.js +1 -1
- package/core/dist/runtime/internalization/dreamer-output.js.map +1 -1
- package/core/dist/runtime/internalization/dreamer-prompt-builder.d.ts +3 -2
- package/core/dist/runtime/internalization/dreamer-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/dreamer-runner.d.ts +1 -1
- package/core/dist/runtime/internalization/dreamer-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/evaluator-output.d.ts +7 -17
- package/core/dist/runtime/internalization/evaluator-output.d.ts.map +1 -1
- package/core/dist/runtime/internalization/evaluator-output.js +2 -2
- package/core/dist/runtime/internalization/evaluator-output.js.map +1 -1
- package/core/dist/runtime/internalization/evaluator-prompt-builder.d.ts +3 -9
- package/core/dist/runtime/internalization/evaluator-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/evaluator-prompt-builder.js +1 -1
- package/core/dist/runtime/internalization/evaluator-prompt-builder.js.map +1 -1
- package/core/dist/runtime/internalization/formation-context.d.ts +4 -6
- package/core/dist/runtime/internalization/formation-context.d.ts.map +1 -1
- package/core/dist/runtime/internalization/formation-context.js +3 -3
- package/core/dist/runtime/internalization/formation-context.js.map +1 -1
- package/core/dist/runtime/internalization/index.d.ts +2 -4
- package/core/dist/runtime/internalization/index.d.ts.map +1 -1
- package/core/dist/runtime/internalization/index.js +8 -1
- package/core/dist/runtime/internalization/index.js.map +1 -1
- package/core/dist/runtime/internalization/intake-to-internalization-bridge.d.ts +2 -1
- package/core/dist/runtime/internalization/intake-to-internalization-bridge.d.ts.map +1 -1
- package/core/dist/runtime/internalization/intent-contract.d.ts +2 -1
- package/core/dist/runtime/internalization/intent-contract.d.ts.map +1 -1
- package/core/dist/runtime/internalization/internalization-job-graph.d.ts +1 -1
- package/core/dist/runtime/internalization/internalization-job-graph.d.ts.map +1 -1
- package/core/dist/runtime/internalization/internalization-route.d.ts +2 -1
- package/core/dist/runtime/internalization/internalization-route.d.ts.map +1 -1
- package/core/dist/runtime/internalization/owner-decision-review.d.ts +3 -2
- package/core/dist/runtime/internalization/owner-decision-review.d.ts.map +1 -1
- package/core/dist/runtime/internalization/owner-resolution-service.d.ts +2 -1
- package/core/dist/runtime/internalization/owner-resolution-service.d.ts.map +1 -1
- package/core/dist/runtime/internalization/owner-retry.d.ts +2 -1
- package/core/dist/runtime/internalization/owner-retry.d.ts.map +1 -1
- package/core/dist/runtime/internalization/owner-review.d.ts +2 -21
- package/core/dist/runtime/internalization/owner-review.d.ts.map +1 -1
- package/core/dist/runtime/internalization/owner-review.js +2 -2
- package/core/dist/runtime/internalization/owner-review.js.map +1 -1
- package/core/dist/runtime/internalization/peer-runner-contracts.d.ts +2 -5
- package/core/dist/runtime/internalization/peer-runner-contracts.d.ts.map +1 -1
- package/core/dist/runtime/internalization/peer-runner-contracts.js +1 -1
- package/core/dist/runtime/internalization/peer-runner-contracts.js.map +1 -1
- package/core/dist/runtime/internalization/philosopher-output.d.ts +0 -8
- package/core/dist/runtime/internalization/philosopher-output.d.ts.map +1 -1
- package/core/dist/runtime/internalization/philosopher-output.js +1 -1
- package/core/dist/runtime/internalization/philosopher-output.js.map +1 -1
- package/core/dist/runtime/internalization/philosopher-prompt-builder.d.ts +3 -2
- package/core/dist/runtime/internalization/philosopher-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/pitask-metadata.d.ts +1 -1
- package/core/dist/runtime/internalization/pitask-metadata.d.ts.map +1 -1
- package/core/dist/runtime/internalization/repair-replay-resolver.d.ts +4 -3
- package/core/dist/runtime/internalization/repair-replay-resolver.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-output.d.ts +2 -3
- package/core/dist/runtime/internalization/rollout-reviewer-output.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-output.js.map +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-prompt-builder.d.ts +0 -1
- package/core/dist/runtime/internalization/rollout-reviewer-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-prompt-builder.js +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-prompt-builder.js.map +1 -1
- package/core/dist/runtime/internalization/router-context-reconstruction.d.ts +3 -3
- package/core/dist/runtime/internalization/router-context-reconstruction.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rule-activation-contract.d.ts +3 -2
- package/core/dist/runtime/internalization/rule-activation-contract.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rule-host-input-builder.d.ts +16 -0
- package/core/dist/runtime/internalization/rule-host-input-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rule-host-input-builder.js +18 -0
- package/core/dist/runtime/internalization/rule-host-input-builder.js.map +1 -1
- package/core/dist/runtime/internalization/rule-reliability-validation.d.ts +13 -18
- package/core/dist/runtime/internalization/rule-reliability-validation.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rule-reliability-validation.js +43 -1
- package/core/dist/runtime/internalization/rule-reliability-validation.js.map +1 -1
- package/core/dist/runtime/internalization/scribe-output.d.ts +2 -15
- package/core/dist/runtime/internalization/scribe-output.d.ts.map +1 -1
- package/core/dist/runtime/internalization/scribe-output.js +2 -2
- package/core/dist/runtime/internalization/scribe-output.js.map +1 -1
- package/core/dist/runtime/internalization/scribe-prompt-builder.d.ts +3 -3
- package/core/dist/runtime/internalization/scribe-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/scribe-prompt-builder.js +0 -1
- package/core/dist/runtime/internalization/scribe-prompt-builder.js.map +1 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts +25 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.js +122 -5
- package/core/dist/runtime/internalization/split-diagnostician-runner.js.map +1 -1
- package/core/dist/runtime/internalization/textual-basis-anchor.d.ts +3 -6
- package/core/dist/runtime/internalization/textual-basis-anchor.d.ts.map +1 -1
- package/core/dist/runtime/internalization/textual-basis-anchor.js +2 -2
- package/core/dist/runtime/internalization/textual-basis-anchor.js.map +1 -1
- package/core/dist/runtime/internalization/tool-semantic-registry.d.ts +26 -0
- package/core/dist/runtime/internalization/tool-semantic-registry.d.ts.map +1 -1
- package/core/dist/runtime/internalization/tool-semantic-registry.js +55 -5
- package/core/dist/runtime/internalization/tool-semantic-registry.js.map +1 -1
- package/core/dist/runtime/internalization-chain-integrity-read-model.d.ts.map +1 -1
- package/core/dist/runtime/internalization-chain-integrity-read-model.js +2 -2
- package/core/dist/runtime/internalization-chain-integrity-read-model.js.map +1 -1
- package/core/dist/runtime/internalization-integrity-remediation.d.ts.map +1 -1
- package/core/dist/runtime/internalization-integrity-remediation.js +2 -2
- package/core/dist/runtime/internalization-integrity-remediation.js.map +1 -1
- package/core/dist/runtime/language-directive.d.ts +2 -1
- package/core/dist/runtime/language-directive.d.ts.map +1 -1
- package/core/dist/runtime/operator-health-read-model.d.ts.map +1 -1
- package/core/dist/runtime/operator-health-read-model.js +2 -2
- package/core/dist/runtime/operator-health-read-model.js.map +1 -1
- package/core/dist/runtime/owner-decision/owner-decision-view-contract.d.ts +3 -29
- package/core/dist/runtime/owner-decision/owner-decision-view-contract.d.ts.map +1 -1
- package/core/dist/runtime/owner-decision/owner-decision-view-contract.js +4 -5
- package/core/dist/runtime/owner-decision/owner-decision-view-contract.js.map +1 -1
- package/core/dist/runtime/owner-decision/owner-decision-view.d.ts +0 -49
- package/core/dist/runtime/owner-decision/owner-decision-view.d.ts.map +1 -1
- package/core/dist/runtime/owner-decision/owner-decision-view.js +5 -5
- package/core/dist/runtime/owner-decision/owner-decision-view.js.map +1 -1
- package/core/dist/runtime/owner-decision/semantic-selector.d.ts +3 -2
- package/core/dist/runtime/owner-decision/semantic-selector.d.ts.map +1 -1
- package/core/dist/runtime/owner-identity.d.ts +12 -1
- package/core/dist/runtime/owner-identity.d.ts.map +1 -1
- package/core/dist/runtime/owner-identity.js +19 -1
- package/core/dist/runtime/owner-identity.js.map +1 -1
- package/core/dist/runtime/pain-ingress-payload.d.ts +0 -39
- package/core/dist/runtime/pain-ingress-payload.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress-payload.js +4 -4
- package/core/dist/runtime/pain-ingress-payload.js.map +1 -1
- package/core/dist/runtime/pain-ingress.d.ts +1 -1
- package/core/dist/runtime/pain-ingress.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress.js.map +1 -1
- package/core/dist/runtime/pain-recall-read-model.d.ts.map +1 -1
- package/core/dist/runtime/pain-recall-read-model.js +4 -3
- package/core/dist/runtime/pain-recall-read-model.js.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.d.ts +0 -2
- package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.js +1 -1
- package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts +3 -3
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.js +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime/principle-reuse/reuse-proposal.d.ts +3 -2
- package/core/dist/runtime/principle-reuse/reuse-proposal.d.ts.map +1 -1
- package/core/dist/runtime/principle-reuse/reuse-retrieval.d.ts +0 -10
- package/core/dist/runtime/principle-reuse/reuse-retrieval.d.ts.map +1 -1
- package/core/dist/runtime/principle-reuse/reuse-retrieval.js +1 -1
- package/core/dist/runtime/principle-reuse/reuse-retrieval.js.map +1 -1
- package/core/dist/runtime/principle-reuse/reuse-shortlist.d.ts +1 -8
- package/core/dist/runtime/principle-reuse/reuse-shortlist.d.ts.map +1 -1
- package/core/dist/runtime/principle-reuse/reuse-shortlist.js +1 -1
- package/core/dist/runtime/principle-reuse/reuse-shortlist.js.map +1 -1
- package/core/dist/runtime/product-telemetry/snapshot-contract.d.ts +3 -2
- package/core/dist/runtime/product-telemetry/snapshot-contract.d.ts.map +1 -1
- package/core/dist/runtime/pruning-read-model.d.ts.map +1 -1
- package/core/dist/runtime/pruning-read-model.js +3 -2
- package/core/dist/runtime/pruning-read-model.js.map +1 -1
- package/core/dist/runtime/risk/risk-calculator-policy.d.ts +12 -2
- package/core/dist/runtime/risk/risk-calculator-policy.d.ts.map +1 -1
- package/core/dist/runtime/risk/risk-calculator-policy.js +33 -22
- package/core/dist/runtime/risk/risk-calculator-policy.js.map +1 -1
- package/core/dist/runtime/runner/base-peer-runner.d.ts +32 -0
- package/core/dist/runtime/runner/base-peer-runner.d.ts.map +1 -1
- package/core/dist/runtime/runner/base-peer-runner.js +168 -16
- package/core/dist/runtime/runner/base-peer-runner.js.map +1 -1
- package/core/dist/runtime/runner/default-validator.d.ts +0 -1
- package/core/dist/runtime/runner/default-validator.d.ts.map +1 -1
- package/core/dist/runtime/runner/default-validator.js +11 -3
- package/core/dist/runtime/runner/default-validator.js.map +1 -1
- package/core/dist/runtime/runner/peer-runner-types.d.ts +11 -0
- package/core/dist/runtime/runner/peer-runner-types.d.ts.map +1 -1
- package/core/dist/runtime/schema-conformance-read-model.js +2 -2
- package/core/dist/runtime/schema-conformance-read-model.js.map +1 -1
- package/core/dist/runtime/storage-paths.d.ts +15 -0
- package/core/dist/runtime/storage-paths.d.ts.map +1 -0
- package/core/dist/runtime/storage-paths.js +15 -0
- package/core/dist/runtime/storage-paths.js.map +1 -0
- package/core/dist/runtime/store/artifact/index.d.ts +1 -1
- package/core/dist/runtime/store/artifact/index.d.ts.map +1 -1
- package/core/dist/runtime/store/candidate/admission-document.d.ts +4 -3
- package/core/dist/runtime/store/candidate/admission-document.d.ts.map +1 -1
- package/core/dist/runtime/store/commit/index.d.ts +0 -1
- package/core/dist/runtime/store/commit/index.d.ts.map +1 -1
- package/core/dist/runtime/store/commit/index.js.map +1 -1
- package/core/dist/runtime/store/design-gate/sqlite-design-gate-store.d.ts +4 -3
- package/core/dist/runtime/store/design-gate/sqlite-design-gate-store.d.ts.map +1 -1
- package/core/dist/runtime/store/lifecycle/lease-manager.d.ts +2 -1
- package/core/dist/runtime/store/lifecycle/lease-manager.d.ts.map +1 -1
- package/core/dist/runtime/store/runtime-state-manager.d.ts +1 -2
- 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/sqlite-connection.d.ts +2 -6
- package/core/dist/runtime/store/sqlite-connection.d.ts.map +1 -1
- package/core/dist/runtime/store/sqlite-connection.js +4 -12
- package/core/dist/runtime/store/sqlite-connection.js.map +1 -1
- package/core/dist/runtime/store/storage-paths.d.ts +17 -0
- package/core/dist/runtime/store/storage-paths.d.ts.map +1 -0
- package/core/dist/runtime/store/storage-paths.js +52 -0
- package/core/dist/runtime/store/storage-paths.js.map +1 -0
- package/core/dist/runtime/store/task/sqlite-family-reopen.d.ts +2 -1
- package/core/dist/runtime/store/task/sqlite-family-reopen.d.ts.map +1 -1
- package/core/dist/runtime/store/task/sqlite-task-store.d.ts +2 -1
- package/core/dist/runtime/store/task/sqlite-task-store.d.ts.map +1 -1
- package/core/dist/runtime/story-a-demo.d.ts.map +1 -1
- package/core/dist/runtime/story-a-demo.js +4 -1
- package/core/dist/runtime/story-a-demo.js.map +1 -1
- package/core/dist/runtime/tools/agent-tool-contract.d.ts +1 -2
- package/core/dist/runtime/tools/agent-tool-contract.d.ts.map +1 -1
- package/core/dist/runtime/tools/agent-tool-contract.js +0 -2
- package/core/dist/runtime/tools/agent-tool-contract.js.map +1 -1
- package/core/dist/runtime/tools/artificer-l2-tool-contract.d.ts +0 -2
- package/core/dist/runtime/tools/artificer-l2-tool-contract.d.ts.map +1 -1
- package/core/dist/runtime/tools/artificer-l2-tool-contract.js +0 -2
- package/core/dist/runtime/tools/artificer-l2-tool-contract.js.map +1 -1
- package/core/dist/runtime/trajectory-retention.d.ts +257 -0
- package/core/dist/runtime/trajectory-retention.d.ts.map +1 -0
- package/core/dist/runtime/trajectory-retention.js +598 -0
- package/core/dist/runtime/trajectory-retention.js.map +1 -0
- package/core/dist/runtime/types/event-payload.d.ts +0 -2
- package/core/dist/runtime/types/event-payload.d.ts.map +1 -1
- package/core/dist/runtime/types/event-payload.js.map +1 -1
- package/core/dist/runtime/types/evidence-chain-contract.d.ts +66 -2
- package/core/dist/runtime/types/evidence-chain-contract.d.ts.map +1 -1
- package/core/dist/runtime/types/evidence-chain-contract.js +69 -4
- package/core/dist/runtime/types/evidence-chain-contract.js.map +1 -1
- package/core/dist/runtime/types/hygiene-types.d.ts +0 -6
- package/core/dist/runtime/types/hygiene-types.d.ts.map +1 -1
- package/core/dist/runtime/types/hygiene-types.js.map +1 -1
- package/core/dist/runtime/types/index.d.ts +1 -1
- package/core/dist/runtime/types/index.d.ts.map +1 -1
- package/core/dist/runtime/types/index.js.map +1 -1
- package/core/dist/runtime/types/intervention-evidence-contract.d.ts +5 -5
- package/core/dist/runtime/types/intervention-evidence-contract.d.ts.map +1 -1
- package/core/dist/runtime/types/intervention-evidence-contract.js +0 -2
- package/core/dist/runtime/types/intervention-evidence-contract.js.map +1 -1
- package/core/dist/runtime/types/principle-dependency.d.ts +0 -2
- package/core/dist/runtime/types/principle-dependency.d.ts.map +1 -1
- package/core/dist/runtime/types/principle-dependency.js.map +1 -1
- package/core/dist/runtime/types/principle-lifecycle-event.d.ts +0 -2
- package/core/dist/runtime/types/principle-lifecycle-event.d.ts.map +1 -1
- package/core/dist/runtime/types/principle-lifecycle-event.js.map +1 -1
- package/core/dist/runtime/types/principle-schema.d.ts +0 -26
- package/core/dist/runtime/types/principle-schema.d.ts.map +1 -1
- package/core/dist/runtime/types/principle-schema.js +2 -2
- package/core/dist/runtime/types/principle-schema.js.map +1 -1
- package/core/dist/runtime/types/principle-tree-store.d.ts +0 -2
- package/core/dist/runtime/types/principle-tree-store.d.ts.map +1 -1
- package/core/dist/runtime/types/principle-tree-store.js.map +1 -1
- package/core/dist/runtime/types/principle-value-metrics.d.ts +0 -2
- package/core/dist/runtime/types/principle-value-metrics.d.ts.map +1 -1
- package/core/dist/runtime/types/principle-value-metrics.js.map +1 -1
- package/core/dist/runtime/types/rule-candidate-binding.d.ts +2 -1
- package/core/dist/runtime/types/rule-candidate-binding.d.ts.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 +11 -0
- package/core/dist/telemetry-event.js.map +1 -1
- package/core/dist/trajectory-store.d.ts +9 -9
- package/core/dist/trajectory-store.d.ts.map +1 -1
- package/core/dist/trajectory-store.js +9 -12
- package/core/dist/trajectory-store.js.map +1 -1
- package/core/package.json +5 -1
- package/dist/installers/codex-host-installer.d.ts +9 -0
- package/dist/installers/codex-host-installer.d.ts.map +1 -1
- package/dist/installers/codex-host-installer.js +127 -6
- package/dist/installers/codex-host-installer.js.map +1 -1
- package/dist/installers/mcp-binding-shape-mirror.d.ts +27 -0
- package/dist/installers/mcp-binding-shape-mirror.d.ts.map +1 -0
- package/dist/installers/mcp-binding-shape-mirror.js +105 -0
- package/dist/installers/mcp-binding-shape-mirror.js.map +1 -0
- package/dist/skill-catalog.d.ts +35 -0
- package/dist/skill-catalog.d.ts.map +1 -0
- package/dist/skill-catalog.js +85 -0
- package/dist/skill-catalog.js.map +1 -0
- package/dist/skill-delivery-parity.d.ts +22 -0
- package/dist/skill-delivery-parity.d.ts.map +1 -0
- package/dist/skill-delivery-parity.js +31 -0
- package/dist/skill-delivery-parity.js.map +1 -0
- package/dist/update/product-identity.d.ts.map +1 -1
- package/dist/update/product-identity.js +5 -1
- package/dist/update/product-identity.js.map +1 -1
- package/host-runtime/dist/active-principle-prompt.d.ts +13 -0
- package/host-runtime/dist/active-principle-prompt.js +87 -10
- package/host-runtime/dist/adaptive-decision-protocol.d.ts +129 -0
- package/host-runtime/dist/adaptive-decision-protocol.js +176 -0
- package/host-runtime/dist/adaptive-priority-provider.d.ts +38 -13
- package/host-runtime/dist/adaptive-priority-provider.js +70 -66
- package/host-runtime/dist/adaptive-selection.d.ts +71 -64
- package/host-runtime/dist/adaptive-selection.js +220 -329
- package/host-runtime/dist/adaptive-skip-decision.d.ts +26 -14
- package/host-runtime/dist/adaptive-skip-decision.js +33 -29
- package/host-runtime/dist/codex-disclosure.d.ts +12 -7
- package/host-runtime/dist/codex-disclosure.js +12 -7
- package/host-runtime/dist/codex-rule-context-provider.js +4 -1
- package/host-runtime/dist/conversation-ingestion/pipeline.d.ts +8 -0
- package/host-runtime/dist/conversation-ingestion/pipeline.js +6 -1
- package/host-runtime/dist/conversation-ingestion/text-policy.d.ts +3 -4
- package/host-runtime/dist/conversation-ingestion/text-policy.js +3 -4
- package/host-runtime/dist/governance-observation-store.d.ts +73 -1
- package/host-runtime/dist/governance-observation-store.js +251 -14
- package/host-runtime/dist/governance-signal-admission.d.ts +19 -3
- package/host-runtime/dist/governance-signal-admission.js +12 -4
- package/host-runtime/dist/host-tool-declaration.d.ts +18 -2
- package/host-runtime/dist/host-tool-declaration.js +67 -11
- package/host-runtime/dist/host-tool-semantic-resolver.d.ts +7 -0
- package/host-runtime/dist/host-tool-semantic-resolver.js +22 -2
- package/host-runtime/dist/index.d.ts +3 -0
- package/host-runtime/dist/index.js +17 -0
- package/host-runtime/dist/production-rulehost-gate.d.ts +36 -1
- package/host-runtime/dist/production-rulehost-gate.js +106 -4
- package/host-runtime/dist/trajectory-retention.d.ts +147 -0
- package/host-runtime/dist/trajectory-retention.js +907 -0
- package/host-runtime/package.json +1 -1
- package/install-layout/dist/index.d.ts +9 -2
- package/install-layout/dist/index.js +26 -9
- package/install-layout/dist/mcp-binding-contract.d.ts +91 -0
- package/install-layout/dist/mcp-binding-contract.js +230 -0
- package/install-layout/package.json +1 -1
- package/package.json +4 -4
- package/pd-cli/dist/commands/build-trajectory-evidence.d.ts.map +1 -1
- package/pd-cli/dist/commands/build-trajectory-evidence.js +17 -11
- package/pd-cli/dist/commands/build-trajectory-evidence.js.map +1 -1
- package/pd-cli/dist/commands/codex-reconcile.d.ts +7 -0
- package/pd-cli/dist/commands/codex-reconcile.d.ts.map +1 -1
- package/pd-cli/dist/commands/codex-reconcile.js +11 -2
- package/pd-cli/dist/commands/codex-reconcile.js.map +1 -1
- package/pd-cli/dist/commands/codex-worker.d.ts.map +1 -1
- package/pd-cli/dist/commands/codex-worker.js +35 -0
- package/pd-cli/dist/commands/codex-worker.js.map +1 -1
- package/pd-cli/dist/commands/command-helpers.d.ts +1 -1
- package/pd-cli/dist/commands/command-helpers.js +1 -1
- package/pd-cli/dist/commands/diagnose.js +1 -1
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/errors-list.d.ts +1 -1
- package/pd-cli/dist/commands/errors-list.js +1 -1
- package/pd-cli/dist/commands/health-ingestion.d.ts +96 -0
- package/pd-cli/dist/commands/health-ingestion.d.ts.map +1 -0
- package/pd-cli/dist/commands/health-ingestion.js +473 -0
- package/pd-cli/dist/commands/health-ingestion.js.map +1 -0
- package/pd-cli/dist/commands/health-mcp.d.ts +23 -1
- package/pd-cli/dist/commands/health-mcp.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-mcp.js +81 -22
- package/pd-cli/dist/commands/health-mcp.js.map +1 -1
- package/pd-cli/dist/commands/health.d.ts +1 -1
- package/pd-cli/dist/commands/health.d.ts.map +1 -1
- package/pd-cli/dist/commands/health.js +22 -5
- package/pd-cli/dist/commands/health.js.map +1 -1
- package/pd-cli/dist/commands/principles-stats.d.ts +1 -1
- package/pd-cli/dist/commands/principles-stats.js +1 -1
- package/pd-cli/dist/commands/trajectory-retention.d.ts +23 -0
- package/pd-cli/dist/commands/trajectory-retention.d.ts.map +1 -0
- package/pd-cli/dist/commands/trajectory-retention.js +159 -0
- package/pd-cli/dist/commands/trajectory-retention.js.map +1 -0
- package/pd-cli/dist/commands/workbuddy-setup.d.ts +69 -0
- package/pd-cli/dist/commands/workbuddy-setup.d.ts.map +1 -0
- package/pd-cli/dist/commands/workbuddy-setup.js +379 -0
- package/pd-cli/dist/commands/workbuddy-setup.js.map +1 -0
- package/pd-cli/dist/commands/workbuddy-worker.d.ts.map +1 -1
- package/pd-cli/dist/commands/workbuddy-worker.js +42 -6
- package/pd-cli/dist/commands/workbuddy-worker.js.map +1 -1
- package/pd-cli/dist/index.d.ts +1 -7
- package/pd-cli/dist/index.d.ts.map +1 -1
- package/pd-cli/dist/index.js +15 -1201
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/dist/program.d.ts +17 -0
- package/pd-cli/dist/program.d.ts.map +1 -0
- package/pd-cli/dist/program.js +1263 -0
- package/pd-cli/dist/program.js.map +1 -0
- package/pd-cli/dist/services/delivery-surfaces.d.ts.map +1 -1
- package/pd-cli/dist/services/delivery-surfaces.js +7 -5
- package/pd-cli/dist/services/delivery-surfaces.js.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.js +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.js.map +1 -1
- package/pd-cli/dist/services/version-report.d.ts.map +1 -1
- package/pd-cli/dist/services/version-report.js +35 -5
- package/pd-cli/dist/services/version-report.js.map +1 -1
- package/pd-cli/package.json +1 -1
- 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 +3 -1
- package/plugin/dist/bundle.js +529 -468
- package/plugin/dist/constants/tools.d.ts +8 -1
- package/plugin/dist/core/experiment-workspace-guard.d.ts +25 -0
- package/plugin/dist/core/trajectory-retention-trigger.d.ts +13 -0
- package/plugin/dist/core/trajectory.d.ts +14 -0
- package/plugin/dist/hooks/gate-block-helper.d.ts +17 -0
- package/plugin/dist/hooks/gate.d.ts +6 -1
- package/plugin/dist/host-runtime/openclaw-host-runtime.d.ts +1 -0
- package/plugin/dist/index.d.ts +5 -0
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/rulehost-evidence.js +29 -23
- package/plugin/dist/templates/langs/en/skills/pd-cli-operator/SKILL.md +16 -5
- package/plugin/dist/templates/langs/en/skills/pd-control/SKILL.md +7 -6
- package/plugin/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +141 -28
- package/plugin/dist/templates/langs/en/skills/pd-review/SKILL.md +15 -1
- package/plugin/dist/templates/langs/zh/skills/pd-cli-operator/SKILL.md +16 -5
- package/plugin/dist/templates/langs/zh/skills/pd-control/SKILL.md +7 -6
- package/plugin/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +142 -29
- package/plugin/dist/templates/langs/zh/skills/pd-review/SKILL.md +15 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/plugin/templates/langs/en/skills/pd-cli-operator/SKILL.md +16 -5
- package/plugin/templates/langs/en/skills/pd-control/SKILL.md +7 -6
- package/plugin/templates/langs/en/skills/pd-pain-signal/SKILL.md +141 -28
- package/plugin/templates/langs/en/skills/pd-review/SKILL.md +15 -1
- package/plugin/templates/langs/zh/skills/pd-cli-operator/SKILL.md +16 -5
- package/plugin/templates/langs/zh/skills/pd-control/SKILL.md +7 -6
- package/plugin/templates/langs/zh/skills/pd-pain-signal/SKILL.md +142 -29
- package/plugin/templates/langs/zh/skills/pd-review/SKILL.md +15 -1
- package/release-manager/dist/installers/codex-host-installer.js +127 -6
- package/release-manager/dist/installers/mcp-binding-shape-mirror.js +105 -0
- package/release-manager/dist/update/product-identity.js +5 -1
- package/release-manager/package.json +1 -1
- package/workbuddy-adapter/dist/codec/input-decoder.d.ts +10 -0
- package/workbuddy-adapter/dist/codec/input-decoder.js +62 -5
- package/workbuddy-adapter/dist/host-adapter.js +1 -0
- package/workbuddy-adapter/dist/index.d.ts +1 -0
- package/workbuddy-adapter/dist/index.js +1 -0
- package/workbuddy-adapter/dist/ingestion/catch-up.d.ts +36 -0
- package/workbuddy-adapter/dist/ingestion/catch-up.js +166 -0
- package/workbuddy-adapter/dist/ingestion/encode-cwd.d.ts +6 -0
- package/workbuddy-adapter/dist/ingestion/encode-cwd.js +39 -0
- package/workbuddy-adapter/dist/ingestion/index.d.ts +13 -0
- package/workbuddy-adapter/dist/ingestion/index.js +13 -0
- package/workbuddy-adapter/dist/ingestion/ingestion.d.ts +46 -0
- package/workbuddy-adapter/dist/ingestion/ingestion.js +135 -0
- package/workbuddy-adapter/dist/ingestion/transcript-decoder.d.ts +70 -0
- package/workbuddy-adapter/dist/ingestion/transcript-decoder.js +554 -0
- package/workbuddy-adapter/dist/ingestion/transcript-path.d.ts +39 -0
- package/workbuddy-adapter/dist/ingestion/transcript-path.js +117 -0
- package/workbuddy-adapter/dist/ingestion/transcript-source.d.ts +15 -0
- package/workbuddy-adapter/dist/ingestion/transcript-source.js +152 -0
- package/workbuddy-adapter/dist/pd-hook.d.ts +8 -0
- package/workbuddy-adapter/dist/pd-hook.js +59 -2
- package/workbuddy-adapter/dist/worker/workspace-worker.d.ts +9 -0
- package/workbuddy-adapter/dist/worker/workspace-worker.js +46 -17
- package/workbuddy-adapter/package.json +1 -1
- package/workbuddy-adapter/plugin/hooks/hooks.json +11 -0
- package/workbuddy-adapter/plugin/skills/pd-cli-operator/SKILL.md +57 -19
- package/workbuddy-adapter/plugin/skills/pd-control/SKILL.md +21 -9
- package/workbuddy-adapter/plugin/skills/pd-pain-signal/SKILL.md +72 -61
- package/workbuddy-adapter/plugin/skills/pd-review/SKILL.md +27 -12
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
// ── Bounds (SPEC §3.1) ───────────────────────────────────────────────────────
|
|
2
|
+
export const TRAJECTORY_RETENTION_DEFAULTS = Object.freeze({
|
|
3
|
+
enabled: true,
|
|
4
|
+
retentionDays: 90,
|
|
5
|
+
intervalHours: 6,
|
|
6
|
+
batchSize: 2000,
|
|
7
|
+
runBudgetMs: 3000,
|
|
8
|
+
});
|
|
9
|
+
/** `retentionDays = 0` disables retention; 1..6 is rejected (never "delete all"). */
|
|
10
|
+
export const RETENTION_MIN_ACCEPTED_DAYS = 7;
|
|
11
|
+
export const RETENTION_MAX_ACCEPTED_DAYS = 3650;
|
|
12
|
+
export const RETENTION_BATCH_SIZE_MIN = 100;
|
|
13
|
+
export const RETENTION_BATCH_SIZE_MAX = 10000;
|
|
14
|
+
export const RETENTION_RUN_BUDGET_MIN_MS = 500;
|
|
15
|
+
export const RETENTION_RUN_BUDGET_MAX_MS = 10000;
|
|
16
|
+
export const RETENTION_INTERVAL_HOURS_MIN = 1;
|
|
17
|
+
export const RETENTION_INTERVAL_HOURS_MAX = 168;
|
|
18
|
+
const HOUR_MS = 60 * 60 * 1000;
|
|
19
|
+
const DAY_MS = 24 * HOUR_MS;
|
|
20
|
+
/** 单批墙钟上限;超过即提交后停止本次运行(SPEC §4.3)。 */
|
|
21
|
+
export const RETENTION_BATCH_BUDGET_MS = 250;
|
|
22
|
+
/** 截止线每次最多前进 7 天,防止一次时钟前跳清空历史(SPEC §3.3)。 */
|
|
23
|
+
export const RETENTION_MAX_CUTOFF_ADVANCE_MS = 7 * DAY_MS;
|
|
24
|
+
/** 系统时间后跳容差。 */
|
|
25
|
+
export const RETENTION_CLOCK_BACKWARDS_TOLERANCE_MS = HOUR_MS;
|
|
26
|
+
/** busy 让路后的指数退避序列,最后一档封顶(SPEC §4.4)。 */
|
|
27
|
+
export const RETENTION_BUSY_BACKOFF_MS = Object.freeze([
|
|
28
|
+
30 * 60 * 1000,
|
|
29
|
+
HOUR_MS,
|
|
30
|
+
2 * HOUR_MS,
|
|
31
|
+
6 * HOUR_MS,
|
|
32
|
+
]);
|
|
33
|
+
function isRecord(value) {
|
|
34
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
35
|
+
}
|
|
36
|
+
function readOwn(record, key) {
|
|
37
|
+
return Object.hasOwn(record, key) ? record[key] : undefined;
|
|
38
|
+
}
|
|
39
|
+
function readInteger(record, key) {
|
|
40
|
+
const value = readOwn(record, key);
|
|
41
|
+
if (value === undefined)
|
|
42
|
+
return 'absent';
|
|
43
|
+
if (typeof value !== 'number' || !Number.isInteger(value))
|
|
44
|
+
return 'invalid';
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Map the raw `trajectoryRetention` config section to an effective policy.
|
|
49
|
+
*
|
|
50
|
+
* Three distinct states, deliberately separated:
|
|
51
|
+
* - absent → defaults, sweeping enabled;
|
|
52
|
+
* - valid → the configured values;
|
|
53
|
+
* - unusable → `degradedReason` set, sweeping must delete 0 rows.
|
|
54
|
+
*
|
|
55
|
+
* A missing section never degrades; a present-but-wrong section never falls
|
|
56
|
+
* back to "delete with defaults" (that would turn a config typo into
|
|
57
|
+
* irreversible deletion).
|
|
58
|
+
*/
|
|
59
|
+
export function resolveTrajectoryRetentionPolicy(raw) {
|
|
60
|
+
const defaults = TRAJECTORY_RETENTION_DEFAULTS;
|
|
61
|
+
if (raw === undefined || raw === null) {
|
|
62
|
+
return { ...defaults };
|
|
63
|
+
}
|
|
64
|
+
if (!isRecord(raw)) {
|
|
65
|
+
return { ...defaults, degradedReason: 'config_not_object' };
|
|
66
|
+
}
|
|
67
|
+
for (const key of Object.keys(raw)) {
|
|
68
|
+
if (!Object.hasOwn(defaults, key)) {
|
|
69
|
+
return { ...defaults, degradedReason: `unknown_key:${key}` };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const enabledRaw = readOwn(raw, 'enabled');
|
|
73
|
+
if (enabledRaw !== undefined && typeof enabledRaw !== 'boolean') {
|
|
74
|
+
return { ...defaults, enabled: false, degradedReason: 'enabled_not_boolean' };
|
|
75
|
+
}
|
|
76
|
+
const enabled = typeof enabledRaw === 'boolean' ? enabledRaw : defaults.enabled;
|
|
77
|
+
const retentionDaysRaw = readInteger(raw, 'retentionDays');
|
|
78
|
+
if (retentionDaysRaw === 'invalid') {
|
|
79
|
+
return { ...defaults, enabled, degradedReason: 'retention_days_not_integer' };
|
|
80
|
+
}
|
|
81
|
+
if (retentionDaysRaw === 0) {
|
|
82
|
+
// SPEC §3.1: zero means STOP, never "delete everything".
|
|
83
|
+
return { ...defaults, enabled: false, disabledByZeroDays: true };
|
|
84
|
+
}
|
|
85
|
+
if (retentionDaysRaw !== 'absent' && retentionDaysRaw < RETENTION_MIN_ACCEPTED_DAYS) {
|
|
86
|
+
return {
|
|
87
|
+
...defaults,
|
|
88
|
+
enabled,
|
|
89
|
+
degradedReason: `retention_days_out_of_range:${retentionDaysRaw}`,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (retentionDaysRaw !== 'absent' && retentionDaysRaw > RETENTION_MAX_ACCEPTED_DAYS) {
|
|
93
|
+
return {
|
|
94
|
+
...defaults,
|
|
95
|
+
enabled,
|
|
96
|
+
retentionDays: RETENTION_MAX_ACCEPTED_DAYS,
|
|
97
|
+
degradedReason: `retention_days_out_of_range:${retentionDaysRaw}`,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const retentionDays = retentionDaysRaw === 'absent' ? defaults.retentionDays : retentionDaysRaw;
|
|
101
|
+
const intervalHoursRaw = readInteger(raw, 'intervalHours');
|
|
102
|
+
if (intervalHoursRaw === 'invalid'
|
|
103
|
+
|| (intervalHoursRaw !== 'absent'
|
|
104
|
+
&& (intervalHoursRaw < RETENTION_INTERVAL_HOURS_MIN
|
|
105
|
+
|| intervalHoursRaw > RETENTION_INTERVAL_HOURS_MAX))) {
|
|
106
|
+
return {
|
|
107
|
+
...defaults,
|
|
108
|
+
enabled,
|
|
109
|
+
retentionDays,
|
|
110
|
+
degradedReason: `interval_hours_out_of_range:${String(intervalHoursRaw)}`,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const intervalHours = intervalHoursRaw === 'absent' ? defaults.intervalHours : intervalHoursRaw;
|
|
114
|
+
const batchSizeRaw = readInteger(raw, 'batchSize');
|
|
115
|
+
if (batchSizeRaw === 'invalid'
|
|
116
|
+
|| (batchSizeRaw !== 'absent'
|
|
117
|
+
&& (batchSizeRaw < RETENTION_BATCH_SIZE_MIN || batchSizeRaw > RETENTION_BATCH_SIZE_MAX))) {
|
|
118
|
+
return {
|
|
119
|
+
...defaults,
|
|
120
|
+
enabled,
|
|
121
|
+
retentionDays,
|
|
122
|
+
intervalHours,
|
|
123
|
+
degradedReason: `batch_size_out_of_range:${String(batchSizeRaw)}`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const batchSize = batchSizeRaw === 'absent' ? defaults.batchSize : batchSizeRaw;
|
|
127
|
+
const runBudgetRaw = readInteger(raw, 'runBudgetMs');
|
|
128
|
+
if (runBudgetRaw === 'invalid'
|
|
129
|
+
|| (runBudgetRaw !== 'absent'
|
|
130
|
+
&& (runBudgetRaw < RETENTION_RUN_BUDGET_MIN_MS || runBudgetRaw > RETENTION_RUN_BUDGET_MAX_MS))) {
|
|
131
|
+
return {
|
|
132
|
+
...defaults,
|
|
133
|
+
enabled,
|
|
134
|
+
retentionDays,
|
|
135
|
+
intervalHours,
|
|
136
|
+
batchSize,
|
|
137
|
+
degradedReason: `run_budget_out_of_range:${String(runBudgetRaw)}`,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
const runBudgetMs = runBudgetRaw === 'absent' ? defaults.runBudgetMs : runBudgetRaw;
|
|
141
|
+
return { enabled, retentionDays, intervalHours, batchSize, runBudgetMs };
|
|
142
|
+
}
|
|
143
|
+
export const EMPTY_RETENTION_MARKER = Object.freeze({
|
|
144
|
+
lastRunAt: null,
|
|
145
|
+
lastCutoff: null,
|
|
146
|
+
lastOutcome: null,
|
|
147
|
+
deletedByTable: {},
|
|
148
|
+
durationMs: null,
|
|
149
|
+
totalDurationMs: null,
|
|
150
|
+
partial: false,
|
|
151
|
+
backoffUntil: null,
|
|
152
|
+
consecutiveBusy: 0,
|
|
153
|
+
reason: null,
|
|
154
|
+
});
|
|
155
|
+
function normalizeTimestampField(value) {
|
|
156
|
+
if (value === null)
|
|
157
|
+
return { value: null, damaged: false };
|
|
158
|
+
if (typeof value !== 'string')
|
|
159
|
+
return { value: null, damaged: true };
|
|
160
|
+
// A timestamp we cannot parse is unusable as a clock baseline. Keeping the
|
|
161
|
+
// bad string would make every later run hit `marker_timestamp_invalid` — a
|
|
162
|
+
// permanent stall. Normalising it to null makes the next run recover.
|
|
163
|
+
return Number.isFinite(Date.parse(value))
|
|
164
|
+
? { value, damaged: false }
|
|
165
|
+
: { value: null, damaged: true };
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Coerce any parsed JSON into a usable marker.
|
|
169
|
+
*
|
|
170
|
+
* Returns `damaged: true` when a field was missing or malformed. Unparseable
|
|
171
|
+
* timestamps are normalised to `null` instead of being preserved, so a single
|
|
172
|
+
* bad value can never wedge retention forever (review finding P1-2).
|
|
173
|
+
*/
|
|
174
|
+
export function normalizeRetentionMarker(value) {
|
|
175
|
+
if (!isRecord(value)) {
|
|
176
|
+
return { marker: { ...EMPTY_RETENTION_MARKER, deletedByTable: {} }, damaged: true };
|
|
177
|
+
}
|
|
178
|
+
let damaged = false;
|
|
179
|
+
const timestamp = (key) => {
|
|
180
|
+
const field = normalizeTimestampField(readOwn(value, key));
|
|
181
|
+
if (field.damaged)
|
|
182
|
+
damaged = true;
|
|
183
|
+
return field.value;
|
|
184
|
+
};
|
|
185
|
+
const nullableString = (key) => {
|
|
186
|
+
const field = readOwn(value, key);
|
|
187
|
+
if (field === null || field === undefined) {
|
|
188
|
+
if (field === undefined)
|
|
189
|
+
damaged = true;
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
if (typeof field !== 'string') {
|
|
193
|
+
damaged = true;
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
return field;
|
|
197
|
+
};
|
|
198
|
+
const nullableNumber = (key) => {
|
|
199
|
+
const field = readOwn(value, key);
|
|
200
|
+
if (field === null)
|
|
201
|
+
return null;
|
|
202
|
+
if (typeof field !== 'number' || !Number.isFinite(field)) {
|
|
203
|
+
damaged = true;
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
return field;
|
|
207
|
+
};
|
|
208
|
+
const deletedByTable = {};
|
|
209
|
+
const rawCounts = readOwn(value, 'deletedByTable');
|
|
210
|
+
if (isRecord(rawCounts)) {
|
|
211
|
+
for (const [table, count] of Object.entries(rawCounts)) {
|
|
212
|
+
if (typeof count === 'number' && Number.isFinite(count))
|
|
213
|
+
deletedByTable[table] = count;
|
|
214
|
+
else
|
|
215
|
+
damaged = true;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
damaged = true;
|
|
220
|
+
}
|
|
221
|
+
const partial = readOwn(value, 'partial');
|
|
222
|
+
if (typeof partial !== 'boolean')
|
|
223
|
+
damaged = true;
|
|
224
|
+
const consecutiveBusy = readOwn(value, 'consecutiveBusy');
|
|
225
|
+
if (typeof consecutiveBusy !== 'number' || !Number.isFinite(consecutiveBusy))
|
|
226
|
+
damaged = true;
|
|
227
|
+
return {
|
|
228
|
+
marker: {
|
|
229
|
+
lastRunAt: timestamp('lastRunAt'),
|
|
230
|
+
lastCutoff: timestamp('lastCutoff'),
|
|
231
|
+
lastOutcome: nullableString('lastOutcome'),
|
|
232
|
+
deletedByTable,
|
|
233
|
+
durationMs: nullableNumber('durationMs'),
|
|
234
|
+
totalDurationMs: nullableNumber('totalDurationMs'),
|
|
235
|
+
partial: partial === true,
|
|
236
|
+
backoffUntil: timestamp('backoffUntil'),
|
|
237
|
+
consecutiveBusy: typeof consecutiveBusy === 'number' ? consecutiveBusy : 0,
|
|
238
|
+
reason: nullableString('reason'),
|
|
239
|
+
},
|
|
240
|
+
damaged,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
export function isRetentionMarker(value) {
|
|
244
|
+
return !normalizeRetentionMarker(value).damaged;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Whether a stored `lastCutoff` may be used as a lower bound.
|
|
248
|
+
*
|
|
249
|
+
* A surviving cutoff is only meaningful while it lies inside the current
|
|
250
|
+
* retention window. A future value can arrive from a clock that ran fast (the
|
|
251
|
+
* cutoff advanced while the clock was wrong) or from a hand-edited marker.
|
|
252
|
+
* Such a value must be DISCARDED, not clamped: clamping still leaves a cutoff
|
|
253
|
+
* inside the window and deletes rows that should be kept (F1).
|
|
254
|
+
*/
|
|
255
|
+
export function isRetentionCutoffInWindow(args) {
|
|
256
|
+
const { lastCutoff, nowMs, retentionDays } = args;
|
|
257
|
+
if (lastCutoff === null)
|
|
258
|
+
return true;
|
|
259
|
+
const parsed = Date.parse(lastCutoff);
|
|
260
|
+
if (!Number.isFinite(parsed))
|
|
261
|
+
return false;
|
|
262
|
+
const computedCutoffMs = nowMs - retentionDays * DAY_MS;
|
|
263
|
+
return parsed <= computedCutoffMs && parsed <= nowMs;
|
|
264
|
+
}
|
|
265
|
+
function parseTimestamp(value) {
|
|
266
|
+
if (value === null)
|
|
267
|
+
return null;
|
|
268
|
+
const parsed = Date.parse(value);
|
|
269
|
+
return Number.isFinite(parsed) ? parsed : 'invalid';
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Compute this run's cutoff.
|
|
273
|
+
*
|
|
274
|
+
* Deletion is irreversible, so every ambiguity resolves to "delete less":
|
|
275
|
+
* - the cutoff never moves backwards;
|
|
276
|
+
* - it advances at most `RETENTION_MAX_CUTOFF_ADVANCE_MS` per run;
|
|
277
|
+
* - a backwards clock tick (> 1 h) and an implausible forward jump skip the
|
|
278
|
+
* run entirely instead of deleting a range that may be wrong.
|
|
279
|
+
*/
|
|
280
|
+
export function computeRetentionCutoff(args) {
|
|
281
|
+
const { nowMs, retentionDays, intervalHours, marker } = args;
|
|
282
|
+
const lastRunAtMs = parseTimestamp(marker.lastRunAt);
|
|
283
|
+
const lastCutoffMs = parseTimestamp(marker.lastCutoff);
|
|
284
|
+
if (lastRunAtMs === 'invalid' || lastCutoffMs === 'invalid') {
|
|
285
|
+
return { kind: 'skip', reason: 'marker_timestamp_invalid' };
|
|
286
|
+
}
|
|
287
|
+
if (lastRunAtMs !== null) {
|
|
288
|
+
if (nowMs < lastRunAtMs - RETENTION_CLOCK_BACKWARDS_TOLERANCE_MS) {
|
|
289
|
+
return { kind: 'skip', reason: 'clock_backwards' };
|
|
290
|
+
}
|
|
291
|
+
const forwardLimit = lastRunAtMs
|
|
292
|
+
+ intervalHours * 2 * HOUR_MS
|
|
293
|
+
+ RETENTION_MAX_CUTOFF_ADVANCE_MS;
|
|
294
|
+
if (nowMs > forwardLimit) {
|
|
295
|
+
return { kind: 'skip', reason: 'clock_forward_anomaly' };
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
const computedCutoffMs = nowMs - retentionDays * DAY_MS;
|
|
299
|
+
// Never trust a cutoff that is not inside the current window (F1). An
|
|
300
|
+
// in-window cutoff is by definition <= `computedCutoffMs`, so the cutoff is
|
|
301
|
+
// inherently monotonic: it can never end up earlier than the stored value.
|
|
302
|
+
const trustedLastCutoffMs = isRetentionCutoffInWindow({
|
|
303
|
+
lastCutoff: marker.lastCutoff,
|
|
304
|
+
nowMs,
|
|
305
|
+
retentionDays,
|
|
306
|
+
})
|
|
307
|
+
? lastCutoffMs
|
|
308
|
+
: null;
|
|
309
|
+
let effectiveCutoffMs = computedCutoffMs;
|
|
310
|
+
let advanceCapped = false;
|
|
311
|
+
if (trustedLastCutoffMs !== null) {
|
|
312
|
+
const capped = trustedLastCutoffMs + RETENTION_MAX_CUTOFF_ADVANCE_MS;
|
|
313
|
+
if (computedCutoffMs > capped) {
|
|
314
|
+
effectiveCutoffMs = capped;
|
|
315
|
+
advanceCapped = true;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return {
|
|
319
|
+
kind: 'run',
|
|
320
|
+
cutoff: new Date(effectiveCutoffMs).toISOString(),
|
|
321
|
+
computedCutoff: new Date(computedCutoffMs).toISOString(),
|
|
322
|
+
advanceCapped,
|
|
323
|
+
discardedMarkerCutoff: lastCutoffMs !== null && trustedLastCutoffMs === null,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
export function nextBackoffUntil(nowMs, consecutiveBusy) {
|
|
327
|
+
const index = Math.min(Math.max(consecutiveBusy - 1, 0), RETENTION_BUSY_BACKOFF_MS.length - 1);
|
|
328
|
+
const backoffMs = RETENTION_BUSY_BACKOFF_MS[index] ?? RETENTION_BUSY_BACKOFF_MS[0] ?? 30 * 60 * 1000;
|
|
329
|
+
return new Date(nowMs + backoffMs).toISOString();
|
|
330
|
+
}
|
|
331
|
+
export const TRAJECTORY_RETENTION_TABLES = Object.freeze([
|
|
332
|
+
{ table: 'tool_calls', timeColumn: 'created_at' },
|
|
333
|
+
{ table: 'assistant_turns', timeColumn: 'created_at' },
|
|
334
|
+
{ table: 'user_turns', timeColumn: 'created_at' },
|
|
335
|
+
{
|
|
336
|
+
table: 'governance_observations',
|
|
337
|
+
timeColumn: 'expired_at',
|
|
338
|
+
extraPredicate: "retention_class IN ('expired','rolled_back')",
|
|
339
|
+
},
|
|
340
|
+
]);
|
|
341
|
+
/**
|
|
342
|
+
* Retention indexes.
|
|
343
|
+
*
|
|
344
|
+
* Kept out of `applyTrajectorySchemaBase` on purpose: creating an index on a
|
|
345
|
+
* million-row table costs seconds, and that function runs every time a host
|
|
346
|
+
* opens the database. Only the maintenance entry point calls this (SPEC §5.2).
|
|
347
|
+
*
|
|
348
|
+
* `idx_assistant_turns_session_id` / `idx_user_turns_session_id` /
|
|
349
|
+
* `idx_tool_calls_created_at` / `idx_assistant_turns_created_at` already exist
|
|
350
|
+
* in the canonical schema; only the genuinely missing ones are here.
|
|
351
|
+
*/
|
|
352
|
+
export const TRAJECTORY_RETENTION_INDEXES = Object.freeze([
|
|
353
|
+
'CREATE INDEX IF NOT EXISTS idx_user_turns_created_at ON user_turns(created_at)',
|
|
354
|
+
'CREATE INDEX IF NOT EXISTS idx_pain_events_created_at ON pain_events(created_at)',
|
|
355
|
+
'CREATE INDEX IF NOT EXISTS idx_assistant_turns_blob_ref ON assistant_turns(blob_ref) WHERE blob_ref IS NOT NULL',
|
|
356
|
+
'CREATE INDEX IF NOT EXISTS idx_user_turns_blob_ref ON user_turns(blob_ref) WHERE blob_ref IS NOT NULL',
|
|
357
|
+
]);
|
|
358
|
+
/**
|
|
359
|
+
* Create the retention indexes if their tables exist. Idempotent.
|
|
360
|
+
* `skipped` names indexes whose table is absent (Profile A databases do not
|
|
361
|
+
* carry governance tables, for example) — never an error.
|
|
362
|
+
*/
|
|
363
|
+
export function ensureTrajectoryRetentionIndexes(db) {
|
|
364
|
+
const applied = [];
|
|
365
|
+
const skipped = [];
|
|
366
|
+
for (const statement of TRAJECTORY_RETENTION_INDEXES) {
|
|
367
|
+
const table = / ON ([a-z_]+)\(/.exec(statement)?.[1];
|
|
368
|
+
if (table !== undefined) {
|
|
369
|
+
const exists = db
|
|
370
|
+
.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?")
|
|
371
|
+
.get(table);
|
|
372
|
+
if (exists === undefined) {
|
|
373
|
+
skipped.push(statement);
|
|
374
|
+
continue;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
db.exec(statement);
|
|
378
|
+
applied.push(statement);
|
|
379
|
+
}
|
|
380
|
+
return { applied, skipped };
|
|
381
|
+
}
|
|
382
|
+
function tableExists(db, table) {
|
|
383
|
+
return db
|
|
384
|
+
.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?")
|
|
385
|
+
.get(table) !== undefined;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Read-only existence check for the retention indexes. The regular sweep must
|
|
389
|
+
* never create them: `CREATE INDEX` on a busy database can block for seconds,
|
|
390
|
+
* which is exactly the host stall F2 forbids. Index creation is an explicit
|
|
391
|
+
* maintenance action (`pd trajectory vacuum --yes`).
|
|
392
|
+
*/
|
|
393
|
+
export function missingTrajectoryRetentionIndexes(db) {
|
|
394
|
+
const missing = [];
|
|
395
|
+
for (const statement of TRAJECTORY_RETENTION_INDEXES) {
|
|
396
|
+
const name = /CREATE INDEX IF NOT EXISTS ([a-z_]+)/.exec(statement)?.[1];
|
|
397
|
+
const table = / ON ([a-z_]+)\(/.exec(statement)?.[1];
|
|
398
|
+
if (name === undefined)
|
|
399
|
+
continue;
|
|
400
|
+
if (table !== undefined && !tableExists(db, table))
|
|
401
|
+
continue;
|
|
402
|
+
const row = db
|
|
403
|
+
.prepare("SELECT name FROM sqlite_master WHERE type = 'index' AND name = ?")
|
|
404
|
+
.get(name);
|
|
405
|
+
if (row === undefined)
|
|
406
|
+
missing.push(name);
|
|
407
|
+
}
|
|
408
|
+
return missing;
|
|
409
|
+
}
|
|
410
|
+
function isBusyError(error) {
|
|
411
|
+
if (!isRecord(error))
|
|
412
|
+
return false;
|
|
413
|
+
const code = typeof error.code === 'string' ? error.code : '';
|
|
414
|
+
if (code === 'SQLITE_BUSY' || code === 'SQLITE_BUSY_SNAPSHOT' || code === 'SQLITE_LOCKED') {
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
const message = typeof error.message === 'string' ? error.message : '';
|
|
418
|
+
return message.includes('SQLITE_BUSY') || message.includes('database is locked');
|
|
419
|
+
}
|
|
420
|
+
function isRetentionBatchRow(value) {
|
|
421
|
+
if (!isRecord(value))
|
|
422
|
+
return false;
|
|
423
|
+
return typeof value.id === 'number' && typeof value.at === 'string';
|
|
424
|
+
}
|
|
425
|
+
function readCount(value) {
|
|
426
|
+
if (!isRecord(value))
|
|
427
|
+
return 0;
|
|
428
|
+
const count = value.c;
|
|
429
|
+
return typeof count === 'number' ? count : 0;
|
|
430
|
+
}
|
|
431
|
+
function retainedPredicate(plan) {
|
|
432
|
+
const base = `${plan.timeColumn} IS NOT NULL AND ${plan.timeColumn} < ?`;
|
|
433
|
+
return plan.extraPredicate === undefined ? base : `${base} AND ${plan.extraPredicate}`;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Statement text assembled from the frozen plan list above.
|
|
437
|
+
*
|
|
438
|
+
* Every *value* stays bound with `?`. The only things that reach the SQL text
|
|
439
|
+
* are identifiers from `TRAJECTORY_RETENTION_TABLES` and its fixed predicate —
|
|
440
|
+
* neither can come from user input. No statement is built from runtime data.
|
|
441
|
+
*
|
|
442
|
+
* Built here rather than inline in `db.prepare(\`...\`)` because SEC-BASE-4
|
|
443
|
+
* scans template literals directly inside `prepare`/`exec`; keeping the
|
|
444
|
+
* assembly in one helper makes the guard read a constant expression while the
|
|
445
|
+
* SQL stays fully parameterized.
|
|
446
|
+
*/
|
|
447
|
+
function retentionTableSql(plan) {
|
|
448
|
+
const predicate = retainedPredicate(plan);
|
|
449
|
+
return {
|
|
450
|
+
count: 'SELECT COUNT(*) AS c FROM ' + plan.table + ' WHERE ' + predicate,
|
|
451
|
+
select: 'SELECT id, ' + plan.timeColumn + ' AS at FROM ' + plan.table
|
|
452
|
+
+ ' WHERE ' + predicate + ' ORDER BY id LIMIT ?',
|
|
453
|
+
deletePrefix: 'DELETE FROM ' + plan.table + ' WHERE id IN (',
|
|
454
|
+
deleteSuffix: ') AND ' + predicate,
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
function countExpired(db, plan, cutoff) {
|
|
458
|
+
const row = db.prepare(retentionTableSql(plan).count).get(cutoff);
|
|
459
|
+
return readCount(row);
|
|
460
|
+
}
|
|
461
|
+
function retentionTableExists(db, table) {
|
|
462
|
+
const row = db
|
|
463
|
+
.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?")
|
|
464
|
+
.get(table);
|
|
465
|
+
return row !== undefined;
|
|
466
|
+
}
|
|
467
|
+
/** Selection runs outside any write transaction (WAL readers never block). */
|
|
468
|
+
function selectExpiredBatch(args) {
|
|
469
|
+
const { db, plan, cutoff, batchSize } = args;
|
|
470
|
+
const rawRows = db
|
|
471
|
+
.prepare(retentionTableSql(plan).select)
|
|
472
|
+
.all(cutoff, batchSize);
|
|
473
|
+
if (!Array.isArray(rawRows))
|
|
474
|
+
throw new Error('retention_batch_rows_not_array');
|
|
475
|
+
const rows = [];
|
|
476
|
+
for (const raw of rawRows) {
|
|
477
|
+
if (!isRetentionBatchRow(raw))
|
|
478
|
+
throw new Error('retention_batch_row_invalid');
|
|
479
|
+
rows.push(raw);
|
|
480
|
+
}
|
|
481
|
+
return rows;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Delete exactly the selected ids inside one write transaction.
|
|
485
|
+
*
|
|
486
|
+
* The row-count invariant is checked INSIDE that transaction, between a
|
|
487
|
+
* pre-count and a post-count taken under the same write lock. That removes the
|
|
488
|
+
* false-positive window a run-level pre/post pair has: a third-party writer
|
|
489
|
+
* cannot interleave between the counts (review finding 8).
|
|
490
|
+
*
|
|
491
|
+
* The predicate is re-applied on the DELETE: a `governance_observations` row
|
|
492
|
+
* whose class changed after selection must not be deleted.
|
|
493
|
+
*/
|
|
494
|
+
function deleteSelectedBatch(args) {
|
|
495
|
+
const { db, plan, cutoff, rows } = args;
|
|
496
|
+
try {
|
|
497
|
+
// IMMEDIATE takes the write lock up front. DEFERRED would read first and
|
|
498
|
+
// then fail to upgrade under concurrent writers — the exact SQLITE_BUSY
|
|
499
|
+
// shape this design exists to avoid (SPEC §4.2).
|
|
500
|
+
db.exec('BEGIN IMMEDIATE');
|
|
501
|
+
}
|
|
502
|
+
catch (error) {
|
|
503
|
+
if (isBusyError(error))
|
|
504
|
+
return { kind: 'busy' };
|
|
505
|
+
throw error;
|
|
506
|
+
}
|
|
507
|
+
try {
|
|
508
|
+
const pre = countExpired(db, plan, cutoff);
|
|
509
|
+
const placeholders = rows.map(() => '?').join(',');
|
|
510
|
+
const sql = retentionTableSql(plan);
|
|
511
|
+
const deleteSql = sql.deletePrefix + placeholders + sql.deleteSuffix;
|
|
512
|
+
const info = db.prepare(deleteSql).run(...rows.map((row) => row.id), cutoff);
|
|
513
|
+
const post = countExpired(db, plan, cutoff);
|
|
514
|
+
if (pre - post !== info.changes) {
|
|
515
|
+
db.exec('ROLLBACK');
|
|
516
|
+
return {
|
|
517
|
+
kind: 'invariant',
|
|
518
|
+
reason: `row_count_mismatch:${plan.table}:pre=${pre}:post=${post}:deleted=${info.changes}`,
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
db.exec('COMMIT');
|
|
522
|
+
return { kind: 'ok', selected: rows.length, changes: info.changes };
|
|
523
|
+
}
|
|
524
|
+
catch (error) {
|
|
525
|
+
try {
|
|
526
|
+
db.exec('ROLLBACK');
|
|
527
|
+
}
|
|
528
|
+
catch {
|
|
529
|
+
// no open transaction; the original error is what matters
|
|
530
|
+
}
|
|
531
|
+
if (isBusyError(error))
|
|
532
|
+
return { kind: 'busy' };
|
|
533
|
+
throw error;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
export function runTrajectoryRetentionBatches(db, request) {
|
|
537
|
+
const { policy, cutoff, hooks } = request;
|
|
538
|
+
const startedAt = hooks.now();
|
|
539
|
+
const deletedByTable = {};
|
|
540
|
+
let batches = 0;
|
|
541
|
+
let maxBatchDurationMs = 0;
|
|
542
|
+
const base = (outcome, reason) => ({
|
|
543
|
+
outcome,
|
|
544
|
+
cutoff,
|
|
545
|
+
deletedByTable,
|
|
546
|
+
batches,
|
|
547
|
+
maxBatchDurationMs,
|
|
548
|
+
durationMs: hooks.now() - startedAt,
|
|
549
|
+
...(reason === undefined ? {} : { reason }),
|
|
550
|
+
});
|
|
551
|
+
// A Profile A workspace has no governance tables, and an older database may
|
|
552
|
+
// be missing any of them. An absent table is "nothing to sweep", never a
|
|
553
|
+
// failure: the runner must not require the caller to pre-create every table.
|
|
554
|
+
const plans = TRAJECTORY_RETENTION_TABLES.filter((plan) => retentionTableExists(db, plan.table));
|
|
555
|
+
for (const plan of plans) {
|
|
556
|
+
deletedByTable[plan.table] = 0;
|
|
557
|
+
for (;;) {
|
|
558
|
+
const remaining = policy.runBudgetMs - (hooks.now() - startedAt);
|
|
559
|
+
if (remaining < RETENTION_BATCH_BUDGET_MS) {
|
|
560
|
+
return base('deadline', 'run_budget_exhausted');
|
|
561
|
+
}
|
|
562
|
+
const batchStartedAt = hooks.now();
|
|
563
|
+
const rows = selectExpiredBatch({ db, plan, cutoff, batchSize: policy.batchSize });
|
|
564
|
+
if (rows.length === 0)
|
|
565
|
+
break;
|
|
566
|
+
// Audit BEFORE the write transaction: a failed export must not delete.
|
|
567
|
+
const auditError = hooks.onBatchPrepared?.({ table: plan.table, rows }) ?? null;
|
|
568
|
+
if (auditError !== null) {
|
|
569
|
+
return base('partial', `audit_failed:${auditError}`);
|
|
570
|
+
}
|
|
571
|
+
const batch = deleteSelectedBatch({ db, plan, cutoff, rows });
|
|
572
|
+
const batchDuration = hooks.now() - batchStartedAt;
|
|
573
|
+
maxBatchDurationMs = Math.max(maxBatchDurationMs, batchDuration);
|
|
574
|
+
if (batch.kind === 'busy') {
|
|
575
|
+
return base('deferred_busy', 'sqlite_busy');
|
|
576
|
+
}
|
|
577
|
+
if (batch.kind === 'invariant') {
|
|
578
|
+
return base('invariant_violation', batch.reason);
|
|
579
|
+
}
|
|
580
|
+
batches += 1;
|
|
581
|
+
deletedByTable[plan.table] = (deletedByTable[plan.table] ?? 0) + batch.changes;
|
|
582
|
+
hooks.onBatchCommitted?.({ table: plan.table, rows, changes: batch.changes });
|
|
583
|
+
if (batch.changes === 0) {
|
|
584
|
+
// Every selected row became ineligible between select and delete.
|
|
585
|
+
// Stop rather than loop on the same predicate forever.
|
|
586
|
+
return base('partial', `no_progress:${plan.table}`);
|
|
587
|
+
}
|
|
588
|
+
if (batchDuration > RETENTION_BATCH_BUDGET_MS) {
|
|
589
|
+
// Committed, but over budget: stop instead of gambling on the next one.
|
|
590
|
+
return base('partial', 'batch_over_budget');
|
|
591
|
+
}
|
|
592
|
+
if (batch.selected < policy.batchSize)
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
return base('completed');
|
|
597
|
+
}
|
|
598
|
+
//# sourceMappingURL=trajectory-retention.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trajectory-retention.js","sourceRoot":"","sources":["../../src/runtime/trajectory-retention.ts"],"names":[],"mappings":"AAsBA,gFAAgF;AAEhF,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD,OAAO,EAAE,IAAI;IACb,aAAa,EAAE,EAAE;IACjB,aAAa,EAAE,CAAC;IAChB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;CAClB,CAAC,CAAC;AAEH,qFAAqF;AACrF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAC7C,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAChD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAC9C,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAC/C,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC;AACj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AAE,CAAC;gBAC1B,OAAO,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;YAC9C,CAAC;YACD,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;gBAC/B,OAAO,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACnD,CAAC;YAED,OAAO,IAAI,CAAC,CAAC;YACb,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;YAC/E,KAAK,CAAC,gBAAgB,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAE9E,IAAI,KAAK,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;gBACxB,kEAAkE;gBAClE,uDAAuD;gBACvD,OAAO,IAAI,CAAC,SAAS,EAAE,eAAe,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;YACtD,CAAC;YACD,IAAI,aAAa,GAAG,yBAAyB,EAAE,CAAC;gBAC9C,wEAAwE;gBACxE,OAAO,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;YAC9C,CAAC;YACD,IAAI,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,SAAS;gBAAE,MAAM;QAC/C,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Discriminated union for EventLogEntry — replaces flat data: Record<string, unknown>.
|
|
3
3
|
* Each union member is keyed on the `type` field for type narrowing.
|
|
4
4
|
*/
|
|
5
|
-
import { type Static } from '@sinclair/typebox';
|
|
6
5
|
import type { ToolCallEventData, PainSignalEventData, RulePromotionEventData, GovernanceActionEventData, HookExecutionEventData, GateBlockEventData, GateBypassEventData, EvolutionTaskEventData, EmpathyRollbackEventData, EventCategory } from './event-types.js';
|
|
7
6
|
export type EventLogEntry = {
|
|
8
7
|
ts: string;
|
|
@@ -216,5 +215,4 @@ export declare const DiscriminatedEventLogEntrySchema: import("@sinclair/typebox
|
|
|
216
215
|
workspaceDir: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
217
216
|
data: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>;
|
|
218
217
|
}>]>;
|
|
219
|
-
export type DiscriminatedEventLogEntryStatic = Static<typeof DiscriminatedEventLogEntrySchema>;
|
|
220
218
|
//# sourceMappingURL=event-payload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-payload.d.ts","sourceRoot":"","sources":["../../../src/runtime/types/event-payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"event-payload.d.ts","sourceRoot":"","sources":["../../../src/runtime/types/event-payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAG1B,MAAM,MAAM,aAAa,GACrB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAC5I;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE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