create-principles-disciple 1.150.4 → 1.150.6

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 (457) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/codex-adapter/dist/ingestion/ingestion.js +25 -4
  3. package/codex-adapter/dist/ingestion/transcript-decoder.d.ts +5 -3
  4. package/codex-adapter/dist/ingestion/transcript-decoder.js +61 -5
  5. package/codex-adapter/package.json +1 -1
  6. package/console/dist/server/index.js +14 -2
  7. package/console/dist/server/models/ActivationsConsoleModel.js +3 -2
  8. package/console/dist/server/models/ApprovalsConsoleModel.js +2 -1
  9. package/console/dist/server/models/ApprovalsGroupedConsoleModel.js +2 -1
  10. package/console/dist/server/models/EvidenceChainConsoleModel.d.ts +46 -0
  11. package/console/dist/server/models/EvidenceChainConsoleModel.js +121 -2
  12. package/console/dist/server/models/GovernanceConsoleModel.js +3 -2
  13. package/console/dist/server/models/GovernanceExperienceCollector.js +2 -1
  14. package/console/dist/server/models/GovernanceProjectionCollector.js +2 -1
  15. package/console/dist/server/models/IngestionHealthModel.d.ts +34 -0
  16. package/console/dist/server/models/IngestionHealthModel.js +254 -0
  17. package/console/dist/server/models/IntentDecisionModel.js +2 -2
  18. package/console/dist/server/models/IntentPageModel.js +2 -1
  19. package/console/dist/server/models/OwnerDecisionConsoleModel.js +3 -3
  20. package/console/dist/server/models/OwnerDecisionViewModel.js +2 -2
  21. package/console/dist/server/models/PrincipleTrajectoryModel.js +2 -1
  22. package/console/dist/server/models/ReceiptsConsoleModel.js +2 -2
  23. package/console/dist/server/models/RuleCandidateBindingConsoleModel.js +3 -2
  24. package/console/dist/server/routes/diagnostician.js +2 -1
  25. package/console/dist/server/routes/evidence-chain.d.ts +4 -0
  26. package/console/dist/server/routes/evidence-chain.js +22 -0
  27. package/console/dist/server/routes/failed-tasks.js +78 -2
  28. package/console/dist/server/routes/health.d.ts +8 -0
  29. package/console/dist/server/routes/health.js +72 -0
  30. package/console/dist/server/routes/owner-identity.d.ts +6 -0
  31. package/console/dist/server/routes/owner-identity.js +7 -3
  32. package/console/dist/server/routes/principles.js +3 -3
  33. package/console/dist/web/assets/app.css +3 -0
  34. package/console/dist/web/assets/app.js +33 -31
  35. package/core/dist/runtime/activation/adaptive-selection-output.d.ts +0 -21
  36. package/core/dist/runtime/activation/adaptive-selection-output.d.ts.map +1 -1
  37. package/core/dist/runtime/activation/adaptive-selection-output.js.map +1 -1
  38. package/core/dist/runtime/activation/index.d.ts +2 -6
  39. package/core/dist/runtime/activation/index.d.ts.map +1 -1
  40. package/core/dist/runtime/activation/index.js.map +1 -1
  41. package/core/dist/runtime/activation/production-gate-deps.d.ts +2 -1
  42. package/core/dist/runtime/activation/production-gate-deps.d.ts.map +1 -1
  43. package/core/dist/runtime/activation/prompt-activation-reader-contract.d.ts +2 -1
  44. package/core/dist/runtime/activation/prompt-activation-reader-contract.d.ts.map +1 -1
  45. package/core/dist/runtime/activation/writers/index.d.ts +0 -1
  46. package/core/dist/runtime/activation/writers/index.d.ts.map +1 -1
  47. package/core/dist/runtime/activation/writers/rule-host-writer.d.ts.map +1 -1
  48. package/core/dist/runtime/activation/writers/rule-host-writer.js +15 -6
  49. package/core/dist/runtime/activation/writers/rule-host-writer.js.map +1 -1
  50. package/core/dist/runtime/activation-compatibility-read-model.d.ts +3 -2
  51. package/core/dist/runtime/activation-compatibility-read-model.d.ts.map +1 -1
  52. package/core/dist/runtime/adapter/context-budget.d.ts +3 -14
  53. package/core/dist/runtime/adapter/context-budget.d.ts.map +1 -1
  54. package/core/dist/runtime/adapter/context-budget.js +2 -2
  55. package/core/dist/runtime/adapter/context-budget.js.map +1 -1
  56. package/core/dist/runtime/adapter/index.d.ts +1 -2
  57. package/core/dist/runtime/adapter/index.d.ts.map +1 -1
  58. package/core/dist/runtime/adapter/index.js +1 -1
  59. package/core/dist/runtime/adapter/index.js.map +1 -1
  60. package/core/dist/runtime/adapter/output-repair-contract.d.ts +18 -1
  61. package/core/dist/runtime/adapter/output-repair-contract.d.ts.map +1 -1
  62. package/core/dist/runtime/adapter/output-repair-contract.js +94 -0
  63. package/core/dist/runtime/adapter/output-repair-contract.js.map +1 -1
  64. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts +2 -3
  65. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  66. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js +5 -2
  67. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js.map +1 -1
  68. package/core/dist/runtime/adapter/principle-tree-ledger-adapter.d.ts +1 -1
  69. package/core/dist/runtime/adapter/principle-tree-ledger-adapter.d.ts.map +1 -1
  70. package/core/dist/runtime/adapter/schema-prompt-adapter.d.ts +0 -1
  71. package/core/dist/runtime/adapter/schema-prompt-adapter.d.ts.map +1 -1
  72. package/core/dist/runtime/adapter/schema-prompt-adapter.js +43 -1
  73. package/core/dist/runtime/adapter/schema-prompt-adapter.js.map +1 -1
  74. package/core/dist/runtime/bridge-result-shaper.d.ts +1 -1
  75. package/core/dist/runtime/bridge-result-shaper.d.ts.map +1 -1
  76. package/core/dist/runtime/candidate-intake-service.d.ts +2 -1
  77. package/core/dist/runtime/candidate-intake-service.d.ts.map +1 -1
  78. package/core/dist/runtime/cli/diagnose.d.ts +4 -3
  79. package/core/dist/runtime/cli/diagnose.d.ts.map +1 -1
  80. package/core/dist/runtime/config/index.d.ts +2 -2
  81. package/core/dist/runtime/config/index.d.ts.map +1 -1
  82. package/core/dist/runtime/config/index.js +3 -3
  83. package/core/dist/runtime/config/index.js.map +1 -1
  84. package/core/dist/runtime/config/pd-config-defaults.d.ts +0 -2
  85. package/core/dist/runtime/config/pd-config-defaults.d.ts.map +1 -1
  86. package/core/dist/runtime/config/pd-config-defaults.js +2 -2
  87. package/core/dist/runtime/config/pd-config-defaults.js.map +1 -1
  88. package/core/dist/runtime/config/pd-config-types.d.ts +2 -0
  89. package/core/dist/runtime/config/pd-config-types.d.ts.map +1 -1
  90. package/core/dist/runtime/config/pd-config-types.js.map +1 -1
  91. package/core/dist/runtime/config/pd-config-validate.d.ts.map +1 -1
  92. package/core/dist/runtime/config/pd-config-validate.js +10 -1
  93. package/core/dist/runtime/config/pd-config-validate.js.map +1 -1
  94. package/core/dist/runtime/config/pd-profile-constants.d.ts +1 -7
  95. package/core/dist/runtime/config/pd-profile-constants.d.ts.map +1 -1
  96. package/core/dist/runtime/config/pd-profile-constants.js +5 -6
  97. package/core/dist/runtime/config/pd-profile-constants.js.map +1 -1
  98. package/core/dist/runtime/config/pd-validate-profile.d.ts +3 -2
  99. package/core/dist/runtime/config/pd-validate-profile.d.ts.map +1 -1
  100. package/core/dist/runtime/context-payload.d.ts +0 -7
  101. package/core/dist/runtime/context-payload.d.ts.map +1 -1
  102. package/core/dist/runtime/context-payload.js +1 -1
  103. package/core/dist/runtime/context-payload.js.map +1 -1
  104. package/core/dist/runtime/core-principles/index.d.ts +1 -1
  105. package/core/dist/runtime/core-principles/index.d.ts.map +1 -1
  106. package/core/dist/runtime/correction/correction-types.d.ts +0 -10
  107. package/core/dist/runtime/correction/correction-types.d.ts.map +1 -1
  108. package/core/dist/runtime/correction/correction-types.js.map +1 -1
  109. package/core/dist/runtime/diagnostician/diag-distiller-output.d.ts +0 -3
  110. package/core/dist/runtime/diagnostician/diag-distiller-output.d.ts.map +1 -1
  111. package/core/dist/runtime/diagnostician/diag-distiller-output.js +1 -1
  112. package/core/dist/runtime/diagnostician/diag-distiller-output.js.map +1 -1
  113. package/core/dist/runtime/diagnostician/diag-rootcause-output.d.ts +3 -11
  114. package/core/dist/runtime/diagnostician/diag-rootcause-output.d.ts.map +1 -1
  115. package/core/dist/runtime/diagnostician/diag-rootcause-output.js +3 -3
  116. package/core/dist/runtime/diagnostician/diag-rootcause-output.js.map +1 -1
  117. package/core/dist/runtime/diagnostician/distiller-prompt-builder.d.ts +5 -4
  118. package/core/dist/runtime/diagnostician/distiller-prompt-builder.d.ts.map +1 -1
  119. package/core/dist/runtime/diagnostician/evidence-ref-binding.d.ts +2 -1
  120. package/core/dist/runtime/diagnostician/evidence-ref-binding.d.ts.map +1 -1
  121. package/core/dist/runtime/diagnostician/rootcause-prompt-builder.d.ts +2 -1
  122. package/core/dist/runtime/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
  123. package/core/dist/runtime/diagnostician/router-prompt-builder.d.ts +22 -3
  124. package/core/dist/runtime/diagnostician/router-prompt-builder.d.ts.map +1 -1
  125. package/core/dist/runtime/diagnostician/router-prompt-builder.js +11 -1
  126. package/core/dist/runtime/diagnostician/router-prompt-builder.js.map +1 -1
  127. package/core/dist/runtime/diagnostician-association-shadow.d.ts +2 -2
  128. package/core/dist/runtime/diagnostician-association-shadow.d.ts.map +1 -1
  129. package/core/dist/runtime/diagnostician-association-validation.d.ts +3 -2
  130. package/core/dist/runtime/diagnostician-association-validation.d.ts.map +1 -1
  131. package/core/dist/runtime/diagnostician-output.d.ts +32 -5
  132. package/core/dist/runtime/diagnostician-output.d.ts.map +1 -1
  133. package/core/dist/runtime/diagnostician-output.js +47 -4
  134. package/core/dist/runtime/diagnostician-output.js.map +1 -1
  135. package/core/dist/runtime/diagnostician-prompt-builder.d.ts +2 -1
  136. package/core/dist/runtime/diagnostician-prompt-builder.d.ts.map +1 -1
  137. package/core/dist/runtime/error-categories.d.ts.map +1 -1
  138. package/core/dist/runtime/error-categories.js +10 -1
  139. package/core/dist/runtime/error-categories.js.map +1 -1
  140. package/core/dist/runtime/evidence-sanitizer.d.ts +8 -1
  141. package/core/dist/runtime/evidence-sanitizer.d.ts.map +1 -1
  142. package/core/dist/runtime/evidence-sanitizer.js +10 -3
  143. package/core/dist/runtime/evidence-sanitizer.js.map +1 -1
  144. package/core/dist/runtime/evolution/evolution-types.d.ts +0 -26
  145. package/core/dist/runtime/evolution/evolution-types.d.ts.map +1 -1
  146. package/core/dist/runtime/evolution/evolution-types.js.map +1 -1
  147. package/core/dist/runtime/feature-flags/index.d.ts +0 -1
  148. package/core/dist/runtime/feature-flags/index.d.ts.map +1 -1
  149. package/core/dist/runtime/feature-flags/index.js.map +1 -1
  150. package/core/dist/runtime/golden-trace.d.ts +9 -1
  151. package/core/dist/runtime/golden-trace.d.ts.map +1 -1
  152. package/core/dist/runtime/golden-trace.js +7 -0
  153. package/core/dist/runtime/golden-trace.js.map +1 -1
  154. package/core/dist/runtime/governance-projection-contract.d.ts +0 -6
  155. package/core/dist/runtime/governance-projection-contract.d.ts.map +1 -1
  156. package/core/dist/runtime/governance-projection-contract.js +3 -3
  157. package/core/dist/runtime/governance-projection-contract.js.map +1 -1
  158. package/core/dist/runtime/internalization/artifact-summary.d.ts +5 -4
  159. package/core/dist/runtime/internalization/artifact-summary.d.ts.map +1 -1
  160. package/core/dist/runtime/internalization/artifact-summary.js +1 -1
  161. package/core/dist/runtime/internalization/artifact-summary.js.map +1 -1
  162. package/core/dist/runtime/internalization/artificer-intent-preflight.d.ts +1 -1
  163. package/core/dist/runtime/internalization/artificer-intent-preflight.d.ts.map +1 -1
  164. package/core/dist/runtime/internalization/artificer-output.d.ts +0 -2
  165. package/core/dist/runtime/internalization/artificer-output.d.ts.map +1 -1
  166. package/core/dist/runtime/internalization/artificer-output.js +17 -0
  167. package/core/dist/runtime/internalization/artificer-output.js.map +1 -1
  168. package/core/dist/runtime/internalization/artificer-prompt-builder.d.ts +14 -3
  169. package/core/dist/runtime/internalization/artificer-prompt-builder.d.ts.map +1 -1
  170. package/core/dist/runtime/internalization/artificer-prompt-builder.js +13 -1
  171. package/core/dist/runtime/internalization/artificer-prompt-builder.js.map +1 -1
  172. package/core/dist/runtime/internalization/artificer-run-correlation.d.ts +3 -2
  173. package/core/dist/runtime/internalization/artificer-run-correlation.d.ts.map +1 -1
  174. package/core/dist/runtime/internalization/consumer-evidence-preflight.d.ts +2 -1
  175. package/core/dist/runtime/internalization/consumer-evidence-preflight.d.ts.map +1 -1
  176. package/core/dist/runtime/internalization/diag-distiller-runner.d.ts +1 -1
  177. package/core/dist/runtime/internalization/diag-distiller-runner.d.ts.map +1 -1
  178. package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts +1 -1
  179. package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
  180. package/core/dist/runtime/internalization/diag-router-runner.d.ts +11 -1
  181. package/core/dist/runtime/internalization/diag-router-runner.d.ts.map +1 -1
  182. package/core/dist/runtime/internalization/diag-router-runner.js +105 -1
  183. package/core/dist/runtime/internalization/diag-router-runner.js.map +1 -1
  184. package/core/dist/runtime/internalization/dreamer-output.d.ts +0 -9
  185. package/core/dist/runtime/internalization/dreamer-output.d.ts.map +1 -1
  186. package/core/dist/runtime/internalization/dreamer-output.js +1 -1
  187. package/core/dist/runtime/internalization/dreamer-output.js.map +1 -1
  188. package/core/dist/runtime/internalization/dreamer-prompt-builder.d.ts +3 -2
  189. package/core/dist/runtime/internalization/dreamer-prompt-builder.d.ts.map +1 -1
  190. package/core/dist/runtime/internalization/dreamer-runner.d.ts +1 -1
  191. package/core/dist/runtime/internalization/dreamer-runner.d.ts.map +1 -1
  192. package/core/dist/runtime/internalization/evaluator-output.d.ts +7 -17
  193. package/core/dist/runtime/internalization/evaluator-output.d.ts.map +1 -1
  194. package/core/dist/runtime/internalization/evaluator-output.js +2 -2
  195. package/core/dist/runtime/internalization/evaluator-output.js.map +1 -1
  196. package/core/dist/runtime/internalization/evaluator-prompt-builder.d.ts +3 -9
  197. package/core/dist/runtime/internalization/evaluator-prompt-builder.d.ts.map +1 -1
  198. package/core/dist/runtime/internalization/evaluator-prompt-builder.js +1 -1
  199. package/core/dist/runtime/internalization/evaluator-prompt-builder.js.map +1 -1
  200. package/core/dist/runtime/internalization/formation-context.d.ts +4 -6
  201. package/core/dist/runtime/internalization/formation-context.d.ts.map +1 -1
  202. package/core/dist/runtime/internalization/formation-context.js +3 -3
  203. package/core/dist/runtime/internalization/formation-context.js.map +1 -1
  204. package/core/dist/runtime/internalization/index.d.ts +2 -4
  205. package/core/dist/runtime/internalization/index.d.ts.map +1 -1
  206. package/core/dist/runtime/internalization/index.js +8 -1
  207. package/core/dist/runtime/internalization/index.js.map +1 -1
  208. package/core/dist/runtime/internalization/intake-to-internalization-bridge.d.ts +2 -1
  209. package/core/dist/runtime/internalization/intake-to-internalization-bridge.d.ts.map +1 -1
  210. package/core/dist/runtime/internalization/intent-contract.d.ts +2 -1
  211. package/core/dist/runtime/internalization/intent-contract.d.ts.map +1 -1
  212. package/core/dist/runtime/internalization/internalization-job-graph.d.ts +1 -1
  213. package/core/dist/runtime/internalization/internalization-job-graph.d.ts.map +1 -1
  214. package/core/dist/runtime/internalization/internalization-route.d.ts +2 -1
  215. package/core/dist/runtime/internalization/internalization-route.d.ts.map +1 -1
  216. package/core/dist/runtime/internalization/owner-decision-review.d.ts +3 -2
  217. package/core/dist/runtime/internalization/owner-decision-review.d.ts.map +1 -1
  218. package/core/dist/runtime/internalization/owner-resolution-service.d.ts +2 -1
  219. package/core/dist/runtime/internalization/owner-resolution-service.d.ts.map +1 -1
  220. package/core/dist/runtime/internalization/owner-retry.d.ts +2 -1
  221. package/core/dist/runtime/internalization/owner-retry.d.ts.map +1 -1
  222. package/core/dist/runtime/internalization/owner-review.d.ts +2 -21
  223. package/core/dist/runtime/internalization/owner-review.d.ts.map +1 -1
  224. package/core/dist/runtime/internalization/owner-review.js +2 -2
  225. package/core/dist/runtime/internalization/owner-review.js.map +1 -1
  226. package/core/dist/runtime/internalization/peer-runner-contracts.d.ts +2 -5
  227. package/core/dist/runtime/internalization/peer-runner-contracts.d.ts.map +1 -1
  228. package/core/dist/runtime/internalization/peer-runner-contracts.js +1 -1
  229. package/core/dist/runtime/internalization/peer-runner-contracts.js.map +1 -1
  230. package/core/dist/runtime/internalization/philosopher-output.d.ts +0 -8
  231. package/core/dist/runtime/internalization/philosopher-output.d.ts.map +1 -1
  232. package/core/dist/runtime/internalization/philosopher-output.js +1 -1
  233. package/core/dist/runtime/internalization/philosopher-output.js.map +1 -1
  234. package/core/dist/runtime/internalization/philosopher-prompt-builder.d.ts +3 -2
  235. package/core/dist/runtime/internalization/philosopher-prompt-builder.d.ts.map +1 -1
  236. package/core/dist/runtime/internalization/pitask-metadata.d.ts +1 -1
  237. package/core/dist/runtime/internalization/pitask-metadata.d.ts.map +1 -1
  238. package/core/dist/runtime/internalization/repair-replay-resolver.d.ts +4 -3
  239. package/core/dist/runtime/internalization/repair-replay-resolver.d.ts.map +1 -1
  240. package/core/dist/runtime/internalization/rollout-reviewer-output.d.ts +2 -3
  241. package/core/dist/runtime/internalization/rollout-reviewer-output.d.ts.map +1 -1
  242. package/core/dist/runtime/internalization/rollout-reviewer-output.js.map +1 -1
  243. package/core/dist/runtime/internalization/rollout-reviewer-prompt-builder.d.ts +0 -1
  244. package/core/dist/runtime/internalization/rollout-reviewer-prompt-builder.d.ts.map +1 -1
  245. package/core/dist/runtime/internalization/rollout-reviewer-prompt-builder.js +1 -1
  246. package/core/dist/runtime/internalization/rollout-reviewer-prompt-builder.js.map +1 -1
  247. package/core/dist/runtime/internalization/router-context-reconstruction.d.ts +3 -3
  248. package/core/dist/runtime/internalization/router-context-reconstruction.d.ts.map +1 -1
  249. package/core/dist/runtime/internalization/rule-activation-contract.d.ts +3 -2
  250. package/core/dist/runtime/internalization/rule-activation-contract.d.ts.map +1 -1
  251. package/core/dist/runtime/internalization/rule-reliability-validation.d.ts +13 -18
  252. package/core/dist/runtime/internalization/rule-reliability-validation.d.ts.map +1 -1
  253. package/core/dist/runtime/internalization/rule-reliability-validation.js +43 -1
  254. package/core/dist/runtime/internalization/rule-reliability-validation.js.map +1 -1
  255. package/core/dist/runtime/internalization/scribe-output.d.ts +2 -15
  256. package/core/dist/runtime/internalization/scribe-output.d.ts.map +1 -1
  257. package/core/dist/runtime/internalization/scribe-output.js +2 -2
  258. package/core/dist/runtime/internalization/scribe-output.js.map +1 -1
  259. package/core/dist/runtime/internalization/scribe-prompt-builder.d.ts +3 -3
  260. package/core/dist/runtime/internalization/scribe-prompt-builder.d.ts.map +1 -1
  261. package/core/dist/runtime/internalization/scribe-prompt-builder.js +0 -1
  262. package/core/dist/runtime/internalization/scribe-prompt-builder.js.map +1 -1
  263. package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts +17 -1
  264. package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts.map +1 -1
  265. package/core/dist/runtime/internalization/split-diagnostician-runner.js +98 -3
  266. package/core/dist/runtime/internalization/split-diagnostician-runner.js.map +1 -1
  267. package/core/dist/runtime/internalization/textual-basis-anchor.d.ts +3 -6
  268. package/core/dist/runtime/internalization/textual-basis-anchor.d.ts.map +1 -1
  269. package/core/dist/runtime/internalization/textual-basis-anchor.js +2 -2
  270. package/core/dist/runtime/internalization/textual-basis-anchor.js.map +1 -1
  271. package/core/dist/runtime/language-directive.d.ts +2 -1
  272. package/core/dist/runtime/language-directive.d.ts.map +1 -1
  273. package/core/dist/runtime/owner-decision/owner-decision-view-contract.d.ts +3 -29
  274. package/core/dist/runtime/owner-decision/owner-decision-view-contract.d.ts.map +1 -1
  275. package/core/dist/runtime/owner-decision/owner-decision-view-contract.js +4 -5
  276. package/core/dist/runtime/owner-decision/owner-decision-view-contract.js.map +1 -1
  277. package/core/dist/runtime/owner-decision/owner-decision-view.d.ts +0 -49
  278. package/core/dist/runtime/owner-decision/owner-decision-view.d.ts.map +1 -1
  279. package/core/dist/runtime/owner-decision/owner-decision-view.js +5 -5
  280. package/core/dist/runtime/owner-decision/owner-decision-view.js.map +1 -1
  281. package/core/dist/runtime/owner-decision/semantic-selector.d.ts +3 -2
  282. package/core/dist/runtime/owner-decision/semantic-selector.d.ts.map +1 -1
  283. package/core/dist/runtime/owner-identity.d.ts +12 -1
  284. package/core/dist/runtime/owner-identity.d.ts.map +1 -1
  285. package/core/dist/runtime/owner-identity.js +19 -1
  286. package/core/dist/runtime/owner-identity.js.map +1 -1
  287. package/core/dist/runtime/pain-ingress-payload.d.ts +0 -39
  288. package/core/dist/runtime/pain-ingress-payload.d.ts.map +1 -1
  289. package/core/dist/runtime/pain-ingress-payload.js +4 -4
  290. package/core/dist/runtime/pain-ingress-payload.js.map +1 -1
  291. package/core/dist/runtime/pain-ingress.d.ts +1 -1
  292. package/core/dist/runtime/pain-ingress.d.ts.map +1 -1
  293. package/core/dist/runtime/pain-ingress.js.map +1 -1
  294. package/core/dist/runtime/pain-signal-bridge.d.ts +0 -2
  295. package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
  296. package/core/dist/runtime/pain-signal-bridge.js +1 -1
  297. package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
  298. package/core/dist/runtime/pain-signal-runtime-factory.d.ts +3 -3
  299. package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
  300. package/core/dist/runtime/pain-signal-runtime-factory.js +1 -1
  301. package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
  302. package/core/dist/runtime/principle-reuse/reuse-proposal.d.ts +3 -2
  303. package/core/dist/runtime/principle-reuse/reuse-proposal.d.ts.map +1 -1
  304. package/core/dist/runtime/principle-reuse/reuse-retrieval.d.ts +0 -10
  305. package/core/dist/runtime/principle-reuse/reuse-retrieval.d.ts.map +1 -1
  306. package/core/dist/runtime/principle-reuse/reuse-retrieval.js +1 -1
  307. package/core/dist/runtime/principle-reuse/reuse-retrieval.js.map +1 -1
  308. package/core/dist/runtime/principle-reuse/reuse-shortlist.d.ts +1 -8
  309. package/core/dist/runtime/principle-reuse/reuse-shortlist.d.ts.map +1 -1
  310. package/core/dist/runtime/principle-reuse/reuse-shortlist.js +1 -1
  311. package/core/dist/runtime/principle-reuse/reuse-shortlist.js.map +1 -1
  312. package/core/dist/runtime/product-telemetry/snapshot-contract.d.ts +3 -2
  313. package/core/dist/runtime/product-telemetry/snapshot-contract.d.ts.map +1 -1
  314. package/core/dist/runtime/runner/base-peer-runner.d.ts +32 -0
  315. package/core/dist/runtime/runner/base-peer-runner.d.ts.map +1 -1
  316. package/core/dist/runtime/runner/base-peer-runner.js +168 -16
  317. package/core/dist/runtime/runner/base-peer-runner.js.map +1 -1
  318. package/core/dist/runtime/runner/default-validator.d.ts +0 -1
  319. package/core/dist/runtime/runner/default-validator.d.ts.map +1 -1
  320. package/core/dist/runtime/runner/default-validator.js +11 -3
  321. package/core/dist/runtime/runner/default-validator.js.map +1 -1
  322. package/core/dist/runtime/runner/peer-runner-types.d.ts +11 -0
  323. package/core/dist/runtime/runner/peer-runner-types.d.ts.map +1 -1
  324. package/core/dist/runtime/storage-paths.d.ts +15 -0
  325. package/core/dist/runtime/storage-paths.d.ts.map +1 -0
  326. package/core/dist/runtime/storage-paths.js +15 -0
  327. package/core/dist/runtime/storage-paths.js.map +1 -0
  328. package/core/dist/runtime/store/artifact/index.d.ts +1 -1
  329. package/core/dist/runtime/store/artifact/index.d.ts.map +1 -1
  330. package/core/dist/runtime/store/candidate/admission-document.d.ts +4 -3
  331. package/core/dist/runtime/store/candidate/admission-document.d.ts.map +1 -1
  332. package/core/dist/runtime/store/commit/index.d.ts +0 -1
  333. package/core/dist/runtime/store/commit/index.d.ts.map +1 -1
  334. package/core/dist/runtime/store/commit/index.js.map +1 -1
  335. package/core/dist/runtime/store/design-gate/sqlite-design-gate-store.d.ts +4 -3
  336. package/core/dist/runtime/store/design-gate/sqlite-design-gate-store.d.ts.map +1 -1
  337. package/core/dist/runtime/store/lifecycle/lease-manager.d.ts +2 -1
  338. package/core/dist/runtime/store/lifecycle/lease-manager.d.ts.map +1 -1
  339. package/core/dist/runtime/store/runtime-state-manager.d.ts +1 -2
  340. package/core/dist/runtime/store/runtime-state-manager.d.ts.map +1 -1
  341. package/core/dist/runtime/store/runtime-state-manager.js.map +1 -1
  342. package/core/dist/runtime/store/sqlite-connection.d.ts +2 -1
  343. package/core/dist/runtime/store/sqlite-connection.d.ts.map +1 -1
  344. package/core/dist/runtime/store/task/sqlite-family-reopen.d.ts +2 -1
  345. package/core/dist/runtime/store/task/sqlite-family-reopen.d.ts.map +1 -1
  346. package/core/dist/runtime/store/task/sqlite-task-store.d.ts +2 -1
  347. package/core/dist/runtime/store/task/sqlite-task-store.d.ts.map +1 -1
  348. package/core/dist/runtime/story-a-demo.d.ts.map +1 -1
  349. package/core/dist/runtime/story-a-demo.js +4 -1
  350. package/core/dist/runtime/story-a-demo.js.map +1 -1
  351. package/core/dist/runtime/tools/agent-tool-contract.d.ts +1 -2
  352. package/core/dist/runtime/tools/agent-tool-contract.d.ts.map +1 -1
  353. package/core/dist/runtime/tools/agent-tool-contract.js +0 -2
  354. package/core/dist/runtime/tools/agent-tool-contract.js.map +1 -1
  355. package/core/dist/runtime/tools/artificer-l2-tool-contract.d.ts +0 -2
  356. package/core/dist/runtime/tools/artificer-l2-tool-contract.d.ts.map +1 -1
  357. package/core/dist/runtime/tools/artificer-l2-tool-contract.js +0 -2
  358. package/core/dist/runtime/tools/artificer-l2-tool-contract.js.map +1 -1
  359. package/core/dist/runtime/types/event-payload.d.ts +0 -2
  360. package/core/dist/runtime/types/event-payload.d.ts.map +1 -1
  361. package/core/dist/runtime/types/event-payload.js.map +1 -1
  362. package/core/dist/runtime/types/evidence-chain-contract.d.ts +66 -2
  363. package/core/dist/runtime/types/evidence-chain-contract.d.ts.map +1 -1
  364. package/core/dist/runtime/types/evidence-chain-contract.js +69 -4
  365. package/core/dist/runtime/types/evidence-chain-contract.js.map +1 -1
  366. package/core/dist/runtime/types/hygiene-types.d.ts +0 -6
  367. package/core/dist/runtime/types/hygiene-types.d.ts.map +1 -1
  368. package/core/dist/runtime/types/hygiene-types.js.map +1 -1
  369. package/core/dist/runtime/types/index.d.ts +1 -1
  370. package/core/dist/runtime/types/index.d.ts.map +1 -1
  371. package/core/dist/runtime/types/index.js.map +1 -1
  372. package/core/dist/runtime/types/intervention-evidence-contract.d.ts +5 -5
  373. package/core/dist/runtime/types/intervention-evidence-contract.d.ts.map +1 -1
  374. package/core/dist/runtime/types/intervention-evidence-contract.js +0 -2
  375. package/core/dist/runtime/types/intervention-evidence-contract.js.map +1 -1
  376. package/core/dist/runtime/types/principle-dependency.d.ts +0 -2
  377. package/core/dist/runtime/types/principle-dependency.d.ts.map +1 -1
  378. package/core/dist/runtime/types/principle-dependency.js.map +1 -1
  379. package/core/dist/runtime/types/principle-lifecycle-event.d.ts +0 -2
  380. package/core/dist/runtime/types/principle-lifecycle-event.d.ts.map +1 -1
  381. package/core/dist/runtime/types/principle-lifecycle-event.js.map +1 -1
  382. package/core/dist/runtime/types/principle-schema.d.ts +0 -26
  383. package/core/dist/runtime/types/principle-schema.d.ts.map +1 -1
  384. package/core/dist/runtime/types/principle-schema.js +2 -2
  385. package/core/dist/runtime/types/principle-schema.js.map +1 -1
  386. package/core/dist/runtime/types/principle-tree-store.d.ts +0 -2
  387. package/core/dist/runtime/types/principle-tree-store.d.ts.map +1 -1
  388. package/core/dist/runtime/types/principle-tree-store.js.map +1 -1
  389. package/core/dist/runtime/types/principle-value-metrics.d.ts +0 -2
  390. package/core/dist/runtime/types/principle-value-metrics.d.ts.map +1 -1
  391. package/core/dist/runtime/types/principle-value-metrics.js.map +1 -1
  392. package/core/dist/runtime/types/rule-candidate-binding.d.ts +2 -1
  393. package/core/dist/runtime/types/rule-candidate-binding.d.ts.map +1 -1
  394. package/core/dist/telemetry-event.d.ts +2 -2
  395. package/core/dist/telemetry-event.d.ts.map +1 -1
  396. package/core/dist/telemetry-event.js +11 -0
  397. package/core/dist/telemetry-event.js.map +1 -1
  398. package/core/package.json +5 -1
  399. package/dist/installers/codex-host-installer.d.ts +9 -0
  400. package/dist/installers/codex-host-installer.d.ts.map +1 -1
  401. package/dist/installers/codex-host-installer.js +35 -1
  402. package/dist/installers/codex-host-installer.js.map +1 -1
  403. package/dist/update/product-identity.d.ts.map +1 -1
  404. package/dist/update/product-identity.js +5 -1
  405. package/dist/update/product-identity.js.map +1 -1
  406. package/host-runtime/dist/active-principle-prompt.d.ts +7 -2
  407. package/host-runtime/dist/active-principle-prompt.js +80 -13
  408. package/host-runtime/dist/adaptive-decision-protocol.d.ts +7 -20
  409. package/host-runtime/dist/adaptive-decision-protocol.js +10 -24
  410. package/host-runtime/dist/adaptive-priority-provider.d.ts +2 -1
  411. package/host-runtime/dist/adaptive-priority-provider.js +6 -5
  412. package/host-runtime/dist/adaptive-selection.d.ts +4 -0
  413. package/host-runtime/dist/adaptive-selection.js +6 -3
  414. package/host-runtime/dist/codex-disclosure.d.ts +12 -7
  415. package/host-runtime/dist/codex-disclosure.js +12 -7
  416. package/host-runtime/dist/conversation-ingestion/pipeline.d.ts +8 -0
  417. package/host-runtime/dist/conversation-ingestion/pipeline.js +6 -1
  418. package/host-runtime/dist/conversation-ingestion/text-policy.d.ts +3 -4
  419. package/host-runtime/dist/conversation-ingestion/text-policy.js +3 -4
  420. package/host-runtime/dist/governance-observation-store.d.ts +38 -5
  421. package/host-runtime/dist/governance-observation-store.js +63 -5
  422. package/host-runtime/dist/index.js +5 -2
  423. package/host-runtime/dist/production-rulehost-gate.d.ts +36 -1
  424. package/host-runtime/dist/production-rulehost-gate.js +91 -1
  425. package/host-runtime/package.json +1 -1
  426. package/package.json +2 -2
  427. package/pd-cli/dist/commands/diagnose.js +1 -1
  428. package/pd-cli/dist/commands/diagnose.js.map +1 -1
  429. package/pd-cli/dist/commands/health-ingestion.d.ts +96 -0
  430. package/pd-cli/dist/commands/health-ingestion.d.ts.map +1 -0
  431. package/pd-cli/dist/commands/health-ingestion.js +473 -0
  432. package/pd-cli/dist/commands/health-ingestion.js.map +1 -0
  433. package/pd-cli/dist/commands/health.d.ts.map +1 -1
  434. package/pd-cli/dist/commands/health.js +10 -0
  435. package/pd-cli/dist/commands/health.js.map +1 -1
  436. package/pd-cli/dist/services/demo-story-a-runner.js +1 -1
  437. package/pd-cli/dist/services/demo-story-a-runner.js.map +1 -1
  438. package/pd-cli/dist/services/version-report.d.ts.map +1 -1
  439. package/pd-cli/dist/services/version-report.js +5 -1
  440. package/pd-cli/dist/services/version-report.js.map +1 -1
  441. package/pd-cli/package.json +1 -1
  442. package/plugin/dist/bundle.js +506 -495
  443. package/plugin/dist/core/experiment-workspace-guard.d.ts +25 -0
  444. package/plugin/dist/index.d.ts +1 -1
  445. package/plugin/dist/openclaw.plugin.json +1 -1
  446. package/plugin/openclaw.plugin.json +1 -1
  447. package/plugin/package.json +1 -1
  448. package/release-manager/dist/installers/codex-host-installer.js +35 -1
  449. package/release-manager/dist/update/product-identity.js +5 -1
  450. package/release-manager/package.json +1 -1
  451. package/workbuddy-adapter/dist/index.d.ts +1 -1
  452. package/workbuddy-adapter/dist/index.js +1 -1
  453. package/workbuddy-adapter/dist/ingestion/catch-up.d.ts +11 -0
  454. package/workbuddy-adapter/dist/ingestion/catch-up.js +7 -2
  455. package/workbuddy-adapter/dist/ingestion/index.d.ts +1 -1
  456. package/workbuddy-adapter/dist/ingestion/index.js +1 -1
  457. package/workbuddy-adapter/package.json +1 -1
