create-principles-disciple 1.150.4 → 1.151.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/_release/product-identity.json +1 -1
- package/codex-adapter/dist/ingestion/codex-version.d.ts +14 -12
- package/codex-adapter/dist/ingestion/codex-version.js +19 -20
- 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/package.json +1 -1
- package/console/dist/server/bind-guard.d.ts +6 -13
- package/console/dist/server/bind-guard.js +8 -17
- package/console/dist/server/index.d.ts +9 -3
- package/console/dist/server/index.js +69 -55
- package/console/dist/server/models/ActivationsConsoleModel.js +5 -3
- 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 +61 -22
- 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/activations.js +2 -2
- package/console/dist/server/routes/diagnostician.js +3 -2
- 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/evidence-outcomes.d.ts +3 -2
- package/console/dist/server/routes/evidence-outcomes.js +1 -1
- package/console/dist/server/routes/failed-tasks.js +79 -3
- package/console/dist/server/routes/governance.d.ts +9 -6
- package/console/dist/server/routes/governance.js +10 -6
- 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-decisions.d.ts +3 -3
- package/console/dist/server/routes/owner-decisions.js +1 -1
- package/console/dist/server/routes/owner-identity.d.ts +10 -5
- package/console/dist/server/routes/owner-identity.js +11 -7
- package/console/dist/server/routes/principles.js +3 -3
- package/console/dist/server/routes/rule-candidate-bindings.js +1 -1
- package/console/dist/server/routes/update.js +24 -6
- package/console/dist/server/utils/request-guard.d.ts +35 -0
- package/console/dist/server/utils/request-guard.js +81 -0
- package/console/dist/server/utils/response.d.ts +0 -1
- package/console/dist/server/utils/response.js +0 -3
- package/console/dist/web/assets/app.css +98 -167
- package/console/dist/web/assets/app.js +34 -37
- package/core/dist/runtime/activation/activation-control-types.d.ts +3 -0
- package/core/dist/runtime/activation/activation-control-types.d.ts.map +1 -1
- 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/rulecode-owner-decision-service.d.ts.map +1 -1
- package/core/dist/runtime/activation/rulecode-owner-decision-service.js +3 -2
- package/core/dist/runtime/activation/rulecode-owner-decision-service.js.map +1 -1
- package/core/dist/runtime/activation/sqlite-activation-safety-store.d.ts.map +1 -1
- package/core/dist/runtime/activation/sqlite-activation-safety-store.js +26 -13
- package/core/dist/runtime/activation/sqlite-activation-safety-store.js.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/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 +27 -10
- 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/adapter/structured-output-repair.d.ts +17 -2
- package/core/dist/runtime/adapter/structured-output-repair.d.ts.map +1 -1
- package/core/dist/runtime/adapter/structured-output-repair.js +26 -5
- package/core/dist/runtime/adapter/structured-output-repair.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-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-types.d.ts +2 -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 +10 -1
- 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/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-experience-contract.d.ts +12 -12
- package/core/dist/runtime/governance-experience-contract.d.ts.map +1 -1
- package/core/dist/runtime/governance-experience-contract.js +0 -2
- package/core/dist/runtime/governance-experience-contract.js.map +1 -1
- package/core/dist/runtime/governance-experience.d.ts.map +1 -1
- package/core/dist/runtime/governance-experience.js +8 -16
- package/core/dist/runtime/governance-experience.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/internalization/approved-rule-revision.d.ts.map +1 -1
- package/core/dist/runtime/internalization/approved-rule-revision.js +2 -1
- package/core/dist/runtime/internalization/approved-rule-revision.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 +2 -2
- 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-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 +17 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.js +98 -3
- 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/language-directive.d.ts +2 -1
- package/core/dist/runtime/language-directive.d.ts.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-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/recovery-sweep-service.d.ts +7 -0
- package/core/dist/runtime/recovery-sweep-service.d.ts.map +1 -1
- package/core/dist/runtime/recovery-sweep-service.js +1 -0
- package/core/dist/runtime/recovery-sweep-service.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/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/context/promoted-evidence-reader.d.ts +59 -0
- package/core/dist/runtime/store/context/promoted-evidence-reader.d.ts.map +1 -0
- package/core/dist/runtime/store/context/promoted-evidence-reader.js +201 -0
- package/core/dist/runtime/store/context/promoted-evidence-reader.js.map +1 -0
- package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts.map +1 -1
- package/core/dist/runtime/store/context/sqlite-context-assembler.js +43 -2
- package/core/dist/runtime/store/context/sqlite-context-assembler.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 -1
- package/core/dist/runtime/store/sqlite-connection.d.ts.map +1 -1
- package/core/dist/runtime/store/sqlite-connection.js +96 -37
- package/core/dist/runtime/store/sqlite-connection.js.map +1 -1
- 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/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/package.json +5 -1
- package/dist/installer.d.ts +14 -0
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +36 -77
- package/dist/installer.js.map +1 -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 +35 -1
- package/dist/installers/codex-host-installer.js.map +1 -1
- package/dist/mvp-config.js +1 -1
- package/dist/mvp-config.js.map +1 -1
- package/dist/update/data-compatibility.d.ts.map +1 -1
- package/dist/update/data-compatibility.js +3 -1
- package/dist/update/data-compatibility.js.map +1 -1
- 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/dist/update/release-manager.d.ts +5 -0
- package/dist/update/release-manager.d.ts.map +1 -1
- package/dist/update/release-manager.js +11 -1
- package/dist/update/release-manager.js.map +1 -1
- package/host-runtime/dist/active-principle-prompt.d.ts +7 -2
- package/host-runtime/dist/active-principle-prompt.js +80 -13
- package/host-runtime/dist/adaptive-decision-protocol.d.ts +36 -21
- package/host-runtime/dist/adaptive-decision-protocol.js +79 -34
- package/host-runtime/dist/adaptive-priority-provider.d.ts +2 -1
- package/host-runtime/dist/adaptive-priority-provider.js +6 -5
- package/host-runtime/dist/adaptive-selection.d.ts +4 -0
- package/host-runtime/dist/adaptive-selection.js +12 -4
- package/host-runtime/dist/cli-recovery-probe.d.ts +42 -1
- package/host-runtime/dist/cli-recovery-probe.js +16 -3
- package/host-runtime/dist/codex-disclosure.d.ts +12 -7
- package/host-runtime/dist/codex-disclosure.js +12 -7
- package/host-runtime/dist/conversation-ingestion/pipeline.d.ts +8 -29
- package/host-runtime/dist/conversation-ingestion/pipeline.js +45 -3
- 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 +38 -5
- package/host-runtime/dist/governance-observation-store.js +63 -5
- package/host-runtime/dist/index.js +5 -2
- package/host-runtime/dist/production-rulehost-gate.d.ts +36 -1
- package/host-runtime/dist/production-rulehost-gate.js +91 -1
- package/host-runtime/package.json +1 -1
- package/package.json +2 -2
- package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
- package/pd-cli/dist/commands/candidate.js +117 -3
- package/pd-cli/dist/commands/candidate.js.map +1 -1
- package/pd-cli/dist/commands/console.d.ts +0 -4
- package/pd-cli/dist/commands/console.d.ts.map +1 -1
- package/pd-cli/dist/commands/console.js +4 -67
- package/pd-cli/dist/commands/console.js.map +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/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.d.ts.map +1 -1
- package/pd-cli/dist/commands/health.js +10 -0
- package/pd-cli/dist/commands/health.js.map +1 -1
- package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-activation.js +4 -8
- package/pd-cli/dist/commands/runtime-activation.js.map +1 -1
- package/pd-cli/dist/commands/runtime-recovery-failed-tasks.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-recovery-failed-tasks.js +114 -63
- package/pd-cli/dist/commands/runtime-recovery-failed-tasks.js.map +1 -1
- package/pd-cli/dist/program.d.ts.map +1 -1
- package/pd-cli/dist/program.js +0 -8
- package/pd-cli/dist/program.js.map +1 -1
- package/pd-cli/dist/services/console-launcher.d.ts +1 -18
- package/pd-cli/dist/services/console-launcher.d.ts.map +1 -1
- package/pd-cli/dist/services/console-launcher.js +4 -92
- package/pd-cli/dist/services/console-launcher.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 +5 -1
- package/pd-cli/dist/services/version-report.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +562 -534
- package/plugin/dist/core/experiment-workspace-guard.d.ts +25 -0
- package/plugin/dist/index.d.ts +1 -1
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/release-manager/dist/installer.js +36 -77
- package/release-manager/dist/installers/codex-host-installer.js +35 -1
- package/release-manager/dist/mvp-config.js +1 -1
- package/release-manager/dist/update/product-identity.js +5 -1
- package/release-manager/dist/update/release-manager.js +11 -1
- package/release-manager/package.json +1 -1
- package/workbuddy-adapter/dist/index.d.ts +1 -1
- package/workbuddy-adapter/dist/index.js +1 -1
- package/workbuddy-adapter/dist/ingestion/catch-up.d.ts +11 -0
- package/workbuddy-adapter/dist/ingestion/catch-up.js +7 -2
- package/workbuddy-adapter/dist/ingestion/index.d.ts +1 -1
- package/workbuddy-adapter/dist/ingestion/index.js +1 -1
- package/workbuddy-adapter/package.json +1 -1
- package/console/dist/server/config/AuthConfig.d.ts +0 -14
- package/console/dist/server/config/AuthConfig.js +0 -42
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type ExperimentIsolationViolation = {
|
|
2
|
+
reason: string;
|
|
3
|
+
message: string;
|
|
4
|
+
nextAction: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Canonical form for containment decisions: `realpath` resolves junctions and
|
|
8
|
+
* symlinks (a link inside the root that points at production is an escape, not
|
|
9
|
+
* a child), with the resolved path as fallback for targets that do not exist.
|
|
10
|
+
* Windows paths are case-folded because NTFS is case-insensitive.
|
|
11
|
+
*/
|
|
12
|
+
export declare function canonicalForIsolation(candidate: string): string;
|
|
13
|
+
export declare function experimentRootFromEnv(env?: NodeJS.ProcessEnv): string | null;
|
|
14
|
+
export declare function experimentIsolationNextAction(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Returns `null` when the workspace is acceptable, else a structured violation.
|
|
17
|
+
*/
|
|
18
|
+
export declare function describeExperimentWorkspaceViolation(workspaceDir: string, env?: NodeJS.ProcessEnv): ExperimentIsolationViolation | null;
|
|
19
|
+
/**
|
|
20
|
+
* Guard for non-workspace path inputs (`PD_STATE_DIR`, config paths). In
|
|
21
|
+
* experiment mode they must stay inside the root; production is unchanged.
|
|
22
|
+
*/
|
|
23
|
+
export declare function assertExperimentPathInsideRoot(candidate: string, source: string, env?: NodeJS.ProcessEnv): void;
|
|
24
|
+
/** Throwing form for paths whose contract is "throw or return a value". */
|
|
25
|
+
export declare function assertExperimentWorkspaceIsolation(workspaceDir: string, source: string): void;
|
package/plugin/dist/index.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ export declare function syncMcpBindingFromExplicitWorkspace(options: {
|
|
|
66
66
|
} | null;
|
|
67
67
|
}): McpBindingSyncResult;
|
|
68
68
|
/** Native-gap scoring only on host-admitted user messages. */
|
|
69
|
-
export declare function resolveOpenClawNativeGap(event: PluginHookBeforePromptBuildEvent, context: PluginHookAgentContext, ...[hostEvent, candidates, api]: [
|
|
69
|
+
export declare function resolveOpenClawNativeGap(event: PluginHookBeforePromptBuildEvent, context: PluginHookAgentContext, ...[hostEvent, candidates, gapOptions, api]: [
|
|
70
70
|
...Parameters<import('@principles/host-runtime').AdaptivePriorityProvider>,
|
|
71
71
|
Parameters<typeof handleBeforePromptBuild>[1]['api']
|
|
72
72
|
]): Promise<import("@principles/host-runtime").AdaptivePrioritySelection | undefined>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "4.1.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "4.1.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
package/plugin/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "principles-disciple",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -2728,6 +2728,22 @@ export function ensureConsoleResolution() {
|
|
|
2728
2728
|
export function ensureCodexAdapterResolution() {
|
|
2729
2729
|
ensureComponentFileDependencyLinks(getInstalledCodexAdapterDir(), '@principles/codex-adapter');
|
|
2730
2730
|
}
|
|
2731
|
+
/**
|
|
2732
|
+
* PRI-1145: the INSTALLED host-runtime declares the same `file:../<component>`
|
|
2733
|
+
* siblings as the other runtime components (core / install-layout), but it was
|
|
2734
|
+
* the only one with no `ensure*Resolution()` caller. `installBundledHostRuntime`
|
|
2735
|
+
* therefore left the npm-materialized `node_modules/@principles/core` physical
|
|
2736
|
+
* copy in place, so a second core byte lived on the machine outside the
|
|
2737
|
+
* "every component resolves the canonical runtime core" invariant. Reuses the
|
|
2738
|
+
* shared helper (Connection Before Creation) instead of a new mechanism.
|
|
2739
|
+
*
|
|
2740
|
+
* Ordering contract: MUST run after installBundledHostRuntime() AND after every
|
|
2741
|
+
* `file:../` sibling it declares is deployed (core, install-layout). A missing
|
|
2742
|
+
* sibling fails the install loud (the helper).
|
|
2743
|
+
*/
|
|
2744
|
+
export function ensureHostRuntimeResolution() {
|
|
2745
|
+
ensureComponentFileDependencyLinks(getInstalledHostRuntimeDir(), '@principles/host-runtime');
|
|
2746
|
+
}
|
|
2731
2747
|
/**
|
|
2732
2748
|
* SPEC workbuddy-host-adapter §4.1/§5: the bundled @principles/workbuddy-adapter
|
|
2733
2749
|
* payload installs as a runtime sibling exactly like codex-adapter, and its
|
|
@@ -3065,22 +3081,16 @@ export class ConsoleVerifyError extends Error {
|
|
|
3065
3081
|
}
|
|
3066
3082
|
}
|
|
3067
3083
|
/**
|
|
3068
|
-
* PD Console health shape
|
|
3069
|
-
* for untrusted keys).
|
|
3084
|
+
* PD Console health shape (rc-5: Object.hasOwn for untrusted keys).
|
|
3070
3085
|
*
|
|
3071
3086
|
* P1-B: `data.overall` is the PD-specific discriminative field — the generic
|
|
3072
|
-
* { success: true } envelope alone matches any service.
|
|
3073
|
-
* `data.authenticationMode` must equal the launched posture, because that is the
|
|
3074
|
-
* same fact `pd console open` refuses on (`console_authentication_mode_mismatch`).
|
|
3075
|
-
* Without it the installer certified ANY healthy PD console on 3100..3119 as
|
|
3076
|
-
* "the console I just launched", including a pre-existing no-auth one that
|
|
3077
|
-
* `pd console open` had already refused to adopt.
|
|
3087
|
+
* { success: true } envelope alone matches any service.
|
|
3078
3088
|
*
|
|
3079
3089
|
* (Hoisted above the G1 P0-1 identity verifier — its first caller in file
|
|
3080
3090
|
* order — for no-use-before-define discipline; the autolaunch probe below
|
|
3081
3091
|
* shares this same shape contract.)
|
|
3082
3092
|
*/
|
|
3083
|
-
function isLaunchedConsoleHealth(payload
|
|
3093
|
+
function isLaunchedConsoleHealth(payload) {
|
|
3084
3094
|
if (typeof payload !== 'object' || payload === null)
|
|
3085
3095
|
return false;
|
|
3086
3096
|
if (!Object.hasOwn(payload, 'success') || Reflect.get(payload, 'success') !== true)
|
|
@@ -3093,18 +3103,7 @@ function isLaunchedConsoleHealth(payload, expectedMode) {
|
|
|
3093
3103
|
if (!Object.hasOwn(data, 'overall'))
|
|
3094
3104
|
return false;
|
|
3095
3105
|
const overall = Reflect.get(data, 'overall');
|
|
3096
|
-
|
|
3097
|
-
return false;
|
|
3098
|
-
if (!Object.hasOwn(data, 'authenticationMode'))
|
|
3099
|
-
return false;
|
|
3100
|
-
return Reflect.get(data, 'authenticationMode') === expectedMode;
|
|
3101
|
-
}
|
|
3102
|
-
/** sendUnauthorized's envelope — the only responder worth offering the token to. */
|
|
3103
|
-
function isConsoleUnauthorizedEnvelope(payload) {
|
|
3104
|
-
if (typeof payload !== 'object' || payload === null)
|
|
3105
|
-
return false;
|
|
3106
|
-
return Object.hasOwn(payload, 'success') && Reflect.get(payload, 'success') === false
|
|
3107
|
-
&& Object.hasOwn(payload, 'error') && Reflect.get(payload, 'error') === 'unauthorized';
|
|
3106
|
+
return overall === 'healthy' || overall === 'degraded' || overall === 'error';
|
|
3108
3107
|
}
|
|
3109
3108
|
/** P0-1 (SPEC v1.2 §7 / invariant I-3): the response must prove it came from
|
|
3110
3109
|
* THIS child — a one-shot nonce injected through the child env and echoed by
|
|
@@ -3112,7 +3111,7 @@ function isConsoleUnauthorizedEnvelope(payload) {
|
|
|
3112
3111
|
* 200+JSON cannot know the value, so they all fail closed here. The nonce
|
|
3113
3112
|
* value never enters logs or diagnostics. */
|
|
3114
3113
|
function isVerifiedConsoleIdentity(payload, expectedNonce) {
|
|
3115
|
-
if (!isLaunchedConsoleHealth(payload
|
|
3114
|
+
if (!isLaunchedConsoleHealth(payload))
|
|
3116
3115
|
return false;
|
|
3117
3116
|
const data = Reflect.get(payload, 'data');
|
|
3118
3117
|
if (typeof data !== 'object' || data === null || Array.isArray(data))
|
|
@@ -3163,7 +3162,7 @@ export async function verifyConsole(workspaceDir) {
|
|
|
3163
3162
|
// Cleared at every attempt exit below; attempts are strictly serial.
|
|
3164
3163
|
const nonce = randomUUID();
|
|
3165
3164
|
process.env.PD_CONSOLE_VERIFY_NONCE = nonce;
|
|
3166
|
-
const child = spawn(process.execPath, [serverEntry, '--workspace', workspaceDir, '--port', String(port), '--
|
|
3165
|
+
const child = spawn(process.execPath, [serverEntry, '--workspace', workspaceDir, '--port', String(port), '--host', '127.0.0.1'], {
|
|
3167
3166
|
stdio: 'pipe',
|
|
3168
3167
|
env: { ...process.env },
|
|
3169
3168
|
detached: false,
|
|
@@ -3315,9 +3314,9 @@ function openBrowserForOnboarding(url) {
|
|
|
3315
3314
|
return { opened: false, reason: err instanceof Error ? err.message : String(err) };
|
|
3316
3315
|
}
|
|
3317
3316
|
}
|
|
3318
|
-
function requestConsoleHealth(port,
|
|
3317
|
+
function requestConsoleHealth(port, timeoutMs) {
|
|
3319
3318
|
return new Promise((resolve) => {
|
|
3320
|
-
const req = http.get(`http://127.0.0.1:${port}/api/health`,
|
|
3319
|
+
const req = http.get(`http://127.0.0.1:${port}/api/health`, (res) => {
|
|
3321
3320
|
const chunks = [];
|
|
3322
3321
|
res.on('data', (c) => chunks.push(c));
|
|
3323
3322
|
res.on('end', () => {
|
|
@@ -3336,31 +3335,13 @@ function requestConsoleHealth(port, token, timeoutMs) {
|
|
|
3336
3335
|
});
|
|
3337
3336
|
}
|
|
3338
3337
|
/**
|
|
3339
|
-
* Is the console READY on this port
|
|
3340
|
-
*
|
|
3341
|
-
*
|
|
3342
|
-
* 1. bare GET first: a bearer credential must never be sprayed at up to
|
|
3343
|
-
* CONSOLE_AUTOLAUNCH_PORT_SCAN_LIMIT unidentified local ports;
|
|
3344
|
-
* 2. the token is attached only to a responder that answered 401 with the
|
|
3345
|
-
* console's own error envelope, and 200 is accepted only when
|
|
3346
|
-
* `authenticationMode` matches the launched posture.
|
|
3347
|
-
* An authenticated console answers 401 to a bare probe, so phase 1 alone cannot
|
|
3348
|
-
* distinguish it — phase 2 is the proof that the responder accepts THIS token.
|
|
3338
|
+
* Is the console READY on this port? A single bare GET is enough now: the
|
|
3339
|
+
* Console has no credential, so a 200 with a healthy envelope (and the
|
|
3340
|
+
* launcher's one-shot nonce where required) is the whole proof.
|
|
3349
3341
|
*/
|
|
3350
|
-
async function probeAutolaunchHealth(port,
|
|
3351
|
-
const
|
|
3352
|
-
|
|
3353
|
-
if (bare === null)
|
|
3354
|
-
return false;
|
|
3355
|
-
if (bare.status === 200)
|
|
3356
|
-
return isLaunchedConsoleHealth(bare.payload, expectedMode);
|
|
3357
|
-
if (bare.status !== 401 || !posture.authenticated)
|
|
3358
|
-
return false;
|
|
3359
|
-
if (!isConsoleUnauthorizedEnvelope(bare.payload))
|
|
3360
|
-
return false;
|
|
3361
|
-
const authorized = await requestConsoleHealth(port, posture.token, timeoutMs);
|
|
3362
|
-
return authorized !== null && authorized.status === 200
|
|
3363
|
-
&& isLaunchedConsoleHealth(authorized.payload, expectedMode);
|
|
3342
|
+
async function probeAutolaunchHealth(port, timeoutMs = 1500) {
|
|
3343
|
+
const response = await requestConsoleHealth(port, timeoutMs);
|
|
3344
|
+
return response !== null && response.status === 200 && isLaunchedConsoleHealth(response.payload);
|
|
3364
3345
|
}
|
|
3365
3346
|
/**
|
|
3366
3347
|
* Task 8: Auto-launch the PD Console at the end of a successful install by
|
|
@@ -3382,32 +3363,8 @@ async function probeAutolaunchHealth(port, posture, timeoutMs = 1500) {
|
|
|
3382
3363
|
export function resolveConsoleWorkspaceDir(host, projectWorkspaceDir, homeDir) {
|
|
3383
3364
|
return host === 'workbuddy' ? getWorkbuddyWorkspaceDir(homeDir) : projectWorkspaceDir;
|
|
3384
3365
|
}
|
|
3385
|
-
/**
|
|
3386
|
-
* PRI-1054: the authentication posture to auto-launch the console in.
|
|
3387
|
-
*
|
|
3388
|
-
* The update chain must NOT invent a posture: PD Companion asks for an
|
|
3389
|
-
* authenticated console whenever PD_CONSOLE_TOKEN is in its environment, and it
|
|
3390
|
-
* restores that token from its own encrypted state on every launch. Hardcoding
|
|
3391
|
-
* `--no-auth` here therefore swapped a healthy authenticated console for a
|
|
3392
|
-
* no-auth one on every release, and the next Companion start aborted with
|
|
3393
|
-
* `console_authentication_mode_mismatch` — i.e. configuring a token made every
|
|
3394
|
-
* later release brick the desktop app.
|
|
3395
|
-
*
|
|
3396
|
-
* Inheriting this process's own PD_CONSOLE_TOKEN keeps the machine's posture
|
|
3397
|
-
* unchanged, because `pd console open` reads the same variable (console.ts
|
|
3398
|
-
* resolves `opts.token ?? process.env.PD_CONSOLE_TOKEN` and only skips auth for
|
|
3399
|
-
* `--no-auth`). No new authority: the variable stays the single declaration.
|
|
3400
|
-
*/
|
|
3401
|
-
function readConsoleAuthPosture(env = process.env) {
|
|
3402
|
-
const token = env.PD_CONSOLE_TOKEN?.trim();
|
|
3403
|
-
return token ? { authenticated: true, token } : { authenticated: false };
|
|
3404
|
-
}
|
|
3405
3366
|
async function autoLaunchConsole(workspaceDir) {
|
|
3406
|
-
const
|
|
3407
|
-
const noAuthFlag = posture.authenticated ? '' : ' --no-auth';
|
|
3408
|
-
// The instruction the Owner may follow by hand — it must carry the same
|
|
3409
|
-
// posture as the launch, or following it re-creates the collision.
|
|
3410
|
-
const manualOpenCommand = `pd console open --workspace "${workspaceDir}"${noAuthFlag}`;
|
|
3367
|
+
const manualOpenCommand = `pd console open --workspace "${workspaceDir}"`;
|
|
3411
3368
|
// Test/smoke seam (mirrors PD_SKIP_GLOBAL_SHIM): isolated installs (release
|
|
3412
3369
|
// smoke, upgrade gate) must not spawn a detached console that holds the
|
|
3413
3370
|
// installed files open or pops a browser.
|
|
@@ -3422,8 +3379,6 @@ async function autoLaunchConsole(workspaceDir) {
|
|
|
3422
3379
|
// Spawn `pd console open` detached — reuses handleConsoleOpen (port detection,
|
|
3423
3380
|
// reuse, health). --no-browser because we open /welcome ourselves.
|
|
3424
3381
|
const launchArgs = [pdCliEntry, 'console', 'open', '--workspace', workspaceDir, '--no-browser'];
|
|
3425
|
-
if (!posture.authenticated)
|
|
3426
|
-
launchArgs.push('--no-auth');
|
|
3427
3382
|
const child = spawn(process.execPath, launchArgs, { detached: true, stdio: 'ignore', shell: false });
|
|
3428
3383
|
child.unref();
|
|
3429
3384
|
// Wait for the console to become ready (bounded poll on
|
|
@@ -3432,7 +3387,7 @@ async function autoLaunchConsole(workspaceDir) {
|
|
|
3432
3387
|
while (Date.now() < deadline) {
|
|
3433
3388
|
for (let i = 0; i < CONSOLE_AUTOLAUNCH_PORT_SCAN_LIMIT; i++) {
|
|
3434
3389
|
const port = CONSOLE_AUTOLAUNCH_BASE_PORT + i;
|
|
3435
|
-
if (await probeAutolaunchHealth(port
|
|
3390
|
+
if (await probeAutolaunchHealth(port)) {
|
|
3436
3391
|
// HashRouter: client-side routes live under /#/ — server only serves /,
|
|
3437
3392
|
// anything else (incl. /welcome) is treated as an API path and returns
|
|
3438
3393
|
// 404 not_found. Must open /#/welcome so the browser loads index.html
|
|
@@ -4299,6 +4254,10 @@ transaction) {
|
|
|
4299
4254
|
installBundledCodexAdapter(pluginDir);
|
|
4300
4255
|
stepIndex++;
|
|
4301
4256
|
installBundledLayoutPackage(pluginDir);
|
|
4257
|
+
// PRI-1145: host-runtime declares file:../core + file:../install-layout.
|
|
4258
|
+
// Both siblings are deployed above, so its physical nested copies are
|
|
4259
|
+
// corrected here — same contract as the adapters below.
|
|
4260
|
+
ensureHostRuntimeResolution();
|
|
4302
4261
|
// PRI-711: the adapter's own file: deps must resolve or pd-cli's eager
|
|
4303
4262
|
// import graph crashes on every command. Runs only once ALL adapter
|
|
4304
4263
|
// siblings exist — the manifest declares file:../core, file:../host-runtime
|
|
@@ -440,6 +440,19 @@ function defaultRunCommand(file, args, timeoutMs) {
|
|
|
440
440
|
const detail = stderr.length > 0 ? stderr.slice(-400) : error;
|
|
441
441
|
return { ok, ...(detail === undefined ? {} : { detail }) };
|
|
442
442
|
}
|
|
443
|
+
/**
|
|
444
|
+
* True when the host's `plugin add` failed while LOADING the marketplace
|
|
445
|
+
* source, not while installing the plugin. Those two failures need different
|
|
446
|
+
* recovery: re-running the same `plugin add` cannot fix a marketplace whose
|
|
447
|
+
* source is missing or unreadable, so the next action must repair the
|
|
448
|
+
* marketplace instead. The match is intentionally narrow — only the host's
|
|
449
|
+
* own loader wording, never a generic error.
|
|
450
|
+
*/
|
|
451
|
+
function isMarketplaceLoadFailure(detail) {
|
|
452
|
+
if (detail === undefined)
|
|
453
|
+
return false;
|
|
454
|
+
return /marketplace root does not contain a supported manifest|failed to load marketplace|marketplace not found|no such marketplace/i.test(detail);
|
|
455
|
+
}
|
|
443
456
|
/**
|
|
444
457
|
* Resolve Codex's PLUGIN_DATA root. ensurePluginData creates
|
|
445
458
|
* `<home>/plugins/data/principles-disciple-<marketplace>`, and Codex sets
|
|
@@ -545,6 +558,19 @@ export class CodexHostInstaller {
|
|
|
545
558
|
const run = this.deps.runCommand ?? defaultRunCommand;
|
|
546
559
|
return run('codex', args, 120_000);
|
|
547
560
|
}
|
|
561
|
+
/**
|
|
562
|
+
* Best-effort refresh of the marketplace snapshot before re-adding the
|
|
563
|
+
* plugin. A Git marketplace serves `plugin add` from a cached snapshot, so a
|
|
564
|
+
* new release is invisible until that snapshot moves. A LOCAL marketplace
|
|
565
|
+
* legitimately refuses this command (there is no snapshot to refresh), which
|
|
566
|
+
* is why failure must not block: the authoritative verdict stays `plugin add`
|
|
567
|
+
* plus the post-refresh pin check below.
|
|
568
|
+
*/
|
|
569
|
+
runMarketplaceUpgrade(marketplace) {
|
|
570
|
+
const args = ['plugin', 'marketplace', 'upgrade', marketplace];
|
|
571
|
+
const run = this.deps.runCommand ?? defaultRunCommand;
|
|
572
|
+
return run('codex', args, 120_000);
|
|
573
|
+
}
|
|
548
574
|
/**
|
|
549
575
|
* Materialize the payload's pinned runtime in PLUGIN_DATA through the
|
|
550
576
|
* plugin's EXISTING setup authority (scripts/pd-setup.cjs). `--skip-init`
|
|
@@ -602,15 +628,23 @@ export class CodexHostInstaller {
|
|
|
602
628
|
: `payload freshness is unverifiable: ${path.join(current.versionDir, 'runtime-version.json')} is unreadable`);
|
|
603
629
|
}
|
|
604
630
|
else if (isRuntimeCohortBehind(pinBefore, canonical)) {
|
|
631
|
+
// A Git marketplace serves `plugin add` from a cached snapshot; without
|
|
632
|
+
// this refresh a new release is invisible. Best-effort: local
|
|
633
|
+
// marketplaces refuse it and `plugin add` + the pin re-check below still
|
|
634
|
+
// decide the outcome honestly.
|
|
635
|
+
this.runMarketplaceUpgrade(marketplaceName);
|
|
605
636
|
const refresh = this.runMarketplaceAdd(marketplaceName);
|
|
606
637
|
if (!refresh.ok) {
|
|
638
|
+
const marketplaceUnavailable = isMarketplaceLoadFailure(refresh.detail);
|
|
607
639
|
return {
|
|
608
640
|
success: false,
|
|
609
641
|
hostId: this.hostId,
|
|
610
642
|
configAction: 'skipped',
|
|
611
643
|
manualActionRequired: true,
|
|
612
644
|
reason: `The installed Codex plugin (cache ${current.version}, pinned ${describeRuntimeCohort(pinBefore)}) is behind the PD release being installed (${describeRuntimeCohort(canonical)}), and the in-place refresh failed${refresh.detail === undefined ? '' : `: ${refresh.detail}`}.`,
|
|
613
|
-
nextAction:
|
|
645
|
+
nextAction: marketplaceUnavailable
|
|
646
|
+
? `The Codex marketplace source for "${marketplaceName}" is unavailable (${refresh.detail}). Re-add it: codex plugin marketplace remove ${marketplaceName}, then codex plugin marketplace add csuzngjh/principles, then re-run this installer.`
|
|
647
|
+
: `Run "codex plugin add principles-disciple@${marketplaceName}" (no uninstall needed) and re-run this installer — the installer then aligns the plugin runtime with the refreshed pin.`,
|
|
614
648
|
};
|
|
615
649
|
}
|
|
616
650
|
const after = detectCodexMarketplaceState(this.codexHome());
|
|
@@ -128,7 +128,7 @@ export function buildSuccessOutput(opts) {
|
|
|
128
128
|
nextActions.push(`Console ready at ${consoleUrl} (browser opened automatically)`);
|
|
129
129
|
}
|
|
130
130
|
else {
|
|
131
|
-
nextActions.push('Start console: pd console --workspace <path>
|
|
131
|
+
nextActions.push('Start console: pd console --workspace <path> (listens on 127.0.0.1 only)');
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
if (isComplete) {
|
|
@@ -73,6 +73,10 @@ export function parseEmbeddedProductIdentity(value) {
|
|
|
73
73
|
}
|
|
74
74
|
/** `pd --version` short stable text contract: `Principles Disciple <version> (<releaseId prefix>)`. */
|
|
75
75
|
export function formatShortVersion(report) {
|
|
76
|
-
|
|
76
|
+
// Bundled ids already carry a readable `bundled-<version>-<digest12>` form; the
|
|
77
|
+
// generic prefix slice cut them to `bundled-2.8.` and dropped the digest. Only
|
|
78
|
+
// raw hex ids need abbreviating.
|
|
79
|
+
const shown = report.releaseId.startsWith('bundled-') ? report.releaseId : report.releaseId.slice(0, 12);
|
|
80
|
+
return `Principles Disciple ${report.productVersion} (${shown})`;
|
|
77
81
|
}
|
|
78
82
|
//# sourceMappingURL=product-identity.js.map
|
|
@@ -268,7 +268,12 @@ export class ReleaseManager {
|
|
|
268
268
|
if (!decision.allowed) {
|
|
269
269
|
// PRI-848: the reason travels structured — the Console must map refusal
|
|
270
270
|
// states from a reason code, never by parsing the note string.
|
|
271
|
-
return {
|
|
271
|
+
return {
|
|
272
|
+
kind: 'no_update',
|
|
273
|
+
reason: decision.reason,
|
|
274
|
+
note: decision.message,
|
|
275
|
+
nextAction: decision.nextAction,
|
|
276
|
+
};
|
|
272
277
|
}
|
|
273
278
|
// PRI-853 (SPEC §10 wired, live-run fix): data compatibility preflight
|
|
274
279
|
// runs against the CURRENTLY ACTIVE version — the release whose data must
|
|
@@ -284,6 +289,7 @@ export class ReleaseManager {
|
|
|
284
289
|
kind: 'no_update',
|
|
285
290
|
reason: 'install_identity_unverifiable',
|
|
286
291
|
note: 'The installation has no readable active release record, so its data compatibility cannot be proven.',
|
|
292
|
+
nextAction: 'No runtime change was made. Run the official installer (npx create-principles-disciple) to repair the active release record, then retry the update.',
|
|
287
293
|
};
|
|
288
294
|
}
|
|
289
295
|
const windowVersion = parseProductVersion(releaseMetadata.compatibility.dataSchemaForwardReadableFrom, 'compatibility.dataSchemaForwardReadableFrom');
|
|
@@ -293,6 +299,10 @@ export class ReleaseManager {
|
|
|
293
299
|
kind: 'no_update',
|
|
294
300
|
reason: 'destructive_migration_requires_maintenance',
|
|
295
301
|
note: `Release ${releaseMetadata.productVersion} only guarantees data readable back to ${windowVersion.productVersion}, but the installed release is ${activeVersion.productVersion}. An ordinary update could strand code rollback.`,
|
|
302
|
+
// PRI-1153: state the facts and an executable step. There is no
|
|
303
|
+
// "official maintenance workflow" entry in this repository, so the
|
|
304
|
+
// refusal must not promise one.
|
|
305
|
+
nextAction: `No runtime change was made. Back up this workspace's ".pd" directory, then contact the maintainer to migrate data from ${activeVersion.productVersion} before installing ${releaseMetadata.productVersion}; this ordinary update path cannot cross the ${windowVersion.productVersion} schema boundary.`,
|
|
296
306
|
};
|
|
297
307
|
}
|
|
298
308
|
// PRI-850: honor a caller-generated transaction id (bootstrap executor
|
|
@@ -14,4 +14,4 @@ export { WORKBUDDY_TOOL_SEMANTICS, WORKBUDDY_TOOL_SEMANTIC_MAPPINGS, } from './t
|
|
|
14
14
|
export { recordWorkbuddyPromptDeliveryEvidence, recordWorkbuddyDenyEvidence, workbuddyCapabilityDeclarations, WORKBUDDY_EVIDENCE_ADAPTER_VERSION, } from './workbuddy-evidence-recorder.js';
|
|
15
15
|
export { processWorkbuddyHookInvocation, annotateContextWarnings, type WorkBuddyPdHookResult, } from './pd-hook.js';
|
|
16
16
|
export { runWorkbuddyWorkspaceWorkerCycle, type WorkbuddyWorkerCycleResult, type WorkbuddyWorkerCycleOptions, type WorkbuddyWorkerCycleStepReport, type WorkbuddyWorkerMode, } from './worker/workspace-worker.js';
|
|
17
|
-
export { encodeWorkbuddyCwd, deriveWorkbuddyTranscriptPath, validateWorkbuddyTranscriptPath, workbuddyProjectsRoot, decodeWorkbuddyTranscriptWindow, createWorkbuddyTranscriptSource, WORKBUDDY_SINGLE_SESSION_ALERT_BYTES, type WorkbuddyTranscriptFileIdentity, type WorkbuddyTranscriptPathValidation, type DecodedWorkbuddyDelta, type DecodeWorkbuddyWindowInput, type WorkbuddyTranscriptSourceContext, ingestWorkbuddyConversation, workbuddyIngestionHints, catchUpWorkbuddyIngestion, type WorkbuddyIngestionOptions, type WorkbuddyIngestionOutcome, type WorkbuddyCatchUpOptions, type WorkbuddyCatchUpResult, } from './ingestion/index.js';
|
|
17
|
+
export { encodeWorkbuddyCwd, deriveWorkbuddyTranscriptPath, validateWorkbuddyTranscriptPath, workbuddyProjectsRoot, decodeWorkbuddyTranscriptWindow, createWorkbuddyTranscriptSource, WORKBUDDY_SINGLE_SESSION_ALERT_BYTES, type WorkbuddyTranscriptFileIdentity, type WorkbuddyTranscriptPathValidation, type DecodedWorkbuddyDelta, type DecodeWorkbuddyWindowInput, type WorkbuddyTranscriptSourceContext, ingestWorkbuddyConversation, workbuddyIngestionHints, catchUpWorkbuddyIngestion, locateWorkbuddyTranscriptBySessionIdentity, type WorkbuddyIngestionOptions, type WorkbuddyIngestionOutcome, type WorkbuddyCatchUpOptions, type WorkbuddyCatchUpResult, } from './ingestion/index.js';
|
|
@@ -14,4 +14,4 @@ export { WORKBUDDY_TOOL_SEMANTICS, WORKBUDDY_TOOL_SEMANTIC_MAPPINGS, } from './t
|
|
|
14
14
|
export { recordWorkbuddyPromptDeliveryEvidence, recordWorkbuddyDenyEvidence, workbuddyCapabilityDeclarations, WORKBUDDY_EVIDENCE_ADAPTER_VERSION, } from './workbuddy-evidence-recorder.js';
|
|
15
15
|
export { processWorkbuddyHookInvocation, annotateContextWarnings, } from './pd-hook.js';
|
|
16
16
|
export { runWorkbuddyWorkspaceWorkerCycle, } from './worker/workspace-worker.js';
|
|
17
|
-
export { encodeWorkbuddyCwd, deriveWorkbuddyTranscriptPath, validateWorkbuddyTranscriptPath, workbuddyProjectsRoot, decodeWorkbuddyTranscriptWindow, createWorkbuddyTranscriptSource, WORKBUDDY_SINGLE_SESSION_ALERT_BYTES, ingestWorkbuddyConversation, workbuddyIngestionHints, catchUpWorkbuddyIngestion, } from './ingestion/index.js';
|
|
17
|
+
export { encodeWorkbuddyCwd, deriveWorkbuddyTranscriptPath, validateWorkbuddyTranscriptPath, workbuddyProjectsRoot, decodeWorkbuddyTranscriptWindow, createWorkbuddyTranscriptSource, WORKBUDDY_SINGLE_SESSION_ALERT_BYTES, ingestWorkbuddyConversation, workbuddyIngestionHints, catchUpWorkbuddyIngestion, locateWorkbuddyTranscriptBySessionIdentity, } from './ingestion/index.js';
|
|
@@ -14,6 +14,17 @@ export interface WorkbuddyCatchUpResult {
|
|
|
14
14
|
readonly ingested: number;
|
|
15
15
|
readonly warnings: readonly string[];
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Find the ONE transcript file whose name equals an already checkpointed
|
|
19
|
+
* session identity inside the projects root. Returns null for a non-contract
|
|
20
|
+
* identity, an unreadable root, or zero/multiple matches — never a guess.
|
|
21
|
+
*
|
|
22
|
+
* Exported since PRI-1171 ticket ⑦: the `pd health` ingestion section stats
|
|
23
|
+
* the SAME located file (size only, never content) for byte-lag — one
|
|
24
|
+
* locator for both the writer (catch-up) and the reader (health), not a
|
|
25
|
+
* second implementation of the same purpose.
|
|
26
|
+
*/
|
|
27
|
+
export declare function locateWorkbuddyTranscriptBySessionIdentity(projectsRoot: string, rolloutIdentity: string): string | null;
|
|
17
28
|
/**
|
|
18
29
|
* Re-enter the gated ingestion pipeline for every durable WorkBuddy
|
|
19
30
|
* checkpoint, at most `maxRollouts` sessions per cycle.
|
|
@@ -34,8 +34,13 @@ const SESSION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-
|
|
|
34
34
|
* Find the ONE transcript file whose name equals an already checkpointed
|
|
35
35
|
* session identity inside the projects root. Returns null for a non-contract
|
|
36
36
|
* identity, an unreadable root, or zero/multiple matches — never a guess.
|
|
37
|
+
*
|
|
38
|
+
* Exported since PRI-1171 ticket ⑦: the `pd health` ingestion section stats
|
|
39
|
+
* the SAME located file (size only, never content) for byte-lag — one
|
|
40
|
+
* locator for both the writer (catch-up) and the reader (health), not a
|
|
41
|
+
* second implementation of the same purpose.
|
|
37
42
|
*/
|
|
38
|
-
function
|
|
43
|
+
export function locateWorkbuddyTranscriptBySessionIdentity(projectsRoot, rolloutIdentity) {
|
|
39
44
|
if (!SESSION_ID_PATTERN.test(rolloutIdentity))
|
|
40
45
|
return null;
|
|
41
46
|
let entries;
|
|
@@ -122,7 +127,7 @@ export function catchUpWorkbuddyIngestion(options) {
|
|
|
122
127
|
warnings.push(`checkpoint_defer_failed:${rolloutIdentity}:${deferred.reason}`);
|
|
123
128
|
};
|
|
124
129
|
for (const checkpoint of checkpoints) {
|
|
125
|
-
const located =
|
|
130
|
+
const located = locateWorkbuddyTranscriptBySessionIdentity(projectsRoot, checkpoint.rolloutIdentity);
|
|
126
131
|
if (located === null) {
|
|
127
132
|
warnings.push(`transcript_unavailable:${checkpoint.rolloutIdentity}`);
|
|
128
133
|
defer(checkpoint.rolloutIdentity, 'transcript_unavailable');
|
|
@@ -10,4 +10,4 @@ export { deriveWorkbuddyTranscriptPath, validateWorkbuddyTranscriptPath, workbud
|
|
|
10
10
|
export { decodeWorkbuddyTranscriptWindow, type DecodedWorkbuddyDelta, type DecodeWorkbuddyWindowInput, } from './transcript-decoder.js';
|
|
11
11
|
export { createWorkbuddyTranscriptSource, WORKBUDDY_SINGLE_SESSION_ALERT_BYTES, type WorkbuddyTranscriptSourceContext, } from './transcript-source.js';
|
|
12
12
|
export { ingestWorkbuddyConversation, workbuddyIngestionHints, type WorkbuddyIngestionOptions, type WorkbuddyIngestionOutcome, } from './ingestion.js';
|
|
13
|
-
export { catchUpWorkbuddyIngestion, type WorkbuddyCatchUpOptions, type WorkbuddyCatchUpResult, } from './catch-up.js';
|
|
13
|
+
export { catchUpWorkbuddyIngestion, locateWorkbuddyTranscriptBySessionIdentity, type WorkbuddyCatchUpOptions, type WorkbuddyCatchUpResult, } from './catch-up.js';
|
|
@@ -10,4 +10,4 @@ export { deriveWorkbuddyTranscriptPath, validateWorkbuddyTranscriptPath, workbud
|
|
|
10
10
|
export { decodeWorkbuddyTranscriptWindow, } from './transcript-decoder.js';
|
|
11
11
|
export { createWorkbuddyTranscriptSource, WORKBUDDY_SINGLE_SESSION_ALERT_BYTES, } from './transcript-source.js';
|
|
12
12
|
export { ingestWorkbuddyConversation, workbuddyIngestionHints, } from './ingestion.js';
|
|
13
|
-
export { catchUpWorkbuddyIngestion, } from './catch-up.js';
|
|
13
|
+
export { catchUpWorkbuddyIngestion, locateWorkbuddyTranscriptBySessionIdentity, } from './catch-up.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principles/workbuddy-adapter",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "WorkBuddy host adapter for Principles Disciple — implements the HostAdapter interface for WorkBuddy's Git Bash command-hook model (ADR-0020 third host, SPEC workbuddy-host-adapter v0.3.0).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { IncomingMessage } from 'node:http';
|
|
2
|
-
export interface AuthConfigOptions {
|
|
3
|
-
cliToken?: string;
|
|
4
|
-
envToken?: string;
|
|
5
|
-
noAuth?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare class AuthConfig {
|
|
8
|
-
private readonly token;
|
|
9
|
-
private readonly enabled;
|
|
10
|
-
constructor(opts?: AuthConfigOptions);
|
|
11
|
-
isEnabled(): boolean;
|
|
12
|
-
getToken(): string | null;
|
|
13
|
-
isAuthenticated(req: IncomingMessage): boolean;
|
|
14
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as crypto from 'crypto';
|
|
2
|
-
export class AuthConfig {
|
|
3
|
-
token;
|
|
4
|
-
enabled;
|
|
5
|
-
constructor(opts = {}) {
|
|
6
|
-
const token = opts.cliToken ?? opts.envToken ?? null;
|
|
7
|
-
this.enabled = !opts.noAuth && token !== null && token.length > 0;
|
|
8
|
-
this.token = token;
|
|
9
|
-
}
|
|
10
|
-
isEnabled() {
|
|
11
|
-
return this.enabled;
|
|
12
|
-
}
|
|
13
|
-
getToken() {
|
|
14
|
-
return this.token;
|
|
15
|
-
}
|
|
16
|
-
isAuthenticated(req) {
|
|
17
|
-
if (!this.enabled) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
const authHeader = req.headers.authorization;
|
|
21
|
-
if (typeof authHeader !== 'string') {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
const match = /^Bearer\s+(.+)$/i.exec(authHeader);
|
|
25
|
-
if (!match) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
const [, provided] = match;
|
|
29
|
-
if (!provided) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
if (!this.token) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
const providedBuf = Buffer.from(provided, 'utf8');
|
|
36
|
-
const expectedBuf = Buffer.from(this.token, 'utf8');
|
|
37
|
-
if (providedBuf.length !== expectedBuf.length) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
return crypto.timingSafeEqual(providedBuf, expectedBuf);
|
|
41
|
-
}
|
|
42
|
-
}
|