@cratylus/canon 0.1.0

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 (546) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +76 -0
  3. package/dist/agents/arch-doc-writer.d.ts +2 -0
  4. package/dist/agents/arch-doc-writer.js +54 -0
  5. package/dist/agents/arch-doc-writer.js.map +1 -0
  6. package/dist/agents/boz.d.ts +2 -0
  7. package/dist/agents/boz.js +59 -0
  8. package/dist/agents/boz.js.map +1 -0
  9. package/dist/agents/developer.d.ts +2 -0
  10. package/dist/agents/developer.js +53 -0
  11. package/dist/agents/developer.js.map +1 -0
  12. package/dist/agents/investigator.d.ts +2 -0
  13. package/dist/agents/investigator.js +59 -0
  14. package/dist/agents/investigator.js.map +1 -0
  15. package/dist/agents/mav.d.ts +2 -0
  16. package/dist/agents/mav.js +83 -0
  17. package/dist/agents/mav.js.map +1 -0
  18. package/dist/agents/nico.d.ts +2 -0
  19. package/dist/agents/nico.js +92 -0
  20. package/dist/agents/nico.js.map +1 -0
  21. package/dist/agents/planner.d.ts +2 -0
  22. package/dist/agents/planner.js +52 -0
  23. package/dist/agents/planner.js.map +1 -0
  24. package/dist/agents/principal-engineer-reviewer.d.ts +2 -0
  25. package/dist/agents/principal-engineer-reviewer.js +56 -0
  26. package/dist/agents/principal-engineer-reviewer.js.map +1 -0
  27. package/dist/agents/principal-ic.d.ts +2 -0
  28. package/dist/agents/principal-ic.js +72 -0
  29. package/dist/agents/principal-ic.js.map +1 -0
  30. package/dist/agents/tester.d.ts +2 -0
  31. package/dist/agents/tester.js +55 -0
  32. package/dist/agents/tester.js.map +1 -0
  33. package/dist/dimensions/actions/code-execution.d.ts +2 -0
  34. package/dist/dimensions/actions/code-execution.js +2 -0
  35. package/dist/dimensions/actions/code-execution.js.map +1 -0
  36. package/dist/dimensions/actions/communication.d.ts +2 -0
  37. package/dist/dimensions/actions/communication.js +2 -0
  38. package/dist/dimensions/actions/communication.js.map +1 -0
  39. package/dist/dimensions/actions/computer-use.d.ts +2 -0
  40. package/dist/dimensions/actions/computer-use.js +2 -0
  41. package/dist/dimensions/actions/computer-use.js.map +1 -0
  42. package/dist/dimensions/actions/delegation.d.ts +2 -0
  43. package/dist/dimensions/actions/delegation.js +2 -0
  44. package/dist/dimensions/actions/delegation.js.map +1 -0
  45. package/dist/dimensions/actions/file-ops.d.ts +2 -0
  46. package/dist/dimensions/actions/file-ops.js +2 -0
  47. package/dist/dimensions/actions/file-ops.js.map +1 -0
  48. package/dist/dimensions/actions/physical-actuation.d.ts +2 -0
  49. package/dist/dimensions/actions/physical-actuation.js +2 -0
  50. package/dist/dimensions/actions/physical-actuation.js.map +1 -0
  51. package/dist/dimensions/actions/retrieval.d.ts +2 -0
  52. package/dist/dimensions/actions/retrieval.js +2 -0
  53. package/dist/dimensions/actions/retrieval.js.map +1 -0
  54. package/dist/dimensions/actions/tool-call.d.ts +2 -0
  55. package/dist/dimensions/actions/tool-call.js +2 -0
  56. package/dist/dimensions/actions/tool-call.js.map +1 -0
  57. package/dist/dimensions/audience-adaptation/convergence.d.ts +2 -0
  58. package/dist/dimensions/audience-adaptation/convergence.js +2 -0
  59. package/dist/dimensions/audience-adaptation/convergence.js.map +1 -0
  60. package/dist/dimensions/audience-adaptation/divergence.d.ts +2 -0
  61. package/dist/dimensions/audience-adaptation/divergence.js +2 -0
  62. package/dist/dimensions/audience-adaptation/divergence.js.map +1 -0
  63. package/dist/dimensions/audience-adaptation/maintenance.d.ts +2 -0
  64. package/dist/dimensions/audience-adaptation/maintenance.js +2 -0
  65. package/dist/dimensions/audience-adaptation/maintenance.js.map +1 -0
  66. package/dist/dimensions/autonomy/check-in.d.ts +2 -0
  67. package/dist/dimensions/autonomy/check-in.js +2 -0
  68. package/dist/dimensions/autonomy/check-in.js.map +1 -0
  69. package/dist/dimensions/autonomy/decision-authority.d.ts +2 -0
  70. package/dist/dimensions/autonomy/decision-authority.js +17 -0
  71. package/dist/dimensions/autonomy/decision-authority.js.map +1 -0
  72. package/dist/dimensions/autonomy/human-in-the-loop.d.ts +2 -0
  73. package/dist/dimensions/autonomy/human-in-the-loop.js +2 -0
  74. package/dist/dimensions/autonomy/human-in-the-loop.js.map +1 -0
  75. package/dist/dimensions/autonomy/human-on-the-loop.d.ts +2 -0
  76. package/dist/dimensions/autonomy/human-on-the-loop.js +10 -0
  77. package/dist/dimensions/autonomy/human-on-the-loop.js.map +1 -0
  78. package/dist/dimensions/autonomy/human-out-of-the-loop.d.ts +2 -0
  79. package/dist/dimensions/autonomy/human-out-of-the-loop.js +2 -0
  80. package/dist/dimensions/autonomy/human-out-of-the-loop.js.map +1 -0
  81. package/dist/dimensions/autonomy/mission-command.d.ts +2 -0
  82. package/dist/dimensions/autonomy/mission-command.js +2 -0
  83. package/dist/dimensions/autonomy/mission-command.js.map +1 -0
  84. package/dist/dimensions/capabilities/analysis-diagnosis.d.ts +2 -0
  85. package/dist/dimensions/capabilities/analysis-diagnosis.js +2 -0
  86. package/dist/dimensions/capabilities/analysis-diagnosis.js.map +1 -0
  87. package/dist/dimensions/capabilities/data-analytics.d.ts +2 -0
  88. package/dist/dimensions/capabilities/data-analytics.js +2 -0
  89. package/dist/dimensions/capabilities/data-analytics.js.map +1 -0
  90. package/dist/dimensions/capabilities/operations-delivery.d.ts +2 -0
  91. package/dist/dimensions/capabilities/operations-delivery.js +2 -0
  92. package/dist/dimensions/capabilities/operations-delivery.js.map +1 -0
  93. package/dist/dimensions/capabilities/planning-decomposition.d.ts +2 -0
  94. package/dist/dimensions/capabilities/planning-decomposition.js +2 -0
  95. package/dist/dimensions/capabilities/planning-decomposition.js.map +1 -0
  96. package/dist/dimensions/capabilities/research-investigation.d.ts +2 -0
  97. package/dist/dimensions/capabilities/research-investigation.js +2 -0
  98. package/dist/dimensions/capabilities/research-investigation.js.map +1 -0
  99. package/dist/dimensions/capabilities/review-critique.d.ts +2 -0
  100. package/dist/dimensions/capabilities/review-critique.js +2 -0
  101. package/dist/dimensions/capabilities/review-critique.js.map +1 -0
  102. package/dist/dimensions/capabilities/software-engineering.d.ts +2 -0
  103. package/dist/dimensions/capabilities/software-engineering.js +2 -0
  104. package/dist/dimensions/capabilities/software-engineering.js.map +1 -0
  105. package/dist/dimensions/capabilities/system-design.d.ts +2 -0
  106. package/dist/dimensions/capabilities/system-design.js +2 -0
  107. package/dist/dimensions/capabilities/system-design.js.map +1 -0
  108. package/dist/dimensions/capabilities/technical-writing.d.ts +2 -0
  109. package/dist/dimensions/capabilities/technical-writing.js +2 -0
  110. package/dist/dimensions/capabilities/technical-writing.js.map +1 -0
  111. package/dist/dimensions/capabilities/verification-testing.d.ts +2 -0
  112. package/dist/dimensions/capabilities/verification-testing.js +2 -0
  113. package/dist/dimensions/capabilities/verification-testing.js.map +1 -0
  114. package/dist/dimensions/engineering-principles/cold-decode-oracle.d.ts +2 -0
  115. package/dist/dimensions/engineering-principles/cold-decode-oracle.js +2 -0
  116. package/dist/dimensions/engineering-principles/cold-decode-oracle.js.map +1 -0
  117. package/dist/dimensions/engineering-principles/cratylism.d.ts +2 -0
  118. package/dist/dimensions/engineering-principles/cratylism.js +2 -0
  119. package/dist/dimensions/engineering-principles/cratylism.js.map +1 -0
  120. package/dist/dimensions/engineering-principles/dry.d.ts +2 -0
  121. package/dist/dimensions/engineering-principles/dry.js +2 -0
  122. package/dist/dimensions/engineering-principles/dry.js.map +1 -0
  123. package/dist/dimensions/engineering-principles/first-principles.d.ts +2 -0
  124. package/dist/dimensions/engineering-principles/first-principles.js +2 -0
  125. package/dist/dimensions/engineering-principles/first-principles.js.map +1 -0
  126. package/dist/dimensions/engineering-principles/green-field.d.ts +2 -0
  127. package/dist/dimensions/engineering-principles/green-field.js +2 -0
  128. package/dist/dimensions/engineering-principles/green-field.js.map +1 -0
  129. package/dist/dimensions/engineering-principles/invoke-the-canonical.d.ts +2 -0
  130. package/dist/dimensions/engineering-principles/invoke-the-canonical.js +2 -0
  131. package/dist/dimensions/engineering-principles/invoke-the-canonical.js.map +1 -0
  132. package/dist/dimensions/engineering-principles/llm-native.d.ts +2 -0
  133. package/dist/dimensions/engineering-principles/llm-native.js +2 -0
  134. package/dist/dimensions/engineering-principles/llm-native.js.map +1 -0
  135. package/dist/dimensions/engineering-principles/mece.d.ts +2 -0
  136. package/dist/dimensions/engineering-principles/mece.js +2 -0
  137. package/dist/dimensions/engineering-principles/mece.js.map +1 -0
  138. package/dist/dimensions/engineering-principles/separation-of-concerns.d.ts +2 -0
  139. package/dist/dimensions/engineering-principles/separation-of-concerns.js +2 -0
  140. package/dist/dimensions/engineering-principles/separation-of-concerns.js.map +1 -0
  141. package/dist/dimensions/engineering-principles/simplicity.d.ts +2 -0
  142. package/dist/dimensions/engineering-principles/simplicity.js +2 -0
  143. package/dist/dimensions/engineering-principles/simplicity.js.map +1 -0
  144. package/dist/dimensions/engineering-principles/trust-but-verify.d.ts +2 -0
  145. package/dist/dimensions/engineering-principles/trust-but-verify.js +2 -0
  146. package/dist/dimensions/engineering-principles/trust-but-verify.js.map +1 -0
  147. package/dist/dimensions/engineering-principles/zero-trust.d.ts +2 -0
  148. package/dist/dimensions/engineering-principles/zero-trust.js +2 -0
  149. package/dist/dimensions/engineering-principles/zero-trust.js.map +1 -0
  150. package/dist/dimensions/formality/casual.d.ts +2 -0
  151. package/dist/dimensions/formality/casual.js +2 -0
  152. package/dist/dimensions/formality/casual.js.map +1 -0
  153. package/dist/dimensions/formality/expansive.d.ts +2 -0
  154. package/dist/dimensions/formality/expansive.js +2 -0
  155. package/dist/dimensions/formality/expansive.js.map +1 -0
  156. package/dist/dimensions/formality/formal.d.ts +2 -0
  157. package/dist/dimensions/formality/formal.js +2 -0
  158. package/dist/dimensions/formality/formal.js.map +1 -0
  159. package/dist/dimensions/formality/neutral.d.ts +2 -0
  160. package/dist/dimensions/formality/neutral.js +2 -0
  161. package/dist/dimensions/formality/neutral.js.map +1 -0
  162. package/dist/dimensions/framing/adversarial.d.ts +2 -0
  163. package/dist/dimensions/framing/adversarial.js +2 -0
  164. package/dist/dimensions/framing/adversarial.js.map +1 -0
  165. package/dist/dimensions/framing/analytical.d.ts +2 -0
  166. package/dist/dimensions/framing/analytical.js +2 -0
  167. package/dist/dimensions/framing/analytical.js.map +1 -0
  168. package/dist/dimensions/framing/correctness-oriented.d.ts +2 -0
  169. package/dist/dimensions/framing/correctness-oriented.js +2 -0
  170. package/dist/dimensions/framing/correctness-oriented.js.map +1 -0
  171. package/dist/dimensions/framing/decompositional.d.ts +2 -0
  172. package/dist/dimensions/framing/decompositional.js +2 -0
  173. package/dist/dimensions/framing/decompositional.js.map +1 -0
  174. package/dist/dimensions/framing/diagnostic.d.ts +2 -0
  175. package/dist/dimensions/framing/diagnostic.js +2 -0
  176. package/dist/dimensions/framing/diagnostic.js.map +1 -0
  177. package/dist/dimensions/framing/exploratory.d.ts +2 -0
  178. package/dist/dimensions/framing/exploratory.js +2 -0
  179. package/dist/dimensions/framing/exploratory.js.map +1 -0
  180. package/dist/dimensions/framing/first-principles.d.ts +2 -0
  181. package/dist/dimensions/framing/first-principles.js +2 -0
  182. package/dist/dimensions/framing/first-principles.js.map +1 -0
  183. package/dist/dimensions/framing/goal-directed.d.ts +2 -0
  184. package/dist/dimensions/framing/goal-directed.js +2 -0
  185. package/dist/dimensions/framing/goal-directed.js.map +1 -0
  186. package/dist/dimensions/framing/risk-oriented.d.ts +2 -0
  187. package/dist/dimensions/framing/risk-oriented.js +2 -0
  188. package/dist/dimensions/framing/risk-oriented.js.map +1 -0
  189. package/dist/dimensions/framing/systems-thinking.d.ts +2 -0
  190. package/dist/dimensions/framing/systems-thinking.js +2 -0
  191. package/dist/dimensions/framing/systems-thinking.js.map +1 -0
  192. package/dist/dimensions/framing/user-centered.d.ts +2 -0
  193. package/dist/dimensions/framing/user-centered.js +2 -0
  194. package/dist/dimensions/framing/user-centered.js.map +1 -0
  195. package/dist/dimensions/guardrails/accountability.d.ts +2 -0
  196. package/dist/dimensions/guardrails/accountability.js +2 -0
  197. package/dist/dimensions/guardrails/accountability.js.map +1 -0
  198. package/dist/dimensions/guardrails/harm-avoidance.d.ts +2 -0
  199. package/dist/dimensions/guardrails/harm-avoidance.js +2 -0
  200. package/dist/dimensions/guardrails/harm-avoidance.js.map +1 -0
  201. package/dist/dimensions/guardrails/helpfulness.d.ts +2 -0
  202. package/dist/dimensions/guardrails/helpfulness.js +2 -0
  203. package/dist/dimensions/guardrails/helpfulness.js.map +1 -0
  204. package/dist/dimensions/guardrails/honesty.d.ts +2 -0
  205. package/dist/dimensions/guardrails/honesty.js +2 -0
  206. package/dist/dimensions/guardrails/honesty.js.map +1 -0
  207. package/dist/dimensions/guardrails/human-oversight.d.ts +2 -0
  208. package/dist/dimensions/guardrails/human-oversight.js +2 -0
  209. package/dist/dimensions/guardrails/human-oversight.js.map +1 -0
  210. package/dist/dimensions/guardrails/input-untrusted.d.ts +2 -0
  211. package/dist/dimensions/guardrails/input-untrusted.js +2 -0
  212. package/dist/dimensions/guardrails/input-untrusted.js.map +1 -0
  213. package/dist/dimensions/guardrails/privacy.d.ts +2 -0
  214. package/dist/dimensions/guardrails/privacy.js +2 -0
  215. package/dist/dimensions/guardrails/privacy.js.map +1 -0
  216. package/dist/dimensions/guardrails/scope-of-authority.d.ts +2 -0
  217. package/dist/dimensions/guardrails/scope-of-authority.js +2 -0
  218. package/dist/dimensions/guardrails/scope-of-authority.js.map +1 -0
  219. package/dist/dimensions/heuristics/anchoring.d.ts +2 -0
  220. package/dist/dimensions/heuristics/anchoring.js +2 -0
  221. package/dist/dimensions/heuristics/anchoring.js.map +1 -0
  222. package/dist/dimensions/heuristics/availability.d.ts +2 -0
  223. package/dist/dimensions/heuristics/availability.js +2 -0
  224. package/dist/dimensions/heuristics/availability.js.map +1 -0
  225. package/dist/dimensions/heuristics/recognition.d.ts +2 -0
  226. package/dist/dimensions/heuristics/recognition.js +2 -0
  227. package/dist/dimensions/heuristics/recognition.js.map +1 -0
  228. package/dist/dimensions/heuristics/take-the-best.d.ts +2 -0
  229. package/dist/dimensions/heuristics/take-the-best.js +2 -0
  230. package/dist/dimensions/heuristics/take-the-best.js.map +1 -0
  231. package/dist/dimensions/learning/continual-online.d.ts +2 -0
  232. package/dist/dimensions/learning/continual-online.js +2 -0
  233. package/dist/dimensions/learning/continual-online.js.map +1 -0
  234. package/dist/dimensions/learning/correction-consolidation.d.ts +2 -0
  235. package/dist/dimensions/learning/correction-consolidation.js +2 -0
  236. package/dist/dimensions/learning/correction-consolidation.js.map +1 -0
  237. package/dist/dimensions/learning/curated-promotion.d.ts +2 -0
  238. package/dist/dimensions/learning/curated-promotion.js +2 -0
  239. package/dist/dimensions/learning/curated-promotion.js.map +1 -0
  240. package/dist/dimensions/learning/episodic-accretion.d.ts +2 -0
  241. package/dist/dimensions/learning/episodic-accretion.js +2 -0
  242. package/dist/dimensions/learning/episodic-accretion.js.map +1 -0
  243. package/dist/dimensions/learning/in-context-recall.d.ts +2 -0
  244. package/dist/dimensions/learning/in-context-recall.js +2 -0
  245. package/dist/dimensions/learning/in-context-recall.js.map +1 -0
  246. package/dist/dimensions/learning/reflective-revision.d.ts +2 -0
  247. package/dist/dimensions/learning/reflective-revision.js +2 -0
  248. package/dist/dimensions/learning/reflective-revision.js.map +1 -0
  249. package/dist/dimensions/learning/static-frozen.d.ts +2 -0
  250. package/dist/dimensions/learning/static-frozen.js +2 -0
  251. package/dist/dimensions/learning/static-frozen.js.map +1 -0
  252. package/dist/dimensions/memory/episodic.d.ts +2 -0
  253. package/dist/dimensions/memory/episodic.js +2 -0
  254. package/dist/dimensions/memory/episodic.js.map +1 -0
  255. package/dist/dimensions/memory/long-term-memory.d.ts +2 -0
  256. package/dist/dimensions/memory/long-term-memory.js +2 -0
  257. package/dist/dimensions/memory/long-term-memory.js.map +1 -0
  258. package/dist/dimensions/memory/procedural.d.ts +2 -0
  259. package/dist/dimensions/memory/procedural.js +2 -0
  260. package/dist/dimensions/memory/procedural.js.map +1 -0
  261. package/dist/dimensions/memory/semantic.d.ts +2 -0
  262. package/dist/dimensions/memory/semantic.js +2 -0
  263. package/dist/dimensions/memory/semantic.js.map +1 -0
  264. package/dist/dimensions/memory/working-memory.d.ts +2 -0
  265. package/dist/dimensions/memory/working-memory.js +2 -0
  266. package/dist/dimensions/memory/working-memory.js.map +1 -0
  267. package/dist/dimensions/modalities/audio.d.ts +2 -0
  268. package/dist/dimensions/modalities/audio.js +2 -0
  269. package/dist/dimensions/modalities/audio.js.map +1 -0
  270. package/dist/dimensions/modalities/image.d.ts +2 -0
  271. package/dist/dimensions/modalities/image.js +2 -0
  272. package/dist/dimensions/modalities/image.js.map +1 -0
  273. package/dist/dimensions/modalities/text.d.ts +2 -0
  274. package/dist/dimensions/modalities/text.js +2 -0
  275. package/dist/dimensions/modalities/text.js.map +1 -0
  276. package/dist/dimensions/modalities/video.d.ts +2 -0
  277. package/dist/dimensions/modalities/video.js +2 -0
  278. package/dist/dimensions/modalities/video.js.map +1 -0
  279. package/dist/dimensions/model/claude.d.ts +2 -0
  280. package/dist/dimensions/model/claude.js +2 -0
  281. package/dist/dimensions/model/claude.js.map +1 -0
  282. package/dist/dimensions/objective/correctness.d.ts +2 -0
  283. package/dist/dimensions/objective/correctness.js +2 -0
  284. package/dist/dimensions/objective/correctness.js.map +1 -0
  285. package/dist/dimensions/objective/delivery.d.ts +2 -0
  286. package/dist/dimensions/objective/delivery.js +2 -0
  287. package/dist/dimensions/objective/delivery.js.map +1 -0
  288. package/dist/dimensions/objective/faithful-record.d.ts +2 -0
  289. package/dist/dimensions/objective/faithful-record.js +2 -0
  290. package/dist/dimensions/objective/faithful-record.js.map +1 -0
  291. package/dist/dimensions/objective/insight.d.ts +2 -0
  292. package/dist/dimensions/objective/insight.js +2 -0
  293. package/dist/dimensions/objective/insight.js.map +1 -0
  294. package/dist/dimensions/objective/parsimony.d.ts +2 -0
  295. package/dist/dimensions/objective/parsimony.js +2 -0
  296. package/dist/dimensions/objective/parsimony.js.map +1 -0
  297. package/dist/dimensions/objective/safety.d.ts +2 -0
  298. package/dist/dimensions/objective/safety.js +2 -0
  299. package/dist/dimensions/objective/safety.js.map +1 -0
  300. package/dist/dimensions/objective/thoroughness.d.ts +2 -0
  301. package/dist/dimensions/objective/thoroughness.js +2 -0
  302. package/dist/dimensions/objective/thoroughness.js.map +1 -0
  303. package/dist/dimensions/objective/throughput.d.ts +2 -0
  304. package/dist/dimensions/objective/throughput.js +2 -0
  305. package/dist/dimensions/objective/throughput.js.map +1 -0
  306. package/dist/dimensions/objective/user-satisfaction.d.ts +2 -0
  307. package/dist/dimensions/objective/user-satisfaction.js +2 -0
  308. package/dist/dimensions/objective/user-satisfaction.js.map +1 -0
  309. package/dist/dimensions/output-format/action.d.ts +2 -0
  310. package/dist/dimensions/output-format/action.js +2 -0
  311. package/dist/dimensions/output-format/action.js.map +1 -0
  312. package/dist/dimensions/output-format/code.d.ts +2 -0
  313. package/dist/dimensions/output-format/code.js +2 -0
  314. package/dist/dimensions/output-format/code.js.map +1 -0
  315. package/dist/dimensions/output-format/document.d.ts +2 -0
  316. package/dist/dimensions/output-format/document.js +2 -0
  317. package/dist/dimensions/output-format/document.js.map +1 -0
  318. package/dist/dimensions/output-format/natural-language.d.ts +2 -0
  319. package/dist/dimensions/output-format/natural-language.js +2 -0
  320. package/dist/dimensions/output-format/natural-language.js.map +1 -0
  321. package/dist/dimensions/output-format/structured-data.d.ts +2 -0
  322. package/dist/dimensions/output-format/structured-data.js +2 -0
  323. package/dist/dimensions/output-format/structured-data.js.map +1 -0
  324. package/dist/dimensions/output-format/structured-decision.d.ts +2 -0
  325. package/dist/dimensions/output-format/structured-decision.js +2 -0
  326. package/dist/dimensions/output-format/structured-decision.js.map +1 -0
  327. package/dist/dimensions/output-format/visualization.d.ts +2 -0
  328. package/dist/dimensions/output-format/visualization.js +2 -0
  329. package/dist/dimensions/output-format/visualization.js.map +1 -0
  330. package/dist/dimensions/reasoning-strategy/chain-of-thought.d.ts +2 -0
  331. package/dist/dimensions/reasoning-strategy/chain-of-thought.js +2 -0
  332. package/dist/dimensions/reasoning-strategy/chain-of-thought.js.map +1 -0
  333. package/dist/dimensions/reasoning-strategy/plan-and-solve.d.ts +2 -0
  334. package/dist/dimensions/reasoning-strategy/plan-and-solve.js +2 -0
  335. package/dist/dimensions/reasoning-strategy/plan-and-solve.js.map +1 -0
  336. package/dist/dimensions/reasoning-strategy/react.d.ts +2 -0
  337. package/dist/dimensions/reasoning-strategy/react.js +2 -0
  338. package/dist/dimensions/reasoning-strategy/react.js.map +1 -0
  339. package/dist/dimensions/reasoning-strategy/reflexion.d.ts +2 -0
  340. package/dist/dimensions/reasoning-strategy/reflexion.js +2 -0
  341. package/dist/dimensions/reasoning-strategy/reflexion.js.map +1 -0
  342. package/dist/dimensions/reasoning-strategy/tree-of-thoughts.d.ts +2 -0
  343. package/dist/dimensions/reasoning-strategy/tree-of-thoughts.js +2 -0
  344. package/dist/dimensions/reasoning-strategy/tree-of-thoughts.js.map +1 -0
  345. package/dist/dimensions/role/architect.d.ts +2 -0
  346. package/dist/dimensions/role/architect.js +2 -0
  347. package/dist/dimensions/role/architect.js.map +1 -0
  348. package/dist/dimensions/role/build.d.ts +2 -0
  349. package/dist/dimensions/role/build.js +2 -0
  350. package/dist/dimensions/role/build.js.map +1 -0
  351. package/dist/dimensions/role/converse.d.ts +2 -0
  352. package/dist/dimensions/role/converse.js +2 -0
  353. package/dist/dimensions/role/converse.js.map +1 -0
  354. package/dist/dimensions/role/curate.d.ts +2 -0
  355. package/dist/dimensions/role/curate.js +2 -0
  356. package/dist/dimensions/role/curate.js.map +1 -0
  357. package/dist/dimensions/role/diagnose.d.ts +2 -0
  358. package/dist/dimensions/role/diagnose.js +2 -0
  359. package/dist/dimensions/role/diagnose.js.map +1 -0
  360. package/dist/dimensions/role/document.d.ts +2 -0
  361. package/dist/dimensions/role/document.js +2 -0
  362. package/dist/dimensions/role/document.js.map +1 -0
  363. package/dist/dimensions/role/implement.d.ts +2 -0
  364. package/dist/dimensions/role/implement.js +2 -0
  365. package/dist/dimensions/role/implement.js.map +1 -0
  366. package/dist/dimensions/role/operate.d.ts +2 -0
  367. package/dist/dimensions/role/operate.js +2 -0
  368. package/dist/dimensions/role/operate.js.map +1 -0
  369. package/dist/dimensions/role/orchestrate.d.ts +2 -0
  370. package/dist/dimensions/role/orchestrate.js +2 -0
  371. package/dist/dimensions/role/orchestrate.js.map +1 -0
  372. package/dist/dimensions/role/plan.d.ts +2 -0
  373. package/dist/dimensions/role/plan.js +2 -0
  374. package/dist/dimensions/role/plan.js.map +1 -0
  375. package/dist/dimensions/role/research.d.ts +2 -0
  376. package/dist/dimensions/role/research.js +2 -0
  377. package/dist/dimensions/role/research.js.map +1 -0
  378. package/dist/dimensions/role/review.d.ts +2 -0
  379. package/dist/dimensions/role/review.js +2 -0
  380. package/dist/dimensions/role/review.js.map +1 -0
  381. package/dist/dimensions/role/test.d.ts +2 -0
  382. package/dist/dimensions/role/test.js +2 -0
  383. package/dist/dimensions/role/test.js.map +1 -0
  384. package/dist/dimensions/satisficing/optimize.d.ts +2 -0
  385. package/dist/dimensions/satisficing/optimize.js +2 -0
  386. package/dist/dimensions/satisficing/optimize.js.map +1 -0
  387. package/dist/dimensions/satisficing/satisfice.d.ts +2 -0
  388. package/dist/dimensions/satisficing/satisfice.js +2 -0
  389. package/dist/dimensions/satisficing/satisfice.js.map +1 -0
  390. package/dist/dimensions/self-evaluation/acceptance-criteria-check.d.ts +2 -0
  391. package/dist/dimensions/self-evaluation/acceptance-criteria-check.js +2 -0
  392. package/dist/dimensions/self-evaluation/acceptance-criteria-check.js.map +1 -0
  393. package/dist/dimensions/self-evaluation/cross-validation-consensus.d.ts +2 -0
  394. package/dist/dimensions/self-evaluation/cross-validation-consensus.js +2 -0
  395. package/dist/dimensions/self-evaluation/cross-validation-consensus.js.map +1 -0
  396. package/dist/dimensions/self-evaluation/executable-test-oracle.d.ts +2 -0
  397. package/dist/dimensions/self-evaluation/executable-test-oracle.js +2 -0
  398. package/dist/dimensions/self-evaluation/executable-test-oracle.js.map +1 -0
  399. package/dist/dimensions/self-evaluation/human-review.d.ts +2 -0
  400. package/dist/dimensions/self-evaluation/human-review.js +2 -0
  401. package/dist/dimensions/self-evaluation/human-review.js.map +1 -0
  402. package/dist/dimensions/self-evaluation/llm-as-judge.d.ts +2 -0
  403. package/dist/dimensions/self-evaluation/llm-as-judge.js +2 -0
  404. package/dist/dimensions/self-evaluation/llm-as-judge.js.map +1 -0
  405. package/dist/dimensions/self-evaluation/self-critique.d.ts +2 -0
  406. package/dist/dimensions/self-evaluation/self-critique.js +2 -0
  407. package/dist/dimensions/self-evaluation/self-critique.js.map +1 -0
  408. package/dist/dimensions/self-evaluation/verifier-model.d.ts +2 -0
  409. package/dist/dimensions/self-evaluation/verifier-model.js +2 -0
  410. package/dist/dimensions/self-evaluation/verifier-model.js.map +1 -0
  411. package/dist/dimensions/situation-awareness/comprehension.d.ts +2 -0
  412. package/dist/dimensions/situation-awareness/comprehension.js +2 -0
  413. package/dist/dimensions/situation-awareness/comprehension.js.map +1 -0
  414. package/dist/dimensions/situation-awareness/perception.d.ts +2 -0
  415. package/dist/dimensions/situation-awareness/perception.js +2 -0
  416. package/dist/dimensions/situation-awareness/perception.js.map +1 -0
  417. package/dist/dimensions/situation-awareness/projection.d.ts +2 -0
  418. package/dist/dimensions/situation-awareness/projection.js +2 -0
  419. package/dist/dimensions/situation-awareness/projection.js.map +1 -0
  420. package/dist/dimensions/transparency/answer-only.d.ts +2 -0
  421. package/dist/dimensions/transparency/answer-only.js +2 -0
  422. package/dist/dimensions/transparency/answer-only.js.map +1 -0
  423. package/dist/dimensions/transparency/decision-rationale.d.ts +2 -0
  424. package/dist/dimensions/transparency/decision-rationale.js +2 -0
  425. package/dist/dimensions/transparency/decision-rationale.js.map +1 -0
  426. package/dist/dimensions/transparency/limitation-disclosure.d.ts +2 -0
  427. package/dist/dimensions/transparency/limitation-disclosure.js +2 -0
  428. package/dist/dimensions/transparency/limitation-disclosure.js.map +1 -0
  429. package/dist/dimensions/transparency/post-hoc-rationale.d.ts +2 -0
  430. package/dist/dimensions/transparency/post-hoc-rationale.js +2 -0
  431. package/dist/dimensions/transparency/post-hoc-rationale.js.map +1 -0
  432. package/dist/dimensions/transparency/provenance-attribution.d.ts +2 -0
  433. package/dist/dimensions/transparency/provenance-attribution.js +2 -0
  434. package/dist/dimensions/transparency/provenance-attribution.js.map +1 -0
  435. package/dist/dimensions/transparency/reasoning-trace.d.ts +2 -0
  436. package/dist/dimensions/transparency/reasoning-trace.js +2 -0
  437. package/dist/dimensions/transparency/reasoning-trace.js.map +1 -0
  438. package/dist/dimensions/transparency/uncertainty-disclosure.d.ts +2 -0
  439. package/dist/dimensions/transparency/uncertainty-disclosure.js +2 -0
  440. package/dist/dimensions/transparency/uncertainty-disclosure.js.map +1 -0
  441. package/dist/dimensions/trigger/agent-message.d.ts +2 -0
  442. package/dist/dimensions/trigger/agent-message.js +2 -0
  443. package/dist/dimensions/trigger/agent-message.js.map +1 -0
  444. package/dist/dimensions/trigger/environment-event.d.ts +2 -0
  445. package/dist/dimensions/trigger/environment-event.js +2 -0
  446. package/dist/dimensions/trigger/environment-event.js.map +1 -0
  447. package/dist/dimensions/trigger/introspection-request.d.ts +2 -0
  448. package/dist/dimensions/trigger/introspection-request.js +2 -0
  449. package/dist/dimensions/trigger/introspection-request.js.map +1 -0
  450. package/dist/dimensions/trigger/scheduled-trigger.d.ts +2 -0
  451. package/dist/dimensions/trigger/scheduled-trigger.js +2 -0
  452. package/dist/dimensions/trigger/scheduled-trigger.js.map +1 -0
  453. package/dist/dimensions/trigger/tool-result.d.ts +2 -0
  454. package/dist/dimensions/trigger/tool-result.js +2 -0
  455. package/dist/dimensions/trigger/tool-result.js.map +1 -0
  456. package/dist/dimensions/trigger/user-message.d.ts +2 -0
  457. package/dist/dimensions/trigger/user-message.js +2 -0
  458. package/dist/dimensions/trigger/user-message.js.map +1 -0
  459. package/dist/genus/founding-doctrine.d.ts +7 -0
  460. package/dist/genus/founding-doctrine.js +41 -0
  461. package/dist/genus/founding-doctrine.js.map +1 -0
  462. package/dist/hook-cells.d.ts +3 -0
  463. package/dist/hook-cells.js +30 -0
  464. package/dist/hook-cells.js.map +1 -0
  465. package/dist/hooks/deploy-drift-notice.d.ts +2 -0
  466. package/dist/hooks/deploy-drift-notice.js +434 -0
  467. package/dist/hooks/deploy-drift-notice.js.map +1 -0
  468. package/dist/hooks/memory-consolidation-nudge.d.ts +2 -0
  469. package/dist/hooks/memory-consolidation-nudge.js +148 -0
  470. package/dist/hooks/memory-consolidation-nudge.js.map +1 -0
  471. package/dist/hooks/praxis-continuity.d.ts +2 -0
  472. package/dist/hooks/praxis-continuity.js +131 -0
  473. package/dist/hooks/praxis-continuity.js.map +1 -0
  474. package/dist/hooks/resume-availability-notice.d.ts +2 -0
  475. package/dist/hooks/resume-availability-notice.js +50 -0
  476. package/dist/hooks/resume-availability-notice.js.map +1 -0
  477. package/dist/hooks/stance-guardrail-pre.d.ts +2 -0
  478. package/dist/hooks/stance-guardrail-pre.js +170 -0
  479. package/dist/hooks/stance-guardrail-pre.js.map +1 -0
  480. package/dist/hooks/stance-guardrail.d.ts +2 -0
  481. package/dist/hooks/stance-guardrail.js +943 -0
  482. package/dist/hooks/stance-guardrail.js.map +1 -0
  483. package/dist/index.d.ts +2 -0
  484. package/dist/index.js +45 -0
  485. package/dist/index.js.map +1 -0
  486. package/dist/manifest.d.ts +191 -0
  487. package/dist/manifest.js +237 -0
  488. package/dist/manifest.js.map +1 -0
  489. package/dist/operator-lexicon.d.ts +302 -0
  490. package/dist/operator-lexicon.js +198 -0
  491. package/dist/operator-lexicon.js.map +1 -0
  492. package/dist/plan-states.d.ts +31 -0
  493. package/dist/plan-states.js +42 -0
  494. package/dist/plan-states.js.map +1 -0
  495. package/dist/rules/repo-preamble.d.ts +2 -0
  496. package/dist/rules/repo-preamble.js +56 -0
  497. package/dist/rules/repo-preamble.js.map +1 -0
  498. package/dist/skills/carry-on/skill.d.ts +2 -0
  499. package/dist/skills/carry-on/skill.js +56 -0
  500. package/dist/skills/carry-on/skill.js.map +1 -0
  501. package/dist/skills/conceptualize/skill.d.ts +2 -0
  502. package/dist/skills/conceptualize/skill.js +34 -0
  503. package/dist/skills/conceptualize/skill.js.map +1 -0
  504. package/dist/skills/create-agent/skill.d.ts +2 -0
  505. package/dist/skills/create-agent/skill.js +38 -0
  506. package/dist/skills/create-agent/skill.js.map +1 -0
  507. package/dist/skills/create-skill/skill.d.ts +2 -0
  508. package/dist/skills/create-skill/skill.js +27 -0
  509. package/dist/skills/create-skill/skill.js.map +1 -0
  510. package/dist/skills/dream/skill.d.ts +2 -0
  511. package/dist/skills/dream/skill.js +65 -0
  512. package/dist/skills/dream/skill.js.map +1 -0
  513. package/dist/skills/elicit/skill.d.ts +2 -0
  514. package/dist/skills/elicit/skill.js +26 -0
  515. package/dist/skills/elicit/skill.js.map +1 -0
  516. package/dist/skills/event-tap/skill.d.ts +2 -0
  517. package/dist/skills/event-tap/skill.js +37 -0
  518. package/dist/skills/event-tap/skill.js.map +1 -0
  519. package/dist/skills/exemplify/skill.d.ts +2 -0
  520. package/dist/skills/exemplify/skill.js +42 -0
  521. package/dist/skills/exemplify/skill.js.map +1 -0
  522. package/dist/skills/formalize/skill.d.ts +2 -0
  523. package/dist/skills/formalize/skill.js +35 -0
  524. package/dist/skills/formalize/skill.js.map +1 -0
  525. package/dist/skills/handoff/skill.d.ts +2 -0
  526. package/dist/skills/handoff/skill.js +27 -0
  527. package/dist/skills/handoff/skill.js.map +1 -0
  528. package/dist/skills/introspect/skill.d.ts +2 -0
  529. package/dist/skills/introspect/skill.js +47 -0
  530. package/dist/skills/introspect/skill.js.map +1 -0
  531. package/dist/skills/materialize/skill.d.ts +2 -0
  532. package/dist/skills/materialize/skill.js +54 -0
  533. package/dist/skills/materialize/skill.js.map +1 -0
  534. package/dist/skills/praxis/skill.d.ts +2 -0
  535. package/dist/skills/praxis/skill.js +196 -0
  536. package/dist/skills/praxis/skill.js.map +1 -0
  537. package/dist/skills/probe/skill.d.ts +2 -0
  538. package/dist/skills/probe/skill.js +58 -0
  539. package/dist/skills/probe/skill.js.map +1 -0
  540. package/dist/skills/signify/skill.d.ts +2 -0
  541. package/dist/skills/signify/skill.js +59 -0
  542. package/dist/skills/signify/skill.js.map +1 -0
  543. package/dist/skills/wake/skill.d.ts +2 -0
  544. package/dist/skills/wake/skill.js +43 -0
  545. package/dist/skills/wake/skill.js.map +1 -0
  546. package/package.json +72 -0