@@ -19,7 +19,7 @@ import type { ReuseEvidenceActor } from '../types/principle-schema.js';
19
19
  * required before anything is written.
20
20
  * `no_candidates` — nothing credible was found; the caller proceeds to create.
21
21
  */
22
- export type ReuseProposalStatus = 'pending' | 'no_candidates';
22
+ type ReuseProposalStatus = 'pending' | 'no_candidates';
23
23
  export interface ReuseProposalEntry {
24
24
  /** Canonical Principle Ledger UUID. */
25
25
  principleId: string;
@@ -61,7 +61,7 @@ export type ReuseDecision = {
61
61
  export declare function buildReuseProposal(candidateId: string, shortlist: ReuseShortlist): ReuseProposal;
62
62
  /** True when the proposal needs an Owner answer before writing. */
63
63
  export declare function proposalNeedsDecision(proposal: ReuseProposal): boolean;
64
- export type ReuseDecisionValidation = {
64
+ type ReuseDecisionValidation = {
65
65
  ok: true;
66
66
  decision: ReuseDecision;
67
67
  } | {
@@ -84,4 +84,5 @@ export type ReuseDecisionValidation = {
84
84
  * without them cannot produce a self-contained, auditable evidence entry.
85
85
  */
86
86
  export declare function validateReuseDecision(raw: unknown): ReuseDecisionValidation;
87
+ export {};
87
88
  //# sourceMappingURL=reuse-proposal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reuse-proposal.d.ts","source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AAElC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,uBAAuB,CAwC3E"}
1
+ {"version":3,"file":"reuse-proposal.d.ts","sourceRoot":"","sources":["../../../src/runtime/principle-reuse/reuse-proposal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;;GAIG;AACH,KAAK,mBAAmB,GAAG,SAAS,GAAG,eAAe,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,iDAAiD;IACjD,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,GACtB;IACE,QAAQ,EAAE,OAAO,CAAC;IAClB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,cAAc,GACxB,aAAa,CAef;AAED,mEAAmE;AACnE,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAEtE;AAED,KAAK,uBAAuB,GACxB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAA;CAAE,GACrC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,uBAAuB,CAwC3E"}
@@ -10,16 +10,6 @@
10
10
  * @see docs/archive/specs/PRI-917-reuse-before-create-v0.1.md (SPEC v0.2)
11
11
  */
12
12
  import type { ReuseCandidateInput, ReusablePrinciple, ReuseShortlist, ReuseShortlistOptions } from './reuse-domain.js';
13
- /**
14
- * Statuses a Principle may be reused into (SPEC §15).
15
- *
16
- * `active` and `candidate`/`probation` are included because that is where real
17
- * reusable knowledge lives — excluding `candidate` would leave almost nothing,
18
- * as the live ledger is overwhelmingly `candidate`. `archived` and `deprecated`
19
- * are excluded: reusing into a retired Principle would revive withdrawn
20
- * knowledge. Any unrecognised status is excluded fail-closed.
21
- */
22
- export declare const REUSABLE_PRINCIPLE_STATUSES: ReadonlySet<string>;
23
13
  export declare function isReusablePrincipleStatus(status: unknown): boolean;
24
14
  export declare function readReusablePrinciples(stateDir: string): ReusablePrinciple[];
25
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"reuse-retrieval.d.ts","sourceRoot":"","sources":["../../../src/runtime/principle-reuse/reuse-retrieval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,EAAE,WAAW,CAAC,MAAM,CAI1D,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAMlE;AA0CD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAa5E;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,mBAAmB,EAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,qBAAqB,GAAG;IAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAO,GACrE,cAAc,CAWhB"}
1
+ {"version":3,"file":"reuse-retrieval.d.ts","sourceRoot":"","sources":["../../../src/runtime/principle-reuse/reuse-retrieval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAiB3B,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAMlE;AA0CD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAa5E;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,mBAAmB,EAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,qBAAqB,GAAG;IAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAO,GACrE,cAAc,CAWhB"}
@@ -24,7 +24,7 @@ import { selectReuseShortlist } from './reuse-shortlist.js';
24
24
  * are excluded: reusing into a retired Principle would revive withdrawn
25
25
  * knowledge. Any unrecognised status is excluded fail-closed.
26
26
  */
27
- export const REUSABLE_PRINCIPLE_STATUSES = new Set([
27
+ const REUSABLE_PRINCIPLE_STATUSES = new Set([
28
28
  'active',
29
29
  'candidate',
30
30
  'probation',
@@ -1 +1 @@
1
- {"version":3,"file":"reuse-retrieval.js","sourceRoot":"","sources":["../../../src/runtime/principle-reuse/reuse-retrieval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACr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AAU,CAAC,QAAQ,CAAC,CAAC;IACnC,yEAAyE;IACzE,yEAAyE;IACzE,0EAA0E;IAC1E,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAc,CAAC;IAClE,MAAM,QAAQ,GAAwB,EAAE,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,UAAU,IAAI,yBAAyB,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5F,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAA0B,EAC1B,QAAgB,EAChB,OAAO,GAA6D,EAAE;IAEtE,MAAM,EAAE,kBAAkB,EAAE,GAAG,gBAAgB,EAAE,GAAG,OAAO,CAAC;IAC5D,IAAI,kBAAkB,KAAK,SAAS,IAAI,CAAC,6BAA6B,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC3F,OAAO;YACL,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,CAAC;YAChB,eAAe,EAAE,CAAC;YAClB,qBAAqB,EAAE,KAAK;SAC7B,CAAC;IACJ,CAAC;IACD,OAAO,oBAAoB,CAAC,KAAK,EAAE,sBAAsB,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACzF,CAAC"}
@@ -10,7 +10,7 @@
10
10
  * Explicit non-goals (SPEC §6): no embedding, no vector store, no semantic
11
11
  * search service, no background process, no clock, no randomness.
12
12
  */
13
- import type { ReuseCandidate, ReuseCandidateInput, ReusablePrinciple, ReuseShortlist, ReuseShortlistOptions } from './reuse-domain.js';
13
+ import type { ReuseCandidateInput, ReusablePrinciple, ReuseShortlist, ReuseShortlistOptions } from './reuse-domain.js';
14
14
  /**
15
15
  * Deterministic, dependency-free tokenizer.
16
16
  *
@@ -21,13 +21,6 @@ import type { ReuseCandidate, ReuseCandidateInput, ReusablePrinciple, ReuseShort
21
21
  * The output is sorted, so two equal texts always tokenize identically.
22
22
  */
23
23
  export declare function tokenizeForReuse(input: string): string[];
24
- /**
25
- * Score one existing Principle against the candidate.
26
- *
27
- * Returns `null` when no field pair shares anything — an entry with no
28
- * evidence is not a proposal.
29
- */
30
- export declare function scoreReuseCandidate(input: ReuseCandidateInput, principle: ReusablePrinciple, maxEvidenceTerms?: number): ReuseCandidate | null;
31
24
  /**
32
25
  * Build a deterministic, bounded shortlist of existing Principles that may
33
26
  * already cover the candidate.
@@ -1 +1 @@
1
- {"version":3,"file":"reuse-shortlist.d.ts","sourceRoot":"","sources":["../../../src/runtime/principle-reuse/reuse-shortlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EAGnB,iBAAiB,EAEjB,cAAc,EACd,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AA0C3B;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAqCxD;AAQD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,mBAAmB,EAC1B,SAAS,EAAE,iBAAiB,EAC5B,gBAAgB,GAAE,MAAmC,GACpD,cAAc,GAAG,IAAI,CAoDvB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,mBAAmB,EAC1B,UAAU,EAAE,SAAS,iBAAiB,EAAE,EACxC,OAAO,GAAE,qBAA0B,GAClC,cAAc,CAkBhB"}
1
+ {"version":3,"file":"reuse-shortlist.d.ts","sourceRoot":"","sources":["../../../src/runtime/principle-reuse/reuse-shortlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAEV,mBAAmB,EAGnB,iBAAiB,EAEjB,cAAc,EACd,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AA0C3B;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAqCxD;AAwED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,mBAAmB,EAC1B,UAAU,EAAE,SAAS,iBAAiB,EAAE,EACxC,OAAO,GAAE,qBAA0B,GAClC,cAAc,CAkBhB"}
@@ -104,7 +104,7 @@ function intersect(a, b) {
104
104
  * Returns `null` when no field pair shares anything — an entry with no
105
105
  * evidence is not a proposal.
106
106
  */
107
- export function scoreReuseCandidate(input, principle, maxEvidenceTerms = DEFAULT_MAX_EVIDENCE_TERMS) {
107
+ function scoreReuseCandidate(input, principle, maxEvidenceTerms = DEFAULT_MAX_EVIDENCE_TERMS) {
108
108
  const inputTerms = {
109
109
  text: new Set(tokenizeForReuse(input.text)),
110
110
  triggerPattern: new Set(tokenizeForReuse(input.triggerPattern)),
@@ -1 +1 @@
1
- {"version":3,"file":"reuse-shortlist.js","sourceRoot":"","sources":["../../../src/runtime/principle-reuse/reuse-shortlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAaH,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAC/B,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAErC;;;;GAIG;AACH,MAAM,kBAAkB,GAIlB;IACJ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE;IACvC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE;IAC3C,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,EAAE;IAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,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WAAW,EAAE,SAAS,CAAC,EAAE;QACzB,aAAa,EAAE,SAAS,CAAC,IAAI;QAC7B,KAAK;QACL,QAAQ;QACR,gBAAgB,EAAE,MAAM;KACzB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAA0B,EAC1B,UAAwC,EACxC,OAAO,GAA0B,EAAE;IAEnC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,aAAa,CAAC;IAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,iBAAiB,CAAC;IACvD,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,0BAA0B,CAAC;IAEhF,MAAM,MAAM,GAAqB,EAAE,CAAC;IACpC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAC1E,IAAI,SAAS,IAAI,SAAS,CAAC,KAAK,IAAI,QAAQ;YAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvE,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;IAEvF,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;QACjC,aAAa,EAAE,UAAU,CAAC,MAAM;QAChC,eAAe,EAAE,MAAM,CAAC,MAAM;QAC9B,qBAAqB,EAAE,IAAI;KAC5B,CAAC;AACJ,CAAC"}
@@ -64,11 +64,11 @@ export declare const PROHIBITED_TELEMETRY_FIELD_TOKENS: readonly ['content', 'pr
64
64
  * none matches a prohibited token. Throws with the offending names.
65
65
  */
66
66
  export declare function assertTelemetrySchemaPrivacy(fieldNames: readonly string[]): void;
67
- export interface SnapshotValidationOk {
67
+ interface SnapshotValidationOk {
68
68
  ok: true;
69
69
  value: ProductTelemetrySnapshotV1;
70
70
  }
71
- export interface SnapshotValidationErr {
71
+ interface SnapshotValidationErr {
72
72
  ok: false;
73
73
  errors: string[];
74
74
  }
@@ -107,4 +107,5 @@ export interface BuildSnapshotInput {
107
107
  * error rather than letting an invalid payload reach the network).
108
108
  */
109
109
  export declare function buildProductTelemetrySnapshot(input: BuildSnapshotInput): ProductTelemetrySnapshotV1;
110
+ export {};
110
111
  //# sourceMappingURL=snapshot-contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot-contract.d.ts","sourceRoot":"","sources":["../../../src/runtime/product-telemetry/snapshot-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGtD,eAAO,MAAM,yCAAyC,MAAM,CAAC;AAC7D,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAErD,sFAAsF;AACtF,eAAO,MAAM,4BAA4B,YAAI,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,CAAU,CAAC;AACjG,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,+DAA+D;AAC/D,eAAO,MAAM,uCAAuC,KAAK,CAAC;AAE1D,2FAA2F;AAC3F,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,IAAI,CAAC;AAI3C,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;EAkB3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAEzF,0FAA0F;AAC1F,eAAO,MAAM,kCAAkC,sIASmB,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,YA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version":3,"file":"snapshot-contract.d.ts","sourceRoot":"","sources":["../../../src/runtime/product-telemetry/snapshot-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGtD,eAAO,MAAM,yCAAyC,MAAM,CAAC;AAC7D,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAErD,sFAAsF;AACtF,eAAO,MAAM,4BAA4B,YAAI,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,CAAU,CAAC;AACjG,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,+DAA+D;AAC/D,eAAO,MAAM,uCAAuC,KAAK,CAAC;AAE1D,2FAA2F;AAC3F,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,IAAI,CAAC;AAI3C,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;EAkB3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAEzF,0FAA0F;AAC1F,eAAO,MAAM,kCAAkC,sIASmB,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,YAC5C,SAAS,EACT,QAAQ,EACR,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,OAAO,EACP,WAAW,EACX,SAAS,EACT,WAAW,EACX,YAAY,CACJ,CAAC;AAEX;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAWhF;AAED,UAAU,oBAAoB;IAC5B,EAAE,EAAE,IAAI,CAAC;IACT,KAAK,EAAE,0BAA0B,CAAC;CACnC;AAED,UAAU,qBAAqB;IAC7B,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAWpF;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,OAAO,GAAG,wBAAwB,CA+GvF;AAED,+EAA+E;AAC/E,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,aAAa,CAAC;IAC3B,YAAY,EAAE,aAAa,CAAC;IAC5B,iBAAiB,EAAE,aAAa,CAAC;IACjC,kBAAkB,EAAE,aAAa,CAAC;IAClC,uBAAuB,EAAE,aAAa,CAAC;IACvC,qBAAqB,EAAE,aAAa,CAAC;CACtC;AAED,oEAAoE;AACpE,MAAM,WAAW,gCAAgC;IAC/C,oBAAoB,EAAE,aAAa,CAAC;CACrC;AAED,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,wBAAwB,CAAC;IACnC,UAAU,EAAE,8BAA8B,CAAC;IAC3C,WAAW,EAAE,gCAAgC,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,kBAAkB,GAAG,0BAA0B,CAyBnG"}
@@ -106,6 +106,16 @@ export declare abstract class BasePeerRunner<TContext extends {
106
106
  * to inherit this behavior instead of duplicating the override.
107
107
  */
108
108
  protected postFetchTransform(_taskId: string, untrustedOutput: unknown, _context: TContext): void;
109
+ /**
110
+ * Deep copy of the model output taken before `postFetchTransform` mutates it.
111
+ *
112
+ * The failure evidence must show what the model produced; a subclass that
113
+ * rewrites nested fields in place would otherwise make the preview describe
114
+ * the rewritten object. The payload is parsed JSON, so cloning is lossless.
115
+ * A clone failure is observable (rc-9) instead of silently degrading to the
116
+ * mutated reference.
117
+ */
118
+ private snapshotBeforeTransform;
109
119
  /**
110
120
  * Execute the full peer runner lifecycle for a task.
111
121
  *
@@ -149,6 +159,14 @@ export declare abstract class BasePeerRunner<TContext extends {
149
159
  task: TaskRecord;
150
160
  errors: readonly string[];
151
161
  errorCategory?: PDErrorCategory;
162
+ /**
163
+ * SPEC-PD-DIAG-ROUTER-RELIABILITY-001 §7: the untrusted output that failed
164
+ * validation. Persisted as a bounded, redacted preview in the existing
165
+ * `diagnosticJson.output_failure_details` — never in `runs.output_payload`,
166
+ * which consumers treat as already-validated V2 output (writing raw
167
+ * invalid text there would break lineage verification).
168
+ */
169
+ rawOutput?: unknown;
152
170
  }): Promise<PeerRunnerResult<TOutput>>;
153
171
  /**
154
172
  * Core retry-or-fail decision.
@@ -158,6 +176,20 @@ export declare abstract class BasePeerRunner<TContext extends {
158
176
  * propagating the exception (ERR-002: graceful degradation with reason).
159
177
  */
160
178
  protected retryOrFail(ctx: FailureContext): Promise<PeerRunnerResult<TOutput>>;
179
+ /**
180
+ * P1-3: persist `diagnosticJson.terminal_failure` before the terminal
181
+ * markTaskFailed write.
182
+ *
183
+ * Re-reads the task row first (rc-7 loop-state freshness): the in-memory
184
+ * context snapshot predates this attempt's own output_failure_details write,
185
+ * and merging from the stale snapshot would erase the very validator errors
186
+ * this record exists to preserve alongside.
187
+ *
188
+ * Best-effort (rc-9): a persistence failure is observable via
189
+ * `mark_failed_error` and must not block the terminal state transition —
190
+ * the classified `last_error` on the task row is still correct without it.
191
+ */
192
+ private persistTerminalFailure;
161
193
  private classifyError;
162
194
  /**
163
195
  * PRI-559 P0-2: 把结构化输出失败详情持久化到 task.diagnosticJson。
@@ -1 +1 @@
1
- {"version":3,"file":"base-peer-runner.d.ts","sourceRoot":"","sources":["../../../src/runtime/runner/base-peer-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAA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W,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CA+JnF;IAED;;;;;;;;;;;;OAYG;YACW,sBAAsB;IAyBpC,OAAO,CAAC,aAAa;IAgBrB;;;;;;;;;;;;OAYG;IAEH,UAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,sBAAsB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC1C,OAAO,CAAC,IAAI,CAAC,CAoBf;IAGD,OAAO,CAAC,2BAA2B;IAUnC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzC;IAED;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,IAAI,OAAO,CAKxC;IAID;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,kCAAkC;CA+D3C"}
@@ -23,8 +23,51 @@ import { parseSeedSourcePainId } from '../internalization/pitask-metadata.js';
23
23
  import { PDRuntimeError } from '../error-categories.js';
24
24
  import { RunnerPhase } from './runner-phase.js';
25
25
  import { computeFeatureFlagsFromConfig, isFeatureEnabled } from '../config/pd-config-feature-flags.js';
26
- import { redactAbsolutePaths, redactTokenLikeValues, redactEnvLikeValues, } from '../feedback/redact-sensitive.js';
26
+ import { redactAbsolutePaths, redactTokenLikeValues, redactEnvLikeValues, redactSensitiveFields, redactTelemetryString, } from '../feedback/redact-sensitive.js';
27
+ import { safeStringifyPreview } from '../adapter/output-repair-contract.js';
27
28
  // ── Defaults ─────────────────────────────────────────────────────────────────
29
+ /**
30
+ * P1-3: bounded per-attempt validator-error history. Kept small because it is
31
+ * appended to diagnosticJson on every failed attempt; the newest 10 attempts
32
+ * are enough to show a repeated (unrepaired) failure without unbounded growth.
33
+ */
34
+ const MAX_VALIDATOR_ERROR_HISTORY = 10;
35
+ /**
36
+ * Parse a persisted diagnosticJson string into a plain record (rc-1/rc-2:
37
+ * untrusted runtime data stays `unknown` until narrowed). Malformed or
38
+ * non-object JSON yields `{}` so callers always get a merge target instead of
39
+ * throwing inside a failure path.
40
+ */
41
+ function parseDiagnosticJsonRecord(raw) {
42
+ if (!raw)
43
+ return {};
44
+ let candidate;
45
+ try {
46
+ candidate = JSON.parse(raw);
47
+ }
48
+ catch {
49
+ return {};
50
+ }
51
+ if (typeof candidate !== 'object' || candidate === null || Array.isArray(candidate))
52
+ return {};
53
+ // runtime-contract-exempt: ERR-001 the typeof/Array.isArray guards above have
54
+ // already narrowed `candidate` to a non-null, non-array object.
55
+ return candidate;
56
+ }
57
+ /**
58
+ * P1-3: read the existing bounded per-attempt validator-error history.
59
+ * Untrusted JSON (rc-1/rc-4): entries are validated element-by-element, and a
60
+ * malformed entry invalidates only itself — never the whole history.
61
+ */
62
+ function readValidatorErrorHistory(raw) {
63
+ const parsed = parseDiagnosticJsonRecord(raw);
64
+ if (!Object.hasOwn(parsed, 'validator_error_history'))
65
+ return [];
66
+ const history = parsed.validator_error_history;
67
+ if (!Array.isArray(history))
68
+ return [];
69
+ return history.filter((entry) => typeof entry === 'object' && entry !== null && !Array.isArray(entry));
70
+ }
28
71
  const DEFAULT_PEER_RUNNER_OPTIONS = {
29
72
  pollIntervalMs: 5_000,
30
73
  timeoutMs: 300_000,
@@ -148,6 +191,26 @@ export class BasePeerRunner {
148
191
  Reflect.set(untrustedOutput, 'generatedAt', new Date().toISOString());
149
192
  }
150
193
  }
194
+ /**
195
+ * Deep copy of the model output taken before `postFetchTransform` mutates it.
196
+ *
197
+ * The failure evidence must show what the model produced; a subclass that
198
+ * rewrites nested fields in place would otherwise make the preview describe
199
+ * the rewritten object. The payload is parsed JSON, so cloning is lossless.
200
+ * A clone failure is observable (rc-9) instead of silently degrading to the
201
+ * mutated reference.
202
+ */
203
+ snapshotBeforeTransform(taskId, untrustedOutput) {
204
+ try {
205
+ return structuredClone(untrustedOutput);
206
+ }
207
+ catch (error) {
208
+ this.emitEvent('raw_output_snapshot_failed', taskId, {
209
+ errorMessage: error instanceof Error ? error.message : String(error),
210
+ });
211
+ return untrustedOutput;
212
+ }
213
+ }
151
214
  // ── Template method: full pipeline ─────────────────────────────────────────
152
215
  /**
153
216
  * Execute the full peer runner lifecycle for a task.
@@ -240,6 +303,10 @@ export class BasePeerRunner {
240
303
  const untrustedOutput = await this.fetchAndParseOutput(runHandle.runId, taskId);
241
304
  // 7b. Post-fetch transform on untrusted data (e.g., re-inject lineage fields).
242
305
  // Operates on `unknown` — must NOT assume TOutput shape (ERR-001).
306
+ // Snapshot first: subclasses may rewrite nested fields in place, and the
307
+ // failure preview must describe what the MODEL produced, not the rewritten
308
+ // object (SPEC §7). Derived JSON data, so a deep clone is lossless.
309
+ const rawOutputSnapshot = this.snapshotBeforeTransform(taskId, untrustedOutput);
243
310
  this.postFetchTransform(taskId, untrustedOutput, context);
244
311
  // 8. Validate — the trust boundary. Only validated output becomes TOutput.
245
312
  this.phase = RunnerPhase.Validating;
@@ -250,6 +317,11 @@ export class BasePeerRunner {
250
317
  task: leasedTask,
251
318
  errors: validationResult.errors,
252
319
  errorCategory: validationResult.errorCategory,
320
+ // SPEC-PD-DIAG-ROUTER-RELIABILITY-001 §7: the raw model output is only
321
+ // in scope here. Without it a runner-level rejection leaves
322
+ // `runs.output_payload` NULL and nothing to diagnose (the adapter's
323
+ // evidence pack only covers adapter-level failures, which fail earlier).
324
+ rawOutput: rawOutputSnapshot,
253
325
  });
254
326
  }
255
327
  // Validation passed — safe to treat as TOutput.
@@ -519,17 +591,50 @@ export class BasePeerRunner {
519
591
  // 携带 sourceAttemptCount(= 本 attempt 序号)供读取侧做跨 attempt/跨
520
592
  // 进程新鲜度判定——运行时错误不清除它也不会串 attempt(读取侧只接受
521
593
  // sourceAttemptCount === 本 attempt-1 的记录)。
594
+ //
595
+ // P1-3: `validator_error_history` is appended in the SAME merged write.
596
+ // output_failure_details/lastValidatorErrors only describe the CURRENT
597
+ // attempt; the lab evidence showed three identical failures where every
598
+ // earlier attempt's validator errors were gone, making "did the repair
599
+ // feedback change anything?" unanswerable. The history is bounded and lives
600
+ // in the existing diagnosticJson field — the runs table stays untouched.
601
+ const recordedAt = new Date().toISOString();
602
+ const history = readValidatorErrorHistory(ctx.task.diagnosticJson);
603
+ const boundedHistory = [
604
+ ...history,
605
+ {
606
+ attempt: ctx.task.attemptCount,
607
+ recordedAt,
608
+ errorCategory: category,
609
+ errors: [...ctx.errors],
610
+ },
611
+ ].slice(-MAX_VALIDATOR_ERROR_HISTORY);
612
+ // SPEC §7 evidence: structured redaction FIRST (key-name based: password /
613
+ // apiKey / client_secret / authorization / nested token), then serialize,
614
+ // then string-level redaction for credentials embedded inside plain values.
615
+ // Serializing first would let JSON-quoted keys and escaped Windows paths slip
616
+ // past the string regexes — proven leak in the 2026-11-12 review.
617
+ let rawOutputPreview;
618
+ if (ctx.rawOutput !== undefined) {
619
+ const structured = redactSensitiveFields(ctx.rawOutput);
620
+ const sanitized = structured.ok ? structured.value : ctx.rawOutput;
621
+ const serialized = safeStringifyPreview(sanitized, 2000);
622
+ const redacted = redactTelemetryString(serialized);
623
+ rawOutputPreview = typeof redacted === 'string' ? redacted : serialized;
624
+ }
522
625
  await this.persistOutputFailureDetails(ctx.taskId, ctx.task.diagnosticJson, {
523
626
  errorCategory: category,
524
627
  validatorErrors: [...ctx.errors],
525
628
  errorCount: ctx.errors.length,
629
+ ...(rawOutputPreview !== undefined ? { rawOutputPreview } : {}),
526
630
  }, {
527
631
  lastValidatorErrors: {
528
- recordedAt: new Date().toISOString(),
632
+ recordedAt,
529
633
  errorCategory: category,
530
634
  errors: [...ctx.errors],
531
635
  sourceAttemptCount: ctx.task.attemptCount,
532
636
  },
637
+ validator_error_history: boundedHistory,
533
638
  });
534
639
  return this.retryOrFail({
535
640
  taskId: ctx.taskId,
@@ -656,9 +761,26 @@ export class BasePeerRunner {
656
761
  attemptCount: ctx.task.attemptCount,
657
762
  };
658
763
  }
659
- // Max attempts exceeded
764
+ // Max attempts exceeded.
765
+ //
766
+ // P1-3 root cause fix: the exhausted-budget branch used to call
767
+ // markTaskFailed(taskId, 'max_attempts_exceeded', ...), REPLACING
768
+ // task.last_error and the newest run's errorCategory with the budget
769
+ // mechanism. The classified cause (e.g. output_invalid) was erased, so a
770
+ // task whose schema validation failed three times ended up indistinguishable
771
+ // from an unclassified runtime hang. The budget is HOW execution stopped,
772
+ // not WHY it failed:
773
+ // - task.last_error keeps the classified category (single truth for
774
+ // "what went wrong");
775
+ // - diagnosticJson.terminal_failure records the terminal mechanism plus
776
+ // the classified category/attempts, in the SAME diagnosticJson the
777
+ // output-failure details already use (no new table, no second truth);
778
+ // - the newest run keeps the classified errorCategory, and its reason
779
+ // still says "Max attempts exceeded: <classified reason>".
780
+ await this.persistTerminalFailure(ctx);
781
+ const maxAttemptsReason = `Max attempts exceeded: ${ctx.failureReason}`;
660
782
  try {
661
- await this.stateManager.markTaskFailed(ctx.taskId, 'max_attempts_exceeded', `Max attempts exceeded: ${ctx.failureReason}`);
783
+ await this.stateManager.markTaskFailed(ctx.taskId, ctx.errorCategory, maxAttemptsReason);
662
784
  }
663
785
  catch (stateErr) {
664
786
  this.emitEvent('mark_failed_error', ctx.taskId, {
@@ -675,19 +797,56 @@ export class BasePeerRunner {
675
797
  };
676
798
  }
677
799
  this.emitEvent('task_failed', ctx.taskId, {
678
- errorCategory: 'max_attempts_exceeded',
800
+ errorCategory: ctx.errorCategory,
801
+ terminalReason: 'max_attempts_exceeded',
679
802
  attemptCount: ctx.task.attemptCount,
680
- failureReason: `Max attempts exceeded: ${ctx.failureReason}`,
803
+ failureReason: maxAttemptsReason,
681
804
  });
682
805
  this.phase = RunnerPhase.Failed;
683
806
  return {
684
807
  status: 'failed',
685
808
  taskId: ctx.taskId,
686
- errorCategory: 'max_attempts_exceeded',
687
- failureReason: `Max attempts exceeded: ${ctx.failureReason}`,
809
+ errorCategory: ctx.errorCategory,
810
+ terminalReason: 'max_attempts_exceeded',
811
+ failureReason: maxAttemptsReason,
688
812
  attemptCount: ctx.task.attemptCount,
689
813
  };
690
814
  }
815
+ /**
816
+ * P1-3: persist `diagnosticJson.terminal_failure` before the terminal
817
+ * markTaskFailed write.
818
+ *
819
+ * Re-reads the task row first (rc-7 loop-state freshness): the in-memory
820
+ * context snapshot predates this attempt's own output_failure_details write,
821
+ * and merging from the stale snapshot would erase the very validator errors
822
+ * this record exists to preserve alongside.
823
+ *
824
+ * Best-effort (rc-9): a persistence failure is observable via
825
+ * `mark_failed_error` and must not block the terminal state transition —
826
+ * the classified `last_error` on the task row is still correct without it.
827
+ */
828
+ async persistTerminalFailure(ctx) {
829
+ try {
830
+ const fresh = await this.stateManager.getTask(ctx.taskId);
831
+ const parsed = parseDiagnosticJsonRecord(fresh?.diagnosticJson ?? ctx.task.diagnosticJson);
832
+ parsed.terminal_failure = {
833
+ recordedAt: new Date().toISOString(),
834
+ reason: 'max_attempts_exceeded',
835
+ errorCategory: ctx.errorCategory,
836
+ failureReason: ctx.failureReason,
837
+ attemptCount: ctx.task.attemptCount,
838
+ maxAttempts: ctx.task.maxAttempts,
839
+ };
840
+ await this.stateManager.updateTask(ctx.taskId, { diagnosticJson: JSON.stringify(parsed) });
841
+ }
842
+ catch (err) {
843
+ this.emitEvent('mark_failed_error', ctx.taskId, {
844
+ errorCategory: 'storage_unavailable',
845
+ attemptCount: ctx.task.attemptCount,
846
+ errorMessage: `persistTerminalFailure failed: ${err instanceof Error ? err.message : String(err)}`,
847
+ });
848
+ }
849
+ }
691
850
  // ── Error classification ──────────────────────────────────────────────────
692
851
  // eslint-disable-next-line @typescript-eslint/class-methods-use-this
693
852
  classifyError(error) {
@@ -717,14 +876,7 @@ export class BasePeerRunner {
717
876
  // eslint-disable-next-line @typescript-eslint/max-params
718
877
  async persistOutputFailureDetails(taskId, existingDiagnosticJson, details, extraTopLevelKeys) {
719
878
  try {
720
- let parsed = {};
721
- if (existingDiagnosticJson) {
722
- const candidate = JSON.parse(existingDiagnosticJson);
723
- if (typeof candidate === 'object' && candidate !== null && !Array.isArray(candidate)) {
724
- // runtime-contract-exempt: ERR-001 上方 typeof/Array.isArray 守卫已收窄
725
- parsed = candidate;
726
- }
727
- }
879
+ const parsed = parseDiagnosticJsonRecord(existingDiagnosticJson);
728
880
  parsed.output_failure_details = {
729
881
  recordedAt: new Date().toISOString(),
730
882
  ...details,