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
|
@@ -49,6 +49,22 @@ function mergeDeclarations(declarations) {
|
|
|
49
49
|
nextAction: 'each raw tool name must resolve to one canonical kind across all co-installed hosts — fix the conflicting host declaration',
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
// ADR-0030: the payload encoding is part of the same identity. Two hosts
|
|
53
|
+
// claiming the same write tool with different encodings cannot both be
|
|
54
|
+
// right, and picking by startup order would make parsing order-dependent.
|
|
55
|
+
//
|
|
56
|
+
// An ABSENT format is a claim of plain content, not "no opinion": with a
|
|
57
|
+
// single-value enum this is the only reading under which the guard can
|
|
58
|
+
// fire, so "host A omits / host B declares the patch envelope" is a real
|
|
59
|
+
// disagreement (fail loud) rather than silently resolved drift. The fix
|
|
60
|
+
// belongs in the host declaration, never here.
|
|
61
|
+
if (existing && existing.writePayloadFormat !== mapping.writePayloadFormat) {
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
reason: `host_tool_declaration_invalid (conflicting writePayloadFormat for '${mapping.rawToolName}': ${existing.writePayloadFormat ?? 'unset'} vs ${mapping.writePayloadFormat ?? 'unset'})`,
|
|
65
|
+
nextAction: 'each raw tool name must resolve to one write payload format across all co-installed hosts — fix the conflicting host declaration',
|
|
66
|
+
};
|
|
67
|
+
}
|
|
52
68
|
if (!existing)
|
|
53
69
|
mappings.push(mapping);
|
|
54
70
|
}
|
|
@@ -81,6 +97,7 @@ export function resolveWorkspaceHostToolSemantics(workspaceDir) {
|
|
|
81
97
|
ok: true,
|
|
82
98
|
registry: built.registry,
|
|
83
99
|
hostKinds: loaded.declarations.map((d) => d.hostKind).sort(),
|
|
100
|
+
warnings: loaded.warnings,
|
|
84
101
|
};
|
|
85
102
|
}
|
|
86
103
|
/**
|
|
@@ -101,6 +118,9 @@ export function resolveWorkspaceHostToolSemantics(workspaceDir) {
|
|
|
101
118
|
* - malformed / conflicting declaration → typed refusal, never a silent
|
|
102
119
|
* static fallback and never an empty registry. Consumers must surface the
|
|
103
120
|
* reason (rc-9) and may fall back to their static registry for availability.
|
|
121
|
+
* - legacy declaration version (v1 read by a v2 build) → NOT a refusal: the
|
|
122
|
+
* file is read with v1 semantics (`writePayloadFormat` unset) and the
|
|
123
|
+
* result carries `warnings`, which consumers must surface (rc-9).
|
|
104
124
|
*/
|
|
105
125
|
export function resolveHostToolSemanticsForHook(options) {
|
|
106
126
|
const builtStatic = buildToolSemanticRegistry(options.staticMappings);
|
|
@@ -114,7 +134,7 @@ export function resolveHostToolSemanticsForHook(options) {
|
|
|
114
134
|
const loaded = loadHostToolDeclarations(options.workspaceDir);
|
|
115
135
|
if (!loaded.ok) {
|
|
116
136
|
if (loaded.reason === 'host_tool_declaration_missing') {
|
|
117
|
-
return { ok: true, registry: builtStatic.registry, source: 'host-static' };
|
|
137
|
+
return { ok: true, registry: builtStatic.registry, source: 'host-static', warnings: [] };
|
|
118
138
|
}
|
|
119
139
|
return { ok: false, reason: loaded.reason, nextAction: loaded.nextAction };
|
|
120
140
|
}
|
|
@@ -134,6 +154,6 @@ export function resolveHostToolSemanticsForHook(options) {
|
|
|
134
154
|
nextAction: `merged tool mappings invalid: ${built.errors.slice(0, 3).join('; ')}`,
|
|
135
155
|
};
|
|
136
156
|
}
|
|
137
|
-
return { ok: true, registry: built.registry, source: 'workspace-declaration' };
|
|
157
|
+
return { ok: true, registry: built.registry, source: 'workspace-declaration', warnings: loaded.warnings };
|
|
138
158
|
}
|
|
139
159
|
export { saveHostToolDeclaration };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type HostEvent, type HostEventResult, type HostEventEmitter } from '@principles/core/host';
|
|
2
|
+
import type { AdaptivePriorityProvider } from './adaptive-priority-provider.js';
|
|
2
3
|
import { buildActivePrinciplePromptContext } from './active-principle-prompt.js';
|
|
3
4
|
import { type RuleContextProvider, type RuleInputEnrichmentProvider } from './production-rulehost-gate.js';
|
|
4
5
|
import type { RuleImplementationRuntime } from './rule-implementation-runtime.js';
|
|
@@ -17,6 +18,7 @@ export * from './production-rulehost-gate.js';
|
|
|
17
18
|
export * from './rule-implementation-runtime.js';
|
|
18
19
|
export * from './production-pain-evidence.js';
|
|
19
20
|
export * from './governance-observation-store.js';
|
|
21
|
+
export * from './trajectory-retention.js';
|
|
20
22
|
export * from './conversation-ingestion/index.js';
|
|
21
23
|
export * from './governance-signal-admission.js';
|
|
22
24
|
export * from './signal-classifier.js';
|
|
@@ -92,6 +94,7 @@ export declare function createProductionHostRuntime(options?: Partial<Pick<HostR
|
|
|
92
94
|
* before this convergence. Must be a positive integer when present.
|
|
93
95
|
*/
|
|
94
96
|
roundKeyProvider?: (event: HostEvent) => number | undefined | Promise<number | undefined>;
|
|
97
|
+
adaptiveGapProvider?: AdaptivePriorityProvider;
|
|
95
98
|
/** Optional, already-scoped single prompt target from the host adapter. Errors fail closed to Native. */
|
|
96
99
|
adaptivePriorityProvider?: (event: HostEvent) => {
|
|
97
100
|
artifactId: string;
|
|
@@ -29,6 +29,10 @@ export * from './production-rulehost-gate.js';
|
|
|
29
29
|
export * from './rule-implementation-runtime.js';
|
|
30
30
|
export * from './production-pain-evidence.js';
|
|
31
31
|
export * from './governance-observation-store.js';
|
|
32
|
+
// SPEC-PD-TR-001: trajectory retention I/O boundary (lock + marker + export
|
|
33
|
+
// list + explicit VACUUM). The policy/batch engine is pure and lives in
|
|
34
|
+
// `@principles/core/runtime`.
|
|
35
|
+
export * from './trajectory-retention.js';
|
|
32
36
|
// PRI-1171: unified conversation-ingestion seam — the ONE host-neutral entry
|
|
33
37
|
// for transcript trajectory ingestion (source contract + shared pipeline +
|
|
34
38
|
// consent ledger v3 + text policy). Host decoders stay in their adapter
|
|
@@ -279,6 +283,16 @@ export function createProductionHostRuntime(options = {}) {
|
|
|
279
283
|
const prompt = await buildActivePrinciplePromptContext({
|
|
280
284
|
workspaceDir: event.context.workspaceDir,
|
|
281
285
|
...(roundKey !== undefined ? { roundKey } : {}),
|
|
286
|
+
...(options.adaptiveGapProvider ? {
|
|
287
|
+
async selectNativeGap(candidates, gapOptions) {
|
|
288
|
+
try {
|
|
289
|
+
return await options.adaptiveGapProvider?.(event, candidates, gapOptions);
|
|
290
|
+
}
|
|
291
|
+
catch {
|
|
292
|
+
return undefined;
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
} : {}),
|
|
282
296
|
...(adaptivePriority ? {
|
|
283
297
|
adaptivePriority: { artifactId: adaptivePriority.artifactId, activationId: adaptivePriority.activationId },
|
|
284
298
|
...(adaptivePriority.additiveOnly === true ? { additiveOnly: true } : {}),
|
|
@@ -323,6 +337,9 @@ export function createProductionHostRuntime(options = {}) {
|
|
|
323
337
|
// failure must not block the prompt result — it degrades to an
|
|
324
338
|
// observable warning (rc-9).
|
|
325
339
|
const emissionWarnings = [];
|
|
340
|
+
if (prompt.adaptivePacking?.source === 'native_gap' && prompt.adaptivePacking.status === 'unavailable') {
|
|
341
|
+
emissionWarnings.push(`adaptive_assembly_unavailable:${prompt.adaptivePacking.reason}`);
|
|
342
|
+
}
|
|
326
343
|
try {
|
|
327
344
|
options.events?.recordRuntimeActivationsInjected({
|
|
328
345
|
sessionId: event.context.sessionId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ToolSemanticRegistry, type GovernanceHostKind } from '@principles/core/runtime';
|
|
1
|
+
import { type RuleHostResult, type ToolSemanticRegistry, type GovernanceHostKind } from '@principles/core/runtime';
|
|
2
2
|
import type { HostEvent, HostEventResult } from '@principles/core/host';
|
|
3
3
|
import { type RuleImplementationRuntime } from './rule-implementation-runtime.js';
|
|
4
4
|
export interface ProductionRuleContextRequest {
|
|
@@ -29,5 +29,40 @@ export interface ProductionRuleHostGateOptions {
|
|
|
29
29
|
* (shell/cmd/insert/patch/delete_file/move_file were never hinted).
|
|
30
30
|
*/
|
|
31
31
|
toolSemantics?: ToolSemanticRegistry;
|
|
32
|
+
/**
|
|
33
|
+
* PRI-1187: observation-only signal for the accepted "over-block" tradeoff.
|
|
34
|
+
*
|
|
35
|
+
* When a rule declares `affectedTools` and the current action family is NOT
|
|
36
|
+
* in that declaration, the rule is still evaluated (never skipped). This
|
|
37
|
+
* sink records one structured event per such evaluation so we can measure
|
|
38
|
+
* how much over-blocking exists and which rules cause it.
|
|
39
|
+
*
|
|
40
|
+
* Defaults ON. Silence it with `{ enabled: false }` or the environment
|
|
41
|
+
* variable `PD_AFFECTED_TOOLS_OBSERVABILITY=0`. The sink is called inside a
|
|
42
|
+
* try/catch and can never alter the decision.
|
|
43
|
+
*/
|
|
44
|
+
affectedToolsObservability?: AffectedToolsObservabilityOptions;
|
|
45
|
+
}
|
|
46
|
+
/** One observation-only "declared scope does not cover the action" record. */
|
|
47
|
+
export interface AffectedToolsMismatchEvent {
|
|
48
|
+
ruleId: string;
|
|
49
|
+
activationId: string;
|
|
50
|
+
activationMode: 'live' | 'shadow';
|
|
51
|
+
toolName: string;
|
|
52
|
+
/** Action family resolved by the ToolSemanticRegistry (write/execute/agent…). */
|
|
53
|
+
actionFamily: string;
|
|
54
|
+
/** Raw declaration, verbatim from the artifact. */
|
|
55
|
+
declaredTools: string[];
|
|
56
|
+
/** Resolved families of `declaredTools` (never empty when emitted). */
|
|
57
|
+
declaredFamilies: string[];
|
|
58
|
+
/** The rule's own decision for this call (not the merged verdict). */
|
|
59
|
+
decision: RuleHostResult['decision'];
|
|
60
|
+
hostKind?: GovernanceHostKind;
|
|
61
|
+
}
|
|
62
|
+
export interface AffectedToolsObservabilityOptions {
|
|
63
|
+
/** Defaults to `PD_AFFECTED_TOOLS_OBSERVABILITY !== '0' | 'false' | 'off'`. */
|
|
64
|
+
enabled?: boolean;
|
|
65
|
+
/** Defaults to one structured JSON line on `console.warn`. */
|
|
66
|
+
sink?: (event: AffectedToolsMismatchEvent) => void;
|
|
32
67
|
}
|
|
33
68
|
export declare function createProductionRuleHostGate(options?: ProductionRuleHostGateOptions): (event: HostEvent) => Promise<HostEventResult>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { buildRuleHostAction, buildToolSemanticRegistry, deriveToolHintsFromCanonicalKind, estimateLineChanges, mergeDecisions, normalizeRuleHostResult, SqliteConnection, UNAVAILABLE_RULE_CONTEXT, validateRuleContextV2, verifyPiArtifactRowDigest, RECOVERY_CONTROL_SURFACES, } from '@principles/core/runtime';
|
|
4
|
-
import { isSensitiveSystemPath } from '@principles/core/runtime/internalization/rule-host-input-builder';
|
|
4
|
+
import { isRuleHostEvaluableKind, isSensitiveSystemPath } from '@principles/core/runtime/internalization/rule-host-input-builder';
|
|
5
5
|
import { classifyBashRisk } from '@principles/core/runtime/internalization/bash-risk';
|
|
6
6
|
import { scanRetiredContractSymbols } from './legacy-rule-contract-symbols.js';
|
|
7
7
|
import { recordDegradedEnforcement } from './degraded-enforcement-marker.js';
|
|
@@ -10,6 +10,27 @@ const WARNING_LIMIT = 500;
|
|
|
10
10
|
const MAX_WARNINGS = 16;
|
|
11
11
|
const GATE_DEADLINE_MS = 3_000;
|
|
12
12
|
const ARTIFACT_CONTENT_BYTES = 512 * 1024;
|
|
13
|
+
/**
|
|
14
|
+
* Production RuleHost gate — the shared decision path for every supported host.
|
|
15
|
+
*
|
|
16
|
+
* PRI-1187 (Owner decision 2026-11-12): rules are NEVER filtered by
|
|
17
|
+
* `affectedTools`. Over-blocking (a write-only rule also observing exec) is
|
|
18
|
+
* accepted noise; under-blocking is not. `affectedTools` is the DECLARED
|
|
19
|
+
* SCOPE used by activation (`validateRuleReliability`: golden-trace tool
|
|
20
|
+
* families must be a subset of the declared families) and by approval/audit
|
|
21
|
+
* surfaces — it is NOT an execution bound.
|
|
22
|
+
*
|
|
23
|
+
* DO NOT re-add a runtime filter here. Three review rounds each found a way to
|
|
24
|
+
* skip a call the rule was validated to block: the reserved `host-liveness:`
|
|
25
|
+
* prefix, a narrow declaration with a broad implementation, and a guard that
|
|
26
|
+
* only inspected the golden trace. The decision and the follow-up ticket live
|
|
27
|
+
* in docs/proposals/PRI-1187-write-only-rule-exec-false-positive.md.
|
|
28
|
+
*
|
|
29
|
+
* The only affectedTools runtime code allowed in this file is the
|
|
30
|
+
* observation-only mismatch signal below: it logs, it never changes the
|
|
31
|
+
* evaluation set or the verdict.
|
|
32
|
+
*/
|
|
33
|
+
const AFFECTED_TOOLS_OBSERVABILITY_ENV = 'PD_AFFECTED_TOOLS_OBSERVABILITY';
|
|
13
34
|
// Check the actual imported builder, not an installed-package version string:
|
|
14
35
|
// a mixed host-runtime/core deployment must not claim input-v2 support.
|
|
15
36
|
const RECOVERY_INPUT_V2_AVAILABLE = RECOVERY_CONTROL_SURFACES
|
|
@@ -82,9 +103,73 @@ if (!baselineToolSemanticsResult.ok) {
|
|
|
82
103
|
throw new Error(`baseline tool semantic registry failed to build: ${baselineToolSemanticsResult.errors.join('; ')}`);
|
|
83
104
|
}
|
|
84
105
|
const BASELINE_TOOL_SEMANTICS = baselineToolSemanticsResult.registry;
|
|
106
|
+
/**
|
|
107
|
+
* Resolve a rule's declared scope for OBSERVATION ONLY.
|
|
108
|
+
*
|
|
109
|
+
* Returns `null` when the declaration cannot prove a mismatch (absent, not an
|
|
110
|
+
* array, empty, malformed entry, or a name the registry cannot classify). A
|
|
111
|
+
* `null` declaration therefore emits nothing — the signal must never guess,
|
|
112
|
+
* because a false positive would misdirect the follow-up work that decides
|
|
113
|
+
* whether the no-filter tradeoff stays.
|
|
114
|
+
*/
|
|
115
|
+
function resolveDeclaredFamilies(affectedTools, toolSemantics) {
|
|
116
|
+
if (!Array.isArray(affectedTools) || affectedTools.length === 0)
|
|
117
|
+
return null;
|
|
118
|
+
const tools = [];
|
|
119
|
+
const families = new Set();
|
|
120
|
+
for (const declared of affectedTools) {
|
|
121
|
+
if (typeof declared !== 'string' || declared.trim().length === 0)
|
|
122
|
+
return null;
|
|
123
|
+
const kind = toolSemantics.lookup(declared);
|
|
124
|
+
if (kind === null)
|
|
125
|
+
return null;
|
|
126
|
+
tools.push(declared);
|
|
127
|
+
families.add(kind);
|
|
128
|
+
}
|
|
129
|
+
return families.size === 0 ? null : { tools, families: [...families] };
|
|
130
|
+
}
|
|
131
|
+
function affectedToolsObservabilityDisabledByEnv() {
|
|
132
|
+
const raw = process.env[AFFECTED_TOOLS_OBSERVABILITY_ENV]?.trim().toLowerCase();
|
|
133
|
+
return raw === '0' || raw === 'false' || raw === 'off';
|
|
134
|
+
}
|
|
135
|
+
function defaultAffectedToolsSink(event) {
|
|
136
|
+
console.warn(`[PD:RuleHost] affected_tools_mismatch ${JSON.stringify(event)}`);
|
|
137
|
+
}
|
|
85
138
|
export function createProductionRuleHostGate(options = {}) {
|
|
86
139
|
const implementationRuntime = options.implementationRuntime ?? createNodeRuleImplementationRuntime();
|
|
87
140
|
const toolSemantics = options.toolSemantics ?? BASELINE_TOOL_SEMANTICS;
|
|
141
|
+
const observabilityEnabled = options.affectedToolsObservability?.enabled
|
|
142
|
+
?? !affectedToolsObservabilityDisabledByEnv();
|
|
143
|
+
const observabilitySink = options.affectedToolsObservability?.sink ?? defaultAffectedToolsSink;
|
|
144
|
+
/**
|
|
145
|
+
* PRI-1187 observation-only: record that a declared scope did not cover the
|
|
146
|
+
* action while the rule was still evaluated. MUST NOT skip, reorder, or
|
|
147
|
+
* mutate anything. Sink failures are swallowed for the same reason.
|
|
148
|
+
*/
|
|
149
|
+
const emitAffectedToolsMismatch = (candidate, observation) => {
|
|
150
|
+
if (!observabilityEnabled)
|
|
151
|
+
return;
|
|
152
|
+
if (candidate.declaredTools === null || candidate.declaredFamilies === null)
|
|
153
|
+
return;
|
|
154
|
+
if (candidate.declaredFamilies.includes(observation.actionFamily))
|
|
155
|
+
return;
|
|
156
|
+
try {
|
|
157
|
+
observabilitySink({
|
|
158
|
+
ruleId: candidate.ruleId,
|
|
159
|
+
activationId: candidate.implId,
|
|
160
|
+
activationMode: candidate.activationMode,
|
|
161
|
+
toolName: observation.toolName,
|
|
162
|
+
actionFamily: observation.actionFamily,
|
|
163
|
+
declaredTools: candidate.declaredTools,
|
|
164
|
+
declaredFamilies: candidate.declaredFamilies,
|
|
165
|
+
decision: observation.decision,
|
|
166
|
+
...(options.hostKind !== undefined ? { hostKind: options.hostKind } : {}),
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
// Observation must never affect enforcement.
|
|
171
|
+
}
|
|
172
|
+
};
|
|
88
173
|
return async (event) => {
|
|
89
174
|
const startedAt = Date.now();
|
|
90
175
|
const warnings = [];
|
|
@@ -93,9 +178,21 @@ export function createProductionRuleHostGate(options = {}) {
|
|
|
93
178
|
return { decision: 'allow', source: event.source, warnings: [boundedWarning('tool_input_invalid', 'decode and validate toolName and params before dispatch')] };
|
|
94
179
|
}
|
|
95
180
|
const canonicalKind = toolSemantics.resolve(input.toolName);
|
|
181
|
+
// PRI-1184 / F3': restore the RuleHost routing contract. Only the write,
|
|
182
|
+
// execute and agent families enter rule evaluation; read/search and every
|
|
183
|
+
// other canonical kind are allowed without touching the RuleCode engine.
|
|
184
|
+
// The kind comes from the same ToolSemanticRegistry that supplies the
|
|
185
|
+
// extraction hints below — never a tool-name allowlist.
|
|
186
|
+
if (!isRuleHostEvaluableKind(canonicalKind)) {
|
|
187
|
+
return { decision: 'allow', source: event.source, metadata: { evaluatedLiveRules: 0 } };
|
|
188
|
+
}
|
|
96
189
|
const { isBashTool: isBash, isWriteTool: isWrite } = deriveToolHintsFromCanonicalKind(canonicalKind);
|
|
97
190
|
const action = buildRuleHostAction(input.toolName, input.params, options.projectDir ?? event.context.workspaceDir, { isBashTool: isBash, isWriteTool: isWrite, canonicalKind });
|
|
98
|
-
|
|
191
|
+
// F3': normalizePathPure returns '' when no path could be extracted, so the
|
|
192
|
+
// old `=== null` guard never fired. Both null and '' mean "no action
|
|
193
|
+
// target": a pathless tool is not evaluated rather than treating an empty
|
|
194
|
+
// string as a path.
|
|
195
|
+
if (action.normalizedPath === null || action.normalizedPath === '')
|
|
99
196
|
return { decision: 'allow', source: event.source, metadata: { evaluatedLiveRules: 0 } };
|
|
100
197
|
let context;
|
|
101
198
|
/**
|
|
@@ -509,7 +606,10 @@ export function createProductionRuleHostGate(options = {}) {
|
|
|
509
606
|
continue;
|
|
510
607
|
}
|
|
511
608
|
const fallbackMeta = { name: activationId, version: '1', ruleId, coversCondition: 'all' };
|
|
512
|
-
|
|
609
|
+
// PRI-1187: resolved for the observation-only mismatch signal; it
|
|
610
|
+
// is attached to the candidate but never filters the batch.
|
|
611
|
+
const declaredScope = resolveDeclaredFamilies(content.affectedTools, toolSemantics);
|
|
612
|
+
candidates.push({ implId: activationId, ruleId, principleId, meta: isRuleMeta(content.meta) ? content.meta : fallbackMeta, source: content.implementationCode, activationMode, declaredTools: declaredScope?.tools ?? null, declaredFamilies: declaredScope?.families ?? null });
|
|
513
613
|
}
|
|
514
614
|
catch (error) {
|
|
515
615
|
addWarning(warnings, `implementation_unhealthy: ${error instanceof Error ? error.message : String(error)}`, 'fix the RuleCode and reactivate the rule');
|
|
@@ -521,7 +621,7 @@ export function createProductionRuleHostGate(options = {}) {
|
|
|
521
621
|
workspace: { isRiskPath: isSensitiveSystemPath(action.normalizedPath) },
|
|
522
622
|
session: { sessionId: event.context.sessionId },
|
|
523
623
|
evolution: { epTier: enrichment.epTier },
|
|
524
|
-
derived: { estimatedLineChanges: estimateLineChanges({ toolName: input.toolName, params: input.params }), bashRisk: enrichment.bashRisk },
|
|
624
|
+
derived: { estimatedLineChanges: estimateLineChanges({ toolName: input.toolName, params: input.params }, toolSemantics), bashRisk: enrichment.bashRisk },
|
|
525
625
|
...(context ? { context } : {}),
|
|
526
626
|
};
|
|
527
627
|
// CodeRabbit CR-3: live and shadow evaluate in SEPARATE batches so a
|
|
@@ -593,6 +693,7 @@ export function createProductionRuleHostGate(options = {}) {
|
|
|
593
693
|
const shadowResult = normalized.matched
|
|
594
694
|
? { ...normalized, ruleId: candidate.ruleId, principleId: candidate.principleId }
|
|
595
695
|
: normalized;
|
|
696
|
+
emitAffectedToolsMismatch(candidate, { decision: shadowResult.decision, actionFamily: canonicalKind, toolName: input.toolName });
|
|
596
697
|
shadowEvaluations.push({
|
|
597
698
|
toolName: input.toolName,
|
|
598
699
|
filePath: action.normalizedPath,
|
|
@@ -633,6 +734,7 @@ export function createProductionRuleHostGate(options = {}) {
|
|
|
633
734
|
: normalized;
|
|
634
735
|
implementations.push({ ...candidate, evaluate: () => validatedResult });
|
|
635
736
|
liveEvaluatedResults.push(validatedResult);
|
|
737
|
+
emitAffectedToolsMismatch(candidate, { decision: validatedResult.decision, actionFamily: canonicalKind, toolName: input.toolName });
|
|
636
738
|
}
|
|
637
739
|
const result = mergeDecisions(implementations, hostInput, {
|
|
638
740
|
warn(message) { addWarning(warnings, message, 'inspect the unhealthy activation and RuleCode output'); },
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { type RetentionIndexReport, type TrajectoryRetentionMarker, type TrajectoryRetentionPolicy } from '@principles/core/runtime';
|
|
2
|
+
export declare const TRAJECTORY_RETENTION_MARKER_FILENAME = "trajectory-retention.json";
|
|
3
|
+
export declare const TRAJECTORY_RETENTION_LOCK_FILENAME = "trajectory-retention.lock";
|
|
4
|
+
/** 10 minutes: far above the 3 s run budget, so a live run is never taken over. */
|
|
5
|
+
export declare const TRAJECTORY_RETENTION_LOCK_STALE_MS: number;
|
|
6
|
+
/**
|
|
7
|
+
* The maintenance connection waits at most this long for the write lock.
|
|
8
|
+
*
|
|
9
|
+
* SPEC §4.2 says `busy_timeout = 5000`; acceptance criterion A8 requires the
|
|
10
|
+
* maintenance run to yield within 300 ms when another writer holds the lock.
|
|
11
|
+
* Those two cannot both hold, and A8 is the measurable one, so the write lock
|
|
12
|
+
* wait wins: a sweeper that queues behind the user's writer turns a background
|
|
13
|
+
* chore into user-visible latency. Reads in WAL mode do not need this wait.
|
|
14
|
+
*
|
|
15
|
+
* 100 ms (not 250) because SQLite's busy handler overshoots its timeout by up
|
|
16
|
+
* to one sleep step (~100 ms): a 250 ms timeout was measured at ~355 ms
|
|
17
|
+
* wall-clock, which breaks A8. Ordinary host writes hold the lock for
|
|
18
|
+
* milliseconds, so 100 ms is still enough to ride out normal contention.
|
|
19
|
+
*/
|
|
20
|
+
export declare const TRAJECTORY_RETENTION_WRITE_LOCK_WAIT_MS = 100;
|
|
21
|
+
/**
|
|
22
|
+
* Index DDL is NOT the hot path and is NEVER attempted by a regular sweep
|
|
23
|
+
* (F2: a 5 s wait at the start of every run stalled the host). Creation only
|
|
24
|
+
* happens in the explicit maintenance entry, which may use this longer wait.
|
|
25
|
+
*/
|
|
26
|
+
export declare const TRAJECTORY_RETENTION_DDL_BUSY_TIMEOUT_MS = 5000;
|
|
27
|
+
/** VACUUM is a foreground, explicit action; it may wait properly. */
|
|
28
|
+
export declare const TRAJECTORY_RETENTION_VACUUM_BUSY_TIMEOUT_MS = 5000;
|
|
29
|
+
export type TrajectoryRetentionTrigger = 'worker' | 'manual';
|
|
30
|
+
export type TrajectoryRetentionReportOutcome = 'completed' | 'partial' | 'deadline' | 'invariant_violation' | 'deferred:busy' | 'skipped';
|
|
31
|
+
export interface TrajectoryRetentionReport {
|
|
32
|
+
outcome: TrajectoryRetentionReportOutcome;
|
|
33
|
+
reason: string | null;
|
|
34
|
+
workspaceDir: string;
|
|
35
|
+
cutoff: string | null;
|
|
36
|
+
deletedByTable: Record<string, number>;
|
|
37
|
+
batches: number;
|
|
38
|
+
/** Batch-engine wall clock only. */
|
|
39
|
+
durationMs: number;
|
|
40
|
+
/** Whole run, including DB open, WAL check, index DDL and marker write (A1). */
|
|
41
|
+
totalDurationMs: number;
|
|
42
|
+
maxBatchDurationMs: number;
|
|
43
|
+
partial: boolean;
|
|
44
|
+
backoffUntil: string | null;
|
|
45
|
+
policy: TrajectoryRetentionPolicy;
|
|
46
|
+
indexes: RetentionIndexReport | null;
|
|
47
|
+
/** Non-null when index creation failed but the sweep continued anyway. */
|
|
48
|
+
indexesError: string | null;
|
|
49
|
+
/** Present on refused/failed outcomes (cli-6). */
|
|
50
|
+
nextAction?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface RunTrajectoryRetentionOptions {
|
|
53
|
+
workspaceDir: string;
|
|
54
|
+
trigger?: TrajectoryRetentionTrigger;
|
|
55
|
+
/** Injectable clock (tests, deterministic marker/cutoff assertions). */
|
|
56
|
+
now?: () => number;
|
|
57
|
+
}
|
|
58
|
+
export declare function trajectoryRetentionPaths(workspaceDir: string): {
|
|
59
|
+
stateDir: string;
|
|
60
|
+
dbPath: string;
|
|
61
|
+
markerPath: string;
|
|
62
|
+
lockPath: string;
|
|
63
|
+
exportsDir: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* One retention attempt for one workspace.
|
|
67
|
+
*
|
|
68
|
+
* Synchronous on purpose: callers are a worker cycle and a CLI command, both
|
|
69
|
+
* of which already own their concurrency, and a fire-and-forget promise in a
|
|
70
|
+
* worker loop is a crash risk with no upside.
|
|
71
|
+
*/
|
|
72
|
+
export declare function runTrajectoryRetention(options: RunTrajectoryRetentionOptions): TrajectoryRetentionReport;
|
|
73
|
+
export interface TrajectoryRetentionLogger {
|
|
74
|
+
info?: (message: string) => void;
|
|
75
|
+
warn?: (message: string) => void;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Long-lived failure reasons repeat on every worker cycle. Return a message
|
|
79
|
+
* only when the reason for THIS workspace changed, so a permanently wrong
|
|
80
|
+
* `journal_mode` or a failing index DDL is visible once, not every 120 s
|
|
81
|
+
* (review finding 7).
|
|
82
|
+
*/
|
|
83
|
+
export declare function retentionWarning(report: TrajectoryRetentionReport): string | null;
|
|
84
|
+
/**
|
|
85
|
+
* Schedule the periodic retention run for a long-lived host process.
|
|
86
|
+
*
|
|
87
|
+
* SPEC §4.1: an unref'd interval in the gateway process. Deliberately does NOT
|
|
88
|
+
* run at scheduling time — that call happens inside `before_prompt_build`, and
|
|
89
|
+
* a 3 s sweep there would be exactly the hook latency A3 forbids. The first
|
|
90
|
+
* attempt happens one minute later, off the hook path.
|
|
91
|
+
*
|
|
92
|
+
* Idempotent per workspace: repeated plugin initialisation cannot stack timers.
|
|
93
|
+
* Config is read once here (interval); the runner re-reads it every cycle, so
|
|
94
|
+
* `enabled`/range changes still take effect.
|
|
95
|
+
*/
|
|
96
|
+
export declare function scheduleTrajectoryRetention(workspaceDirInput: string, logger?: TrajectoryRetentionLogger): void;
|
|
97
|
+
export interface TrajectoryRetentionStatus {
|
|
98
|
+
workspaceDir: string;
|
|
99
|
+
dbPath: string;
|
|
100
|
+
dbExists: boolean;
|
|
101
|
+
marker: TrajectoryRetentionMarker;
|
|
102
|
+
markerError: string | null;
|
|
103
|
+
policy: TrajectoryRetentionPolicy;
|
|
104
|
+
/** Cutoff the NEXT run will use; null when no sweep can run. */
|
|
105
|
+
nextCutoff: string | null;
|
|
106
|
+
/** Rows the NEXT run's cutoff would select (same rule, same predicate). */
|
|
107
|
+
expiredByTable: Record<string, number> | null;
|
|
108
|
+
/** Retention indexes absent from the database (created by `vacuum --yes`). */
|
|
109
|
+
indexesMissing: string[];
|
|
110
|
+
dbError: string | null;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Read-only status: never creates the marker, never opens the database for
|
|
114
|
+
* writing, never creates an index.
|
|
115
|
+
*
|
|
116
|
+
* `now` is injectable so the projected next cutoff can be asserted exactly
|
|
117
|
+
* against the run that follows it (F4: one definition of "expired").
|
|
118
|
+
*/
|
|
119
|
+
export declare function readTrajectoryRetentionStatus(workspaceDirInput: string, now?: () => number): TrajectoryRetentionStatus;
|
|
120
|
+
export interface TrajectoryVacuumReport {
|
|
121
|
+
workspaceDir: string;
|
|
122
|
+
dbPath: string;
|
|
123
|
+
applied: boolean;
|
|
124
|
+
refusedReason: string | null;
|
|
125
|
+
nextAction?: string;
|
|
126
|
+
sizeBeforeBytes: number;
|
|
127
|
+
sizeAfterBytes: number | null;
|
|
128
|
+
freeBytes: number | null;
|
|
129
|
+
requiredBytes: number | null;
|
|
130
|
+
freelistBefore: number | null;
|
|
131
|
+
freelistAfter: number | null;
|
|
132
|
+
/** Retention indexes created here — the ONLY place DDL may run (F2). */
|
|
133
|
+
indexes: RetentionIndexReport | null;
|
|
134
|
+
durationMs: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* `pd trajectory vacuum` — the ONLY place VACUUM may run (SPEC §6).
|
|
138
|
+
*
|
|
139
|
+
* VACUUM takes an exclusive lock and cannot be interrupted, which is why it is
|
|
140
|
+
* never scheduled. Default is a dry run: it reports the space requirement and
|
|
141
|
+
* refuses to start when the filesystem cannot hold `2 × size + 10%`.
|
|
142
|
+
*/
|
|
143
|
+
export declare function vacuumTrajectoryDatabase(args: {
|
|
144
|
+
workspaceDir: string;
|
|
145
|
+
apply: boolean;
|
|
146
|
+
now?: () => number;
|
|
147
|
+
}): TrajectoryVacuumReport;
|