create-principles-disciple 1.104.0 → 1.104.2
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 +2 -2
- package/console/dist/server/config/pd-config-store.d.ts +8 -1
- package/console/dist/server/config/pd-config-store.js +50 -0
- package/console/dist/server/index.js +24 -3
- package/console/dist/server/models/HealthCheckModel.d.ts +27 -0
- package/console/dist/server/models/HealthCheckModel.js +56 -0
- package/console/dist/server/routes/failed-tasks.d.ts +24 -0
- package/console/dist/server/routes/failed-tasks.js +207 -0
- package/console/dist/server/routes/feedback-reports.d.ts +1 -0
- package/console/dist/server/routes/feedback-reports.js +29 -2
- package/console/dist/server/routes/lifecycle.js +19 -1
- package/console/dist/server/routes/onboarding.js +2 -2
- package/console/dist/server/routes/update.js +307 -35
- package/console/dist/server/utils/gateway.d.ts +25 -0
- package/console/dist/server/utils/gateway.js +131 -0
- package/console/dist/ui/App.d.ts +1 -1
- package/console/dist/ui/App.js +2 -1
- package/console/dist/ui/api.d.ts +2 -1
- package/console/dist/ui/api.js +14 -2
- package/console/dist/ui/components/auth/login-form.d.ts +2 -1
- package/console/dist/ui/components/auth/splash-screen.d.ts +2 -1
- package/console/dist/ui/components/error-boundary.d.ts +1 -1
- package/console/dist/ui/components/focus/daily-thought-card.d.ts +1 -1
- package/console/dist/ui/components/language-switcher.d.ts +2 -1
- package/console/dist/ui/components/layout/app-sidebar.d.ts +6 -1
- package/console/dist/ui/components/layout/app-sidebar.js +10 -2
- package/console/dist/ui/components/layout/page-loading.d.ts +1 -1
- package/console/dist/ui/components/layout/page-shell.d.ts +1 -1
- package/console/dist/ui/components/layout/section-title.d.ts +1 -1
- package/console/dist/ui/components/notifications/NotificationProvider.d.ts +1 -1
- package/console/dist/ui/components/onboarding/CircuitDiagram.d.ts +1 -1
- package/console/dist/ui/components/onboarding/DemoResultView.d.ts +1 -1
- package/console/dist/ui/components/onboarding/SlashCommandsCard.d.ts +16 -0
- package/console/dist/ui/components/onboarding/SlashCommandsCard.js +20 -0
- package/console/dist/ui/components/onboarding/slashCommands.d.ts +20 -0
- package/console/dist/ui/components/onboarding/slashCommands.js +23 -0
- package/console/dist/ui/components/theme-provider.d.ts +1 -1
- package/console/dist/ui/components/theme-toggle.d.ts +2 -1
- package/console/dist/ui/components/ui/alert-dialog.d.ts +8 -8
- package/console/dist/ui/components/ui/badge.d.ts +2 -2
- package/console/dist/ui/components/ui/button.d.ts +2 -2
- package/console/dist/ui/components/ui/charts.d.ts +5 -5
- package/console/dist/ui/components/ui/dialog.d.ts +8 -8
- package/console/dist/ui/components/ui/markdown.d.ts +4 -4
- package/console/dist/ui/components/ui/progress-bar.d.ts +2 -2
- package/console/dist/ui/components/ui/sheet.d.ts +9 -9
- package/console/dist/ui/components/ui/shiny-text.d.ts +1 -1
- package/console/dist/ui/components/ui/skeleton.d.ts +1 -1
- package/console/dist/ui/components/ui/sonner.d.ts +1 -1
- package/console/dist/ui/i18n/en.json +52 -7
- package/console/dist/ui/i18n/zh-CN.json +52 -7
- package/console/dist/ui/pages/ReportProblemValidators.d.ts +63 -0
- package/console/dist/ui/pages/ReportProblemValidators.js +238 -0
- package/console/dist/ui/pages/activation/ActivationPage.d.ts +1 -1
- package/console/dist/ui/pages/activation/ActivationPage.js +1 -1
- package/console/dist/ui/pages/control-center/AgentCard.d.ts +1 -1
- package/console/dist/ui/pages/control-center/AgentCard.js +1 -1
- package/console/dist/ui/pages/control-center/AgentGroup.d.ts +1 -1
- package/console/dist/ui/pages/control-center/ControlCenterPage.d.ts +1 -1
- package/console/dist/ui/pages/control-center/ControlCenterPage.js +1 -1
- package/console/dist/ui/pages/control-center/EmpathyObserverCostHint.d.ts +1 -1
- package/console/dist/ui/pages/control-center/RuntimeProfileManager.d.ts +1 -1
- package/console/dist/ui/pages/control-center/RuntimeProfileManager.js +1 -1
- package/console/dist/ui/pages/control-center/WorkflowDiagram.d.ts +1 -1
- package/console/dist/ui/pages/debt/DebtPage.d.ts +2 -1
- package/console/dist/ui/pages/debt/DebtPage.js +1 -1
- package/console/dist/ui/pages/design-system/DesignSystemPage.d.ts +2 -1
- package/console/dist/ui/pages/failed-tasks/FailedTasksPage.d.ts +1 -0
- package/console/dist/ui/pages/failed-tasks/FailedTasksPage.js +229 -0
- package/console/dist/ui/pages/focus/FocusPage.d.ts +1 -1
- package/console/dist/ui/pages/focus/FocusPage.js +2 -2
- package/console/dist/ui/pages/intent/IntentOnboarding.d.ts +4 -4
- package/console/dist/ui/pages/intent/IntentOnboarding.js +1 -1
- package/console/dist/ui/pages/intent/IntentPage.d.ts +1 -1
- package/console/dist/ui/pages/intent/IntentPage.js +1 -1
- package/console/dist/ui/pages/pain/PainPage.d.ts +1 -1
- package/console/dist/ui/pages/pain/PainPage.js +1 -1
- package/console/dist/ui/pages/principles/PrincipleDetailPage.d.ts +1 -1
- package/console/dist/ui/pages/principles/PrincipleDetailPage.js +1 -1
- package/console/dist/ui/pages/principles/PrinciplesPage.d.ts +1 -1
- package/console/dist/ui/pages/report-problem/ReportProblemPage.d.ts +1 -1
- package/console/dist/ui/pages/report-problem/ReportProblemPage.js +36 -9
- package/console/dist/ui/pages/settings/SettingsPage.d.ts +1 -1
- package/console/dist/ui/pages/settings/SettingsPage.js +1 -1
- package/console/dist/ui/pages/settings/UpdatePage.d.ts +1 -1
- package/console/dist/ui/pages/settings/UpdatePage.js +35 -3
- package/console/dist/ui/pages/signal-keywords/KeywordEditDialog.d.ts +1 -1
- package/console/dist/ui/pages/signal-keywords/KeywordListSection.d.ts +1 -1
- package/console/dist/ui/pages/signal-keywords/PendingTermsSection.d.ts +1 -1
- package/console/dist/ui/pages/signal-keywords/SignalKeywordsPage.d.ts +1 -1
- package/console/dist/ui/pages/welcome/WelcomePage.d.ts +1 -1
- package/console/dist/ui/pages/welcome/WelcomePage.js +7 -5
- package/console/dist/ui/utils/agent-metadata.js +9 -9
- package/console/dist/ui/utils/validators.d.ts +14 -2
- package/console/dist/ui/utils/validators.js +18 -1
- package/console/dist/web/assets/app.css +428 -716
- package/console/dist/web/assets/app.js +1574 -877
- package/console/package.json +14 -14
- package/core/dist/adapters/__tests__/code-review-pain-adapter.test.d.ts +2 -0
- package/core/dist/adapters/__tests__/code-review-pain-adapter.test.d.ts.map +1 -0
- package/core/dist/adapters/__tests__/code-review-pain-adapter.test.js +346 -0
- package/core/dist/adapters/__tests__/code-review-pain-adapter.test.js.map +1 -0
- package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.d.ts +2 -0
- package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.d.ts.map +1 -0
- package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.js +290 -0
- package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.js.map +1 -0
- package/core/dist/adapters/__tests__/writing-pain-adapter.test.d.ts +2 -0
- package/core/dist/adapters/__tests__/writing-pain-adapter.test.d.ts.map +1 -0
- package/core/dist/adapters/__tests__/writing-pain-adapter.test.js +239 -0
- package/core/dist/adapters/__tests__/writing-pain-adapter.test.js.map +1 -0
- package/core/dist/adapters/code-review/code-review-pain-adapter.d.ts.map +1 -1
- package/core/dist/adapters/coding/openclaw-pain-adapter.d.ts.map +1 -1
- package/core/dist/adapters/writing/writing-pain-adapter.d.ts.map +1 -1
- package/core/dist/evolution-store.js.map +1 -1
- package/core/dist/evolution-store.test.d.ts +2 -0
- package/core/dist/evolution-store.test.d.ts.map +1 -0
- package/core/dist/evolution-store.test.js +291 -0
- package/core/dist/evolution-store.test.js.map +1 -0
- package/core/dist/host/__tests__/host-adapter.test.d.ts +2 -0
- package/core/dist/host/__tests__/host-adapter.test.d.ts.map +1 -0
- package/core/dist/host/__tests__/host-adapter.test.js +96 -0
- package/core/dist/host/__tests__/host-adapter.test.js.map +1 -0
- package/core/dist/host/host-adapter.d.ts +185 -0
- package/core/dist/host/host-adapter.d.ts.map +1 -0
- package/core/dist/host/host-adapter.js +81 -0
- package/core/dist/host/host-adapter.js.map +1 -0
- package/core/dist/host/host-installer.d.ts +165 -0
- package/core/dist/host/host-installer.d.ts.map +1 -0
- package/core/dist/host/host-installer.js +55 -0
- package/core/dist/host/host-installer.js.map +1 -0
- package/core/dist/host/index.d.ts +14 -0
- package/core/dist/host/index.d.ts.map +1 -0
- package/core/dist/host/index.js +3 -0
- package/core/dist/host/index.js.map +1 -0
- package/core/dist/index.d.ts +2 -0
- package/core/dist/index.d.ts.map +1 -1
- package/core/dist/index.js +1 -0
- package/core/dist/index.js.map +1 -1
- package/core/dist/principle-injector.d.ts.map +1 -1
- package/core/dist/principle-injector.test.d.ts +2 -0
- package/core/dist/principle-injector.test.d.ts.map +1 -0
- package/core/dist/principle-injector.test.js +158 -0
- package/core/dist/principle-injector.test.js.map +1 -0
- package/core/dist/principle-tree-ledger-lifecycle.test.d.ts +2 -0
- package/core/dist/principle-tree-ledger-lifecycle.test.d.ts.map +1 -0
- package/core/dist/principle-tree-ledger-lifecycle.test.js +530 -0
- package/core/dist/principle-tree-ledger-lifecycle.test.js.map +1 -0
- package/core/dist/principle-tree-ledger.d.ts.map +1 -1
- package/core/dist/principle-tree-ledger.js +55 -30
- package/core/dist/principle-tree-ledger.js.map +1 -1
- package/core/dist/prompt-builder/__tests__/attitude-directive.test.d.ts +2 -0
- package/core/dist/prompt-builder/__tests__/attitude-directive.test.d.ts.map +1 -0
- package/core/dist/prompt-builder/__tests__/attitude-directive.test.js +49 -0
- package/core/dist/prompt-builder/__tests__/attitude-directive.test.js.map +1 -0
- package/core/dist/prompt-builder/__tests__/correction-cue.test.d.ts +2 -0
- package/core/dist/prompt-builder/__tests__/correction-cue.test.d.ts.map +1 -0
- package/core/dist/prompt-builder/__tests__/correction-cue.test.js +61 -0
- package/core/dist/prompt-builder/__tests__/correction-cue.test.js.map +1 -0
- package/core/dist/prompt-builder/__tests__/message-extraction.test.d.ts +2 -0
- package/core/dist/prompt-builder/__tests__/message-extraction.test.d.ts.map +1 -0
- package/core/dist/prompt-builder/__tests__/message-extraction.test.js +90 -0
- package/core/dist/prompt-builder/__tests__/message-extraction.test.js.map +1 -0
- package/core/dist/prompt-builder/__tests__/minimal-trigger.test.d.ts +2 -0
- package/core/dist/prompt-builder/__tests__/minimal-trigger.test.d.ts.map +1 -0
- package/core/dist/prompt-builder/__tests__/minimal-trigger.test.js +45 -0
- package/core/dist/prompt-builder/__tests__/minimal-trigger.test.js.map +1 -0
- package/core/dist/prompt-builder/__tests__/principle-selection.test.js.map +1 -1
- package/core/dist/prompt-builder/empathy-keyword-matching.js.map +1 -1
- package/core/dist/prompt-builder/empathy-types.js.map +1 -1
- package/core/dist/prompt-builder/focus-compression.js.map +1 -1
- package/core/dist/prompt-builder/routing-guidance.d.ts +3 -3
- package/core/dist/prompt-builder/routing-guidance.d.ts.map +1 -1
- package/core/dist/prompt-builder/routing-guidance.js.map +1 -1
- package/core/dist/quality-scorecard/__tests__/quality-scorecard.test.js +399 -1
- package/core/dist/quality-scorecard/__tests__/quality-scorecard.test.js.map +1 -1
- package/core/dist/quality-scorecard/__tests__/report-generator.test.d.ts +2 -0
- package/core/dist/quality-scorecard/__tests__/report-generator.test.d.ts.map +1 -0
- package/core/dist/quality-scorecard/__tests__/report-generator.test.js +627 -0
- package/core/dist/quality-scorecard/__tests__/report-generator.test.js.map +1 -0
- package/core/dist/quality-scorecard/types.d.ts +1 -1
- package/core/dist/quality-scorecard/types.d.ts.map +1 -1
- package/core/dist/runtime-v2/__tests__/admission-gate.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/adversarial-loop.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +317 -6
- package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/artificer-runner-vslice.test.js +839 -0
- package/core/dist/runtime-v2/__tests__/artificer-runner-vslice.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/bridge-result-shaper.test.d.ts +26 -0
- package/core/dist/runtime-v2/__tests__/bridge-result-shaper.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/bridge-result-shaper.test.js +402 -0
- package/core/dist/runtime-v2/__tests__/bridge-result-shaper.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/build-golden-trace-from-artificer.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/context-payload-validation.test.d.ts +11 -0
- package/core/dist/runtime-v2/__tests__/context-payload-validation.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/context-payload-validation.test.js +309 -0
- package/core/dist/runtime-v2/__tests__/context-payload-validation.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/diagnostician-output-schema.test.d.ts +25 -0
- package/core/dist/runtime-v2/__tests__/diagnostician-output-schema.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/diagnostician-output-schema.test.js +405 -0
- package/core/dist/runtime-v2/__tests__/diagnostician-output-schema.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/dreamer-runner.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/error-categories.test.js +1 -0
- package/core/dist/runtime-v2/__tests__/error-categories.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/evaluator-repair-loop.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/evaluator-repair-loop.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/evaluator-repair-loop.test.js +562 -0
- package/core/dist/runtime-v2/__tests__/evaluator-repair-loop.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/feedback/create-report.test.js +51 -0
- package/core/dist/runtime-v2/__tests__/feedback/create-report.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/feedback/privacy-preview.test.js +1 -1
- package/core/dist/runtime-v2/__tests__/feedback/privacy-preview.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/feedback/render-markdown.test.js +1 -1
- package/core/dist/runtime-v2/__tests__/feedback/render-markdown.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/fixtures/test-helpers.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/golden-trace-candidate-builder.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/internalization-consumer-product-path.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/internalization-contracts.test.js +1 -1
- package/core/dist/runtime-v2/__tests__/internalization-contracts.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/internalization-route.test.js +1 -1
- package/core/dist/runtime-v2/__tests__/internalization-route.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/internalization-state-machine.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/l1-hard-cap.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/operator-health-cold-start-guard.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pain-signal-bridge-result-shaping.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pain-signal-runtime-factory-edge-cases.test.d.ts +8 -0
- package/core/dist/runtime-v2/__tests__/pain-signal-runtime-factory-edge-cases.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/pain-signal-runtime-factory-edge-cases.test.js +168 -0
- package/core/dist/runtime-v2/__tests__/pain-signal-runtime-factory-edge-cases.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.js +13 -2
- package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pitask-metadata.test.js +150 -0
- package/core/dist/runtime-v2/__tests__/pitask-metadata.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pruning-mask.test.d.ts +25 -0
- package/core/dist/runtime-v2/__tests__/pruning-mask.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/pruning-mask.test.js +281 -0
- package/core/dist/runtime-v2/__tests__/pruning-mask.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/resolve-runtime-config-from-pd-config.test.js +8 -8
- package/core/dist/runtime-v2/__tests__/resolve-runtime-config-from-pd-config.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/schema-version.test.d.ts +19 -0
- package/core/dist/runtime-v2/__tests__/schema-version.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/schema-version.test.js +176 -0
- package/core/dist/runtime-v2/__tests__/schema-version.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/scribe-runner-vslice.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/story-a-demo.test.js +20 -5
- package/core/dist/runtime-v2/__tests__/story-a-demo.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/task-state-semantics.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/task-three-strikes.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/workflow-funnel-loader.test.d.ts +29 -0
- package/core/dist/runtime-v2/__tests__/workflow-funnel-loader.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/workflow-funnel-loader.test.js +431 -0
- package/core/dist/runtime-v2/__tests__/workflow-funnel-loader.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/workspace-leak-guard.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/workspace-leak-guard.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/workspace-leak-guard.test.js +110 -0
- package/core/dist/runtime-v2/__tests__/workspace-leak-guard.test.js.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js +109 -0
- package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/activation-re-dispatch.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/approval-completion-service.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/helpers.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/prompt-activation-reader-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/activation-dispatcher.d.ts +11 -0
- package/core/dist/runtime-v2/activation/activation-dispatcher.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/activation-dispatcher.js +60 -6
- package/core/dist/runtime-v2/activation/activation-dispatcher.js.map +1 -1
- package/core/dist/runtime-v2/activation/activation-types.d.ts +4 -0
- package/core/dist/runtime-v2/activation/activation-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/approval-completion-service.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/approval-completion-service.js.map +1 -1
- package/core/dist/runtime-v2/activation/approval-queue.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/approval-queue.js.map +1 -1
- package/core/dist/runtime-v2/activation/low-risk-writers.d.ts +2 -2
- package/core/dist/runtime-v2/activation/low-risk-writers.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/memory-activation-state-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/memory-approval-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/prompt-activation-reader-contract.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.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.map +1 -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 +1 -1
- package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.js +13 -3
- package/core/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/l2-agent-loop-adapter.test.js +3 -2
- package/core/dist/runtime-v2/adapter/__tests__/l2-agent-loop-adapter.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter-message-file.test.d.ts +19 -0
- package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter-message-file.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter-message-file.test.js +188 -0
- package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter-message-file.test.js.map +1 -0
- package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.js +102 -9
- package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js +51 -23
- package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/principle-tree-ledger-adapter.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/artificer-l2-adapter.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/artificer-l2-adapter.js +2 -1
- package/core/dist/runtime-v2/adapter/artificer-l2-adapter.js.map +1 -1
- package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts +1 -1
- 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 +2 -2
- package/core/dist/runtime-v2/adapter/l2-agent-loop-adapter.js.map +1 -1
- package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js +42 -16
- package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js.map +1 -1
- package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts +1 -1
- package/core/dist/runtime-v2/adapter/output-repair-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/output-schema-registry.d.ts +36 -0
- package/core/dist/runtime-v2/adapter/output-schema-registry.d.ts.map +1 -0
- package/core/dist/runtime-v2/adapter/output-schema-registry.js +44 -0
- package/core/dist/runtime-v2/adapter/output-schema-registry.js.map +1 -0
- package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +17 -0
- 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 +61 -33
- package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
- package/core/dist/runtime-v2/adapter/principle-tree-ledger-adapter.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/schema-prompt-adapter.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/structured-output-repair.js.map +1 -1
- package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.js +1 -1
- package/core/dist/runtime-v2/adapter/test-double-runtime-adapter.js.map +1 -1
- package/core/dist/runtime-v2/admission-gate.js.map +1 -1
- package/core/dist/runtime-v2/agent-spec.d.ts +10 -10
- package/core/dist/runtime-v2/agent-spec.d.ts.map +1 -1
- package/core/dist/runtime-v2/candidate-intake-service.d.ts.map +1 -1
- package/core/dist/runtime-v2/candidate-intake.d.ts +5 -5
- package/core/dist/runtime-v2/candidate-intake.d.ts.map +1 -1
- package/core/dist/runtime-v2/candidate-intake.js.map +1 -1
- package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js +29 -1
- 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-context-injection.test.d.ts +2 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-context-injection.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-context-injection.test.js +308 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-context-injection.test.js.map +1 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js +5 -4
- package/core/dist/runtime-v2/config/__tests__/pd-config-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/config/__tests__/pd-config-validation-edge-cases.test.js +44 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-validation-edge-cases.test.js.map +1 -1
- package/core/dist/runtime-v2/config/index.d.ts +1 -1
- package/core/dist/runtime-v2/config/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/index.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts +2 -0
- 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 +16 -0
- package/core/dist/runtime-v2/config/pd-config-agent-binding.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-defaults.d.ts +2 -2
- package/core/dist/runtime-v2/config/pd-config-defaults.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-defaults.js +5 -15
- package/core/dist/runtime-v2/config/pd-config-defaults.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.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-feature-flags.d.ts +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-types.d.ts +25 -10
- package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
- 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 +9 -0
- package/core/dist/runtime-v2/config/pd-config-validate.js.map +1 -1
- package/core/dist/runtime-v2/context-payload.d.ts +8 -8
- package/core/dist/runtime-v2/core-principles/core-axiom-block.js.map +1 -1
- package/core/dist/runtime-v2/detection/__tests__/detection-funnel-policy.test.js.map +1 -1
- package/core/dist/runtime-v2/detection/detection-funnel-policy.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician/__tests__/diag-distiller-output.test.js +46 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/diag-distiller-output.test.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/diag-distiller-output.d.ts +2 -0
- package/core/dist/runtime-v2/diagnostician/diag-distiller-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician/diag-distiller-output.js +29 -2
- package/core/dist/runtime-v2/diagnostician/diag-distiller-output.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician/distiller-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician/distiller-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/router-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician/router-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician-output.js +7 -1
- package/core/dist/runtime-v2/diagnostician-output.js.map +1 -1
- package/core/dist/runtime-v2/error-categories.d.ts +2 -2
- package/core/dist/runtime-v2/error-categories.d.ts.map +1 -1
- package/core/dist/runtime-v2/error-categories.js +4 -1
- package/core/dist/runtime-v2/error-categories.js.map +1 -1
- package/core/dist/runtime-v2/evidence-triage/__tests__/admission-events.test.js.map +1 -1
- package/core/dist/runtime-v2/evidence-triage/__tests__/observation-resolver.test.js.map +1 -1
- package/core/dist/runtime-v2/evidence-triage/__tests__/triage-policy.test.js.map +1 -1
- package/core/dist/runtime-v2/evidence-triage/trigger-controller.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.d.ts +15 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.js +90 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/context-manifest-budget-flag.test.d.ts +12 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/context-manifest-budget-flag.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/context-manifest-budget-flag.test.js +114 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/context-manifest-budget-flag.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +66 -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__/progressive-evaluator-flag.test.d.ts +8 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/progressive-evaluator-flag.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/progressive-evaluator-flag.test.js +56 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/progressive-evaluator-flag.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts +1 -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 +56 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/surface-guard-policy.js.map +1 -1
- package/core/dist/runtime-v2/feedback/__tests__/create-report-agent-draft.test.d.ts +2 -0
- package/core/dist/runtime-v2/feedback/__tests__/create-report-agent-draft.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feedback/__tests__/create-report-agent-draft.test.js +221 -0
- package/core/dist/runtime-v2/feedback/__tests__/create-report-agent-draft.test.js.map +1 -0
- package/core/dist/runtime-v2/feedback/__tests__/mailto-url.test.d.ts +11 -0
- package/core/dist/runtime-v2/feedback/__tests__/mailto-url.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feedback/__tests__/mailto-url.test.js +160 -0
- package/core/dist/runtime-v2/feedback/__tests__/mailto-url.test.js.map +1 -0
- package/core/dist/runtime-v2/feedback/__tests__/pending-agent-draft-store.test.d.ts +2 -0
- package/core/dist/runtime-v2/feedback/__tests__/pending-agent-draft-store.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feedback/__tests__/pending-agent-draft-store.test.js +342 -0
- package/core/dist/runtime-v2/feedback/__tests__/pending-agent-draft-store.test.js.map +1 -0
- package/core/dist/runtime-v2/feedback/create-report.d.ts +7 -1
- package/core/dist/runtime-v2/feedback/create-report.d.ts.map +1 -1
- package/core/dist/runtime-v2/feedback/create-report.js +65 -7
- package/core/dist/runtime-v2/feedback/create-report.js.map +1 -1
- package/core/dist/runtime-v2/feedback/feedback-types.d.ts +18 -1
- package/core/dist/runtime-v2/feedback/feedback-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/feedback/feedback-types.js +19 -12
- package/core/dist/runtime-v2/feedback/feedback-types.js.map +1 -1
- package/core/dist/runtime-v2/feedback/index.d.ts +3 -1
- package/core/dist/runtime-v2/feedback/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/feedback/index.js +7 -1
- package/core/dist/runtime-v2/feedback/index.js.map +1 -1
- package/core/dist/runtime-v2/feedback/pending-agent-draft-store.d.ts +106 -0
- package/core/dist/runtime-v2/feedback/pending-agent-draft-store.d.ts.map +1 -0
- package/core/dist/runtime-v2/feedback/pending-agent-draft-store.js +220 -0
- package/core/dist/runtime-v2/feedback/pending-agent-draft-store.js.map +1 -0
- package/core/dist/runtime-v2/feedback/privacy-preview.d.ts +16 -0
- package/core/dist/runtime-v2/feedback/privacy-preview.d.ts.map +1 -1
- package/core/dist/runtime-v2/feedback/privacy-preview.js +54 -0
- package/core/dist/runtime-v2/feedback/privacy-preview.js.map +1 -1
- package/core/dist/runtime-v2/feedback/redact-sensitive.js.map +1 -1
- package/core/dist/runtime-v2/feedback/render-markdown.js.map +1 -1
- package/core/dist/runtime-v2/full-trace-contract.d.ts +8 -8
- package/core/dist/runtime-v2/full-trace-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/gfi/__tests__/gfi-kernel.test.js.map +1 -1
- package/core/dist/runtime-v2/gfi/__tests__/gfi-read-model.test.js.map +1 -1
- package/core/dist/runtime-v2/gfi/gfi-kernel.js.map +1 -1
- package/core/dist/runtime-v2/golden-trace.js.map +1 -1
- package/core/dist/runtime-v2/index.d.ts +11 -2
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +13 -1
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.js.map +1 -1
- package/core/dist/runtime-v2/intent/intent-doc-reader-port.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/adversarial-case.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/adversarial-feedback.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.d.ts +11 -0
- package/core/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.js +124 -0
- package/core/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.d.ts +12 -0
- package/core/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.js +253 -0
- package/core/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js +175 -0
- package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/c2-live-runner-chain.test.js +32 -5
- package/core/dist/runtime-v2/internalization/__tests__/c2-live-runner-chain.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.d.ts +15 -0
- package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.js +301 -0
- package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/context-manifest.property.test.d.ts +12 -0
- package/core/dist/runtime-v2/internalization/__tests__/context-manifest.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/context-manifest.property.test.js +176 -0
- package/core/dist/runtime-v2/internalization/__tests__/context-manifest.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/diag-distiller-runner.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-runner.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/diag-router-runner.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/internalization-consumer-decision.test.js +27 -1
- package/core/dist/runtime-v2/internalization/__tests__/internalization-consumer-decision.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/philosopher-runner-trust-boundary.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.js +279 -0
- package/core/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.d.ts +22 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.js +92 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.d.ts +165 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.js +659 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.d.ts +22 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.js +229 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.js +1039 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator-stage-isolation.property.test.d.ts +13 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator-stage-isolation.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator-stage-isolation.property.test.js +257 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator-stage-isolation.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator.property.test.d.ts +11 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator.property.test.js +154 -0
- package/core/dist/runtime-v2/internalization/__tests__/progressive-evaluator.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/prompt-budget-manager.property.test.d.ts +12 -0
- package/core/dist/runtime-v2/internalization/__tests__/prompt-budget-manager.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/prompt-budget-manager.property.test.js +254 -0
- package/core/dist/runtime-v2/internalization/__tests__/prompt-budget-manager.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/queue-actionability.test.js +14 -5
- package/core/dist/runtime-v2/internalization/__tests__/queue-actionability.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/refiner-rulehost-gate.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/resolve-injection.property.test.d.ts +15 -0
- package/core/dist/runtime-v2/internalization/__tests__/resolve-injection.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/resolve-injection.property.test.js +150 -0
- package/core/dist/runtime-v2/internalization/__tests__/resolve-injection.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/rule-code-dialect.test.js +29 -0
- package/core/dist/runtime-v2/internalization/__tests__/rule-code-dialect.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/split-diagnostician-runner-retry.test.js +173 -0
- package/core/dist/runtime-v2/internalization/__tests__/split-diagnostician-runner-retry.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.d.ts +22 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.js +280 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.d.ts +25 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.js +413 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.d.ts +12 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.js +176 -0
- package/core/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/artifact-content-hash.d.ts +19 -0
- package/core/dist/runtime-v2/internalization/artifact-content-hash.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/artifact-content-hash.js +116 -0
- package/core/dist/runtime-v2/internalization/artifact-content-hash.js.map +1 -0
- package/core/dist/runtime-v2/internalization/artifact-summary.d.ts +106 -0
- package/core/dist/runtime-v2/internalization/artifact-summary.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/artifact-summary.js +331 -0
- package/core/dist/runtime-v2/internalization/artifact-summary.js.map +1 -0
- package/core/dist/runtime-v2/internalization/artificer-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts +42 -1
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js +22 -3
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-runner.d.ts +22 -0
- package/core/dist/runtime-v2/internalization/artificer-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-runner.js +229 -3
- package/core/dist/runtime-v2/internalization/artificer-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/attach-summary-envelope.d.ts +60 -0
- package/core/dist/runtime-v2/internalization/attach-summary-envelope.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/attach-summary-envelope.js +126 -0
- package/core/dist/runtime-v2/internalization/attach-summary-envelope.js.map +1 -0
- package/core/dist/runtime-v2/internalization/candidate-lineage.d.ts +136 -0
- package/core/dist/runtime-v2/internalization/candidate-lineage.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/candidate-lineage.js +230 -0
- package/core/dist/runtime-v2/internalization/candidate-lineage.js.map +1 -0
- package/core/dist/runtime-v2/internalization/context-manifest.d.ts +117 -0
- package/core/dist/runtime-v2/internalization/context-manifest.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/context-manifest.js +156 -0
- package/core/dist/runtime-v2/internalization/context-manifest.js.map +1 -0
- package/core/dist/runtime-v2/internalization/context-manifests.d.ts +74 -0
- package/core/dist/runtime-v2/internalization/context-manifests.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/context-manifests.js +192 -0
- package/core/dist/runtime-v2/internalization/context-manifests.js.map +1 -0
- package/core/dist/runtime-v2/internalization/correction-proposal.js.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-distiller-runner.d.ts +1 -1
- package/core/dist/runtime-v2/internalization/diag-distiller-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-distiller-runner.js +23 -2
- package/core/dist/runtime-v2/internalization/diag-distiller-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js +9 -1
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-router-runner.d.ts +7 -2
- package/core/dist/runtime-v2/internalization/diag-router-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-router-runner.js +28 -1
- package/core/dist/runtime-v2/internalization/diag-router-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/dimension-coverage-policy.d.ts +54 -0
- package/core/dist/runtime-v2/internalization/dimension-coverage-policy.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/dimension-coverage-policy.js +70 -0
- package/core/dist/runtime-v2/internalization/dimension-coverage-policy.js.map +1 -0
- package/core/dist/runtime-v2/internalization/dreamer-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/dreamer-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization/dreamer-runner.d.ts +9 -1
- package/core/dist/runtime-v2/internalization/dreamer-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/dreamer-runner.js +41 -7
- package/core/dist/runtime-v2/internalization/dreamer-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-output.d.ts +27 -1
- package/core/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-output.js +7 -1
- package/core/dist/runtime-v2/internalization/evaluator-output.js.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js +12 -0
- package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts +115 -1
- package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-runner.js +384 -5
- package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/index.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/index.js +2 -0
- package/core/dist/runtime-v2/internalization/index.js.map +1 -1
- package/core/dist/runtime-v2/internalization/internalization-consumer-decision.d.ts +24 -0
- package/core/dist/runtime-v2/internalization/internalization-consumer-decision.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/internalization-consumer-decision.js +25 -2
- package/core/dist/runtime-v2/internalization/internalization-consumer-decision.js.map +1 -1
- package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts +1 -1
- package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/internalization-orchestrator.js +44 -1
- package/core/dist/runtime-v2/internalization/internalization-orchestrator.js.map +1 -1
- package/core/dist/runtime-v2/internalization/internalization-task-guards.js.map +1 -1
- package/core/dist/runtime-v2/internalization/lifecycle-read-model.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts +3 -0
- package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/peer-runner-contracts.js.map +1 -1
- package/core/dist/runtime-v2/internalization/philosopher-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/philosopher-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization/philosopher-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/philosopher-runner.js +25 -1
- package/core/dist/runtime-v2/internalization/philosopher-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/pi-artifact-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts +35 -1
- package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/pitask-metadata.js +64 -0
- package/core/dist/runtime-v2/internalization/pitask-metadata.js.map +1 -1
- package/core/dist/runtime-v2/internalization/progressive-evaluator.d.ts +115 -0
- package/core/dist/runtime-v2/internalization/progressive-evaluator.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/progressive-evaluator.js +248 -0
- package/core/dist/runtime-v2/internalization/progressive-evaluator.js.map +1 -0
- package/core/dist/runtime-v2/internalization/prompt-budget-manager.d.ts +90 -0
- package/core/dist/runtime-v2/internalization/prompt-budget-manager.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/prompt-budget-manager.js +149 -0
- package/core/dist/runtime-v2/internalization/prompt-budget-manager.js.map +1 -0
- package/core/dist/runtime-v2/internalization/queue-actionability.d.ts +11 -0
- package/core/dist/runtime-v2/internalization/queue-actionability.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/queue-actionability.js +12 -0
- package/core/dist/runtime-v2/internalization/queue-actionability.js.map +1 -1
- package/core/dist/runtime-v2/internalization/resolve-injection.d.ts +62 -0
- package/core/dist/runtime-v2/internalization/resolve-injection.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/resolve-injection.js +78 -0
- package/core/dist/runtime-v2/internalization/resolve-injection.js.map +1 -0
- package/core/dist/runtime-v2/internalization/rollout-reviewer-output.d.ts +1 -1
- package/core/dist/runtime-v2/internalization/rollout-reviewer-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/rollout-reviewer-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/routing-policy.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/rule-code-validator.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/rule-code-validator.js +7 -1
- package/core/dist/runtime-v2/internalization/rule-code-validator.js.map +1 -1
- package/core/dist/runtime-v2/internalization/rule-host-input-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-runner.js +33 -1
- package/core/dist/runtime-v2/internalization/scribe-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/split-diagnostician-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/split-diagnostician-runner.js +75 -13
- package/core/dist/runtime-v2/internalization/split-diagnostician-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/summary-field-reader.d.ts +38 -0
- package/core/dist/runtime-v2/internalization/summary-field-reader.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/summary-field-reader.js +108 -0
- package/core/dist/runtime-v2/internalization/summary-field-reader.js.map +1 -0
- package/core/dist/runtime-v2/internalization-chain-integrity-read-model.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization-integrity-remediation.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization-queue-read-model.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization-queue-read-model.js.map +1 -1
- package/core/dist/runtime-v2/language-directive.d.ts +1 -1
- package/core/dist/runtime-v2/language-directive.d.ts.map +1 -1
- package/core/dist/runtime-v2/language-directive.js.map +1 -1
- package/core/dist/runtime-v2/mainline-contract.js.map +1 -1
- package/core/dist/runtime-v2/observer/agent-scheduler.d.ts.map +1 -1
- package/core/dist/runtime-v2/observer/correction-observer.d.ts.map +1 -1
- package/core/dist/runtime-v2/observer/empathy-observer.d.ts.map +1 -1
- package/core/dist/runtime-v2/operator-health-read-model.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-chain-read-model.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-gate/__tests__/pain-diagnostic-gate-policy.test.js.map +1 -1
- package/core/dist/runtime-v2/pain-gate/pain-diagnostic-gate-policy.d.ts +1 -1
- package/core/dist/runtime-v2/pain-gate/pain-diagnostic-gate-policy.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +4 -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 +3 -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 +2 -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/proven-channel-baseline.js +1 -1
- package/core/dist/runtime-v2/proven-channel-baseline.js.map +1 -1
- package/core/dist/runtime-v2/pruning-read-model.d.ts.map +1 -1
- package/core/dist/runtime-v2/recovery-sweep-service.js.map +1 -1
- package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-agent-draft.test.d.ts +2 -0
- package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-agent-draft.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-agent-draft.test.js +459 -0
- package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-agent-draft.test.js.map +1 -0
- package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-rate-limit-degradation.test.d.ts +2 -0
- package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-rate-limit-degradation.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-rate-limit-degradation.test.js +320 -0
- package/core/dist/runtime-v2/runner/__tests__/base-peer-runner-rate-limit-degradation.test.js.map +1 -0
- package/core/dist/runtime-v2/runner/__tests__/default-validator.test.js +63 -0
- package/core/dist/runtime-v2/runner/__tests__/default-validator.test.js.map +1 -1
- package/core/dist/runtime-v2/runner/__tests__/diagnose.test.js.map +1 -1
- package/core/dist/runtime-v2/runner/base-peer-runner.d.ts +117 -4
- package/core/dist/runtime-v2/runner/base-peer-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/runner/base-peer-runner.js +403 -0
- package/core/dist/runtime-v2/runner/base-peer-runner.js.map +1 -1
- package/core/dist/runtime-v2/runner/default-validator.d.ts.map +1 -1
- package/core/dist/runtime-v2/runner/default-validator.js +31 -3
- package/core/dist/runtime-v2/runner/default-validator.js.map +1 -1
- package/core/dist/runtime-v2/runner/diagnostician-validator.d.ts.map +1 -1
- package/core/dist/runtime-v2/runner/peer-runner-types.d.ts +36 -0
- package/core/dist/runtime-v2/runner/peer-runner-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/runtime-protocol.d.ts +1 -1
- package/core/dist/runtime-v2/schema-conformance-read-model.d.ts.map +1 -1
- package/core/dist/runtime-v2/signal-collector/types.d.ts.map +1 -1
- package/core/dist/runtime-v2/stalled-diagnostician-task-read-model.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/artifact/memory-artifact-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/artifact/memory-artifact-store.js.map +1 -1
- package/core/dist/runtime-v2/store/artifact/sqlite-artifact-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/artifact/sqlite-artifact-store.js.map +1 -1
- 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.map +1 -1
- package/core/dist/runtime-v2/store/candidate/memory-candidate-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/candidate/sqlite-candidate-store.js.map +1 -1
- package/core/dist/runtime-v2/store/commit/diagnostician-committer.d.ts +15 -0
- package/core/dist/runtime-v2/store/commit/diagnostician-committer.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/commit/diagnostician-committer.js +32 -1
- package/core/dist/runtime-v2/store/commit/diagnostician-committer.js.map +1 -1
- package/core/dist/runtime-v2/store/commit/memory-commit-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/commit/sqlite-commit-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/commit/sqlite-commit-store.js.map +1 -1
- package/core/dist/runtime-v2/store/context/resilient-context-assembler.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/context/resilient-context-assembler.js.map +1 -1
- package/core/dist/runtime-v2/store/context/sqlite-context-assembler.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/context/sqlite-context-assembler.js.map +1 -1
- package/core/dist/runtime-v2/store/diagnostician-committer.test.js +36 -2
- package/core/dist/runtime-v2/store/diagnostician-committer.test.js.map +1 -1
- package/core/dist/runtime-v2/store/event-emitter.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/history/resilient-history-query.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/history/resilient-history-query.js.map +1 -1
- package/core/dist/runtime-v2/store/history/sqlite-history-query.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/history/sqlite-history-query.js.map +1 -1
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.js.map +1 -1
- package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.js.map +1 -1
- package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.js.map +1 -1
- package/core/dist/runtime-v2/store/lifecycle/lease-manager.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/lifecycle/lease-manager.js.map +1 -1
- package/core/dist/runtime-v2/store/lifecycle/lease-manager.test.js.map +1 -1
- package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.js.map +1 -1
- package/core/dist/runtime-v2/store/lifecycle/recovery-sweep.test.js.map +1 -1
- package/core/dist/runtime-v2/store/lifecycle/retry-policy.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/lifecycle/retry-policy.js.map +1 -1
- package/core/dist/runtime-v2/store/pain/__tests__/sqlite-dead-letter-store.test.d.ts +2 -0
- package/core/dist/runtime-v2/store/pain/__tests__/sqlite-dead-letter-store.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/pain/__tests__/sqlite-dead-letter-store.test.js +225 -0
- package/core/dist/runtime-v2/store/pain/__tests__/sqlite-dead-letter-store.test.js.map +1 -0
- package/core/dist/runtime-v2/store/pain/index.d.ts +3 -0
- package/core/dist/runtime-v2/store/pain/index.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/pain/index.js +2 -0
- package/core/dist/runtime-v2/store/pain/index.js.map +1 -0
- package/core/dist/runtime-v2/store/pain/sqlite-dead-letter-store.d.ts +70 -0
- package/core/dist/runtime-v2/store/pain/sqlite-dead-letter-store.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/pain/sqlite-dead-letter-store.js +154 -0
- package/core/dist/runtime-v2/store/pain/sqlite-dead-letter-store.js.map +1 -0
- package/core/dist/runtime-v2/store/run/memory-run-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/run/sqlite-run-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/run/sqlite-run-store.js.map +1 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.integration.test.js.map +1 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.js.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-connection.js +46 -1
- package/core/dist/runtime-v2/store/sqlite-connection.js.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-task-store.test.js.map +1 -1
- package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.d.ts +2 -0
- package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.js +442 -0
- package/core/dist/runtime-v2/store/task/__tests__/sqlite-task-store.failed-tasks.test.js.map +1 -0
- package/core/dist/runtime-v2/store/task/index.d.ts +1 -0
- package/core/dist/runtime-v2/store/task/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/task/index.js.map +1 -1
- package/core/dist/runtime-v2/store/task/memory-task-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/task/sqlite-task-store.d.ts +45 -0
- 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 +205 -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 +60 -0
- package/core/dist/runtime-v2/store/task/task-types.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/task/task-types.js +2 -0
- package/core/dist/runtime-v2/store/task/task-types.js.map +1 -0
- package/core/dist/runtime-v2/store/task-migration.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/task-migration.js.map +1 -1
- package/core/dist/runtime-v2/store/trajectory/source-trace-locator.test.js.map +1 -1
- package/core/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.js.map +1 -1
- package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.js.map +1 -1
- package/core/dist/runtime-v2/store/workspace-leak-guard.d.ts +23 -0
- package/core/dist/runtime-v2/store/workspace-leak-guard.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/workspace-leak-guard.js +111 -0
- package/core/dist/runtime-v2/store/workspace-leak-guard.js.map +1 -0
- package/core/dist/runtime-v2/story-a-demo.d.ts +1 -1
- package/core/dist/runtime-v2/story-a-demo.d.ts.map +1 -1
- package/core/dist/runtime-v2/story-a-demo.js +8 -10
- package/core/dist/runtime-v2/story-a-demo.js.map +1 -1
- package/core/dist/runtime-v2/task-status.d.ts +2 -2
- package/core/dist/runtime-v2/tools/__tests__/agent-tool-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/tools/__tests__/dreamer-output-typebox.test.js.map +1 -1
- package/core/dist/runtime-v2/trace-refiner.d.ts +2 -2
- package/core/dist/runtime-v2/trace-refiner.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/evidence-chain-contract.js.map +1 -1
- package/core/dist/trajectory-store.js.map +1 -1
- package/core/dist/trajectory-store.test.d.ts +2 -0
- package/core/dist/trajectory-store.test.d.ts.map +1 -0
- package/core/dist/trajectory-store.test.js +251 -0
- package/core/dist/trajectory-store.test.js.map +1 -0
- package/core/dist/workflow-funnel-loader.d.ts.map +1 -1
- package/core/package.json +13 -7
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +56 -6
- 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 +186 -27
- package/dist/index.js.map +1 -1
- package/dist/installer.d.ts +11 -2
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +296 -145
- package/dist/installer.js.map +1 -1
- package/dist/installers/codex-host-installer.d.ts +15 -0
- package/dist/installers/codex-host-installer.d.ts.map +1 -0
- package/dist/installers/codex-host-installer.js +445 -0
- package/dist/installers/codex-host-installer.js.map +1 -0
- package/dist/installers/index.d.ts +40 -0
- package/dist/installers/index.d.ts.map +1 -0
- package/dist/installers/index.js +35 -0
- package/dist/installers/index.js.map +1 -0
- package/dist/installers/openclaw-host-installer.d.ts +18 -0
- package/dist/installers/openclaw-host-installer.d.ts.map +1 -0
- package/dist/installers/openclaw-host-installer.js +404 -0
- package/dist/installers/openclaw-host-installer.js.map +1 -0
- package/dist/mvp-config.d.ts +23 -4
- package/dist/mvp-config.d.ts.map +1 -1
- package/dist/mvp-config.js +15 -7
- package/dist/mvp-config.js.map +1 -1
- package/dist/prompts.d.ts +17 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +114 -0
- package/dist/prompts.js.map +1 -1
- package/dist/uninstaller.d.ts +18 -1
- package/dist/uninstaller.d.ts.map +1 -1
- package/dist/uninstaller.js +60 -75
- package/dist/uninstaller.js.map +1 -1
- package/dist/updater.d.ts +0 -6
- package/dist/updater.d.ts.map +1 -1
- package/dist/updater.js +0 -11
- package/dist/updater.js.map +1 -1
- package/dist/utils/env.d.ts +14 -0
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +35 -2
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/package.json +7 -7
- package/pd-cli/dist/commands/__tests__/pain-retry-maxTokens-flag.test.d.ts +2 -0
- package/pd-cli/dist/commands/__tests__/pain-retry-maxTokens-flag.test.d.ts.map +1 -0
- package/pd-cli/dist/commands/__tests__/pain-retry-maxTokens-flag.test.js +60 -0
- package/pd-cli/dist/commands/__tests__/pain-retry-maxTokens-flag.test.js.map +1 -0
- package/pd-cli/dist/commands/__tests__/rulecode-flag-wiring.test.js +11 -4
- package/pd-cli/dist/commands/__tests__/rulecode-flag-wiring.test.js.map +1 -1
- package/pd-cli/dist/commands/__tests__/runtime-probe-config.test.js +2 -2
- package/pd-cli/dist/commands/__tests__/runtime-probe-config.test.js.map +1 -1
- package/pd-cli/dist/commands/admission-gate.d.ts +24 -0
- package/pd-cli/dist/commands/admission-gate.d.ts.map +1 -0
- package/pd-cli/dist/commands/admission-gate.js +29 -0
- package/pd-cli/dist/commands/admission-gate.js.map +1 -0
- package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
- package/pd-cli/dist/commands/candidate.js +2 -21
- package/pd-cli/dist/commands/candidate.js.map +1 -1
- package/pd-cli/dist/commands/console.d.ts.map +1 -1
- package/pd-cli/dist/commands/console.js +40 -0
- package/pd-cli/dist/commands/console.js.map +1 -1
- package/pd-cli/dist/commands/demo-story-a.js.map +1 -1
- package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
- package/pd-cli/dist/commands/diagnose.js +88 -9
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/errors-list.d.ts +25 -0
- package/pd-cli/dist/commands/errors-list.d.ts.map +1 -0
- package/pd-cli/dist/commands/errors-list.js +368 -0
- package/pd-cli/dist/commands/errors-list.js.map +1 -0
- package/pd-cli/dist/commands/health.js.map +1 -1
- package/pd-cli/dist/commands/pain-evidence.d.ts +6 -0
- package/pd-cli/dist/commands/pain-evidence.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-evidence.js +6 -0
- package/pd-cli/dist/commands/pain-evidence.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts +1 -0
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +288 -19
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/dist/commands/proven-channel-baseline.js.map +1 -1
- package/pd-cli/dist/commands/runtime-canary.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-canary.js +28 -5
- package/pd-cli/dist/commands/runtime-canary.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-context-trace.d.ts +25 -0
- package/pd-cli/dist/commands/runtime-internalization-context-trace.d.ts.map +1 -0
- package/pd-cli/dist/commands/runtime-internalization-context-trace.js +374 -0
- package/pd-cli/dist/commands/runtime-internalization-context-trace.js.map +1 -0
- package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.js +20 -5
- package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
- package/pd-cli/dist/commands/runtime-uat.guard.test.js +13 -15
- package/pd-cli/dist/commands/runtime-uat.guard.test.js.map +1 -1
- package/pd-cli/dist/commands/runtime-uat.js.map +1 -1
- package/pd-cli/dist/index.js +21 -3
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/dist/services/__tests__/evaluator-runner-deps.test.d.ts +2 -0
- package/pd-cli/dist/services/__tests__/evaluator-runner-deps.test.d.ts.map +1 -0
- package/pd-cli/dist/services/__tests__/evaluator-runner-deps.test.js +304 -0
- package/pd-cli/dist/services/__tests__/evaluator-runner-deps.test.js.map +1 -0
- package/pd-cli/dist/services/__tests__/rulehost-readiness.test.js.map +1 -1
- package/pd-cli/dist/services/__tests__/runtime-adapter-resolver.test.js.map +1 -1
- package/pd-cli/dist/services/config-doctor.js.map +1 -1
- package/pd-cli/dist/services/pain-flood-simulation-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/pain-flood-simulation-runner.js +9 -0
- package/pd-cli/dist/services/pain-flood-simulation-runner.js.map +1 -1
- package/pd-cli/dist/services/proven-channel-baseline-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/proven-channel-baseline-runner.js +10 -2
- package/pd-cli/dist/services/proven-channel-baseline-runner.js.map +1 -1
- package/pd-cli/dist/services/quality-scorecard/data-extractor.js.map +1 -1
- package/pd-cli/dist/services/resolve-runtime-from-pd-config.js.map +1 -1
- package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts +73 -1
- package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/rulehost-pipeline-runner.js +107 -6
- package/pd-cli/dist/services/rulehost-pipeline-runner.js.map +1 -1
- package/pd-cli/dist/services/rulehost-readiness.js.map +1 -1
- package/pd-cli/dist/services/runtime-adapter-resolver.d.ts +1 -0
- package/pd-cli/dist/services/runtime-adapter-resolver.d.ts.map +1 -1
- package/pd-cli/dist/services/runtime-adapter-resolver.js +2 -0
- package/pd-cli/dist/services/runtime-adapter-resolver.js.map +1 -1
- package/pd-cli/dist/services/synthetic-baseline-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/synthetic-baseline-runner.js +11 -0
- package/pd-cli/dist/services/synthetic-baseline-runner.js.map +1 -1
- package/pd-cli/dist/utils/production-workspace-guard.d.ts +4 -4
- package/pd-cli/dist/utils/production-workspace-guard.d.ts.map +1 -1
- package/pd-cli/dist/utils/production-workspace-guard.js +19 -16
- package/pd-cli/dist/utils/production-workspace-guard.js.map +1 -1
- package/pd-cli/dist/utils/production-workspace-guard.test.js +54 -19
- package/pd-cli/dist/utils/production-workspace-guard.test.js.map +1 -1
- package/pd-cli/package.json +4 -4
- package/plugin/dist/assets/logo.svg +11 -0
- package/plugin/dist/bundle.js +3152 -0
- package/plugin/dist/config/defaults/runtime.d.ts +1 -1
- package/plugin/dist/constants/tools.d.ts +4 -4
- package/plugin/dist/core/config-health.d.ts +1 -11
- package/plugin/dist/core/dictionary.d.ts +1 -1
- package/plugin/dist/core/path-resolver.d.ts +3 -3
- package/plugin/dist/core/signal-collector-host.d.ts +9 -1
- package/plugin/dist/core/system-logger.d.ts +16 -0
- package/plugin/dist/index.d.ts +1 -1
- package/plugin/dist/index.js +1 -808
- package/plugin/dist/openclaw-sdk.d.ts +49 -8
- package/plugin/dist/openclaw.plugin.json +65 -0
- package/plugin/dist/service/evolution-worker.d.ts +27 -1
- package/plugin/dist/templates/langs/en/core/AGENTS.md +205 -0
- package/plugin/dist/templates/langs/en/core/BOOT.md +60 -0
- package/plugin/dist/templates/langs/en/core/BOOTSTRAP.md +259 -0
- package/plugin/dist/templates/langs/en/core/HEARTBEAT.md +74 -0
- package/plugin/dist/templates/langs/en/core/IDENTITY.md +8 -0
- package/plugin/dist/templates/langs/en/core/PRINCIPLES.md +10 -0
- package/plugin/dist/templates/langs/en/core/SOUL.md +46 -0
- package/plugin/dist/templates/langs/en/core/TOOLS.md +15 -0
- package/plugin/dist/templates/langs/en/core/USER.md +10 -0
- package/plugin/dist/templates/langs/en/pain/00_seed_samples.md +23 -0
- package/plugin/dist/templates/langs/en/pain_dictionary.json +22 -0
- package/plugin/dist/templates/langs/en/principles/THINKING_OS.md +77 -0
- package/plugin/dist/templates/langs/en/skills/admin/SKILL.md +39 -0
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/runtime/.gitignore +2 -0
- package/plugin/dist/templates/langs/en/skills/bootstrap-tools/SKILL.md +53 -0
- package/plugin/dist/templates/langs/en/skills/deductive-audit/SKILL.md +36 -0
- package/plugin/dist/templates/langs/en/skills/evolution-framework-update/SKILL.md +31 -0
- package/plugin/dist/templates/langs/en/skills/evolve-task/SKILL.md +83 -0
- package/plugin/dist/templates/langs/en/skills/feedback/SKILL.md +51 -0
- package/plugin/dist/templates/langs/en/skills/init-strategy/SKILL.md +54 -0
- package/plugin/dist/templates/langs/en/skills/inject-rule/SKILL.md +19 -0
- package/plugin/dist/templates/langs/en/skills/pd-auditor/SKILL.md +61 -0
- package/plugin/dist/templates/langs/en/skills/pd-cli-operator/SKILL.md +76 -0
- package/plugin/dist/templates/langs/en/skills/pd-explorer/SKILL.md +65 -0
- package/plugin/dist/templates/langs/en/skills/pd-implementer/SKILL.md +68 -0
- package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +213 -0
- package/plugin/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +30 -0
- package/plugin/dist/templates/langs/en/skills/pd-planner/SKILL.md +65 -0
- package/plugin/dist/templates/langs/en/skills/pd-runtime-v2/SKILL.md +71 -0
- package/plugin/dist/templates/langs/en/skills/profile/SKILL.md +24 -0
- package/plugin/dist/templates/langs/en/skills/reflection/SKILL.md +40 -0
- package/plugin/dist/templates/langs/en/skills/reflection-log/SKILL.md +37 -0
- package/plugin/dist/templates/langs/en/skills/report/SKILL.md +13 -0
- package/plugin/dist/templates/langs/en/skills/root-cause/SKILL.md +33 -0
- package/plugin/dist/templates/langs/en/skills/triage/SKILL.md +29 -0
- package/plugin/dist/templates/langs/en/skills/watch-evolution/SKILL.md +33 -0
- package/plugin/dist/templates/langs/zh/core/AGENTS.md +197 -0
- package/plugin/dist/templates/langs/zh/core/BOOT.md +60 -0
- package/plugin/dist/templates/langs/zh/core/BOOTSTRAP.md +260 -0
- package/plugin/dist/templates/langs/zh/core/HEARTBEAT.md +98 -0
- package/plugin/dist/templates/langs/zh/core/IDENTITY.md +8 -0
- package/plugin/dist/templates/langs/zh/core/PRINCIPLES.md +7 -0
- package/plugin/dist/templates/langs/zh/core/SOUL.md +46 -0
- package/plugin/dist/templates/langs/zh/core/TOOLS.md +15 -0
- package/plugin/dist/templates/langs/zh/core/USER.md +10 -0
- package/plugin/dist/templates/langs/zh/pain/00_seed_samples.md +24 -0
- package/plugin/dist/templates/langs/zh/pain_dictionary.json +18 -0
- package/plugin/dist/templates/langs/zh/principles/THINKING_OS.md +77 -0
- package/plugin/dist/templates/langs/zh/skills/admin/SKILL.md +41 -0
- package/plugin/dist/templates/langs/zh/skills/bootstrap-tools/SKILL.md +52 -0
- package/plugin/dist/templates/langs/zh/skills/deductive-audit/SKILL.md +36 -0
- package/plugin/dist/templates/langs/zh/skills/evolution-framework-update/SKILL.md +31 -0
- package/plugin/dist/templates/langs/zh/skills/evolve-task/SKILL.md +83 -0
- package/plugin/dist/templates/langs/zh/skills/feedback/SKILL.md +53 -0
- package/plugin/dist/templates/langs/zh/skills/init-strategy/SKILL.md +54 -0
- package/plugin/dist/templates/langs/zh/skills/inject-rule/SKILL.md +19 -0
- package/plugin/dist/templates/langs/zh/skills/pd-auditor/SKILL.md +61 -0
- package/plugin/dist/templates/langs/zh/skills/pd-cli-operator/SKILL.md +76 -0
- package/plugin/dist/templates/langs/zh/skills/pd-explorer/SKILL.md +65 -0
- package/plugin/dist/templates/langs/zh/skills/pd-implementer/SKILL.md +68 -0
- package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +213 -0
- package/plugin/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +30 -0
- package/plugin/dist/templates/langs/zh/skills/pd-planner/SKILL.md +65 -0
- package/plugin/dist/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +71 -0
- package/plugin/dist/templates/langs/zh/skills/profile/SKILL.md +24 -0
- package/plugin/dist/templates/langs/zh/skills/reflection/SKILL.md +40 -0
- package/plugin/dist/templates/langs/zh/skills/reflection-log/SKILL.md +37 -0
- package/plugin/dist/templates/langs/zh/skills/report/SKILL.md +13 -0
- package/plugin/dist/templates/langs/zh/skills/root-cause/SKILL.md +33 -0
- package/plugin/dist/templates/langs/zh/skills/triage/SKILL.md +29 -0
- package/plugin/dist/templates/langs/zh/skills/watch-evolution/SKILL.md +33 -0
- package/plugin/dist/templates/pain_dictionary.json +36 -0
- package/plugin/dist/templates/pain_settings.json +103 -0
- package/plugin/dist/templates/workspace/.principles/DECISION_POLICY.json +44 -0
- package/plugin/dist/templates/workspace/.principles/PRINCIPLES.md +20 -0
- package/plugin/dist/templates/workspace/.principles/PROFILE.json +54 -0
- package/plugin/dist/templates/workspace/.principles/PROFILE.schema.json +56 -0
- package/plugin/dist/templates/workspace/.principles/THINKING_OS.md +65 -0
- package/plugin/dist/templates/workspace/.principles/THINKING_OS_ARCHIVE.md +7 -0
- package/plugin/dist/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +9 -0
- package/plugin/dist/templates/workspace/.principles/models/_INDEX.md +27 -0
- package/plugin/dist/templates/workspace/.principles/models/first_principles.md +62 -0
- package/plugin/dist/templates/workspace/.principles/models/marketing_4p.md +52 -0
- package/plugin/dist/templates/workspace/.principles/models/porter_five.md +63 -0
- package/plugin/dist/templates/workspace/.principles/models/swot.md +60 -0
- package/plugin/dist/templates/workspace/.principles/models/user_story_map.md +63 -0
- package/plugin/dist/templates/workspace/.state/WORKBOARD.json +4 -0
- package/plugin/dist/templates/workspace/AUDIT.md +15 -0
- package/plugin/dist/templates/workspace/okr/CURRENT_FOCUS.md +57 -0
- package/plugin/dist/templates/workspace/okr/RECOVERY_PROTOCOL.md +56 -0
- package/plugin/dist/templates/workspace/okr/TASK_CHANGES.jsonl +6 -0
- package/plugin/dist/templates/workspace/okr/WEEK_TASKS.json +6 -0
- package/plugin/openclaw.plugin.json +5 -5
- package/plugin/package.json +22 -10
- package/plugin/scripts/bootstrap-rules.mjs +5 -1
- package/plugin/scripts/postinstall.cjs +177 -0
- package/plugin/scripts/sync-plugin.mjs +12 -1
- package/plugin/dist/commands/archive-impl.js +0 -105
- package/plugin/dist/commands/capabilities.js +0 -77
- package/plugin/dist/commands/context.js +0 -299
- package/plugin/dist/commands/disable-impl.js +0 -118
- package/plugin/dist/commands/evolution-status.js +0 -185
- package/plugin/dist/commands/export.js +0 -53
- package/plugin/dist/commands/focus.js +0 -451
- package/plugin/dist/commands/pain.js +0 -336
- package/plugin/dist/commands/principle-rollback.js +0 -26
- package/plugin/dist/commands/promote-impl.js +0 -194
- package/plugin/dist/commands/rollback-impl.js +0 -180
- package/plugin/dist/commands/rollback.js +0 -126
- package/plugin/dist/commands/samples.js +0 -83
- package/plugin/dist/commands/strategy.js +0 -16
- package/plugin/dist/commands/thinking-os.js +0 -186
- package/plugin/dist/commands/workflow-debug.js +0 -132
- package/plugin/dist/config/defaults/runtime.js +0 -74
- package/plugin/dist/config/errors.js +0 -107
- package/plugin/dist/config/index.js +0 -7
- package/plugin/dist/constants/tools.js +0 -53
- package/plugin/dist/core/__tests__/focus-history.test.js +0 -160
- package/plugin/dist/core/behavior-example-pack-assembler.js +0 -207
- package/plugin/dist/core/bootstrap-rules.js +0 -187
- package/plugin/dist/core/code-implementation-storage.js +0 -139
- package/plugin/dist/core/config-health.js +0 -60
- package/plugin/dist/core/config-service.js +0 -26
- package/plugin/dist/core/config.js +0 -191
- package/plugin/dist/core/control-ui-db.js +0 -333
- package/plugin/dist/core/correction-cue-learner.js +0 -186
- package/plugin/dist/core/correction-types.js +0 -1
- package/plugin/dist/core/detection-funnel.js +0 -56
- package/plugin/dist/core/detection-service.js +0 -28
- package/plugin/dist/core/dictionary-service.js +0 -26
- package/plugin/dist/core/dictionary.js +0 -148
- package/plugin/dist/core/empathy-keyword-matcher.js +0 -40
- package/plugin/dist/core/empathy-types.js +0 -1
- package/plugin/dist/core/event-log.js +0 -706
- package/plugin/dist/core/evolution-engine.js +0 -460
- package/plugin/dist/core/evolution-logger.js +0 -261
- package/plugin/dist/core/evolution-reducer.js +0 -720
- package/plugin/dist/core/evolution-types.js +0 -11
- package/plugin/dist/core/file-store.js +0 -46
- package/plugin/dist/core/focus-history.js +0 -574
- package/plugin/dist/core/hygiene/tracker.js +0 -110
- package/plugin/dist/core/init.js +0 -254
- package/plugin/dist/core/intent-doc-reader-adapter.js +0 -76
- package/plugin/dist/core/intent-doc-reader.js +0 -210
- package/plugin/dist/core/migration.js +0 -86
- package/plugin/dist/core/pain-diagnostic-gate.js +0 -69
- package/plugin/dist/core/pain.js +0 -56
- package/plugin/dist/core/path-resolver.js +0 -358
- package/plugin/dist/core/paths.js +0 -77
- package/plugin/dist/core/pd-config-loader.js +0 -307
- package/plugin/dist/core/pd-task-reconciler.js +0 -262
- package/plugin/dist/core/pd-task-service.js +0 -32
- package/plugin/dist/core/pd-task-store.js +0 -62
- package/plugin/dist/core/pd-task-types.js +0 -2
- package/plugin/dist/core/principle-compiler/__tests__/compiler-replay-gate.test.js +0 -132
- package/plugin/dist/core/principle-compiler/code-validator.js +0 -86
- package/plugin/dist/core/principle-compiler/compiler.js +0 -289
- package/plugin/dist/core/principle-compiler/index.js +0 -10
- package/plugin/dist/core/principle-compiler/ledger-registrar.js +0 -95
- package/plugin/dist/core/principle-compiler/template-generator.js +0 -7
- package/plugin/dist/core/principle-injection.js +0 -10
- package/plugin/dist/core/principle-internalization/filesystem-lifecycle-datasource.js +0 -34
- package/plugin/dist/core/principle-internalization/lifecycle-read-model.js +0 -21
- package/plugin/dist/core/principle-internalization/lifecycle-refresh.js +0 -4
- package/plugin/dist/core/principle-internalization/principle-lifecycle-service.js +0 -89
- package/plugin/dist/core/principle-training-state.js +0 -113
- package/plugin/dist/core/principle-tree-ledger.js +0 -42
- package/plugin/dist/core/profile.js +0 -211
- package/plugin/dist/core/reflection/reflection-context.js +0 -91
- package/plugin/dist/core/replay-engine.js +0 -82
- package/plugin/dist/core/rule-context-assembler.js +0 -148
- package/plugin/dist/core/rule-host.js +0 -554
- package/plugin/dist/core/rule-implementation-runtime.js +0 -112
- package/plugin/dist/core/runtime-v2-prompt-activation-reader.js +0 -99
- package/plugin/dist/core/session-tracker.js +0 -462
- package/plugin/dist/core/signal-collector-host.js +0 -337
- package/plugin/dist/core/system-logger.js +0 -113
- package/plugin/dist/core/thinking-models.js +0 -94
- package/plugin/dist/core/thinking-os-parser.js +0 -132
- package/plugin/dist/core/trajectory-types.js +0 -8
- package/plugin/dist/core/trajectory.js +0 -1692
- package/plugin/dist/core/workflow-funnel-loader.js +0 -135
- package/plugin/dist/core/workspace-context.js +0 -260
- package/plugin/dist/core/workspace-dir-validation.js +0 -37
- package/plugin/dist/core/workspace-guidance-migrator.js +0 -141
- package/plugin/dist/hooks/after-tool-call-helpers.js +0 -552
- package/plugin/dist/hooks/after-tool-call-types.js +0 -13
- package/plugin/dist/hooks/gate-block-helper.js +0 -249
- package/plugin/dist/hooks/gate.js +0 -430
- package/plugin/dist/hooks/lifecycle.js +0 -284
- package/plugin/dist/hooks/llm.js +0 -452
- package/plugin/dist/hooks/message-sanitize.js +0 -77
- package/plugin/dist/hooks/pain.js +0 -369
- package/plugin/dist/hooks/prompt-helpers.js +0 -288
- package/plugin/dist/hooks/prompt-types.js +0 -12
- package/plugin/dist/hooks/prompt.js +0 -501
- package/plugin/dist/hooks/raw-observation-adapter.js +0 -15
- package/plugin/dist/hooks/raw-observation-types.js +0 -11
- package/plugin/dist/hooks/trajectory-collector.js +0 -164
- package/plugin/dist/hooks/trajectory-evidence.js +0 -92
- package/plugin/dist/hooks/triage-adapter.js +0 -72
- package/plugin/dist/hooks/trigger-cooldown-tracker.js +0 -80
- package/plugin/dist/i18n/commands.js +0 -120
- package/plugin/dist/openclaw-sdk.js +0 -4
- package/plugin/dist/rulehost-evidence.js +0 -3
- package/plugin/dist/service/correction-observer-service.js +0 -191
- package/plugin/dist/service/evolution-dedup.js +0 -54
- package/plugin/dist/service/evolution-worker.js +0 -578
- package/plugin/dist/service/internalization-auto-consumer-service.js +0 -323
- package/plugin/dist/service/keyword-optimization-service.js +0 -137
- package/plugin/dist/service/phase3-input-filter.js +0 -172
- package/plugin/dist/service/queue-io.js +0 -91
- package/plugin/dist/service/queue-migration.js +0 -113
- package/plugin/dist/service/runtime-summary-service.js +0 -639
- package/plugin/dist/service/subagent-workflow/subagent-error-utils.js +0 -23
- package/plugin/dist/service/subagent-workflow/types.js +0 -11
- package/plugin/dist/service/subagent-workflow/workflow-store.js +0 -298
- package/plugin/dist/service/trajectory-service.js +0 -16
- package/plugin/dist/service/workflow-watchdog.js +0 -104
- package/plugin/dist/types/event-types.js +0 -1
- package/plugin/dist/types/hygiene-types.js +0 -1
- package/plugin/dist/types/principle-tree-schema.js +0 -24
- package/plugin/dist/types/queue.js +0 -1
- package/plugin/dist/types/runtime-summary.js +0 -1
- package/plugin/dist/types.js +0 -11
- package/plugin/dist/utils/file-lock.js +0 -310
- package/plugin/dist/utils/hashing.js +0 -25
- package/plugin/dist/utils/io.js +0 -174
- package/plugin/dist/utils/node-vm-polyfill.js +0 -9
- package/plugin/dist/utils/retry.js +0 -380
- package/plugin/dist/utils/session-key.js +0 -21
- package/plugin/dist/utils/workspace-resolver.js +0 -288
|
@@ -27,7 +27,34 @@
|
|
|
27
27
|
import type { TaskRecord } from '../task-status.js';
|
|
28
28
|
import type { PITaskRecord, InternalizationChannel, ArtifactRef } from './peer-runner-contracts.js';
|
|
29
29
|
/** Namespace key used inside diagnosticJson to isolate PI metadata. */
|
|
30
|
-
export declare const PI_METADATA_KEY:
|
|
30
|
+
export declare const PI_METADATA_KEY: 'pi_metadata';
|
|
31
|
+
/**
|
|
32
|
+
* Evaluator repair payload (PRI-509).
|
|
33
|
+
*
|
|
34
|
+
* Carries the evaluator's structured feedback when decision === 'needs_revision'
|
|
35
|
+
* so the seeded artificer repair task can address each required change instead
|
|
36
|
+
* of regenerating blind. The metadata layer treats this as opaque; the
|
|
37
|
+
* ArtificerRunner.buildContext reads it and constructs a pre-formatted
|
|
38
|
+
* repairFeedback string for the prompt builder.
|
|
39
|
+
*
|
|
40
|
+
* Lineage (rc-6):
|
|
41
|
+
* - sourceArtificerArtifactId: the prior artificer artifact that was rejected
|
|
42
|
+
* - sourceEvaluatorTaskId: the evaluator task that returned needs_revision
|
|
43
|
+
*
|
|
44
|
+
* Loop state freshness (rc-7, EP-05, ERR-015/018/019):
|
|
45
|
+
* - repairIteration is written at task creation time, never inferred at read.
|
|
46
|
+
* - Round 1 = first repair (after initial evaluator needs_revision).
|
|
47
|
+
* - Round 2 = second repair (after first repair's evaluator needs_revision).
|
|
48
|
+
* - Max 2 rounds; a 3rd needs_revision fails loud via needs_human_review (EP-03).
|
|
49
|
+
*/
|
|
50
|
+
export interface RepairPayload {
|
|
51
|
+
readonly requiredChanges: readonly string[];
|
|
52
|
+
readonly concerns: readonly string[];
|
|
53
|
+
readonly previousScore: number;
|
|
54
|
+
readonly repairIteration: number;
|
|
55
|
+
readonly sourceArtificerArtifactId: string;
|
|
56
|
+
readonly sourceEvaluatorTaskId: string;
|
|
57
|
+
}
|
|
31
58
|
/**
|
|
32
59
|
* PI-specific metadata stored inside TaskRecord.diagnosticJson.
|
|
33
60
|
* All fields must be present except parentTaskId and correlationId (optional).
|
|
@@ -48,6 +75,13 @@ export interface PITaskMetadata {
|
|
|
48
75
|
* metadata layer; the ArtificerRunner forwards it to the prompt builder.
|
|
49
76
|
*/
|
|
50
77
|
adversarialFeedback?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Evaluator repair payload (PRI-509). Present only on artificer tasks seeded
|
|
80
|
+
* by evaluator needs_revision. Carries the structured feedback
|
|
81
|
+
* (requiredChanges/concerns/previousScore/repairIteration) so the artificer
|
|
82
|
+
* can address each required change. Undefined on Round-1 artificer tasks.
|
|
83
|
+
*/
|
|
84
|
+
repairPayload?: RepairPayload;
|
|
51
85
|
}
|
|
52
86
|
/**
|
|
53
87
|
* Serialize PITaskMetadata into a JSON string suitable for TaskRecord.diagnosticJson.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pitask-metadata.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/pitask-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAGpC,uEAAuE;AACvE,eAAO,MAAM,eAAe,EAAG,aAAsB,CAAC;AAEtD;;;G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WAAW,EAAE,CAAC;IACjC,kBAAkB,EAAE,WAAW,EAAE,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAID;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAexE;AAED,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,gCAA0B,CAAC;AA6DlE;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAkFjF;AAID;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CA4BzE"}
|
|
@@ -44,6 +44,7 @@ export function serializePITaskMetadata(metadata) {
|
|
|
44
44
|
correlationId: metadata.correlationId,
|
|
45
45
|
rejectionCount: metadata.rejectionCount,
|
|
46
46
|
adversarialFeedback: metadata.adversarialFeedback,
|
|
47
|
+
repairPayload: metadata.repairPayload,
|
|
47
48
|
},
|
|
48
49
|
});
|
|
49
50
|
}
|
|
@@ -62,6 +63,57 @@ function isValidArtifactRef(value) {
|
|
|
62
63
|
return typeof r.artifactType === 'string' && r.artifactType.trim() !== '' &&
|
|
63
64
|
typeof r.ref === 'string' && r.ref.trim() !== '';
|
|
64
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Validates a value is a valid RepairPayload (PRI-509).
|
|
68
|
+
*
|
|
69
|
+
* Trust boundary (rc-1, rc-2): repairPayload originates from evaluator LLM
|
|
70
|
+
* output persisted into diagnosticJson. Treat as unknown and validate every
|
|
71
|
+
* field before returning. No `as` casts that bypass validation.
|
|
72
|
+
*
|
|
73
|
+
* Validation rules:
|
|
74
|
+
* - requiredChanges: non-empty array of non-empty strings (rc-4)
|
|
75
|
+
* - concerns: array of non-empty strings (can be empty)
|
|
76
|
+
* - previousScore: finite number
|
|
77
|
+
* - repairIteration: positive integer, upper bound of 2 (rc-3 fail-closed
|
|
78
|
+
* at the trust boundary — the documented contract is "max 2 rounds"; a
|
|
79
|
+
* payload with repairIteration: 3 must be rejected here rather than
|
|
80
|
+
* relying on the runtime caller's priorRepairIteration >= 2 check)
|
|
81
|
+
* - sourceArtificerArtifactId: non-empty string
|
|
82
|
+
* - sourceEvaluatorTaskId: non-empty string
|
|
83
|
+
*/
|
|
84
|
+
function isValidRepairPayload(value) {
|
|
85
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
86
|
+
return false;
|
|
87
|
+
const p = value;
|
|
88
|
+
// rc-4: validate array elements are non-empty strings.
|
|
89
|
+
if (!Array.isArray(p.requiredChanges) || p.requiredChanges.length === 0)
|
|
90
|
+
return false;
|
|
91
|
+
for (const c of p.requiredChanges) {
|
|
92
|
+
if (typeof c !== 'string' || c.trim() === '')
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
if (!Array.isArray(p.concerns))
|
|
96
|
+
return false;
|
|
97
|
+
for (const c of p.concerns) {
|
|
98
|
+
if (typeof c !== 'string' || c.trim() === '')
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
if (typeof p.previousScore !== 'number' || !Number.isFinite(p.previousScore))
|
|
102
|
+
return false;
|
|
103
|
+
// rc-3: enforce the documented max-2-rounds contract at the trust boundary.
|
|
104
|
+
// repairIteration must be a positive integer in [1, 2]; reject 3+ here so
|
|
105
|
+
// a malformed payload cannot bypass the runtime caller's max-iteration guard.
|
|
106
|
+
if (typeof p.repairIteration !== 'number'
|
|
107
|
+
|| !Number.isInteger(p.repairIteration)
|
|
108
|
+
|| p.repairIteration < 1
|
|
109
|
+
|| p.repairIteration > 2)
|
|
110
|
+
return false;
|
|
111
|
+
if (typeof p.sourceArtificerArtifactId !== 'string' || p.sourceArtificerArtifactId.trim() === '')
|
|
112
|
+
return false;
|
|
113
|
+
if (typeof p.sourceEvaluatorTaskId !== 'string' || p.sourceEvaluatorTaskId.trim() === '')
|
|
114
|
+
return false;
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
65
117
|
// ── Parsing ─────────────────────────────────────────────────────────────────────
|
|
66
118
|
/**
|
|
67
119
|
* Parse a diagnosticJson string into PITaskMetadata.
|
|
@@ -145,6 +197,16 @@ export function parsePITaskMetadata(diagnosticJson) {
|
|
|
145
197
|
if (m.adversarialFeedback.trim() === '')
|
|
146
198
|
return null;
|
|
147
199
|
}
|
|
200
|
+
// repairPayload (PRI-509): optional, must pass full validation if present.
|
|
201
|
+
// rc-3: if the key is present but the value is malformed, fail loud (return null)
|
|
202
|
+
// rather than silently dropping the field — the caller will see a null metadata
|
|
203
|
+
// and treat the task as non-PI, which surfaces the corruption.
|
|
204
|
+
let repairPayload;
|
|
205
|
+
if (Object.hasOwn(m, 'repairPayload') && m.repairPayload !== undefined) {
|
|
206
|
+
if (!isValidRepairPayload(m.repairPayload))
|
|
207
|
+
return null;
|
|
208
|
+
({ repairPayload } = m);
|
|
209
|
+
}
|
|
148
210
|
return {
|
|
149
211
|
dependencyTaskIds: m.dependencyTaskIds,
|
|
150
212
|
channel: m.channel,
|
|
@@ -155,6 +217,7 @@ export function parsePITaskMetadata(diagnosticJson) {
|
|
|
155
217
|
correlationId: typeof m.correlationId === 'string' ? m.correlationId : undefined,
|
|
156
218
|
rejectionCount,
|
|
157
219
|
adversarialFeedback: typeof m.adversarialFeedback === 'string' ? m.adversarialFeedback : undefined,
|
|
220
|
+
repairPayload,
|
|
158
221
|
};
|
|
159
222
|
}
|
|
160
223
|
// ── Hydration ───────────────────────────────────────────────────────────────────
|
|
@@ -200,6 +263,7 @@ export function hydratePITaskRecord(task) {
|
|
|
200
263
|
correlationId: meta.correlationId,
|
|
201
264
|
rejectionCount: meta.rejectionCount ?? 0,
|
|
202
265
|
adversarialFeedback: meta.adversarialFeedback,
|
|
266
|
+
repairPayload: meta.repairPayload,
|
|
203
267
|
};
|
|
204
268
|
}
|
|
205
269
|
//# sourceMappingURL=pitask-metadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pitask-metadata.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/pitask-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAQH,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEpF,uEAAuE;AACvE,MAAM,CAAC,MAAM,eAAe,GAAG,aAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"pitask-metadata.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/pitask-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAQH,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEpF,uEAAuE;AACvE,MAAM,CAAC,MAAM,eAAe,GAAG,aAAsB,CAAC;AA2DtD,kFAAkF;AAElF;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAwB;IAC9D,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,CAAC,eAAe,CAAC,EAAE;YACjB,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;YAC7C,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;YAC7C,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;YAC/C,YAAY,EAAE,QAAQ,CAAC,YAAY;YACnC,aAAa,EAAE,QAAQ,CAAC,aAAa;YACrC,cAAc,EAAE,QAAQ,CAAC,cAAc;YACvC,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB;YACjD,aAAa,EAAE,QAAQ,CA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,wDAAwD;IACxD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAE9C,wEAAwE;IACxE,MAAM,GAAG,GAAG,IAA+B,CAAC;IAC5C,MAAM,EAAC,cAAc,EAAC,GAAG,GAAG,CAAC;IAC7B,IAAI,CAAC,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAEvE,MAAM,IAAI,GAAG,mBAAmB,CAAC,cAAc,CAAC,CAAC;IACjD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,wDAAwD;IACxD,oEAAoE;IACpE,OAAO;QACL,GAAG,IAAI;QACP,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;QAC3C,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,CAAC;QACxC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;QAC7C,aAAa,EAAE,IAAI,CAAC,aAAa;KACP,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 2 — Progressive Evaluator: two-stage evaluation with flagged criteria
|
|
3
|
+
* (design §6.5).
|
|
4
|
+
*
|
|
5
|
+
* Pure logic only (Core vs Plugin boundary, `antipattern-core-io`).
|
|
6
|
+
*
|
|
7
|
+
* The progressive evaluator runs Stage 1 (summary-level context) first; only
|
|
8
|
+
* when flagged / undetermined / forced-sample does it trigger Stage 2 (tier2
|
|
9
|
+
* full-contentJson re-evaluation). This keeps daily cost low while enabling
|
|
10
|
+
* deep diagnosis on demand.
|
|
11
|
+
*
|
|
12
|
+
* Key invariants:
|
|
13
|
+
* - Stage 2 output is INDEPENDENT — never merged with Stage 1 (rc-7 /
|
|
14
|
+
* ERR-015 / ERR-018 / ERR-019). `stagesRun === 2` ⟹ `finalOutput` is
|
|
15
|
+
* entirely the Stage 2 result.
|
|
16
|
+
* - flagged criteria read DIMENSION_COVERAGE_POLICY (single source of truth),
|
|
17
|
+
* never inline a dimension-name array. Untrusted LLM input is filtered by
|
|
18
|
+
* the policy table before flagging (rc-1 / rc-4).
|
|
19
|
+
* - Deterministic forced sampling via fnv1a32 (no Math.random, design §4.4).
|
|
20
|
+
*/
|
|
21
|
+
export declare const IMPLEMENTATION_FIDELITY_THRESHOLD = 0.7;
|
|
22
|
+
export declare const FORCED_STAGE2_SAMPLE_MODULUS = 20;
|
|
23
|
+
export type FlaggedReasonCode = 'missing_dimensions' | 'pain_not_fully_covered' | 'implementation_fidelity_below_threshold';
|
|
24
|
+
export interface FlaggedDecision {
|
|
25
|
+
readonly flagged: boolean;
|
|
26
|
+
readonly reasons: readonly FlaggedReasonCode[];
|
|
27
|
+
/** Fields that could not be determined (missing/malformed) — rc-3 + rc-9. */
|
|
28
|
+
readonly undetermined: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
export interface ProgressiveEvaluationOutcome {
|
|
31
|
+
/** Stage 2 ran → entirely Stage 2's result; never merged with Stage 1. */
|
|
32
|
+
readonly finalOutput: unknown;
|
|
33
|
+
readonly stagesRun: 1 | 2;
|
|
34
|
+
readonly stage1Decision: FlaggedDecision;
|
|
35
|
+
readonly forcedStage2: boolean;
|
|
36
|
+
readonly stage1FalseNegative?: {
|
|
37
|
+
readonly newConcernKeys: readonly string[];
|
|
38
|
+
};
|
|
39
|
+
readonly stage2Aborted?: {
|
|
40
|
+
readonly reason: 'lineage_error';
|
|
41
|
+
readonly detail: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* FNV-1a 32-bit hash. Pure, deterministic, no crypto, no Math.random.
|
|
46
|
+
* Supports the full Unicode range in the input string.
|
|
47
|
+
*/
|
|
48
|
+
export declare function fnv1a32(input: string): number;
|
|
49
|
+
/**
|
|
50
|
+
* Deterministic ~5% forced Stage 2 sampling. `fnv1a32(taskId) % modulus === 0`.
|
|
51
|
+
* Never uses Math.random or any non-deterministic source (design §4.4).
|
|
52
|
+
*/
|
|
53
|
+
export declare function isForcedStage2(taskId: string, modulus?: number): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Evaluate the three flagged criteria against Stage 1 output (design §6.5.3).
|
|
56
|
+
*
|
|
57
|
+
* Preconditions: none — `stage1Output` is untrusted LLM output (rc-1), read
|
|
58
|
+
* via `Object.hasOwn` (rc-5 / ERR-013).
|
|
59
|
+
*
|
|
60
|
+
* Postconditions:
|
|
61
|
+
* - `flagged === true` iff `reasons` is non-empty.
|
|
62
|
+
* - Three criteria: required-dimension missing, painCoverage.fullyCovered === false,
|
|
63
|
+
* implementationFidelity.score < 0.7.
|
|
64
|
+
* - Fields missing or wrong type → `undetermined` (rc-3: fail loud, never
|
|
65
|
+
* silently pass).
|
|
66
|
+
*
|
|
67
|
+
* Dimension criterion (§6.5.3, measurement-driven tightening):
|
|
68
|
+
* - Only **required** dimension names in `missingDimensions` count. The LLM
|
|
69
|
+
* may stuff optional/excluded/unknown strings in — all filtered out by
|
|
70
|
+
* `isRequiredDimension` before checking. `optionalUncovered` never enters
|
|
71
|
+
* `reasons`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function evaluateFlaggedCriteria(stage1Output: unknown): FlaggedDecision;
|
|
74
|
+
/**
|
|
75
|
+
* LLM evaluator callback type. The caller injects the actual LLM invocation;
|
|
76
|
+
* this module is pure logic and never calls an LLM directly.
|
|
77
|
+
*/
|
|
78
|
+
export interface ProgressiveEvaluatorLLM {
|
|
79
|
+
/** Evaluate using the provided context fields. Returns the raw LLM output (unknown). */
|
|
80
|
+
evaluate(fields: Readonly<Record<string, string>>): Promise<unknown>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Lineage resolver type (CandidateLineage from Layer 2, injected by caller).
|
|
84
|
+
*/
|
|
85
|
+
export interface ProgressiveEvaluatorLineage {
|
|
86
|
+
resolve(startArtifactId: string): Promise<{
|
|
87
|
+
readonly ok: true;
|
|
88
|
+
readonly value: {
|
|
89
|
+
readonly nodes: readonly unknown[];
|
|
90
|
+
};
|
|
91
|
+
} | {
|
|
92
|
+
readonly ok: false;
|
|
93
|
+
readonly error: {
|
|
94
|
+
readonly kind: string;
|
|
95
|
+
};
|
|
96
|
+
}>;
|
|
97
|
+
}
|
|
98
|
+
export interface ProgressiveEvaluatorDeps {
|
|
99
|
+
readonly taskId: string;
|
|
100
|
+
readonly startArtifactId: string;
|
|
101
|
+
readonly stage1Context: Readonly<Record<string, string>>;
|
|
102
|
+
readonly stage2Context?: Readonly<Record<string, string>>;
|
|
103
|
+
readonly llm: ProgressiveEvaluatorLLM;
|
|
104
|
+
readonly lineage?: ProgressiveEvaluatorLineage;
|
|
105
|
+
readonly emit?: (event: ProgressiveEvaluatorEvent) => void;
|
|
106
|
+
}
|
|
107
|
+
export type ProgressiveEvaluatorEvent = {
|
|
108
|
+
readonly type: 'lineage_data_corrupt';
|
|
109
|
+
readonly detail: string;
|
|
110
|
+
} | {
|
|
111
|
+
readonly type: 'stage1_false_negative';
|
|
112
|
+
readonly newConcernKeys: readonly string[];
|
|
113
|
+
};
|
|
114
|
+
export declare function runProgressiveEvaluation(deps: ProgressiveEvaluatorDeps): Promise<ProgressiveEvaluationOutcome>;
|
|
115
|
+
//# sourceMappingURL=progressive-evaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progressive-evaluator.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/progressive-evaluator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,eAAO,MAAM,iCAAiC,MAAM,CAAC;AACrD,eAAO,MAAM,4BAA4B,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AkDvC"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 2 — Progressive Evaluator: two-stage evaluation with flagged criteria
|
|
3
|
+
* (design §6.5).
|
|
4
|
+
*
|
|
5
|
+
* Pure logic only (Core vs Plugin boundary, `antipattern-core-io`).
|
|
6
|
+
*
|
|
7
|
+
* The progressive evaluator runs Stage 1 (summary-level context) first; only
|
|
8
|
+
* when flagged / undetermined / forced-sample does it trigger Stage 2 (tier2
|
|
9
|
+
* full-contentJson re-evaluation). This keeps daily cost low while enabling
|
|
10
|
+
* deep diagnosis on demand.
|
|
11
|
+
*
|
|
12
|
+
* Key invariants:
|
|
13
|
+
* - Stage 2 output is INDEPENDENT — never merged with Stage 1 (rc-7 /
|
|
14
|
+
* ERR-015 / ERR-018 / ERR-019). `stagesRun === 2` ⟹ `finalOutput` is
|
|
15
|
+
* entirely the Stage 2 result.
|
|
16
|
+
* - flagged criteria read DIMENSION_COVERAGE_POLICY (single source of truth),
|
|
17
|
+
* never inline a dimension-name array. Untrusted LLM input is filtered by
|
|
18
|
+
* the policy table before flagging (rc-1 / rc-4).
|
|
19
|
+
* - Deterministic forced sampling via fnv1a32 (no Math.random, design §4.4).
|
|
20
|
+
*/
|
|
21
|
+
import { isRequiredDimension } from './dimension-coverage-policy.js';
|
|
22
|
+
// ── Constants ────────────────────────────────────────────────────────────────
|
|
23
|
+
export const IMPLEMENTATION_FIDELITY_THRESHOLD = 0.7;
|
|
24
|
+
export const FORCED_STAGE2_SAMPLE_MODULUS = 20; // ~5%
|
|
25
|
+
// ── Runtime guards (rc-1 / rc-2 / rc-5) ──────────────────────────────────────
|
|
26
|
+
function isRecord(value) {
|
|
27
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
28
|
+
}
|
|
29
|
+
function readNumber(source, key) {
|
|
30
|
+
if (!isRecord(source) || !Object.hasOwn(source, key))
|
|
31
|
+
return null;
|
|
32
|
+
const v = source[key];
|
|
33
|
+
return typeof v === 'number' && Number.isFinite(v) ? v : null;
|
|
34
|
+
}
|
|
35
|
+
function readBoolean(source, key) {
|
|
36
|
+
if (!isRecord(source) || !Object.hasOwn(source, key))
|
|
37
|
+
return null;
|
|
38
|
+
const v = source[key];
|
|
39
|
+
return typeof v === 'boolean' ? v : null;
|
|
40
|
+
}
|
|
41
|
+
function readStringArray(source, key) {
|
|
42
|
+
if (!isRecord(source) || !Object.hasOwn(source, key))
|
|
43
|
+
return null;
|
|
44
|
+
const v = source[key];
|
|
45
|
+
if (!Array.isArray(v))
|
|
46
|
+
return null;
|
|
47
|
+
return v.filter((el) => typeof el === 'string');
|
|
48
|
+
}
|
|
49
|
+
// ── Deterministic forced sampling (design §4.4) ───────────────────────────────
|
|
50
|
+
/**
|
|
51
|
+
* FNV-1a 32-bit hash. Pure, deterministic, no crypto, no Math.random.
|
|
52
|
+
* Supports the full Unicode range in the input string.
|
|
53
|
+
*/
|
|
54
|
+
export function fnv1a32(input) {
|
|
55
|
+
let hash = 0x811c9dc5;
|
|
56
|
+
for (let i = 0; i < input.length; i++) {
|
|
57
|
+
hash ^= input.charCodeAt(i);
|
|
58
|
+
// FNV prime multiplication with 32-bit overflow wrapping.
|
|
59
|
+
hash = Math.imul(hash, 0x01000193);
|
|
60
|
+
}
|
|
61
|
+
// Convert to unsigned 32-bit.
|
|
62
|
+
return hash >>> 0;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Deterministic ~5% forced Stage 2 sampling. `fnv1a32(taskId) % modulus === 0`.
|
|
66
|
+
* Never uses Math.random or any non-deterministic source (design §4.4).
|
|
67
|
+
*/
|
|
68
|
+
export function isForcedStage2(taskId, modulus = FORCED_STAGE2_SAMPLE_MODULUS) {
|
|
69
|
+
if (modulus <= 0)
|
|
70
|
+
return false;
|
|
71
|
+
return fnv1a32(taskId) % modulus === 0;
|
|
72
|
+
}
|
|
73
|
+
// ── Flagged criteria (design §6.5.3) ─────────────────────────────────────────
|
|
74
|
+
/**
|
|
75
|
+
* Evaluate the three flagged criteria against Stage 1 output (design §6.5.3).
|
|
76
|
+
*
|
|
77
|
+
* Preconditions: none — `stage1Output` is untrusted LLM output (rc-1), read
|
|
78
|
+
* via `Object.hasOwn` (rc-5 / ERR-013).
|
|
79
|
+
*
|
|
80
|
+
* Postconditions:
|
|
81
|
+
* - `flagged === true` iff `reasons` is non-empty.
|
|
82
|
+
* - Three criteria: required-dimension missing, painCoverage.fullyCovered === false,
|
|
83
|
+
* implementationFidelity.score < 0.7.
|
|
84
|
+
* - Fields missing or wrong type → `undetermined` (rc-3: fail loud, never
|
|
85
|
+
* silently pass).
|
|
86
|
+
*
|
|
87
|
+
* Dimension criterion (§6.5.3, measurement-driven tightening):
|
|
88
|
+
* - Only **required** dimension names in `missingDimensions` count. The LLM
|
|
89
|
+
* may stuff optional/excluded/unknown strings in — all filtered out by
|
|
90
|
+
* `isRequiredDimension` before checking. `optionalUncovered` never enters
|
|
91
|
+
* `reasons`.
|
|
92
|
+
*/
|
|
93
|
+
export function evaluateFlaggedCriteria(stage1Output) {
|
|
94
|
+
const reasons = [];
|
|
95
|
+
const undetermined = [];
|
|
96
|
+
if (!isRecord(stage1Output)) {
|
|
97
|
+
// Entire output is malformed — all criteria undetermined.
|
|
98
|
+
return { flagged: false, reasons: [], undetermined: ['output_not_object'] };
|
|
99
|
+
}
|
|
100
|
+
// Criterion 1: required dimension missing (filtered, §6.5.3).
|
|
101
|
+
const compressionFidelity = Object.hasOwn(stage1Output, 'compressionFidelity')
|
|
102
|
+
? stage1Output.compressionFidelity
|
|
103
|
+
: undefined;
|
|
104
|
+
if (isRecord(compressionFidelity)) {
|
|
105
|
+
const missingDims = readStringArray(compressionFidelity, 'missingDimensions');
|
|
106
|
+
if (missingDims === null) {
|
|
107
|
+
undetermined.push('compressionFidelity.missingDimensions');
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
// rc-4: filter untrusted input through the policy table.
|
|
111
|
+
const requiredMissing = missingDims.filter((d) => isRequiredDimension(d));
|
|
112
|
+
if (requiredMissing.length > 0) {
|
|
113
|
+
reasons.push('missing_dimensions');
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
undetermined.push('compressionFidelity');
|
|
119
|
+
}
|
|
120
|
+
// Criterion 2: painCoverage.fullyCovered === false.
|
|
121
|
+
const painCoverage = Object.hasOwn(stage1Output, 'painCoverage')
|
|
122
|
+
? stage1Output.painCoverage
|
|
123
|
+
: undefined;
|
|
124
|
+
if (isRecord(painCoverage)) {
|
|
125
|
+
const fullyCovered = readBoolean(painCoverage, 'fullyCovered');
|
|
126
|
+
if (fullyCovered === null) {
|
|
127
|
+
undetermined.push('painCoverage.fullyCovered');
|
|
128
|
+
}
|
|
129
|
+
else if (fullyCovered === false) {
|
|
130
|
+
reasons.push('pain_not_fully_covered');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
undetermined.push('painCoverage');
|
|
135
|
+
}
|
|
136
|
+
// Criterion 3: implementationFidelity.score < threshold.
|
|
137
|
+
const implFidelity = Object.hasOwn(stage1Output, 'implementationFidelity')
|
|
138
|
+
? stage1Output.implementationFidelity
|
|
139
|
+
: undefined;
|
|
140
|
+
if (isRecord(implFidelity)) {
|
|
141
|
+
const score = readNumber(implFidelity, 'score');
|
|
142
|
+
if (score === null) {
|
|
143
|
+
undetermined.push('implementationFidelity.score');
|
|
144
|
+
}
|
|
145
|
+
else if (score < IMPLEMENTATION_FIDELITY_THRESHOLD) {
|
|
146
|
+
reasons.push('implementation_fidelity_below_threshold');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
undetermined.push('implementationFidelity');
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
flagged: reasons.length > 0,
|
|
154
|
+
reasons,
|
|
155
|
+
undetermined,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Run the two-stage progressive evaluation (design §6.5).
|
|
160
|
+
*
|
|
161
|
+
* Stage 1: evaluate with summary-level context → flagged criteria.
|
|
162
|
+
* If not flagged AND not forced AND no undetermined → return Stage 1 result.
|
|
163
|
+
* Otherwise → Stage 2: resolve tier2 lineage, evaluate independently.
|
|
164
|
+
*
|
|
165
|
+
* Stage 2 output is INDEPENDENT (rc-7 / ERR-015 / ERR-018 / ERR-019):
|
|
166
|
+
* - Stage 1 output is NOT injected into Stage 2 context.
|
|
167
|
+
* - Stage 2 concerns are NOT merged with Stage 1.
|
|
168
|
+
* - `stagesRun === 2` → `finalOutput` is entirely Stage 2's result.
|
|
169
|
+
*
|
|
170
|
+
* Forced sampling (~5%) serves as a false-negative check: if Stage 1 passed
|
|
171
|
+
* but Stage 2 finds new concerns, emit `stage1_false_negative`.
|
|
172
|
+
*/
|
|
173
|
+
/**
|
|
174
|
+
* Extract concern identifiers from an evaluator output (best-effort).
|
|
175
|
+
* The evaluator schema (evaluator-output.ts) defines `evaluation.concerns` as
|
|
176
|
+
* a `string[]` — each concern is a plain string. This function returns those
|
|
177
|
+
* strings directly, filtering out any non-string elements defensively.
|
|
178
|
+
* (CodeRabbit PR #1277: previously assumed concerns were objects with key/
|
|
179
|
+
* description fields, but the schema is string[] — the mismatch meant
|
|
180
|
+
* diffConcernKeys always returned empty, disabling false-negative detection.)
|
|
181
|
+
*/
|
|
182
|
+
function extractConcernKeys(output) {
|
|
183
|
+
if (!isRecord(output))
|
|
184
|
+
return [];
|
|
185
|
+
const evaluation = Object.hasOwn(output, 'evaluation') ? output.evaluation : undefined;
|
|
186
|
+
if (!isRecord(evaluation))
|
|
187
|
+
return [];
|
|
188
|
+
const concerns = Object.hasOwn(evaluation, 'concerns') ? evaluation.concerns : undefined;
|
|
189
|
+
if (!Array.isArray(concerns))
|
|
190
|
+
return [];
|
|
191
|
+
return concerns.filter((c) => typeof c === 'string' && c !== '');
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Compute the set difference of concern keys between Stage 2 and Stage 1.
|
|
195
|
+
* Returns keys present in Stage 2 but not in Stage 1.
|
|
196
|
+
*/
|
|
197
|
+
function diffConcernKeys(stage2Output, stage1Output) {
|
|
198
|
+
const keys1 = extractConcernKeys(stage1Output);
|
|
199
|
+
const keys2 = extractConcernKeys(stage2Output);
|
|
200
|
+
const set1 = new Set(keys1);
|
|
201
|
+
return keys2.filter((k) => !set1.has(k));
|
|
202
|
+
}
|
|
203
|
+
export async function runProgressiveEvaluation(deps) {
|
|
204
|
+
const emit = deps.emit ?? (() => undefined);
|
|
205
|
+
// Stage 1: summary-level evaluation.
|
|
206
|
+
const out1 = await deps.llm.evaluate(deps.stage1Context);
|
|
207
|
+
const d1 = evaluateFlaggedCriteria(out1);
|
|
208
|
+
const forced = isForcedStage2(deps.taskId);
|
|
209
|
+
// No Stage 2 needed.
|
|
210
|
+
if (!d1.flagged && !forced && d1.undetermined.length === 0) {
|
|
211
|
+
return { finalOutput: out1, stagesRun: 1, stage1Decision: d1, forcedStage2: false };
|
|
212
|
+
}
|
|
213
|
+
// Stage 2 triggered. Resolve tier2 lineage first.
|
|
214
|
+
if (deps.lineage !== undefined) {
|
|
215
|
+
const tier2 = await deps.lineage.resolve(deps.startArtifactId);
|
|
216
|
+
if (!tier2.ok) {
|
|
217
|
+
emit({ type: 'lineage_data_corrupt', detail: tier2.error.kind });
|
|
218
|
+
return {
|
|
219
|
+
finalOutput: out1,
|
|
220
|
+
stagesRun: 1,
|
|
221
|
+
stage1Decision: d1,
|
|
222
|
+
forcedStage2: forced,
|
|
223
|
+
stage2Aborted: { reason: 'lineage_error', detail: tier2.error.kind },
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
// Stage 2: independent re-evaluation with tier2 context.
|
|
228
|
+
// rc-7: do NOT inject out1, d1, or Stage 1 concerns into Stage 2.
|
|
229
|
+
const stage2Ctx = deps.stage2Context ?? deps.stage1Context;
|
|
230
|
+
const out2 = await deps.llm.evaluate(stage2Ctx);
|
|
231
|
+
// False-negative check (forced sample only, Stage 1 not flagged).
|
|
232
|
+
let falseNeg;
|
|
233
|
+
if (forced && !d1.flagged) {
|
|
234
|
+
const newKeys = diffConcernKeys(out2, out1);
|
|
235
|
+
if (newKeys.length > 0) {
|
|
236
|
+
falseNeg = { newConcernKeys: newKeys };
|
|
237
|
+
emit({ type: 'stage1_false_negative', newConcernKeys: newKeys });
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
finalOutput: out2,
|
|
242
|
+
stagesRun: 2,
|
|
243
|
+
stage1Decision: d1,
|
|
244
|
+
forcedStage2: forced,
|
|
245
|
+
stage1FalseNegative: falseNeg,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=progressive-evaluator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progressive-evaluator.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/progressive-evaluator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,gFAAgF;AAEhF,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAG,CAAC;AACrD,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC,CAAC,MAAM;AAwBtD,gFAAgF;AAEhF,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,UAAU,CAAC,MAAe,EAAE,GAAW;IAC9C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAClE,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,C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,CAAC;IAED,yDAAyD;IACzD,kEAAkE;IAClE,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC;IAC3D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEhD,kEAAkE;IAClE,IAAI,QAAoE,CAAC;IACzE,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5C,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,QAAQ,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC;YACvC,IAAI,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,OAAO;QACL,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,CAAC;QACZ,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,MAAM;QACpB,mBAAmB,EAAE,QAAQ;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 1 — PromptBudgetManager: budgeted context allocation (design §6.3).
|
|
3
|
+
*
|
|
4
|
+
* Pure logic only (Core vs Plugin boundary, `antipattern-core-io`).
|
|
5
|
+
*
|
|
6
|
+
* `allocateContext` takes a manifest + the available field values (as a
|
|
7
|
+
* `ReadonlyMap<string, unknown>`, rc-1) and produces an `AllocatedContext`:
|
|
8
|
+
* which fields fit the budget, which were truncated, which were dropped, and
|
|
9
|
+
* which were absent. It is a PURE allocation function — it does NOT decide
|
|
10
|
+
* whether to fall back to full-predecessor injection; that decision lives in
|
|
11
|
+
* `resolveInjection` (resolve-injection.ts, task 5.10).
|
|
12
|
+
*
|
|
13
|
+
* Key correctness properties (design §6.3 postconditions):
|
|
14
|
+
* - `usedTokens <= budgetTokens`
|
|
15
|
+
* - every dropped/truncated field has a TruncationRecord AND emits a
|
|
16
|
+
* `context_truncated` event (rc-9 — never silently lose a field; the base
|
|
17
|
+
* proposal `break`ed on budget exhaustion, dropping remaining fields
|
|
18
|
+
* without record — ERR-002)
|
|
19
|
+
* - identical input always yields identical output (total order by
|
|
20
|
+
* (rank ASC, path ASC), no randomness, no time dependency)
|
|
21
|
+
* - unknown values go through `safeStringifyPreview` (rc-8) before token
|
|
22
|
+
* estimation
|
|
23
|
+
*
|
|
24
|
+
* budgetTokens scope (design §6.2.1 / §6.3 — MUST be reflected in comments):
|
|
25
|
+
* covers ONLY manifest-declared injection fields (tier0/tier1/tier2). Does NOT
|
|
26
|
+
* include core grounding, runner base instructions, or output-schema
|
|
27
|
+
* descriptions. `usedTokens <= budgetTokens` is an injection-field budget
|
|
28
|
+
* ceiling, NOT a prompt-total-length hard cap.
|
|
29
|
+
*/
|
|
30
|
+
import type { ContextManifest } from './context-manifest.js';
|
|
31
|
+
import type { SummaryRunnerKind } from './artifact-summary.js';
|
|
32
|
+
/** char/4 heuristic; no tokenizer dependency. Monotonically non-decreasing, pure. */
|
|
33
|
+
export declare function estimateTokens(text: string): number;
|
|
34
|
+
/** Max chars of a single field's serialized preview before token estimation. */
|
|
35
|
+
export declare const FIELD_PREVIEW_MAX_CHARS = 600;
|
|
36
|
+
/**
|
|
37
|
+
* Below this remaining budget, a field is dropped whole rather than
|
|
38
|
+
* partially truncated — a partial slice shorter than this carries too little
|
|
39
|
+
* signal to be worth the slot. Expressed in tokens (≈ 4 chars each).
|
|
40
|
+
*/
|
|
41
|
+
export declare const MIN_USEFUL_TOKENS = 8;
|
|
42
|
+
/** Appended to partially-truncated field text so truncation is explicit (rc-9). */
|
|
43
|
+
export declare const TRUNCATION_MARKER = "\u2026[budget-truncated]";
|
|
44
|
+
export interface TruncationRecord {
|
|
45
|
+
readonly fieldPath: string;
|
|
46
|
+
readonly reason: 'budget_exceeded' | 'partially_truncated';
|
|
47
|
+
readonly remainingBudgetTokens: number;
|
|
48
|
+
readonly keptChars: number;
|
|
49
|
+
readonly droppedChars: number;
|
|
50
|
+
}
|
|
51
|
+
export interface AllocatedContext {
|
|
52
|
+
readonly manifestId: string;
|
|
53
|
+
/** Fields that fit (fully or partially) into the budget. */
|
|
54
|
+
readonly fields: Readonly<Record<string, string>>;
|
|
55
|
+
/** Fields dropped/truncated, each with a reason (rc-9). */
|
|
56
|
+
readonly truncated: readonly TruncationRecord[];
|
|
57
|
+
/** Manifest-declared paths not present in the available map. */
|
|
58
|
+
readonly absent: readonly string[];
|
|
59
|
+
readonly usedTokens: number;
|
|
60
|
+
readonly budgetTokens: number;
|
|
61
|
+
}
|
|
62
|
+
export interface ContextTruncatedEvent {
|
|
63
|
+
readonly type: 'context_truncated';
|
|
64
|
+
readonly runnerKind: SummaryRunnerKind;
|
|
65
|
+
readonly manifestId: string;
|
|
66
|
+
readonly fieldPath: string;
|
|
67
|
+
readonly reason: TruncationRecord['reason'];
|
|
68
|
+
readonly remainingBudgetTokens: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Allocate manifest-declared fields into the token budget (design §6.3).
|
|
72
|
+
*
|
|
73
|
+
* Preconditions: `manifest.budgetTokens > 0`; `available` values are `unknown`
|
|
74
|
+
* (rc-1) and are narrowed only via `safeStringifyPreview`.
|
|
75
|
+
*
|
|
76
|
+
* Postconditions:
|
|
77
|
+
* - `usedTokens <= budgetTokens`
|
|
78
|
+
* - every dropped/truncated field has a TruncationRecord and emitted a
|
|
79
|
+
* `context_truncated` event (rc-9)
|
|
80
|
+
* - identical input → identical output (total order, deterministic)
|
|
81
|
+
*
|
|
82
|
+
* Loop invariant while traversing: `usedTokens + remainingBudget === budgetTokens`
|
|
83
|
+
* (until a partial truncate zeroes remaining).
|
|
84
|
+
*
|
|
85
|
+
* NOTE: this function does NOT perform the information-floor fallback (design
|
|
86
|
+
* §6.2.2). The fallback is decided by `resolveInjection` after reading this
|
|
87
|
+
* function's `absent` array.
|
|
88
|
+
*/
|
|
89
|
+
export declare function allocateContext(manifest: ContextManifest, available: ReadonlyMap<string, unknown>, emit: (event: ContextTruncatedEvent) => void): AllocatedContext;
|
|
90
|
+
//# sourceMappingURL=prompt-budget-manager.d.ts.map
|