@@ -0,0 +1,434 @@
1
+ // deploy-drift-notice — the advisory that answers, before the agent acts, whether
2
+ // the doctrine THIS HOST runs is the doctrine the corpus renders.
3
+ //
4
+ // THE INCIDENT. `~/.claude/agents/<name>.md` and the render tree diverged. An agent
5
+ // edited the corpus for a full session under a superseded first principle, and every
6
+ // gate in the repository stayed green the entire time — because every gate that
7
+ // existed was a claim about how a target is PRODUCED, and none was a claim about what
8
+ // a host is RUNNING. The comparison that would have caught it landed with
9
+ // `deploy --check`: reachable, correct, and speaking only when asked. A check that
10
+ // must be remembered is a check that will be forgotten at exactly the moment it
11
+ // matters — the session where the doctrine is already wrong. This cell is what asks.
12
+ //
13
+ // SILENCE WHEN CLEAN IS THE LOAD-BEARING HALF, not a courtesy. An advisory that fires
14
+ // every session trains its reader to skip it, and a skipped advisory is worse than an
15
+ // absent one: it occupies the slot where a real warning would have been read. So the
16
+ // in-sync path emits nothing at all, and the cost of that path is what makes the
17
+ // silence affordable (below).
18
+ //
19
+ // IT RELAYS A REPORT, IT DOES NOT COMPUTE ONE. `deploy --check` already produces the
20
+ // only thing worth saying — per artifact, the rendered lines this host is MISSING and
21
+ // the superseded lines it is STILL RUNNING. "3 files differ" does not tell an agent
22
+ // its own first principle is stale; the axiom does. Recomputing any of that here would
23
+ // put a second home under the one claim that must never fork, and the second home
24
+ // would be a shell script.
25
+ //
26
+ // WHAT IT MAY NOT DO: refuse. `ARCHITECTURE`'s fidelity ladder — a shortfall degrades
27
+ // and warns, it never refuses and never widens. A stale deployment must not block a
28
+ // session; it must be impossible to start one without being told.
29
+ //
30
+ // IT ASKS AGAIN, BECAUSE THE HOST GOES STALE MID-SESSION. Bound to `session.start`
31
+ // alone, the cell answered a question that expires: a projection landing during the
32
+ // session it was authored in left the rest of that session running the superseded
33
+ // copy with nothing further to say. That is not hypothetical and it is not rare —
34
+ // it is the ORDINARY shape of work here, where a session edits a cell, projects it,
35
+ // and keeps going under the version it just replaced. The 16-hour-old projection of
36
+ // an agent's own governing cell was this; so was a `praxis` edit that landed under a
37
+ // running session hours later.
38
+ //
39
+ // `prompt.submit` IS THE RE-ARM, and it is the same question at a finer grain rather
40
+ // than a second mechanism. Both events put the notice in the one position that makes
41
+ // it worth having — BEFORE the agent acts on an instruction — and on both harnesses
42
+ // the answer reaches the agent's own context, which is where a false premise has to
43
+ // be corrected because the agent is the thing holding it. `turn.end` was the runner-up
44
+ // and is the wrong end of the turn: it speaks after the acting is done, and on claude
45
+ // its stdout lands in the transcript rather than in the context of the reader who
46
+ // needs it. `file.edit.post` was rejected as a category error — a cell EDIT is not
47
+ // drift; drift begins when the render tree moves, which happens under a shell command.
48
+ //
49
+ // A RE-ARM IS ONLY AS GOOD AS ITS SILENCE, and this one is where the silence had to be
50
+ // re-earned. Fired every prompt, an unchanged verdict would repeat the same advisory
51
+ // until the reader stopped seeing it — the exact failure the in-sync path was built to
52
+ // avoid, re-entering through the door held open for the fix. So the trigger is a CHANGE
53
+ // in the verdict, never a verdict that is merely non-empty: the worker records the last
54
+ // verdict this session was told (keyed by ⟨harness, session⟩, carrying ⟨corpus, tree⟩ so
55
+ // the same session moved to another checkout asks a fresh question) and speaks only when
56
+ // the new one differs. Said once, a standing drift is then silent until it changes or is
57
+ // repaired. THE CLEAN VERDICT IS RECORDED TOO, and that is what makes a REAPPEARING drift
58
+ // audible: without it, drift → deploy → the identical drift again would match the stale
59
+ // record and say nothing.
60
+ //
61
+ // NO SESSION IDENTITY MEANS NO SUPPRESSION, deliberately, in that direction. When the
62
+ // payload carries no usable `session_id` or the state cannot be written, every run
63
+ // speaks. A repeated advisory under genuine drift is noise the operator can end with one
64
+ // command; a suppressed one is silence, and this cell's own residue says silence is
65
+ // borrowed from the in-sync path and may never be handed to any other.
66
+ //
67
+ // COST, MEASURED (2026-08-05, darwin/arm64, warm page cache, 39 rendered artifacts
68
+ // against a deployed `.claude` of ~40 files):
69
+ // clean path, end to end 45 ms (10 ms shell discovery + ~35 ms comparator)
70
+ // drift path, end to end 60 ms (the report is longer, and is printed)
71
+ //
72
+ // RE-MEASURED after the three repairs above, and reported as an A/B rather than as a
73
+ // new absolute, because an absolute is a claim about the rig as much as the worker.
74
+ // Same corpus, same real deployment, best-of-7, the PREVIOUS worker and this one run
75
+ // alternately in one session:
76
+ // previous worker 56 ms clean · 58 ms drift
77
+ // this worker 56 ms clean · 56 ms drift
78
+ // The change is free, and the whole spread between 45 and 56 belongs to the harness
79
+ // the numbers were taken through (a `sh` under a `bash` under a timestamping
80
+ // `python3`), not to anything the worker does. It could not have been otherwise: the
81
+ // three facts are SUBSTITUTED AT PROJECTION, so the resolved worker does the same
82
+ // three variable assignments it always did, and the one thing that got cheaper is the
83
+ // non-zero path, which no longer forks `printf | tail | grep` to recover a verdict.
84
+ //
85
+ // RE-MEASURED AGAIN for the re-arm, same rig, same A/B discipline (best-of-7, the two
86
+ // workers run alternately; the clean leg against a fixture host deployed from this
87
+ // corpus's own render tree, so it is a real in-sync verdict rather than an early exit):
88
+ // previous worker 62 ms clean · 62 ms drift
89
+ // this worker 60 ms clean · 64 ms drift
90
+ // Per run it is free — the state costs one `cat` and one small write, which is under
91
+ // this rig's noise. THE COST THAT ACTUALLY CHANGED IS FREQUENCY, and saying so is the
92
+ // point of measuring: the hook now runs once per PROMPT rather than once per session,
93
+ // so a 40-prompt session pays ~2.4 s of wall clock it did not pay before, spread across
94
+ // 40 moments where the agent is already waiting on a model. That is the price of not
95
+ // running superseded doctrine for the other 39 of them, and it is the trade this cell
96
+ // exists to take. The per-run number is what keeps it payable, which is why the bound
97
+ // is held by a test rather than remembered.
98
+ //
99
+ // A FULL BYTE COMPARISON of every rendered artifact is therefore what runs — no
100
+ // digest, and above all NO SAMPLE. A sampled check that misses the founding doctrine
101
+ // reports "in sync", which is the exact failure this cell exists to end. The
102
+ // `deploy-drift-notice` suite re-measures the clean path and fails on a regression, so
103
+ // the number above is a held bound rather than a remembered one.
104
+ //
105
+ // THE CELL NAMES A CAPABILITY, NOT A PATH, and it now ASKS for everything it used to
106
+ // infer. TWO LAWS BIND A CELL. The first: a cell must not restate a location the
107
+ // projector already computes. The harder companion: a cell must not GUESS what the
108
+ // projector could have told it. Three guesses lived here and all three are gone:
109
+ //
110
+ // 1. THE COMPARATOR'S NAME was a shell literal, because the forge CLI's name had no
111
+ // compile-time home the way `CLI_BIN` does. It has one now — derived, not
112
+ // declared: `forge/src/bin-name.ts` reads the `bin` key npm itself obeys, so
113
+ // there is one authored spelling in the package and the cell names the fact
114
+ // (`deploy-bin`) rather than repeating it.
115
+ // 2. THE HARNESS was assumed to be claude. The tree is still identified by SHAPE —
116
+ // `--out` is an operator's choice and must never be assumed — but the shape it
117
+ // matches is now THIS harness's, because the projector substitutes this
118
+ // harness's hooks-file name (`harness-hooks-file`) and its own name
119
+ // (`harness-name`, passed to the comparator so it audits the right home). A
120
+ // codex session reports on the codex deployment. The pair lives on
121
+ // `HarnessAdapter` and reaches here through projection, which is the only stage
122
+ // that knows which adapter it is rendering for — the alternative was a
123
+ // shell-side copy of the harness registry, a second home for adapter knowledge.
124
+ // 3. THE VERDICT was recovered by matching the report's closing line. `deploy
125
+ // --check` exited 1 both when the host was stale and when the check itself
126
+ // failed, so the exit status could not separate them and the worker read the
127
+ // TEXT — coupling a hook worker to the comparator's output FORMAT because its
128
+ // exit CONTRACT could not carry the distinction. The contract carries it now
129
+ // (`forge/src/deploy/check-exit.ts`: 0 in sync · 1 drift · 2 no verdict), and
130
+ // the one code that is forge's choice rather than POSIX's arrives as a fact.
131
+ //
132
+ // EVERY HOOK WORKER ON EVERY HARNESS HAD (2). This cell is only the first whose job
133
+ // made it visible, because it is the first that has to LOOK at the deployed tree
134
+ // rather than merely run in it — and the repair is on the shared channel, so the next
135
+ // one asks by name instead of rediscovering the blindness.
136
+ //
137
+ // The `workers[].content` is the TEMPLATE the committed worker at `targetPath`
138
+ // regenerates from — resolved bytes, byte-locked by `test/hook-rule-boundary.test.ts`.
139
+ // The committed resolution is the CLAUDE one (`COMMITTED_TARGET_HARNESS`), because a
140
+ // template with an adapter-relative fact has one resolution per harness and
141
+ // `targetPath` names one file; every DEPLOYED copy is resolved for the harness that
142
+ // session runs. EDIT THE CELL AND REGENERATE (`pnpm canon:project:targets`) — never
143
+ // the committed `.sh` alone.
144
+ export const deployDriftNotice = {
145
+ id: 'deploy-drift-notice',
146
+ residue: 'advisory ↾ session.start ∧ prompt.submit ⟨re-arm ∴ mid-session projection ⇏ stale ∀remaining-turns⟩ · deployed ≢ rendered ⇒ emit ⟨superseded-lines ∧ missing-lines ; ¬count · ¬digest · ¬sample⟩ ↾ verdict ≢ last-told ⟨trigger ≜ verdict-change · ¬verdict-non-empty ∴ re-arm ⇏ re-notify · memory ↾ ⟨harness · session⟩ ∧ ⟨corpus · tree⟩ · in-sync recorded ∴ recurrence audible · ∄session-id ⇒ ¬suppress ⟨noise ≻ borrowed-silence⟩⟩ · deployed ≡ rendered ⇒ ∅ ⟨silence-when-clean MANDATORY ⟨fires ∀session ⇒ reader-skips ⇒ worse-than-absent⟩⟩ · verdict ↦ comparator ⟨corpus-owned · ¬face-computed · ¬reimplemented⟩ · corpus ↦ walk-up ⟨cwd · corpus-marker⟩ ⟨∄ ⇒ ∅ ⟨¬in-scope ∴ ¬wrong⟩⟩ · tree ↦ shape ⟨agents ∧ skills ∧ THIS-harness-hooks-file ; ¬named-path⟩ · harness ↦ projection ⟨¬inferred ∴ session-own-deployment⟩ · stale ⊻ ¬ran ↦ exit-code ⟨¬report-text ∴ format ⊥ verdict⟩ · reached ∧ ∄verdict ⇒ SAY-SO ⟨silence ≡ in-sync ∴ ¬borrowable⟩ · ¬block · exit-0 ∀error',
147
+ substrate: 'harness',
148
+ events: ['session.start', 'prompt.submit'],
149
+ entry: 'deploy-drift-notice.sh',
150
+ timeout: 10,
151
+ refs: [],
152
+ speech: [
153
+ {
154
+ id: 'drift',
155
+ text: 'DEPLOY DRIFT — this host runs a SUPERSEDED projection of the canon. In the report below, a `-` line is doctrine THIS SESSION is operating under and the corpus no longer says; a `+` line is what the corpus says and this host never received. Read every `-` line as a false premise, not as background. `pnpm canon:deploy` converges the host.',
156
+ },
157
+ {
158
+ id: 'no-verdict',
159
+ // `%s` is the worker's printf arg for the comparator it actually invoked. A
160
+ // BLIND line naming nothing sends the reader hunting for what failed.
161
+ text: 'DEPLOY DRIFT — the comparator (`%s`) returned no verdict, so whether this host runs the current canon is UNKNOWN. This is not an in-sync report; nothing here establishes that the doctrine in force is the corpus.',
162
+ },
163
+ {
164
+ id: 'no-comparator',
165
+ text: 'DEPLOY DRIFT — this corpus is in scope and its deploy comparator (`%s`) is not installed here, so whether this host runs the current canon is UNKNOWN. Install the workspace dependencies to make the question answerable; until then this is not an in-sync report.',
166
+ },
167
+ ],
168
+ workers: [
169
+ {
170
+ filename: 'deploy-drift-notice.sh',
171
+ targetPath: 'packages/canon/targets/guardrail/deploy-drift-notice.sh',
172
+ executable: true,
173
+ content: `#!/usr/bin/env sh
174
+ # deploy-drift-notice — an ADVISORY, at session start and again before every
175
+ # prompt. It asks the corpus's own deploy tool whether the tree this host RUNS is
176
+ # the tree the corpus RENDERS, and speaks only when the answer CHANGES to "no".
177
+ #
178
+ # WHY (the incident): a deployed agent definition and the render tree diverged, an
179
+ # agent ran a superseded first principle for a whole session, and every gate in the
180
+ # repository stayed green throughout. The comparison was already reachable —
181
+ # \`deploy --check\` — and nothing ran it, so the drift stayed silent by default.
182
+ #
183
+ # WHY AGAIN (the second incident): bound to session start alone, it answered a
184
+ # question that expires. A projection landing MID-session left the rest of that
185
+ # session running the superseded copy with nothing further to say — which is the
186
+ # ordinary shape of work here, not an edge case. \`prompt.submit\` re-asks it in the
187
+ # same position that made the first answer worth having: before the agent acts.
188
+ #
189
+ # CONTRACT:
190
+ # - SILENT WHEN IN SYNC. An advisory that fires every session trains its reader
191
+ # to skip it, and is then worse than absent.
192
+ # - SPEAKS ON A CHANGE, NOT ON A STATE. Re-armed per prompt, a standing drift
193
+ # would otherwise repeat until it stopped being read — the same failure, back
194
+ # through the door the re-arm opened. The last verdict this session was told is
195
+ # recorded; an identical one is silent.
196
+ # - ADVISORY ONLY. Prints to stdout and exits 0. It never emits
197
+ # {"decision":"block"} — a stale deployment must not block a session.
198
+ # - NEVER SAMPLES. The comparison is the tool's own: whole tree, byte for byte.
199
+ # A sampled check that misses the founding doctrine reports "in sync".
200
+ # - NOT A COUNT. It relays the tool's report, which carries the superseded lines
201
+ # still running and the rendered lines missing.
202
+ #
203
+ # NOTHING BELOW IS INFERRED THAT PROJECTION COULD STATE. The four values this
204
+ # worker cannot compute for itself are SUBSTITUTED into it when the cell is
205
+ # rendered — the comparator's name, this harness's name and hooks file, and the
206
+ # exit code the comparator returns for drift. A copy of any of them, spelled here,
207
+ # would be a second home in a file no compiler reads.
208
+ #
209
+ # COST: the cell header carries the measurement and its A/B. Not repeated here — a
210
+ # number in two places is a number that will disagree with itself. What is worth
211
+ # saying at this grain: the discovery below is a small fraction of it, and the rest
212
+ # is the comparator reading both trees whole, which is the point.
213
+ #
214
+ # INPUT : SessionStart / UserPromptSubmit hook JSON on stdin (cwd, session_id, ...).
215
+ # OUTPUT : a CHANGED drift verdict -> advisory + the report; a changed unanswerable
216
+ # one -> a BLIND line; in sync, or unchanged since this session was told -> none.
217
+
218
+ set -eu
219
+
220
+ # Neither a session start nor a prompt may be broken by an advisory. Any unexpected
221
+ # error -> silence.
222
+ trap 'exit 0' EXIT
223
+
224
+ # ── WHAT PROJECTION TOLD US ────────────────────────────────────────────────────
225
+ # The corpus's own deploy tool. ONE authored spelling exists in the whole
226
+ # repository — \`packages/forge/package.json\`'s \`bin\` key, the one npm obeys — and
227
+ # \`forge/src/bin-name.ts\` derives from it, so this line is that key, relayed.
228
+ DEPLOY_TOOL={{fact:deploy-bin}}
229
+
230
+ # WHICH HARNESS THIS PROJECTION IS FOR. A hook worker is handed no identity by the
231
+ # session it runs in, so a worker that must LOOK at a deployed tree had to guess —
232
+ # and guessed claude, which made a codex session report on a sibling deployment.
233
+ # These two are the adapter's own \`name\` and \`hooksFile\`, substituted at
234
+ # projection: the codex render of this cell carries codex's.
235
+ HARNESS={{fact:harness-name}}
236
+ HARNESS_HOOKS_FILE={{fact:harness-hooks-file}}
237
+
238
+ # The status the comparator returns when it FOUND drift. \`0\` means success to
239
+ # POSIX and needs no telling; this one is the tool's own choice, so it is told.
240
+ DRIFT_RC={{fact:deploy-check-drift-code}}
241
+
242
+ # ── THE PAYLOAD, DRAINED ONCE ──────────────────────────────────────────────────
243
+ # Two fields are needed and stdin can only be read once, so both come off ONE jq —
244
+ # the same single fork the cwd lookup already cost, not a second one. \`.cwd\` says
245
+ # which corpus; \`.session_id\` says who is being told, which is what lets a re-armed
246
+ # advisory stay quiet about a verdict it has already delivered.
247
+ input="$(cat 2>/dev/null || true)"
248
+ cwd=""
249
+ sid=""
250
+ if command -v jq >/dev/null 2>&1 && [ -n "$input" ]; then
251
+ fields="$(printf '%s' "$input" | jq -r '.cwd // "", .session_id // ""' 2>/dev/null || true)"
252
+ {
253
+ read -r cwd || true
254
+ read -r sid || true
255
+ } <<EOF
256
+ $fields
257
+ EOF
258
+ fi
259
+
260
+ # ── WHERE ARE WE? the corpus, by its own marker ────────────────────────────────
261
+ # \`cratylus.config.ts\` is the file \`deploy\` itself reads to learn which corpus it is
262
+ # operating on. Walking up for it asks the same question the tool asks, instead of
263
+ # inventing a second convention for "a checkout of the canon".
264
+ start="\${CRATYLUS_CORPUS:-$cwd}"
265
+ [ -n "$start" ] || start="\${CLAUDE_PROJECT_DIR:-$PWD}"
266
+
267
+ root=""
268
+ d="$start"
269
+ while [ -n "$d" ] && [ "$d" != "/" ]; do
270
+ if [ -f "$d/cratylus.config.ts" ]; then
271
+ root="$d"
272
+ break
273
+ fi
274
+ d="\${d%/*}"
275
+ done
276
+ # NO CORPUS IN SCOPE IS SILENCE, and it is not the "clean" silence above. A session
277
+ # outside every checkout has no rendered doctrine to be compared against, so there is
278
+ # nothing here this hook could be right or wrong about — and speaking would fire it on
279
+ # every unrelated session, which is the one failure that makes an advisory worthless.
280
+ [ -n "$root" ] || exit 0
281
+
282
+ # ── WHICH TREE? this harness's render tree, by its SHAPE ───────────────────────
283
+ # A render tree is recognized by BEING one: \`agents/\` + \`skills/\` + THIS harness's
284
+ # own hooks file. That file is what distinguishes this harness's tree from another
285
+ # harness's tree sitting beside it, and it is named by projection rather than by
286
+ # this script — so a codex render of this worker skips the claude tree and a claude
287
+ # render skips the codex one. The \`--out\` dir is an operator's choice, so the tree
288
+ # is discovered, never named.
289
+ #
290
+ # THE GLOB USED TO BE \`.render*\`, WHICH MADE THE PARAGRAPH ABOVE FALSE. The shape
291
+ # test only ever ran on candidates a NAME had already selected, so "discovered, never
292
+ # named" described the second half of a two-stage filter whose first stage was a
293
+ # hard-coded prefix. Any operator honouring the documented freedom — \`--out
294
+ # build/corpus\` — got silence, and silence here is indistinguishable from in-sync.
295
+ # The rename of the corpus's own tree is what surfaced it; the defect predates it.
296
+ #
297
+ # So the candidate set is now DOTTED DIRECTORIES at the same depths, plus one level
298
+ # beneath each, because a tree that splits per harness puts the shape one deeper
299
+ # (\`.cratylus/claude\`, not \`.render-ts\`). Dotted, because that is the convention
300
+ # for generated trees (\`.next\`, \`.turbo\`, \`.svelte-kit\`) and because walking every
301
+ # directory in a checkout to find one that has \`agents/\` is a cost this hook cannot
302
+ # pay on every prompt. The shape test is still what decides; the glob now only bounds
303
+ # where to look, and it no longer bounds it to one spelling.
304
+ tree="\${CRATYLUS_RENDER_TREE:-}"
305
+ if [ -z "$tree" ]; then
306
+ for c in \\
307
+ "$root"/.*/ "$root"/*/.*/ "$root"/*/*/.*/ \\
308
+ "$root"/.*/*/ "$root"/*/.*/*/ "$root"/*/*/.*/*/; do
309
+ case "$c" in
310
+ */node_modules/*) continue ;;
311
+ */.git/*) continue ;;
312
+ */./ | */../) continue ;;
313
+ esac
314
+ c="\${c%/}"
315
+ [ -d "$c/agents" ] && [ -d "$c/skills" ] && [ -f "$c/$HARNESS_HOOKS_FILE" ] || continue
316
+ tree="$c"
317
+ break
318
+ done
319
+ fi
320
+ # A corpus that has rendered nothing for THIS harness has nothing to be compared
321
+ # against — the same not-in-scope silence, one step in.
322
+ [ -n "$tree" ] || exit 0
323
+
324
+ # ── WHAT WAS THIS SESSION ALREADY TOLD? ────────────────────────────────────────
325
+ # The re-arm's whole cost is here. Asked before every prompt, an unchanged verdict
326
+ # repeated until the reader stopped seeing it would be the in-sync failure re-entering
327
+ # through the door opened to fix the stale one. So one small file per session holds the
328
+ # last verdict delivered, and the trigger is the DIFFERENCE.
329
+ #
330
+ # The key is \`⟨harness, session⟩\` and the CONTENT carries \`⟨corpus, tree⟩\`: two
331
+ # harnesses in one session audit two hosts and must not overwrite each other's answer,
332
+ # and the same session moved to another checkout is asking a different question rather
333
+ # than repeating one. A session id that is not a plain token is treated as absent —
334
+ # nothing here builds a path out of an unexamined payload field.
335
+ state=""
336
+ case "$sid" in
337
+ '' | *[!A-Za-z0-9._-]*) ;;
338
+ *)
339
+ stash="\${TMPDIR:-/tmp}/cratylus-deploy-drift"
340
+ if [ -d "$stash" ] || mkdir -p "$stash" 2>/dev/null; then
341
+ state="$stash/$HARNESS-$sid"
342
+ fi
343
+ ;;
344
+ esac
345
+
346
+ # \`changed <verdict>\` — record it as the last thing this session was told, and
347
+ # answer whether it DIFFERS from what was recorded before.
348
+ #
349
+ # NO STATE MEANS EVERY RUN SPEAKS, and the asymmetry is deliberate. Without a session
350
+ # id there is nothing to suppress against, and a repeated advisory under real drift is
351
+ # noise one \`deploy\` ends, while a suppressed one is SILENCE — which this cell spends
352
+ # its whole contract making mean "in sync", and may therefore lend to nothing else.
353
+ changed() {
354
+ now="$root|$tree|$1"
355
+ [ -n "$state" ] || return 0
356
+ last=""
357
+ [ ! -f "$state" ] || last="$(cat "$state" 2>/dev/null || true)"
358
+ printf '%s' "$now" >"$state" 2>/dev/null || true
359
+ [ "$last" != "$now" ]
360
+ }
361
+
362
+ # ── WHAT ASKS? the tool, never a reimplementation ──────────────────────────────
363
+ cli="\${CRATYLUS_DEPLOY_CHECK:-}"
364
+ if [ -z "$cli" ]; then
365
+ if [ -x "$root/node_modules/.bin/$DEPLOY_TOOL" ]; then
366
+ cli="$root/node_modules/.bin/$DEPLOY_TOOL"
367
+ elif command -v "$DEPLOY_TOOL" >/dev/null 2>&1; then
368
+ cli="$DEPLOY_TOOL"
369
+ fi
370
+ fi
371
+ if [ -z "$cli" ]; then
372
+ if changed "no-comparator"; then
373
+ printf '{{speech:no-comparator}}\\n' "$DEPLOY_TOOL"
374
+ fi
375
+ exit 0
376
+ fi
377
+
378
+ # \`--harness\` is what makes the audited HOME this session's. Without it the tool
379
+ # resolves its default root, so a codex tree would be compared against the claude
380
+ # deployment — a report that is about neither.
381
+ # The tool reports and repairs nothing, so it is safe to point at a host mid-work.
382
+ set +e
383
+ out="$("$cli" deploy --check \\
384
+ --harness "$HARNESS" \\
385
+ --agents-dir "$tree/agents" \\
386
+ --skills-dir "$tree/skills" \\
387
+ --hooks-dir "$tree" 2>&1)"
388
+ rc=$?
389
+ set -e
390
+
391
+ # rc 0 IS the tool's verdict that no artifact is stale and none is absent (a foreign
392
+ # artifact is reported by it, and is not a defect). The silence is earned here, and
393
+ # nowhere else — every other exit takes a branch below.
394
+ #
395
+ # IT IS RECORDED ANYWAY, and that is what makes a RETURNING drift audible: drift, then
396
+ # a deploy, then the identical drift again would match a record that still said "drift"
397
+ # and be swallowed. Recording the clean verdict makes the second one a change. Its own
398
+ # result is discarded — a host that has just gone from stale to in-sync gets no all-clear
399
+ # either, because silence-when-clean is unconditional.
400
+ if [ "$rc" -eq 0 ]; then
401
+ changed in-sync || true
402
+ exit 0
403
+ fi
404
+
405
+ # WHICH KIND OF NON-ZERO — asked of the EXIT CODE, which is a contract, and not of
406
+ # the report's wording, which is a format. Drift has a code of its own; everything
407
+ # else that is not success is the check failing to produce a verdict, including the
408
+ # codes this worker was never told about (a crash, a signal, a missing file). The
409
+ # two demand opposite responses: relaying a broken tool as drift fabricates a
410
+ # verdict, and relaying it as silence is the bypass-by-omission this cell exists to
411
+ # end.
412
+ #
413
+ # THE REPORT IS PART OF THE VERDICT, not decoration on it. Two drifts that differ in
414
+ # WHICH doctrine is superseded are two things to be told, so the report's bytes are what
415
+ # the session remembers — a key of "drift" alone would announce the first stale artifact
416
+ # and swallow every one after it.
417
+ if [ "$rc" -eq "$DRIFT_RC" ]; then
418
+ if changed "drift
419
+ $out"; then
420
+ printf '%s\\n' '{{speech:drift}}'
421
+ printf '%s\\n' "$out"
422
+ fi
423
+ else
424
+ if changed "no-verdict $rc
425
+ $out"; then
426
+ printf '{{speech:no-verdict}}\\n' "$cli"
427
+ fi
428
+ fi
429
+ exit 0
430
+ `,
431
+ },
432
+ ],
433
+ };
434
+ //# sourceMappingURL=deploy-drift-notice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-drift-notice.js","sourceRoot":"","sources":["../../src/hooks/deploy-drift-notice.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,kEAAkE;AAClE,EAAE;AACF,oFAAoF;AACpF,qFAAqF;AACrF,gFAAgF;AAChF,sFAAsF;AACtF,0EAA0E;AAC1E,mFAAmF;AACnF,gFAAgF;AAChF,qFAAqF;AACrF,EAAE;AACF,sFAAsF;AACtF,sFAAsF;AACtF,qFAAqF;AACrF,iFAAiF;AACjF,8BAA8B;AAC9B,EAAE;AACF,qFAAqF;AACrF,sFAAsF;AACtF,oFAAoF;AACpF,uFAAuF;AACvF,kFAAkF;AAClF,2BAA2B;AAC3B,EAAE;AACF,sFAAsF;AACtF,oFAAoF;AACpF,kEAAkE;AAClE,EAAE;AACF,mFAAmF;AACnF,oFAAoF;AACpF,kFAAkF;AAClF,kFAAkF;AAClF,oFAAoF;AACpF,oFAAoF;AACpF,qFAAqF;AACrF,+BAA+B;AAC/B,EAAE;AACF,qFAAqF;AACrF,qFAAqF;AACrF,oFAAoF;AACpF,oFAAoF;AACpF,uFAAuF;AACvF,sFAAsF;AACtF,kFAAkF;AAClF,mFAAmF;AACnF,uFAAuF;AACvF,EAAE;AACF,uFAAuF;AACvF,qFAAqF;AACrF,uFAAuF;AACvF,wFAAwF;AACxF,wFAAwF;AACxF,yFAAyF;AACzF,yFAAyF;AACzF,yFAAyF;AACzF,0FAA0F;AAC1F,wFAAwF;AACxF,0BAA0B;AAC1B,EAAE;AACF,sFAAsF;AACtF,mFAAmF;AACnF,yFAAyF;AACzF,oFAAoF;AACpF,uEAAuE;AACvE,EAAE;AACF,mFAAmF;AACnF,8CAA8C;AAC9C,gFAAgF;AAChF,2EAA2E;AAC3E,EAAE;AACF,qFAAqF;AACrF,oFAAoF;AACpF,qFAAqF;AACrF,8BAA8B;AAC9B,gDAAgD;AAChD,gDAAgD;AAChD,oFAAoF;AACpF,6EAA6E;AAC7E,qFAAqF;AACrF,kFAAkF;AAClF,sFAAsF;AACtF,oFAAoF;AACpF,EAAE;AACF,sFAAsF;AACtF,mFAAmF;AACnF,wFAAwF;AACxF,gDAAgD;AAChD,gDAAgD;AAChD,qFAAqF;AACrF,sFAAsF;AACtF,sFAAsF;AACtF,wFAAwF;AACxF,qFAAqF;AACrF,sFAAsF;AACtF,sFAAsF;AACtF,4CAA4C;AAC5C,EAAE;AACF,gFAAgF;AAChF,qFAAqF;AACrF,6EAA6E;AAC7E,uFAAuF;AACvF,iEAAiE;AACjE,EAAE;AACF,qFAAqF;AACrF,iFAAiF;AACjF,mFAAmF;AACnF,iFAAiF;AACjF,EAAE;AACF,sFAAsF;AACtF,+EAA+E;AAC/E,kFAAkF;AAClF,iFAAiF;AACjF,gDAAgD;AAChD,qFAAqF;AACrF,oFAAoF;AACpF,6EAA6E;AAC7E,yEAAyE;AACzE,iFAAiF;AACjF,wEAAwE;AACxE,qFAAqF;AACrF,4EAA4E;AAC5E,qFAAqF;AACrF,gFAAgF;AAChF,gFAAgF;AAChF,kFAAkF;AAClF,mFAAmF;AACnF,kFAAkF;AAClF,mFAAmF;AACnF,kFAAkF;AAClF,EAAE;AACF,oFAAoF;AACpF,iFAAiF;AACjF,sFAAsF;AACtF,2DAA2D;AAC3D,EAAE;AACF,+EAA+E;AAC/E,uFAAuF;AACvF,qFAAqF;AACrF,4EAA4E;AAC5E,oFAAoF;AACpF,oFAAoF;AACpF,6BAA6B;AAE7B,MAAM,CAAC,MAAM,iBAAiB,GAAa;IACzC,EAAE,EAAE,qBAAqB;IACzB,OAAO,EACL,i8BAAi8B;IACn8B,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,KAAK,EAAE,wBAAwB;IAC/B,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,MAAM,EAAE;QACN;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,oVAAoV;SAC3V;QACD;YACE,EAAE,EAAE,YAAY;YAChB,4EAA4E;YAC5E,sEAAsE;YACtE,IAAI,EAAE,qNAAqN;SAC5N;QACD;YACE,EAAE,EAAE,eAAe;YACnB,IAAI,EAAE,sQAAsQ;SAC7Q;KACF;IACD,OAAO,EAAE;QACP;YACE,QAAQ,EAAE,wBAAwB;YAClC,UAAU,EAAE,yDAAyD;YACrE,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiQd;SACI;KACF;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { HookCell } from '../manifest.js';
2
+ export declare const memoryConsolidationNudge: HookCell;
@@ -0,0 +1,148 @@
1
+ // memory-consolidation-nudge — an ADVISORY Stop hook (the harness half of the
2
+ // memory-consolidation protocol). On turn.end (Stop only — NOT SubagentStop), it
3
+ // cheaply counts the agent's unconsolidated EPISODIC records and, over a
4
+ // conservative watermark, prints a non-blocking advisory to run a hot-path dream.
5
+ //
6
+ // WHY THIS EXISTS (the harness half of the memory dimension):
7
+ // Per-turn ENCODE grows the raw EPISODIC log; only /dream folds + drains it. An
8
+ // agent that never dreams accretes an unbounded raw log and loses the
9
+ // consolidation window while context is still hot. This hook is the ambient
10
+ // reminder: it observes the backlog the agent cannot see from inside the turn
11
+ // and surfaces "time to consolidate" — without ever wedging the turn.
12
+ //
13
+ // ADVISORY, NEVER BLOCKING (the load-bearing contract):
14
+ // Unlike stance-guardrail, this hook NEVER emits `{"decision":"block"}`. It
15
+ // prints an advisory line to stdout and exits 0. Memory consolidation is a
16
+ // soft, recoverable duty; blocking a turn on an un-run ritual would wedge real
17
+ // work for no correctness gain. The nudge is intentionally soft.
18
+ //
19
+ // HOME DERIVATION (the Stop-env caveat — flagged, not faked):
20
+ // A top-level Stop hook fires in the harness env and carries NO agent_type
21
+ // (that is a SubagentStop field), so the agent's home is not handed in. The
22
+ // worker derives it best-effort, in order: (1) $CLAUDE_AGENT_HOME override;
23
+ // (2) match the hook JSON's session_id against the memory session registry
24
+ // `~/.agents/*/sessions/<id>.json` (the liveness registry the `memory` tool keeps —
25
+ // the correct derivation whenever wake has registered the session); (3) the sole
26
+ // `~/.agents/*` home when exactly one exists. If none resolves, it exits 0
27
+ // SILENTLY — a KNOWN LIMITATION (no reliable home ⇒ no honest count), never a
28
+ // fabricated count.
29
+ //
30
+ // The `workers[].content` is the TEMPLATE the committed worker at `targetPath`
31
+ // regenerates from — resolved bytes, byte-locked by `test/hook-rule-boundary.test.ts`.
32
+ // EDIT THE CELL AND REGENERATE (`pnpm canon:project:targets`) — never the committed
33
+ // `.sh` alone; a hand-edit drifts the anchor and the byte-lock goes red.
34
+ //
35
+ // THIS CELL ONCE IMPORTED `CLI_BIN` FROM `@cratylus/runtime`, and it was the last
36
+ // breach of ARCHITECTURE's property 1 — meaning and mechanism never reference each
37
+ // other. The rationale on record was that "the worker names it inside a shell string
38
+ // no compiler reads", which is true and beside the point: the import is an edge
39
+ // whether or not a compiler follows the value into the string. The worker now names
40
+ // the FACT it needs (`{{fact:runtime-bin}}`) and the PROJECTOR substitutes; the cell
41
+ // names a capability, never an implementation. `$MEMORY_BIN` stays the override and
42
+ // the test seam; the resolved name is only its DEFAULT.
43
+ //
44
+ // WHAT IT SAYS TO AN AGENT lives in `speech`, not in the shell. Those two strings are
45
+ // the only bytes here that land in a reader's context, so they are the only ones a
46
+ // reader-density gate should score — and they had no declared home until this seam.
47
+ export const memoryConsolidationNudge = {
48
+ id: 'memory-consolidation-nudge',
49
+ residue: 'advisory ↾ turn-end · owed ⇒ emit hot-path-dream advisory ⟨¬block · exit-0 · ¬wedge-turn⟩ · owed ↦ runtime ⟨backlog ∨ store-pressure ∨ scope-drift ; ¬face-computed⟩ · home ↦ $env ∨ runtime(session) ⟨¬derivable ⇒ silent⟩ · fail-open ∀error',
50
+ substrate: 'harness',
51
+ events: ['turn.end'],
52
+ entry: 'memory-consolidation-nudge.sh',
53
+ timeout: 10,
54
+ refs: [],
55
+ speech: [
56
+ {
57
+ id: 'owed',
58
+ text: 'MEMORY — a consolidation is owed (unfolded records, an oversized store, or scope drift). Consider a hot-path /dream to fold, drain and depalimpsest while context is hot.',
59
+ },
60
+ {
61
+ id: 'blind',
62
+ // `%s` is the worker's printf arg for `$MEM` — the bin actually consulted. A
63
+ // BLIND nudge that named no binary would send the reader hunting for which one.
64
+ text: 'MEMORY — the runtime did not answer whether a consolidation is owed (`%s memory audit` failed). The nudge is BLIND until that is fixed; this is not a clear verdict.',
65
+ },
66
+ ],
67
+ workers: [
68
+ {
69
+ filename: 'memory-consolidation-nudge.sh',
70
+ targetPath: 'packages/canon/targets/guardrail/memory-consolidation-nudge.sh',
71
+ executable: true,
72
+ content: `#!/usr/bin/env sh
73
+ # memory-consolidation-nudge — an ADVISORY Stop hook. It asks the memory runtime
74
+ # whether a consolidation is owed and, if so, prints a non-blocking reminder to
75
+ # run a hot-path /dream. It NEVER blocks the turn.
76
+ #
77
+ # WHY (the harness half of the memory dimension): per-turn ENCODE grows the raw
78
+ # EPISODIC log and the prose stores only ever grow; only /dream folds, drains and
79
+ # depalimpsests them. This is the ambient reminder to do it while context is hot.
80
+ #
81
+ # THE FACE ASKS, IT DOES NOT KNOW. Both questions this hook needs — which home
82
+ # owns this session, and whether a dream is owed — are answered by the runtime:
83
+ #
84
+ # memory home --session <id> -> the owning home (registry lookup)
85
+ # memory audit --home <h> --owed -> "owed" | "clear"
86
+ #
87
+ # It previously derived the home by scanning ~/.agents/* and counted the backlog
88
+ # by awk-ing EPISODIC.jsonl. Both made a harness FACE read the being's memory
89
+ # layout, and the second put a second home on the "is a dream owed" predicate —
90
+ # one that measured only raw-record count, so an oversized prose store never
91
+ # raised a signal at all.
92
+ #
93
+ # CONTRACT:
94
+ # - ADVISORY ONLY. Prints to stdout and exits 0. It NEVER emits
95
+ # {"decision":"block"} — a soft, recoverable duty must not wedge a turn.
96
+ # - FAILS OPEN + SILENT. Any error (no runtime, no home, no jq) -> exit 0, no
97
+ # output. A reminder that misfires on its own flakiness is worse than a
98
+ # missed one.
99
+ # - Stop ONLY (turn.end). Registered on subagent.end it would nudge transient
100
+ # sub-turns; the dimension home is the top-level agent's.
101
+ #
102
+ # INPUT : Claude Code Stop hook JSON on stdin (session_id, cwd, ...).
103
+ # OUTPUT : owed -> one advisory line + exit 0; else nothing.
104
+
105
+ set -eu
106
+
107
+ # A Stop hook must never break a session. Any unexpected error -> allow the stop.
108
+ trap 'exit 0' EXIT
109
+
110
+ # The runtime bin. \$MEMORY_BIN is the override and the test seam.
111
+ MEM="\${MEMORY_BIN:-{{fact:runtime-bin}}}"
112
+ command -v "\$MEM" >/dev/null 2>&1 || exit 0
113
+
114
+ input="\$(cat 2>/dev/null || true)"
115
+
116
+ # --- resolve the home: explicit override, else ask the registry ----------------
117
+ home="\${CLAUDE_AGENT_HOME:-}"
118
+ if [ -z "\$home" ]; then
119
+ sid=""
120
+ if command -v jq >/dev/null 2>&1 && [ -n "\$input" ]; then
121
+ sid="\$(printf '%s' "\$input" | jq -r '.session_id // empty' 2>/dev/null || true)"
122
+ fi
123
+ [ -n "\$sid" ] || exit 0
124
+ home="\$("\$MEM" memory home --session "\$sid" 2>/dev/null || true)"
125
+ fi
126
+ [ -n "\$home" ] || exit 0
127
+
128
+ # --- ask whether a dream is owed ------------------------------------------------
129
+ # The verdict and the FAILURE are separated deliberately. Every runtime call here is
130
+ # \`2>/dev/null || true\` so a reminder can never fail a turn — correct, but it made an
131
+ # unreachable runtime yield an EMPTY verdict, which is exactly what "clear" yields. So
132
+ # a broken runtime read as a clean bill of health, silently and forever: the nudge
133
+ # would stop existing and nothing would say so. \`if signal absent then pass\` is a
134
+ # bypass by omission; this inverts it to \`if signal absent then SAY SO\`, while still
135
+ # never blocking.
136
+ if verdict="\$("\$MEM" memory audit --home "\$home" --owed 2>/dev/null)"; then
137
+ if [ "\$verdict" = "owed" ]; then
138
+ printf '{{speech:owed}}\\n'
139
+ fi
140
+ else
141
+ printf '{{speech:blind}}\\n' "\$MEM"
142
+ fi
143
+ exit 0
144
+ `,
145
+ },
146
+ ],
147
+ };
148
+ //# sourceMappingURL=memory-consolidation-nudge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-consolidation-nudge.js","sourceRoot":"","sources":["../../src/hooks/memory-consolidation-nudge.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,iFAAiF;AACjF,yEAAyE;AACzE,kFAAkF;AAClF,EAAE;AACF,8DAA8D;AAC9D,kFAAkF;AAClF,wEAAwE;AACxE,8EAA8E;AAC9E,gFAAgF;AAChF,wEAAwE;AACxE,EAAE;AACF,wDAAwD;AACxD,8EAA8E;AAC9E,6EAA6E;AAC7E,iFAAiF;AACjF,mEAAmE;AACnE,EAAE;AACF,8DAA8D;AAC9D,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,sFAAsF;AACtF,mFAAmF;AACnF,6EAA6E;AAC7E,gFAAgF;AAChF,sBAAsB;AACtB,EAAE;AACF,+EAA+E;AAC/E,uFAAuF;AACvF,oFAAoF;AACpF,yEAAyE;AACzE,EAAE;AACF,kFAAkF;AAClF,mFAAmF;AACnF,qFAAqF;AACrF,gFAAgF;AAChF,oFAAoF;AACpF,qFAAqF;AACrF,oFAAoF;AACpF,wDAAwD;AACxD,EAAE;AACF,sFAAsF;AACtF,mFAAmF;AACnF,oFAAoF;AAEpF,MAAM,CAAC,MAAM,wBAAwB,GAAa;IAChD,EAAE,EAAE,4BAA4B;IAChC,OAAO,EACL,gPAAgP;IAClP,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,CAAC,UAAU,CAAC;IACpB,KAAK,EAAE,+BAA+B;IACtC,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,MAAM,EAAE;QACN;YACE,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,2KAA2K;SAClL;QACD;YACE,EAAE,EAAE,OAAO;YACX,6EAA6E;YAC7E,gFAAgF;YAChF,IAAI,EAAE,sKAAsK;SAC7K;KACF;IACD,OAAO,EAAE;QACP;YACE,QAAQ,EAAE,+BAA+B;YACzC,UAAU,EACR,gEAAgE;YAClE,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEd;SACI;KACF;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { HookCell } from '../manifest.js';
2
+ export declare const praxisContinuity: HookCell;