create-principles-disciple 1.121.8 → 1.121.10
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 +263 -41
- package/console/dist/server/utils/update-links.d.ts +38 -0
- package/console/dist/server/utils/update-links.js +71 -0
- 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 +3 -1
- 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 +1 -2
- 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 +5 -0
- 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 +29 -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 +1 -0
- package/plugin/dist/bundle.js +868 -936
- 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/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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type FileDepLinkSpec = {
|
|
2
|
+
linkPath: string;
|
|
3
|
+
/** Deployed layout dir the link points at; may be created by the copy
|
|
4
|
+
* steps that run after derivation (see stagedTargetExists). */
|
|
5
|
+
target: string;
|
|
6
|
+
/** The staged sibling dir proving this component ships in this release. */
|
|
7
|
+
stagedTarget: string;
|
|
8
|
+
};
|
|
9
|
+
export type StagedComponent = {
|
|
10
|
+
/** Freshly extracted component dir under the update temp dir. */
|
|
11
|
+
manifestDir: string;
|
|
12
|
+
/** Deployed layout dir this component is (or will be) installed into. */
|
|
13
|
+
deployedDir: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Derive the node_modules link specs implied by each staged component's
|
|
17
|
+
* declared `file:` dependencies.
|
|
18
|
+
*
|
|
19
|
+
* - `readDependencies(manifestDir)` returns the component's dependency map
|
|
20
|
+
* (name -> version-or-ref); return {} for unreadable/missing manifests.
|
|
21
|
+
* - A `file:` ref is resolved against its staged manifest dir to find the
|
|
22
|
+
* staged sibling target; the deployed link target is taken from the same
|
|
23
|
+
* staged->deployed pairing the caller provides — component identity is
|
|
24
|
+
* the staged directory itself (normalized absolute path), NOT the
|
|
25
|
+
* deployed directory's basename. In the legacy layout the deployed
|
|
26
|
+
* plugin dir is named `principles-disciple` while the staged one is
|
|
27
|
+
* `plugin`, so a basename lookup would silently drop the derived link
|
|
28
|
+
* (review P1, PR #1457).
|
|
29
|
+
* - Deps whose staged target is not one of the layout components (e.g.
|
|
30
|
+
* @principles/codex-adapter — a separate host install, not part of this
|
|
31
|
+
* layout) are skipped.
|
|
32
|
+
*
|
|
33
|
+
* Note: `target` (the deployed dir) may not exist yet at derivation time —
|
|
34
|
+
* for components whose copy step runs after this call, the caller creates
|
|
35
|
+
* the directory right after deriving and creating these links. Use
|
|
36
|
+
* `stagedTarget` to verify the component actually ships in this release.
|
|
37
|
+
*/
|
|
38
|
+
export declare function collectFileDepLinkSpecs(stagedComponents: readonly StagedComponent[], readDependencies: (manifestDir: string) => Record<string, string>): FileDepLinkSpec[];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data-driven resolution-link derivation for the full-update pipeline.
|
|
3
|
+
*
|
|
4
|
+
* The deployed console performs full updates with the update logic baked
|
|
5
|
+
* into its own dist — one generation behind the components it installs. A
|
|
6
|
+
* hardcoded link list therefore goes stale the moment a release introduces
|
|
7
|
+
* a new internal `file:` dependency (observed 2026-08-29: the 1.221.2
|
|
8
|
+
* console could not know about the newly introduced install-layout
|
|
9
|
+
* component, so the 1.222.5 update left
|
|
10
|
+
* host-runtime/node_modules/@principles/install-layout missing and every
|
|
11
|
+
* pd-cli runtime command failed with ERR_MODULE_NOT_FOUND).
|
|
12
|
+
*
|
|
13
|
+
* The authoritative source for "which links does the UPDATED tree need" is
|
|
14
|
+
* the STAGED manifests under the update's temp dir (the freshly extracted
|
|
15
|
+
* release trees) — NOT the deployed pre-update manifests, which by
|
|
16
|
+
* definition do not declare newly added dependencies.
|
|
17
|
+
*
|
|
18
|
+
* Each staged component's `file:` refs resolve to a sibling staged
|
|
19
|
+
* component directory; the deployed link target is that sibling's entry in
|
|
20
|
+
* the same staged->deployed pairing.
|
|
21
|
+
*/
|
|
22
|
+
import * as path from 'node:path';
|
|
23
|
+
/**
|
|
24
|
+
* Derive the node_modules link specs implied by each staged component's
|
|
25
|
+
* declared `file:` dependencies.
|
|
26
|
+
*
|
|
27
|
+
* - `readDependencies(manifestDir)` returns the component's dependency map
|
|
28
|
+
* (name -> version-or-ref); return {} for unreadable/missing manifests.
|
|
29
|
+
* - A `file:` ref is resolved against its staged manifest dir to find the
|
|
30
|
+
* staged sibling target; the deployed link target is taken from the same
|
|
31
|
+
* staged->deployed pairing the caller provides — component identity is
|
|
32
|
+
* the staged directory itself (normalized absolute path), NOT the
|
|
33
|
+
* deployed directory's basename. In the legacy layout the deployed
|
|
34
|
+
* plugin dir is named `principles-disciple` while the staged one is
|
|
35
|
+
* `plugin`, so a basename lookup would silently drop the derived link
|
|
36
|
+
* (review P1, PR #1457).
|
|
37
|
+
* - Deps whose staged target is not one of the layout components (e.g.
|
|
38
|
+
* @principles/codex-adapter — a separate host install, not part of this
|
|
39
|
+
* layout) are skipped.
|
|
40
|
+
*
|
|
41
|
+
* Note: `target` (the deployed dir) may not exist yet at derivation time —
|
|
42
|
+
* for components whose copy step runs after this call, the caller creates
|
|
43
|
+
* the directory right after deriving and creating these links. Use
|
|
44
|
+
* `stagedTarget` to verify the component actually ships in this release.
|
|
45
|
+
*/
|
|
46
|
+
export function collectFileDepLinkSpecs(stagedComponents, readDependencies) {
|
|
47
|
+
const deployedDirByStagedDir = new Map();
|
|
48
|
+
for (const component of stagedComponents) {
|
|
49
|
+
deployedDirByStagedDir.set(path.resolve(component.manifestDir), component.deployedDir);
|
|
50
|
+
}
|
|
51
|
+
const specs = [];
|
|
52
|
+
const seen = new Set();
|
|
53
|
+
for (const component of stagedComponents) {
|
|
54
|
+
for (const [name, ref] of Object.entries(readDependencies(component.manifestDir))) {
|
|
55
|
+
if (typeof ref !== 'string' || !ref.startsWith('file:'))
|
|
56
|
+
continue;
|
|
57
|
+
const stagedTarget = path.resolve(component.manifestDir, ref.slice('file:'.length));
|
|
58
|
+
const deployedTarget = deployedDirByStagedDir.get(stagedTarget);
|
|
59
|
+
if (deployedTarget === undefined)
|
|
60
|
+
continue;
|
|
61
|
+
// The link lives in the DEPLOYED component dir (what the updated dist
|
|
62
|
+
// resolves against) — never inside the throwaway temp dir.
|
|
63
|
+
const linkPath = path.join(component.deployedDir, 'node_modules', name);
|
|
64
|
+
if (seen.has(linkPath))
|
|
65
|
+
continue;
|
|
66
|
+
seen.add(linkPath);
|
|
67
|
+
specs.push({ linkPath, target: deployedTarget, stagedTarget });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return specs;
|
|
71
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback channel identity constants — PRI-613.
|
|
3
|
+
*
|
|
4
|
+
* Kept in a dependency-free module so the browser bundle can import the
|
|
5
|
+
* runtime const WITHOUT pulling @sinclair/typebox in (the schema module
|
|
6
|
+
* imports typebox; importing it at runtime from UI code would add ~850KB to
|
|
7
|
+
* the browser bundle — measured, SPEC §10.5 stop condition). The schema
|
|
8
|
+
* module derives its literal union from this const; the UI derives its
|
|
9
|
+
* runtime channel-ID check from the same const. One authority, two safe
|
|
10
|
+
* import contexts.
|
|
11
|
+
*/
|
|
12
|
+
export declare const FEEDBACK_CHANNEL_IDS: readonly ['ingest', 'github', 'email', 'file'];
|
|
13
|
+
export type FeedbackChannelId = (typeof FEEDBACK_CHANNEL_IDS)[number];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback channel identity constants — PRI-613.
|
|
3
|
+
*
|
|
4
|
+
* Kept in a dependency-free module so the browser bundle can import the
|
|
5
|
+
* runtime const WITHOUT pulling @sinclair/typebox in (the schema module
|
|
6
|
+
* imports typebox; importing it at runtime from UI code would add ~850KB to
|
|
7
|
+
* the browser bundle — measured, SPEC §10.5 stop condition). The schema
|
|
8
|
+
* module derives its literal union from this const; the UI derives its
|
|
9
|
+
* runtime channel-ID check from the same const. One authority, two safe
|
|
10
|
+
* import contexts.
|
|
11
|
+
*/
|
|
12
|
+
export const FEEDBACK_CHANNEL_IDS = ['ingest', 'github', 'email', 'file'];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback submit-ladder shared contract — PRI-613 Schema→Type→Validator pilot.
|
|
3
|
+
*
|
|
4
|
+
* Canonical authority for the wire shapes shared by server and UI. The
|
|
5
|
+
* TypeBox schemas here are the single source: the server's ChannelStatus
|
|
6
|
+
* derives from them (type-only import), and the UI's validator data shapes
|
|
7
|
+
* derive via `import type` — the browser bundle must NOT import this module
|
|
8
|
+
* at runtime (it would bundle @sinclair/typebox, ~850KB; see
|
|
9
|
+
* feedback-channel-ids.ts for the runtime-safe const).
|
|
10
|
+
*
|
|
11
|
+
* UI validators (ui/utils/validators.ts) are a machine-enforced mirror:
|
|
12
|
+
* tests/integration/feedback-contract.test.ts asserts schema-vs-validator
|
|
13
|
+
* equivalence on an accept/reject matrix, so drift is CI-detectable without
|
|
14
|
+
* shipping typebox to the browser.
|
|
15
|
+
*
|
|
16
|
+
* Single direction: Schema → Static type. Do NOT add a parallel interface
|
|
17
|
+
* next to these schemas.
|
|
18
|
+
*/
|
|
19
|
+
import { type Static } from '@sinclair/typebox';
|
|
20
|
+
export declare const FeedbackChannelStatusSchema: import("@sinclair/typebox").TObject<{
|
|
21
|
+
id: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"email" | "file" | "github" | "ingest">[]>;
|
|
22
|
+
available: import("@sinclair/typebox").TBoolean;
|
|
23
|
+
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
24
|
+
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
25
|
+
}>;
|
|
26
|
+
export type FeedbackChannelStatus = Static<typeof FeedbackChannelStatusSchema>;
|
|
27
|
+
export declare const FeedbackChannelsDataSchema: import("@sinclair/typebox").TObject<{
|
|
28
|
+
channels: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
29
|
+
id: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"email" | "file" | "github" | "ingest">[]>;
|
|
30
|
+
available: import("@sinclair/typebox").TBoolean;
|
|
31
|
+
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
32
|
+
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
33
|
+
}>>;
|
|
34
|
+
}>;
|
|
35
|
+
export type FeedbackChannelsData = Static<typeof FeedbackChannelsDataSchema>;
|
|
36
|
+
export declare const FeedbackSubmitResultSchema: import("@sinclair/typebox").TObject<{
|
|
37
|
+
ok: import("@sinclair/typebox").TBoolean;
|
|
38
|
+
alreadySubmitted: import("@sinclair/typebox").TBoolean;
|
|
39
|
+
status: import("@sinclair/typebox").TString;
|
|
40
|
+
submittedVia: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
41
|
+
trackingId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
42
|
+
externalUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
43
|
+
writeBackFailed: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
44
|
+
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
|
|
45
|
+
}>;
|
|
46
|
+
export type FeedbackSubmitResult = Static<typeof FeedbackSubmitResultSchema>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback submit-ladder shared contract — PRI-613 Schema→Type→Validator pilot.
|
|
3
|
+
*
|
|
4
|
+
* Canonical authority for the wire shapes shared by server and UI. The
|
|
5
|
+
* TypeBox schemas here are the single source: the server's ChannelStatus
|
|
6
|
+
* derives from them (type-only import), and the UI's validator data shapes
|
|
7
|
+
* derive via `import type` — the browser bundle must NOT import this module
|
|
8
|
+
* at runtime (it would bundle @sinclair/typebox, ~850KB; see
|
|
9
|
+
* feedback-channel-ids.ts for the runtime-safe const).
|
|
10
|
+
*
|
|
11
|
+
* UI validators (ui/utils/validators.ts) are a machine-enforced mirror:
|
|
12
|
+
* tests/integration/feedback-contract.test.ts asserts schema-vs-validator
|
|
13
|
+
* equivalence on an accept/reject matrix, so drift is CI-detectable without
|
|
14
|
+
* shipping typebox to the browser.
|
|
15
|
+
*
|
|
16
|
+
* Single direction: Schema → Static type. Do NOT add a parallel interface
|
|
17
|
+
* next to these schemas.
|
|
18
|
+
*/
|
|
19
|
+
import { Type } from '@sinclair/typebox';
|
|
20
|
+
import { FEEDBACK_CHANNEL_IDS } from './feedback-channel-ids.js';
|
|
21
|
+
/**
|
|
22
|
+
* Optional explanation fields are `string | null` on the wire: absent means
|
|
23
|
+
* "no reason to show"; explicit null is accepted and normalized to absent by
|
|
24
|
+
* the UI validator (legacy readNullableString semantics).
|
|
25
|
+
*/
|
|
26
|
+
const optionalNullableString = Type.Optional(Type.Union([Type.String(), Type.Null()]));
|
|
27
|
+
export const FeedbackChannelStatusSchema = Type.Object({
|
|
28
|
+
id: Type.Union(FEEDBACK_CHANNEL_IDS.map((id) => Type.Literal(id))),
|
|
29
|
+
available: Type.Boolean(),
|
|
30
|
+
reason: optionalNullableString,
|
|
31
|
+
nextAction: optionalNullableString,
|
|
32
|
+
});
|
|
33
|
+
export const FeedbackChannelsDataSchema = Type.Object({
|
|
34
|
+
channels: Type.Array(FeedbackChannelStatusSchema),
|
|
35
|
+
});
|
|
36
|
+
export const FeedbackSubmitResultSchema = Type.Object({
|
|
37
|
+
ok: Type.Boolean(),
|
|
38
|
+
alreadySubmitted: Type.Boolean(),
|
|
39
|
+
status: Type.String(),
|
|
40
|
+
submittedVia: optionalNullableString,
|
|
41
|
+
trackingId: optionalNullableString,
|
|
42
|
+
externalUrl: optionalNullableString,
|
|
43
|
+
writeBackFailed: Type.Optional(Type.Boolean()),
|
|
44
|
+
nextAction: optionalNullableString,
|
|
45
|
+
});
|
package/console/dist/ui/App.js
CHANGED
|
@@ -130,7 +130,7 @@ function AuthRoutes() {
|
|
|
130
130
|
}, []);
|
|
131
131
|
return (_jsxs(Routes, { children: [_jsx(Route, { path: "/splash", element: _jsx(SplashScreen, { onComplete: () => {
|
|
132
132
|
setShowSplash(false);
|
|
133
|
-
} }) }), _jsx(Route, { path: "/login", element: _jsx(LoginForm, { onAuthSuccess: handleAuthSuccess }) }), _jsx(Route, { path: "/*", element: authed === null ? (_jsx("div", { className: "min-h-screen bg-paper flex items-center justify-center", children: _jsxs("div", { className: "flex flex-col items-center gap-4", children: [_jsx("div", { className: "w-8 h-8 border-2 border-gov border-t-transparent rounded-full animate-spin" }), _jsx("span", { className: "text-[12px] font-mono tracking-wider text-ink-3 uppercase", children: "Verifying Session..." })] }) })) : authed ? (_jsx(NotificationProvider, { children: _jsxs("div", { className: "min-h-screen bg-paper text-ink", children: [_jsx("a", { href: "#main-content", className: "sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4 focus:bg-paper focus:text-ink", children: "Skip to main content" }), _jsx(AppSidebar, { featureFlags: featureFlags ?? undefined }), _jsx("main", { id: "main-content", className: "ml-[256px] min-h-screen overflow-y-auto", children: _jsx(ErrorBoundary, { children: _jsxs(Routes, { children: [_jsx(Route, { path: "/", element: _jsx(Navigate, { to: "/focus", replace: true }) }), _jsx(Route, { path: "/welcome", element: _jsx(WelcomePage, { workspaceId: currentWorkspaceId }) }), _jsx(Route, { path: "/focus", element: _jsx(FocusPage, {}) }), _jsx(Route, { path: "/pain", element: _jsx(PainPage, {}) }), _jsx(Route, { path: "/principles", element: _jsx(PrinciplesPage, {}) }), _jsx(Route, { path: "/principles/:id", element: _jsx(PrincipleDetailPage, {}) }), _jsx(Route, { path: "/activation", element: _jsx(ActivationPage, {}) }), _jsx(Route, { path: "/debt", element: _jsx(DebtPage, {}) }), _jsx(Route, { path: "/control-center", element: _jsx(ControlCenterPage, {}) }), _jsx(Route, { path: "/control-center/signal-keywords", element: _jsx(SignalKeywordsPage, {}) }), _jsx(Route, { path: "/settings", element: _jsx(SettingsPage, {}) }), _jsx(Route, { path: "/update", element: _jsx(UpdatePage, {}) }), _jsx(Route, { path: "/report-problem", element: _jsx(ReportProblemPage, {}) }), _jsx(Route, { path: "/failed-tasks", element: _jsx(FailedTasksPage, {}) }), _jsx(Route, { path: "/intent", element: _jsx(IntentPage, {}) }), IS_DEV && (_jsx(Route, { path: "/design-system", element: _jsx(DesignSystemPage, {}) })), !IS_DEV && (_jsx(Route, { path: "/design-system", element: _jsx(Navigate, { to: "/focus", replace: true }) }))] }) }) })] }) })) : (_jsx(Navigate, { to: "/login", replace: true })) })] }));
|
|
133
|
+
} }) }), _jsx(Route, { path: "/login", element: _jsx(LoginForm, { onAuthSuccess: handleAuthSuccess }) }), _jsx(Route, { path: "/*", element: authed === null ? (_jsx("div", { className: "min-h-screen bg-paper flex items-center justify-center", children: _jsxs("div", { className: "flex flex-col items-center gap-4", children: [_jsx("div", { className: "w-8 h-8 border-2 border-gov border-t-transparent rounded-full animate-spin" }), _jsx("span", { className: "text-[12px] font-mono tracking-wider text-ink-3 uppercase", children: "Verifying Session..." })] }) })) : authed ? (_jsx(NotificationProvider, { children: _jsxs("div", { className: "min-h-screen bg-paper text-ink", children: [_jsx("a", { href: "#main-content", className: "sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4 focus:bg-paper focus:text-ink", children: "Skip to main content" }), _jsx(AppSidebar, { featureFlags: featureFlags ?? undefined }), _jsx("main", { id: "main-content", className: "ml-[256px] min-h-screen overflow-y-auto", children: _jsx(ErrorBoundary, { children: _jsxs(Routes, { children: [_jsx(Route, { path: "/", element: _jsx(Navigate, { to: "/focus", replace: true }) }), _jsx(Route, { path: "/welcome", element: _jsx(WelcomePage, { workspaceId: currentWorkspaceId }) }), _jsx(Route, { path: "/focus", element: _jsx(FocusPage, { featureFlags: featureFlags ?? undefined }) }), _jsx(Route, { path: "/pain", element: _jsx(PainPage, {}) }), _jsx(Route, { path: "/principles", element: _jsx(PrinciplesPage, {}) }), _jsx(Route, { path: "/principles/:id", element: _jsx(PrincipleDetailPage, {}) }), _jsx(Route, { path: "/activation", element: _jsx(ActivationPage, {}) }), _jsx(Route, { path: "/debt", element: _jsx(DebtPage, {}) }), _jsx(Route, { path: "/control-center", element: _jsx(ControlCenterPage, {}) }), _jsx(Route, { path: "/control-center/signal-keywords", element: _jsx(SignalKeywordsPage, {}) }), _jsx(Route, { path: "/settings", element: _jsx(SettingsPage, {}) }), _jsx(Route, { path: "/update", element: _jsx(UpdatePage, {}) }), _jsx(Route, { path: "/report-problem", element: _jsx(ReportProblemPage, {}) }), _jsx(Route, { path: "/failed-tasks", element: _jsx(FailedTasksPage, {}) }), _jsx(Route, { path: "/intent", element: _jsx(IntentPage, {}) }), IS_DEV && (_jsx(Route, { path: "/design-system", element: _jsx(DesignSystemPage, {}) })), !IS_DEV && (_jsx(Route, { path: "/design-system", element: _jsx(Navigate, { to: "/focus", replace: true }) }))] }) }) })] }) })) : (_jsx(Navigate, { to: "/login", replace: true })) })] }));
|
|
134
134
|
}
|
|
135
135
|
export function App() {
|
|
136
136
|
return (_jsx(ThemeProvider, { children: _jsxs(I18nextProvider, { i18n: i18n, children: [_jsx(HashRouter, { children: _jsx(AuthRoutes, {}) }), _jsx(Toaster, {})] }) }));
|
package/console/dist/ui/api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ApiResponse } from "../types.js";
|
|
2
2
|
import { listActiveSignalKeywords, listPendingSignalTerms, fetchKeywordStore, fetchPendingTerms, updateKeywordStore, admitPendingTerm, rejectPendingTerm } from "./utils/signal-keywords-api.js";
|
|
3
|
-
import type { OwnerGovernanceView } from '@principles/core/runtime-v2';
|
|
3
|
+
import type { GovernanceExperienceSnapshot, OwnerGovernanceView } from '@principles/core/runtime-v2';
|
|
4
|
+
import type { OwnerIdentityViewData, OwnerIdentityRegisterData, OwnerIdentityUnregisterData } from "./utils/validators.js";
|
|
4
5
|
import type { FeedbackReportData, FeedbackDraftSummaryData, FeedbackDraftEnvelopeData, FeedbackChannelsData, FeedbackSubmitResultData, DeleteEnvelopeData, WorkspaceEntryData, RemovedEnvelopeData, SyncResultData, ConfigSummaryData, ConfigCatalogData, AgentBindingUpdateData, DefaultRuntimeUpdateData, RuntimeProfileMutationData, ReadinessCheckData, FeatureFlagUpdateData, OutputLanguageData, GovernanceQueueData, RecoveryResultData, ActivationsData, DisableActivationData, LifecycleMetricsData, UpdateStatusData, UpdateHistoryData, ApplyUpdateResultData, RollbackResultData, ApprovalRecordData, PrinciplesListData, ApprovalsGroupedData, EvidenceChainData, TrajectoryData, IntentSummaryData, IntentDecisionRecordData, IntentDecisionResultData, IntentDecisionSummaryData, FollowUpResponseData, IntentInitResultData, IntentSaveResultData, IntentRawContentData, IntentVersionData, RuleCodeOwnerReviewData, RuleCodeMutationData } from "./utils/validators.js";
|
|
5
6
|
declare function getToken(): string | null;
|
|
6
7
|
declare function setToken(token: string): void;
|
|
@@ -48,6 +49,7 @@ export interface PrincipleReceiptsData {
|
|
|
48
49
|
presenceCount: number;
|
|
49
50
|
lastEffectAt: string | null;
|
|
50
51
|
events: ReceiptEventData[];
|
|
52
|
+
coverage: ReceiptEvidenceCoverageData;
|
|
51
53
|
}
|
|
52
54
|
export interface ReceiptCountEntryData {
|
|
53
55
|
principleId: string;
|
|
@@ -60,6 +62,18 @@ export interface ReceiptCountsData {
|
|
|
60
62
|
reason?: string;
|
|
61
63
|
nextAction?: string;
|
|
62
64
|
counts: ReceiptCountEntryData[];
|
|
65
|
+
coverage: ReceiptEvidenceCoverageData;
|
|
66
|
+
}
|
|
67
|
+
export type ReceiptSourceStatusData = "available" | "disabled" | "unavailable";
|
|
68
|
+
export type ReceiptValidationStatusData = "valid" | "partial" | "malformed";
|
|
69
|
+
export interface ReceiptEvidenceCoverageData {
|
|
70
|
+
sourceStatus: ReceiptSourceStatusData;
|
|
71
|
+
validationStatus: ReceiptValidationStatusData;
|
|
72
|
+
observedFrom: string | null;
|
|
73
|
+
asOf: string;
|
|
74
|
+
retentionPolicyDays: number;
|
|
75
|
+
reasonCode?: string;
|
|
76
|
+
nextActionCode?: string;
|
|
63
77
|
}
|
|
64
78
|
declare function fetchPrincipleReceipts(principleId: string): Promise<ApiResponse<PrincipleReceiptsData>>;
|
|
65
79
|
declare function fetchReceiptCounts(): Promise<ApiResponse<ReceiptCountsData>>;
|
|
@@ -84,6 +98,9 @@ declare function fetchConfigSummary(): Promise<ApiResponse<ConfigSummaryData>>;
|
|
|
84
98
|
declare function fetchConfigCatalog(): Promise<ApiResponse<ConfigCatalogData>>;
|
|
85
99
|
declare function updateAgentBinding(agentName: string, runtimeProfile: string, enabled: boolean): Promise<ApiResponse<AgentBindingUpdateData>>;
|
|
86
100
|
declare function updateDefaultRuntime(defaultRuntime: string): Promise<ApiResponse<DefaultRuntimeUpdateData>>;
|
|
101
|
+
export declare function fetchOwnerIdentity(): Promise<ApiResponse<OwnerIdentityViewData>>;
|
|
102
|
+
export declare function registerOwnerIdentity(ownerId: string, credentialId: string): Promise<ApiResponse<OwnerIdentityRegisterData>>;
|
|
103
|
+
export declare function unregisterOwnerIdentity(): Promise<ApiResponse<OwnerIdentityUnregisterData>>;
|
|
87
104
|
/**
|
|
88
105
|
* Create a new runtime profile.
|
|
89
106
|
*
|
|
@@ -129,7 +146,8 @@ declare function patchFeatureFlag(featureName: string, enabled: boolean): Promis
|
|
|
129
146
|
declare function fetchOutputLanguage(): Promise<ApiResponse<OutputLanguageData>>;
|
|
130
147
|
declare function updateOutputLanguage(outputLanguage: string): Promise<ApiResponse<OutputLanguageData>>;
|
|
131
148
|
declare function fetchGovernanceQueue(): Promise<ApiResponse<GovernanceQueueData>>;
|
|
132
|
-
declare function
|
|
149
|
+
declare function fetchGovernanceExperience(): Promise<ApiResponse<GovernanceExperienceSnapshot>>;
|
|
150
|
+
declare function recoverFailedTask(taskId: string, reason?: string, force?: boolean): Promise<ApiResponse<RecoveryResultData>>;
|
|
133
151
|
declare function fetchApprovalsGrouped(): Promise<ApiResponse<ApprovalsGroupedData>>;
|
|
134
152
|
declare function fetchAllActivations(): Promise<ApiResponse<ActivationsData>>;
|
|
135
153
|
declare function disableActivation(activationId: string): Promise<ApiResponse<DisableActivationData>>;
|
|
@@ -196,7 +214,7 @@ export interface FollowUpPayload {
|
|
|
196
214
|
candidateId?: string;
|
|
197
215
|
}
|
|
198
216
|
declare function dispatchFollowUp(decisionId: string, payload: FollowUpPayload): Promise<ApiResponse<FollowUpResponseData>>;
|
|
199
|
-
export { request, listActiveSignalKeywords, listPendingSignalTerms, fetchKeywordStore, fetchPendingTerms, updateKeywordStore, admitPendingTerm, rejectPendingTerm, getToken, setToken, clearToken, checkAuth, approveApproval, rejectApproval, editApproval, fetchPrinciples, fetchPrincipleDetail, fetchPrincipleGovernance, fetchPrincipleTrajectory, fetchPrincipleReceipts, fetchReceiptCounts, archivePrinciple, unarchivePrinciple, createFeedbackReport, listFeedbackReports, getFeedbackReport, deleteFeedbackReport, fetchFeedbackChannels, submitFeedbackReport, markFeedbackReportSent, fetchConfigSummary, fetchConfigCatalog, updateAgentBinding, updateDefaultRuntime, createRuntimeProfile, updateRuntimeProfile, deleteRuntimeProfile, fetchAgentReadiness, patchFeatureFlag, fetchOutputLanguage, updateOutputLanguage, fetchWorkspaces, addWorkspace, removeWorkspace, syncWorkspace, fetchGovernanceQueue, recoverFailedTask, fetchApprovalsGrouped, fetchAllActivations, disableActivation, fetchRuleCodeOwnerReview, ruleCodeDecision, pauseAllRuleCode, releaseRuleCodePause, fetchLifecycleMetrics, fetchUpdateStatus, fetchUpdateHistory, applyUpdate, applyFullUpdate, rollbackUpdate, fetchEvidenceChain, fetchIntentSummary, fetchIntentContent, createIntentTemplate, saveIntentContent, fetchIntentVersions, recordIntentDecision, listIntentDecisionsByPainId, listIntentDecisionsByTaskId, fetchIntentDecisionSummary, dispatchFollowUp, };
|
|
217
|
+
export { request, listActiveSignalKeywords, listPendingSignalTerms, fetchKeywordStore, fetchPendingTerms, updateKeywordStore, admitPendingTerm, rejectPendingTerm, getToken, setToken, clearToken, checkAuth, approveApproval, rejectApproval, editApproval, fetchPrinciples, fetchPrincipleDetail, fetchPrincipleGovernance, fetchPrincipleTrajectory, fetchPrincipleReceipts, fetchReceiptCounts, archivePrinciple, unarchivePrinciple, createFeedbackReport, listFeedbackReports, getFeedbackReport, deleteFeedbackReport, fetchFeedbackChannels, submitFeedbackReport, markFeedbackReportSent, fetchConfigSummary, fetchConfigCatalog, updateAgentBinding, updateDefaultRuntime, createRuntimeProfile, updateRuntimeProfile, deleteRuntimeProfile, fetchAgentReadiness, patchFeatureFlag, fetchOutputLanguage, updateOutputLanguage, fetchWorkspaces, addWorkspace, removeWorkspace, syncWorkspace, fetchGovernanceQueue, fetchGovernanceExperience, recoverFailedTask, fetchApprovalsGrouped, fetchAllActivations, disableActivation, fetchRuleCodeOwnerReview, ruleCodeDecision, pauseAllRuleCode, releaseRuleCodePause, fetchLifecycleMetrics, fetchUpdateStatus, fetchUpdateHistory, applyUpdate, applyFullUpdate, rollbackUpdate, fetchEvidenceChain, fetchIntentSummary, fetchIntentContent, createIntentTemplate, saveIntentContent, fetchIntentVersions, recordIntentDecision, listIntentDecisionsByPainId, listIntentDecisionsByTaskId, fetchIntentDecisionSummary, dispatchFollowUp, };
|
|
200
218
|
export type { FeedbackReportData, FeedbackDraftSummaryData, FeedbackDraftEnvelopeData, FeedbackChannelsData, FeedbackSubmitResultData, DeleteEnvelopeData, WorkspaceEntryData, RemovedEnvelopeData, SyncResultData, ConfigSummaryData, ConfigCatalogData, AgentBindingUpdateData, DefaultRuntimeUpdateData, RuntimeProfileMutationData, ReadinessCheckData, FeatureFlagUpdateData, OutputLanguageData, GovernanceQueueData, RecoveryResultData, ActivationsData, DisableActivationData, RuleCodeOwnerReviewData, RuleCodeMutationData, LifecycleMetricsData, UpdateStatusData, UpdateHistoryData, ApplyUpdateResultData, RollbackResultData, ApprovalRecordData, PrinciplesListData, ApprovalsGroupedData, EvidenceChainData, EvidenceChainRecordData, EvidenceChainStateData, TrajectoryData, TrajectoryStageData, IntentSummaryData, IntentSectionsData, IntentDocWarningData, IntentDecisionRecordData, IntentDecisionResultData, IntentDecisionSummaryData, FollowUpResponseData, LinkCandidateFollowUpData, GuideRulehostFollowUpData, GeneratePatchProposalFollowUpData, IntentVersionEntry, IntentVersionData, } from "./utils/validators.js";
|
|
201
219
|
export type { SignalKeyword, PendingSignalTerm } from "./utils/signal-keywords-types.js";
|
|
202
220
|
export type { ActivationRecordData as ActivationRecord } from "./utils/validators.js";
|
|
@@ -213,6 +231,7 @@ export type { RedactedFeatureSummaryData as RedactedFeatureSummary } from "./uti
|
|
|
213
231
|
export type { RedactedAgentSummaryData as RedactedAgentSummary } from "./utils/validators.js";
|
|
214
232
|
export type { UpdateHistoryEntryData as UpdateHistoryEntry } from "./utils/validators.js";
|
|
215
233
|
export type { ReadinessStatus } from "./utils/validators.js";
|
|
234
|
+
export type { OwnerIdentityViewData, OwnerIdentityRegisterData, OwnerIdentityUnregisterData } from "./utils/validators.js";
|
|
216
235
|
export type { ConfigSource } from "./utils/validators.js";
|
|
217
236
|
export interface PrincipleDetail {
|
|
218
237
|
id: string;
|
package/console/dist/ui/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { listActiveSignalKeywords, listPendingSignalTerms, fetchKeywordStore, fetchPendingTerms, updateKeywordStore, admitPendingTerm, rejectPendingTerm, } from "./utils/signal-keywords-api.js";
|
|
2
|
-
import { validateErrorResponse, validateHeaders, validateFeedbackReport, validateFeedbackDraftsList, validateFeedbackDraftEnvelope, validateFeedbackChannels, validateFeedbackSubmitResult, validateDeleteEnvelope, validateWorkspaceEntry, validateWorkspaceList, validateRemovedEnvelope, validateSyncResult, validateConfigSummary, validateConfigCatalog, validateAgentBindingUpdate, validateDefaultRuntimeUpdate, validateRuntimeProfileMutation, validateReadinessCheck, validateFeatureFlagUpdate, validateOutputLanguage, validateGovernanceQueue, validateRecoveryResult, validateActivations, validateDisableActivation, validateLifecycleMetrics, validateUpdateStatus, validateUpdateHistory, validateApplyUpdateResult, validateRollbackResult, validateApprovalRecordDirect, validatePrinciplesList, validateApprovalsGrouped, validateEvidenceChain, validateTrajectoryData, validateIntentSummary, validateIntentDecisionList, validateIntentDecisionResult, validateIntentDecisionSummary, validateFollowUpResponse, validateIntentInitResult, validateIntentSaveResult, validateIntentRawContent, validateIntentVersions, validateOwnerGovernanceView, validateRuleCodeOwnerReview, validateRuleCodeMutation, } from "./utils/validators.js";
|
|
2
|
+
import { validateErrorResponse, validateHeaders, validateFeedbackReport, validateFeedbackDraftsList, validateFeedbackDraftEnvelope, validateFeedbackChannels, validateFeedbackSubmitResult, validateDeleteEnvelope, validateWorkspaceEntry, validateWorkspaceList, validateRemovedEnvelope, validateSyncResult, validateConfigSummary, validateConfigCatalog, validateAgentBindingUpdate, validateDefaultRuntimeUpdate, validateRuntimeProfileMutation, validateReadinessCheck, validateFeatureFlagUpdate, validateOutputLanguage, validateGovernanceQueue, validateRecoveryResult, validateActivations, validateDisableActivation, validateLifecycleMetrics, validateUpdateStatus, validateUpdateHistory, validateApplyUpdateResult, validateRollbackResult, validateApprovalRecordDirect, validatePrinciplesList, validateApprovalsGrouped, validateEvidenceChain, validateTrajectoryData, validateIntentSummary, validateIntentDecisionList, validateIntentDecisionResult, validateIntentDecisionSummary, validateFollowUpResponse, validateIntentInitResult, validateIntentSaveResult, validateIntentRawContent, validateIntentVersions, validateOwnerGovernanceView, validateGovernanceExperienceSnapshot, validateRuleCodeOwnerReview, validateRuleCodeMutation, validateOwnerIdentityView, validateOwnerIdentityRegister, validateOwnerIdentityUnregister, } from "./utils/validators.js";
|
|
3
3
|
// ── Auth ──────────────────────────────────────────────────────────────────────
|
|
4
4
|
function getToken() {
|
|
5
5
|
return sessionStorage.getItem("pd_token");
|
|
@@ -136,6 +136,32 @@ async function unarchivePrinciple(principleId) {
|
|
|
136
136
|
async function fetchPrincipleTrajectory(principleId) {
|
|
137
137
|
return request(`/api/principles/${encodeURIComponent(principleId)}/trajectory`, undefined, validateTrajectoryData);
|
|
138
138
|
}
|
|
139
|
+
const RECEIPT_SOURCE_STATUSES = new Set(["available", "disabled", "unavailable"]);
|
|
140
|
+
const RECEIPT_VALIDATION_STATUSES = new Set(["valid", "partial", "malformed"]);
|
|
141
|
+
function validateReceiptCoverage(value) {
|
|
142
|
+
if (typeof value !== "object" || value === null)
|
|
143
|
+
return null;
|
|
144
|
+
const rec = value;
|
|
145
|
+
if (typeof rec.sourceStatus !== "string" || !RECEIPT_SOURCE_STATUSES.has(rec.sourceStatus))
|
|
146
|
+
return null;
|
|
147
|
+
if (typeof rec.validationStatus !== "string" || !RECEIPT_VALIDATION_STATUSES.has(rec.validationStatus))
|
|
148
|
+
return null;
|
|
149
|
+
if (rec.observedFrom !== null && typeof rec.observedFrom !== "string")
|
|
150
|
+
return null;
|
|
151
|
+
if (typeof rec.asOf !== "string")
|
|
152
|
+
return null;
|
|
153
|
+
if (typeof rec.retentionPolicyDays !== "number")
|
|
154
|
+
return null;
|
|
155
|
+
return {
|
|
156
|
+
sourceStatus: rec.sourceStatus,
|
|
157
|
+
validationStatus: rec.validationStatus,
|
|
158
|
+
observedFrom: rec.observedFrom,
|
|
159
|
+
asOf: rec.asOf,
|
|
160
|
+
retentionPolicyDays: rec.retentionPolicyDays,
|
|
161
|
+
...(typeof rec.reasonCode === "string" ? { reasonCode: rec.reasonCode } : {}),
|
|
162
|
+
...(typeof rec.nextActionCode === "string" ? { nextActionCode: rec.nextActionCode } : {}),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
139
165
|
const RECEIPT_KINDS = new Set(["rule_blocked", "auto_correct_applied", "self_reported", "prompt_injected"]);
|
|
140
166
|
function validateReceiptEvent(value) {
|
|
141
167
|
if (typeof value !== "object" || value === null)
|
|
@@ -164,6 +190,11 @@ function validatePrincipleReceipts(data) {
|
|
|
164
190
|
const rec = data;
|
|
165
191
|
if (typeof rec.principleId !== "string")
|
|
166
192
|
return null;
|
|
193
|
+
// PRI-590: coverage is a required field of the receipt contract — a missing
|
|
194
|
+
// or malformed block means server/client contract skew; reject loudly.
|
|
195
|
+
const coverage = validateReceiptCoverage(rec.coverage);
|
|
196
|
+
if (coverage === null)
|
|
197
|
+
return null;
|
|
167
198
|
const events = [];
|
|
168
199
|
if (Array.isArray(rec.events)) {
|
|
169
200
|
for (const item of rec.events) {
|
|
@@ -181,12 +212,16 @@ function validatePrincipleReceipts(data) {
|
|
|
181
212
|
presenceCount: typeof rec.presenceCount === "number" ? rec.presenceCount : 0,
|
|
182
213
|
lastEffectAt: typeof rec.lastEffectAt === "string" ? rec.lastEffectAt : null,
|
|
183
214
|
events,
|
|
215
|
+
coverage,
|
|
184
216
|
};
|
|
185
217
|
}
|
|
186
218
|
function validateReceiptCounts(data) {
|
|
187
219
|
if (typeof data !== "object" || data === null)
|
|
188
220
|
return null;
|
|
189
221
|
const rec = data;
|
|
222
|
+
const coverage = validateReceiptCoverage(rec.coverage);
|
|
223
|
+
if (coverage === null)
|
|
224
|
+
return null;
|
|
190
225
|
const counts = [];
|
|
191
226
|
if (Array.isArray(rec.counts)) {
|
|
192
227
|
for (const item of rec.counts) {
|
|
@@ -208,6 +243,7 @@ function validateReceiptCounts(data) {
|
|
|
208
243
|
reason: typeof rec.reason === "string" ? rec.reason : undefined,
|
|
209
244
|
nextAction: typeof rec.nextAction === "string" ? rec.nextAction : undefined,
|
|
210
245
|
counts,
|
|
246
|
+
coverage,
|
|
211
247
|
};
|
|
212
248
|
}
|
|
213
249
|
async function fetchPrincipleReceipts(principleId) {
|
|
@@ -305,6 +341,19 @@ async function updateDefaultRuntime(defaultRuntime) {
|
|
|
305
341
|
body: JSON.stringify({ defaultRuntime }),
|
|
306
342
|
}, validateDefaultRuntimeUpdate);
|
|
307
343
|
}
|
|
344
|
+
// ── Owner identity (ADR-0022 / PRI-578) ──────────────────────────────────────
|
|
345
|
+
export async function fetchOwnerIdentity() {
|
|
346
|
+
return request('/api/v1/owner-identity', undefined, validateOwnerIdentityView);
|
|
347
|
+
}
|
|
348
|
+
export async function registerOwnerIdentity(ownerId, credentialId) {
|
|
349
|
+
return request('/api/v1/owner-identity', {
|
|
350
|
+
method: 'POST',
|
|
351
|
+
body: JSON.stringify({ ownerId, credentialId }),
|
|
352
|
+
}, validateOwnerIdentityRegister);
|
|
353
|
+
}
|
|
354
|
+
export async function unregisterOwnerIdentity() {
|
|
355
|
+
return request('/api/v1/owner-identity', { method: 'DELETE' }, validateOwnerIdentityUnregister);
|
|
356
|
+
}
|
|
308
357
|
// ── Runtime Profile CRUD (POST/PATCH/DELETE /api/v1/config/profiles) ──────────
|
|
309
358
|
/**
|
|
310
359
|
* Create a new runtime profile.
|
|
@@ -382,13 +431,24 @@ async function updateOutputLanguage(outputLanguage) {
|
|
|
382
431
|
async function fetchGovernanceQueue() {
|
|
383
432
|
return request('/api/v1/governance/queue', undefined, validateGovernanceQueue);
|
|
384
433
|
}
|
|
434
|
+
// PRI-586: read-only governance experience snapshot. Only called when the
|
|
435
|
+
// governance_experience_v1 flag is enabled — flag-off the endpoint 403s and
|
|
436
|
+
// the Console keeps the legacy Focus experience (ERR-102: disabled ≠ unavailable).
|
|
437
|
+
async function fetchGovernanceExperience() {
|
|
438
|
+
return request('/api/v1/governance/experience', undefined, validateGovernanceExperienceSnapshot);
|
|
439
|
+
}
|
|
385
440
|
// Governance Recovery Actions v1: Owner-triggered recovery of a failed /
|
|
386
441
|
// needs_human_review internalization task (failed→pending | needs_human_review→pending).
|
|
387
|
-
|
|
442
|
+
// force=true recovers a task whose attempt budget is exhausted (core raises
|
|
443
|
+
// its maxAttempts); it only affects the failed path.
|
|
444
|
+
async function recoverFailedTask(taskId, reason, force) {
|
|
388
445
|
const body = {};
|
|
389
446
|
if (reason !== undefined && reason.length > 0) {
|
|
390
447
|
body.reason = reason;
|
|
391
448
|
}
|
|
449
|
+
if (force === true) {
|
|
450
|
+
body.force = true;
|
|
451
|
+
}
|
|
392
452
|
return request('/api/v1/failed-tasks/' + encodeURIComponent(taskId) + '/recover', {
|
|
393
453
|
method: 'POST',
|
|
394
454
|
body: JSON.stringify(body),
|
|
@@ -510,4 +570,4 @@ listActiveSignalKeywords, listPendingSignalTerms, fetchKeywordStore, fetchPendin
|
|
|
510
570
|
// auth
|
|
511
571
|
getToken, setToken, clearToken, checkAuth, approveApproval, rejectApproval, editApproval, fetchPrinciples, fetchPrincipleDetail, fetchPrincipleGovernance, fetchPrincipleTrajectory, fetchPrincipleReceipts, fetchReceiptCounts, archivePrinciple, unarchivePrinciple, createFeedbackReport, listFeedbackReports, getFeedbackReport, deleteFeedbackReport,
|
|
512
572
|
// Feedback submit ladder (Slice 3, spec §8)
|
|
513
|
-
fetchFeedbackChannels, submitFeedbackReport, markFeedbackReportSent, fetchConfigSummary, fetchConfigCatalog, updateAgentBinding, updateDefaultRuntime, createRuntimeProfile, updateRuntimeProfile, deleteRuntimeProfile, fetchAgentReadiness, patchFeatureFlag, fetchOutputLanguage, updateOutputLanguage, fetchWorkspaces, addWorkspace, removeWorkspace, syncWorkspace, fetchGovernanceQueue, recoverFailedTask, fetchApprovalsGrouped, fetchAllActivations, disableActivation, fetchRuleCodeOwnerReview, ruleCodeDecision, pauseAllRuleCode, releaseRuleCodePause, fetchLifecycleMetrics, fetchUpdateStatus, fetchUpdateHistory, applyUpdate, applyFullUpdate, rollbackUpdate, fetchEvidenceChain, fetchIntentSummary, fetchIntentContent, createIntentTemplate, saveIntentContent, fetchIntentVersions, recordIntentDecision, listIntentDecisionsByPainId, listIntentDecisionsByTaskId, fetchIntentDecisionSummary, dispatchFollowUp, };
|
|
573
|
+
fetchFeedbackChannels, submitFeedbackReport, markFeedbackReportSent, fetchConfigSummary, fetchConfigCatalog, updateAgentBinding, updateDefaultRuntime, createRuntimeProfile, updateRuntimeProfile, deleteRuntimeProfile, fetchAgentReadiness, patchFeatureFlag, fetchOutputLanguage, updateOutputLanguage, fetchWorkspaces, addWorkspace, removeWorkspace, syncWorkspace, fetchGovernanceQueue, fetchGovernanceExperience, recoverFailedTask, fetchApprovalsGrouped, fetchAllActivations, disableActivation, fetchRuleCodeOwnerReview, ruleCodeDecision, pauseAllRuleCode, releaseRuleCodePause, fetchLifecycleMetrics, fetchUpdateStatus, fetchUpdateHistory, applyUpdate, applyFullUpdate, rollbackUpdate, fetchEvidenceChain, fetchIntentSummary, fetchIntentContent, createIntentTemplate, saveIntentContent, fetchIntentVersions, recordIntentDecision, listIntentDecisionsByPainId, listIntentDecisionsByTaskId, fetchIntentDecisionSummary, dispatchFollowUp, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReceiptEvidenceCoverageData, ReceiptSourceStatusData } from "../../api.js";
|
|
2
|
+
/** Localized label key for a source status — shared by the degraded notes. */
|
|
3
|
+
export declare function getReceiptSourceStatusLabelKey(status: ReceiptSourceStatusData): string;
|
|
4
|
+
export declare function ReceiptCoverageDisclosure({ coverage }: {
|
|
5
|
+
coverage: ReceiptEvidenceCoverageData;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Receipt evidence coverage disclosure — PRI-590.
|
|
4
|
+
*
|
|
5
|
+
* Shared block that explains what receipt numbers MEAN: source status,
|
|
6
|
+
* observed range, retention policy, and the "observed evidence, not full
|
|
7
|
+
* history" limitation. Used by the PrincipleDetail receipt section and the
|
|
8
|
+
* Activation page counts context.
|
|
9
|
+
*
|
|
10
|
+
* Never displays file paths, digests, raw payloads, or tool arguments.
|
|
11
|
+
*
|
|
12
|
+
* Keys use full paths ("pages.principles.…") because this component binds
|
|
13
|
+
* useTranslation() to the default `common` namespace, which carries the
|
|
14
|
+
* whole locale tree — usable from pages that pick other namespaces.
|
|
15
|
+
*/
|
|
16
|
+
import { useTranslation } from "react-i18next";
|
|
17
|
+
import { formatDate } from "../../utils/format-date.js";
|
|
18
|
+
// ERR-106: exhaustive Records over the status unions — a binary ternary would
|
|
19
|
+
// fold one member into a default and misrepresent its state.
|
|
20
|
+
const SOURCE_STATUS_LABEL_KEYS = {
|
|
21
|
+
available: "pages.principles.detail.receipts.coverage.statusAvailable",
|
|
22
|
+
disabled: "pages.principles.detail.receipts.coverage.statusDisabled",
|
|
23
|
+
unavailable: "pages.principles.detail.receipts.coverage.statusUnavailable",
|
|
24
|
+
};
|
|
25
|
+
const SOURCE_STATUS_PILL_CLASS = {
|
|
26
|
+
available: "border-green/35 text-green bg-green/5",
|
|
27
|
+
disabled: "border-amber/35 text-amber bg-amber/5",
|
|
28
|
+
unavailable: "border-line text-ink-4 bg-surface/80",
|
|
29
|
+
};
|
|
30
|
+
const VALIDATION_NOTE_KEYS = {
|
|
31
|
+
valid: null,
|
|
32
|
+
partial: "pages.principles.detail.receipts.coverage.validationPartial",
|
|
33
|
+
malformed: "pages.principles.detail.receipts.coverage.validationMalformed",
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* reasonCode → localized phrase. Owner-facing copy must not leak snake_case
|
|
37
|
+
* technical codes (review round 2). A Map (not a plain object) because the
|
|
38
|
+
* lookup key comes from the API payload — no prototype-chain exposure
|
|
39
|
+
* (EP-01/ERR-013). Unknown codes fall back to the raw code — fail-visible
|
|
40
|
+
* rather than blank, so the debug clue survives.
|
|
41
|
+
*/
|
|
42
|
+
const REASON_CODE_LABEL_KEYS = new Map([
|
|
43
|
+
["receipt_rows_dropped", "pages.principles.detail.receipts.coverage.reasonCodes.receiptRowsDropped"],
|
|
44
|
+
["ledger_level_invalid", "pages.principles.detail.receipts.coverage.reasonCodes.ledgerLevelInvalid"],
|
|
45
|
+
["ledger_counts_unreadable", "pages.principles.detail.receipts.coverage.reasonCodes.ledgerCountsUnreadable"],
|
|
46
|
+
]);
|
|
47
|
+
/** Localized label key for a source status — shared by the degraded notes. */
|
|
48
|
+
export function getReceiptSourceStatusLabelKey(status) {
|
|
49
|
+
return SOURCE_STATUS_LABEL_KEYS[status];
|
|
50
|
+
}
|
|
51
|
+
export function ReceiptCoverageDisclosure({ coverage }) {
|
|
52
|
+
const { t, i18n } = useTranslation();
|
|
53
|
+
const validationNoteKey = VALIDATION_NOTE_KEYS[coverage.validationStatus];
|
|
54
|
+
// Known codes render as a localized phrase; unknown codes fall back to the
|
|
55
|
+
// raw code in parentheses (fail-visible debug clue, never a blank verdict).
|
|
56
|
+
let reasonSuffix = null;
|
|
57
|
+
if (coverage.reasonCode !== undefined) {
|
|
58
|
+
const labelKey = REASON_CODE_LABEL_KEYS.get(coverage.reasonCode);
|
|
59
|
+
reasonSuffix = labelKey !== undefined ? ` — ${t(labelKey)}` : ` (${coverage.reasonCode})`;
|
|
60
|
+
}
|
|
61
|
+
return (_jsxs("div", { "data-testid": "receipt-coverage", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "font-mono text-[11px] uppercase tracking-[0.08em] text-ink-4", children: t("pages.principles.detail.receipts.coverage.label") }), _jsx("span", { className: `inline-flex items-center border rounded-[2px] px-[7px] py-0.5 font-mono text-[11px] uppercase ${SOURCE_STATUS_PILL_CLASS[coverage.sourceStatus]}`, children: t(SOURCE_STATUS_LABEL_KEYS[coverage.sourceStatus]) })] }), _jsxs("p", { className: "mt-1.5 text-[11px] leading-relaxed text-ink-4", children: [coverage.observedFrom !== null
|
|
62
|
+
? t("pages.principles.detail.receipts.coverage.observedSince", {
|
|
63
|
+
date: formatDate(coverage.observedFrom, i18n.language),
|
|
64
|
+
})
|
|
65
|
+
: t("pages.principles.detail.receipts.coverage.observedSinceEmpty"), " · ", t("pages.principles.detail.receipts.coverage.asOf", { date: formatDate(coverage.asOf, i18n.language) }), " · ", t("pages.principles.detail.receipts.coverage.retention", { days: coverage.retentionPolicyDays })] }), _jsx("p", { className: "mt-1 text-[11px] leading-relaxed text-ink-4", children: t("pages.principles.detail.receipts.coverage.limitation") }), validationNoteKey !== null && (_jsxs("p", { "data-testid": "receipt-coverage-validation", className: "mt-1 text-[11px] leading-relaxed text-amber", children: [t(validationNoteKey), reasonSuffix] }))] }));
|
|
66
|
+
}
|