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
|
@@ -24,7 +24,20 @@ import { fileURLToPath } from 'node:url';
|
|
|
24
24
|
* caller receives explicit NOT-VERIFIED entries for them instead of
|
|
25
25
|
* fabricated ok flags (fail closed; SPEC R4 §2.4.7).
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* PRI-1202 — single budget authority.
|
|
29
|
+
*
|
|
30
|
+
* The CLI recovery probes run INSIDE one Owner Console HTTP request. The
|
|
31
|
+
* console wrapper (`asyncHandler`) answers 504 once its request budget
|
|
32
|
+
* expires, so two independent literals (probe 15s, request 10s) let a single
|
|
33
|
+
* probe outlive the request it belongs to. The console request budget is the
|
|
34
|
+
* authority; the probe budget is DERIVED from it and must stay strictly
|
|
35
|
+
* smaller, leaving fixed headroom for the console to serialize the response.
|
|
36
|
+
*/
|
|
37
|
+
export const CONSOLE_REQUEST_BUDGET_MS = 10_000;
|
|
38
|
+
/** Headroom reserved inside the console request budget for response assembly. */
|
|
39
|
+
export const CLI_RECOVERY_PROBE_HEADROOM_MS = 2_000;
|
|
40
|
+
export const CLI_RECOVERY_PROBE_TIMEOUT_MS = CONSOLE_REQUEST_BUDGET_MS - CLI_RECOVERY_PROBE_HEADROOM_MS;
|
|
28
41
|
const MAX_STDOUT_BYTES = 1024 * 1024;
|
|
29
42
|
export const DEACTIVATE_DRY_RUN_PROBE_ACTIVATION_ID = 'recovery-probe-nonexistent';
|
|
30
43
|
/**
|
|
@@ -109,7 +122,7 @@ function capability(capabilityId, evidence) {
|
|
|
109
122
|
const CONSOLE_UNVERIFIABLE_DETAIL = 'console-channel control: verifying the HTTP-only recovery entry requires the Owner Console process; a CLI subprocess cannot produce this evidence';
|
|
110
123
|
/** `pd activation list --json` — the pd_status status surface, read-only. */
|
|
111
124
|
export async function probeCliActivationStatus(options) {
|
|
112
|
-
const run = await runCli(options.cliEntry, ['activation', 'list', '--json', '--workspace', options.workspaceDir], options.timeoutMs ??
|
|
125
|
+
const run = await runCli(options.cliEntry, ['activation', 'list', '--json', '--workspace', options.workspaceDir], options.timeoutMs ?? CLI_RECOVERY_PROBE_TIMEOUT_MS);
|
|
113
126
|
if (!run.ok)
|
|
114
127
|
return capability('pd_status', { channel: 'cli', ok: false, workspaceMatched: false, detail: `pd activation list: ${run.detail}` });
|
|
115
128
|
let parsed;
|
|
@@ -138,7 +151,7 @@ export async function probeCliActivationStatus(options) {
|
|
|
138
151
|
* an honest not-found while the entry itself is proven executable.
|
|
139
152
|
*/
|
|
140
153
|
export async function probeCliDeactivateDryRun(options) {
|
|
141
|
-
const run = await runCli(options.cliEntry, ['activation', 'deactivate', '--activation-id', DEACTIVATE_DRY_RUN_PROBE_ACTIVATION_ID, '--dry-run', '--json', '--workspace', options.workspaceDir], options.timeoutMs ??
|
|
154
|
+
const run = await runCli(options.cliEntry, ['activation', 'deactivate', '--activation-id', DEACTIVATE_DRY_RUN_PROBE_ACTIVATION_ID, '--dry-run', '--json', '--workspace', options.workspaceDir], options.timeoutMs ?? CLI_RECOVERY_PROBE_TIMEOUT_MS);
|
|
142
155
|
if (!run.ok)
|
|
143
156
|
return capability('rulecode_deactivate', { channel: 'cli', ok: false, workspaceMatched: false, detail: `pd activation deactivate --dry-run: ${run.detail}` });
|
|
144
157
|
let parsed;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Codex conversation-ingestion consent disclosure — G2A frozen text (Slice D)
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* package:
|
|
2
|
+
* Codex conversation-ingestion consent disclosure — G2A frozen text (Slice D),
|
|
3
|
+
* amended by the Owner decision recorded as "Amendment 2 — disclosure v2"
|
|
4
|
+
* (2026-11-12) in:
|
|
6
5
|
* docs/superpowers/specs/2026-08-28-codex-governance-closure-g0-g2a-decision.md
|
|
7
6
|
* § "Frozen consent disclosure text (setup will show this verbatim)"
|
|
8
7
|
*
|
|
@@ -12,12 +11,18 @@
|
|
|
12
11
|
* the document and asserts byte equality with this constant, so any drift
|
|
13
12
|
* here fails CI.
|
|
14
13
|
*
|
|
14
|
+
* v2 (g2b) corrects the "what PD reads" paragraph: the model's own plaintext
|
|
15
|
+
* thinking summary IS stored (it is visible in the Codex UI); the encrypted
|
|
16
|
+
* reasoning body is neither read nor saved. The version advanced so that a
|
|
17
|
+
* consent granted against the old disclosure falls back to the bounded tier
|
|
18
|
+
* instead of silently widening what is stored.
|
|
19
|
+
*
|
|
15
20
|
* The English rendering states the same facts; per the G2A binding note it is
|
|
16
21
|
* produced at setup implementation time from the frozen Chinese text. Setup
|
|
17
22
|
* surfaces always present the Chinese SSoT first.
|
|
18
23
|
*/
|
|
19
|
-
export declare const CODEX_INGESTION_DISCLOSURE_VERSION = "
|
|
24
|
+
export declare const CODEX_INGESTION_DISCLOSURE_VERSION = "g2b-2026-11-12";
|
|
20
25
|
export type CodexIngestionDisclosureLanguage = 'zh' | 'en';
|
|
21
|
-
export declare const CODEX_INGESTION_DISCLOSURE_ZH = "### Principles Disciple \u2014 \u5BF9\u8BDD\u89C2\u5BDF\u4E0E\u6CBB\u7406\u95ED\u73AF\uFF08Codex\uFF09\n\n**\u5F00\u542F\u540E PD \u4F1A\u8BFB\u53D6\u4EC0\u4E48\uFF1F**\n\u8BFB\u53D6\u672C\u5DE5\u4F5C\u533A\u5185 Codex \u660E\u786E\u63D0\u4F9B\u7ED9 PD \u7684\u4F1A\u8BDD\u8BB0\u5F55\uFF08transcript\uFF09\u3002\u8FDB\u5165\u6CBB\u7406\u89C2\u5BDF\u7684\u53EA\u6709\u53EF\u89C1\u5185\u5BB9\uFF1A\u4F60\u53D1\u51FA\u7684\u6D88\u606F\u3001\u52A9\u624B\u7684\u53EF\u89C1\u56DE\u590D\u3001\
|
|
22
|
-
export declare const CODEX_INGESTION_DISCLOSURE_EN = "### Principles Disciple \u2014 Conversation Observation & Governance Closure (Codex)\n\n**What does PD read once enabled?**\nPD reads the Codex session transcripts that Codex explicitly provides to PD inside this workspace. Only visible content enters governance observation: the messages you send, the assistant's visible replies,
|
|
26
|
+
export declare const CODEX_INGESTION_DISCLOSURE_ZH = "### Principles Disciple \u2014 \u5BF9\u8BDD\u89C2\u5BDF\u4E0E\u6CBB\u7406\u95ED\u73AF\uFF08Codex\uFF09\n\n**\u5F00\u542F\u540E PD \u4F1A\u8BFB\u53D6\u4EC0\u4E48\uFF1F**\n\u8BFB\u53D6\u672C\u5DE5\u4F5C\u533A\u5185 Codex \u660E\u786E\u63D0\u4F9B\u7ED9 PD \u7684\u4F1A\u8BDD\u8BB0\u5F55\uFF08transcript\uFF09\u3002\u8FDB\u5165\u6CBB\u7406\u89C2\u5BDF\u7684\u53EA\u6709\u53EF\u89C1\u5185\u5BB9\uFF1A\u4F60\u53D1\u51FA\u7684\u6D88\u606F\u3001\u52A9\u624B\u7684\u53EF\u89C1\u56DE\u590D\u3001\u5DE5\u5177\u8C03\u7528\u7684\u540D\u79F0/\u8F93\u5165/\u7ED3\u679C\uFF08\u7528\u4E8E\u8BC6\u522B\u53CD\u590D\u51FA\u73B0\u7684\u95EE\u9898\uFF09\uFF0C\u4EE5\u53CA\u6A21\u578B\u81EA\u5DF1\u5199\u51FA\u7684\u601D\u8003\u6458\u8981\uFF08\u4E00\u6BB5\u7B80\u77ED\u6587\u5B57\uFF0CCodex \u754C\u9762\u4E0A\u4E5F\u4F1A\u663E\u793A\u7ED9\u4F60\uFF09\u3002Codex \u53E6\u5916\u4EE5\u52A0\u5BC6\u5F62\u5F0F\u4FDD\u5B58\u7684\u5B8C\u6574\u601D\u8003\u6B63\u6587\uFF0CPD \u65E2\u4E0D\u8BFB\u53D6\u4E5F\u4E0D\u4FDD\u5B58\u3002\u8BB0\u5F55\u4E2D\u540C\u65F6\u5B58\u5728\u7684\u7CFB\u7EDF/\u5F00\u53D1\u8005\u63D0\u793A\u8BCD\u3001\u5BBF\u4E3B\u6CE8\u5165\u7684\u73AF\u5883\u4E0A\u4E0B\u6587\uFF0C\u4F1A\u5728\u89E3\u6790\u65F6\u88AB\u8BC6\u522B\u5E76\u4E22\u5F03\u2014\u2014\u4E0D\u4F1A\u88AB\u4FDD\u5B58\u3001\u4E0D\u4F1A\u8FDB\u5165\u65E5\u5FD7\u3001\u4E0D\u4F1A\u53D1\u9001\u7ED9\u8BCA\u65AD\u6A21\u578B\u3002\n\n**\u4E3A\u4EC0\u4E48\u8BFB\u53D6\uFF1F**\n\u4E3A\u4E86\u8BA9 PD \u5728 Codex \u4E0A\u5B8C\u6210\u5B83\u627F\u8BFA\u7684\u95ED\u73AF\uFF1A\u628A\u4F60\u53CD\u590D\u7EA0\u6B63\u7684\u5730\u65B9\u53D8\u6210\u4E00\u6761\u53EF\u5BA1\u67E5\u7684\u539F\u5219\u5019\u9009\u2014\u2014\u4F60\u9700\u8981\u5148\u770B\u5230\u8BC1\u636E\uFF0C\u518D\u51B3\u5B9A\u662F\u5426\u91C7\u7EB3\u3002\u4E0D\u89E3\u6790\u5BF9\u8BDD\uFF0CPD \u5C31\u53EA\u80FD\u7BA1\u5DE5\u5177\uFF0C\u5B66\u4E0D\u5230\u7EA0\u6B63\u3002\n\n**\u4FDD\u5B58\u591A\u5C11\u3001\u591A\u4E45\uFF1F**\n\u6BCF\u4E2A\u4F1A\u8BDD\u53EA\u4FDD\u7559\u6700\u8FD1 32 \u6761\u53EF\u89C1\u6D88\u606F\u3001\u6700\u591A 7 \u5929\uFF08\u5148\u5230\u671F\u5148\u5220\u9664\uFF09\u3002\u5F53\u67D0\u4E2A\u95EE\u9898\u88AB\u6B63\u5F0F\u7ACB\u4E3A pain \u65F6\uFF0C\u624D\u4F1A\u628A\u5B83\u7684\u524D 12 \u6761\u6D88\u606F + \u89E6\u53D1\u70B9 + \u52A9\u624B\u7684\u4E0B\u4E00\u6761\u5B8C\u6574\u56DE\u590D\u5347\u7EA7\u4E3A\u957F\u671F\u6CBB\u7406\u8BC1\u636E\uFF0C\u6309\u73B0\u6709\u6CBB\u7406\u6570\u636E\u7684\u751F\u547D\u5468\u671F\u7BA1\u7406\u3002\u4FDD\u5B58\u7684\u5DE5\u5177\u8BC1\u636E\u5728\u843D\u76D8\u524D\u4F1A\u7ECF\u8FC7\u65E2\u6709\u7684\u654F\u611F\u5B57\u6BB5\u4E0E\u5E38\u89C1\u5BC6\u94A5\u683C\u5F0F\u8131\u654F\uFF1B\u4F46\u8BF7\u6CE8\u610F\uFF1A\u5982\u679C\u4E00\u6BB5\u5BC6\u94A5\u770B\u8D77\u6765\u5C31\u50CF\u666E\u901A\u6587\u5B57\uFF0C\u4EFB\u4F55\u8FC7\u6EE4\u5668\u90FD\u65E0\u6CD5\u8BC6\u522B\u5B83\u2014\u2014\u8BF7\u4E0D\u8981\u8BA9 PD \u89C2\u5BDF\u5305\u542B\u6B64\u7C7B\u5185\u5BB9\u7684\u4F1A\u8BDD\u3002\n\n**\u6570\u636E\u4F1A\u79BB\u5F00\u672C\u673A\u5417\uFF1F**\n\u89C2\u5BDF\u6570\u636E\u672C\u8EAB\u53EA\u5B58\u5728\u672C\u673A\u5DE5\u4F5C\u533A\u3002\u88AB\u5347\u7EA7\u4E3A\u6CBB\u7406\u8BC1\u636E\u7684\u5BF9\u8BDD\u7247\u6BB5\uFF0C\u4F1A\u50CF\u73B0\u6709\u8BCA\u65AD\u6D41\u7A0B\u4E00\u6837\u53D1\u9001\u7ED9\u4F60\u914D\u7F6E\u7684 LLM API \u505A\u8BCA\u65AD\u2014\u2014\u8FD9\u662F\u552F\u4E00\u7684\u5916\u53D1\u8DEF\u5F84\uFF0C\u4E0E OpenClaw \u4E0A\u7684\u73B0\u6709\u884C\u4E3A\u4E00\u81F4\u3002\u4EA7\u54C1\u9065\u6D4B\u4E0D\u5305\u542B\u4EFB\u4F55\u6D88\u606F\u5185\u5BB9\u6216\u4F1A\u8BDD\u6807\u8BC6\u3002\n\n**\u5982\u4F55\u5173\u95ED\uFF1F\u968F\u65F6\u3002**\n\u5173\u95ED\u540E PD \u7ACB\u5373\u505C\u6B62\u8BFB\u53D6 transcript\uFF08\u4E0D\u662F\"\u8BFB\u4E86\u518D\u4E22\u5F03\"\uFF0C\u800C\u662F\u6839\u672C\u4E0D\u6253\u5F00\uFF09\u3002\u5DF2\u6709\u7684\u539F\u5219\u6CE8\u5165\u3001\u5DE5\u5177\u62E6\u622A\u3001\u65E2\u6709\u5DE5\u5177\u8BC1\u636E\u5B8C\u5168\u4E0D\u53D7\u5F71\u54CD\u3002\u5DF2\u4FDD\u5B58\u7684\u5185\u5BB9\u6309\u4E0A\u8FF0\u671F\u9650\u81EA\u7136\u8FC7\u671F\uFF1B\u5347\u7EA7\u8FC7\u7684\u8BC1\u636E\u53EA\u80FD\u7531\u4F60\u901A\u8FC7\u65E2\u6709\u6CBB\u7406\u6E05\u7406\u547D\u4EE4\u663E\u5F0F\u5220\u9664\u3002\u5378\u8F7D\u4E0D\u4F1A\u9759\u9ED8\u5220\u9664\u4EFB\u4F55\u8BC1\u636E\u3002\n\n**\u9ED8\u8BA4\u72B6\u6001\uFF1F**\n\u9ED8\u8BA4\u5173\u95ED\u3002\u53EA\u6709\u4F60\u5728\u770B\u5230\u672C\u8BF4\u660E\u540E\u660E\u786E\u9009\u62E9\u5F00\u542F\u624D\u4F1A\u751F\u6548\uFF1B\u5347\u7EA7 PD \u6C38\u8FDC\u4E0D\u4F1A\u66FF\u4F60\u5F00\u542F\u3002";
|
|
27
|
+
export declare const CODEX_INGESTION_DISCLOSURE_EN = "### Principles Disciple \u2014 Conversation Observation & Governance Closure (Codex)\n\n**What does PD read once enabled?**\nPD reads the Codex session transcripts that Codex explicitly provides to PD inside this workspace. Only visible content enters governance observation: the messages you send, the assistant's visible replies, the names/inputs/results of tool calls (used to recognize recurring problems), and the short thinking summaries the model writes (the same text Codex shows you in its UI). The full reasoning body that Codex keeps in encrypted form is neither read nor saved by PD. System/developer prompts and host-injected environment context present in the same records are recognized and discarded during parsing \u2014 never saved, never written to logs, never sent to the diagnosis model.\n\n**Why read at all?**\nSo that PD can deliver on its promised closed loop on Codex: turning the places you repeatedly correct into a reviewable principle candidate \u2014 you see the evidence first, then decide whether to adopt it. Without parsing conversations, PD can only govern tools and cannot learn your corrections.\n\n**How much is kept, and for how long?**\nPer session, only the most recent 32 visible messages are kept, for at most 7 days (expired first, deleted first). Only when a problem is formally established as a pain are its preceding 12 messages + the trigger point + the assistant's next complete reply promoted into long-term governance evidence, managed under the existing governance data lifecycle. Saved tool evidence passes through the existing sensitive-field and common-secret-format redaction before being written; but note: if a secret looks like ordinary text, no filter can recognize it \u2014 please do not let PD observe sessions containing such content.\n\n**Does data leave this machine?**\nObservation data itself lives only in the local workspace. Conversation fragments promoted into governance evidence are sent to your configured LLM API for diagnosis, exactly like the existing diagnosis flow \u2014 this is the only egress path, consistent with current behavior on OpenClaw. Product telemetry contains no message content and no session identifiers.\n\n**How do I turn it off? Anytime.**\nOnce off, PD immediately stops reading transcripts (not \"read then discard\" \u2014 the transcript is never opened at all). Existing principle injection, tool interception, and existing tool evidence are completely unaffected. Saved content expires naturally per the limits above; promoted evidence can only be deleted explicitly by you through the existing governance cleanup commands. Uninstall never silently deletes any evidence.\n\n**Default state?**\nOff by default. It takes effect only after you explicitly choose to enable it after seeing this disclosure; upgrading PD never enables it for you.";
|
|
23
28
|
export declare function getCodexIngestionDisclosureText(language: CodexIngestionDisclosureLanguage): string;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Codex conversation-ingestion consent disclosure — G2A frozen text (Slice D)
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* package:
|
|
2
|
+
* Codex conversation-ingestion consent disclosure — G2A frozen text (Slice D),
|
|
3
|
+
* amended by the Owner decision recorded as "Amendment 2 — disclosure v2"
|
|
4
|
+
* (2026-11-12) in:
|
|
6
5
|
* docs/superpowers/specs/2026-08-28-codex-governance-closure-g0-g2a-decision.md
|
|
7
6
|
* § "Frozen consent disclosure text (setup will show this verbatim)"
|
|
8
7
|
*
|
|
@@ -12,15 +11,21 @@
|
|
|
12
11
|
* the document and asserts byte equality with this constant, so any drift
|
|
13
12
|
* here fails CI.
|
|
14
13
|
*
|
|
14
|
+
* v2 (g2b) corrects the "what PD reads" paragraph: the model's own plaintext
|
|
15
|
+
* thinking summary IS stored (it is visible in the Codex UI); the encrypted
|
|
16
|
+
* reasoning body is neither read nor saved. The version advanced so that a
|
|
17
|
+
* consent granted against the old disclosure falls back to the bounded tier
|
|
18
|
+
* instead of silently widening what is stored.
|
|
19
|
+
*
|
|
15
20
|
* The English rendering states the same facts; per the G2A binding note it is
|
|
16
21
|
* produced at setup implementation time from the frozen Chinese text. Setup
|
|
17
22
|
* surfaces always present the Chinese SSoT first.
|
|
18
23
|
*/
|
|
19
|
-
export const CODEX_INGESTION_DISCLOSURE_VERSION = '
|
|
24
|
+
export const CODEX_INGESTION_DISCLOSURE_VERSION = 'g2b-2026-11-12';
|
|
20
25
|
export const CODEX_INGESTION_DISCLOSURE_ZH = `### Principles Disciple — 对话观察与治理闭环(Codex)
|
|
21
26
|
|
|
22
27
|
**开启后 PD 会读取什么?**
|
|
23
|
-
读取本工作区内 Codex 明确提供给 PD 的会话记录(transcript
|
|
28
|
+
读取本工作区内 Codex 明确提供给 PD 的会话记录(transcript)。进入治理观察的只有可见内容:你发出的消息、助手的可见回复、工具调用的名称/输入/结果(用于识别反复出现的问题),以及模型自己写出的思考摘要(一段简短文字,Codex 界面上也会显示给你)。Codex 另外以加密形式保存的完整思考正文,PD 既不读取也不保存。记录中同时存在的系统/开发者提示词、宿主注入的环境上下文,会在解析时被识别并丢弃——不会被保存、不会进入日志、不会发送给诊断模型。
|
|
24
29
|
|
|
25
30
|
**为什么读取?**
|
|
26
31
|
为了让 PD 在 Codex 上完成它承诺的闭环:把你反复纠正的地方变成一条可审查的原则候选——你需要先看到证据,再决定是否采纳。不解析对话,PD 就只能管工具,学不到纠正。
|
|
@@ -39,7 +44,7 @@ export const CODEX_INGESTION_DISCLOSURE_ZH = `### Principles Disciple — 对话
|
|
|
39
44
|
export const CODEX_INGESTION_DISCLOSURE_EN = `### Principles Disciple — Conversation Observation & Governance Closure (Codex)
|
|
40
45
|
|
|
41
46
|
**What does PD read once enabled?**
|
|
42
|
-
PD reads the Codex session transcripts that Codex explicitly provides to PD inside this workspace. Only visible content enters governance observation: the messages you send, the assistant's visible replies,
|
|
47
|
+
PD reads the Codex session transcripts that Codex explicitly provides to PD inside this workspace. Only visible content enters governance observation: the messages you send, the assistant's visible replies, the names/inputs/results of tool calls (used to recognize recurring problems), and the short thinking summaries the model writes (the same text Codex shows you in its UI). The full reasoning body that Codex keeps in encrypted form is neither read nor saved by PD. System/developer prompts and host-injected environment context present in the same records are recognized and discarded during parsing — never saved, never written to logs, never sent to the diagnosis model.
|
|
43
48
|
|
|
44
49
|
**Why read at all?**
|
|
45
50
|
So that PD can deliver on its promised closed loop on Codex: turning the places you repeatedly correct into a reviewable principle candidate — you see the evidence first, then decide whether to adopt it. Without parsing conversations, PD can only govern tools and cannot learn your corrections.
|
|
@@ -1,35 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conversation-ingestion pipeline — the single orchestration entry for
|
|
3
|
-
* unified host trajectory ingestion (PRI-1171; SPEC v0.2 §4.1).
|
|
4
|
-
*
|
|
5
|
-
* Five segments, host-neutral:
|
|
6
|
-
*
|
|
7
|
-
* gate (flag short-circuit, ZERO port calls) → consent gate → locate →
|
|
8
|
-
* bounded window read (TOCTOU-mapped) → host decode → host contract guard →
|
|
9
|
-
* pre-ingest host side-writes → sanitize-at-store ingest with checkpoint →
|
|
10
|
-
* stop-classified outcome.
|
|
11
|
-
*
|
|
12
|
-
* Ordering invariants carried over verbatim from the Codex path (behavior
|
|
13
|
-
* lock, fixtures in codex-adapter/tests/ingestion/ingestion.test.ts):
|
|
14
|
-
* - flag-off / consent-not-granted short-circuit BEFORE locate — the
|
|
15
|
-
* transcript filesystem boundary receives zero calls (SPEC §10 hard
|
|
16
|
-
* privacy invariant, proven by a port spy);
|
|
17
|
-
* - a host contract guard refusal (e.g. unsupported host version) ingests
|
|
18
|
-
* NOTHING and holds the checkpoint — the next trigger retries;
|
|
19
|
-
* - pre-ingest side-write failure (e.g. verified tool outcomes) holds the
|
|
20
|
-
* checkpoint so the delta retries instead of silently losing facts;
|
|
21
|
-
* - a stable malformed record commits the records BEFORE it, holds the
|
|
22
|
-
* checkpoint at it, and degrades loudly;
|
|
23
|
-
* - an incomplete tail commits what precedes it, parks the checkpoint at
|
|
24
|
-
* the tail start, and reports a warning (transient by design).
|
|
25
|
-
*
|
|
26
|
-
* The pipeline never learns host formats: the source adapter supplies locate
|
|
27
|
-
* + decode + rollout lineage; `degradeTexts` carries host-CLI vocabulary
|
|
28
|
-
* (quarantine commands etc.) so Operator-facing nextActions stay exact.
|
|
29
|
-
*/
|
|
30
1
|
import { type GovernanceObservationInput } from '../governance-observation-store.js';
|
|
31
2
|
import { type HookHints, type SessionRef, type TranscriptDelta, type TranscriptPort, type TranscriptSourceAdapter } from './source.js';
|
|
32
3
|
import type { ConversationIngestionConsentDecision } from './consent.js';
|
|
4
|
+
import { type TextPolicy } from './text-policy.js';
|
|
33
5
|
/** Verdict of a pre-ingest host side-write: failure holds the checkpoint (retry-safe). */
|
|
34
6
|
export type PreIngestVerdict = {
|
|
35
7
|
ok: true;
|
|
@@ -65,6 +37,13 @@ export interface RunIngestionArgs {
|
|
|
65
37
|
readonly consent: {
|
|
66
38
|
decision: ConversationIngestionConsentDecision | 'not_present';
|
|
67
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* PRI-1179: how much `visible_text` may be stored. The host resolves this
|
|
42
|
+
* from its OWN consent record via `resolveTextPolicy(record, disclosureVersion)`
|
|
43
|
+
* — a stale or non-granted record resolves to the bounded tier, never wider.
|
|
44
|
+
* Absent = bounded (the pre-existing 200-char content bound).
|
|
45
|
+
*/
|
|
46
|
+
readonly textPolicy?: TextPolicy;
|
|
68
47
|
readonly now?: Date;
|
|
69
48
|
/** Injected filesystem boundary (tests spy here; production uses the node port). */
|
|
70
49
|
readonly port?: TranscriptPort;
|
|
@@ -27,8 +27,11 @@
|
|
|
27
27
|
* + decode + rollout lineage; `degradeTexts` carries host-CLI vocabulary
|
|
28
28
|
* (quarantine commands etc.) so Operator-facing nextActions stay exact.
|
|
29
29
|
*/
|
|
30
|
+
import * as nodePath from 'node:path';
|
|
31
|
+
import { appendEventLogLine } from '@principles/core/runtime';
|
|
30
32
|
import { ingestGovernanceObservations, readGovernanceCheckpoint, } from '../governance-observation-store.js';
|
|
31
33
|
import { CONVERSATION_INGESTION_MAX_BATCH_BYTES, TranscriptReplacedError, createNodeTranscriptPort, } from './source.js';
|
|
34
|
+
import { TEXT_POLICY_BOUNDED_MAX_CHARS } from './text-policy.js';
|
|
32
35
|
export function runConversationIngestion(args) {
|
|
33
36
|
const texts = {
|
|
34
37
|
readFailedNextAction: 'verify the transcript file still exists and is a regular file inside the host sessions root.',
|
|
@@ -37,7 +40,43 @@ export function runConversationIngestion(args) {
|
|
|
37
40
|
oversizedNextAction: 'a single transcript record exceeds the bounded-read window; inspect the transcript file.',
|
|
38
41
|
...args.degradeTexts,
|
|
39
42
|
};
|
|
40
|
-
const
|
|
43
|
+
const now = args.now ?? new Date();
|
|
44
|
+
const eventLogStateDir = nodePath.join(args.workspaceDir, '.state');
|
|
45
|
+
const boundedText = (value) => {
|
|
46
|
+
// Code-point bounded: a log line may be rendered by an Owner-facing
|
|
47
|
+
// surface, so never split a surrogate pair (EP-11).
|
|
48
|
+
const points = Array.from(value);
|
|
49
|
+
return points.length > 300 ? `${points.slice(0, 300).join('')}…` : value;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* rc-9: every refused ingest leaves a durable fact in the existing
|
|
53
|
+
* `events_<date>.jsonl` channel. The hook's stderr is the only other
|
|
54
|
+
* surface, and it is per-process — "0 rows" was previously unattributable
|
|
55
|
+
* after the fact. Best-effort: a failed write must not break the hook, but
|
|
56
|
+
* it must stay observable on the returned warnings.
|
|
57
|
+
*/
|
|
58
|
+
const degraded = (reason, nextAction, warnings) => {
|
|
59
|
+
const observableWarnings = [...warnings];
|
|
60
|
+
try {
|
|
61
|
+
appendEventLogLine(eventLogStateDir, {
|
|
62
|
+
ts: now.toISOString(),
|
|
63
|
+
type: 'conversation_ingestion',
|
|
64
|
+
category: 'degraded',
|
|
65
|
+
sessionId: args.session.sessionId,
|
|
66
|
+
data: {
|
|
67
|
+
hostKind: args.source.hostKind,
|
|
68
|
+
reason: boundedText(reason),
|
|
69
|
+
nextAction: boundedText(nextAction),
|
|
70
|
+
warningCount: warnings.length,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
const detail = boundedText(error instanceof Error ? error.message : String(error));
|
|
76
|
+
observableWarnings.push(`degradation_event_log_failed:${detail}`);
|
|
77
|
+
}
|
|
78
|
+
return { status: 'degraded', reason, nextAction, warnings: observableWarnings };
|
|
79
|
+
};
|
|
41
80
|
// 1. Flag short-circuit — before locate, before ANY port call (SPEC §10).
|
|
42
81
|
if (!args.flags.ingestionEnabled) {
|
|
43
82
|
return degraded('ingestion_disabled', 'enable the conversation-ingestion flag for this host in the workspace .pd/config.yaml to ingest transcripts.', []);
|
|
@@ -46,7 +85,6 @@ export function runConversationIngestion(args) {
|
|
|
46
85
|
if (args.consent.decision !== 'granted') {
|
|
47
86
|
return degraded(`consent_not_granted:${args.consent.decision}`, 'record a granted consent decision for this host (setup flow or Owner directive) before transcript ingestion runs.', []);
|
|
48
87
|
}
|
|
49
|
-
const now = args.now ?? new Date();
|
|
50
88
|
const port = args.port ?? createNodeTranscriptPort();
|
|
51
89
|
// 3. Locate (deterministic, host rules).
|
|
52
90
|
const locator = args.source.locate(args.session, args.hints, args.env ?? {});
|
|
@@ -107,9 +145,13 @@ export function runConversationIngestion(args) {
|
|
|
107
145
|
return degraded(verdict.reason, verdict.nextAction, delta.warnings);
|
|
108
146
|
}
|
|
109
147
|
}
|
|
110
|
-
// 10. Sanitize-at-store ingest with the durable checkpoint.
|
|
148
|
+
// 10. Sanitize-at-store ingest with the durable checkpoint. The text bound
|
|
149
|
+
// comes from the caller's consent-tiered policy (PRI-1179); the store's
|
|
150
|
+
// generic evidence bound stays the default when no policy is supplied.
|
|
151
|
+
const textPolicy = args.textPolicy ?? { tier: 'bounded', maxChars: TEXT_POLICY_BOUNDED_MAX_CHARS };
|
|
111
152
|
const result = ingestGovernanceObservations({
|
|
112
153
|
workspaceDir: args.workspaceDir,
|
|
154
|
+
maxVisibleTextChars: textPolicy.maxChars,
|
|
113
155
|
rollout: {
|
|
114
156
|
hostKind: args.source.hostKind,
|
|
115
157
|
rolloutIdentity: locator.sessionIdentity,
|
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
* 20,000 chars against malformed giant records; the observed
|
|
15
15
|
* truncation rate is reported at acceptance time.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* bounded storage path.
|
|
17
|
+
* PRI-1179 wires the policy into production: the host resolves the tier from its
|
|
18
|
+
* own consent record and passes it through `runConversationIngestion`, which
|
|
19
|
+
* forwards `maxChars` to the store and the core `sanitizeString` bound.
|
|
21
20
|
*/
|
|
22
21
|
export type TextPolicy = {
|
|
23
22
|
tier: 'bounded';
|
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
* 20,000 chars against malformed giant records; the observed
|
|
15
15
|
* truncation rate is reported at acceptance time.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* bounded storage path.
|
|
17
|
+
* PRI-1179 wires the policy into production: the host resolves the tier from its
|
|
18
|
+
* own consent record and passes it through `runConversationIngestion`, which
|
|
19
|
+
* forwards `maxChars` to the store and the core `sanitizeString` bound.
|
|
21
20
|
*/
|
|
22
21
|
export const TEXT_POLICY_BOUNDED_MAX_CHARS = 200;
|
|
23
22
|
export const TEXT_POLICY_FULL_MAX_CHARS = 20_000;
|
|
@@ -6,11 +6,10 @@ export declare const GOVERNANCE_PENDING_TAIL_STALE_MS: number;
|
|
|
6
6
|
/** Host taxonomy for governance observations (schema v4; PRI-1171 unification). */
|
|
7
7
|
export type GovernanceObservationHostKind = 'codex' | 'workbuddy' | 'openclaw';
|
|
8
8
|
/**
|
|
9
|
-
* PRI-1171 P2: `reasoning` joins the kind union
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* existing Codex path starts emitting it.
|
|
9
|
+
* PRI-1171 P2: `reasoning` joins the kind union (`workbuddy` decoder was the
|
|
10
|
+
* first producer). PRI-1179 added the Codex producer: only the rollout's
|
|
11
|
+
* plaintext `summary` is stored — never the encrypted reasoning body. The
|
|
12
|
+
* stored bound stays governed by the caller's text policy.
|
|
14
13
|
*/
|
|
15
14
|
export type GovernanceObservationKind = 'user_turn' | 'assistant_turn' | 'tool_call' | 'reasoning';
|
|
16
15
|
export type GovernanceObservationSource = 'live_hook' | 'transcript';
|
|
@@ -162,6 +161,12 @@ export interface IngestGovernanceObservationsInput {
|
|
|
162
161
|
readonly compactionTimestamp?: string;
|
|
163
162
|
/** Sequential rollback markers (num_turns each) decoded from the transcript delta. */
|
|
164
163
|
readonly rollbackTurns?: readonly number[];
|
|
164
|
+
/**
|
|
165
|
+
* PRI-1179: content bound for every stored `visible_text`, forwarded from the
|
|
166
|
+
* conversation-ingestion text policy (bounded 200 / full 20,000). Absent =
|
|
167
|
+
* the generic evidence bound, i.e. the pre-existing behavior.
|
|
168
|
+
*/
|
|
169
|
+
readonly maxVisibleTextChars?: number;
|
|
165
170
|
readonly now?: Date;
|
|
166
171
|
readonly databaseFactory?: ObservationDatabaseFactory;
|
|
167
172
|
}
|
|
@@ -210,6 +215,24 @@ export interface ListGovernanceCheckpointsArgs {
|
|
|
210
215
|
readonly hostKind: GovernanceObservationHostKind;
|
|
211
216
|
readonly databaseFactory?: ObservationDatabaseFactory;
|
|
212
217
|
}
|
|
218
|
+
export interface GovernanceUncheckpointedSession {
|
|
219
|
+
readonly rolloutIdentity: string;
|
|
220
|
+
/** MAX(observed_at) across this session's observations (TD §9 live_only stamp). */
|
|
221
|
+
readonly lastObservedAt: string;
|
|
222
|
+
readonly observationCount: number;
|
|
223
|
+
}
|
|
224
|
+
export interface ListGovernanceUncheckpointedSessionsArgs {
|
|
225
|
+
readonly workspaceDir: string;
|
|
226
|
+
readonly hostKind: GovernanceObservationHostKind;
|
|
227
|
+
/** Bounded result size (default 50, hard cap 200); `truncated` reports overflow. */
|
|
228
|
+
readonly limit?: number;
|
|
229
|
+
readonly databaseFactory?: ObservationDatabaseFactory;
|
|
230
|
+
}
|
|
231
|
+
export type ListGovernanceUncheckpointedSessionsResult = {
|
|
232
|
+
ok: true;
|
|
233
|
+
sessions: readonly GovernanceUncheckpointedSession[];
|
|
234
|
+
truncated: boolean;
|
|
235
|
+
} | Degradation;
|
|
213
236
|
export type ListGovernanceCheckpointsResult = {
|
|
214
237
|
ok: true;
|
|
215
238
|
checkpoints: readonly GovernanceCheckpointRecord[];
|
|
@@ -222,6 +245,16 @@ export type ListGovernanceCheckpointsResult = {
|
|
|
222
245
|
* discovery (SPEC §13 / ADR-0020 §11.2).
|
|
223
246
|
*/
|
|
224
247
|
export declare function listGovernanceCheckpoints(args: ListGovernanceCheckpointsArgs): ListGovernanceCheckpointsResult;
|
|
248
|
+
/**
|
|
249
|
+
* Sessions that have observations but NO checkpoint row for this host kind
|
|
250
|
+
* (PRI-1171 ticket ⑦, TD §9). The live hook path never writes a checkpoint,
|
|
251
|
+
* so "no checkpoint" must never render as a lag anomaly: the health surface
|
|
252
|
+
* reports these as an explicit `live_only` state stamped with
|
|
253
|
+
* MAX(observed_at) instead of inventing a byte offset. Ordered by
|
|
254
|
+
* lastObservedAt descending; result bounded by `limit` with a `truncated`
|
|
255
|
+
* flag so large live-only sets stay visible without unbounded output.
|
|
256
|
+
*/
|
|
257
|
+
export declare function listGovernanceUncheckpointedSessions(args: ListGovernanceUncheckpointedSessionsArgs): ListGovernanceUncheckpointedSessionsResult;
|
|
225
258
|
export interface ListGovernanceObservationsInput {
|
|
226
259
|
readonly workspaceDir: string;
|
|
227
260
|
readonly rolloutIdentity?: string;
|
|
@@ -308,7 +308,11 @@ function upsertRollout(db, input, now) {
|
|
|
308
308
|
* committed content, mark partial, and report where the checkpoint must stop.
|
|
309
309
|
* Never overwrites committed content silently (source precedence, SPEC §10).
|
|
310
310
|
*/
|
|
311
|
-
function applyObservation({ db, rolloutRowId, input, workspaceDir }) {
|
|
311
|
+
function applyObservation({ db, rolloutRowId, input, workspaceDir, maxVisibleTextChars }) {
|
|
312
|
+
// One bound for every visible_text use in this function: the insert, the
|
|
313
|
+
// user-turn conflict comparison and the fill path must agree, otherwise a
|
|
314
|
+
// full-tier row would look like a content mismatch on the next replay.
|
|
315
|
+
const boundVisibleText = (value) => sanitizeString(value, workspaceDir, maxVisibleTextChars);
|
|
312
316
|
const byKey = db.prepare('SELECT * FROM governance_observations WHERE logical_key = ?').get(input.logicalObservationKey);
|
|
313
317
|
let existing = byKey;
|
|
314
318
|
// Cross-window tool completion by STABLE identity (P2 review): the call row
|
|
@@ -335,7 +339,7 @@ function applyObservation({ db, rolloutRowId, input, workspaceDir }) {
|
|
|
335
339
|
if (isRecord(physical))
|
|
336
340
|
return { disposition: 'duplicate' };
|
|
337
341
|
}
|
|
338
|
-
const sanitizedText = input.visibleText !== undefined ?
|
|
342
|
+
const sanitizedText = input.visibleText !== undefined ? boundVisibleText(input.visibleText) : null;
|
|
339
343
|
const facts = input.toolFacts !== undefined ? safeJson({ facts: sanitizeValue(input.toolFacts, 0, workspaceDir) }) : null;
|
|
340
344
|
db.prepare(`INSERT INTO governance_observations
|
|
341
345
|
(rollout_row_id, host_kind, rollout_identity, root_session_id, host_turn_id, kind, logical_key, transcript_record_key, source_order, source_ordinal, assistant_item_id, phase, tool_use_id, transcript_tool_call_id, visible_text, sanitized_tool_facts_json, source, completeness, retention_class, observed_at)
|
|
@@ -355,7 +359,7 @@ function applyObservation({ db, rolloutRowId, input, workspaceDir }) {
|
|
|
355
359
|
&& input.source === 'transcript'
|
|
356
360
|
&& input.visibleText !== undefined
|
|
357
361
|
&& typeof existingText === 'string'
|
|
358
|
-
&&
|
|
362
|
+
&& boundVisibleText(input.visibleText) !== existingText) {
|
|
359
363
|
db.prepare("UPDATE governance_observations SET completeness = 'partial' WHERE id = ?").run(existingId);
|
|
360
364
|
return { disposition: 'conflict', stopByteStart: input.recordByteStart };
|
|
361
365
|
}
|
|
@@ -395,7 +399,7 @@ function applyObservation({ db, rolloutRowId, input, workspaceDir }) {
|
|
|
395
399
|
fill('phase', boundedString(input.phase, MAX_TEXT_BOUND));
|
|
396
400
|
fill('tool_use_id', boundedString(input.toolUseId, MAX_TEXT_BOUND));
|
|
397
401
|
fill('transcript_tool_call_id', boundedString(input.transcriptToolCallId, MAX_TEXT_BOUND));
|
|
398
|
-
fill('visible_text', input.visibleText !== undefined ?
|
|
402
|
+
fill('visible_text', input.visibleText !== undefined ? boundVisibleText(input.visibleText) : null);
|
|
399
403
|
const incomingFacts = input.toolFacts !== undefined ? safeJson({ facts: sanitizeValue(input.toolFacts, 0, workspaceDir) }) : null;
|
|
400
404
|
// Cross-window tool completion (P1): the call row is partial and the result
|
|
401
405
|
// arrives under the same logical key from a later decode window. Merge the
|
|
@@ -550,7 +554,13 @@ export function ingestGovernanceObservations(input) {
|
|
|
550
554
|
}
|
|
551
555
|
for (const observation of input.observations) {
|
|
552
556
|
rolloutRowId = upsertRollout(db, observation, now);
|
|
553
|
-
const outcome = applyObservation({
|
|
557
|
+
const outcome = applyObservation({
|
|
558
|
+
db,
|
|
559
|
+
rolloutRowId,
|
|
560
|
+
input: observation,
|
|
561
|
+
workspaceDir: input.workspaceDir,
|
|
562
|
+
...(input.maxVisibleTextChars !== undefined ? { maxVisibleTextChars: input.maxVisibleTextChars } : {}),
|
|
563
|
+
});
|
|
554
564
|
if (outcome.disposition === 'inserted')
|
|
555
565
|
inserted += 1;
|
|
556
566
|
else if (outcome.disposition === 'enriched')
|
|
@@ -743,6 +753,54 @@ export function listGovernanceCheckpoints(args) {
|
|
|
743
753
|
close();
|
|
744
754
|
}
|
|
745
755
|
}
|
|
756
|
+
/**
|
|
757
|
+
* Sessions that have observations but NO checkpoint row for this host kind
|
|
758
|
+
* (PRI-1171 ticket ⑦, TD §9). The live hook path never writes a checkpoint,
|
|
759
|
+
* so "no checkpoint" must never render as a lag anomaly: the health surface
|
|
760
|
+
* reports these as an explicit `live_only` state stamped with
|
|
761
|
+
* MAX(observed_at) instead of inventing a byte offset. Ordered by
|
|
762
|
+
* lastObservedAt descending; result bounded by `limit` with a `truncated`
|
|
763
|
+
* flag so large live-only sets stay visible without unbounded output.
|
|
764
|
+
*/
|
|
765
|
+
export function listGovernanceUncheckpointedSessions(args) {
|
|
766
|
+
const { workspaceDir, hostKind, databaseFactory } = args;
|
|
767
|
+
const opened = openStore(workspaceDir, databaseFactory);
|
|
768
|
+
if (!('db' in opened))
|
|
769
|
+
return opened;
|
|
770
|
+
const { db, close } = opened;
|
|
771
|
+
try {
|
|
772
|
+
const limit = Math.min(Math.max(args.limit ?? 50, 1), 200);
|
|
773
|
+
const rows = db.prepare(`SELECT o.rollout_identity AS rollout_identity,
|
|
774
|
+
MAX(o.observed_at) AS last_observed_at,
|
|
775
|
+
COUNT(*) AS observation_count
|
|
776
|
+
FROM governance_observations o
|
|
777
|
+
WHERE o.host_kind = ?
|
|
778
|
+
AND o.rollout_identity NOT IN (
|
|
779
|
+
SELECT c.rollout_identity FROM governance_transcript_checkpoints c WHERE c.host_kind = ?
|
|
780
|
+
)
|
|
781
|
+
GROUP BY o.rollout_identity
|
|
782
|
+
ORDER BY last_observed_at DESC
|
|
783
|
+
LIMIT ?`).all(hostKind, hostKind, limit + 1);
|
|
784
|
+
const sessions = [];
|
|
785
|
+
for (const raw of rows.slice(0, limit)) {
|
|
786
|
+
if (!isRecord(raw))
|
|
787
|
+
continue;
|
|
788
|
+
sessions.push({
|
|
789
|
+
rolloutIdentity: String(rowField(raw, 'rollout_identity')),
|
|
790
|
+
lastObservedAt: String(rowField(raw, 'last_observed_at')),
|
|
791
|
+
observationCount: Number(rowField(raw, 'observation_count')),
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
return { ok: true, sessions, truncated: rows.length > limit };
|
|
795
|
+
}
|
|
796
|
+
catch (error) {
|
|
797
|
+
const detail = error instanceof Error ? error.message.slice(0, 160) : String(error);
|
|
798
|
+
return { ok: false, reason: `governance_live_sessions_failed:${detail}`, nextAction: 'Inspect the workspace trajectory.db; the health surface degraded without mutating anything.' };
|
|
799
|
+
}
|
|
800
|
+
finally {
|
|
801
|
+
close();
|
|
802
|
+
}
|
|
803
|
+
}
|
|
746
804
|
export function listGovernanceObservations(input) {
|
|
747
805
|
const opened = openStore(input.workspaceDir, input.databaseFactory);
|
|
748
806
|
if (!('db' in opened))
|
|
@@ -284,9 +284,9 @@ export function createProductionHostRuntime(options = {}) {
|
|
|
284
284
|
workspaceDir: event.context.workspaceDir,
|
|
285
285
|
...(roundKey !== undefined ? { roundKey } : {}),
|
|
286
286
|
...(options.adaptiveGapProvider ? {
|
|
287
|
-
async selectNativeGap(candidates) {
|
|
287
|
+
async selectNativeGap(candidates, gapOptions) {
|
|
288
288
|
try {
|
|
289
|
-
return await options.adaptiveGapProvider?.(event, candidates);
|
|
289
|
+
return await options.adaptiveGapProvider?.(event, candidates, gapOptions);
|
|
290
290
|
}
|
|
291
291
|
catch {
|
|
292
292
|
return undefined;
|
|
@@ -337,6 +337,9 @@ export function createProductionHostRuntime(options = {}) {
|
|
|
337
337
|
// failure must not block the prompt result — it degrades to an
|
|
338
338
|
// observable warning (rc-9).
|
|
339
339
|
const emissionWarnings = [];
|
|
340
|
+
if (prompt.adaptivePacking?.source === 'native_gap' && prompt.adaptivePacking.status === 'unavailable') {
|
|
341
|
+
emissionWarnings.push(`adaptive_assembly_unavailable:${prompt.adaptivePacking.reason}`);
|
|
342
|
+
}
|
|
340
343
|
try {
|
|
341
344
|
options.events?.recordRuntimeActivationsInjected({
|
|
342
345
|
sessionId: event.context.sessionId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ToolSemanticRegistry, type GovernanceHostKind } from '@principles/core/runtime';
|
|
1
|
+
import { type RuleHostResult, type ToolSemanticRegistry, type GovernanceHostKind } from '@principles/core/runtime';
|
|
2
2
|
import type { HostEvent, HostEventResult } from '@principles/core/host';
|
|
3
3
|
import { type RuleImplementationRuntime } from './rule-implementation-runtime.js';
|
|
4
4
|
export interface ProductionRuleContextRequest {
|
|
@@ -29,5 +29,40 @@ export interface ProductionRuleHostGateOptions {
|
|
|
29
29
|
* (shell/cmd/insert/patch/delete_file/move_file were never hinted).
|
|
30
30
|
*/
|
|
31
31
|
toolSemantics?: ToolSemanticRegistry;
|
|
32
|
+
/**
|
|
33
|
+
* PRI-1187: observation-only signal for the accepted "over-block" tradeoff.
|
|
34
|
+
*
|
|
35
|
+
* When a rule declares `affectedTools` and the current action family is NOT
|
|
36
|
+
* in that declaration, the rule is still evaluated (never skipped). This
|
|
37
|
+
* sink records one structured event per such evaluation so we can measure
|
|
38
|
+
* how much over-blocking exists and which rules cause it.
|
|
39
|
+
*
|
|
40
|
+
* Defaults ON. Silence it with `{ enabled: false }` or the environment
|
|
41
|
+
* variable `PD_AFFECTED_TOOLS_OBSERVABILITY=0`. The sink is called inside a
|
|
42
|
+
* try/catch and can never alter the decision.
|
|
43
|
+
*/
|
|
44
|
+
affectedToolsObservability?: AffectedToolsObservabilityOptions;
|
|
45
|
+
}
|
|
46
|
+
/** One observation-only "declared scope does not cover the action" record. */
|
|
47
|
+
export interface AffectedToolsMismatchEvent {
|
|
48
|
+
ruleId: string;
|
|
49
|
+
activationId: string;
|
|
50
|
+
activationMode: 'live' | 'shadow';
|
|
51
|
+
toolName: string;
|
|
52
|
+
/** Action family resolved by the ToolSemanticRegistry (write/execute/agent…). */
|
|
53
|
+
actionFamily: string;
|
|
54
|
+
/** Raw declaration, verbatim from the artifact. */
|
|
55
|
+
declaredTools: string[];
|
|
56
|
+
/** Resolved families of `declaredTools` (never empty when emitted). */
|
|
57
|
+
declaredFamilies: string[];
|
|
58
|
+
/** The rule's own decision for this call (not the merged verdict). */
|
|
59
|
+
decision: RuleHostResult['decision'];
|
|
60
|
+
hostKind?: GovernanceHostKind;
|
|
61
|
+
}
|
|
62
|
+
export interface AffectedToolsObservabilityOptions {
|
|
63
|
+
/** Defaults to `PD_AFFECTED_TOOLS_OBSERVABILITY !== '0' | 'false' | 'off'`. */
|
|
64
|
+
enabled?: boolean;
|
|
65
|
+
/** Defaults to one structured JSON line on `console.warn`. */
|
|
66
|
+
sink?: (event: AffectedToolsMismatchEvent) => void;
|
|
32
67
|
}
|
|
33
68
|
export declare function createProductionRuleHostGate(options?: ProductionRuleHostGateOptions): (event: HostEvent) => Promise<HostEventResult>;
|