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,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PRI-1182 — Adaptive Activation: the real Decisions scoring protocol.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from the already-verified lab implementation
|
|
5
|
+
* (`scripts/dev/adaptive-selector-lab/diagnostic.mjs`): one POST with
|
|
6
|
+
* `{model, state, questions, provider}`, one `{model, answers}` response.
|
|
7
|
+
*
|
|
8
|
+
* The difference from the lab experiment is the QUESTION SET: the lab asked
|
|
9
|
+
* four task-level questions, while production asks one independent
|
|
10
|
+
* applicability condition per candidate plus one "insufficient context"
|
|
11
|
+
* condition. Each answer is an independent `noul` score in [0, 1] — not a
|
|
12
|
+
* distribution — so PD adjudicates locally instead of trusting the model to
|
|
13
|
+
* emit a decision.
|
|
14
|
+
*
|
|
15
|
+
* Everything here is pure: no I/O, no clock, no transport. The caller owns
|
|
16
|
+
* scheduling, cancellation and diagnostics.
|
|
17
|
+
*/
|
|
18
|
+
export const ADAPTIVE_DECISION_MAX_CANDIDATE_CHARS = 600;
|
|
19
|
+
export const ADAPTIVE_DECISION_INSUFFICIENT_QUESTION = 'insufficient_context';
|
|
20
|
+
/** Preset applicability and context guards. Scores are model judgments, not calibrated probabilities. */
|
|
21
|
+
export const ADAPTIVE_DECISION_CRITERIA = {
|
|
22
|
+
version: 'v2-20261112',
|
|
23
|
+
/** A candidate must reach this independent score to be eligible. */
|
|
24
|
+
selectThreshold: 0.7,
|
|
25
|
+
/** Above this "information is insufficient" score, PD refuses to select. */
|
|
26
|
+
insufficientThreshold: 0.6,
|
|
27
|
+
};
|
|
28
|
+
export function candidateQuestionId(ref) {
|
|
29
|
+
return `candidate_${ref}`;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One question per candidate (its applicability condition) plus one
|
|
33
|
+
* "insufficient context" question. Instructions refer to the snapshot by ref;
|
|
34
|
+
* the candidate text itself travels once, in `state`.
|
|
35
|
+
*/
|
|
36
|
+
export function buildDecisionQuestions(candidates) {
|
|
37
|
+
const questions = {};
|
|
38
|
+
for (const candidate of candidates) {
|
|
39
|
+
questions[candidateQuestionId(candidate.ref)] = {
|
|
40
|
+
type: 'noul',
|
|
41
|
+
instructions: `依据 currentInstruction 判断用户现在要做什么,并比较 state.candidates。候选 ${candidate.ref} 是否直接适用于这项任务,且最能改善下一步具体行动?`
|
|
42
|
+
+ '能避免当前任务的具体失误或补上关键步骤时给高分。仅主题相近、重复用户已明确的要求、或对下一步没有实质帮助时给低分。没有合适候选时全部给低分。'
|
|
43
|
+
+ (candidate.replaces === undefined ? '' : ' 此方案会移除该候选在 state 中的 replaces 原则。只有候选对当前任务明显更有帮助,且移除原原则不会丢掉当前仍需的约束时才给高分;拿不准则给低分。'),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
questions[ADAPTIVE_DECISION_INSUFFICIENT_QUESTION] = {
|
|
47
|
+
type: 'noul',
|
|
48
|
+
instructions: '信息不足:当前输入是否缺少判断候选是否适用所需的信息(例如只有确认词、指代不明、'
|
|
49
|
+
+ '不知道在问哪一个任务)?信息不足时概率接近 1;能够明确判断时为 0。',
|
|
50
|
+
};
|
|
51
|
+
return questions;
|
|
52
|
+
}
|
|
53
|
+
export function buildDecisionRequest(input) {
|
|
54
|
+
if (input.candidates.length === 0) {
|
|
55
|
+
return { ok: false, reason: 'INPUT_REFUSED' };
|
|
56
|
+
}
|
|
57
|
+
const questions = buildDecisionQuestions(input.candidates);
|
|
58
|
+
const state = {
|
|
59
|
+
currentInstruction: input.currentInstruction,
|
|
60
|
+
priorMessages: input.priorMessages,
|
|
61
|
+
candidates: input.candidates.map((candidate) => ({
|
|
62
|
+
ref: candidate.ref,
|
|
63
|
+
text: candidate.text,
|
|
64
|
+
digest: candidate.digest,
|
|
65
|
+
...(candidate.replaces !== undefined ? { replaces: candidate.replaces } : {}),
|
|
66
|
+
})),
|
|
67
|
+
};
|
|
68
|
+
const body = {
|
|
69
|
+
model: input.model,
|
|
70
|
+
state: JSON.stringify(state),
|
|
71
|
+
questions,
|
|
72
|
+
...(input.provider
|
|
73
|
+
? { provider: { only: [input.provider], allow_fallbacks: false } }
|
|
74
|
+
: {}),
|
|
75
|
+
};
|
|
76
|
+
if (JSON.stringify({ state: body.state, questions }).length > input.maxPayloadChars) {
|
|
77
|
+
return { ok: false, reason: 'INPUT_REFUSED' };
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
ok: true,
|
|
81
|
+
body,
|
|
82
|
+
questionIds: [...Object.keys(questions)],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** rc-1/rc-2: parsed JSON is unknown until these guards pass. */
|
|
86
|
+
function isRecord(value) {
|
|
87
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Model identity is exact against an explicit allowlist when one is frozen
|
|
91
|
+
* (the acceptance batch does this). Otherwise one bounded alias class is
|
|
92
|
+
* accepted: a `:free` tag may be absent, and a dated canonical slug
|
|
93
|
+
* (`<base>-YYYYMMDD`) is accepted — the two aliases the lab verified.
|
|
94
|
+
*
|
|
95
|
+
* An unregistered DATE is never accepted through the allowlist path: the
|
|
96
|
+
* observed id must be one of the frozen strings, so a same-prefix slug with a
|
|
97
|
+
* different date is a mismatch.
|
|
98
|
+
*/
|
|
99
|
+
export function isDecisionModelIdentity(configured, observed, allowedResponseModels) {
|
|
100
|
+
if (allowedResponseModels !== undefined && allowedResponseModels.length > 0) {
|
|
101
|
+
return allowedResponseModels.includes(observed);
|
|
102
|
+
}
|
|
103
|
+
if (configured === observed)
|
|
104
|
+
return true;
|
|
105
|
+
const base = configured.endsWith(':free') ? configured.slice(0, -':free'.length) : configured;
|
|
106
|
+
if (base === observed)
|
|
107
|
+
return true;
|
|
108
|
+
return new RegExp(`^${base.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&')}-\\d{8}$`, 'u').test(observed);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Validates model identity, provider identity (when configured), completeness
|
|
112
|
+
* of the exact question set, and every score range. Any missing, extra or
|
|
113
|
+
* malformed answer is a rejected turn — never a partial score table.
|
|
114
|
+
*/
|
|
115
|
+
export function validateDecisionResponse(value, expected) {
|
|
116
|
+
if (!isRecord(value))
|
|
117
|
+
return { ok: false, reason: 'DECISION_OUTPUT_INVALID' };
|
|
118
|
+
const { model } = value;
|
|
119
|
+
if (typeof model !== 'string'
|
|
120
|
+
|| !isDecisionModelIdentity(expected.model, model, expected.allowedResponseModels)) {
|
|
121
|
+
return { ok: false, reason: 'DECISION_MODEL_MISMATCH' };
|
|
122
|
+
}
|
|
123
|
+
if (expected.provider !== undefined) {
|
|
124
|
+
const { provider } = value;
|
|
125
|
+
if (provider !== undefined
|
|
126
|
+
&& (typeof provider !== 'string' || provider.toLowerCase() !== expected.provider.toLowerCase())) {
|
|
127
|
+
return { ok: false, reason: 'DECISION_PROVIDER_MISMATCH' };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const { answers } = value;
|
|
131
|
+
if (!isRecord(answers))
|
|
132
|
+
return { ok: false, reason: 'DECISION_OUTPUT_INVALID' };
|
|
133
|
+
const answerKeys = Object.keys(answers);
|
|
134
|
+
if (answerKeys.length !== expected.questionIds.length
|
|
135
|
+
|| expected.questionIds.some((id) => !Object.hasOwn(answers, id))) {
|
|
136
|
+
return { ok: false, reason: 'DECISION_QUESTION_MISMATCH' };
|
|
137
|
+
}
|
|
138
|
+
const scores = {};
|
|
139
|
+
for (const id of expected.questionIds) {
|
|
140
|
+
const answer = answers[id];
|
|
141
|
+
if (!isRecord(answer) || answer.type !== 'noul') {
|
|
142
|
+
return { ok: false, reason: 'DECISION_OUTPUT_INVALID' };
|
|
143
|
+
}
|
|
144
|
+
const { noul } = answer;
|
|
145
|
+
if (typeof noul !== 'number' || !Number.isFinite(noul) || noul < 0 || noul > 1) {
|
|
146
|
+
return { ok: false, reason: 'DECISION_SCORE_INVALID' };
|
|
147
|
+
}
|
|
148
|
+
scores[id] = noul;
|
|
149
|
+
}
|
|
150
|
+
return { ok: true, scores };
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Local adjudication of the INDEPENDENT condition scores. Order matters:
|
|
154
|
+
* insufficient information first (it invalidates any candidate ranking), then
|
|
155
|
+
* the applicability threshold. An exact tie leaves no unique winner.
|
|
156
|
+
*/
|
|
157
|
+
export function adjudicateDecision(scores, candidates, criteria = ADAPTIVE_DECISION_CRITERIA) {
|
|
158
|
+
const insufficient = scores[ADAPTIVE_DECISION_INSUFFICIENT_QUESTION];
|
|
159
|
+
if (insufficient !== undefined && insufficient >= criteria.insufficientThreshold) {
|
|
160
|
+
return { status: 'uncertain', ref: null, reason: 'information_insufficient', scores };
|
|
161
|
+
}
|
|
162
|
+
const ranked = candidates
|
|
163
|
+
.map((candidate) => ({
|
|
164
|
+
ref: candidate.ref,
|
|
165
|
+
score: scores[candidateQuestionId(candidate.ref)] ?? 0,
|
|
166
|
+
}))
|
|
167
|
+
.sort((left, right) => right.score - left.score);
|
|
168
|
+
const [top, runnerUp] = ranked;
|
|
169
|
+
if (!top || top.score < criteria.selectThreshold) {
|
|
170
|
+
return { status: 'none_applicable', ref: null, reason: 'below_selection_threshold', scores };
|
|
171
|
+
}
|
|
172
|
+
if (runnerUp && top.score === runnerUp.score) {
|
|
173
|
+
return { status: 'uncertain', ref: null, reason: 'candidate_tied', scores };
|
|
174
|
+
}
|
|
175
|
+
return { status: 'selected', ref: top.ref, reason: 'selected', scores };
|
|
176
|
+
}
|
|
@@ -9,10 +9,17 @@
|
|
|
9
9
|
* mapping. Any missing identity/config/model keeps the Native path unchanged.
|
|
10
10
|
*/
|
|
11
11
|
import type { HostEvent } from '@principles/core/host';
|
|
12
|
-
import type { PdConfig } from '@principles/core/runtime';
|
|
12
|
+
import type { ActivatedPrinciple, PdConfig } from '@principles/core/runtime';
|
|
13
|
+
import type { AdaptiveGapOptions } from './active-principle-prompt.js';
|
|
13
14
|
import { type AdaptiveSelectionModel } from './adaptive-selection.js';
|
|
14
15
|
/** Independent switch. `features.host.codex.enabled` remains the whole-hook gate. */
|
|
15
16
|
export declare const ADAPTIVE_ACTIVATION_FLAG = "host.codex.adaptive_activation";
|
|
17
|
+
export type AdaptiveActivationFlag = typeof ADAPTIVE_ACTIVATION_FLAG | 'host.workbuddy.adaptive_activation' | 'host.openclaw.adaptive_activation';
|
|
18
|
+
/**
|
|
19
|
+
* PRI-1182 §2: time kept back from the host window for the principle assembly
|
|
20
|
+
* and the hook's own output. Selection never spends the reserve.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ADAPTIVE_OUTPUT_RESERVE_MS = 200;
|
|
16
23
|
export interface AdaptivePrioritySelection {
|
|
17
24
|
readonly artifactId: string;
|
|
18
25
|
readonly activationId: string;
|
|
@@ -20,7 +27,7 @@ export interface AdaptivePrioritySelection {
|
|
|
20
27
|
readonly deadlineAt?: number;
|
|
21
28
|
readonly signal?: AbortSignal;
|
|
22
29
|
}
|
|
23
|
-
export type AdaptivePriorityProvider = (event: HostEvent) => Promise<AdaptivePrioritySelection | undefined>;
|
|
30
|
+
export type AdaptivePriorityProvider = (event: HostEvent, candidates: readonly ActivatedPrinciple[], options: AdaptiveGapOptions) => Promise<AdaptivePrioritySelection | undefined>;
|
|
24
31
|
export interface AdaptiveActivationReadiness {
|
|
25
32
|
readonly readiness: 'ready' | 'disabled' | 'needs_setup';
|
|
26
33
|
readonly reason: string;
|
|
@@ -29,30 +36,42 @@ export interface AdaptiveActivationReadiness {
|
|
|
29
36
|
export type AdaptiveModelResolution = {
|
|
30
37
|
readonly ok: true;
|
|
31
38
|
readonly model: AdaptiveSelectionModel;
|
|
32
|
-
readonly profileId: string;
|
|
33
39
|
} | {
|
|
34
40
|
readonly ok: false;
|
|
41
|
+
readonly readiness: 'disabled' | 'needs_setup';
|
|
35
42
|
readonly reason: string;
|
|
36
43
|
readonly nextAction: string;
|
|
37
44
|
};
|
|
38
|
-
export declare function resolveAdaptiveSelectionModel(config: PdConfig, env: Record<string, string | undefined
|
|
45
|
+
export declare function resolveAdaptiveSelectionModel(config: PdConfig, env: Record<string, string | undefined>, flag?: AdaptiveActivationFlag): AdaptiveModelResolution;
|
|
39
46
|
export interface AdaptiveSelectionDiagnosticLine {
|
|
40
47
|
readonly status: string;
|
|
41
48
|
readonly reason: string;
|
|
42
49
|
readonly stage: string;
|
|
43
50
|
readonly sends: number;
|
|
51
|
+
readonly requestSentAt: number | null;
|
|
44
52
|
readonly firstByteAt: number | null;
|
|
45
53
|
readonly generationEndedAt: number | null;
|
|
54
|
+
readonly validatedAt: number | null;
|
|
46
55
|
readonly cancelledAt: number | null;
|
|
47
56
|
readonly httpStatus: number | null;
|
|
48
57
|
readonly finishReason: string;
|
|
58
|
+
/** Observed response model; null when no body was parsed. */
|
|
59
|
+
readonly modelObserved: string | null;
|
|
60
|
+
/** Observed response provider; null when absent or no body was parsed. */
|
|
61
|
+
readonly providerObserved: string | null;
|
|
62
|
+
/** Bounded local adjudication evidence (ids only, never prompt text). */
|
|
63
|
+
readonly decision: {
|
|
64
|
+
readonly status: string;
|
|
65
|
+
readonly ref: string | null;
|
|
66
|
+
readonly reason: string;
|
|
67
|
+
readonly scores: Readonly<Record<string, number>>;
|
|
68
|
+
} | null;
|
|
49
69
|
readonly failures: readonly string[];
|
|
50
70
|
}
|
|
51
71
|
export interface CreateAdaptivePriorityProviderOptions {
|
|
52
72
|
readonly workspaceDir: string;
|
|
53
73
|
readonly model: AdaptiveSelectionModel;
|
|
54
|
-
readonly
|
|
55
|
-
readonly generationTimeoutMs?: number;
|
|
74
|
+
readonly requestTimeoutMs?: number;
|
|
56
75
|
/**
|
|
57
76
|
* Absolute host deadline (Codex: the plugin hook window minus the Native
|
|
58
77
|
* reserve). Selection, revalidation and packing all share it: a selection
|
|
@@ -60,13 +79,19 @@ export interface CreateAdaptivePriorityProviderOptions {
|
|
|
60
79
|
*/
|
|
61
80
|
readonly outerDeadlineAt?: number;
|
|
62
81
|
/**
|
|
63
|
-
* PRI-
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
|
|
82
|
+
* PRI-1182 §2: reserved for assembly and output after the decision. The
|
|
83
|
+
* effective deadline is the earlier of the host's remaining window (minus
|
|
84
|
+
* this reserve) and the request's own short limit.
|
|
85
|
+
*/
|
|
86
|
+
readonly outputReserveMs?: number;
|
|
87
|
+
/**
|
|
88
|
+
* PRI-1181/PRI-1182: below this remaining budget the turn is skipped before
|
|
89
|
+
* the candidate read — no model request is sent at all. Defaults to the
|
|
90
|
+
* request's minimum executable envelope
|
|
91
|
+
* (`ADAPTIVE_SKIP_LIMITS.minExecutableBudgetMs`); 0 disables the gate for
|
|
92
|
+
* scenarios that isolate transport cancellation.
|
|
67
93
|
*/
|
|
68
|
-
readonly
|
|
69
|
-
readonly maxTokens?: number;
|
|
94
|
+
readonly minExecutableBudgetMs?: number;
|
|
70
95
|
readonly now?: () => number;
|
|
71
96
|
/** Test seam: production uses the global transport. */
|
|
72
97
|
readonly fetchImpl?: typeof fetch;
|
|
@@ -81,12 +106,12 @@ export type AdaptivePriorityProviderResolution = (AdaptiveActivationReadiness &
|
|
|
81
106
|
readonly ok: true;
|
|
82
107
|
readonly readiness: 'ready';
|
|
83
108
|
readonly provider: AdaptivePriorityProvider;
|
|
84
|
-
readonly profileId: string;
|
|
85
109
|
}) | (AdaptiveActivationReadiness & {
|
|
86
110
|
readonly ok: false;
|
|
87
111
|
});
|
|
88
112
|
export interface CreateAdaptiveProviderFromConfigOptions extends Omit<CreateAdaptivePriorityProviderOptions, 'workspaceDir' | 'model'> {
|
|
89
113
|
readonly env?: Record<string, string | undefined>;
|
|
114
|
+
readonly flag?: AdaptiveActivationFlag;
|
|
90
115
|
}
|
|
91
116
|
/**
|
|
92
117
|
* Config-first factory for hosts (Codex pd-hook) that already loaded the
|
|
@@ -3,89 +3,103 @@ import { ADAPTIVE_SELECTION_LIMITS, runAdaptiveSelection, } from './adaptive-sel
|
|
|
3
3
|
import { decideAdaptiveSkip } from './adaptive-skip-decision.js';
|
|
4
4
|
/** Independent switch. `features.host.codex.enabled` remains the whole-hook gate. */
|
|
5
5
|
export const ADAPTIVE_ACTIVATION_FLAG = 'host.codex.adaptive_activation';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* PRI-1182 §2: time kept back from the host window for the principle assembly
|
|
8
|
+
* and the hook's own output. Selection never spends the reserve.
|
|
9
|
+
*/
|
|
10
|
+
export const ADAPTIVE_OUTPUT_RESERVE_MS = 200;
|
|
11
|
+
export function resolveAdaptiveSelectionModel(config, env, flag = ADAPTIVE_ACTIVATION_FLAG) {
|
|
12
|
+
const feature = config.features[flag];
|
|
8
13
|
if (feature?.enabled !== true) {
|
|
9
14
|
return {
|
|
10
15
|
ok: false,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
const profileId = config.internalAgents.defaultRuntime;
|
|
16
|
-
const profile = config.runtimeProfiles[profileId];
|
|
17
|
-
if (!profile) {
|
|
18
|
-
return {
|
|
19
|
-
ok: false,
|
|
20
|
-
reason: `Runtime profile '${profileId}' not found`,
|
|
21
|
-
nextAction: `Add runtime profile '${profileId}' to runtimeProfiles`,
|
|
16
|
+
readiness: 'disabled',
|
|
17
|
+
reason: `${flag} is disabled in .pd/config.yaml`,
|
|
18
|
+
nextAction: `Enable it explicitly with ${flag}: {enabled: true}`,
|
|
22
19
|
};
|
|
23
20
|
}
|
|
24
|
-
|
|
21
|
+
// PRI-1182: the Adaptive path has its OWN endpoint + model + credential
|
|
22
|
+
// reference. It no longer borrows a pi-ai runtime profile, because the
|
|
23
|
+
// Decisions protocol is a single scoring endpoint, not a chat completion.
|
|
24
|
+
const section = config.adaptiveActivation;
|
|
25
|
+
if (!section) {
|
|
25
26
|
return {
|
|
26
27
|
ok: false,
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
readiness: 'needs_setup',
|
|
29
|
+
reason: 'adaptiveActivation is not configured in .pd/config.yaml',
|
|
30
|
+
nextAction: 'Add adaptiveActivation: {endpoint, model, apiKeyEnv} to .pd/config.yaml',
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
|
-
if (!
|
|
33
|
+
if (!section.endpoint || !section.model || !section.apiKeyEnv) {
|
|
32
34
|
return {
|
|
33
35
|
ok: false,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
readiness: 'needs_setup',
|
|
37
|
+
reason: 'adaptiveActivation is missing endpoint/model/apiKeyEnv',
|
|
38
|
+
nextAction: 'Set endpoint (https URL), model and apiKeyEnv on adaptiveActivation',
|
|
36
39
|
};
|
|
37
40
|
}
|
|
38
|
-
if (!Object.hasOwn(env,
|
|
41
|
+
if (!Object.hasOwn(env, section.apiKeyEnv) || !env[section.apiKeyEnv]) {
|
|
39
42
|
return {
|
|
40
43
|
ok: false,
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
readiness: 'needs_setup',
|
|
45
|
+
reason: `Environment variable '${section.apiKeyEnv}' is not set or empty`,
|
|
46
|
+
nextAction: `Set the environment variable '${section.apiKeyEnv}' with a valid API key`,
|
|
43
47
|
};
|
|
44
48
|
}
|
|
45
49
|
return {
|
|
46
50
|
ok: true,
|
|
47
|
-
profileId,
|
|
48
51
|
model: {
|
|
49
|
-
|
|
50
|
-
model:
|
|
51
|
-
apiKeyEnv:
|
|
52
|
-
...(
|
|
52
|
+
endpoint: section.endpoint,
|
|
53
|
+
model: section.model,
|
|
54
|
+
apiKeyEnv: section.apiKeyEnv,
|
|
55
|
+
...(section.provider ? { provider: section.provider } : {}),
|
|
56
|
+
...(section.responseModels && section.responseModels.length > 0
|
|
57
|
+
? { allowedResponseModels: section.responseModels }
|
|
58
|
+
: {}),
|
|
53
59
|
},
|
|
54
60
|
};
|
|
55
61
|
}
|
|
56
62
|
export function createAdaptivePriorityProvider(options) {
|
|
57
63
|
const now = options.now ?? Date.now;
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
return async (event) => {
|
|
64
|
+
const requestTimeoutMs = options.requestTimeoutMs ?? ADAPTIVE_SELECTION_LIMITS.requestTimeoutMs;
|
|
65
|
+
const outputReserveMs = options.outputReserveMs ?? ADAPTIVE_OUTPUT_RESERVE_MS;
|
|
66
|
+
return async (event, candidates, { excludedByBudget, replacementByActivationId }) => {
|
|
61
67
|
if (event.kind !== 'before_prompt_build')
|
|
62
68
|
return undefined;
|
|
63
69
|
const { sessionId, turnId, promptContent, workspaceDir } = event.context;
|
|
64
|
-
//
|
|
65
|
-
|
|
70
|
+
// The host budget starts before selection; the request budget starts at send.
|
|
71
|
+
const nowMs = now();
|
|
72
|
+
const hostDeadlineAt = options.outerDeadlineAt === undefined
|
|
73
|
+
? undefined
|
|
74
|
+
: options.outerDeadlineAt - outputReserveMs;
|
|
75
|
+
// PRI-1181: the deterministic gate runs before any model request.
|
|
76
|
+
// Native has already been assembled, even when Adaptive skips.
|
|
66
77
|
const skip = decideAdaptiveSkip({
|
|
67
78
|
kind: event.kind,
|
|
68
79
|
sessionId,
|
|
69
80
|
turnId,
|
|
70
81
|
prompt: promptContent ?? '',
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
...(options.minRemainingBudgetMs !== undefined
|
|
75
|
-
? { minRemainingBudgetMs: options.minRemainingBudgetMs }
|
|
82
|
+
remainingBudgetMs: Math.max(0, Math.min(requestTimeoutMs, (hostDeadlineAt ?? Infinity) - nowMs)),
|
|
83
|
+
...(options.minExecutableBudgetMs !== undefined
|
|
84
|
+
? { minExecutableBudgetMs: options.minExecutableBudgetMs }
|
|
76
85
|
: {}),
|
|
77
86
|
});
|
|
78
|
-
if (skip.skip) {
|
|
87
|
+
if (skip.skip || (candidates.length === 0 && excludedByBudget)) {
|
|
79
88
|
options.onDiagnostic?.({
|
|
80
89
|
status: 'skipped',
|
|
81
|
-
reason: skip.reason,
|
|
90
|
+
reason: skip.skip ? skip.reason : 'no_appendable_gap',
|
|
82
91
|
stage: 'gate',
|
|
83
92
|
sends: 0,
|
|
93
|
+
requestSentAt: null,
|
|
84
94
|
firstByteAt: null,
|
|
85
95
|
generationEndedAt: null,
|
|
96
|
+
validatedAt: null,
|
|
86
97
|
cancelledAt: null,
|
|
87
98
|
httpStatus: null,
|
|
88
99
|
finishReason: 'skipped',
|
|
100
|
+
modelObserved: null,
|
|
101
|
+
providerObserved: null,
|
|
102
|
+
decision: null,
|
|
89
103
|
failures: [],
|
|
90
104
|
});
|
|
91
105
|
return undefined;
|
|
@@ -93,27 +107,15 @@ export function createAdaptivePriorityProvider(options) {
|
|
|
93
107
|
// The gate already proved identity and a non-blank prompt (rc-3); the
|
|
94
108
|
// selector only needs the prompt body from here on.
|
|
95
109
|
const prompt = promptContent ?? '';
|
|
96
|
-
const
|
|
97
|
-
? now() + firstByteTimeoutMs
|
|
98
|
-
: Math.min(now() + firstByteTimeoutMs, options.outerDeadlineAt);
|
|
99
|
-
const remainingBudgetMs = options.outerDeadlineAt === undefined
|
|
100
|
-
? firstByteTimeoutMs
|
|
101
|
-
: Math.max(1, options.outerDeadlineAt - now());
|
|
102
|
-
const effectiveGenerationTimeoutMs = options.outerDeadlineAt === undefined
|
|
103
|
-
? generationTimeoutMs
|
|
104
|
-
: Math.min(generationTimeoutMs, remainingBudgetMs);
|
|
105
|
-
// Reuse the selector's AbortSignal seam instead of a second timer: it is
|
|
106
|
-
// combined with the first-byte and request signals inside the transport.
|
|
107
|
-
const signal = options.outerDeadlineAt === undefined ? undefined : AbortSignal.timeout(remainingBudgetMs);
|
|
110
|
+
const signal = hostDeadlineAt === undefined ? undefined : AbortSignal.timeout(Math.max(1, hostDeadlineAt - now()));
|
|
108
111
|
const outcome = await runAdaptiveSelection({
|
|
109
112
|
workspaceDir: workspaceDir || options.workspaceDir,
|
|
110
113
|
currentPrompt: prompt,
|
|
111
|
-
|
|
114
|
+
candidates,
|
|
115
|
+
replacementByActivationId,
|
|
112
116
|
model: options.model,
|
|
113
|
-
|
|
114
|
-
...(
|
|
115
|
-
...(signal ? { signal } : {}),
|
|
116
|
-
...(options.maxTokens !== undefined ? { maxTokens: options.maxTokens } : {}),
|
|
117
|
+
requestTimeoutMs,
|
|
118
|
+
...(hostDeadlineAt !== undefined ? { outerDeadlineAt: hostDeadlineAt, signal } : {}),
|
|
117
119
|
...(options.now ? { now: options.now } : {}),
|
|
118
120
|
...(options.fetchImpl ? { fetchImpl: options.fetchImpl } : {}),
|
|
119
121
|
});
|
|
@@ -122,11 +124,16 @@ export function createAdaptivePriorityProvider(options) {
|
|
|
122
124
|
reason: outcome.reason,
|
|
123
125
|
stage: outcome.diagnostics.stage,
|
|
124
126
|
sends: outcome.sends,
|
|
127
|
+
requestSentAt: outcome.diagnostics.requestSentAt,
|
|
125
128
|
firstByteAt: outcome.diagnostics.firstByteAt,
|
|
126
129
|
generationEndedAt: outcome.diagnostics.generationEndedAt,
|
|
130
|
+
validatedAt: outcome.diagnostics.validatedAt,
|
|
127
131
|
cancelledAt: outcome.diagnostics.cancelledAt,
|
|
128
132
|
httpStatus: outcome.diagnostics.httpStatus,
|
|
129
133
|
finishReason: outcome.diagnostics.finishReason,
|
|
134
|
+
modelObserved: outcome.diagnostics.modelObserved,
|
|
135
|
+
providerObserved: outcome.diagnostics.providerObserved,
|
|
136
|
+
decision: outcome.diagnostics.decision,
|
|
130
137
|
failures: [...outcome.diagnostics.failures],
|
|
131
138
|
});
|
|
132
139
|
if (outcome.status !== 'selected' || !outcome.target)
|
|
@@ -135,8 +142,7 @@ export function createAdaptivePriorityProvider(options) {
|
|
|
135
142
|
artifactId: outcome.target.artifactId,
|
|
136
143
|
activationId: outcome.target.activationId,
|
|
137
144
|
additiveOnly: true,
|
|
138
|
-
deadlineAt:
|
|
139
|
-
...(signal ? { signal } : {}),
|
|
145
|
+
...(hostDeadlineAt !== undefined ? { deadlineAt: hostDeadlineAt, signal } : {}),
|
|
140
146
|
};
|
|
141
147
|
};
|
|
142
148
|
}
|
|
@@ -145,11 +151,11 @@ export function createAdaptivePriorityProvider(options) {
|
|
|
145
151
|
* workspace config for the current turn.
|
|
146
152
|
*/
|
|
147
153
|
export function createAdaptivePriorityProviderForConfig(config, workspaceDir, options = {}) {
|
|
148
|
-
const resolved = resolveAdaptiveSelectionModel(config, options.env ?? process.env);
|
|
154
|
+
const resolved = resolveAdaptiveSelectionModel(config, options.env ?? process.env, options.flag);
|
|
149
155
|
if (!resolved.ok) {
|
|
150
156
|
return {
|
|
151
157
|
ok: false,
|
|
152
|
-
readiness:
|
|
158
|
+
readiness: resolved.readiness,
|
|
153
159
|
reason: resolved.reason,
|
|
154
160
|
nextAction: resolved.nextAction,
|
|
155
161
|
};
|
|
@@ -157,11 +163,10 @@ export function createAdaptivePriorityProviderForConfig(config, workspaceDir, op
|
|
|
157
163
|
const provider = createAdaptivePriorityProvider({
|
|
158
164
|
workspaceDir,
|
|
159
165
|
model: resolved.model,
|
|
160
|
-
...(options.
|
|
161
|
-
...(options.generationTimeoutMs !== undefined ? { generationTimeoutMs: options.generationTimeoutMs } : {}),
|
|
166
|
+
...(options.requestTimeoutMs !== undefined ? { requestTimeoutMs: options.requestTimeoutMs } : {}),
|
|
162
167
|
...(options.outerDeadlineAt !== undefined ? { outerDeadlineAt: options.outerDeadlineAt } : {}),
|
|
163
|
-
...(options.
|
|
164
|
-
...(options.
|
|
168
|
+
...(options.outputReserveMs !== undefined ? { outputReserveMs: options.outputReserveMs } : {}),
|
|
169
|
+
...(options.minExecutableBudgetMs !== undefined ? { minExecutableBudgetMs: options.minExecutableBudgetMs } : {}),
|
|
165
170
|
...(options.now ? { now: options.now } : {}),
|
|
166
171
|
...(options.fetchImpl ? { fetchImpl: options.fetchImpl } : {}),
|
|
167
172
|
...(options.onDiagnostic ? { onDiagnostic: options.onDiagnostic } : {}),
|
|
@@ -169,10 +174,9 @@ export function createAdaptivePriorityProviderForConfig(config, workspaceDir, op
|
|
|
169
174
|
return {
|
|
170
175
|
ok: true,
|
|
171
176
|
readiness: 'ready',
|
|
172
|
-
reason: `adaptive
|
|
177
|
+
reason: `adaptive decision ready at '${resolved.model.endpoint}' (model '${resolved.model.model}')`,
|
|
173
178
|
nextAction: 'none',
|
|
174
179
|
provider,
|
|
175
|
-
profileId: resolved.profileId,
|
|
176
180
|
};
|
|
177
181
|
}
|
|
178
182
|
/**
|