create-principles-disciple 1.152.2 → 1.152.4
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/_release/product-identity.json +1 -1
- package/codex-adapter/dist/pd-hook.js +34 -4
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/config/pd-config-store.d.ts +48 -0
- package/console/dist/server/config/pd-config-store.js +273 -93
- package/console/dist/server/index.js +16 -1
- package/console/dist/server/models/ActivationsConsoleModel.d.ts +72 -1
- package/console/dist/server/models/ActivationsConsoleModel.js +92 -14
- package/console/dist/server/models/AdaptiveActivationConsoleModel.d.ts +79 -0
- package/console/dist/server/models/AdaptiveActivationConsoleModel.js +151 -0
- package/console/dist/server/models/ApprovalsConsoleModel.d.ts +28 -0
- package/console/dist/server/models/ApprovalsConsoleModel.js +118 -3
- package/console/dist/server/models/ApprovalsGroupedConsoleModel.d.ts +38 -0
- package/console/dist/server/models/ApprovalsGroupedConsoleModel.js +158 -26
- package/console/dist/server/models/IntentDecisionModel.d.ts +6 -1
- package/console/dist/server/models/IntentDecisionModel.js +17 -9
- package/console/dist/server/models/pipeline-health-metrics.d.ts +128 -0
- package/console/dist/server/models/pipeline-health-metrics.js +225 -0
- package/console/dist/server/routes/approvals.js +14 -0
- package/console/dist/server/routes/config.js +212 -1
- package/console/dist/server/routes/diagnostician.js +13 -2
- package/console/dist/server/routes/intent-decisions.js +19 -1
- package/console/dist/server/routes/pipeline-health.d.ts +9 -0
- package/console/dist/server/routes/pipeline-health.js +124 -0
- package/console/dist/web/assets/app.css +484 -67
- package/console/dist/web/assets/app.js +36 -31
- package/console/dist/web/assets/evidence-art-1.webp +0 -0
- package/console/dist/web/assets/evidence-art-2.webp +0 -0
- package/console/dist/web/assets/evidence-art-3.webp +0 -0
- package/console/dist/web/assets/evidence-art-4.webp +0 -0
- package/console/dist/web/assets/principle-grove.jpg +0 -0
- package/console/dist/web/assets/principle-stone-steps.jpg +0 -0
- package/console/dist/web/assets/principles-art-1.webp +0 -0
- package/console/dist/web/assets/principles-art-2.webp +0 -0
- package/console/dist/web/assets/principles-art-3.webp +0 -0
- package/console/dist/web/assets/principles-art-4.webp +0 -0
- package/console/dist/web/assets/today-art-1.webp +0 -0
- package/console/dist/web/assets/today-art-2.webp +0 -0
- package/console/dist/web/assets/today-art-3.webp +0 -0
- package/console/dist/web/assets/today-art-4.webp +0 -0
- package/core/dist/runtime/activation/activation-types.d.ts +6 -0
- package/core/dist/runtime/activation/activation-types.d.ts.map +1 -1
- package/core/dist/runtime/activation/activation-types.js.map +1 -1
- package/core/dist/runtime/activation/index.d.ts +2 -1
- package/core/dist/runtime/activation/index.d.ts.map +1 -1
- package/core/dist/runtime/activation/index.js +1 -1
- package/core/dist/runtime/activation/index.js.map +1 -1
- package/core/dist/runtime/activation/ledger-identity.d.ts +8 -0
- package/core/dist/runtime/activation/ledger-identity.d.ts.map +1 -1
- package/core/dist/runtime/activation/ledger-identity.js +20 -1
- package/core/dist/runtime/activation/ledger-identity.js.map +1 -1
- package/core/dist/runtime/activation/sqlite-approval-store.d.ts +18 -0
- package/core/dist/runtime/activation/sqlite-approval-store.d.ts.map +1 -1
- package/core/dist/runtime/activation/sqlite-approval-store.js +146 -20
- package/core/dist/runtime/activation/sqlite-approval-store.js.map +1 -1
- package/core/dist/runtime/adapter/artificer-l2-adapter.d.ts.map +1 -1
- package/core/dist/runtime/adapter/artificer-l2-adapter.js +11 -4
- package/core/dist/runtime/adapter/artificer-l2-adapter.js.map +1 -1
- package/core/dist/runtime/adapter/l2-agent-loop-adapter.d.ts.map +1 -1
- package/core/dist/runtime/adapter/l2-agent-loop-adapter.js +11 -4
- package/core/dist/runtime/adapter/l2-agent-loop-adapter.js.map +1 -1
- package/core/dist/runtime/adapter/output-repair-contract.d.ts +21 -1
- package/core/dist/runtime/adapter/output-repair-contract.d.ts.map +1 -1
- package/core/dist/runtime/adapter/output-repair-contract.js.map +1 -1
- package/core/dist/runtime/adapter/pi-ai-catalog.d.ts +42 -0
- package/core/dist/runtime/adapter/pi-ai-catalog.d.ts.map +1 -1
- package/core/dist/runtime/adapter/pi-ai-catalog.js +68 -0
- package/core/dist/runtime/adapter/pi-ai-catalog.js.map +1 -1
- package/core/dist/runtime/adapter/pi-ai-connection-probe.d.ts +45 -0
- package/core/dist/runtime/adapter/pi-ai-connection-probe.d.ts.map +1 -0
- package/core/dist/runtime/adapter/pi-ai-connection-probe.js +321 -0
- package/core/dist/runtime/adapter/pi-ai-connection-probe.js.map +1 -0
- package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts +27 -2
- package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
- package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js +71 -10
- package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js.map +1 -1
- package/core/dist/runtime/adapter/schema-prompt-adapter.d.ts.map +1 -1
- package/core/dist/runtime/adapter/schema-prompt-adapter.js +39 -6
- package/core/dist/runtime/adapter/schema-prompt-adapter.js.map +1 -1
- package/core/dist/runtime/adapter/structured-output-repair.d.ts +26 -0
- package/core/dist/runtime/adapter/structured-output-repair.d.ts.map +1 -1
- package/core/dist/runtime/adapter/structured-output-repair.js +140 -2
- package/core/dist/runtime/adapter/structured-output-repair.js.map +1 -1
- package/core/dist/runtime/config/execution-timing.d.ts +56 -0
- package/core/dist/runtime/config/execution-timing.d.ts.map +1 -0
- package/core/dist/runtime/config/execution-timing.js +76 -0
- package/core/dist/runtime/config/execution-timing.js.map +1 -0
- package/core/dist/runtime/config/index.d.ts +4 -0
- package/core/dist/runtime/config/index.d.ts.map +1 -1
- package/core/dist/runtime/config/index.js +2 -0
- package/core/dist/runtime/config/index.js.map +1 -1
- package/core/dist/runtime/config/pd-config-redaction.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-redaction.js +4 -0
- package/core/dist/runtime/config/pd-config-redaction.js.map +1 -1
- package/core/dist/runtime/config/pd-config-types.d.ts +5 -0
- package/core/dist/runtime/config/pd-config-types.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-types.js.map +1 -1
- package/core/dist/runtime/config/pd-credentials.d.ts +105 -0
- package/core/dist/runtime/config/pd-credentials.d.ts.map +1 -0
- package/core/dist/runtime/config/pd-credentials.js +409 -0
- package/core/dist/runtime/config/pd-credentials.js.map +1 -0
- package/core/dist/runtime/diagnostician/diag-rootcause-output.d.ts +13 -2
- package/core/dist/runtime/diagnostician/diag-rootcause-output.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/diag-rootcause-output.js.map +1 -1
- package/core/dist/runtime/diagnostician/diagnostic-context-budget.d.ts +45 -0
- package/core/dist/runtime/diagnostician/diagnostic-context-budget.d.ts.map +1 -0
- package/core/dist/runtime/diagnostician/diagnostic-context-budget.js +74 -0
- package/core/dist/runtime/diagnostician/diagnostic-context-budget.js.map +1 -0
- package/core/dist/runtime/diagnostician/prompt-projection.d.ts +51 -0
- package/core/dist/runtime/diagnostician/prompt-projection.d.ts.map +1 -0
- package/core/dist/runtime/diagnostician/prompt-projection.js +192 -0
- package/core/dist/runtime/diagnostician/prompt-projection.js.map +1 -0
- package/core/dist/runtime/diagnostician-output.d.ts +1 -1
- package/core/dist/runtime/diagnostician-output.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician-output.js +2 -2
- package/core/dist/runtime/diagnostician-output.js.map +1 -1
- package/core/dist/runtime/index.d.ts +5 -2
- package/core/dist/runtime/index.d.ts.map +1 -1
- package/core/dist/runtime/index.js +11 -1
- package/core/dist/runtime/index.js.map +1 -1
- package/core/dist/runtime/intent/index.d.ts +2 -0
- package/core/dist/runtime/intent/index.d.ts.map +1 -1
- package/core/dist/runtime/intent/index.js +2 -0
- package/core/dist/runtime/intent/index.js.map +1 -1
- package/core/dist/runtime/intent/intent-decision-record.d.ts +51 -3
- package/core/dist/runtime/intent/intent-decision-record.d.ts.map +1 -1
- package/core/dist/runtime/intent/intent-snapshot.d.ts +104 -0
- package/core/dist/runtime/intent/intent-snapshot.d.ts.map +1 -0
- package/core/dist/runtime/intent/intent-snapshot.js +164 -0
- package/core/dist/runtime/intent/intent-snapshot.js.map +1 -0
- package/core/dist/runtime/intent/strategic-conflict-gate.d.ts +70 -0
- package/core/dist/runtime/intent/strategic-conflict-gate.d.ts.map +1 -0
- package/core/dist/runtime/intent/strategic-conflict-gate.js +148 -0
- package/core/dist/runtime/intent/strategic-conflict-gate.js.map +1 -0
- package/core/dist/runtime/internalization/artificer-runner.js +1 -1
- package/core/dist/runtime/internalization/artificer-runner.js.map +1 -1
- package/core/dist/runtime/internalization/diag-distiller-runner.d.ts +6 -0
- package/core/dist/runtime/internalization/diag-distiller-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-distiller-runner.js +62 -5
- package/core/dist/runtime/internalization/diag-distiller-runner.js.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts +41 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.js +190 -43
- package/core/dist/runtime/internalization/diag-rootcause-runner.js.map +1 -1
- package/core/dist/runtime/internalization/diag-router-runner.d.ts +6 -0
- package/core/dist/runtime/internalization/diag-router-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-router-runner.js +114 -69
- package/core/dist/runtime/internalization/diag-router-runner.js.map +1 -1
- package/core/dist/runtime/internalization/dreamer-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/dreamer-prompt-builder.js +3 -0
- package/core/dist/runtime/internalization/dreamer-prompt-builder.js.map +1 -1
- package/core/dist/runtime/internalization/dreamer-runner.js +1 -1
- package/core/dist/runtime/internalization/dreamer-runner.js.map +1 -1
- package/core/dist/runtime/internalization/evaluator-runner.js +4 -4
- package/core/dist/runtime/internalization/evaluator-runner.js.map +1 -1
- package/core/dist/runtime/internalization/formation-context.d.ts +54 -0
- package/core/dist/runtime/internalization/formation-context.d.ts.map +1 -1
- package/core/dist/runtime/internalization/formation-context.js +135 -3
- package/core/dist/runtime/internalization/formation-context.js.map +1 -1
- package/core/dist/runtime/internalization/index.d.ts +2 -2
- package/core/dist/runtime/internalization/index.d.ts.map +1 -1
- package/core/dist/runtime/internalization/index.js +1 -1
- package/core/dist/runtime/internalization/index.js.map +1 -1
- package/core/dist/runtime/internalization/intent-contract.d.ts +107 -0
- package/core/dist/runtime/internalization/intent-contract.d.ts.map +1 -1
- package/core/dist/runtime/internalization/intent-contract.js +315 -4
- package/core/dist/runtime/internalization/intent-contract.js.map +1 -1
- package/core/dist/runtime/internalization/peer-runner-contracts.d.ts +8 -0
- package/core/dist/runtime/internalization/peer-runner-contracts.d.ts.map +1 -1
- package/core/dist/runtime/internalization/peer-runner-contracts.js.map +1 -1
- package/core/dist/runtime/internalization/philosopher-prompt-builder.d.ts +22 -1
- package/core/dist/runtime/internalization/philosopher-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/philosopher-prompt-builder.js +22 -3
- package/core/dist/runtime/internalization/philosopher-prompt-builder.js.map +1 -1
- package/core/dist/runtime/internalization/philosopher-runner.d.ts +15 -0
- package/core/dist/runtime/internalization/philosopher-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/philosopher-runner.js +74 -2
- package/core/dist/runtime/internalization/philosopher-runner.js.map +1 -1
- package/core/dist/runtime/internalization/pitask-metadata.d.ts +32 -0
- package/core/dist/runtime/internalization/pitask-metadata.d.ts.map +1 -1
- package/core/dist/runtime/internalization/pitask-metadata.js +44 -0
- package/core/dist/runtime/internalization/pitask-metadata.js.map +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts +6 -1
- package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-runner.js +31 -15
- package/core/dist/runtime/internalization/rollout-reviewer-runner.js.map +1 -1
- package/core/dist/runtime/internalization/scribe-output.d.ts +21 -0
- package/core/dist/runtime/internalization/scribe-output.d.ts.map +1 -1
- package/core/dist/runtime/internalization/scribe-output.js +125 -2
- package/core/dist/runtime/internalization/scribe-output.js.map +1 -1
- package/core/dist/runtime/internalization/scribe-prompt-builder.d.ts +26 -1
- package/core/dist/runtime/internalization/scribe-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/scribe-prompt-builder.js +33 -3
- package/core/dist/runtime/internalization/scribe-prompt-builder.js.map +1 -1
- package/core/dist/runtime/internalization/scribe-runner.d.ts +32 -2
- package/core/dist/runtime/internalization/scribe-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/scribe-runner.js +106 -8
- package/core/dist/runtime/internalization/scribe-runner.js.map +1 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts +46 -0
- package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.js +220 -20
- package/core/dist/runtime/internalization/split-diagnostician-runner.js.map +1 -1
- package/core/dist/runtime/internalization-integrity-remediation.d.ts +7 -0
- package/core/dist/runtime/internalization-integrity-remediation.d.ts.map +1 -1
- package/core/dist/runtime/internalization-integrity-remediation.js +44 -12
- package/core/dist/runtime/internalization-integrity-remediation.js.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.js +25 -4
- package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime/pain-submit-capability.js +5 -5
- package/core/dist/runtime/pain-submit-capability.js.map +1 -1
- package/core/dist/runtime/runner/base-peer-runner.d.ts +90 -2
- package/core/dist/runtime/runner/base-peer-runner.d.ts.map +1 -1
- package/core/dist/runtime/runner/base-peer-runner.js +463 -170
- package/core/dist/runtime/runner/base-peer-runner.js.map +1 -1
- package/core/dist/runtime/runner/peer-runner-types.d.ts +19 -0
- package/core/dist/runtime/runner/peer-runner-types.d.ts.map +1 -1
- package/core/dist/runtime/runtime-protocol.d.ts +19 -0
- package/core/dist/runtime/runtime-protocol.d.ts.map +1 -1
- package/core/dist/runtime/signal-collector/llm-stage.d.ts +5 -0
- package/core/dist/runtime/signal-collector/llm-stage.d.ts.map +1 -1
- package/core/dist/runtime/signal-collector/llm-stage.js.map +1 -1
- package/core/dist/runtime/store/artifact/sqlite-pi-artifact-store.d.ts +14 -0
- package/core/dist/runtime/store/artifact/sqlite-pi-artifact-store.d.ts.map +1 -1
- package/core/dist/runtime/store/artifact/sqlite-pi-artifact-store.js +16 -1
- package/core/dist/runtime/store/artifact/sqlite-pi-artifact-store.js.map +1 -1
- package/core/dist/runtime/store/commit/diagnostician-committer.d.ts +19 -0
- package/core/dist/runtime/store/commit/diagnostician-committer.d.ts.map +1 -1
- package/core/dist/runtime/store/commit/diagnostician-committer.js +11 -0
- package/core/dist/runtime/store/commit/diagnostician-committer.js.map +1 -1
- package/core/dist/runtime/store/intent/sqlite-intent-decision-store.d.ts +2 -2
- package/core/dist/runtime/store/intent/sqlite-intent-decision-store.d.ts.map +1 -1
- package/core/dist/runtime/store/intent/sqlite-intent-decision-store.js +285 -35
- package/core/dist/runtime/store/intent/sqlite-intent-decision-store.js.map +1 -1
- package/core/dist/runtime/store/lifecycle/fenced-task-writer.d.ts +64 -0
- package/core/dist/runtime/store/lifecycle/fenced-task-writer.d.ts.map +1 -0
- package/core/dist/runtime/store/lifecycle/fenced-task-writer.js +231 -0
- package/core/dist/runtime/store/lifecycle/fenced-task-writer.js.map +1 -0
- package/core/dist/runtime/store/lifecycle/index.d.ts +2 -0
- package/core/dist/runtime/store/lifecycle/index.d.ts.map +1 -1
- package/core/dist/runtime/store/lifecycle/index.js +1 -0
- package/core/dist/runtime/store/lifecycle/index.js.map +1 -1
- package/core/dist/runtime/store/lifecycle/lease-fence.d.ts +80 -0
- package/core/dist/runtime/store/lifecycle/lease-fence.d.ts.map +1 -0
- package/core/dist/runtime/store/lifecycle/lease-fence.js +79 -0
- package/core/dist/runtime/store/lifecycle/lease-fence.js.map +1 -0
- package/core/dist/runtime/store/lifecycle/lease-heartbeat.d.ts +118 -0
- package/core/dist/runtime/store/lifecycle/lease-heartbeat.d.ts.map +1 -0
- package/core/dist/runtime/store/lifecycle/lease-heartbeat.js +187 -0
- package/core/dist/runtime/store/lifecycle/lease-heartbeat.js.map +1 -0
- package/core/dist/runtime/store/lifecycle/lease-manager.d.ts +30 -20
- package/core/dist/runtime/store/lifecycle/lease-manager.d.ts.map +1 -1
- package/core/dist/runtime/store/lifecycle/lease-manager.js +94 -53
- package/core/dist/runtime/store/lifecycle/lease-manager.js.map +1 -1
- package/core/dist/runtime/store/lifecycle/recovery-sweep.d.ts.map +1 -1
- package/core/dist/runtime/store/lifecycle/recovery-sweep.js +32 -15
- package/core/dist/runtime/store/lifecycle/recovery-sweep.js.map +1 -1
- package/core/dist/runtime/store/run/sqlite-run-store.d.ts +29 -0
- package/core/dist/runtime/store/run/sqlite-run-store.d.ts.map +1 -1
- package/core/dist/runtime/store/run/sqlite-run-store.js +40 -0
- package/core/dist/runtime/store/run/sqlite-run-store.js.map +1 -1
- package/core/dist/runtime/store/runtime-state-manager.d.ts +64 -10
- package/core/dist/runtime/store/runtime-state-manager.d.ts.map +1 -1
- package/core/dist/runtime/store/runtime-state-manager.js +154 -89
- package/core/dist/runtime/store/runtime-state-manager.js.map +1 -1
- package/core/dist/runtime/store/sqlite-connection.d.ts.map +1 -1
- package/core/dist/runtime/store/sqlite-connection.js +73 -4
- package/core/dist/runtime/store/sqlite-connection.js.map +1 -1
- package/core/dist/runtime/store/task/sqlite-task-store.d.ts.map +1 -1
- package/core/dist/runtime/store/task/sqlite-task-store.js +6 -3
- package/core/dist/runtime/store/task/sqlite-task-store.js.map +1 -1
- package/core/dist/runtime/task-status.d.ts +16 -0
- package/core/dist/runtime/task-status.d.ts.map +1 -1
- package/core/dist/runtime/task-status.js +8 -0
- package/core/dist/runtime/task-status.js.map +1 -1
- package/core/dist/runtime/trajectory-schema.d.ts.map +1 -1
- package/core/dist/runtime/trajectory-schema.js +20 -1
- package/core/dist/runtime/trajectory-schema.js.map +1 -1
- package/core/dist/runtime/types/event-types.d.ts +20 -0
- package/core/dist/runtime/types/event-types.d.ts.map +1 -1
- package/core/dist/runtime/types/event-types.js +7 -0
- package/core/dist/runtime/types/event-types.js.map +1 -1
- package/core/dist/telemetry-event.d.ts +2 -2
- package/core/dist/telemetry-event.d.ts.map +1 -1
- package/core/dist/telemetry-event.js +27 -2
- package/core/dist/telemetry-event.js.map +1 -1
- package/core/dist/trajectory-types.d.ts +33 -0
- package/core/dist/trajectory-types.d.ts.map +1 -1
- package/core/package.json +1 -1
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +12 -5
- package/dist/installer.js.map +1 -1
- package/dist/installers/codex-host-installer.d.ts.map +1 -1
- package/dist/installers/codex-host-installer.js +9 -12
- package/dist/installers/codex-host-installer.js.map +1 -1
- package/host-runtime/dist/adaptive-consumer-schedule.d.ts +103 -0
- package/host-runtime/dist/adaptive-consumer-schedule.js +145 -0
- package/host-runtime/dist/adaptive-priority-provider.d.ts +7 -1
- package/host-runtime/dist/adaptive-priority-provider.js +6 -3
- package/host-runtime/dist/adaptive-selection.d.ts +1 -1
- package/host-runtime/dist/adaptive-selection.js +2 -1
- package/host-runtime/dist/degraded-enforcement-marker.d.ts +35 -0
- package/host-runtime/dist/degraded-enforcement-marker.js +79 -0
- package/host-runtime/dist/index.d.ts +2 -0
- package/host-runtime/dist/index.js +8 -0
- package/host-runtime/dist/internalization-consumer-cycle.d.ts +35 -0
- package/host-runtime/dist/internalization-consumer-cycle.js +51 -17
- package/host-runtime/dist/prompt-activation-deliverability.d.ts +10 -0
- package/host-runtime/dist/prompt-activation-deliverability.js +5 -2
- package/host-runtime/dist/prompt-injection-event-evidence.d.ts +34 -0
- package/host-runtime/dist/prompt-injection-event-evidence.js +96 -0
- package/host-runtime/dist/signal-classifier.js +4 -4
- package/host-runtime/package.json +1 -1
- package/install-layout/dist/mcp-binding-contract.js +4 -15
- package/install-layout/package.json +1 -1
- package/package.json +3 -3
- package/pd-cli/dist/commands/health-codex.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-codex.js +26 -1
- package/pd-cli/dist/commands/health-codex.js.map +1 -1
- package/pd-cli/dist/commands/health.d.ts.map +1 -1
- package/pd-cli/dist/commands/health.js +32 -2
- package/pd-cli/dist/commands/health.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +6 -4
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/dist/commands/runtime-init.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-init.js +29 -1
- package/pd-cli/dist/commands/runtime-init.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.js +9 -14
- package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-rulehost.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-rulehost.js +5 -5
- package/pd-cli/dist/commands/runtime-internalization-run-rulehost.js.map +1 -1
- package/pd-cli/dist/commands/runtime-usage.d.ts +62 -0
- package/pd-cli/dist/commands/runtime-usage.d.ts.map +1 -0
- package/pd-cli/dist/commands/runtime-usage.js +315 -0
- package/pd-cli/dist/commands/runtime-usage.js.map +1 -0
- package/pd-cli/dist/commands/runtime.js +6 -6
- package/pd-cli/dist/commands/runtime.js.map +1 -1
- package/pd-cli/dist/index.d.ts.map +1 -1
- package/pd-cli/dist/index.js +51 -17
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/dist/program.d.ts.map +1 -1
- package/pd-cli/dist/program.js +4 -0
- package/pd-cli/dist/program.js.map +1 -1
- package/pd-cli/dist/services/cli-invocation-log.d.ts +66 -0
- package/pd-cli/dist/services/cli-invocation-log.d.ts.map +1 -0
- package/pd-cli/dist/services/cli-invocation-log.js +139 -0
- package/pd-cli/dist/services/cli-invocation-log.js.map +1 -0
- package/pd-cli/dist/services/config-doctor.d.ts.map +1 -1
- package/pd-cli/dist/services/config-doctor.js +5 -4
- package/pd-cli/dist/services/config-doctor.js.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.js +6 -2
- package/pd-cli/dist/services/demo-story-a-runner.js.map +1 -1
- package/pd-cli/dist/services/pd-config-loader.d.ts +3 -1
- package/pd-cli/dist/services/pd-config-loader.d.ts.map +1 -1
- package/pd-cli/dist/services/pd-config-loader.js +20 -8
- package/pd-cli/dist/services/pd-config-loader.js.map +1 -1
- package/pd-cli/dist/services/runtime-adapter-resolver.d.ts.map +1 -1
- package/pd-cli/dist/services/runtime-adapter-resolver.js +5 -5
- package/pd-cli/dist/services/runtime-adapter-resolver.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +632 -536
- package/plugin/dist/core/signal-collector-host.d.ts +5 -0
- package/plugin/dist/governance-audit.js +2 -2
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/rulehost-evidence.js +13 -10
- package/plugin/dist/service/internalization-auto-consumer-service.d.ts +2 -1
- package/plugin/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +1 -1
- package/plugin/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/plugin/templates/langs/en/skills/pd-pain-signal/SKILL.md +1 -1
- package/plugin/templates/langs/zh/skills/pd-pain-signal/SKILL.md +1 -1
- package/release-manager/dist/installer.js +12 -5
- package/release-manager/dist/installers/codex-host-installer.js +9 -12
- package/release-manager/package.json +1 -1
- package/workbuddy-adapter/package.json +1 -1
- package/workbuddy-adapter/plugin/skills/pd-pain-signal/SKILL.md +1 -1
- package/dist/installers/mcp-binding-shape-mirror.d.ts +0 -27
- package/dist/installers/mcp-binding-shape-mirror.d.ts.map +0 -1
- package/dist/installers/mcp-binding-shape-mirror.js +0 -105
- package/dist/installers/mcp-binding-shape-mirror.js.map +0 -1
- package/release-manager/dist/installers/mcp-binding-shape-mirror.js +0 -105
|
@@ -20,13 +20,27 @@
|
|
|
20
20
|
* @see BasePeerRunner in runner/base-peer-runner.ts
|
|
21
21
|
*/
|
|
22
22
|
import { RUNTIME_CONTRACT_SCHEMA_VERSION } from '../schema-version.js';
|
|
23
|
+
import { getIntentFilename } from '../intent/intent-doc.js';
|
|
24
|
+
import { buildIntentSnapshot, filterIntentSnapshotSections, INTENT_SNAPSHOT_SECTION_MAX_CHARS, renderIntentSnapshotDoc, } from '../intent/intent-snapshot.js';
|
|
23
25
|
import { PDRuntimeError } from '../error-categories.js';
|
|
24
|
-
import { hydratePITaskRecord } from './pitask-metadata.js';
|
|
26
|
+
import { hydratePITaskRecord, mergePITaskMetadata, readPersistedIntentSnapshot, serializePITaskMetadata, } from './pitask-metadata.js';
|
|
25
27
|
import { RootCausePromptBuilder } from '../diagnostician/rootcause-prompt-builder.js';
|
|
26
28
|
import { collectTrustedEvidenceRefs, findUnboundEvidenceRefs, formatUnboundEvidenceRefErrors, } from '../diagnostician/evidence-ref-binding.js';
|
|
27
29
|
import { injectRunnerLineageIfAbsent } from './peer-runner-contracts.js';
|
|
28
30
|
import { computeFeatureFlagsFromConfig, isFeatureEnabled } from '../config/pd-config-feature-flags.js';
|
|
29
31
|
import { BasePeerRunner } from '../runner/base-peer-runner.js';
|
|
32
|
+
/** Read the persisted diagnostic JSON without assuming TaskRecord types it. */
|
|
33
|
+
function readDiagnosticJson(task) {
|
|
34
|
+
if (!task)
|
|
35
|
+
return null;
|
|
36
|
+
const raw = task;
|
|
37
|
+
const { diagnosticJson } = raw;
|
|
38
|
+
return typeof diagnosticJson === 'string' ? diagnosticJson : null;
|
|
39
|
+
}
|
|
40
|
+
/** The reader returns an absolute path; its filename is the language witness. */
|
|
41
|
+
function resolveIntentLangFromPath(intentPath) {
|
|
42
|
+
return intentPath.includes(getIntentFilename('en')) ? 'en' : 'zh-CN';
|
|
43
|
+
}
|
|
30
44
|
// ── DiagRootCauseRunner ──────────────────────────────────────────────────────
|
|
31
45
|
/**
|
|
32
46
|
* Stage A runner for the split diagnostician pipeline.
|
|
@@ -73,6 +87,10 @@ export class DiagRootCauseRunner extends BasePeerRunner {
|
|
|
73
87
|
if (!task) {
|
|
74
88
|
throw new PDRuntimeError('input_invalid', `Task ${taskId} not found`);
|
|
75
89
|
}
|
|
90
|
+
// SPEC v1.2 §6.6 / TECH v1.1 §5.4: capture → persist → THEN call the model.
|
|
91
|
+
// Resolved before any expensive work so a failure here costs nothing and
|
|
92
|
+
// can never leave an unpersisted snapshot behind a model invocation.
|
|
93
|
+
const intentSnapshot = await this.resolveIntentSnapshot(task);
|
|
76
94
|
const parentTaskId = task.inputRef || taskId;
|
|
77
95
|
// Assemble pain signal context via ContextAssembler
|
|
78
96
|
const painPayload = await this.contextAssembler.assemble(parentTaskId);
|
|
@@ -100,62 +118,142 @@ export class DiagRootCauseRunner extends BasePeerRunner {
|
|
|
100
118
|
}
|
|
101
119
|
}
|
|
102
120
|
const contextHash = BasePeerRunner.hashContextRefs(contextRefs);
|
|
103
|
-
return {
|
|
121
|
+
return {
|
|
122
|
+
contextHash,
|
|
123
|
+
contextRefs,
|
|
124
|
+
painPayload,
|
|
125
|
+
...(intentSnapshot !== undefined ? { intentSnapshot } : {}),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Resolve the strategic basis for this task (SPEC v1.2 §6.3/§6.6).
|
|
130
|
+
*
|
|
131
|
+
* Order is the contract:
|
|
132
|
+
* 1. persisted `pi_metadata.intentSnapshot` → use it, never touch INTENT.md
|
|
133
|
+
* 2. corrupted persisted snapshot → fail closed (never silently re-capture)
|
|
134
|
+
* 3. absent + flag on + reader → capture, persist via CAS, then continue
|
|
135
|
+
* 4. anything else → no snapshot (degraded, prompt byte-identical)
|
|
136
|
+
*/
|
|
137
|
+
async resolveIntentSnapshot(task) {
|
|
138
|
+
const persisted = readPersistedIntentSnapshot(readDiagnosticJson(task));
|
|
139
|
+
if (persisted.state === 'corrupt') {
|
|
140
|
+
// rc-3: a corrupted strategic input is a real fault. Re-reading the
|
|
141
|
+
// current INTENT.md would silently substitute a different basis.
|
|
142
|
+
throw new PDRuntimeError('input_invalid', `Persisted intent snapshot for task ${task.taskId} is malformed: ${persisted.reason}`);
|
|
143
|
+
}
|
|
144
|
+
if (persisted.state === 'valid')
|
|
145
|
+
return persisted.snapshot;
|
|
146
|
+
// PRI-468 semantics preserved: flag first, then reader; no reader wired is
|
|
147
|
+
// a startup-time factory issue, not a per-task degradation event.
|
|
148
|
+
let intentGrounding = false;
|
|
149
|
+
if (this.effectiveConfig) {
|
|
150
|
+
intentGrounding = isFeatureEnabled(computeFeatureFlagsFromConfig(this.effectiveConfig), 'intent_engineering');
|
|
151
|
+
}
|
|
152
|
+
if (!intentGrounding || !this.intentDocReader)
|
|
153
|
+
return undefined;
|
|
154
|
+
const readResult = this.intentDocReader.readIntentDoc();
|
|
155
|
+
if (!readResult.ok || !readResult.doc) {
|
|
156
|
+
// EP-03 / ERR-002: degrade gracefully but observably.
|
|
157
|
+
this.emitEvent('intent_doc_read_failed', task.taskId, {
|
|
158
|
+
reason: readResult.reason ?? 'unknown',
|
|
159
|
+
nextAction: readResult.nextAction ?? 'Check INTENT.md configuration.',
|
|
160
|
+
flagEnabled: readResult.flagEnabled,
|
|
161
|
+
found: readResult.found,
|
|
162
|
+
});
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
const { doc } = readResult;
|
|
166
|
+
const snapshot = buildIntentSnapshot({
|
|
167
|
+
raw: doc.raw,
|
|
168
|
+
contentHash: doc.contentHash,
|
|
169
|
+
capturedAt: new Date().toISOString(),
|
|
170
|
+
lang: resolveIntentLangFromPath(doc.path),
|
|
171
|
+
});
|
|
172
|
+
if (snapshot.sections.some((section) => section.truncated === true)) {
|
|
173
|
+
this.emitEvent('intent_snapshot_truncated', task.taskId, {
|
|
174
|
+
sectionKeys: snapshot.sections.filter((s) => s.truncated === true).map((s) => s.key),
|
|
175
|
+
maxChars: INTENT_SNAPSHOT_SECTION_MAX_CHARS,
|
|
176
|
+
nextAction: 'Shorten the oversized INTENT.md section(s) so the full strategic basis is preserved.',
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if (task.attemptCount > 1) {
|
|
180
|
+
// SPEC §6.6: crashing between read and persist leaves no artifact, so a
|
|
181
|
+
// retry MUST re-capture. That is legitimate but never silent.
|
|
182
|
+
this.emitEvent('intent_snapshot_capture_incomplete', task.taskId, {
|
|
183
|
+
attemptCount: task.attemptCount,
|
|
184
|
+
reason: 'no_persisted_snapshot_on_retry',
|
|
185
|
+
nextAction: 'Stage A re-captured INTENT.md because the previous attempt did not persist a snapshot.',
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
return await this.persistIntentSnapshot(task, snapshot);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Persist the captured snapshot as TASK INPUT before the model call.
|
|
192
|
+
*
|
|
193
|
+
* Uses the existing diagnostic-json CAS so a concurrent writer's fields
|
|
194
|
+
* (validator history, revision routing, …) are never clobbered. A lost race
|
|
195
|
+
* is not fatal: the winner's durable snapshot IS the input of record, so we
|
|
196
|
+
* adopt it instead of calling the model with an unpersisted value.
|
|
197
|
+
*/
|
|
198
|
+
async persistIntentSnapshot(task, snapshot) {
|
|
199
|
+
const piTask = hydratePITaskRecord(task);
|
|
200
|
+
if (!piTask) {
|
|
201
|
+
throw new PDRuntimeError('context_assembly_failed', `Task ${task.taskId} has no PI metadata; the intent snapshot cannot be persisted before the model call`);
|
|
202
|
+
}
|
|
203
|
+
const nextDiagnosticJson = serializePITaskMetadata(mergePITaskMetadata(piTask, { intentSnapshot: snapshot }));
|
|
204
|
+
const updated = await this.stateManager.updateTaskIfDiagnosticJsonUnchanged(task.taskId, readDiagnosticJson(task), { diagnosticJson: nextDiagnosticJson });
|
|
205
|
+
if (updated)
|
|
206
|
+
return snapshot;
|
|
207
|
+
// CAS lost — re-read and adopt whatever snapshot the winner persisted.
|
|
208
|
+
const reread = await this.stateManager.getTask(task.taskId);
|
|
209
|
+
const winner = readPersistedIntentSnapshot(readDiagnosticJson(reread));
|
|
210
|
+
if (winner.state === 'valid') {
|
|
211
|
+
this.emitEvent('intent_snapshot_cas_conflict', task.taskId, {
|
|
212
|
+
attemptCount: task.attemptCount,
|
|
213
|
+
adoptedContentHash: winner.snapshot.contentHash,
|
|
214
|
+
nextAction: 'A concurrent writer persisted the task input first; its snapshot is the input of record.',
|
|
215
|
+
});
|
|
216
|
+
return winner.snapshot;
|
|
217
|
+
}
|
|
218
|
+
if (winner.state === 'corrupt') {
|
|
219
|
+
throw new PDRuntimeError('input_invalid', `Concurrent write left a malformed intent snapshot on task ${task.taskId}: ${winner.reason}`);
|
|
220
|
+
}
|
|
221
|
+
// No durable snapshot anywhere: the model must NOT run on an unpersisted
|
|
222
|
+
// strategic basis (SPEC §6.6). Retryable — the next attempt re-reads.
|
|
223
|
+
this.emitEvent('intent_snapshot_capture_incomplete', task.taskId, {
|
|
224
|
+
attemptCount: task.attemptCount,
|
|
225
|
+
reason: 'cas_conflict',
|
|
226
|
+
nextAction: 'Retry the stage; no model call was made without a persisted snapshot.',
|
|
227
|
+
});
|
|
228
|
+
throw new PDRuntimeError('context_assembly_failed', `Intent snapshot CAS conflict on task ${task.taskId}; the attempt is retried without invoking the model`);
|
|
104
229
|
}
|
|
105
230
|
async invokeRuntime(taskId, context) {
|
|
106
231
|
// T-E (PRI-371): Read diagnostician_core_grounding flag from effective config.
|
|
107
232
|
let coreGrounding = false;
|
|
108
|
-
// PRI-468: Read intent_engineering flag from effective config.
|
|
109
|
-
let intentGrounding = false;
|
|
110
233
|
// Pain Diagnosis Persistence: Evidence First Attribution rules in the
|
|
111
234
|
// Stage A prompt. Flag off (default) keeps the prompt byte-identical.
|
|
112
235
|
let evidenceFirstAttribution = false;
|
|
113
236
|
if (this.effectiveConfig) {
|
|
114
237
|
const featureFlags = computeFeatureFlagsFromConfig(this.effectiveConfig);
|
|
115
238
|
coreGrounding = isFeatureEnabled(featureFlags, 'diagnostician_core_grounding');
|
|
116
|
-
intentGrounding = isFeatureEnabled(featureFlags, 'intent_engineering');
|
|
117
239
|
evidenceFirstAttribution = isFeatureEnabled(featureFlags, 'pain_diagnosis_persistence');
|
|
118
240
|
}
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
// is not a per-task event; it's a startup-time issue). The prompt stays
|
|
129
|
-
// byte-identical to pre-PRI-468.
|
|
130
|
-
intentGrounding = false;
|
|
131
|
-
}
|
|
132
|
-
else if (intentGrounding && this.intentDocReader) {
|
|
133
|
-
const readResult = this.intentDocReader.readIntentDoc();
|
|
134
|
-
if (readResult.ok && readResult.doc) {
|
|
135
|
-
intentDoc = {
|
|
136
|
-
raw: readResult.doc.raw,
|
|
137
|
-
contentHash: readResult.doc.contentHash,
|
|
138
|
-
path: readResult.doc.path,
|
|
139
|
-
};
|
|
241
|
+
// SPEC v1.2 §6.6 / TECH v1.1 §5.4 step 5: the prompt is rebuilt from the
|
|
242
|
+
// SNAPSHOT resolved in buildContext(). INTENT.md is never read a second
|
|
243
|
+
// time, so a retry cannot switch to a newer strategic basis.
|
|
244
|
+
const { intentSnapshot } = context;
|
|
245
|
+
const intentDoc = intentSnapshot
|
|
246
|
+
? {
|
|
247
|
+
raw: renderIntentSnapshotDoc(intentSnapshot),
|
|
248
|
+
contentHash: intentSnapshot.contentHash,
|
|
249
|
+
path: `.principles/${getIntentFilename(intentSnapshot.lang)}`,
|
|
140
250
|
}
|
|
141
|
-
|
|
142
|
-
// EP-03 / ERR-002: degrade gracefully but observably.
|
|
143
|
-
// Flag stays on in config, but we do not inject INTENT — emit
|
|
144
|
-
// telemetry so the operator can see why INTENT was not injected.
|
|
145
|
-
this.emitEvent('intent_doc_read_failed', taskId, {
|
|
146
|
-
reason: readResult.reason ?? 'unknown',
|
|
147
|
-
nextAction: readResult.nextAction ?? 'Check INTENT.md configuration.',
|
|
148
|
-
flagEnabled: readResult.flagEnabled,
|
|
149
|
-
found: readResult.found,
|
|
150
|
-
});
|
|
151
|
-
intentGrounding = false;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
251
|
+
: undefined;
|
|
154
252
|
const builder = new RootCausePromptBuilder();
|
|
155
253
|
const { message, systemPrompt } = builder.buildPrompt(context.painPayload, {
|
|
156
254
|
outputLanguage: this.resolvedOptions.outputLanguage,
|
|
157
255
|
coreGrounding,
|
|
158
|
-
intentGrounding,
|
|
256
|
+
intentGrounding: intentSnapshot !== undefined,
|
|
159
257
|
intentDoc,
|
|
160
258
|
evidenceFirstAttribution,
|
|
161
259
|
});
|
|
@@ -186,7 +284,7 @@ export class DiagRootCauseRunner extends BasePeerRunner {
|
|
|
186
284
|
};
|
|
187
285
|
}
|
|
188
286
|
// eslint-disable-next-line @typescript-eslint/max-params
|
|
189
|
-
async succeedTask(taskId, runId, output, task, contextHash,
|
|
287
|
+
async succeedTask(taskId, runId, output, task, contextHash, context) {
|
|
190
288
|
// 1. Store output before marking succeeded
|
|
191
289
|
try {
|
|
192
290
|
await this.stateManager.updateRunOutput(runId, JSON.stringify(output));
|
|
@@ -228,7 +326,10 @@ export class DiagRootCauseRunner extends BasePeerRunner {
|
|
|
228
326
|
sourceTaskId: taskId,
|
|
229
327
|
lineageArtifactIds,
|
|
230
328
|
validationStatus: 'pending',
|
|
231
|
-
|
|
329
|
+
// SPEC v1.2 §6.3: `intentSnapshot` is a SERVER-authored sibling key of
|
|
330
|
+
// the model output — the model schema has no such field, so it can
|
|
331
|
+
// neither produce nor overwrite it.
|
|
332
|
+
contentJson: JSON.stringify(this.composeArtifactContent(taskId, output, context.intentSnapshot)),
|
|
232
333
|
createdAt: now,
|
|
233
334
|
updatedAt: now,
|
|
234
335
|
});
|
|
@@ -248,7 +349,7 @@ export class DiagRootCauseRunner extends BasePeerRunner {
|
|
|
248
349
|
// 3. Mark task succeeded
|
|
249
350
|
const resultRef = `${this.config.resultRefPrefix}://${runId}`;
|
|
250
351
|
try {
|
|
251
|
-
await this.
|
|
352
|
+
await this.markSucceededFenced(taskId, resultRef);
|
|
252
353
|
}
|
|
253
354
|
catch (stateErr) {
|
|
254
355
|
this.emitEvent('mark_succeeded_failed', taskId, {
|
|
@@ -277,6 +378,52 @@ export class DiagRootCauseRunner extends BasePeerRunner {
|
|
|
277
378
|
};
|
|
278
379
|
}
|
|
279
380
|
// ── Optional hooks ─────────────────────────────────────────────────────────
|
|
381
|
+
/**
|
|
382
|
+
* Compose the Stage A artifact body (SPEC v1.2 §6.3, TECH v1.1 §3.4).
|
|
383
|
+
*
|
|
384
|
+
* The model output is preserved; the server adds two authoritative facts:
|
|
385
|
+
* - `intentSnapshot`: the captured strategic basis (narrowed to the
|
|
386
|
+
* sections the model declared relevant, when it declared any);
|
|
387
|
+
* - `intentTension.intentDocHash`: ALWAYS the server-computed hash. A
|
|
388
|
+
* model-reported value is never trusted; a differing value is surfaced
|
|
389
|
+
* as `intent_hash_mismatch` instead of being silently rewritten.
|
|
390
|
+
*/
|
|
391
|
+
composeArtifactContent(taskId, output, snapshot) {
|
|
392
|
+
if (!snapshot) {
|
|
393
|
+
// REVIEW FIX (PR #2652 P0-5): `intentSnapshot` is server-authored only.
|
|
394
|
+
// The output schema is permissive about extra keys, so a model that emits
|
|
395
|
+
// its own `intentSnapshot` must never have it persisted as if the server
|
|
396
|
+
// had captured it.
|
|
397
|
+
const content = { ...output };
|
|
398
|
+
delete content.intentSnapshot;
|
|
399
|
+
return content;
|
|
400
|
+
}
|
|
401
|
+
const modelReportedHash = output.intentTension?.intentDocHash;
|
|
402
|
+
// REVIEW FIX (PR #2652 P0-7, SPEC §9.6): a hash mismatch is not a cosmetic
|
|
403
|
+
// replacement. The model judged a DIFFERENT document version, so its
|
|
404
|
+
// strategic fields (`relatedIntentFields` included) are not evidence about
|
|
405
|
+
// the current Owner intent. The tension is dropped, which makes the
|
|
406
|
+
// downstream relevance derivation fall back to `insufficient_evidence`
|
|
407
|
+
// instead of presenting another version's judgment as this version's.
|
|
408
|
+
const hashMismatch = typeof modelReportedHash === 'string' && modelReportedHash !== snapshot.contentHash;
|
|
409
|
+
if (hashMismatch) {
|
|
410
|
+
this.emitEvent('intent_hash_mismatch', taskId, {
|
|
411
|
+
snapshotContentHash: snapshot.contentHash,
|
|
412
|
+
modelReportedHash,
|
|
413
|
+
nextAction: 'The server-computed hash is authoritative; the model-reported value was discarded and the strategic judgment was downgraded to insufficient_evidence.',
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
const intentTension = hashMismatch
|
|
417
|
+
? undefined
|
|
418
|
+
: output.intentTension
|
|
419
|
+
? { ...output.intentTension, intentDocHash: snapshot.contentHash }
|
|
420
|
+
: undefined;
|
|
421
|
+
return {
|
|
422
|
+
...output,
|
|
423
|
+
...(intentTension !== undefined ? { intentTension } : { intentTension: undefined }),
|
|
424
|
+
intentSnapshot: filterIntentSnapshotSections(snapshot, intentTension?.relatedIntentFields ?? []),
|
|
425
|
+
};
|
|
426
|
+
}
|
|
280
427
|
/**
|
|
281
428
|
* Re-inject taskId if stripped by stripLineageFields (PRI-272 / ERR-008).
|
|
282
429
|
* Only fill when absent via Object.hasOwn — present-but-falsy values
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diag-rootcause-runner.js","sourceRoot":"","sources":["../../../src/runtime/internalization/diag-rootcause-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AAOvE,OAAO,EAAE,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OA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kD;QAClD,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,MAAM,EAAE;YACvC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,SAAS;YACT,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM;SAC5C,CAAC,CAAC;QAEH,OAAO;YACL,MAAM,EAAE,WAAW;YACnB,MAAM;YACN,KAAK;YACL,UAAU;YACV,SAAS;YACT,WAAW;YACX,MAAM;YACN,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC;IACJ,CAAC;IAED,8EAA8E;IAE9E;;;;OAIG;IACH,qEAAqE;IAClD,kBAAkB,CAAC,MAAc,EAAE,eAAwB;QAC5E,2BAA2B,CAAC,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAEkB,oBAAoB,CAAC,MAAc,EAAE,MAA6B,EAAE,QAA8B;QACnH,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,MAAM,EAAE;YAC5C,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM;SAC5C,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"diag-rootcause-runner.js","sourceRoot":"","sources":["../../../src/runtime/internalization/diag-rootcause-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AAOvE,OAAO,EAAE,iBAAiB,EAAmB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,iCAAiC,EACjC,uBAAuB,GAExB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B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K,QAAQ,CAAC,WAAW,CAAC;QACzG,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,SAAS,CAAC,sBAAsB,EAAE,MAAM,EAAE;gBAC7C,mBAAmB,EAAE,QAAQ,CAAC,WAAW;gBACzC,iBAAiB;gBACjB,UAAU,EAAE,uJAAuJ;aACpK,CAAC,CAAC;QACL,CAAC;QAED,MAAM,aAAa,GAAG,YAAY;YAChC,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,MAAM,CAAC,aAAa;gBACpB,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,aAAa,EAAE,aAAa,EAAE,QAAQ,CAAC,WAAW,EAAE;gBAClE,CAAC,CAAC,SAAS,CAAC;QAEhB,OAAO;YACL,GAAG,MAAM;YACT,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;YACnF,cAAc,EAAE,4BAA4B,CAC1C,QAAQ,EACR,aAAa,EAAE,mBAAmB,IAAI,EAAE,CACzC;SACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,qEAAqE;IAClD,kBAAkB,CAAC,MAAc,EAAE,eAAwB;QAC5E,2BAA2B,CAAC,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAEkB,oBAAoB,CAAC,MAAc,EAAE,MAA6B,EAAE,QAA8B;QACnH,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,MAAM,EAAE;YAC5C,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM;SAC5C,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -121,6 +121,12 @@ export declare class DiagRouterRunner extends BasePeerRunner<DiagRouterContext,
|
|
|
121
121
|
get permanentErrorCategories(): ReadonlySet<PDErrorCategory>;
|
|
122
122
|
buildContext(taskId: string): Promise<DiagRouterContext>;
|
|
123
123
|
invokeRuntime(taskId: string, context: DiagRouterContext): Promise<RunHandle>;
|
|
124
|
+
/**
|
|
125
|
+
* Record the Stage C projection so a later "why did the router only see part
|
|
126
|
+
* of the context" question is answerable (SPEC §6.2).
|
|
127
|
+
*/
|
|
128
|
+
private emitContextProjection;
|
|
129
|
+
private emitContextBudgetExceeded;
|
|
124
130
|
/**
|
|
125
131
|
* P2-01: persist the exact router message so a NEW process can rebuild the
|
|
126
132
|
* invocation evidence and run the full receipt verification (not just a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diag-router-runner.d.ts","sourceRoot":"","sources":["../../../src/runtime/internalization/diag-router-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,OAAO,EAA8B,KAAK,sBAAsB,EAAE,KAAK,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAC1I,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAEvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAEvF,OAAO,KAAK,EAAE,sBAAsB,EAAgB,MAAM,4CAA4C,CAAC;AACvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"diag-router-runner.d.ts","sourceRoot":"","sources":["../../../src/runtime/internalization/diag-router-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,OAAO,EAA8B,KAAK,sBAAsB,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AO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,yBAAyB;IAiBjC;;;;OAIG;IAEH,UAAmB,yBAAyB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAE3F;IAEK,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAsCtH;IAGK,WAAW,CACf,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,qBAAqB,EAC7B,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC,CAyKlD;IAID;;;;;;;;;;;OAWG;IACH,UAAmB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,GAAG,IAAI,CA0IhH;IAED,UAAmB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CASxH;CACF"}
|
|
@@ -38,7 +38,10 @@ import { DiagDistillerOutputV1Schema } from '../diagnostician/diag-distiller-out
|
|
|
38
38
|
import { PDRuntimeError } from '../error-categories.js';
|
|
39
39
|
import { hydratePITaskRecord, parseLastValidatorErrors, isFreshForNextAttempt } from './pitask-metadata.js';
|
|
40
40
|
import { RouterPromptBuilder } from '../diagnostician/router-prompt-builder.js';
|
|
41
|
+
import { buildDiagnosticContextBudget, } from '../diagnostician/diagnostic-context-budget.js';
|
|
42
|
+
import { projectStageCInput, } from '../diagnostician/prompt-projection.js';
|
|
41
43
|
import { DefaultDiagnosticianValidator } from '../runner/default-validator.js';
|
|
44
|
+
import { isValidIntentSnapshot } from '../intent/intent-snapshot.js';
|
|
42
45
|
import { validateDiagnosticianAssociations } from '../diagnostician-association-validation.js';
|
|
43
46
|
import { BasePeerRunner } from '../runner/base-peer-runner.js';
|
|
44
47
|
// ── Envelope association evaluation (module-level, no runner state) ──────────
|
|
@@ -246,28 +249,51 @@ export class DiagRouterRunner extends BasePeerRunner {
|
|
|
246
249
|
}
|
|
247
250
|
async invokeRuntime(taskId, context) {
|
|
248
251
|
const builder = new RouterPromptBuilder();
|
|
249
|
-
|
|
252
|
+
// PRI-1146 P1-02 / §5.3: the exposure state travels as structured
|
|
253
|
+
// low-trust data in the message — available (possibly empty) vs typed
|
|
254
|
+
// unavailable are distinct payload states, never rendered into the static
|
|
255
|
+
// system prompt.
|
|
256
|
+
const trustedContextPayload = context.trustedPrinciplesUnavailable
|
|
257
|
+
? {
|
|
258
|
+
status: 'unavailable',
|
|
259
|
+
reason: context.trustedPrinciplesUnavailable.reason,
|
|
260
|
+
nextAction: context.trustedPrinciplesUnavailable.nextAction,
|
|
261
|
+
}
|
|
262
|
+
: { status: 'available', principles: context.trustedPrinciples };
|
|
263
|
+
const promptOptions = { outputLanguage: this.resolvedOptions.outputLanguage };
|
|
264
|
+
const buildInput = (rootCauseOutput, distillerOutput) => ({
|
|
250
265
|
rootCauseArtifactId: context.rootCauseArtifactId,
|
|
251
|
-
rootCauseOutput
|
|
266
|
+
rootCauseOutput,
|
|
252
267
|
distillerArtifactId: context.distillerArtifactId,
|
|
253
|
-
distillerOutput
|
|
254
|
-
|
|
255
|
-
// low-trust data in the message — available (possibly empty) vs typed
|
|
256
|
-
// unavailable are distinct payload states, never rendered into the
|
|
257
|
-
// static system prompt.
|
|
258
|
-
trustedContext: context.trustedPrinciplesUnavailable
|
|
259
|
-
? {
|
|
260
|
-
status: 'unavailable',
|
|
261
|
-
reason: context.trustedPrinciplesUnavailable.reason,
|
|
262
|
-
nextAction: context.trustedPrinciplesUnavailable.nextAction,
|
|
263
|
-
}
|
|
264
|
-
: { status: 'available', principles: context.trustedPrinciples },
|
|
268
|
+
distillerOutput,
|
|
269
|
+
trustedContext: trustedContextPayload,
|
|
265
270
|
// P1-3: repair feedback travels in the message payload (it echoes model
|
|
266
271
|
// output and must never be interpolated into the static system prompt).
|
|
267
272
|
...(context.validationFeedback ? { validationFeedback: context.validationFeedback } : {}),
|
|
268
|
-
}, {
|
|
269
|
-
outputLanguage: this.resolvedOptions.outputLanguage,
|
|
270
273
|
});
|
|
274
|
+
const { systemPrompt } = builder.buildPrompt(buildInput(context.rootCauseOutput, context.distillerOutput), promptOptions);
|
|
275
|
+
// SPEC §6.1/§6.2: Stage C has its own budget. Trusted context is copied
|
|
276
|
+
// verbatim — its contentDigest binds the full text, so it must not be
|
|
277
|
+
// trimmed to fit. If the budget cannot hold the projection, fail loud.
|
|
278
|
+
const budget = buildDiagnosticContextBudget({
|
|
279
|
+
stage: 'C',
|
|
280
|
+
modelInfo: this.runtimeAdapter.getModelInfo?.() ?? null,
|
|
281
|
+
systemPrompt,
|
|
282
|
+
});
|
|
283
|
+
const projection = projectStageCInput({
|
|
284
|
+
rootCauseArtifactId: context.rootCauseArtifactId,
|
|
285
|
+
rootCauseOutput: context.rootCauseOutput,
|
|
286
|
+
distillerArtifactId: context.distillerArtifactId,
|
|
287
|
+
distillerOutput: context.distillerOutput,
|
|
288
|
+
trustedContext: trustedContextPayload,
|
|
289
|
+
...(context.validationFeedback ? { validationFeedback: context.validationFeedback } : {}),
|
|
290
|
+
}, budget);
|
|
291
|
+
this.emitContextProjection(taskId, budget, projection.manifest);
|
|
292
|
+
if (projection.budgetExceeded) {
|
|
293
|
+
this.emitContextBudgetExceeded(taskId, projection.manifest);
|
|
294
|
+
throw new PDRuntimeError('input_invalid', `context_budget_exceeded: Stage C projection still needs ${projection.manifest.estimatedTokensAfter} tokens against a budget of ${projection.manifest.inputBudgetTokens ?? 'unknown'}`);
|
|
295
|
+
}
|
|
296
|
+
const { message } = builder.buildPrompt(buildInput(projection.value.rootCauseOutput, projection.value.distillerOutput), promptOptions);
|
|
271
297
|
// System-owned evidence from the exact message submitted, never model output.
|
|
272
298
|
// The trusted allowlist travels INSIDE the message (the runtime adapter
|
|
273
299
|
// ignores StartRunInput.contextItems), so the message digest below is the
|
|
@@ -304,6 +330,36 @@ export class DiagRouterRunner extends BasePeerRunner {
|
|
|
304
330
|
context.invocationEvidence.systemPromptDigest = providerPromptDigest;
|
|
305
331
|
return runHandle;
|
|
306
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* Record the Stage C projection so a later "why did the router only see part
|
|
335
|
+
* of the context" question is answerable (SPEC §6.2).
|
|
336
|
+
*/
|
|
337
|
+
emitContextProjection(taskId, budget, manifest) {
|
|
338
|
+
this.eventEmitter.emitTelemetry({
|
|
339
|
+
eventType: 'context_projection_applied',
|
|
340
|
+
traceId: taskId,
|
|
341
|
+
sessionId: this.resolvedOptions.owner,
|
|
342
|
+
agentId: this.resolvedOptions.agentId,
|
|
343
|
+
timestamp: new Date().toISOString(),
|
|
344
|
+
payload: { budget: { ...budget }, manifest: { ...manifest } },
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
emitContextBudgetExceeded(taskId, manifest) {
|
|
348
|
+
this.eventEmitter.emitTelemetry({
|
|
349
|
+
eventType: 'context_budget_exceeded',
|
|
350
|
+
traceId: taskId,
|
|
351
|
+
sessionId: this.resolvedOptions.owner,
|
|
352
|
+
agentId: this.resolvedOptions.agentId,
|
|
353
|
+
timestamp: new Date().toISOString(),
|
|
354
|
+
payload: {
|
|
355
|
+
stage: manifest.stage,
|
|
356
|
+
estimatedTokensAfter: manifest.estimatedTokensAfter,
|
|
357
|
+
inputBudgetTokens: manifest.inputBudgetTokens,
|
|
358
|
+
overBudgetTokens: manifest.overBudgetTokens,
|
|
359
|
+
dropped: manifest.dropped,
|
|
360
|
+
},
|
|
361
|
+
});
|
|
362
|
+
}
|
|
307
363
|
/**
|
|
308
364
|
* P2-01: persist the exact router message so a NEW process can rebuild the
|
|
309
365
|
* invocation evidence and run the full receipt verification (not just a
|
|
@@ -381,8 +437,17 @@ export class DiagRouterRunner extends BasePeerRunner {
|
|
|
381
437
|
status: 'available',
|
|
382
438
|
principles: context.trustedPrinciples,
|
|
383
439
|
};
|
|
440
|
+
// SIA v1.2 §6.3 / §9.1: additive passthrough of the SERVER-authored
|
|
441
|
+
// `intentSnapshot` captured by Stage A. Stage C never generates one; a
|
|
442
|
+
// corrupted upstream snapshot is a hard input fault (rc-3), never silently
|
|
443
|
+
// re-captured or dropped.
|
|
444
|
+
const stageAIntentSnapshot = context.rootCauseOutput.intentSnapshot;
|
|
445
|
+
if (stageAIntentSnapshot !== undefined && !isValidIntentSnapshot(stageAIntentSnapshot)) {
|
|
446
|
+
throw new PDRuntimeError('input_invalid', `Stage A artifact for DiagRouter task ${taskId} carries a malformed intentSnapshot — the strategic basis cannot be passed through.`);
|
|
447
|
+
}
|
|
384
448
|
const routerContentJson = JSON.stringify({
|
|
385
449
|
...output,
|
|
450
|
+
...(stageAIntentSnapshot !== undefined ? { intentSnapshot: stageAIntentSnapshot } : {}),
|
|
386
451
|
trustedContextReceipt: {
|
|
387
452
|
schemaVersion: 'router-context-v2',
|
|
388
453
|
taskId,
|
|
@@ -414,14 +479,42 @@ export class DiagRouterRunner extends BasePeerRunner {
|
|
|
414
479
|
throw new PDRuntimeError('input_invalid', `Invalid router context receipt: ${receiptCheck.reason}`);
|
|
415
480
|
}
|
|
416
481
|
let commitResult;
|
|
482
|
+
let resultRef;
|
|
417
483
|
try {
|
|
418
|
-
|
|
484
|
+
// SPEC §5.3: artifact + candidate + PIArtifact + task/run terminal state
|
|
485
|
+
// are ONE transaction gated by the lease fence. The former sequence
|
|
486
|
+
// (`assertOwned()` → commit → upsertArtifact → markTaskSucceeded) was a
|
|
487
|
+
// check-then-write race: a takeover between the steps published a result
|
|
488
|
+
// nobody owned, and a failure after the commit left an artifact for a
|
|
489
|
+
// task that never succeeded.
|
|
490
|
+
const lineageResult = await this.resolveLineageArtifactIds(taskId);
|
|
491
|
+
const now = new Date().toISOString();
|
|
492
|
+
const outcome = await this.stateManager.commitDiagnosticianAndFinalize({
|
|
493
|
+
fence: this.requireLeaseFence(),
|
|
419
494
|
runId,
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
495
|
+
commit: {
|
|
496
|
+
runId,
|
|
497
|
+
taskId,
|
|
498
|
+
output,
|
|
499
|
+
idempotencyKey: `${taskId}:${runId}`,
|
|
500
|
+
contentJson: routerContentJson,
|
|
501
|
+
},
|
|
502
|
+
// Dual-write the DiagnosticianOutputV2 into pi_artifacts (PRI-667) in
|
|
503
|
+
// the same transaction. Downstream runners read predecessors ONLY from
|
|
504
|
+
// pi_artifacts; idempotent via (source_task_id, artifact_kind).
|
|
505
|
+
piArtifact: {
|
|
506
|
+
artifactId: `pi-art-${taskId}-${runId}`,
|
|
507
|
+
artifactKind: 'principle',
|
|
508
|
+
sourceTaskId: taskId,
|
|
509
|
+
lineageArtifactIds: lineageResult.ids,
|
|
510
|
+
validationStatus: 'pending',
|
|
511
|
+
contentJson: routerContentJson,
|
|
512
|
+
createdAt: now,
|
|
513
|
+
updatedAt: now,
|
|
514
|
+
},
|
|
424
515
|
});
|
|
516
|
+
commitResult = outcome.commit;
|
|
517
|
+
({ resultRef } = outcome);
|
|
425
518
|
}
|
|
426
519
|
catch (commitErr) {
|
|
427
520
|
this.emitEvent('artifact_commit_failed', taskId, {
|
|
@@ -432,40 +525,6 @@ export class DiagRouterRunner extends BasePeerRunner {
|
|
|
432
525
|
});
|
|
433
526
|
throw commitErr;
|
|
434
527
|
}
|
|
435
|
-
// 2b. Dual-write the DiagnosticianOutputV2 into pi_artifacts (PRI-667).
|
|
436
|
-
// The committer's legacy `artifacts` row is the candidate-intake source;
|
|
437
|
-
// the downstream internalization runners read their predecessors ONLY
|
|
438
|
-
// from pi_artifacts — without this row the evaluator cannot resolve its
|
|
439
|
-
// artificer dependency artifact (observed live 2026-09-03 ×5 chains and
|
|
440
|
-
// in the PRI-653 lab ×2). Same persistence shape as the
|
|
441
|
-
// diag_rootcause/diag_distiller writers, keeping the top-level `evidence`
|
|
442
|
-
// field readable. Idempotent via the (source_task_id, artifact_kind) upsert.
|
|
443
|
-
try {
|
|
444
|
-
const lineageResult = await this.resolveLineageArtifactIds(taskId);
|
|
445
|
-
const now = new Date().toISOString();
|
|
446
|
-
await this.artifactStore.upsertArtifact({
|
|
447
|
-
artifactId: `pi-art-${taskId}-${runId}`,
|
|
448
|
-
artifactKind: 'principle',
|
|
449
|
-
sourceTaskId: taskId,
|
|
450
|
-
lineageArtifactIds: lineageResult.ids,
|
|
451
|
-
validationStatus: 'pending',
|
|
452
|
-
contentJson: routerContentJson,
|
|
453
|
-
createdAt: now,
|
|
454
|
-
updatedAt: now,
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
catch (piWriteErr) {
|
|
458
|
-
this.emitEvent('artifact_write_failed', taskId, {
|
|
459
|
-
runId,
|
|
460
|
-
errorMessage: piWriteErr instanceof Error ? piWriteErr.message : String(piWriteErr),
|
|
461
|
-
});
|
|
462
|
-
return this.retryOrFail({
|
|
463
|
-
taskId,
|
|
464
|
-
task,
|
|
465
|
-
errorCategory: 'artifact_commit_failed',
|
|
466
|
-
failureReason: `PIArtifact dual-write failed: ${piWriteErr instanceof Error ? piWriteErr.message : String(piWriteErr)}`,
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
528
|
// Emit: principle_candidate_registered per recommendation
|
|
470
529
|
for (let i = 0; i < output.recommendations.length; i++) {
|
|
471
530
|
const rec = output.recommendations[i];
|
|
@@ -488,20 +547,6 @@ export class DiagRouterRunner extends BasePeerRunner {
|
|
|
488
547
|
taskId,
|
|
489
548
|
runId,
|
|
490
549
|
});
|
|
491
|
-
// 3. Mark task succeeded
|
|
492
|
-
const resultRef = `commit://${commitResult.commitId}`;
|
|
493
|
-
try {
|
|
494
|
-
await this.stateManager.markTaskSucceeded(taskId, resultRef);
|
|
495
|
-
}
|
|
496
|
-
catch (stateErr) {
|
|
497
|
-
this.emitEvent('mark_succeeded_failed', taskId, {
|
|
498
|
-
taskId,
|
|
499
|
-
runId,
|
|
500
|
-
commitId: commitResult.commitId,
|
|
501
|
-
errorMessage: stateErr instanceof Error ? stateErr.message : String(stateErr),
|
|
502
|
-
});
|
|
503
|
-
throw stateErr;
|
|
504
|
-
}
|
|
505
550
|
// 4. Emit diag_router_task_succeeded telemetry
|
|
506
551
|
const recommendationKinds = output.recommendations.map((r) => r.kind);
|
|
507
552
|
const kindHistogram = {};
|