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
@@ -32,6 +32,7 @@ export interface AdaptiveCandidate {
32
32
  readonly ref: string;
33
33
  readonly text: string;
34
34
  readonly digest: string;
35
+ readonly replaces?: string;
35
36
  readonly principle: AdaptiveCandidateSource;
36
37
  }
37
38
  export interface BoundedSelectionInput {
@@ -46,6 +47,7 @@ export interface BoundedSelectionInput {
46
47
  readonly ref: string;
47
48
  readonly text: string;
48
49
  readonly digest: string;
50
+ readonly replaces?: string;
49
51
  }[];
50
52
  };
51
53
  readonly entries: readonly AdaptiveCandidate[];
@@ -112,6 +114,7 @@ export declare function buildBoundedSelectionInput(input: {
112
114
  readonly source?: string;
113
115
  }[];
114
116
  readonly candidates: readonly AdaptiveCandidateSource[];
117
+ readonly replacementByActivationId?: ReadonlyMap<string, ActivatedPrinciple> | undefined;
115
118
  }): BuildBoundedInputResult;
116
119
  export interface DecisionSelectorOptions {
117
120
  readonly fetchImpl?: typeof fetch;
@@ -145,6 +148,7 @@ export interface RunAdaptiveSelectionOptions {
145
148
  readonly workspaceDir: string;
146
149
  readonly currentPrompt: string;
147
150
  readonly candidates: readonly ActivatedPrinciple[];
151
+ readonly replacementByActivationId?: ReadonlyMap<string, ActivatedPrinciple> | undefined;
148
152
  readonly model: AdaptiveSelectionModel;
149
153
  readonly requestTimeoutMs?: number;
150
154
  readonly signal?: AbortSignal;
@@ -22,10 +22,10 @@
22
22
  */
23
23
  import crypto from 'node:crypto';
24
24
  import { revalidateAdaptivePrinciple } from './adaptive-principle-revalidation.js';
25
- import { adjudicateDecision, buildDecisionRequest, validateDecisionResponse, } from './adaptive-decision-protocol.js';
25
+ import { ADAPTIVE_DECISION_MAX_CANDIDATE_CHARS, adjudicateDecision, buildDecisionRequest, validateDecisionResponse, } from './adaptive-decision-protocol.js';
26
26
  export const ADAPTIVE_SELECTION_LIMITS = {
27
27
  maxCandidates: 12,
28
- maxCandidateChars: 600,
28
+ maxCandidateChars: ADAPTIVE_DECISION_MAX_CANDIDATE_CHARS,
29
29
  maxPriorMessages: 4,
30
30
  maxPriorMessageChars: 1200,
31
31
  maxInputChars: 6000,
@@ -67,7 +67,9 @@ export function buildBoundedSelectionInput(input) {
67
67
  if (!principle.text.trim())
68
68
  continue;
69
69
  const candidateText = boundText(principle.text, ADAPTIVE_SELECTION_LIMITS.maxCandidateChars);
70
+ const outgoing = input.replacementByActivationId?.get(principle.activationId);
70
71
  entries.push({
72
+ ...(outgoing ? { replaces: boundText(outgoing.text, ADAPTIVE_SELECTION_LIMITS.maxCandidateChars) } : {}),
71
73
  ref: `c${entries.length + 1}`,
72
74
  text: candidateText,
73
75
  // The digest stays part of the frozen candidate snapshot even though the
@@ -87,7 +89,7 @@ export function buildBoundedSelectionInput(input) {
87
89
  payload: {
88
90
  currentInstruction,
89
91
  priorMessages: boundedPrior,
90
- candidates: entries.map((entry) => ({ ref: entry.ref, text: entry.text, digest: entry.digest })),
92
+ candidates: entries.map(({ ref, text, digest, replaces }) => ({ ref, text, digest, ...(replaces !== undefined ? { replaces } : {}) })),
91
93
  },
92
94
  entries,
93
95
  priorDropped: Math.max(0, priorMessages.length - selectedPrior.length),
@@ -335,6 +337,7 @@ export async function runAdaptiveSelection(options) {
335
337
  const built = buildBoundedSelectionInput({
336
338
  currentInput: options.currentPrompt,
337
339
  candidates: options.candidates,
340
+ replacementByActivationId: options.replacementByActivationId,
338
341
  });
339
342
  if (!built.ok)
340
343
  return unavailable(built.reason, 'idle');
@@ -1,8 +1,7 @@
1
1
  /**
2
- * Codex conversation-ingestion consent disclosure — G2A frozen text (Slice D).
3
- *
4
- * The Chinese text below is copied VERBATIM from the Owner-approved decision
5
- * package:
2
+ * Codex conversation-ingestion consent disclosure — G2A frozen text (Slice D),
3
+ * amended by the Owner decision recorded as "Amendment 2 — disclosure v2"
4
+ * (2026-11-12) in:
6
5
  * docs/superpowers/specs/2026-08-28-codex-governance-closure-g0-g2a-decision.md
7
6
  * § "Frozen consent disclosure text (setup will show this verbatim)"
8
7
  *
@@ -12,12 +11,18 @@
12
11
  * the document and asserts byte equality with this constant, so any drift
13
12
  * here fails CI.
14
13
  *
14
+ * v2 (g2b) corrects the "what PD reads" paragraph: the model's own plaintext
15
+ * thinking summary IS stored (it is visible in the Codex UI); the encrypted
16
+ * reasoning body is neither read nor saved. The version advanced so that a
17
+ * consent granted against the old disclosure falls back to the bounded tier
18
+ * instead of silently widening what is stored.
19
+ *
15
20
  * The English rendering states the same facts; per the G2A binding note it is
16
21
  * produced at setup implementation time from the frozen Chinese text. Setup
17
22
  * surfaces always present the Chinese SSoT first.
18
23
  */
19
- export declare const CODEX_INGESTION_DISCLOSURE_VERSION = "g2a-2026-08-28";
24
+ export declare const CODEX_INGESTION_DISCLOSURE_VERSION = "g2b-2026-11-12";
20
25
  export type CodexIngestionDisclosureLanguage = 'zh' | 'en';
21
- export declare const CODEX_INGESTION_DISCLOSURE_ZH = "### Principles Disciple \u2014 \u5BF9\u8BDD\u89C2\u5BDF\u4E0E\u6CBB\u7406\u95ED\u73AF\uFF08Codex\uFF09\n\n**\u5F00\u542F\u540E PD \u4F1A\u8BFB\u53D6\u4EC0\u4E48\uFF1F**\n\u8BFB\u53D6\u672C\u5DE5\u4F5C\u533A\u5185 Codex \u660E\u786E\u63D0\u4F9B\u7ED9 PD \u7684\u4F1A\u8BDD\u8BB0\u5F55\uFF08transcript\uFF09\u3002\u8FDB\u5165\u6CBB\u7406\u89C2\u5BDF\u7684\u53EA\u6709\u53EF\u89C1\u5185\u5BB9\uFF1A\u4F60\u53D1\u51FA\u7684\u6D88\u606F\u3001\u52A9\u624B\u7684\u53EF\u89C1\u56DE\u590D\u3001\u4EE5\u53CA\u5DE5\u5177\u8C03\u7528\u7684\u540D\u79F0/\u8F93\u5165/\u7ED3\u679C\uFF08\u7528\u4E8E\u8BC6\u522B\u53CD\u590D\u51FA\u73B0\u7684\u95EE\u9898\uFF09\u3002\u8BB0\u5F55\u4E2D\u540C\u65F6\u5B58\u5728\u7684\u9690\u85CF\u601D\u8003\u8FC7\u7A0B\uFF08Codex \u4EE5\u52A0\u5BC6\u5F62\u5F0F\u4FDD\u5B58\uFF09\u3001\u7CFB\u7EDF/\u5F00\u53D1\u8005\u63D0\u793A\u8BCD\u3001\u5BBF\u4E3B\u6CE8\u5165\u7684\u73AF\u5883\u4E0A\u4E0B\u6587\uFF0C\u4F1A\u5728\u89E3\u6790\u65F6\u88AB\u8BC6\u522B\u5E76\u4E22\u5F03\u2014\u2014\u4E0D\u4F1A\u88AB\u4FDD\u5B58\u3001\u4E0D\u4F1A\u8FDB\u5165\u65E5\u5FD7\u3001\u4E0D\u4F1A\u53D1\u9001\u7ED9\u8BCA\u65AD\u6A21\u578B\u3002\n\n**\u4E3A\u4EC0\u4E48\u8BFB\u53D6\uFF1F**\n\u4E3A\u4E86\u8BA9 PD \u5728 Codex \u4E0A\u5B8C\u6210\u5B83\u627F\u8BFA\u7684\u95ED\u73AF\uFF1A\u628A\u4F60\u53CD\u590D\u7EA0\u6B63\u7684\u5730\u65B9\u53D8\u6210\u4E00\u6761\u53EF\u5BA1\u67E5\u7684\u539F\u5219\u5019\u9009\u2014\u2014\u4F60\u9700\u8981\u5148\u770B\u5230\u8BC1\u636E\uFF0C\u518D\u51B3\u5B9A\u662F\u5426\u91C7\u7EB3\u3002\u4E0D\u89E3\u6790\u5BF9\u8BDD\uFF0CPD \u5C31\u53EA\u80FD\u7BA1\u5DE5\u5177\uFF0C\u5B66\u4E0D\u5230\u7EA0\u6B63\u3002\n\n**\u4FDD\u5B58\u591A\u5C11\u3001\u591A\u4E45\uFF1F**\n\u6BCF\u4E2A\u4F1A\u8BDD\u53EA\u4FDD\u7559\u6700\u8FD1 32 \u6761\u53EF\u89C1\u6D88\u606F\u3001\u6700\u591A 7 \u5929\uFF08\u5148\u5230\u671F\u5148\u5220\u9664\uFF09\u3002\u5F53\u67D0\u4E2A\u95EE\u9898\u88AB\u6B63\u5F0F\u7ACB\u4E3A pain \u65F6\uFF0C\u624D\u4F1A\u628A\u5B83\u7684\u524D 12 \u6761\u6D88\u606F + \u89E6\u53D1\u70B9 + \u52A9\u624B\u7684\u4E0B\u4E00\u6761\u5B8C\u6574\u56DE\u590D\u5347\u7EA7\u4E3A\u957F\u671F\u6CBB\u7406\u8BC1\u636E\uFF0C\u6309\u73B0\u6709\u6CBB\u7406\u6570\u636E\u7684\u751F\u547D\u5468\u671F\u7BA1\u7406\u3002\u4FDD\u5B58\u7684\u5DE5\u5177\u8BC1\u636E\u5728\u843D\u76D8\u524D\u4F1A\u7ECF\u8FC7\u65E2\u6709\u7684\u654F\u611F\u5B57\u6BB5\u4E0E\u5E38\u89C1\u5BC6\u94A5\u683C\u5F0F\u8131\u654F\uFF1B\u4F46\u8BF7\u6CE8\u610F\uFF1A\u5982\u679C\u4E00\u6BB5\u5BC6\u94A5\u770B\u8D77\u6765\u5C31\u50CF\u666E\u901A\u6587\u5B57\uFF0C\u4EFB\u4F55\u8FC7\u6EE4\u5668\u90FD\u65E0\u6CD5\u8BC6\u522B\u5B83\u2014\u2014\u8BF7\u4E0D\u8981\u8BA9 PD \u89C2\u5BDF\u5305\u542B\u6B64\u7C7B\u5185\u5BB9\u7684\u4F1A\u8BDD\u3002\n\n**\u6570\u636E\u4F1A\u79BB\u5F00\u672C\u673A\u5417\uFF1F**\n\u89C2\u5BDF\u6570\u636E\u672C\u8EAB\u53EA\u5B58\u5728\u672C\u673A\u5DE5\u4F5C\u533A\u3002\u88AB\u5347\u7EA7\u4E3A\u6CBB\u7406\u8BC1\u636E\u7684\u5BF9\u8BDD\u7247\u6BB5\uFF0C\u4F1A\u50CF\u73B0\u6709\u8BCA\u65AD\u6D41\u7A0B\u4E00\u6837\u53D1\u9001\u7ED9\u4F60\u914D\u7F6E\u7684 LLM API \u505A\u8BCA\u65AD\u2014\u2014\u8FD9\u662F\u552F\u4E00\u7684\u5916\u53D1\u8DEF\u5F84\uFF0C\u4E0E OpenClaw \u4E0A\u7684\u73B0\u6709\u884C\u4E3A\u4E00\u81F4\u3002\u4EA7\u54C1\u9065\u6D4B\u4E0D\u5305\u542B\u4EFB\u4F55\u6D88\u606F\u5185\u5BB9\u6216\u4F1A\u8BDD\u6807\u8BC6\u3002\n\n**\u5982\u4F55\u5173\u95ED\uFF1F\u968F\u65F6\u3002**\n\u5173\u95ED\u540E PD \u7ACB\u5373\u505C\u6B62\u8BFB\u53D6 transcript\uFF08\u4E0D\u662F\"\u8BFB\u4E86\u518D\u4E22\u5F03\"\uFF0C\u800C\u662F\u6839\u672C\u4E0D\u6253\u5F00\uFF09\u3002\u5DF2\u6709\u7684\u539F\u5219\u6CE8\u5165\u3001\u5DE5\u5177\u62E6\u622A\u3001\u65E2\u6709\u5DE5\u5177\u8BC1\u636E\u5B8C\u5168\u4E0D\u53D7\u5F71\u54CD\u3002\u5DF2\u4FDD\u5B58\u7684\u5185\u5BB9\u6309\u4E0A\u8FF0\u671F\u9650\u81EA\u7136\u8FC7\u671F\uFF1B\u5347\u7EA7\u8FC7\u7684\u8BC1\u636E\u53EA\u80FD\u7531\u4F60\u901A\u8FC7\u65E2\u6709\u6CBB\u7406\u6E05\u7406\u547D\u4EE4\u663E\u5F0F\u5220\u9664\u3002\u5378\u8F7D\u4E0D\u4F1A\u9759\u9ED8\u5220\u9664\u4EFB\u4F55\u8BC1\u636E\u3002\n\n**\u9ED8\u8BA4\u72B6\u6001\uFF1F**\n\u9ED8\u8BA4\u5173\u95ED\u3002\u53EA\u6709\u4F60\u5728\u770B\u5230\u672C\u8BF4\u660E\u540E\u660E\u786E\u9009\u62E9\u5F00\u542F\u624D\u4F1A\u751F\u6548\uFF1B\u5347\u7EA7 PD \u6C38\u8FDC\u4E0D\u4F1A\u66FF\u4F60\u5F00\u542F\u3002";
22
- export declare const CODEX_INGESTION_DISCLOSURE_EN = "### Principles Disciple \u2014 Conversation Observation & Governance Closure (Codex)\n\n**What does PD read once enabled?**\nPD reads the Codex session transcripts that Codex explicitly provides to PD inside this workspace. Only visible content enters governance observation: the messages you send, the assistant's visible replies, and the names/inputs/results of tool calls (used to recognize recurring problems). The hidden reasoning process that Codex stores in encrypted form, system/developer prompts, and host-injected environment context present in the same records are recognized and discarded during parsing \u2014 never saved, never written to logs, never sent to the diagnosis model.\n\n**Why read at all?**\nSo that PD can deliver on its promised closed loop on Codex: turning the places you repeatedly correct into a reviewable principle candidate \u2014 you see the evidence first, then decide whether to adopt it. Without parsing conversations, PD can only govern tools and cannot learn your corrections.\n\n**How much is kept, and for how long?**\nPer session, only the most recent 32 visible messages are kept, for at most 7 days (expired first, deleted first). Only when a problem is formally established as a pain are its preceding 12 messages + the trigger point + the assistant's next complete reply promoted into long-term governance evidence, managed under the existing governance data lifecycle. Saved tool evidence passes through the existing sensitive-field and common-secret-format redaction before being written; but note: if a secret looks like ordinary text, no filter can recognize it \u2014 please do not let PD observe sessions containing such content.\n\n**Does data leave this machine?**\nObservation data itself lives only in the local workspace. Conversation fragments promoted into governance evidence are sent to your configured LLM API for diagnosis, exactly like the existing diagnosis flow \u2014 this is the only egress path, consistent with current behavior on OpenClaw. Product telemetry contains no message content and no session identifiers.\n\n**How do I turn it off? Anytime.**\nOnce off, PD immediately stops reading transcripts (not \"read then discard\" \u2014 the transcript is never opened at all). Existing principle injection, tool interception, and existing tool evidence are completely unaffected. Saved content expires naturally per the limits above; promoted evidence can only be deleted explicitly by you through the existing governance cleanup commands. Uninstall never silently deletes any evidence.\n\n**Default state?**\nOff by default. It takes effect only after you explicitly choose to enable it after seeing this disclosure; upgrading PD never enables it for you.";
26
+ export declare const CODEX_INGESTION_DISCLOSURE_ZH = "### Principles Disciple \u2014 \u5BF9\u8BDD\u89C2\u5BDF\u4E0E\u6CBB\u7406\u95ED\u73AF\uFF08Codex\uFF09\n\n**\u5F00\u542F\u540E PD \u4F1A\u8BFB\u53D6\u4EC0\u4E48\uFF1F**\n\u8BFB\u53D6\u672C\u5DE5\u4F5C\u533A\u5185 Codex \u660E\u786E\u63D0\u4F9B\u7ED9 PD \u7684\u4F1A\u8BDD\u8BB0\u5F55\uFF08transcript\uFF09\u3002\u8FDB\u5165\u6CBB\u7406\u89C2\u5BDF\u7684\u53EA\u6709\u53EF\u89C1\u5185\u5BB9\uFF1A\u4F60\u53D1\u51FA\u7684\u6D88\u606F\u3001\u52A9\u624B\u7684\u53EF\u89C1\u56DE\u590D\u3001\u5DE5\u5177\u8C03\u7528\u7684\u540D\u79F0/\u8F93\u5165/\u7ED3\u679C\uFF08\u7528\u4E8E\u8BC6\u522B\u53CD\u590D\u51FA\u73B0\u7684\u95EE\u9898\uFF09\uFF0C\u4EE5\u53CA\u6A21\u578B\u81EA\u5DF1\u5199\u51FA\u7684\u601D\u8003\u6458\u8981\uFF08\u4E00\u6BB5\u7B80\u77ED\u6587\u5B57\uFF0CCodex \u754C\u9762\u4E0A\u4E5F\u4F1A\u663E\u793A\u7ED9\u4F60\uFF09\u3002Codex \u53E6\u5916\u4EE5\u52A0\u5BC6\u5F62\u5F0F\u4FDD\u5B58\u7684\u5B8C\u6574\u601D\u8003\u6B63\u6587\uFF0CPD \u65E2\u4E0D\u8BFB\u53D6\u4E5F\u4E0D\u4FDD\u5B58\u3002\u8BB0\u5F55\u4E2D\u540C\u65F6\u5B58\u5728\u7684\u7CFB\u7EDF/\u5F00\u53D1\u8005\u63D0\u793A\u8BCD\u3001\u5BBF\u4E3B\u6CE8\u5165\u7684\u73AF\u5883\u4E0A\u4E0B\u6587\uFF0C\u4F1A\u5728\u89E3\u6790\u65F6\u88AB\u8BC6\u522B\u5E76\u4E22\u5F03\u2014\u2014\u4E0D\u4F1A\u88AB\u4FDD\u5B58\u3001\u4E0D\u4F1A\u8FDB\u5165\u65E5\u5FD7\u3001\u4E0D\u4F1A\u53D1\u9001\u7ED9\u8BCA\u65AD\u6A21\u578B\u3002\n\n**\u4E3A\u4EC0\u4E48\u8BFB\u53D6\uFF1F**\n\u4E3A\u4E86\u8BA9 PD \u5728 Codex \u4E0A\u5B8C\u6210\u5B83\u627F\u8BFA\u7684\u95ED\u73AF\uFF1A\u628A\u4F60\u53CD\u590D\u7EA0\u6B63\u7684\u5730\u65B9\u53D8\u6210\u4E00\u6761\u53EF\u5BA1\u67E5\u7684\u539F\u5219\u5019\u9009\u2014\u2014\u4F60\u9700\u8981\u5148\u770B\u5230\u8BC1\u636E\uFF0C\u518D\u51B3\u5B9A\u662F\u5426\u91C7\u7EB3\u3002\u4E0D\u89E3\u6790\u5BF9\u8BDD\uFF0CPD \u5C31\u53EA\u80FD\u7BA1\u5DE5\u5177\uFF0C\u5B66\u4E0D\u5230\u7EA0\u6B63\u3002\n\n**\u4FDD\u5B58\u591A\u5C11\u3001\u591A\u4E45\uFF1F**\n\u6BCF\u4E2A\u4F1A\u8BDD\u53EA\u4FDD\u7559\u6700\u8FD1 32 \u6761\u53EF\u89C1\u6D88\u606F\u3001\u6700\u591A 7 \u5929\uFF08\u5148\u5230\u671F\u5148\u5220\u9664\uFF09\u3002\u5F53\u67D0\u4E2A\u95EE\u9898\u88AB\u6B63\u5F0F\u7ACB\u4E3A pain \u65F6\uFF0C\u624D\u4F1A\u628A\u5B83\u7684\u524D 12 \u6761\u6D88\u606F + \u89E6\u53D1\u70B9 + \u52A9\u624B\u7684\u4E0B\u4E00\u6761\u5B8C\u6574\u56DE\u590D\u5347\u7EA7\u4E3A\u957F\u671F\u6CBB\u7406\u8BC1\u636E\uFF0C\u6309\u73B0\u6709\u6CBB\u7406\u6570\u636E\u7684\u751F\u547D\u5468\u671F\u7BA1\u7406\u3002\u4FDD\u5B58\u7684\u5DE5\u5177\u8BC1\u636E\u5728\u843D\u76D8\u524D\u4F1A\u7ECF\u8FC7\u65E2\u6709\u7684\u654F\u611F\u5B57\u6BB5\u4E0E\u5E38\u89C1\u5BC6\u94A5\u683C\u5F0F\u8131\u654F\uFF1B\u4F46\u8BF7\u6CE8\u610F\uFF1A\u5982\u679C\u4E00\u6BB5\u5BC6\u94A5\u770B\u8D77\u6765\u5C31\u50CF\u666E\u901A\u6587\u5B57\uFF0C\u4EFB\u4F55\u8FC7\u6EE4\u5668\u90FD\u65E0\u6CD5\u8BC6\u522B\u5B83\u2014\u2014\u8BF7\u4E0D\u8981\u8BA9 PD \u89C2\u5BDF\u5305\u542B\u6B64\u7C7B\u5185\u5BB9\u7684\u4F1A\u8BDD\u3002\n\n**\u6570\u636E\u4F1A\u79BB\u5F00\u672C\u673A\u5417\uFF1F**\n\u89C2\u5BDF\u6570\u636E\u672C\u8EAB\u53EA\u5B58\u5728\u672C\u673A\u5DE5\u4F5C\u533A\u3002\u88AB\u5347\u7EA7\u4E3A\u6CBB\u7406\u8BC1\u636E\u7684\u5BF9\u8BDD\u7247\u6BB5\uFF0C\u4F1A\u50CF\u73B0\u6709\u8BCA\u65AD\u6D41\u7A0B\u4E00\u6837\u53D1\u9001\u7ED9\u4F60\u914D\u7F6E\u7684 LLM API \u505A\u8BCA\u65AD\u2014\u2014\u8FD9\u662F\u552F\u4E00\u7684\u5916\u53D1\u8DEF\u5F84\uFF0C\u4E0E OpenClaw \u4E0A\u7684\u73B0\u6709\u884C\u4E3A\u4E00\u81F4\u3002\u4EA7\u54C1\u9065\u6D4B\u4E0D\u5305\u542B\u4EFB\u4F55\u6D88\u606F\u5185\u5BB9\u6216\u4F1A\u8BDD\u6807\u8BC6\u3002\n\n**\u5982\u4F55\u5173\u95ED\uFF1F\u968F\u65F6\u3002**\n\u5173\u95ED\u540E PD \u7ACB\u5373\u505C\u6B62\u8BFB\u53D6 transcript\uFF08\u4E0D\u662F\"\u8BFB\u4E86\u518D\u4E22\u5F03\"\uFF0C\u800C\u662F\u6839\u672C\u4E0D\u6253\u5F00\uFF09\u3002\u5DF2\u6709\u7684\u539F\u5219\u6CE8\u5165\u3001\u5DE5\u5177\u62E6\u622A\u3001\u65E2\u6709\u5DE5\u5177\u8BC1\u636E\u5B8C\u5168\u4E0D\u53D7\u5F71\u54CD\u3002\u5DF2\u4FDD\u5B58\u7684\u5185\u5BB9\u6309\u4E0A\u8FF0\u671F\u9650\u81EA\u7136\u8FC7\u671F\uFF1B\u5347\u7EA7\u8FC7\u7684\u8BC1\u636E\u53EA\u80FD\u7531\u4F60\u901A\u8FC7\u65E2\u6709\u6CBB\u7406\u6E05\u7406\u547D\u4EE4\u663E\u5F0F\u5220\u9664\u3002\u5378\u8F7D\u4E0D\u4F1A\u9759\u9ED8\u5220\u9664\u4EFB\u4F55\u8BC1\u636E\u3002\n\n**\u9ED8\u8BA4\u72B6\u6001\uFF1F**\n\u9ED8\u8BA4\u5173\u95ED\u3002\u53EA\u6709\u4F60\u5728\u770B\u5230\u672C\u8BF4\u660E\u540E\u660E\u786E\u9009\u62E9\u5F00\u542F\u624D\u4F1A\u751F\u6548\uFF1B\u5347\u7EA7 PD \u6C38\u8FDC\u4E0D\u4F1A\u66FF\u4F60\u5F00\u542F\u3002";
27
+ export declare const CODEX_INGESTION_DISCLOSURE_EN = "### Principles Disciple \u2014 Conversation Observation & Governance Closure (Codex)\n\n**What does PD read once enabled?**\nPD reads the Codex session transcripts that Codex explicitly provides to PD inside this workspace. Only visible content enters governance observation: the messages you send, the assistant's visible replies, the names/inputs/results of tool calls (used to recognize recurring problems), and the short thinking summaries the model writes (the same text Codex shows you in its UI). The full reasoning body that Codex keeps in encrypted form is neither read nor saved by PD. System/developer prompts and host-injected environment context present in the same records are recognized and discarded during parsing \u2014 never saved, never written to logs, never sent to the diagnosis model.\n\n**Why read at all?**\nSo that PD can deliver on its promised closed loop on Codex: turning the places you repeatedly correct into a reviewable principle candidate \u2014 you see the evidence first, then decide whether to adopt it. Without parsing conversations, PD can only govern tools and cannot learn your corrections.\n\n**How much is kept, and for how long?**\nPer session, only the most recent 32 visible messages are kept, for at most 7 days (expired first, deleted first). Only when a problem is formally established as a pain are its preceding 12 messages + the trigger point + the assistant's next complete reply promoted into long-term governance evidence, managed under the existing governance data lifecycle. Saved tool evidence passes through the existing sensitive-field and common-secret-format redaction before being written; but note: if a secret looks like ordinary text, no filter can recognize it \u2014 please do not let PD observe sessions containing such content.\n\n**Does data leave this machine?**\nObservation data itself lives only in the local workspace. Conversation fragments promoted into governance evidence are sent to your configured LLM API for diagnosis, exactly like the existing diagnosis flow \u2014 this is the only egress path, consistent with current behavior on OpenClaw. Product telemetry contains no message content and no session identifiers.\n\n**How do I turn it off? Anytime.**\nOnce off, PD immediately stops reading transcripts (not \"read then discard\" \u2014 the transcript is never opened at all). Existing principle injection, tool interception, and existing tool evidence are completely unaffected. Saved content expires naturally per the limits above; promoted evidence can only be deleted explicitly by you through the existing governance cleanup commands. Uninstall never silently deletes any evidence.\n\n**Default state?**\nOff by default. It takes effect only after you explicitly choose to enable it after seeing this disclosure; upgrading PD never enables it for you.";
23
28
  export declare function getCodexIngestionDisclosureText(language: CodexIngestionDisclosureLanguage): string;
@@ -1,8 +1,7 @@
1
1
  /**
2
- * Codex conversation-ingestion consent disclosure — G2A frozen text (Slice D).
3
- *
4
- * The Chinese text below is copied VERBATIM from the Owner-approved decision
5
- * package:
2
+ * Codex conversation-ingestion consent disclosure — G2A frozen text (Slice D),
3
+ * amended by the Owner decision recorded as "Amendment 2 — disclosure v2"
4
+ * (2026-11-12) in:
6
5
  * docs/superpowers/specs/2026-08-28-codex-governance-closure-g0-g2a-decision.md
7
6
  * § "Frozen consent disclosure text (setup will show this verbatim)"
8
7
  *
@@ -12,15 +11,21 @@
12
11
  * the document and asserts byte equality with this constant, so any drift
13
12
  * here fails CI.
14
13
  *
14
+ * v2 (g2b) corrects the "what PD reads" paragraph: the model's own plaintext
15
+ * thinking summary IS stored (it is visible in the Codex UI); the encrypted
16
+ * reasoning body is neither read nor saved. The version advanced so that a
17
+ * consent granted against the old disclosure falls back to the bounded tier
18
+ * instead of silently widening what is stored.
19
+ *
15
20
  * The English rendering states the same facts; per the G2A binding note it is
16
21
  * produced at setup implementation time from the frozen Chinese text. Setup
17
22
  * surfaces always present the Chinese SSoT first.
18
23
  */
19
- export const CODEX_INGESTION_DISCLOSURE_VERSION = 'g2a-2026-08-28';
24
+ export const CODEX_INGESTION_DISCLOSURE_VERSION = 'g2b-2026-11-12';
20
25
  export const CODEX_INGESTION_DISCLOSURE_ZH = `### Principles Disciple — 对话观察与治理闭环(Codex)
21
26
 
22
27
  **开启后 PD 会读取什么?**
23
- 读取本工作区内 Codex 明确提供给 PD 的会话记录(transcript)。进入治理观察的只有可见内容:你发出的消息、助手的可见回复、以及工具调用的名称/输入/结果(用于识别反复出现的问题)。记录中同时存在的隐藏思考过程(Codex 以加密形式保存)、系统/开发者提示词、宿主注入的环境上下文,会在解析时被识别并丢弃——不会被保存、不会进入日志、不会发送给诊断模型。
28
+ 读取本工作区内 Codex 明确提供给 PD 的会话记录(transcript)。进入治理观察的只有可见内容:你发出的消息、助手的可见回复、工具调用的名称/输入/结果(用于识别反复出现的问题),以及模型自己写出的思考摘要(一段简短文字,Codex 界面上也会显示给你)。Codex 另外以加密形式保存的完整思考正文,PD 既不读取也不保存。记录中同时存在的系统/开发者提示词、宿主注入的环境上下文,会在解析时被识别并丢弃——不会被保存、不会进入日志、不会发送给诊断模型。
24
29
 
25
30
  **为什么读取?**
26
31
  为了让 PD 在 Codex 上完成它承诺的闭环:把你反复纠正的地方变成一条可审查的原则候选——你需要先看到证据,再决定是否采纳。不解析对话,PD 就只能管工具,学不到纠正。
@@ -39,7 +44,7 @@ export const CODEX_INGESTION_DISCLOSURE_ZH = `### Principles Disciple — 对话
39
44
  export const CODEX_INGESTION_DISCLOSURE_EN = `### Principles Disciple — Conversation Observation & Governance Closure (Codex)
40
45
 
41
46
  **What does PD read once enabled?**
42
- PD reads the Codex session transcripts that Codex explicitly provides to PD inside this workspace. Only visible content enters governance observation: the messages you send, the assistant's visible replies, and the names/inputs/results of tool calls (used to recognize recurring problems). The hidden reasoning process that Codex stores in encrypted form, system/developer prompts, and host-injected environment context present in the same records are recognized and discarded during parsing — never saved, never written to logs, never sent to the diagnosis model.
47
+ PD reads the Codex session transcripts that Codex explicitly provides to PD inside this workspace. Only visible content enters governance observation: the messages you send, the assistant's visible replies, the names/inputs/results of tool calls (used to recognize recurring problems), and the short thinking summaries the model writes (the same text Codex shows you in its UI). The full reasoning body that Codex keeps in encrypted form is neither read nor saved by PD. System/developer prompts and host-injected environment context present in the same records are recognized and discarded during parsing — never saved, never written to logs, never sent to the diagnosis model.
43
48
 
44
49
  **Why read at all?**
45
50
  So that PD can deliver on its promised closed loop on Codex: turning the places you repeatedly correct into a reviewable principle candidate — you see the evidence first, then decide whether to adopt it. Without parsing conversations, PD can only govern tools and cannot learn your corrections.
@@ -30,6 +30,7 @@
30
30
  import { type GovernanceObservationInput } from '../governance-observation-store.js';
31
31
  import { type HookHints, type SessionRef, type TranscriptDelta, type TranscriptPort, type TranscriptSourceAdapter } from './source.js';
32
32
  import type { ConversationIngestionConsentDecision } from './consent.js';
33
+ import { type TextPolicy } from './text-policy.js';
33
34
  /** Verdict of a pre-ingest host side-write: failure holds the checkpoint (retry-safe). */
34
35
  export type PreIngestVerdict = {
35
36
  ok: true;
@@ -65,6 +66,13 @@ export interface RunIngestionArgs {
65
66
  readonly consent: {
66
67
  decision: ConversationIngestionConsentDecision | 'not_present';
67
68
  };
69
+ /**
70
+ * PRI-1179: how much `visible_text` may be stored. The host resolves this
71
+ * from its OWN consent record via `resolveTextPolicy(record, disclosureVersion)`
72
+ * — a stale or non-granted record resolves to the bounded tier, never wider.
73
+ * Absent = bounded (the pre-existing 200-char content bound).
74
+ */
75
+ readonly textPolicy?: TextPolicy;
68
76
  readonly now?: Date;
69
77
  /** Injected filesystem boundary (tests spy here; production uses the node port). */
70
78
  readonly port?: TranscriptPort;
@@ -29,6 +29,7 @@
29
29
  */
30
30
  import { ingestGovernanceObservations, readGovernanceCheckpoint, } from '../governance-observation-store.js';
31
31
  import { CONVERSATION_INGESTION_MAX_BATCH_BYTES, TranscriptReplacedError, createNodeTranscriptPort, } from './source.js';
32
+ import { TEXT_POLICY_BOUNDED_MAX_CHARS } from './text-policy.js';
32
33
  export function runConversationIngestion(args) {
33
34
  const texts = {
34
35
  readFailedNextAction: 'verify the transcript file still exists and is a regular file inside the host sessions root.',
@@ -107,9 +108,13 @@ export function runConversationIngestion(args) {
107
108
  return degraded(verdict.reason, verdict.nextAction, delta.warnings);
108
109
  }
109
110
  }
110
- // 10. Sanitize-at-store ingest with the durable checkpoint.
111
+ // 10. Sanitize-at-store ingest with the durable checkpoint. The text bound
112
+ // comes from the caller's consent-tiered policy (PRI-1179); the store's
113
+ // generic evidence bound stays the default when no policy is supplied.
114
+ const textPolicy = args.textPolicy ?? { tier: 'bounded', maxChars: TEXT_POLICY_BOUNDED_MAX_CHARS };
111
115
  const result = ingestGovernanceObservations({
112
116
  workspaceDir: args.workspaceDir,
117
+ maxVisibleTextChars: textPolicy.maxChars,
113
118
  rollout: {
114
119
  hostKind: args.source.hostKind,
115
120
  rolloutIdentity: locator.sessionIdentity,
@@ -14,10 +14,9 @@
14
14
  * 20,000 chars against malformed giant records; the observed
15
15
  * truncation rate is reported at acceptance time.
16
16
  *
17
- * P1 ships this resolver with the seam; the sanitizer-side application of the
18
- * full bound (core `sanitizeString` maxChars parameter) lands with the P3
19
- * depth-alignment batch, so in P1 every tier resolves through the unchanged
20
- * bounded storage path.
17
+ * PRI-1179 wires the policy into production: the host resolves the tier from its
18
+ * own consent record and passes it through `runConversationIngestion`, which
19
+ * forwards `maxChars` to the store and the core `sanitizeString` bound.
21
20
  */
22
21
  export type TextPolicy = {
23
22
  tier: 'bounded';
@@ -14,10 +14,9 @@
14
14
  * 20,000 chars against malformed giant records; the observed
15
15
  * truncation rate is reported at acceptance time.
16
16
  *
17
- * P1 ships this resolver with the seam; the sanitizer-side application of the
18
- * full bound (core `sanitizeString` maxChars parameter) lands with the P3
19
- * depth-alignment batch, so in P1 every tier resolves through the unchanged
20
- * bounded storage path.
17
+ * PRI-1179 wires the policy into production: the host resolves the tier from its
18
+ * own consent record and passes it through `runConversationIngestion`, which
19
+ * forwards `maxChars` to the store and the core `sanitizeString` bound.
21
20
  */
22
21
  export const TEXT_POLICY_BOUNDED_MAX_CHARS = 200;
23
22
  export const TEXT_POLICY_FULL_MAX_CHARS = 20_000;
@@ -6,11 +6,10 @@ export declare const GOVERNANCE_PENDING_TAIL_STALE_MS: number;
6
6
  /** Host taxonomy for governance observations (schema v4; PRI-1171 unification). */
7
7
  export type GovernanceObservationHostKind = 'codex' | 'workbuddy' | 'openclaw';
8
8
  /**
9
- * PRI-1171 P2: `reasoning` joins the kind union with the WorkBuddy decoder
10
- * (tech design §5.2) — the first producer. The Codex decoder keeps its
11
- * explicit reasoning discard until P3 ticket ⑧ wires the new disclosure +
12
- * consent records for the Codex full tier (tech design §11.8), so no
13
- * existing Codex path starts emitting it.
9
+ * PRI-1171 P2: `reasoning` joins the kind union (`workbuddy` decoder was the
10
+ * first producer). PRI-1179 added the Codex producer: only the rollout's
11
+ * plaintext `summary` is stored — never the encrypted reasoning body. The
12
+ * stored bound stays governed by the caller's text policy.
14
13
  */
15
14
  export type GovernanceObservationKind = 'user_turn' | 'assistant_turn' | 'tool_call' | 'reasoning';
16
15
  export type GovernanceObservationSource = 'live_hook' | 'transcript';
@@ -162,6 +161,12 @@ export interface IngestGovernanceObservationsInput {
162
161
  readonly compactionTimestamp?: string;
163
162
  /** Sequential rollback markers (num_turns each) decoded from the transcript delta. */
164
163
  readonly rollbackTurns?: readonly number[];
164
+ /**
165
+ * PRI-1179: content bound for every stored `visible_text`, forwarded from the
166
+ * conversation-ingestion text policy (bounded 200 / full 20,000). Absent =
167
+ * the generic evidence bound, i.e. the pre-existing behavior.
168
+ */
169
+ readonly maxVisibleTextChars?: number;
165
170
  readonly now?: Date;
166
171
  readonly databaseFactory?: ObservationDatabaseFactory;
167
172
  }
@@ -210,6 +215,24 @@ export interface ListGovernanceCheckpointsArgs {
210
215
  readonly hostKind: GovernanceObservationHostKind;
211
216
  readonly databaseFactory?: ObservationDatabaseFactory;
212
217
  }
218
+ export interface GovernanceUncheckpointedSession {
219
+ readonly rolloutIdentity: string;
220
+ /** MAX(observed_at) across this session's observations (TD §9 live_only stamp). */
221
+ readonly lastObservedAt: string;
222
+ readonly observationCount: number;
223
+ }
224
+ export interface ListGovernanceUncheckpointedSessionsArgs {
225
+ readonly workspaceDir: string;
226
+ readonly hostKind: GovernanceObservationHostKind;
227
+ /** Bounded result size (default 50, hard cap 200); `truncated` reports overflow. */
228
+ readonly limit?: number;
229
+ readonly databaseFactory?: ObservationDatabaseFactory;
230
+ }
231
+ export type ListGovernanceUncheckpointedSessionsResult = {
232
+ ok: true;
233
+ sessions: readonly GovernanceUncheckpointedSession[];
234
+ truncated: boolean;
235
+ } | Degradation;
213
236
  export type ListGovernanceCheckpointsResult = {
214
237
  ok: true;
215
238
  checkpoints: readonly GovernanceCheckpointRecord[];
@@ -222,6 +245,16 @@ export type ListGovernanceCheckpointsResult = {
222
245
  * discovery (SPEC §13 / ADR-0020 §11.2).
223
246
  */
224
247
  export declare function listGovernanceCheckpoints(args: ListGovernanceCheckpointsArgs): ListGovernanceCheckpointsResult;
248
+ /**
249
+ * Sessions that have observations but NO checkpoint row for this host kind
250
+ * (PRI-1171 ticket ⑦, TD §9). The live hook path never writes a checkpoint,
251
+ * so "no checkpoint" must never render as a lag anomaly: the health surface
252
+ * reports these as an explicit `live_only` state stamped with
253
+ * MAX(observed_at) instead of inventing a byte offset. Ordered by
254
+ * lastObservedAt descending; result bounded by `limit` with a `truncated`
255
+ * flag so large live-only sets stay visible without unbounded output.
256
+ */
257
+ export declare function listGovernanceUncheckpointedSessions(args: ListGovernanceUncheckpointedSessionsArgs): ListGovernanceUncheckpointedSessionsResult;
225
258
  export interface ListGovernanceObservationsInput {
226
259
  readonly workspaceDir: string;
227
260
  readonly rolloutIdentity?: string;
@@ -308,7 +308,11 @@ function upsertRollout(db, input, now) {
308
308
  * committed content, mark partial, and report where the checkpoint must stop.
309
309
  * Never overwrites committed content silently (source precedence, SPEC §10).
310
310
  */
311
- function applyObservation({ db, rolloutRowId, input, workspaceDir }) {
311
+ function applyObservation({ db, rolloutRowId, input, workspaceDir, maxVisibleTextChars }) {
312
+ // One bound for every visible_text use in this function: the insert, the
313
+ // user-turn conflict comparison and the fill path must agree, otherwise a
314
+ // full-tier row would look like a content mismatch on the next replay.
315
+ const boundVisibleText = (value) => sanitizeString(value, workspaceDir, maxVisibleTextChars);
312
316
  const byKey = db.prepare('SELECT * FROM governance_observations WHERE logical_key = ?').get(input.logicalObservationKey);
313
317
  let existing = byKey;
314
318
  // Cross-window tool completion by STABLE identity (P2 review): the call row
@@ -335,7 +339,7 @@ function applyObservation({ db, rolloutRowId, input, workspaceDir }) {
335
339
  if (isRecord(physical))
336
340
  return { disposition: 'duplicate' };
337
341
  }
338
- const sanitizedText = input.visibleText !== undefined ? sanitizeString(input.visibleText, workspaceDir) : null;
342
+ const sanitizedText = input.visibleText !== undefined ? boundVisibleText(input.visibleText) : null;
339
343
  const facts = input.toolFacts !== undefined ? safeJson({ facts: sanitizeValue(input.toolFacts, 0, workspaceDir) }) : null;
340
344
  db.prepare(`INSERT INTO governance_observations
341
345
  (rollout_row_id, host_kind, rollout_identity, root_session_id, host_turn_id, kind, logical_key, transcript_record_key, source_order, source_ordinal, assistant_item_id, phase, tool_use_id, transcript_tool_call_id, visible_text, sanitized_tool_facts_json, source, completeness, retention_class, observed_at)
@@ -355,7 +359,7 @@ function applyObservation({ db, rolloutRowId, input, workspaceDir }) {
355
359
  && input.source === 'transcript'
356
360
  && input.visibleText !== undefined
357
361
  && typeof existingText === 'string'
358
- && sanitizeString(input.visibleText, workspaceDir) !== existingText) {
362
+ && boundVisibleText(input.visibleText) !== existingText) {
359
363
  db.prepare("UPDATE governance_observations SET completeness = 'partial' WHERE id = ?").run(existingId);
360
364
  return { disposition: 'conflict', stopByteStart: input.recordByteStart };
361
365
  }
@@ -395,7 +399,7 @@ function applyObservation({ db, rolloutRowId, input, workspaceDir }) {
395
399
  fill('phase', boundedString(input.phase, MAX_TEXT_BOUND));
396
400
  fill('tool_use_id', boundedString(input.toolUseId, MAX_TEXT_BOUND));
397
401
  fill('transcript_tool_call_id', boundedString(input.transcriptToolCallId, MAX_TEXT_BOUND));
398
- fill('visible_text', input.visibleText !== undefined ? sanitizeString(input.visibleText, workspaceDir) : null);
402
+ fill('visible_text', input.visibleText !== undefined ? boundVisibleText(input.visibleText) : null);
399
403
  const incomingFacts = input.toolFacts !== undefined ? safeJson({ facts: sanitizeValue(input.toolFacts, 0, workspaceDir) }) : null;
400
404
  // Cross-window tool completion (P1): the call row is partial and the result
401
405
  // arrives under the same logical key from a later decode window. Merge the
@@ -550,7 +554,13 @@ export function ingestGovernanceObservations(input) {
550
554
  }
551
555
  for (const observation of input.observations) {
552
556
  rolloutRowId = upsertRollout(db, observation, now);
553
- const outcome = applyObservation({ db, rolloutRowId, input: observation, workspaceDir: input.workspaceDir });
557
+ const outcome = applyObservation({
558
+ db,
559
+ rolloutRowId,
560
+ input: observation,
561
+ workspaceDir: input.workspaceDir,
562
+ ...(input.maxVisibleTextChars !== undefined ? { maxVisibleTextChars: input.maxVisibleTextChars } : {}),
563
+ });
554
564
  if (outcome.disposition === 'inserted')
555
565
  inserted += 1;
556
566
  else if (outcome.disposition === 'enriched')
@@ -743,6 +753,54 @@ export function listGovernanceCheckpoints(args) {
743
753
  close();
744
754
  }
745
755
  }
756
+ /**
757
+ * Sessions that have observations but NO checkpoint row for this host kind
758
+ * (PRI-1171 ticket ⑦, TD §9). The live hook path never writes a checkpoint,
759
+ * so "no checkpoint" must never render as a lag anomaly: the health surface
760
+ * reports these as an explicit `live_only` state stamped with
761
+ * MAX(observed_at) instead of inventing a byte offset. Ordered by
762
+ * lastObservedAt descending; result bounded by `limit` with a `truncated`
763
+ * flag so large live-only sets stay visible without unbounded output.
764
+ */
765
+ export function listGovernanceUncheckpointedSessions(args) {
766
+ const { workspaceDir, hostKind, databaseFactory } = args;
767
+ const opened = openStore(workspaceDir, databaseFactory);
768
+ if (!('db' in opened))
769
+ return opened;
770
+ const { db, close } = opened;
771
+ try {
772
+ const limit = Math.min(Math.max(args.limit ?? 50, 1), 200);
773
+ const rows = db.prepare(`SELECT o.rollout_identity AS rollout_identity,
774
+ MAX(o.observed_at) AS last_observed_at,
775
+ COUNT(*) AS observation_count
776
+ FROM governance_observations o
777
+ WHERE o.host_kind = ?
778
+ AND o.rollout_identity NOT IN (
779
+ SELECT c.rollout_identity FROM governance_transcript_checkpoints c WHERE c.host_kind = ?
780
+ )
781
+ GROUP BY o.rollout_identity
782
+ ORDER BY last_observed_at DESC
783
+ LIMIT ?`).all(hostKind, hostKind, limit + 1);
784
+ const sessions = [];
785
+ for (const raw of rows.slice(0, limit)) {
786
+ if (!isRecord(raw))
787
+ continue;
788
+ sessions.push({
789
+ rolloutIdentity: String(rowField(raw, 'rollout_identity')),
790
+ lastObservedAt: String(rowField(raw, 'last_observed_at')),
791
+ observationCount: Number(rowField(raw, 'observation_count')),
792
+ });
793
+ }
794
+ return { ok: true, sessions, truncated: rows.length > limit };
795
+ }
796
+ catch (error) {
797
+ const detail = error instanceof Error ? error.message.slice(0, 160) : String(error);
798
+ return { ok: false, reason: `governance_live_sessions_failed:${detail}`, nextAction: 'Inspect the workspace trajectory.db; the health surface degraded without mutating anything.' };
799
+ }
800
+ finally {
801
+ close();
802
+ }
803
+ }
746
804
  export function listGovernanceObservations(input) {
747
805
  const opened = openStore(input.workspaceDir, input.databaseFactory);
748
806
  if (!('db' in opened))
@@ -284,9 +284,9 @@ export function createProductionHostRuntime(options = {}) {
284
284
  workspaceDir: event.context.workspaceDir,
285
285
  ...(roundKey !== undefined ? { roundKey } : {}),
286
286
  ...(options.adaptiveGapProvider ? {
287
- async selectNativeGap(candidates) {
287
+ async selectNativeGap(candidates, gapOptions) {
288
288
  try {
289
- return await options.adaptiveGapProvider?.(event, candidates);
289
+ return await options.adaptiveGapProvider?.(event, candidates, gapOptions);
290
290
  }
291
291
  catch {
292
292
  return undefined;
@@ -337,6 +337,9 @@ export function createProductionHostRuntime(options = {}) {
337
337
  // failure must not block the prompt result — it degrades to an
338
338
  // observable warning (rc-9).
339
339
  const emissionWarnings = [];
340
+ if (prompt.adaptivePacking?.source === 'native_gap' && prompt.adaptivePacking.status === 'unavailable') {
341
+ emissionWarnings.push(`adaptive_assembly_unavailable:${prompt.adaptivePacking.reason}`);
342
+ }
340
343
  try {
341
344
  options.events?.recordRuntimeActivationsInjected({
342
345
  sessionId: event.context.sessionId,
@@ -1,4 +1,4 @@
1
- import { type ToolSemanticRegistry, type GovernanceHostKind } from '@principles/core/runtime';
1
+ import { type RuleHostResult, type ToolSemanticRegistry, type GovernanceHostKind } from '@principles/core/runtime';
2
2
  import type { HostEvent, HostEventResult } from '@principles/core/host';
3
3
  import { type RuleImplementationRuntime } from './rule-implementation-runtime.js';
4
4
  export interface ProductionRuleContextRequest {
@@ -29,5 +29,40 @@ export interface ProductionRuleHostGateOptions {
29
29
  * (shell/cmd/insert/patch/delete_file/move_file were never hinted).
30
30
  */
31
31
  toolSemantics?: ToolSemanticRegistry;
32
+ /**
33
+ * PRI-1187: observation-only signal for the accepted "over-block" tradeoff.
34
+ *
35
+ * When a rule declares `affectedTools` and the current action family is NOT
36
+ * in that declaration, the rule is still evaluated (never skipped). This
37
+ * sink records one structured event per such evaluation so we can measure
38
+ * how much over-blocking exists and which rules cause it.
39
+ *
40
+ * Defaults ON. Silence it with `{ enabled: false }` or the environment
41
+ * variable `PD_AFFECTED_TOOLS_OBSERVABILITY=0`. The sink is called inside a
42
+ * try/catch and can never alter the decision.
43
+ */
44
+ affectedToolsObservability?: AffectedToolsObservabilityOptions;
45
+ }
46
+ /** One observation-only "declared scope does not cover the action" record. */
47
+ export interface AffectedToolsMismatchEvent {
48
+ ruleId: string;
49
+ activationId: string;
50
+ activationMode: 'live' | 'shadow';
51
+ toolName: string;
52
+ /** Action family resolved by the ToolSemanticRegistry (write/execute/agent…). */
53
+ actionFamily: string;
54
+ /** Raw declaration, verbatim from the artifact. */
55
+ declaredTools: string[];
56
+ /** Resolved families of `declaredTools` (never empty when emitted). */
57
+ declaredFamilies: string[];
58
+ /** The rule's own decision for this call (not the merged verdict). */
59
+ decision: RuleHostResult['decision'];
60
+ hostKind?: GovernanceHostKind;
61
+ }
62
+ export interface AffectedToolsObservabilityOptions {
63
+ /** Defaults to `PD_AFFECTED_TOOLS_OBSERVABILITY !== '0' | 'false' | 'off'`. */
64
+ enabled?: boolean;
65
+ /** Defaults to one structured JSON line on `console.warn`. */
66
+ sink?: (event: AffectedToolsMismatchEvent) => void;
32
67
  }
33
68
  export declare function createProductionRuleHostGate(options?: ProductionRuleHostGateOptions): (event: HostEvent) => Promise<HostEventResult>;