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.
Files changed (386) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/codex-adapter/dist/pd-hook.js +34 -4
  3. package/codex-adapter/package.json +1 -1
  4. package/console/dist/server/config/pd-config-store.d.ts +48 -0
  5. package/console/dist/server/config/pd-config-store.js +273 -93
  6. package/console/dist/server/index.js +16 -1
  7. package/console/dist/server/models/ActivationsConsoleModel.d.ts +72 -1
  8. package/console/dist/server/models/ActivationsConsoleModel.js +92 -14
  9. package/console/dist/server/models/AdaptiveActivationConsoleModel.d.ts +79 -0
  10. package/console/dist/server/models/AdaptiveActivationConsoleModel.js +151 -0
  11. package/console/dist/server/models/ApprovalsConsoleModel.d.ts +28 -0
  12. package/console/dist/server/models/ApprovalsConsoleModel.js +118 -3
  13. package/console/dist/server/models/ApprovalsGroupedConsoleModel.d.ts +38 -0
  14. package/console/dist/server/models/ApprovalsGroupedConsoleModel.js +158 -26
  15. package/console/dist/server/models/IntentDecisionModel.d.ts +6 -1
  16. package/console/dist/server/models/IntentDecisionModel.js +17 -9
  17. package/console/dist/server/models/pipeline-health-metrics.d.ts +128 -0
  18. package/console/dist/server/models/pipeline-health-metrics.js +225 -0
  19. package/console/dist/server/routes/approvals.js +14 -0
  20. package/console/dist/server/routes/config.js +212 -1
  21. package/console/dist/server/routes/diagnostician.js +13 -2
  22. package/console/dist/server/routes/intent-decisions.js +19 -1
  23. package/console/dist/server/routes/pipeline-health.d.ts +9 -0
  24. package/console/dist/server/routes/pipeline-health.js +124 -0
  25. package/console/dist/web/assets/app.css +484 -67
  26. package/console/dist/web/assets/app.js +36 -31
  27. package/console/dist/web/assets/evidence-art-1.webp +0 -0
  28. package/console/dist/web/assets/evidence-art-2.webp +0 -0
  29. package/console/dist/web/assets/evidence-art-3.webp +0 -0
  30. package/console/dist/web/assets/evidence-art-4.webp +0 -0
  31. package/console/dist/web/assets/principle-grove.jpg +0 -0
  32. package/console/dist/web/assets/principle-stone-steps.jpg +0 -0
  33. package/console/dist/web/assets/principles-art-1.webp +0 -0
  34. package/console/dist/web/assets/principles-art-2.webp +0 -0
  35. package/console/dist/web/assets/principles-art-3.webp +0 -0
  36. package/console/dist/web/assets/principles-art-4.webp +0 -0
  37. package/console/dist/web/assets/today-art-1.webp +0 -0
  38. package/console/dist/web/assets/today-art-2.webp +0 -0
  39. package/console/dist/web/assets/today-art-3.webp +0 -0
  40. package/console/dist/web/assets/today-art-4.webp +0 -0
  41. package/core/dist/runtime/activation/activation-types.d.ts +6 -0
  42. package/core/dist/runtime/activation/activation-types.d.ts.map +1 -1
  43. package/core/dist/runtime/activation/activation-types.js.map +1 -1
  44. package/core/dist/runtime/activation/index.d.ts +2 -1
  45. package/core/dist/runtime/activation/index.d.ts.map +1 -1
  46. package/core/dist/runtime/activation/index.js +1 -1
  47. package/core/dist/runtime/activation/index.js.map +1 -1
  48. package/core/dist/runtime/activation/ledger-identity.d.ts +8 -0
  49. package/core/dist/runtime/activation/ledger-identity.d.ts.map +1 -1
  50. package/core/dist/runtime/activation/ledger-identity.js +20 -1
  51. package/core/dist/runtime/activation/ledger-identity.js.map +1 -1
  52. package/core/dist/runtime/activation/sqlite-approval-store.d.ts +18 -0
  53. package/core/dist/runtime/activation/sqlite-approval-store.d.ts.map +1 -1
  54. package/core/dist/runtime/activation/sqlite-approval-store.js +146 -20
  55. package/core/dist/runtime/activation/sqlite-approval-store.js.map +1 -1
  56. package/core/dist/runtime/adapter/artificer-l2-adapter.d.ts.map +1 -1
  57. package/core/dist/runtime/adapter/artificer-l2-adapter.js +11 -4
  58. package/core/dist/runtime/adapter/artificer-l2-adapter.js.map +1 -1
  59. package/core/dist/runtime/adapter/l2-agent-loop-adapter.d.ts.map +1 -1
  60. package/core/dist/runtime/adapter/l2-agent-loop-adapter.js +11 -4
  61. package/core/dist/runtime/adapter/l2-agent-loop-adapter.js.map +1 -1
  62. package/core/dist/runtime/adapter/output-repair-contract.d.ts +21 -1
  63. package/core/dist/runtime/adapter/output-repair-contract.d.ts.map +1 -1
  64. package/core/dist/runtime/adapter/output-repair-contract.js.map +1 -1
  65. package/core/dist/runtime/adapter/pi-ai-catalog.d.ts +42 -0
  66. package/core/dist/runtime/adapter/pi-ai-catalog.d.ts.map +1 -1
  67. package/core/dist/runtime/adapter/pi-ai-catalog.js +68 -0
  68. package/core/dist/runtime/adapter/pi-ai-catalog.js.map +1 -1
  69. package/core/dist/runtime/adapter/pi-ai-connection-probe.d.ts +45 -0
  70. package/core/dist/runtime/adapter/pi-ai-connection-probe.d.ts.map +1 -0
  71. package/core/dist/runtime/adapter/pi-ai-connection-probe.js +321 -0
  72. package/core/dist/runtime/adapter/pi-ai-connection-probe.js.map +1 -0
  73. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts +27 -2
  74. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  75. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js +71 -10
  76. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js.map +1 -1
  77. package/core/dist/runtime/adapter/schema-prompt-adapter.d.ts.map +1 -1
  78. package/core/dist/runtime/adapter/schema-prompt-adapter.js +39 -6
  79. package/core/dist/runtime/adapter/schema-prompt-adapter.js.map +1 -1
  80. package/core/dist/runtime/adapter/structured-output-repair.d.ts +26 -0
  81. package/core/dist/runtime/adapter/structured-output-repair.d.ts.map +1 -1
  82. package/core/dist/runtime/adapter/structured-output-repair.js +140 -2
  83. package/core/dist/runtime/adapter/structured-output-repair.js.map +1 -1
  84. package/core/dist/runtime/config/execution-timing.d.ts +56 -0
  85. package/core/dist/runtime/config/execution-timing.d.ts.map +1 -0
  86. package/core/dist/runtime/config/execution-timing.js +76 -0
  87. package/core/dist/runtime/config/execution-timing.js.map +1 -0
  88. package/core/dist/runtime/config/index.d.ts +4 -0
  89. package/core/dist/runtime/config/index.d.ts.map +1 -1
  90. package/core/dist/runtime/config/index.js +2 -0
  91. package/core/dist/runtime/config/index.js.map +1 -1
  92. package/core/dist/runtime/config/pd-config-redaction.d.ts.map +1 -1
  93. package/core/dist/runtime/config/pd-config-redaction.js +4 -0
  94. package/core/dist/runtime/config/pd-config-redaction.js.map +1 -1
  95. package/core/dist/runtime/config/pd-config-types.d.ts +5 -0
  96. package/core/dist/runtime/config/pd-config-types.d.ts.map +1 -1
  97. package/core/dist/runtime/config/pd-config-types.js.map +1 -1
  98. package/core/dist/runtime/config/pd-credentials.d.ts +105 -0
  99. package/core/dist/runtime/config/pd-credentials.d.ts.map +1 -0
  100. package/core/dist/runtime/config/pd-credentials.js +409 -0
  101. package/core/dist/runtime/config/pd-credentials.js.map +1 -0
  102. package/core/dist/runtime/diagnostician/diag-rootcause-output.d.ts +13 -2
  103. package/core/dist/runtime/diagnostician/diag-rootcause-output.d.ts.map +1 -1
  104. package/core/dist/runtime/diagnostician/diag-rootcause-output.js.map +1 -1
  105. package/core/dist/runtime/diagnostician/diagnostic-context-budget.d.ts +45 -0
  106. package/core/dist/runtime/diagnostician/diagnostic-context-budget.d.ts.map +1 -0
  107. package/core/dist/runtime/diagnostician/diagnostic-context-budget.js +74 -0
  108. package/core/dist/runtime/diagnostician/diagnostic-context-budget.js.map +1 -0
  109. package/core/dist/runtime/diagnostician/prompt-projection.d.ts +51 -0
  110. package/core/dist/runtime/diagnostician/prompt-projection.d.ts.map +1 -0
  111. package/core/dist/runtime/diagnostician/prompt-projection.js +192 -0
  112. package/core/dist/runtime/diagnostician/prompt-projection.js.map +1 -0
  113. package/core/dist/runtime/diagnostician-output.d.ts +1 -1
  114. package/core/dist/runtime/diagnostician-output.d.ts.map +1 -1
  115. package/core/dist/runtime/diagnostician-output.js +2 -2
  116. package/core/dist/runtime/diagnostician-output.js.map +1 -1
  117. package/core/dist/runtime/index.d.ts +5 -2
  118. package/core/dist/runtime/index.d.ts.map +1 -1
  119. package/core/dist/runtime/index.js +11 -1
  120. package/core/dist/runtime/index.js.map +1 -1
  121. package/core/dist/runtime/intent/index.d.ts +2 -0
  122. package/core/dist/runtime/intent/index.d.ts.map +1 -1
  123. package/core/dist/runtime/intent/index.js +2 -0
  124. package/core/dist/runtime/intent/index.js.map +1 -1
  125. package/core/dist/runtime/intent/intent-decision-record.d.ts +51 -3
  126. package/core/dist/runtime/intent/intent-decision-record.d.ts.map +1 -1
  127. package/core/dist/runtime/intent/intent-snapshot.d.ts +104 -0
  128. package/core/dist/runtime/intent/intent-snapshot.d.ts.map +1 -0
  129. package/core/dist/runtime/intent/intent-snapshot.js +164 -0
  130. package/core/dist/runtime/intent/intent-snapshot.js.map +1 -0
  131. package/core/dist/runtime/intent/strategic-conflict-gate.d.ts +70 -0
  132. package/core/dist/runtime/intent/strategic-conflict-gate.d.ts.map +1 -0
  133. package/core/dist/runtime/intent/strategic-conflict-gate.js +148 -0
  134. package/core/dist/runtime/intent/strategic-conflict-gate.js.map +1 -0
  135. package/core/dist/runtime/internalization/artificer-runner.js +1 -1
  136. package/core/dist/runtime/internalization/artificer-runner.js.map +1 -1
  137. package/core/dist/runtime/internalization/diag-distiller-runner.d.ts +6 -0
  138. package/core/dist/runtime/internalization/diag-distiller-runner.d.ts.map +1 -1
  139. package/core/dist/runtime/internalization/diag-distiller-runner.js +62 -5
  140. package/core/dist/runtime/internalization/diag-distiller-runner.js.map +1 -1
  141. package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts +41 -1
  142. package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
  143. package/core/dist/runtime/internalization/diag-rootcause-runner.js +190 -43
  144. package/core/dist/runtime/internalization/diag-rootcause-runner.js.map +1 -1
  145. package/core/dist/runtime/internalization/diag-router-runner.d.ts +6 -0
  146. package/core/dist/runtime/internalization/diag-router-runner.d.ts.map +1 -1
  147. package/core/dist/runtime/internalization/diag-router-runner.js +114 -69
  148. package/core/dist/runtime/internalization/diag-router-runner.js.map +1 -1
  149. package/core/dist/runtime/internalization/dreamer-prompt-builder.d.ts.map +1 -1
  150. package/core/dist/runtime/internalization/dreamer-prompt-builder.js +3 -0
  151. package/core/dist/runtime/internalization/dreamer-prompt-builder.js.map +1 -1
  152. package/core/dist/runtime/internalization/dreamer-runner.js +1 -1
  153. package/core/dist/runtime/internalization/dreamer-runner.js.map +1 -1
  154. package/core/dist/runtime/internalization/evaluator-runner.js +4 -4
  155. package/core/dist/runtime/internalization/evaluator-runner.js.map +1 -1
  156. package/core/dist/runtime/internalization/formation-context.d.ts +54 -0
  157. package/core/dist/runtime/internalization/formation-context.d.ts.map +1 -1
  158. package/core/dist/runtime/internalization/formation-context.js +135 -3
  159. package/core/dist/runtime/internalization/formation-context.js.map +1 -1
  160. package/core/dist/runtime/internalization/index.d.ts +2 -2
  161. package/core/dist/runtime/internalization/index.d.ts.map +1 -1
  162. package/core/dist/runtime/internalization/index.js +1 -1
  163. package/core/dist/runtime/internalization/index.js.map +1 -1
  164. package/core/dist/runtime/internalization/intent-contract.d.ts +107 -0
  165. package/core/dist/runtime/internalization/intent-contract.d.ts.map +1 -1
  166. package/core/dist/runtime/internalization/intent-contract.js +315 -4
  167. package/core/dist/runtime/internalization/intent-contract.js.map +1 -1
  168. package/core/dist/runtime/internalization/peer-runner-contracts.d.ts +8 -0
  169. package/core/dist/runtime/internalization/peer-runner-contracts.d.ts.map +1 -1
  170. package/core/dist/runtime/internalization/peer-runner-contracts.js.map +1 -1
  171. package/core/dist/runtime/internalization/philosopher-prompt-builder.d.ts +22 -1
  172. package/core/dist/runtime/internalization/philosopher-prompt-builder.d.ts.map +1 -1
  173. package/core/dist/runtime/internalization/philosopher-prompt-builder.js +22 -3
  174. package/core/dist/runtime/internalization/philosopher-prompt-builder.js.map +1 -1
  175. package/core/dist/runtime/internalization/philosopher-runner.d.ts +15 -0
  176. package/core/dist/runtime/internalization/philosopher-runner.d.ts.map +1 -1
  177. package/core/dist/runtime/internalization/philosopher-runner.js +74 -2
  178. package/core/dist/runtime/internalization/philosopher-runner.js.map +1 -1
  179. package/core/dist/runtime/internalization/pitask-metadata.d.ts +32 -0
  180. package/core/dist/runtime/internalization/pitask-metadata.d.ts.map +1 -1
  181. package/core/dist/runtime/internalization/pitask-metadata.js +44 -0
  182. package/core/dist/runtime/internalization/pitask-metadata.js.map +1 -1
  183. package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts +6 -1
  184. package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts.map +1 -1
  185. package/core/dist/runtime/internalization/rollout-reviewer-runner.js +31 -15
  186. package/core/dist/runtime/internalization/rollout-reviewer-runner.js.map +1 -1
  187. package/core/dist/runtime/internalization/scribe-output.d.ts +21 -0
  188. package/core/dist/runtime/internalization/scribe-output.d.ts.map +1 -1
  189. package/core/dist/runtime/internalization/scribe-output.js +125 -2
  190. package/core/dist/runtime/internalization/scribe-output.js.map +1 -1
  191. package/core/dist/runtime/internalization/scribe-prompt-builder.d.ts +26 -1
  192. package/core/dist/runtime/internalization/scribe-prompt-builder.d.ts.map +1 -1
  193. package/core/dist/runtime/internalization/scribe-prompt-builder.js +33 -3
  194. package/core/dist/runtime/internalization/scribe-prompt-builder.js.map +1 -1
  195. package/core/dist/runtime/internalization/scribe-runner.d.ts +32 -2
  196. package/core/dist/runtime/internalization/scribe-runner.d.ts.map +1 -1
  197. package/core/dist/runtime/internalization/scribe-runner.js +106 -8
  198. package/core/dist/runtime/internalization/scribe-runner.js.map +1 -1
  199. package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts +46 -0
  200. package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts.map +1 -1
  201. package/core/dist/runtime/internalization/split-diagnostician-runner.js +220 -20
  202. package/core/dist/runtime/internalization/split-diagnostician-runner.js.map +1 -1
  203. package/core/dist/runtime/internalization-integrity-remediation.d.ts +7 -0
  204. package/core/dist/runtime/internalization-integrity-remediation.d.ts.map +1 -1
  205. package/core/dist/runtime/internalization-integrity-remediation.js +44 -12
  206. package/core/dist/runtime/internalization-integrity-remediation.js.map +1 -1
  207. package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
  208. package/core/dist/runtime/pain-signal-runtime-factory.js +25 -4
  209. package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
  210. package/core/dist/runtime/pain-submit-capability.js +5 -5
  211. package/core/dist/runtime/pain-submit-capability.js.map +1 -1
  212. package/core/dist/runtime/runner/base-peer-runner.d.ts +90 -2
  213. package/core/dist/runtime/runner/base-peer-runner.d.ts.map +1 -1
  214. package/core/dist/runtime/runner/base-peer-runner.js +463 -170
  215. package/core/dist/runtime/runner/base-peer-runner.js.map +1 -1
  216. package/core/dist/runtime/runner/peer-runner-types.d.ts +19 -0
  217. package/core/dist/runtime/runner/peer-runner-types.d.ts.map +1 -1
  218. package/core/dist/runtime/runtime-protocol.d.ts +19 -0
  219. package/core/dist/runtime/runtime-protocol.d.ts.map +1 -1
  220. package/core/dist/runtime/signal-collector/llm-stage.d.ts +5 -0
  221. package/core/dist/runtime/signal-collector/llm-stage.d.ts.map +1 -1
  222. package/core/dist/runtime/signal-collector/llm-stage.js.map +1 -1
  223. package/core/dist/runtime/store/artifact/sqlite-pi-artifact-store.d.ts +14 -0
  224. package/core/dist/runtime/store/artifact/sqlite-pi-artifact-store.d.ts.map +1 -1
  225. package/core/dist/runtime/store/artifact/sqlite-pi-artifact-store.js +16 -1
  226. package/core/dist/runtime/store/artifact/sqlite-pi-artifact-store.js.map +1 -1
  227. package/core/dist/runtime/store/commit/diagnostician-committer.d.ts +19 -0
  228. package/core/dist/runtime/store/commit/diagnostician-committer.d.ts.map +1 -1
  229. package/core/dist/runtime/store/commit/diagnostician-committer.js +11 -0
  230. package/core/dist/runtime/store/commit/diagnostician-committer.js.map +1 -1
  231. package/core/dist/runtime/store/intent/sqlite-intent-decision-store.d.ts +2 -2
  232. package/core/dist/runtime/store/intent/sqlite-intent-decision-store.d.ts.map +1 -1
  233. package/core/dist/runtime/store/intent/sqlite-intent-decision-store.js +285 -35
  234. package/core/dist/runtime/store/intent/sqlite-intent-decision-store.js.map +1 -1
  235. package/core/dist/runtime/store/lifecycle/fenced-task-writer.d.ts +64 -0
  236. package/core/dist/runtime/store/lifecycle/fenced-task-writer.d.ts.map +1 -0
  237. package/core/dist/runtime/store/lifecycle/fenced-task-writer.js +231 -0
  238. package/core/dist/runtime/store/lifecycle/fenced-task-writer.js.map +1 -0
  239. package/core/dist/runtime/store/lifecycle/index.d.ts +2 -0
  240. package/core/dist/runtime/store/lifecycle/index.d.ts.map +1 -1
  241. package/core/dist/runtime/store/lifecycle/index.js +1 -0
  242. package/core/dist/runtime/store/lifecycle/index.js.map +1 -1
  243. package/core/dist/runtime/store/lifecycle/lease-fence.d.ts +80 -0
  244. package/core/dist/runtime/store/lifecycle/lease-fence.d.ts.map +1 -0
  245. package/core/dist/runtime/store/lifecycle/lease-fence.js +79 -0
  246. package/core/dist/runtime/store/lifecycle/lease-fence.js.map +1 -0
  247. package/core/dist/runtime/store/lifecycle/lease-heartbeat.d.ts +118 -0
  248. package/core/dist/runtime/store/lifecycle/lease-heartbeat.d.ts.map +1 -0
  249. package/core/dist/runtime/store/lifecycle/lease-heartbeat.js +187 -0
  250. package/core/dist/runtime/store/lifecycle/lease-heartbeat.js.map +1 -0
  251. package/core/dist/runtime/store/lifecycle/lease-manager.d.ts +30 -20
  252. package/core/dist/runtime/store/lifecycle/lease-manager.d.ts.map +1 -1
  253. package/core/dist/runtime/store/lifecycle/lease-manager.js +94 -53
  254. package/core/dist/runtime/store/lifecycle/lease-manager.js.map +1 -1
  255. package/core/dist/runtime/store/lifecycle/recovery-sweep.d.ts.map +1 -1
  256. package/core/dist/runtime/store/lifecycle/recovery-sweep.js +32 -15
  257. package/core/dist/runtime/store/lifecycle/recovery-sweep.js.map +1 -1
  258. package/core/dist/runtime/store/run/sqlite-run-store.d.ts +29 -0
  259. package/core/dist/runtime/store/run/sqlite-run-store.d.ts.map +1 -1
  260. package/core/dist/runtime/store/run/sqlite-run-store.js +40 -0
  261. package/core/dist/runtime/store/run/sqlite-run-store.js.map +1 -1
  262. package/core/dist/runtime/store/runtime-state-manager.d.ts +64 -10
  263. package/core/dist/runtime/store/runtime-state-manager.d.ts.map +1 -1
  264. package/core/dist/runtime/store/runtime-state-manager.js +154 -89
  265. package/core/dist/runtime/store/runtime-state-manager.js.map +1 -1
  266. package/core/dist/runtime/store/sqlite-connection.d.ts.map +1 -1
  267. package/core/dist/runtime/store/sqlite-connection.js +73 -4
  268. package/core/dist/runtime/store/sqlite-connection.js.map +1 -1
  269. package/core/dist/runtime/store/task/sqlite-task-store.d.ts.map +1 -1
  270. package/core/dist/runtime/store/task/sqlite-task-store.js +6 -3
  271. package/core/dist/runtime/store/task/sqlite-task-store.js.map +1 -1
  272. package/core/dist/runtime/task-status.d.ts +16 -0
  273. package/core/dist/runtime/task-status.d.ts.map +1 -1
  274. package/core/dist/runtime/task-status.js +8 -0
  275. package/core/dist/runtime/task-status.js.map +1 -1
  276. package/core/dist/runtime/trajectory-schema.d.ts.map +1 -1
  277. package/core/dist/runtime/trajectory-schema.js +20 -1
  278. package/core/dist/runtime/trajectory-schema.js.map +1 -1
  279. package/core/dist/runtime/types/event-types.d.ts +20 -0
  280. package/core/dist/runtime/types/event-types.d.ts.map +1 -1
  281. package/core/dist/runtime/types/event-types.js +7 -0
  282. package/core/dist/runtime/types/event-types.js.map +1 -1
  283. package/core/dist/telemetry-event.d.ts +2 -2
  284. package/core/dist/telemetry-event.d.ts.map +1 -1
  285. package/core/dist/telemetry-event.js +27 -2
  286. package/core/dist/telemetry-event.js.map +1 -1
  287. package/core/dist/trajectory-types.d.ts +33 -0
  288. package/core/dist/trajectory-types.d.ts.map +1 -1
  289. package/core/package.json +1 -1
  290. package/dist/installer.d.ts.map +1 -1
  291. package/dist/installer.js +12 -5
  292. package/dist/installer.js.map +1 -1
  293. package/dist/installers/codex-host-installer.d.ts.map +1 -1
  294. package/dist/installers/codex-host-installer.js +9 -12
  295. package/dist/installers/codex-host-installer.js.map +1 -1
  296. package/host-runtime/dist/adaptive-consumer-schedule.d.ts +103 -0
  297. package/host-runtime/dist/adaptive-consumer-schedule.js +145 -0
  298. package/host-runtime/dist/adaptive-priority-provider.d.ts +7 -1
  299. package/host-runtime/dist/adaptive-priority-provider.js +6 -3
  300. package/host-runtime/dist/adaptive-selection.d.ts +1 -1
  301. package/host-runtime/dist/adaptive-selection.js +2 -1
  302. package/host-runtime/dist/degraded-enforcement-marker.d.ts +35 -0
  303. package/host-runtime/dist/degraded-enforcement-marker.js +79 -0
  304. package/host-runtime/dist/index.d.ts +2 -0
  305. package/host-runtime/dist/index.js +8 -0
  306. package/host-runtime/dist/internalization-consumer-cycle.d.ts +35 -0
  307. package/host-runtime/dist/internalization-consumer-cycle.js +51 -17
  308. package/host-runtime/dist/prompt-activation-deliverability.d.ts +10 -0
  309. package/host-runtime/dist/prompt-activation-deliverability.js +5 -2
  310. package/host-runtime/dist/prompt-injection-event-evidence.d.ts +34 -0
  311. package/host-runtime/dist/prompt-injection-event-evidence.js +96 -0
  312. package/host-runtime/dist/signal-classifier.js +4 -4
  313. package/host-runtime/package.json +1 -1
  314. package/install-layout/dist/mcp-binding-contract.js +4 -15
  315. package/install-layout/package.json +1 -1
  316. package/package.json +3 -3
  317. package/pd-cli/dist/commands/health-codex.d.ts.map +1 -1
  318. package/pd-cli/dist/commands/health-codex.js +26 -1
  319. package/pd-cli/dist/commands/health-codex.js.map +1 -1
  320. package/pd-cli/dist/commands/health.d.ts.map +1 -1
  321. package/pd-cli/dist/commands/health.js +32 -2
  322. package/pd-cli/dist/commands/health.js.map +1 -1
  323. package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
  324. package/pd-cli/dist/commands/pain-retry.js +6 -4
  325. package/pd-cli/dist/commands/pain-retry.js.map +1 -1
  326. package/pd-cli/dist/commands/runtime-init.d.ts.map +1 -1
  327. package/pd-cli/dist/commands/runtime-init.js +29 -1
  328. package/pd-cli/dist/commands/runtime-init.js.map +1 -1
  329. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
  330. package/pd-cli/dist/commands/runtime-internalization-run-once.js +9 -14
  331. package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
  332. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.d.ts.map +1 -1
  333. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.js +5 -5
  334. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.js.map +1 -1
  335. package/pd-cli/dist/commands/runtime-usage.d.ts +62 -0
  336. package/pd-cli/dist/commands/runtime-usage.d.ts.map +1 -0
  337. package/pd-cli/dist/commands/runtime-usage.js +315 -0
  338. package/pd-cli/dist/commands/runtime-usage.js.map +1 -0
  339. package/pd-cli/dist/commands/runtime.js +6 -6
  340. package/pd-cli/dist/commands/runtime.js.map +1 -1
  341. package/pd-cli/dist/index.d.ts.map +1 -1
  342. package/pd-cli/dist/index.js +51 -17
  343. package/pd-cli/dist/index.js.map +1 -1
  344. package/pd-cli/dist/program.d.ts.map +1 -1
  345. package/pd-cli/dist/program.js +4 -0
  346. package/pd-cli/dist/program.js.map +1 -1
  347. package/pd-cli/dist/services/cli-invocation-log.d.ts +66 -0
  348. package/pd-cli/dist/services/cli-invocation-log.d.ts.map +1 -0
  349. package/pd-cli/dist/services/cli-invocation-log.js +139 -0
  350. package/pd-cli/dist/services/cli-invocation-log.js.map +1 -0
  351. package/pd-cli/dist/services/config-doctor.d.ts.map +1 -1
  352. package/pd-cli/dist/services/config-doctor.js +5 -4
  353. package/pd-cli/dist/services/config-doctor.js.map +1 -1
  354. package/pd-cli/dist/services/demo-story-a-runner.d.ts.map +1 -1
  355. package/pd-cli/dist/services/demo-story-a-runner.js +6 -2
  356. package/pd-cli/dist/services/demo-story-a-runner.js.map +1 -1
  357. package/pd-cli/dist/services/pd-config-loader.d.ts +3 -1
  358. package/pd-cli/dist/services/pd-config-loader.d.ts.map +1 -1
  359. package/pd-cli/dist/services/pd-config-loader.js +20 -8
  360. package/pd-cli/dist/services/pd-config-loader.js.map +1 -1
  361. package/pd-cli/dist/services/runtime-adapter-resolver.d.ts.map +1 -1
  362. package/pd-cli/dist/services/runtime-adapter-resolver.js +5 -5
  363. package/pd-cli/dist/services/runtime-adapter-resolver.js.map +1 -1
  364. package/pd-cli/package.json +1 -1
  365. package/plugin/dist/bundle.js +632 -536
  366. package/plugin/dist/core/signal-collector-host.d.ts +5 -0
  367. package/plugin/dist/governance-audit.js +2 -2
  368. package/plugin/dist/openclaw.plugin.json +1 -1
  369. package/plugin/dist/rulehost-evidence.js +13 -10
  370. package/plugin/dist/service/internalization-auto-consumer-service.d.ts +2 -1
  371. package/plugin/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +1 -1
  372. package/plugin/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +1 -1
  373. package/plugin/openclaw.plugin.json +1 -1
  374. package/plugin/package.json +1 -1
  375. package/plugin/templates/langs/en/skills/pd-pain-signal/SKILL.md +1 -1
  376. package/plugin/templates/langs/zh/skills/pd-pain-signal/SKILL.md +1 -1
  377. package/release-manager/dist/installer.js +12 -5
  378. package/release-manager/dist/installers/codex-host-installer.js +9 -12
  379. package/release-manager/package.json +1 -1
  380. package/workbuddy-adapter/package.json +1 -1
  381. package/workbuddy-adapter/plugin/skills/pd-pain-signal/SKILL.md +1 -1
  382. package/dist/installers/mcp-binding-shape-mirror.d.ts +0 -27
  383. package/dist/installers/mcp-binding-shape-mirror.d.ts.map +0 -1
  384. package/dist/installers/mcp-binding-shape-mirror.js +0 -105
  385. package/dist/installers/mcp-binding-shape-mirror.js.map +0 -1
  386. 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 { contextHash, contextRefs, painPayload };
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
- // PRI-468: When intent_engineering is on AND a reader is configured,
120
- // attempt to read INTENT.md. On any degraded path (not_found, oversized,
121
- // read_error, flag_disabled, or no reader configured), intentGrounding
122
- // is downgraded to false and the prompt is byte-identical to the
123
- // pre-PRI-468 prompt (EP-03 / ERR-002: graceful degradation with
124
- // observable telemetry).
125
- let intentDoc;
126
- if (intentGrounding && !this.intentDocReader) {
127
- // Flag on but no reader wired — downgrade silently (factory misconfiguration
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
- else {
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, _context) {
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
- contentJson: JSON.stringify(output),
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.stateManager.markTaskSucceeded(taskId, resultRef);
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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AC;QAAC,OAAO,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,SAAS,CAAC,uBAAuB,EAAE,MAAM,EAAE;gBAC9C,MAAM;gBACN,KAAK;gBACL,YAAY,EAAE,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;aAC9E,CAAC,CAAC;YACH,MAAM,QAAQ,CAAC;QACjB,CAAC;QAED,kDAAkD;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,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B,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,8BAA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,CAAC,sBAAsB,CAA+B;IAEtE,YAAY,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,uBAAuB,EAgBvE;IAKD,IAAI,wBAAwB,IAAI,WAAW,CAAC,eAAe,CAAC,CAE3D;IAEK,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAwJ7D;IAEK,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CAyGlF;IAED;;;OAGG;IACH,OAAO,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
- const { message, systemPrompt } = builder.buildPrompt({
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: context.rootCauseOutput,
266
+ rootCauseOutput,
252
267
  distillerArtifactId: context.distillerArtifactId,
253
- distillerOutput: context.distillerOutput,
254
- // PRI-1146 P1-02 / §5.3: the exposure state travels as structured
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
- commitResult = await this.committer.commit({
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
- taskId,
421
- output,
422
- idempotencyKey: `${taskId}:${runId}`,
423
- contentJson: routerContentJson,
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 = {};