create-principles-disciple 1.121.7 → 1.121.9
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 +13 -1
- package/console/dist/server/config/pd-config-store.d.ts +1 -3
- package/console/dist/server/config/pd-config-store.js +4 -4
- package/console/dist/server/feedback/channels.d.ts +2 -8
- package/console/dist/server/feedback/channels.js +0 -11
- package/console/dist/server/index.js +34 -5
- package/console/dist/server/models/ActivationsConsoleModel.d.ts +28 -1
- package/console/dist/server/models/ActivationsConsoleModel.js +72 -30
- package/console/dist/server/models/GovernanceExperienceCollector.d.ts +28 -0
- package/console/dist/server/models/GovernanceExperienceCollector.js +305 -0
- package/console/dist/server/models/GovernanceProjectionCollector.d.ts +60 -2
- package/console/dist/server/models/GovernanceProjectionCollector.js +323 -285
- package/console/dist/server/models/PrincipleClassifier.d.ts +1 -1
- package/console/dist/server/models/PrincipleClassifier.js +7 -4
- package/console/dist/server/models/PrinciplesConsoleModel.d.ts +2 -1
- package/console/dist/server/models/ReceiptsConsoleModel.d.ts +5 -0
- package/console/dist/server/models/ReceiptsConsoleModel.js +140 -13
- package/console/dist/server/routes/activations.js +1 -1
- package/console/dist/server/routes/failed-tasks.js +28 -11
- package/console/dist/server/routes/governance.d.ts +26 -0
- package/console/dist/server/routes/governance.js +51 -0
- package/console/dist/server/routes/owner-identity.d.ts +31 -0
- package/console/dist/server/routes/owner-identity.js +76 -0
- package/console/dist/server/routes/update-history.d.ts +5 -0
- package/console/dist/server/routes/update-history.js +50 -4
- package/console/dist/server/routes/update.js +186 -32
- package/console/dist/shared/feedback-channel-ids.d.ts +13 -0
- package/console/dist/shared/feedback-channel-ids.js +12 -0
- package/console/dist/shared/feedback-contract.d.ts +46 -0
- package/console/dist/shared/feedback-contract.js +45 -0
- package/console/dist/ui/App.js +1 -1
- package/console/dist/ui/api.d.ts +22 -3
- package/console/dist/ui/api.js +63 -3
- package/console/dist/ui/components/receipts/ReceiptCoverageDisclosure.d.ts +6 -0
- package/console/dist/ui/components/receipts/ReceiptCoverageDisclosure.js +66 -0
- package/console/dist/ui/i18n/en.json +198 -2
- package/console/dist/ui/i18n/zh-CN.json +196 -0
- package/console/dist/ui/pages/activation/ActivationPage.js +14 -2
- package/console/dist/ui/pages/failed-tasks/FailedTasksPage.js +25 -5
- package/console/dist/ui/pages/focus/FocusPage.d.ts +28 -1
- package/console/dist/ui/pages/focus/FocusPage.js +128 -15
- package/console/dist/ui/pages/principles/PrincipleDetailPage.d.ts +30 -0
- package/console/dist/ui/pages/principles/PrincipleDetailPage.js +49 -6
- package/console/dist/ui/pages/settings/SettingsPage.js +67 -2
- package/console/dist/ui/pages/settings/UpdatePage.js +7 -7
- package/console/dist/ui/utils/enum-labels.js +0 -1
- package/console/dist/ui/utils/validators.d.ts +53 -21
- package/console/dist/ui/utils/validators.js +248 -21
- package/console/dist/web/assets/app.css +6 -0
- package/console/dist/web/assets/app.js +2721 -1664
- package/console/package.json +4 -2
- package/core/dist/host/host-adapter.d.ts +1 -1
- package/core/dist/host/host-adapter.d.ts.map +1 -1
- package/core/dist/host/host-adapter.js +1 -0
- package/core/dist/host/host-adapter.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +12 -2
- package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js +1 -1
- package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/governance-experience.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/governance-experience.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/governance-experience.test.js +300 -0
- package/core/dist/runtime-v2/__tests__/governance-experience.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/owner-identity.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/owner-identity.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/owner-identity.test.js +147 -0
- package/core/dist/runtime-v2/__tests__/owner-identity.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.d.ts +18 -0
- package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.js +303 -0
- package/core/dist/runtime-v2/__tests__/product-telemetry-contract.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/recovery-actions-log.test.js +40 -0
- package/core/dist/runtime-v2/__tests__/recovery-actions-log.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/status-contract.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/status-contract.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/status-contract.test.js +107 -0
- package/core/dist/runtime-v2/__tests__/status-contract.test.js.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.d.ts +2 -0
- package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.js +104 -0
- package/core/dist/runtime-v2/activation/__tests__/promotion-evidence-snapshot.test.js.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/promotion-readiness-evaluator.test.js +19 -0
- package/core/dist/runtime-v2/activation/__tests__/promotion-readiness-evaluator.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/rulecode-owner-decision-service.test.js +20 -0
- package/core/dist/runtime-v2/activation/__tests__/rulecode-owner-decision-service.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-safety-store.test.js +40 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-safety-store.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/index.d.ts +2 -0
- package/core/dist/runtime-v2/activation/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/index.js +1 -0
- package/core/dist/runtime-v2/activation/index.js.map +1 -1
- package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.d.ts +30 -0
- package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.d.ts.map +1 -0
- package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.js +87 -0
- package/core/dist/runtime-v2/activation/promotion-evidence-snapshot.js.map +1 -0
- package/core/dist/runtime-v2/activation/promotion-readiness-evaluator.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/promotion-readiness-evaluator.js +3 -0
- package/core/dist/runtime-v2/activation/promotion-readiness-evaluator.js.map +1 -1
- package/core/dist/runtime-v2/activation/promotion-readiness-reader.d.ts +1 -1
- package/core/dist/runtime-v2/activation/promotion-readiness-reader.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/promotion-readiness-reader.js +2 -2
- package/core/dist/runtime-v2/activation/promotion-readiness-reader.js.map +1 -1
- package/core/dist/runtime-v2/activation/rulecode-owner-decision-service.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/rulecode-owner-decision-service.js +18 -9
- package/core/dist/runtime-v2/activation/rulecode-owner-decision-service.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.js +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.js +91 -1
- package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js +59 -12
- package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js +10 -9
- package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js +42 -1
- package/core/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/json-extractor.d.ts +25 -0
- package/core/dist/runtime-v2/adapter/json-extractor.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/json-extractor.js +126 -0
- package/core/dist/runtime-v2/adapter/json-extractor.js.map +1 -1
- package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts +9 -4
- package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js +9 -4
- package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js.map +1 -1
- package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts +5 -1
- package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/output-repair-contract.js +4 -1
- package/core/dist/runtime-v2/adapter/output-repair-contract.js.map +1 -1
- package/core/dist/runtime-v2/adapter/pi-ai-catalog.d.ts +7 -0
- package/core/dist/runtime-v2/adapter/pi-ai-catalog.d.ts.map +1 -0
- package/core/dist/runtime-v2/adapter/pi-ai-catalog.js +19 -0
- package/core/dist/runtime-v2/adapter/pi-ai-catalog.js.map +1 -0
- package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +13 -15
- package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +104 -37
- package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
- package/core/dist/runtime-v2/adapter/structured-output-repair.d.ts +16 -1
- package/core/dist/runtime-v2/adapter/structured-output-repair.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/structured-output-repair.js +38 -6
- package/core/dist/runtime-v2/adapter/structured-output-repair.js.map +1 -1
- package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts +1 -1
- package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js +8 -9
- package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js.map +1 -1
- package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js +27 -3
- package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.d.ts +11 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.js +93 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-principles.test.js.map +1 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-workspace.test.js +41 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-workspace.test.js.map +1 -1
- package/core/dist/runtime-v2/config/index.d.ts +2 -2
- package/core/dist/runtime-v2/config/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/index.js +2 -0
- package/core/dist/runtime-v2/config/index.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-agent-binding.js +4 -13
- package/core/dist/runtime-v2/config/pd-config-agent-binding.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-effective.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-effective.js +14 -7
- package/core/dist/runtime-v2/config/pd-config-effective.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-feature-flags.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-feature-flags.js +5 -12
- package/core/dist/runtime-v2/config/pd-config-feature-flags.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-types.d.ts +8 -0
- package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-types.js +2 -0
- package/core/dist/runtime-v2/config/pd-config-types.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-validate.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-validate.js +48 -3
- package/core/dist/runtime-v2/config/pd-config-validate.js.map +1 -1
- package/core/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.js +36 -8
- package/core/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.js.map +1 -1
- package/core/dist/runtime-v2/core-principles/__tests__/core-principle-registry.test.js +36 -12
- package/core/dist/runtime-v2/core-principles/__tests__/core-principle-registry.test.js.map +1 -1
- package/core/dist/runtime-v2/core-principles/core-axiom-block.d.ts +22 -8
- package/core/dist/runtime-v2/core-principles/core-axiom-block.d.ts.map +1 -1
- package/core/dist/runtime-v2/core-principles/core-axiom-block.js +28 -13
- package/core/dist/runtime-v2/core-principles/core-axiom-block.js.map +1 -1
- package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts +29 -4
- package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts.map +1 -1
- package/core/dist/runtime-v2/core-principles/core-principle-registry.js +68 -33
- package/core/dist/runtime-v2/core-principles/core-principle-registry.js.map +1 -1
- package/core/dist/runtime-v2/core-principles/index.d.ts +3 -3
- package/core/dist/runtime-v2/core-principles/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/core-principles/index.js +1 -1
- package/core/dist/runtime-v2/core-principles/index.js.map +1 -1
- package/core/dist/runtime-v2/evolution/evolution-types.d.ts +2 -1
- package/core/dist/runtime-v2/evolution/evolution-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/evolution/evolution-types.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.js +48 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/anonymous-product-telemetry-flag.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.js +46 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/codex-conversation-ingestion-flag.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +86 -31
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.js +83 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-lifecycle.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts +19 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +128 -10
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.d.ts +37 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js +304 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/index.d.ts +4 -2
- package/core/dist/runtime-v2/feature-flags/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/index.js +3 -1
- package/core/dist/runtime-v2/feature-flags/index.js.map +1 -1
- package/core/dist/runtime-v2/governance-experience-contract.d.ts +468 -0
- package/core/dist/runtime-v2/governance-experience-contract.d.ts.map +1 -0
- package/core/dist/runtime-v2/governance-experience-contract.js +208 -0
- package/core/dist/runtime-v2/governance-experience-contract.js.map +1 -0
- package/core/dist/runtime-v2/governance-experience.d.ts +11 -0
- package/core/dist/runtime-v2/governance-experience.d.ts.map +1 -0
- package/core/dist/runtime-v2/governance-experience.js +276 -0
- package/core/dist/runtime-v2/governance-experience.js.map +1 -0
- package/core/dist/runtime-v2/index.d.ts +20 -8
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +20 -6
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/artificer-output-retry-flag.test.js +29 -10
- package/core/dist/runtime-v2/internalization/__tests__/artificer-output-retry-flag.test.js.map +1 -1
- package/core/dist/runtime-v2/owner-identity.d.ts +69 -0
- package/core/dist/runtime-v2/owner-identity.d.ts.map +1 -0
- package/core/dist/runtime-v2/owner-identity.js +179 -0
- package/core/dist/runtime-v2/owner-identity.js.map +1 -0
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js +2 -3
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime-v2/product-telemetry/daily-identity.d.ts +70 -0
- package/core/dist/runtime-v2/product-telemetry/daily-identity.d.ts.map +1 -0
- package/core/dist/runtime-v2/product-telemetry/daily-identity.js +89 -0
- package/core/dist/runtime-v2/product-telemetry/daily-identity.js.map +1 -0
- package/core/dist/runtime-v2/product-telemetry/snapshot-contract.d.ts +110 -0
- package/core/dist/runtime-v2/product-telemetry/snapshot-contract.d.ts.map +1 -0
- package/core/dist/runtime-v2/product-telemetry/snapshot-contract.js +250 -0
- package/core/dist/runtime-v2/product-telemetry/snapshot-contract.js.map +1 -0
- package/core/dist/runtime-v2/pruning-read-model.d.ts +2 -1
- package/core/dist/runtime-v2/pruning-read-model.d.ts.map +1 -1
- package/core/dist/runtime-v2/pruning-read-model.js.map +1 -1
- package/core/dist/runtime-v2/receipt-coverage.d.ts +63 -0
- package/core/dist/runtime-v2/receipt-coverage.d.ts.map +1 -0
- package/core/dist/runtime-v2/receipt-coverage.js +19 -0
- package/core/dist/runtime-v2/receipt-coverage.js.map +1 -0
- package/core/dist/runtime-v2/recovery-actions-log.d.ts +7 -0
- package/core/dist/runtime-v2/recovery-actions-log.d.ts.map +1 -1
- package/core/dist/runtime-v2/recovery-actions-log.js +6 -0
- package/core/dist/runtime-v2/recovery-actions-log.js.map +1 -1
- package/core/dist/runtime-v2/runtime-protocol.js +1 -1
- package/core/dist/runtime-v2/runtime-protocol.js.map +1 -1
- package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.js +17 -1
- package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.js.map +1 -1
- package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/task/sqlite-task-store.js +10 -0
- package/core/dist/runtime-v2/store/task/sqlite-task-store.js.map +1 -1
- package/core/dist/runtime-v2/store/task/task-types.d.ts +2 -0
- package/core/dist/runtime-v2/store/task/task-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/task-status.d.ts +9 -5
- package/core/dist/runtime-v2/task-status.d.ts.map +1 -1
- package/core/dist/runtime-v2/task-status.js +15 -7
- package/core/dist/runtime-v2/task-status.js.map +1 -1
- package/core/dist/runtime-v2/types/event-types.d.ts +4 -0
- package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/event-types.js.map +1 -1
- package/core/dist/runtime-v2/types/index.d.ts +1 -1
- package/core/dist/runtime-v2/types/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/index.js +1 -1
- package/core/dist/runtime-v2/types/index.js.map +1 -1
- package/core/dist/runtime-v2/types/principle-enums.d.ts +3 -2
- package/core/dist/runtime-v2/types/principle-enums.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/principle-enums.js +11 -5
- package/core/dist/runtime-v2/types/principle-enums.js.map +1 -1
- package/core/dist/runtime-v2/types/principle-schema.d.ts +1 -1
- package/core/dist/runtime-v2/types/principle-tree-store.d.ts +1 -1
- package/core/dist/runtime-v2/utils/cli-process-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/utils/cli-process-runner.js +3 -2
- package/core/dist/runtime-v2/utils/cli-process-runner.js.map +1 -1
- package/core/package.json +4 -5
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +4 -2
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +47 -11
- package/dist/index.js.map +1 -1
- package/dist/installer.d.ts +31 -5
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +472 -161
- package/dist/installer.js.map +1 -1
- package/dist/installers/codex-host-installer.d.ts.map +1 -1
- package/dist/installers/codex-host-installer.js +4 -0
- package/dist/installers/codex-host-installer.js.map +1 -1
- package/dist/mvp-config.d.ts +10 -0
- package/dist/mvp-config.d.ts.map +1 -1
- package/dist/mvp-config.js +30 -3
- package/dist/mvp-config.js.map +1 -1
- package/dist/uninstaller.d.ts +9 -1
- package/dist/uninstaller.d.ts.map +1 -1
- package/dist/uninstaller.js +103 -23
- package/dist/uninstaller.js.map +1 -1
- package/dist/update/atomic-file.d.ts +35 -0
- package/dist/update/atomic-file.d.ts.map +1 -0
- package/dist/update/atomic-file.js +120 -0
- package/dist/update/atomic-file.js.map +1 -0
- package/dist/update/bootstrap-protocol.d.ts +55 -0
- package/dist/update/bootstrap-protocol.d.ts.map +1 -0
- package/dist/update/bootstrap-protocol.js +132 -0
- package/dist/update/bootstrap-protocol.js.map +1 -0
- package/dist/update/channel-metadata.d.ts +28 -0
- package/dist/update/channel-metadata.d.ts.map +1 -0
- package/dist/update/channel-metadata.js +90 -0
- package/dist/update/channel-metadata.js.map +1 -0
- package/dist/update/channel-promotion.d.ts +39 -0
- package/dist/update/channel-promotion.d.ts.map +1 -0
- package/dist/update/channel-promotion.js +55 -0
- package/dist/update/channel-promotion.js.map +1 -0
- package/dist/update/data-compatibility.d.ts +35 -0
- package/dist/update/data-compatibility.d.ts.map +1 -0
- package/dist/update/data-compatibility.js +45 -0
- package/dist/update/data-compatibility.js.map +1 -0
- package/dist/update/install-layout.d.ts +59 -0
- package/dist/update/install-layout.d.ts.map +1 -0
- package/dist/update/install-layout.js +127 -0
- package/dist/update/install-layout.js.map +1 -0
- package/dist/update/legacy-migration.d.ts +56 -0
- package/dist/update/legacy-migration.d.ts.map +1 -0
- package/dist/update/legacy-migration.js +254 -0
- package/dist/update/legacy-migration.js.map +1 -0
- package/dist/update/product-identity.d.ts +50 -0
- package/dist/update/product-identity.d.ts.map +1 -0
- package/dist/update/product-identity.js +63 -0
- package/dist/update/product-identity.js.map +1 -0
- package/dist/update/release-asset-manifest.d.ts +31 -0
- package/dist/update/release-asset-manifest.d.ts.map +1 -0
- package/dist/update/release-asset-manifest.js +161 -0
- package/dist/update/release-asset-manifest.js.map +1 -0
- package/dist/update/release-identity.d.ts +33 -0
- package/dist/update/release-identity.d.ts.map +1 -0
- package/dist/update/release-identity.js +108 -0
- package/dist/update/release-identity.js.map +1 -0
- package/dist/update/release-manager.d.ts +96 -0
- package/dist/update/release-manager.d.ts.map +1 -0
- package/dist/update/release-manager.js +253 -0
- package/dist/update/release-manager.js.map +1 -0
- package/dist/update/release-metadata.d.ts +57 -0
- package/dist/update/release-metadata.d.ts.map +1 -0
- package/dist/update/release-metadata.js +200 -0
- package/dist/update/release-metadata.js.map +1 -0
- package/dist/update/release-policy.d.ts +51 -0
- package/dist/update/release-policy.d.ts.map +1 -0
- package/dist/update/release-policy.js +103 -0
- package/dist/update/release-policy.js.map +1 -0
- package/dist/update/rollback-policy.d.ts +56 -0
- package/dist/update/rollback-policy.d.ts.map +1 -0
- package/dist/update/rollback-policy.js +61 -0
- package/dist/update/rollback-policy.js.map +1 -0
- package/dist/update/transaction-journal.d.ts +121 -0
- package/dist/update/transaction-journal.d.ts.map +1 -0
- package/dist/update/transaction-journal.js +333 -0
- package/dist/update/transaction-journal.js.map +1 -0
- package/dist/update/trust-metadata.d.ts +55 -0
- package/dist/update/trust-metadata.d.ts.map +1 -0
- package/dist/update/trust-metadata.js +170 -0
- package/dist/update/trust-metadata.js.map +1 -0
- package/dist/update/update-history.d.ts +46 -0
- package/dist/update/update-history.d.ts.map +1 -0
- package/dist/update/update-history.js +123 -0
- package/dist/update/update-history.js.map +1 -0
- package/dist/utils/env.d.ts +7 -0
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +134 -44
- package/dist/utils/env.js.map +1 -1
- package/host-runtime/dist/governance-observation-store.d.ts +172 -0
- package/host-runtime/dist/governance-observation-store.js +649 -0
- package/host-runtime/dist/index.d.ts +6 -0
- package/host-runtime/dist/index.js +8 -0
- package/host-runtime/dist/product-telemetry/consent-store.d.ts +107 -0
- package/host-runtime/dist/product-telemetry/consent-store.js +329 -0
- package/host-runtime/dist/product-telemetry/eligibility.d.ts +53 -0
- package/host-runtime/dist/product-telemetry/eligibility.js +69 -0
- package/host-runtime/dist/product-telemetry/exporter.d.ts +46 -0
- package/host-runtime/dist/product-telemetry/exporter.js +71 -0
- package/host-runtime/dist/product-telemetry/milestone-readers.d.ts +61 -0
- package/host-runtime/dist/product-telemetry/milestone-readers.js +234 -0
- package/host-runtime/dist/product-telemetry/service.d.ts +142 -0
- package/host-runtime/dist/product-telemetry/service.js +532 -0
- package/host-runtime/dist/product-telemetry/workspace-scope.d.ts +38 -0
- package/host-runtime/dist/product-telemetry/workspace-scope.js +64 -0
- package/host-runtime/package.json +7 -2
- package/install-layout/dist/index.d.ts +48 -0
- package/install-layout/dist/index.js +81 -0
- package/install-layout/dist/index.test.d.ts +1 -0
- package/install-layout/dist/index.test.js +34 -0
- package/install-layout/package.json +33 -0
- package/package.json +16 -6
- package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.d.ts +9 -0
- package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.d.ts.map +1 -0
- package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.js +76 -0
- package/pd-cli/dist/commands/__tests__/telemetry-flag-wiring.test.js.map +1 -0
- package/pd-cli/dist/commands/__tests__/version.test.d.ts +2 -0
- package/pd-cli/dist/commands/__tests__/version.test.d.ts.map +1 -0
- package/pd-cli/dist/commands/__tests__/version.test.js +134 -0
- package/pd-cli/dist/commands/__tests__/version.test.js.map +1 -0
- package/pd-cli/dist/commands/console.d.ts.map +1 -1
- package/pd-cli/dist/commands/console.js +29 -10
- package/pd-cli/dist/commands/console.js.map +1 -1
- package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-record.js +6 -15
- package/pd-cli/dist/commands/pain-record.js.map +1 -1
- package/pd-cli/dist/commands/runtime-activation.d.ts +29 -0
- package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-activation.js +70 -31
- package/pd-cli/dist/commands/runtime-activation.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +2 -2
- package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -1
- package/pd-cli/dist/commands/telemetry.d.ts +82 -0
- package/pd-cli/dist/commands/telemetry.d.ts.map +1 -0
- package/pd-cli/dist/commands/telemetry.js +268 -0
- package/pd-cli/dist/commands/telemetry.js.map +1 -0
- package/pd-cli/dist/commands/version.d.ts +11 -0
- package/pd-cli/dist/commands/version.d.ts.map +1 -0
- package/pd-cli/dist/commands/version.js +48 -0
- package/pd-cli/dist/commands/version.js.map +1 -0
- package/pd-cli/dist/index.js +35 -2
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/dist/services/version-report.d.ts +44 -0
- package/pd-cli/dist/services/version-report.d.ts.map +1 -0
- package/pd-cli/dist/services/version-report.js +152 -0
- package/pd-cli/dist/services/version-report.js.map +1 -0
- package/pd-cli/package.json +3 -2
- package/plugin/dist/bundle.js +870 -932
- package/plugin/dist/core/init.d.ts +2 -1
- package/plugin/dist/core/principle-application-ledger.d.ts +10 -0
- package/plugin/dist/core/product-telemetry-trigger.d.ts +14 -0
- package/plugin/dist/core/thinking-os-parser.d.ts +5 -2
- package/plugin/dist/governance-audit.js +386 -0
- package/plugin/dist/hooks/gate-block-helper.d.ts +25 -1
- package/plugin/dist/hooks/gate.d.ts +22 -0
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/rulehost-evidence.js +832 -0
- package/plugin/dist/templates/langs/en/principles/THINKING_OS.md +53 -45
- package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +1 -1
- package/plugin/dist/templates/langs/zh/principles/THINKING_OS.md +62 -46
- package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +1 -1
- package/plugin/dist/templates/workspace/.principles/THINKING_OS.md +66 -38
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/plugin/templates/langs/en/principles/THINKING_OS.md +53 -45
- package/plugin/templates/langs/en/skills/pd-mentor/SKILL.md +1 -1
- package/plugin/templates/langs/zh/principles/THINKING_OS.md +62 -46
- package/plugin/templates/langs/zh/skills/pd-mentor/SKILL.md +1 -1
- package/plugin/templates/workspace/.principles/THINKING_OS.md +66 -38
package/README.md
CHANGED
|
@@ -126,7 +126,19 @@ PD supports updating through the Web UI:
|
|
|
126
126
|
|
|
127
127
|
## Requirements
|
|
128
128
|
|
|
129
|
-
- Node.js >=
|
|
129
|
+
- Node.js >= 22.0.0
|
|
130
|
+
|
|
131
|
+
Self-contained native release assets are built locally (never cross-labelled) for:
|
|
132
|
+
|
|
133
|
+
| Platform | Architectures | Node.js major / ABI |
|
|
134
|
+
| --- | --- | --- |
|
|
135
|
+
| Windows | x64 | 22 / 127, 24 / 137, 26 / 147 |
|
|
136
|
+
| Linux | x64, arm64 | 22 / 127, 24 / 137, 26 / 147 |
|
|
137
|
+
| macOS | x64, arm64 | 22 / 127, 24 / 137, 26 / 147 |
|
|
138
|
+
|
|
139
|
+
Release builds require a fixed `SOURCE_DATE_EPOCH`. The output directory is published through one atomic rename and contains `payload/`, immutable `asset.tar`, and detached `asset.tar.sha256`. The installed machine does not run npm, lifecycle scripts, or native compilation.
|
|
140
|
+
|
|
141
|
+
PR feedback uses the single-target `.github/workflows/release-reproducibility.yml` quick check. Before npm publication, `publish-npm.yml` must call `.github/workflows/release-reproducibility-full.yml`: for every supported OS/CPU/Node target it builds the real production asset twice from a clean checkout, byte-compares the archives and detached digests, then installs from the archive without npm. Evidence limits: Node versions are pinned exactly, but GitHub runner images float beneath the label — the same-job double build controls toolchain drift within a job; cross-runner absolute byte-equality is not claimed. Committed dependency locks under `release-locks/` are regenerated by maintainers via `npm run generate:release-locks` and verified installable by `npm run check:release-locks`.
|
|
130
142
|
|
|
131
143
|
## License
|
|
132
144
|
|
|
@@ -111,9 +111,7 @@ export interface DefaultRuntimeUpdateResultErr {
|
|
|
111
111
|
}
|
|
112
112
|
export type DefaultRuntimeUpdateResult = DefaultRuntimeUpdateResultOk | DefaultRuntimeUpdateResultErr;
|
|
113
113
|
export declare function updateDefaultRuntime(workspaceDir: string, payload: unknown): DefaultRuntimeUpdateResult;
|
|
114
|
-
|
|
115
|
-
export declare const VALID_OUTPUT_LANGUAGES: readonly ['zh-CN', 'en'];
|
|
116
|
-
export type OutputLanguage = typeof VALID_OUTPUT_LANGUAGES[number];
|
|
114
|
+
import type { OutputLanguage } from '@principles/core/runtime-v2';
|
|
117
115
|
export interface OutputLanguageResultOk {
|
|
118
116
|
ok: true;
|
|
119
117
|
outputLanguage: OutputLanguage;
|
|
@@ -464,13 +464,13 @@ export function updateDefaultRuntime(workspaceDir, payload) {
|
|
|
464
464
|
};
|
|
465
465
|
}
|
|
466
466
|
// ── Principles Output Language (PRI-332 P1-1) ─────────────────────────────
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
// PRI-611: the output-language contract derives from the canonical core
|
|
468
|
+
// authority (runtime-v2/language-directive.ts). Do NOT re-declare the value
|
|
469
|
+
// list or default here — a drift guard test fails on local re-declaration.
|
|
470
|
+
import { VALID_OUTPUT_LANGUAGES, DEFAULT_OUTPUT_LANGUAGE } from '@principles/core/runtime-v2';
|
|
469
471
|
function isValidOutputLanguage(value) {
|
|
470
472
|
return typeof value === 'string' && VALID_OUTPUT_LANGUAGES.includes(value);
|
|
471
473
|
}
|
|
472
|
-
/** Default output language when not configured. */
|
|
473
|
-
const DEFAULT_OUTPUT_LANGUAGE = 'zh-CN';
|
|
474
474
|
/**
|
|
475
475
|
* Read principles.outputLanguage from config.yaml.
|
|
476
476
|
* Returns default ('zh-CN') when not set.
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
+
import type { FeedbackChannelStatus } from '../../shared/feedback-contract.js';
|
|
1
2
|
import type * as childProcessNS from 'node:child_process';
|
|
2
3
|
import type * as fsNS from 'node:fs';
|
|
3
4
|
import type * as osNS from 'node:os';
|
|
4
5
|
import type * as pathNS from 'node:path';
|
|
5
6
|
import type { FeedbackChannelConfig } from '../config/pd-config-store.js';
|
|
6
7
|
type ExecFileFn = typeof childProcessNS.execFile;
|
|
7
|
-
export
|
|
8
|
-
id: 'ingest' | 'github' | 'email' | 'file';
|
|
9
|
-
available: boolean;
|
|
10
|
-
/** Human-readable reason when unavailable. */
|
|
11
|
-
reason?: string;
|
|
12
|
-
/** Concrete next action the user can take (rc-9). */
|
|
13
|
-
nextAction?: string;
|
|
14
|
-
}
|
|
8
|
+
export type ChannelStatus = FeedbackChannelStatus;
|
|
15
9
|
export interface ChannelsResult {
|
|
16
10
|
ok: true;
|
|
17
11
|
channels: ChannelStatus[];
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
// channels.ts
|
|
2
|
-
// Channel-ladder availability probing for feedback submission (PRI-543).
|
|
3
|
-
//
|
|
4
|
-
// Spec §4 / §8.1: the UI orders channels by ladder position and disables
|
|
5
|
-
// unavailable ones, showing reason + nextAction (rc-9). Probing is fail-open:
|
|
6
|
-
// inability to probe is reported as available so a transient probe failure
|
|
7
|
-
// never hides a channel; the submit path then fails loudly and surfaces a
|
|
8
|
-
// structured reason + downgrade hint.
|
|
9
|
-
//
|
|
10
|
-
// Probing results are cached per (channel,url-or-repo) for 60s to avoid
|
|
11
|
-
// hammering the relay /shelling out to gh on every list/via fetch.
|
|
12
1
|
import { probeIngestHealth } from './ingest-adapter.js';
|
|
13
2
|
import { detectGithubCli } from './github-adapter.js';
|
|
14
3
|
const PROBE_CACHE_TTL_MS = 60_000;
|
|
@@ -3,6 +3,8 @@ import * as fs from 'fs';
|
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { loadPdConfig, computeFlagsFromLoadResult, getFeedbackMaintainerEmail, getFeedbackChannelConfig, } from './config/pd-config-store.js';
|
|
6
|
+
import { resolveOwnerIdentity, defaultOwnerIdentityHomeDir } from '@principles/core/runtime-v2';
|
|
7
|
+
import { createProductTelemetryService, scheduleProductTelemetryExport } from '@principles/host-runtime';
|
|
6
8
|
import { AuthConfig } from './config/AuthConfig.js';
|
|
7
9
|
import { WorkspaceConfigStore } from './config/WorkspaceConfigStore.js';
|
|
8
10
|
import { WorkspaceService } from './models/WorkspaceService.js';
|
|
@@ -15,7 +17,8 @@ import { handleLifecycleRoute, disposeLifecycleModels } from './routes/lifecycle
|
|
|
15
17
|
import { handleActivationsRoute, disposeActivationsModels } from './routes/activations.js';
|
|
16
18
|
import { handleReceiptsRoute, disposeReceiptsModels } from './routes/receipts.js';
|
|
17
19
|
import { handleApprovalsGroupedRoute, disposeApprovalsGroupedModels } from './routes/approvals-grouped.js';
|
|
18
|
-
import { handleGovernanceRoute, disposeGovernanceModels } from './routes/governance.js';
|
|
20
|
+
import { handleGovernanceRoute, handleGovernanceExperienceRoute, resolveOwnerConfigSnapshot, disposeGovernanceModels } from './routes/governance.js';
|
|
21
|
+
import { handleOwnerIdentityRoute } from './routes/owner-identity.js';
|
|
19
22
|
import { handleEvidenceChainRoute, disposeEvidenceChainModels } from './routes/evidence-chain.js';
|
|
20
23
|
import { handleIntentRoute, disposeIntentModels } from './routes/intent.js';
|
|
21
24
|
import { handleIntentDecisionsRoute, disposeIntentDecisionModels } from './routes/intent-decisions.js';
|
|
@@ -214,11 +217,15 @@ async function initServices(workspaceDir, authConfig) {
|
|
|
214
217
|
// Governance Recovery Actions v1: fail-closed — recovery stays disabled unless
|
|
215
218
|
// explicitly enabled (default off keeps the Console read-only).
|
|
216
219
|
const failedTaskRecoveryEnabled = pdFlags.flags.failed_task_recovery_console?.enabled ?? false;
|
|
220
|
+
// Governance Experience Snapshot v1.5.1 (PRI-584~587): default off; flag-off
|
|
221
|
+
// keeps the legacy Focus experience and 403s the endpoint before any DB access.
|
|
222
|
+
const governanceExperienceEnabled = pdFlags.flags.governance_experience_v1?.enabled ?? false;
|
|
217
223
|
const feedbackFlags = {
|
|
218
224
|
feedback_channel: { enabled: feedbackChannelEnabled },
|
|
219
225
|
failed_tasks_observability: { enabled: failedTasksObservabilityEnabled },
|
|
220
226
|
principle_governance_projection_v2: { enabled: governanceProjectionEnabled },
|
|
221
227
|
failed_task_recovery_console: { enabled: failedTaskRecoveryEnabled },
|
|
228
|
+
governance_experience_v1: { enabled: governanceExperienceEnabled },
|
|
222
229
|
};
|
|
223
230
|
if (!configResult.ok) {
|
|
224
231
|
console.warn('[pd-console] PD config loading failed (using defaults for feedback channel):', configResult.errors.map(e => e.reason).join('; '));
|
|
@@ -380,10 +387,10 @@ function handleRequest(services) {
|
|
|
380
387
|
// CR8: GET /api/v1/activations
|
|
381
388
|
if (urlPath === '/api/v1/activations' || urlPath.startsWith('/api/v1/activations/')) {
|
|
382
389
|
const subPath = urlPath.slice('/api/v1/activations'.length);
|
|
383
|
-
|
|
384
|
-
const
|
|
385
|
-
const ownerActor = services.authConfig.isEnabled() && ownerId && credentialId
|
|
386
|
-
? { principal: { kind: 'configured_owner', ownerId }, authentication: { method: 'console_token', credentialId } }
|
|
390
|
+
// ADR-0022 (PRI-578): single resolver — env > ~/.pd/owner.json > none
|
|
391
|
+
const identity = resolveOwnerIdentity(process.env, defaultOwnerIdentityHomeDir());
|
|
392
|
+
const ownerActor = services.authConfig.isEnabled() && identity.ownerId && identity.credentialId
|
|
393
|
+
? { principal: { kind: 'configured_owner', ownerId: identity.ownerId }, authentication: { method: 'console_token', credentialId: identity.credentialId } }
|
|
387
394
|
: null;
|
|
388
395
|
asyncHandler(() => handleActivationsRoute(req, res, services.workspaceDir, subPath, {
|
|
389
396
|
ownerActor,
|
|
@@ -391,6 +398,21 @@ function handleRequest(services) {
|
|
|
391
398
|
}))(req, res);
|
|
392
399
|
return;
|
|
393
400
|
}
|
|
401
|
+
// ADR-0022 (PRI-578): /api/v1/owner-identity — GET status, POST register, DELETE unregister
|
|
402
|
+
if (urlPath === '/api/v1/owner-identity' || urlPath.startsWith('/api/v1/owner-identity/')) {
|
|
403
|
+
const subPath = urlPath.slice('/api/v1/owner-identity'.length);
|
|
404
|
+
asyncHandler(() => handleOwnerIdentityRoute(req, res, defaultOwnerIdentityHomeDir(), subPath, services.authConfig))(req, res);
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
// PRI-585: GET /api/v1/governance/experience (flag-gated read-only snapshot)
|
|
408
|
+
if (urlPath === '/api/v1/governance/experience') {
|
|
409
|
+
asyncHandler(() => handleGovernanceExperienceRoute(req, res, {
|
|
410
|
+
workspaceDir: services.workspaceDir,
|
|
411
|
+
featureFlags: services.feedbackFlags,
|
|
412
|
+
ownerConfig: resolveOwnerConfigSnapshot(services.authConfig, resolveOwnerIdentity(process.env, defaultOwnerIdentityHomeDir())),
|
|
413
|
+
}))(req, res);
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
394
416
|
// CR8: GET /api/v1/governance/queue
|
|
395
417
|
if (urlPath === '/api/v1/governance/queue') {
|
|
396
418
|
asyncHandler(() => handleGovernanceRoute(req, res, services.workspaceDir))(req, res);
|
|
@@ -461,6 +483,13 @@ export async function main() {
|
|
|
461
483
|
console.warn('[pd-console] Legacy backup migration failed:', err instanceof Error ? err.message : err);
|
|
462
484
|
}
|
|
463
485
|
const server = http.createServer(handleRequest(services));
|
|
486
|
+
// Anonymous Product Telemetry v1 (PRI-595~603): one fire-and-forget export
|
|
487
|
+
// attempt per console startup. The console process is the long-lived PD
|
|
488
|
+
// surface for Codex-host installations (the pd-hook subprocess is too
|
|
489
|
+
// short-lived to host async export). All gating (flag + consent +
|
|
490
|
+
// environment eligibility) happens inside the service; failures are
|
|
491
|
+
// contained and never affect console behavior.
|
|
492
|
+
scheduleProductTelemetryExport(createProductTelemetryService({ logger: { info: (m) => console.log(m), warn: (m) => console.warn(m) } }), workspace);
|
|
464
493
|
const shutdown = async (signal) => {
|
|
465
494
|
console.log(`[pd-console] Received ${signal}, shutting down...`);
|
|
466
495
|
await new Promise((resolve) => { server.close(() => resolve()); });
|
|
@@ -106,12 +106,39 @@ export interface OwnerMutationInput {
|
|
|
106
106
|
reasonCode: string;
|
|
107
107
|
note?: string;
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* PRI-577: RuleCode event telemetry candidate directories, in priority order.
|
|
111
|
+
*
|
|
112
|
+
* Runtime V2 convention is `.pd/logs`, but the v1 EventLog writer
|
|
113
|
+
* (openclaw-plugin `src/core/event-log.ts`) still emits `events_*.jsonl` under
|
|
114
|
+
* `.state/logs`. No production code ever created `.pd/logs`, so scanning only
|
|
115
|
+
* that path made every activation's shadow metrics report "unavailable" in the
|
|
116
|
+
* console while real evaluations accumulated unread in `.state/logs`. Readers
|
|
117
|
+
* scan both candidates until the writer migrates (ERR-031: both readers derive
|
|
118
|
+
* from this same list).
|
|
119
|
+
*/
|
|
120
|
+
export declare const RULECODE_EVENT_LOG_CANDIDATE_DIRS: readonly string[];
|
|
121
|
+
export interface CollectedRuleCodeEventEntries {
|
|
122
|
+
entries: unknown[];
|
|
123
|
+
/** Number of candidate directories that actually exist on disk. */
|
|
124
|
+
sourceDirsFound: number;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Collect rulehost telemetry entries from all candidate log directories.
|
|
128
|
+
* Malformed lines are excluded individually. A directory counts as a source
|
|
129
|
+
* only after it can be enumerated, so an unreadable path cannot be mistaken
|
|
130
|
+
* for a healthy channel with zero events (ERR-002).
|
|
131
|
+
*
|
|
132
|
+
* Exact lines copied between candidate directories are deduplicated by
|
|
133
|
+
* priority. Different events in same-named daily files are retained.
|
|
134
|
+
*/
|
|
135
|
+
export declare function collectRuleCodeEventEntries(workspaceDir: string): CollectedRuleCodeEventEntries;
|
|
109
136
|
export declare class ActivationsConsoleModel {
|
|
110
137
|
private readonly workspaceDir;
|
|
111
138
|
private readonly governanceAuditWriter;
|
|
112
139
|
constructor(workspaceDir: string, governanceAuditWriter?: GovernanceAuditWriter);
|
|
113
140
|
getActivations(): Promise<ActivationsResponse>;
|
|
114
|
-
getOwnerReview(activationId: string, ownerIdentityConfigured?: boolean): Promise<RuleCodeOwnerReview>;
|
|
141
|
+
getOwnerReview(activationId: string, ownerIdentityConfigured?: boolean, ownerActor?: OwnerPromotionActor): Promise<RuleCodeOwnerReview>;
|
|
115
142
|
continueObserving(activationId: string, input: OwnerMutationInput): Promise<{
|
|
116
143
|
decisionId: string;
|
|
117
144
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SqliteConnection, SqliteActivationStateStore, SqlitePIArtifactStore, extractPrincipleId, extractEvidenceRefs, PromotionReadinessReader, RuleHostWriter, createProductionGateDeps, SqliteActivationSafetyStore, isFeatureEnabled, RuleCodeOwnerDecisionService, collectOpenClawPromotionChecks, summarizeRuleCodeShadowEvents, } from '@principles/core/runtime-v2';
|
|
1
|
+
import { SqliteConnection, SqliteActivationStateStore, SqlitePIArtifactStore, extractPrincipleId, extractEvidenceRefs, PromotionReadinessReader, RuleHostWriter, createProductionGateDeps, SqliteActivationSafetyStore, isFeatureEnabled, RuleCodeOwnerDecisionService, collectOpenClawPromotionChecks, summarizeRuleCodeShadowEvents, buildPromotionEvidenceSnapshot, } from '@principles/core/runtime-v2';
|
|
2
2
|
import { OPENCLAW_HOST_LIVENESS_CONTRACT } from '@principles/host-runtime';
|
|
3
3
|
import { loadPdConfig, computeFlagsFromLoadResult } from '../config/pd-config-store.js';
|
|
4
4
|
import * as fs from 'node:fs';
|
|
@@ -54,27 +54,69 @@ function unavailableShadowSummary() {
|
|
|
54
54
|
firstObservedAt: null, lastObservedAt: null,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
/**
|
|
58
|
+
* PRI-577: RuleCode event telemetry candidate directories, in priority order.
|
|
59
|
+
*
|
|
60
|
+
* Runtime V2 convention is `.pd/logs`, but the v1 EventLog writer
|
|
61
|
+
* (openclaw-plugin `src/core/event-log.ts`) still emits `events_*.jsonl` under
|
|
62
|
+
* `.state/logs`. No production code ever created `.pd/logs`, so scanning only
|
|
63
|
+
* that path made every activation's shadow metrics report "unavailable" in the
|
|
64
|
+
* console while real evaluations accumulated unread in `.state/logs`. Readers
|
|
65
|
+
* scan both candidates until the writer migrates (ERR-031: both readers derive
|
|
66
|
+
* from this same list).
|
|
67
|
+
*/
|
|
68
|
+
export const RULECODE_EVENT_LOG_CANDIDATE_DIRS = ['.pd/logs', '.state/logs'];
|
|
69
|
+
/**
|
|
70
|
+
* Collect rulehost telemetry entries from all candidate log directories.
|
|
71
|
+
* Malformed lines are excluded individually. A directory counts as a source
|
|
72
|
+
* only after it can be enumerated, so an unreadable path cannot be mistaken
|
|
73
|
+
* for a healthy channel with zero events (ERR-002).
|
|
74
|
+
*
|
|
75
|
+
* Exact lines copied between candidate directories are deduplicated by
|
|
76
|
+
* priority. Different events in same-named daily files are retained.
|
|
77
|
+
*/
|
|
78
|
+
export function collectRuleCodeEventEntries(workspaceDir) {
|
|
64
79
|
const entries = [];
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
80
|
+
let sourceDirsFound = 0;
|
|
81
|
+
const higherPriorityLines = new Set();
|
|
82
|
+
for (const candidate of RULECODE_EVENT_LOG_CANDIDATE_DIRS) {
|
|
83
|
+
const logsDir = path.join(workspaceDir, ...candidate.split('/'));
|
|
84
|
+
if (!fs.existsSync(logsDir))
|
|
85
|
+
continue;
|
|
86
|
+
try {
|
|
87
|
+
const files = fs.readdirSync(logsDir)
|
|
88
|
+
.filter(name => /^events_.*\.jsonl$/.test(name))
|
|
89
|
+
.sort()
|
|
90
|
+
.slice(-7);
|
|
91
|
+
sourceDirsFound += 1;
|
|
92
|
+
const currentSourceLines = [];
|
|
93
|
+
for (const file of files) {
|
|
94
|
+
const lines = fs.readFileSync(path.join(logsDir, file), 'utf8').split('\n').filter(Boolean);
|
|
95
|
+
for (const line of lines) {
|
|
96
|
+
currentSourceLines.push(line);
|
|
97
|
+
if (higherPriorityLines.has(line))
|
|
98
|
+
continue;
|
|
99
|
+
try {
|
|
100
|
+
entries.push(JSON.parse(line));
|
|
101
|
+
}
|
|
102
|
+
catch { /* exclude malformed telemetry */ }
|
|
70
103
|
}
|
|
71
|
-
catch { /* malformed telemetry is excluded, readiness remains bounded */ }
|
|
72
104
|
}
|
|
105
|
+
for (const line of currentSourceLines)
|
|
106
|
+
higherPriorityLines.add(line);
|
|
73
107
|
}
|
|
108
|
+
catch { /* unreadable directory contributes no entries */ }
|
|
74
109
|
}
|
|
75
|
-
|
|
110
|
+
return { entries, sourceDirsFound };
|
|
111
|
+
}
|
|
112
|
+
function readRuleCodeTelemetry(workspaceDir, activationId, decisions) {
|
|
113
|
+
const countCircuitTrips = (minimumTime) => decisions.filter(decision => decision.decision === 'safety_isolate' && Date.parse(decision.decidedAt) >= minimumTime).length;
|
|
114
|
+
const now = Date.now();
|
|
115
|
+
const unavailableWindow = (minimumTime) => ({ eligible: null, matched: null, blocked: null, unhealthy: null, circuitTrips: countCircuitTrips(minimumTime), toolDistribution: null });
|
|
116
|
+
const collected = collectRuleCodeEventEntries(workspaceDir);
|
|
117
|
+
if (collected.sourceDirsFound === 0)
|
|
76
118
|
return { shadowSummary: unavailableShadowSummary(), metrics: { last24Hours: unavailableWindow(now - 24 * 60 * 60 * 1000), last7Days: unavailableWindow(now - 7 * 24 * 60 * 60 * 1000), representativeSamples: [] } };
|
|
77
|
-
}
|
|
119
|
+
const { entries } = collected;
|
|
78
120
|
const summarizeWindow = (minimumTime) => {
|
|
79
121
|
let eligible = 0;
|
|
80
122
|
let matched = 0;
|
|
@@ -293,7 +335,7 @@ export class ActivationsConsoleModel {
|
|
|
293
335
|
catch { /* best-effort */ }
|
|
294
336
|
}
|
|
295
337
|
}
|
|
296
|
-
async getOwnerReview(activationId, ownerIdentityConfigured = false) {
|
|
338
|
+
async getOwnerReview(activationId, ownerIdentityConfigured = false, ownerActor) {
|
|
297
339
|
const conn = new SqliteConnection({ workspaceDir: this.workspaceDir, readonly: true });
|
|
298
340
|
try {
|
|
299
341
|
const activationStore = new SqliteActivationStateStore(conn);
|
|
@@ -336,19 +378,19 @@ export class ActivationsConsoleModel {
|
|
|
336
378
|
validateProductionArtifact: candidate => writer.canActivate(candidate),
|
|
337
379
|
});
|
|
338
380
|
},
|
|
339
|
-
buildEvidenceSnapshot: (checks, value) => {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
381
|
+
buildEvidenceSnapshot: (checks, value, evaluationId) => {
|
|
382
|
+
return buildPromotionEvidenceSnapshot({
|
|
383
|
+
activationId,
|
|
384
|
+
evaluationId,
|
|
385
|
+
checks,
|
|
386
|
+
artifact: value,
|
|
387
|
+
expectedArtifactDigest: digest,
|
|
388
|
+
// Bind the real authenticated actor; null (not a placeholder) when
|
|
389
|
+
// the review is read without an Owner session.
|
|
390
|
+
ownerIdentity: ownerActor ?? null,
|
|
391
|
+
hostRuntimeVersion: 'openclaw-legacy@1',
|
|
349
392
|
shadowSummary: telemetry.shadowSummary,
|
|
350
|
-
|
|
351
|
-
};
|
|
393
|
+
});
|
|
352
394
|
},
|
|
353
395
|
newEvaluationId: () => `readiness-${randomUUID()}`,
|
|
354
396
|
});
|
|
@@ -476,7 +518,7 @@ export class ActivationsConsoleModel {
|
|
|
476
518
|
}
|
|
477
519
|
}
|
|
478
520
|
async promoteRuleCode(activationId, expected, input) {
|
|
479
|
-
const review = await this.getOwnerReview(activationId, input.actor.principal.kind === 'configured_owner' && input.actor.authentication.method === 'console_token');
|
|
521
|
+
const review = await this.getOwnerReview(activationId, input.actor.principal.kind === 'configured_owner' && input.actor.authentication.method === 'console_token', input.actor);
|
|
480
522
|
const flags = computeFlagsFromLoadResult(loadPdConfig(this.workspaceDir));
|
|
481
523
|
const conn = new SqliteConnection({ workspaceDir: this.workspaceDir, readonly: false });
|
|
482
524
|
try {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { GovernanceExperienceInputs, GovernanceExperienceSnapshot, OwnerConfigSnapshot } from '@principles/core/runtime-v2';
|
|
2
|
+
import { type GovernanceProjectionTables } from './GovernanceProjectionCollector.js';
|
|
3
|
+
/**
|
|
4
|
+
* Stable, path-safe workspace hash for snapshotId (SPEC §13): never exposes the
|
|
5
|
+
* raw path and is never persisted. Windows normalization: backslashes become
|
|
6
|
+
* forward slashes and the drive letter is case-folded, so `D:\a\b`, `d:/a/b/`
|
|
7
|
+
* and `D:/a/b` hash identically. POSIX path case is intentionally preserved.
|
|
8
|
+
*/
|
|
9
|
+
export declare function hashWorkspacePath(workspaceDir: string): string;
|
|
10
|
+
export interface GovernanceExperienceCollectOptions {
|
|
11
|
+
ownerConfig: OwnerConfigSnapshot;
|
|
12
|
+
/** ISO-8601 UTC timestamp; defaults to now. Injected by tests for determinism. */
|
|
13
|
+
asOf?: string;
|
|
14
|
+
/** Test seam for the query-budget contract; production always reads via GovernanceProjectionCollector.readTables. */
|
|
15
|
+
tableReader?: (workspaceDir: string) => GovernanceProjectionTables;
|
|
16
|
+
}
|
|
17
|
+
export declare class GovernanceExperienceCollector {
|
|
18
|
+
private readonly workspaceDir;
|
|
19
|
+
constructor(workspaceDir: string);
|
|
20
|
+
collectSnapshot(options: GovernanceExperienceCollectOptions): GovernanceExperienceSnapshot;
|
|
21
|
+
buildInputs(options: GovernanceExperienceCollectOptions): GovernanceExperienceInputs;
|
|
22
|
+
/**
|
|
23
|
+
* Reads the principle ledger once and validates every entry. A readable file
|
|
24
|
+
* with a malformed tree counts as an unavailable ledger source (no views can
|
|
25
|
+
* be built); individual invalid entries degrade to data-quality groups.
|
|
26
|
+
*/
|
|
27
|
+
private scanLedger;
|
|
28
|
+
}
|