create-principles-disciple 1.94.0 → 1.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/console/dist/server/config/WorkspaceConfigStore.js +2 -1
- package/console/dist/server/config/pd-config-store.d.ts +33 -0
- package/console/dist/server/config/pd-config-store.js +196 -0
- package/console/dist/server/index.js +19 -4
- package/console/dist/server/models/EvidenceChainConsoleModel.d.ts +0 -2
- package/console/dist/server/models/EvidenceChainConsoleModel.js +36 -2
- package/console/dist/server/models/HealthCheckModel.js +5 -3
- package/console/dist/server/models/IntentDecisionModel.d.ts +66 -0
- package/console/dist/server/models/IntentDecisionModel.js +207 -0
- package/console/dist/server/models/IntentPageModel.d.ts +52 -0
- package/console/dist/server/models/IntentPageModel.js +292 -0
- package/console/dist/server/models/PrinciplesConsoleModel.d.ts +2 -0
- package/console/dist/server/models/PrinciplesConsoleModel.js +37 -1
- package/console/dist/server/models/WorkspaceService.d.ts +0 -28
- package/console/dist/server/models/WorkspaceService.js +0 -115
- package/console/dist/server/routes/config.js +55 -1
- package/console/dist/server/routes/intent-decisions.d.ts +33 -0
- package/console/dist/server/routes/intent-decisions.js +499 -0
- package/console/dist/server/routes/intent.d.ts +7 -0
- package/console/dist/server/routes/intent.js +223 -0
- package/console/dist/server/routes/principles.js +67 -1
- package/console/dist/server/routes/update.d.ts +0 -1
- package/console/dist/server/routes/update.js +14 -11
- package/console/dist/types.d.ts +1 -0
- package/console/dist/ui/App.js +2 -60
- package/console/dist/ui/api.d.ts +58 -18
- package/console/dist/ui/api.js +78 -6
- package/console/dist/ui/components/layout/app-sidebar.js +13 -12
- package/console/dist/ui/components/ui/badge.d.ts +1 -1
- package/console/dist/ui/components/ui/button.d.ts +1 -1
- package/console/dist/ui/components/ui/shiny-text.d.ts +28 -0
- package/console/dist/ui/components/ui/shiny-text.js +46 -0
- package/console/dist/ui/i18n/en.json +306 -3
- package/console/dist/ui/i18n/zh-CN.json +306 -3
- package/console/dist/ui/pages/activation/ActivationPage.js +2 -1
- package/console/dist/ui/pages/control-center/AgentCard.d.ts +31 -0
- package/console/dist/ui/pages/control-center/AgentCard.js +156 -0
- package/console/dist/ui/pages/control-center/AgentGroup.d.ts +26 -0
- package/console/dist/ui/pages/control-center/AgentGroup.js +38 -0
- package/console/dist/ui/pages/control-center/ControlCenterPage.js +103 -41
- package/console/dist/ui/pages/control-center/EmpathyObserverCostHint.d.ts +28 -0
- package/console/dist/ui/pages/control-center/EmpathyObserverCostHint.js +38 -0
- package/console/dist/ui/pages/control-center/WorkflowDiagram.d.ts +17 -0
- package/console/dist/ui/pages/control-center/WorkflowDiagram.js +55 -0
- package/console/dist/ui/pages/debt/DebtPage.js +219 -2
- package/console/dist/ui/pages/focus/FocusPage.js +2 -1
- package/console/dist/ui/pages/intent/IntentOnboarding.d.ts +67 -0
- package/console/dist/ui/pages/intent/IntentOnboarding.js +289 -0
- package/console/dist/ui/pages/intent/IntentPage.d.ts +1 -0
- package/console/dist/ui/pages/intent/IntentPage.js +258 -0
- package/console/dist/ui/pages/pain/PainPage.js +234 -4
- package/console/dist/ui/pages/pain/pain-card-helpers.d.ts +75 -0
- package/console/dist/ui/pages/pain/pain-card-helpers.js +78 -0
- package/console/dist/ui/pages/principles/PrinciplesPage.js +2 -1
- package/console/dist/ui/utils/agent-metadata.d.ts +58 -0
- package/console/dist/ui/utils/agent-metadata.js +275 -0
- package/console/dist/ui/utils/control-center-helpers.d.ts +19 -0
- package/console/dist/ui/utils/control-center-helpers.js +37 -0
- package/console/dist/ui/utils/validators.d.ts +200 -0
- package/console/dist/ui/utils/validators.js +563 -0
- package/console/dist/web/assets/app.css +498 -3
- package/console/dist/web/assets/app.js +5063 -1418
- package/console/package.json +3 -0
- package/core/dist/principle-tree-ledger.d.ts +55 -4
- package/core/dist/principle-tree-ledger.d.ts.map +1 -1
- package/core/dist/principle-tree-ledger.js +472 -13
- package/core/dist/principle-tree-ledger.js.map +1 -1
- package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.js +58 -0
- package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.js.map +1 -1
- package/core/dist/prompt-builder/empathy-keyword-matching.d.ts.map +1 -1
- package/core/dist/prompt-builder/empathy-keyword-matching.js +9 -6
- package/core/dist/prompt-builder/empathy-keyword-matching.js.map +1 -1
- package/core/dist/prompt-builder/size-guard.d.ts +1 -0
- package/core/dist/prompt-builder/size-guard.d.ts.map +1 -1
- package/core/dist/prompt-builder/size-guard.js +21 -0
- package/core/dist/prompt-builder/size-guard.js.map +1 -1
- package/core/dist/prompt-builder/types.d.ts +2 -0
- package/core/dist/prompt-builder/types.d.ts.map +1 -1
- package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +143 -65
- package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js +85 -7
- package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.js +284 -0
- package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.js +70 -0
- package/core/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/golden-trace.test.js +136 -1
- package/core/dist/runtime-v2/__tests__/golden-trace.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pain-signal-bridge-result-shaping.test.js +105 -0
- package/core/dist/runtime-v2/__tests__/pain-signal-bridge-result-shaping.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js +7 -5
- package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.js +11 -0
- package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js +15 -2
- package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/schema-float-precision.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/schema-float-precision.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/schema-float-precision.test.js +290 -0
- package/core/dist/runtime-v2/__tests__/schema-float-precision.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.js +158 -0
- package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.js +211 -0
- package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.js.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js +15 -1
- package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.d.ts +2 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.js +62 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.js.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js +12 -2
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.d.ts +2 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.js +56 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.js.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js +8 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/story-a-acceptance.test.js +20 -0
- package/core/dist/runtime-v2/activation/__tests__/story-a-acceptance.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js +6 -0
- package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-approval-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-approval-store.js +86 -32
- package/core/dist/runtime-v2/activation/sqlite-approval-store.js.map +1 -1
- package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js +158 -1
- package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts +11 -0
- package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/writers/rule-host-writer.js +55 -11
- package/core/dist/runtime-v2/activation/writers/rule-host-writer.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.js +134 -15
- package/core/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.d.ts +18 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.js +251 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.js.map +1 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.js +73 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts +98 -0
- package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.js +131 -0
- package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts +8 -0
- package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js +66 -3
- package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician-output.d.ts +23 -0
- package/core/dist/runtime-v2/diagnostician-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician-output.js +16 -0
- package/core/dist/runtime-v2/diagnostician-output.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts +32 -0
- package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/evidence-triage/source-descriptors.d.ts +1 -1
- package/core/dist/runtime-v2/evidence-triage/source-descriptors.js +1 -1
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +23 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.js +30 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.js +74 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.js +246 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.js.map +1 -0
- 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 +9 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/index.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/index.js +2 -0
- package/core/dist/runtime-v2/feature-flags/index.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.js +0 -9
- package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.js.map +1 -1
- package/{plugin/dist/core/surface-guard.d.ts → core/dist/runtime-v2/feature-flags/surface-guard-policy.d.ts} +15 -5
- package/core/dist/runtime-v2/feature-flags/surface-guard-policy.d.ts.map +1 -0
- package/{plugin/dist/core/surface-guard.js → core/dist/runtime-v2/feature-flags/surface-guard-policy.js} +14 -2
- package/core/dist/runtime-v2/feature-flags/surface-guard-policy.js.map +1 -0
- package/core/dist/runtime-v2/golden-trace-replay-validator.js +1 -1
- package/core/dist/runtime-v2/golden-trace-replay-validator.js.map +1 -1
- package/core/dist/runtime-v2/golden-trace.d.ts +19 -3
- package/core/dist/runtime-v2/golden-trace.d.ts.map +1 -1
- package/core/dist/runtime-v2/golden-trace.js +2 -0
- package/core/dist/runtime-v2/golden-trace.js.map +1 -1
- package/core/dist/runtime-v2/index.d.ts +21 -4
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +21 -3
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.d.ts +2 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.js +185 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.js.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.d.ts +2 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.js +88 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.js.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.d.ts +2 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.js +181 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.js.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.d.ts +2 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.js +168 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.js.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.d.ts +2 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.js +121 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.js.map +1 -0
- package/core/dist/runtime-v2/intent/index.d.ts +8 -0
- package/core/dist/runtime-v2/intent/index.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/index.js +8 -0
- package/core/dist/runtime-v2/intent/index.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-browser.d.ts +23 -0
- package/core/dist/runtime-v2/intent/intent-browser.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-browser.js +21 -0
- package/core/dist/runtime-v2/intent/intent-browser.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-decision-record.d.ts +125 -0
- package/core/dist/runtime-v2/intent/intent-decision-record.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-decision-record.js +21 -0
- package/core/dist/runtime-v2/intent/intent-decision-record.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc-reader-port.d.ts +95 -0
- package/core/dist/runtime-v2/intent/intent-doc-reader-port.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc-reader-port.js +43 -0
- package/core/dist/runtime-v2/intent/intent-doc-reader-port.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc-version.d.ts +28 -0
- package/core/dist/runtime-v2/intent/intent-doc-version.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc-version.js +21 -0
- package/core/dist/runtime-v2/intent/intent-doc-version.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc.d.ts +35 -0
- package/core/dist/runtime-v2/intent/intent-doc.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc.js +158 -0
- package/core/dist/runtime-v2/intent/intent-doc.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-friction-block.d.ts +63 -0
- package/core/dist/runtime-v2/intent/intent-friction-block.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-friction-block.js +129 -0
- package/core/dist/runtime-v2/intent/intent-friction-block.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-hash.d.ts +2 -0
- package/core/dist/runtime-v2/intent/intent-hash.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-hash.js +10 -0
- package/core/dist/runtime-v2/intent/intent-hash.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-patch-proposal.d.ts +42 -0
- package/core/dist/runtime-v2/intent/intent-patch-proposal.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-patch-proposal.js +81 -0
- package/core/dist/runtime-v2/intent/intent-patch-proposal.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.d.ts +54 -0
- package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.js +219 -0
- package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js +41 -1
- package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/artificer-rule-output.test.js +130 -2
- package/core/dist/runtime-v2/internalization/__tests__/artificer-rule-output.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.js +228 -0
- package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js +41 -11
- package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.js +360 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.js +333 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.js +113 -0
- package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js +135 -0
- package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.js +449 -0
- package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/adversarial-case.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/adversarial-case.js +24 -0
- package/core/dist/runtime-v2/internalization/adversarial-case.js.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-output.d.ts +10 -0
- package/core/dist/runtime-v2/internalization/artificer-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-output.js +45 -0
- package/core/dist/runtime-v2/internalization/artificer-output.js.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts +2 -2
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js +7 -2
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization/behavior-example-pack.d.ts +66 -0
- package/core/dist/runtime-v2/internalization/behavior-example-pack.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/behavior-example-pack.js +183 -0
- package/core/dist/runtime-v2/internalization/behavior-example-pack.js.map +1 -0
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts +13 -0
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js +42 -0
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-router-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-router-runner.js +27 -0
- package/core/dist/runtime-v2/internalization/diag-router-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-output.d.ts +8 -0
- package/core/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-output.js +10 -0
- package/core/dist/runtime-v2/internalization/evaluator-output.js.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts +17 -0
- package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-runner.js +118 -24
- package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js +1 -1
- package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js.map +1 -1
- package/core/dist/runtime-v2/internalization/rule-context-v2.d.ts +61 -0
- package/core/dist/runtime-v2/internalization/rule-context-v2.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/rule-context-v2.js +301 -0
- package/core/dist/runtime-v2/internalization/rule-context-v2.js.map +1 -0
- package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts +9 -0
- package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/v2-adversarial-cases.d.ts +55 -0
- package/core/dist/runtime-v2/internalization/v2-adversarial-cases.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/v2-adversarial-cases.js +131 -0
- package/core/dist/runtime-v2/internalization/v2-adversarial-cases.js.map +1 -0
- package/core/dist/runtime-v2/pain-signal-observability.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-observability.js +280 -56
- package/core/dist/runtime-v2/pain-signal-observability.js.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +12 -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 +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime-v2/pain-to-principle-service.d.ts +6 -0
- package/core/dist/runtime-v2/pain-to-principle-service.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-to-principle-service.js +2 -0
- package/core/dist/runtime-v2/pain-to-principle-service.js.map +1 -1
- package/core/dist/runtime-v2/principle-tree/ledger-codec.js.map +1 -1
- package/core/dist/runtime-v2/proven-channel-baseline.js +1 -1
- package/core/dist/runtime-v2/proven-channel-baseline.js.map +1 -1
- package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.d.ts +2 -0
- package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.js +95 -0
- package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.js.map +1 -0
- package/core/dist/runtime-v2/risk/index.d.ts +7 -0
- package/core/dist/runtime-v2/risk/index.d.ts.map +1 -0
- package/core/dist/runtime-v2/risk/index.js +6 -0
- package/core/dist/runtime-v2/risk/index.js.map +1 -0
- package/core/dist/runtime-v2/risk/risk-calculator-policy.d.ts +18 -0
- package/core/dist/runtime-v2/risk/risk-calculator-policy.d.ts.map +1 -0
- package/core/dist/runtime-v2/risk/risk-calculator-policy.js +47 -0
- package/core/dist/runtime-v2/risk/risk-calculator-policy.js.map +1 -0
- package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.d.ts +2 -0
- package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.js +55 -0
- package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.js.map +1 -0
- package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js +6 -0
- package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js.map +1 -1
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.d.ts +2 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.js +272 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.js.map +1 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.d.ts +2 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.js +83 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.js.map +1 -0
- package/core/dist/runtime-v2/store/intent/index.d.ts +7 -0
- package/core/dist/runtime-v2/store/intent/index.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/intent/index.js +6 -0
- package/core/dist/runtime-v2/store/intent/index.js.map +1 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.d.ts +51 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.js +306 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.js.map +1 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.d.ts +28 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.js +88 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.js.map +1 -0
- package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.js +14 -3
- package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.js.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.d.ts +2 -0
- package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.js +72 -0
- package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.js.map +1 -0
- package/core/dist/runtime-v2/store/sqlite-connection.d.ts +27 -0
- package/core/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-connection.js +138 -12
- package/core/dist/runtime-v2/store/sqlite-connection.js.map +1 -1
- package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.d.ts +2 -0
- package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.js +149 -0
- package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.js.map +1 -0
- package/core/dist/runtime-v2/thinking-models/index.d.ts +3 -0
- package/core/dist/runtime-v2/thinking-models/index.d.ts.map +1 -0
- package/core/dist/runtime-v2/thinking-models/index.js +3 -0
- package/core/dist/runtime-v2/thinking-models/index.js.map +1 -0
- package/core/dist/runtime-v2/thinking-models/thinking-models-policy.d.ts +73 -0
- package/core/dist/runtime-v2/thinking-models/thinking-models-policy.d.ts.map +1 -0
- package/core/dist/runtime-v2/thinking-models/thinking-models-policy.js +227 -0
- package/core/dist/runtime-v2/thinking-models/thinking-models-policy.js.map +1 -0
- package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js +40 -1
- package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js +28 -1
- package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js.map +1 -1
- package/core/dist/runtime-v2/tools/artificer-output-typebox.d.ts +3 -0
- package/core/dist/runtime-v2/tools/artificer-output-typebox.d.ts.map +1 -1
- package/core/dist/runtime-v2/tools/artificer-output-typebox.js +3 -0
- package/core/dist/runtime-v2/tools/artificer-output-typebox.js.map +1 -1
- package/core/dist/runtime-v2/types/event-payload.d.ts +1 -20
- package/core/dist/runtime-v2/types/event-payload.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/event-payload.js +0 -12
- package/core/dist/runtime-v2/types/event-payload.js.map +1 -1
- package/core/dist/runtime-v2/types/event-types.d.ts +5 -34
- package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/event-types.js +0 -19
- package/core/dist/runtime-v2/types/event-types.js.map +1 -1
- package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts +63 -0
- package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/evidence-chain-contract.js +234 -9
- package/core/dist/runtime-v2/types/evidence-chain-contract.js.map +1 -1
- package/core/dist/runtime-v2/types/index.d.ts +5 -5
- package/core/dist/runtime-v2/types/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/index.js +5 -3
- package/core/dist/runtime-v2/types/index.js.map +1 -1
- package/core/dist/runtime-v2/types/ledger-store.d.ts +30 -30
- package/core/dist/runtime-v2/types/ledger-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/ledger-store.js +10 -5
- package/core/dist/runtime-v2/types/ledger-store.js.map +1 -1
- package/core/dist/workflow-funnel-loader.d.ts +2 -2
- package/core/dist/workflow-funnel-loader.d.ts.map +1 -1
- package/core/package.json +4 -0
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +16 -0
- package/dist/installer.js.map +1 -1
- package/package.json +1 -1
- package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.d.ts +9 -0
- package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.d.ts.map +1 -0
- package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.js +237 -0
- package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.js.map +1 -0
- package/pd-cli/dist/commands/intent.d.ts +76 -0
- package/pd-cli/dist/commands/intent.d.ts.map +1 -0
- package/pd-cli/dist/commands/intent.js +411 -0
- package/pd-cli/dist/commands/intent.js.map +1 -0
- package/pd-cli/dist/commands/runtime-init.d.ts +43 -0
- package/pd-cli/dist/commands/runtime-init.d.ts.map +1 -0
- package/pd-cli/dist/commands/runtime-init.js +264 -0
- package/pd-cli/dist/commands/runtime-init.js.map +1 -0
- package/pd-cli/dist/index.js +25 -0
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.js +6 -0
- package/pd-cli/dist/services/demo-story-a-runner.js.map +1 -1
- package/pd-cli/package.json +1 -0
- package/plugin/dist/commands/pain.js +2 -0
- package/plugin/dist/core/behavior-example-pack-assembler.d.ts +43 -0
- package/plugin/dist/core/behavior-example-pack-assembler.js +247 -0
- package/plugin/dist/core/control-ui-db.d.ts +11 -0
- package/plugin/dist/core/control-ui-db.js +40 -16
- package/plugin/dist/core/event-log.js +0 -5
- package/plugin/dist/core/intent-doc-reader-adapter.d.ts +36 -0
- package/plugin/dist/core/intent-doc-reader-adapter.js +76 -0
- package/plugin/dist/core/intent-doc-reader.d.ts +89 -0
- package/plugin/dist/core/intent-doc-reader.js +210 -0
- package/plugin/dist/core/principle-tree-ledger.d.ts +27 -79
- package/plugin/dist/core/principle-tree-ledger.js +39 -524
- package/plugin/dist/core/reflection/reflection-context.d.ts +2 -2
- package/plugin/dist/core/rule-context-assembler.d.ts +45 -0
- package/plugin/dist/core/rule-context-assembler.js +148 -0
- package/plugin/dist/core/thinking-models.d.ts +12 -57
- package/plugin/dist/core/thinking-models.js +18 -224
- package/plugin/dist/core/trajectory-types.d.ts +18 -0
- package/plugin/dist/core/trajectory.d.ts +50 -2
- package/plugin/dist/core/trajectory.js +435 -254
- package/plugin/dist/core/workspace-context.d.ts +2 -3
- package/plugin/dist/hooks/gate.js +59 -2
- package/plugin/dist/hooks/pain.js +5 -0
- package/plugin/dist/hooks/prompt-helpers.d.ts +19 -1
- package/plugin/dist/hooks/prompt-helpers.js +39 -2
- package/plugin/dist/hooks/prompt-types.d.ts +8 -0
- package/plugin/dist/hooks/prompt.js +81 -21
- package/plugin/dist/index.d.ts +3 -1
- package/plugin/dist/index.js +10 -6
- package/plugin/dist/service/runtime-summary-service.js +1 -1
- package/plugin/dist/service/subagent-workflow/workflow-store.d.ts +14 -0
- package/plugin/dist/service/subagent-workflow/workflow-store.js +91 -2
- package/plugin/dist/types/event-types.d.ts +1 -1
- package/plugin/package.json +6 -3
- package/plugin/scripts/acceptance-test.mjs +3 -3
- package/plugin/dist/core/evolution-migration.d.ts +0 -5
- package/plugin/dist/core/evolution-migration.js +0 -65
- package/plugin/dist/core/principle-tree-ledger-adapter.d.ts +0 -32
- package/plugin/dist/core/principle-tree-ledger-adapter.js +0 -125
- package/plugin/dist/core/risk-calculator.d.ts +0 -22
- package/plugin/dist/core/risk-calculator.js +0 -88
- package/plugin/dist/core/rule-host-helpers.d.ts +0 -8
- package/plugin/dist/core/rule-host-helpers.js +0 -7
- package/plugin/dist/core/rule-host-types.d.ts +0 -7
- package/plugin/dist/core/rule-host-types.js +0 -7
- package/plugin/dist/core/schema/db-types.d.ts +0 -11
- package/plugin/dist/core/schema/db-types.js +0 -5
- package/plugin/dist/core/schema/index.d.ts +0 -17
- package/plugin/dist/core/schema/index.js +0 -15
- package/plugin/dist/core/schema/migration-runner.d.ts +0 -53
- package/plugin/dist/core/schema/migration-runner.js +0 -170
- package/plugin/dist/core/schema/migrations/001-init-trajectory.d.ts +0 -6
- package/plugin/dist/core/schema/migrations/001-init-trajectory.js +0 -190
- package/plugin/dist/core/schema/migrations/002-init-central.d.ts +0 -5
- package/plugin/dist/core/schema/migrations/002-init-central.js +0 -108
- package/plugin/dist/core/schema/migrations/003-init-workflow.d.ts +0 -5
- package/plugin/dist/core/schema/migrations/003-init-workflow.js +0 -50
- package/plugin/dist/core/schema/migrations/004-add-thinking-and-gfi.d.ts +0 -8
- package/plugin/dist/core/schema/migrations/004-add-thinking-and-gfi.js +0 -66
- package/plugin/dist/core/schema/migrations/index.d.ts +0 -16
- package/plugin/dist/core/schema/migrations/index.js +0 -27
- package/plugin/dist/core/schema/schema-definitions.d.ts +0 -46
- package/plugin/dist/core/schema/schema-definitions.js +0 -599
- package/plugin/dist/service/central-database.d.ts +0 -138
- package/plugin/dist/service/central-database.js +0 -731
- package/plugin/dist/service/central-sync-service.d.ts +0 -8
- package/plugin/dist/service/central-sync-service.js +0 -71
- package/plugin/scripts/db-migrate.mjs +0 -170
- package/plugin/scripts/validate-live-path.ts +0 -462
|
@@ -23,6 +23,8 @@ const REQUIRED_SOURCE_FILES = [
|
|
|
23
23
|
'internalization/rule-host-contracts.ts',
|
|
24
24
|
'internalization/rule-host-helpers.ts',
|
|
25
25
|
'internalization/index.ts',
|
|
26
|
+
// PRI-480 (RuleContext v2 — Phase 1 Core ABI)
|
|
27
|
+
'internalization/rule-context-v2.ts',
|
|
26
28
|
// PRI-43
|
|
27
29
|
'internalization/internalization-route.ts',
|
|
28
30
|
// PRI-44
|
|
@@ -98,6 +100,8 @@ const REQUIRED_SOURCE_FILES = [
|
|
|
98
100
|
// RuleHost MVP Activation (PRI-421..428, ADR-0014 Amendment 2026-06-17)
|
|
99
101
|
'internalization/adversarial-case.ts',
|
|
100
102
|
'internalization/adversarial-feedback.ts',
|
|
103
|
+
// PRI-485 Phase 6: v2 adversarial case generator (pure logic)
|
|
104
|
+
'internalization/v2-adversarial-cases.ts',
|
|
101
105
|
'internalization/artificer-prompt-builder.ts',
|
|
102
106
|
'adversarial-loop.ts',
|
|
103
107
|
// Phase 2 migration: evolution types
|
|
@@ -201,6 +205,10 @@ const REQUIRED_SOURCE_FILES = [
|
|
|
201
205
|
'pain-gate/index.ts',
|
|
202
206
|
'detection/detection-funnel-policy.ts',
|
|
203
207
|
'detection/index.ts',
|
|
208
|
+
// PRI-470: IntentDecisionRecord durable store + types (SPEC §21.7)
|
|
209
|
+
'intent/intent-decision-record.ts',
|
|
210
|
+
'store/intent/sqlite-intent-decision-store.ts',
|
|
211
|
+
'store/intent/index.ts',
|
|
204
212
|
];
|
|
205
213
|
// ── PRI-212: Plugin core anti-growth guard ────────────────────────────────────
|
|
206
214
|
//
|
|
@@ -278,6 +286,16 @@ const KNOWN_PLUGIN_CORE_FILES = new Set([
|
|
|
278
286
|
'schema/migrations/001-init-trajectory.ts',
|
|
279
287
|
// ── I/O Boundary ────────────────────────────────────────────────────────
|
|
280
288
|
'trajectory.ts',
|
|
289
|
+
// PRI-482: Plugin I/O boundary — converts raw TrajectoryDatabase rows into
|
|
290
|
+
// validated RuleHistoryWindow. Pure logic (canonicalize, validate, facts)
|
|
291
|
+
// delegated to @principles/core. Assembler stays in plugin because it
|
|
292
|
+
// consumes DB row shapes (I/O data).
|
|
293
|
+
'rule-context-assembler.ts',
|
|
294
|
+
// PRI-484: Plugin I/O boundary — assembles a BehaviorExamplePack for the
|
|
295
|
+
// Artificer by reading pain lineage + trajectory from TrajectoryDatabase.
|
|
296
|
+
// Pure logic (type + validator) lives in @principles/core; this module
|
|
297
|
+
// owns the DB row → pack mapping and fail-loud validation.
|
|
298
|
+
'behavior-example-pack-assembler.ts',
|
|
281
299
|
'evolution-reducer.ts',
|
|
282
300
|
'focus-history.ts',
|
|
283
301
|
'training-program.ts',
|
|
@@ -302,25 +320,33 @@ const KNOWN_PLUGIN_CORE_FILES = new Set([
|
|
|
302
320
|
// with crypto.createHash + PainDictionary. Kept here because it owns the
|
|
303
321
|
// crypto + dictionary I/O boundary.
|
|
304
322
|
'detection-funnel.ts',
|
|
305
|
-
'risk-calculator.ts',
|
|
306
323
|
'migration.ts',
|
|
307
324
|
'file-store.ts',
|
|
308
325
|
'pd-task-store.ts',
|
|
309
|
-
'evolution-migration.ts',
|
|
310
326
|
'empathy-keyword-matcher.ts',
|
|
311
327
|
'pain-lifecycle.ts',
|
|
312
328
|
'session-tracker.ts',
|
|
329
|
+
// PRI-459: now a thin re-export adapter over @principles/core/principle-tree-ledger.
|
|
330
|
+
// Kept in the plugin baseline so existing relative imports (./principle-tree-ledger.js)
|
|
331
|
+
// still resolve. No parsing/serialization/mutation logic may live here — enforced by
|
|
332
|
+
// tests/ledger-schema-diff.test.ts.
|
|
313
333
|
'principle-tree-ledger.ts',
|
|
314
334
|
'evolution-logger.ts',
|
|
315
335
|
'evolution-engine.ts',
|
|
316
336
|
// ── Runtime V2 ──────────────────────────────────────────────────────────
|
|
317
337
|
'runtime-v2-prompt-activation-reader.ts',
|
|
318
338
|
'workspace-guidance-migrator.ts',
|
|
319
|
-
'surface-guard.ts',
|
|
320
339
|
// PRI-307: Plugin I/O boundary — reads .pd/config.yaml, delegates validation to core
|
|
321
340
|
'pd-config-loader.ts',
|
|
322
341
|
// PRI-346: Pure function for checking conversation access config (extracted for circular import avoidance)
|
|
323
342
|
'config-health.ts',
|
|
343
|
+
// PRI-467: Plugin I/O boundary — reads .principles/INTENT.md with TTL+mtime cache,
|
|
344
|
+
// delegates parsing/validation/hashing to @principles/core. Never throws.
|
|
345
|
+
'intent-doc-reader.ts',
|
|
346
|
+
// PRI-468: Plugin adapter implementing core IntentDocReader port — pure type
|
|
347
|
+
// mapping from safeReadIntentDoc result to the core-owned IntentDocReadResult.
|
|
348
|
+
// No new I/O; delegates to intent-doc-reader.ts above.
|
|
349
|
+
'intent-doc-reader-adapter.ts',
|
|
324
350
|
// ── Test Files ──────────────────────────────────────────────────────────
|
|
325
351
|
'__tests__/focus-history.test.ts',
|
|
326
352
|
'principle-compiler/__tests__/compiler-replay-gate.test.ts',
|
|
@@ -362,7 +388,7 @@ describe('PRI-212 plugin core anti-growth guard', () => {
|
|
|
362
388
|
expect.fail(msg);
|
|
363
389
|
}
|
|
364
390
|
});
|
|
365
|
-
it('known baseline count is self-consistent (
|
|
391
|
+
it('known baseline count is self-consistent (92 files)', async () => {
|
|
366
392
|
// Sanity check: if the baseline grows, update this number.
|
|
367
393
|
// Prevents accidental baseline bloat from going unnoticed.
|
|
368
394
|
// See docs/reviews/plugin-core-inventory-2026-05.md §7
|
|
@@ -376,7 +402,22 @@ describe('PRI-212 plugin core anti-growth guard', () => {
|
|
|
376
402
|
// PRI-446: pain-diagnostic-gate.ts and detection-funnel.ts remain at 92 —
|
|
377
403
|
// they are now thin adapters delegating pure logic to core, but still live
|
|
378
404
|
// in plugin src/core/ and own I/O side effects, so they stay classified.
|
|
379
|
-
|
|
405
|
+
// PRI-467: Added intent-doc-reader.ts (92 → 93) — plugin I/O boundary for
|
|
406
|
+
// reading .principles/INTENT.md with TTL+mtime cache for prompt injection.
|
|
407
|
+
// PRI-468: Added intent-doc-reader-adapter.ts (93 → 94) — plugin adapter
|
|
408
|
+
// implementing core IntentDocReader port (pure type mapping, no new I/O).
|
|
409
|
+
// Stage-1 cleanup: Removed evolution-migration.ts (94 → 93) — dead code,
|
|
410
|
+
// zero production references after refactor to @principles/core.
|
|
411
|
+
// PRI-482: Added rule-context-assembler.ts (93 → 94) — plugin I/O boundary
|
|
412
|
+
// converting TrajectoryDatabase rows to validated RuleHistoryWindow.
|
|
413
|
+
// Stage-3: Removed risk-calculator.ts (94 → 93) — pure logic sunk to
|
|
414
|
+
// core runtime-v2/risk/, dead code (assessRiskLevel/getTargetFileLineCount/
|
|
415
|
+
// calculatePercentageThreshold) removed.
|
|
416
|
+
// Stage-3 sink: Removed surface-guard.ts (93 → 92) — pure guard logic
|
|
417
|
+
// migrated to @principles/core/runtime-v2/feature-flags/surface-guard-policy.
|
|
418
|
+
// PRI-484: Added behavior-example-pack-assembler.ts (92 → 93) — plugin I/O
|
|
419
|
+
// boundary assembling BehaviorExamplePack from pain lineage + trajectory.
|
|
420
|
+
expect(KNOWN_PLUGIN_CORE_FILES.size).toBe(93);
|
|
380
421
|
});
|
|
381
422
|
});
|
|
382
423
|
const REQUIRED_TEST_FILES = [
|
|
@@ -456,6 +497,11 @@ const REQUIRED_TEST_FILES = [
|
|
|
456
497
|
'../internalization/__tests__/diag-chain-e2e.test.ts',
|
|
457
498
|
// PRI-431
|
|
458
499
|
'build-l2-principle-reader.test.ts',
|
|
500
|
+
// PRI-469
|
|
501
|
+
'evidence-chain-intent-tension.test.ts',
|
|
502
|
+
// PRI-470: IntentDecisionRecord types + SQLite store
|
|
503
|
+
'../intent/__tests__/intent-decision-record.test.ts',
|
|
504
|
+
'../store/intent/__tests__/sqlite-intent-decision-store.test.ts',
|
|
459
505
|
];
|
|
460
506
|
const REQUIRED_DOC_FILES = [];
|
|
461
507
|
for (const file of REQUIRED_SOURCE_FILES) {
|
|
@@ -521,6 +567,8 @@ describe('runtime-v2 public API (index.ts barrel)', () => {
|
|
|
521
567
|
'buildL2PrincipleReaderFromLedger',
|
|
522
568
|
// LLM output hardening — shared utility
|
|
523
569
|
'stripFabricatedCorePrincipleIds',
|
|
570
|
+
// PRI-470: IntentDecisionRecord durable SQLite store
|
|
571
|
+
'SqliteIntentDecisionStore',
|
|
524
572
|
];
|
|
525
573
|
for (const name of REQUIRED_EXPORTS) {
|
|
526
574
|
it(`exports ${name}`, async () => {
|
|
@@ -581,13 +629,6 @@ describe('openclaw-plugin pain hook integration', () => {
|
|
|
581
629
|
});
|
|
582
630
|
// ── PRI-42: Internalization boundary guards ──────────────────────────────────
|
|
583
631
|
describe('PRI-42 internalization boundary', () => {
|
|
584
|
-
const CONTRACT_TYPES = [
|
|
585
|
-
'RuleHostInput',
|
|
586
|
-
'RuleHostResult',
|
|
587
|
-
'RuleHostDecision',
|
|
588
|
-
'RuleHostMeta',
|
|
589
|
-
'LoadedImplementation',
|
|
590
|
-
];
|
|
591
632
|
it('core internalization has zero openclaw-plugin imports', async () => {
|
|
592
633
|
const { existsSync, readdirSync, readFileSync } = await import('node:fs');
|
|
593
634
|
const { resolve, join } = await import('node:path');
|
|
@@ -636,29 +677,6 @@ describe('PRI-42 internalization boundary', () => {
|
|
|
636
677
|
expect(src).not.toContain('../../../openclaw-plugin');
|
|
637
678
|
}
|
|
638
679
|
});
|
|
639
|
-
it('plugin does not re-define RuleHost contract types locally', async () => {
|
|
640
|
-
const { existsSync, readFileSync } = await import('node:fs');
|
|
641
|
-
const { resolve } = await import('node:path');
|
|
642
|
-
const typesPath = resolve(__dirname, '../../../../openclaw-plugin/src/core/rule-host-types.ts');
|
|
643
|
-
expect(existsSync(typesPath)).toBe(true);
|
|
644
|
-
const src = readFileSync(typesPath, 'utf-8');
|
|
645
|
-
// After PRI-42, rule-host-types.ts should re-export from core, not define interfaces
|
|
646
|
-
for (const typeName of CONTRACT_TYPES) {
|
|
647
|
-
expect(src).toContain(typeName);
|
|
648
|
-
expect(src).toContain("from '@principles/core/runtime-v2'");
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
it('plugin does not re-define RuleHostHelpers locally', async () => {
|
|
652
|
-
const { existsSync, readFileSync } = await import('node:fs');
|
|
653
|
-
const { resolve } = await import('node:path');
|
|
654
|
-
const helpersPath = resolve(__dirname, '../../../../openclaw-plugin/src/core/rule-host-helpers.ts');
|
|
655
|
-
expect(existsSync(helpersPath)).toBe(true);
|
|
656
|
-
const src = readFileSync(helpersPath, 'utf-8');
|
|
657
|
-
// After PRI-42, rule-host-helpers.ts should re-export from core, not define interface
|
|
658
|
-
expect(src).toContain('RuleHostHelpers');
|
|
659
|
-
expect(src).toContain('createRuleHostHelpers');
|
|
660
|
-
expect(src).toContain("from '@principles/core/runtime-v2'");
|
|
661
|
-
});
|
|
662
680
|
it('plugin rule-host.ts imports contracts from core barrel', async () => {
|
|
663
681
|
const { existsSync, readFileSync } = await import('node:fs');
|
|
664
682
|
const { resolve } = await import('node:path');
|
|
@@ -3192,33 +3210,31 @@ describe('PRI-443: pure module boundary guards', () => {
|
|
|
3192
3210
|
expect(src).not.toMatch(/export\s+type\s+\{\s*LedgerTreeStore\s*\}\s*from\s*['"]\.\.\/principle-tree-ledger\.js['"]/);
|
|
3193
3211
|
});
|
|
3194
3212
|
});
|
|
3195
|
-
|
|
3196
|
-
//
|
|
3197
|
-
//
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
//
|
|
3203
|
-
//
|
|
3204
|
-
|
|
3205
|
-
'
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
'runtime-v2/schema-conformance-read-model.ts',
|
|
3221
|
-
]);
|
|
3213
|
+
describe('PRI-450 / PRI-462: core I/O seam registry guard', () => {
|
|
3214
|
+
// Registry lives at packages/principles-core/io-seam-registry.json
|
|
3215
|
+
// (3 levels up from __tests__: __tests__ → runtime-v2 → src → principles-core)
|
|
3216
|
+
const registryPath = pathSync.resolve(__dirname, '..', '..', '..', 'io-seam-registry.json');
|
|
3217
|
+
const registryRaw = fsSync.readFileSync(registryPath, 'utf-8');
|
|
3218
|
+
const registry = JSON.parse(registryRaw);
|
|
3219
|
+
// Runtime-validate the registry shape (Runtime Contract Rule 1+2: treat
|
|
3220
|
+
// parsed JSON as unknown, validate with typeof/Array.isArray before access).
|
|
3221
|
+
// `as` is used only for type narrowing AFTER runtime checks, not to bypass them.
|
|
3222
|
+
function isValidRegistry(v) {
|
|
3223
|
+
if (typeof v !== 'object' || v === null || !Object.hasOwn(v, 'seams'))
|
|
3224
|
+
return false;
|
|
3225
|
+
const { seams } = v;
|
|
3226
|
+
if (!Array.isArray(seams))
|
|
3227
|
+
return false;
|
|
3228
|
+
return seams.every((s) => typeof s === 'object' && s !== null &&
|
|
3229
|
+
typeof s.name === 'string' &&
|
|
3230
|
+
typeof s.description === 'string' &&
|
|
3231
|
+
Array.isArray(s.files) &&
|
|
3232
|
+
s.files.every((f) => typeof f === 'string'));
|
|
3233
|
+
}
|
|
3234
|
+
// Flatten all registry files into a Set (relative to packages/principles-core/src/).
|
|
3235
|
+
const ALLOWED_IO_FILES = new Set(isValidRegistry(registry)
|
|
3236
|
+
? registry.seams.flatMap((s) => s.files)
|
|
3237
|
+
: []);
|
|
3222
3238
|
// Extract all import module paths from source code.
|
|
3223
3239
|
// Handles: import ... from 'mod', import 'mod' (side-effect), and multiline imports.
|
|
3224
3240
|
// Reuses the same pattern proven in the PRI-215 extractImportModulePaths helper.
|
|
@@ -3257,7 +3273,52 @@ describe('PRI-450: core I/O whitelist guard', () => {
|
|
|
3257
3273
|
}
|
|
3258
3274
|
}
|
|
3259
3275
|
}
|
|
3260
|
-
|
|
3276
|
+
// ── Registry validity (PRI-462) ───────────────────────────────────────────
|
|
3277
|
+
it('io-seam-registry.json is valid: seams array with name/description/files', () => {
|
|
3278
|
+
expect(isValidRegistry(registry)).toBe(true);
|
|
3279
|
+
if (!isValidRegistry(registry))
|
|
3280
|
+
return; // type narrowing
|
|
3281
|
+
expect(registry.seams.length).toBeGreaterThan(0);
|
|
3282
|
+
for (const seam of registry.seams) {
|
|
3283
|
+
expect(seam.name.length).toBeGreaterThan(0);
|
|
3284
|
+
expect(seam.description.length).toBeGreaterThan(0);
|
|
3285
|
+
expect(seam.files.length).toBeGreaterThan(0);
|
|
3286
|
+
}
|
|
3287
|
+
});
|
|
3288
|
+
it('registry has no duplicate files across seams', () => {
|
|
3289
|
+
if (!isValidRegistry(registry)) {
|
|
3290
|
+
// isValidRegistry test above will fail with details; skip here.
|
|
3291
|
+
expect(isValidRegistry(registry)).toBe(true);
|
|
3292
|
+
return;
|
|
3293
|
+
}
|
|
3294
|
+
const seen = new Set();
|
|
3295
|
+
const dupes = [];
|
|
3296
|
+
for (const seam of registry.seams) {
|
|
3297
|
+
for (const f of seam.files) {
|
|
3298
|
+
if (seen.has(f))
|
|
3299
|
+
dupes.push(f);
|
|
3300
|
+
seen.add(f);
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
expect(dupes).toEqual([]);
|
|
3304
|
+
});
|
|
3305
|
+
it('every seam description explains why the I/O is allowed (non-trivial)', () => {
|
|
3306
|
+
if (!isValidRegistry(registry)) {
|
|
3307
|
+
expect(isValidRegistry(registry)).toBe(true);
|
|
3308
|
+
return;
|
|
3309
|
+
}
|
|
3310
|
+
const weak = [];
|
|
3311
|
+
for (const seam of registry.seams) {
|
|
3312
|
+
// Description must be at least 20 chars — a single word like "legacy" is
|
|
3313
|
+
// not an explanation. This forces maintainers to write a real rationale.
|
|
3314
|
+
if (seam.description.trim().length < 20) {
|
|
3315
|
+
weak.push(`${seam.name}: "${seam.description}"`);
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
expect(weak).toEqual([]);
|
|
3319
|
+
});
|
|
3320
|
+
// ── Registry ↔ production files (PRI-450, EP-02) ──────────────────────────
|
|
3321
|
+
it('core/src/ production files: only registry-listed files import fs/path', () => {
|
|
3261
3322
|
const coreSrcDir = pathSync.resolve(__dirname, '..', '..');
|
|
3262
3323
|
const allFiles = [];
|
|
3263
3324
|
collectTsFiles(coreSrcDir, allFiles);
|
|
@@ -3271,9 +3332,13 @@ describe('PRI-450: core I/O whitelist guard', () => {
|
|
|
3271
3332
|
}
|
|
3272
3333
|
}
|
|
3273
3334
|
}
|
|
3274
|
-
|
|
3335
|
+
if (violations.length > 0) {
|
|
3336
|
+
throw new Error(`Found ${violations.length} file(s) importing fs/path that are NOT in io-seam-registry.json.\n` +
|
|
3337
|
+
`Add them to the appropriate seam in packages/principles-core/io-seam-registry.json.\n` +
|
|
3338
|
+
`Violations:\n ` + violations.join('\n '));
|
|
3339
|
+
}
|
|
3275
3340
|
});
|
|
3276
|
-
it('
|
|
3341
|
+
it('registry-listed files all exist on disk', () => {
|
|
3277
3342
|
const coreSrcDir = pathSync.resolve(__dirname, '..', '..');
|
|
3278
3343
|
const missing = [];
|
|
3279
3344
|
for (const relPath of ALLOWED_IO_FILES) {
|
|
@@ -3284,6 +3349,19 @@ describe('PRI-450: core I/O whitelist guard', () => {
|
|
|
3284
3349
|
}
|
|
3285
3350
|
expect(missing).toEqual([]);
|
|
3286
3351
|
});
|
|
3352
|
+
// ── Registry ↔ ESLint exemption (PRI-462, EP-06 single source of truth) ───
|
|
3353
|
+
//
|
|
3354
|
+
// ESLint's no-restricted-imports exemption list must be DERIVED from the
|
|
3355
|
+
// registry, not hand-maintained. This test verifies eslint.config.js
|
|
3356
|
+
// references the registry file, proving the two stay in sync.
|
|
3357
|
+
it('eslint.config.js derives fs/path exemption from the registry (no shadow list)', () => {
|
|
3358
|
+
const eslintPath = pathSync.resolve(__dirname, '..', '..', '..', '..', '..', 'eslint.config.js');
|
|
3359
|
+
const eslintSrc = fsSync.readFileSync(eslintPath, 'utf-8');
|
|
3360
|
+
// The eslint config must read the registry JSON — if this reference is
|
|
3361
|
+
// removed, someone has reintroduced a hand-maintained shadow list.
|
|
3362
|
+
expect(eslintSrc).toContain('io-seam-registry.json');
|
|
3363
|
+
});
|
|
3364
|
+
// ── Helper unit tests ─────────────────────────────────────────────────────
|
|
3287
3365
|
it('importsFsOrPath detects sub-path imports (fs/promises) and side-effect imports', () => {
|
|
3288
3366
|
// Sub-path import
|
|
3289
3367
|
expect(importsFsOrPath(`import { mkdir } from 'node:fs/promises';`)).toBe(true);
|