@a-company/paradigm 5.11.0 → 5.21.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 (408) hide show
  1. package/dist/accept-orchestration-IUAWQZUN.js +18 -0
  2. package/dist/add-P76GEMGF.js +8 -0
  3. package/dist/agent-UUTYOFTH.js +33 -0
  4. package/dist/agent-loader-EPXURMO7.js +2 -0
  5. package/dist/agent-loader-PYGPX6D2.js +2 -0
  6. package/dist/agent-state-KSQ3S7OB.js +2 -0
  7. package/dist/agents-suggest-HYTFMQD3.js +10 -0
  8. package/dist/aggregate-W66DM3GA.js +10 -0
  9. package/dist/ambient-HYZR42NX.js +35 -0
  10. package/dist/assess-UFPYEJKP.js +9 -0
  11. package/dist/auto-RHJXOZFL.js +14 -0
  12. package/dist/beacon-5QVYV5DF.js +13 -0
  13. package/dist/calibration-OLJYB5HN.js +7 -0
  14. package/dist/check-THVGY4R5.js +14 -0
  15. package/dist/chunk-22ISTMKI.js +31 -0
  16. package/dist/chunk-2QO33NYK.js +3 -0
  17. package/dist/chunk-33LKBMVK.js +134 -0
  18. package/dist/chunk-4QADCWPU.js +7 -0
  19. package/dist/chunk-4TXOVRWD.js +3 -0
  20. package/dist/chunk-4UJ4NIEQ.js +4 -0
  21. package/dist/chunk-4ZGGWZ32.js +3 -0
  22. package/dist/chunk-5TAVYPOV.js +2 -0
  23. package/dist/chunk-6EX37L4Q.js +8 -0
  24. package/dist/chunk-AD5TAD2A.js +5 -0
  25. package/dist/chunk-AGVAHVUA.js +2 -0
  26. package/dist/chunk-AO7ZSRME.js +13 -0
  27. package/dist/chunk-BFD3GFRK.js +2 -0
  28. package/dist/chunk-D34YFK4M.js +6 -0
  29. package/dist/chunk-DVZWCXB6.js +2 -0
  30. package/dist/chunk-EKZDFEJW.js +2 -0
  31. package/dist/chunk-ET5XJTSX.js +2 -0
  32. package/dist/chunk-FYDRENK7.js +3 -0
  33. package/dist/chunk-HMQ5BHP2.js +743 -0
  34. package/dist/chunk-HXKWL3VK.js +29 -0
  35. package/dist/chunk-IZSBGW6E.js +2 -0
  36. package/dist/chunk-J32OPJEX.js +2 -0
  37. package/dist/chunk-JBDMCRPP.js +7 -0
  38. package/dist/chunk-JIXHEBGK.js +7 -0
  39. package/dist/chunk-JNSJVCTU.js +2 -0
  40. package/dist/chunk-JQKKVAAN.js +2 -0
  41. package/dist/chunk-KLBH26PA.js +429 -0
  42. package/dist/chunk-L6K5HNDL.js +24 -0
  43. package/dist/chunk-LKAT7IAK.js +2 -0
  44. package/dist/chunk-M4UMM6DC.js +5 -0
  45. package/dist/chunk-NKYNHSA5.js +424 -0
  46. package/dist/chunk-NW6OKHE6.js +5 -0
  47. package/dist/chunk-NXRVR37G.js +60 -0
  48. package/dist/chunk-ODVKPZZ4.js +2 -0
  49. package/dist/chunk-PUBB7LIT.js +5 -0
  50. package/dist/chunk-Q2J542ST.js +2 -0
  51. package/dist/chunk-QGZRM6ZB.js +2 -0
  52. package/dist/chunk-QNZEG7IT.js +13 -0
  53. package/dist/chunk-QT2LKB3P.js +7 -0
  54. package/dist/chunk-RVRARWSY.js +9 -0
  55. package/dist/chunk-T6IDXUUA.js +2 -0
  56. package/dist/chunk-TYWB5IQJ.js +3 -0
  57. package/dist/chunk-UIKLE3WD.js +2 -0
  58. package/dist/chunk-V7K6CQVX.js +111 -0
  59. package/dist/chunk-VCKKJDLP.js +8 -0
  60. package/dist/chunk-VG7FN2TU.js +4 -0
  61. package/dist/chunk-W5IWDW4Y.js +16 -0
  62. package/dist/chunk-W7C6FFMO.js +8 -0
  63. package/dist/chunk-WESTEMIM.js +10 -0
  64. package/dist/chunk-WR6D3SC6.js +5 -0
  65. package/dist/chunk-WS2N27RX.js +3 -0
  66. package/dist/chunk-XMAV5AG6.js +2 -0
  67. package/dist/chunk-XROULIQN.js +2 -0
  68. package/dist/chunk-XUFYOXOU.js +3 -0
  69. package/dist/chunk-Y4XFVDZC.js +3 -0
  70. package/dist/chunk-Y6KXTQBG.js +2 -0
  71. package/dist/{chunk-GTR2TBIJ.js → chunk-Z2UZUCY6.js} +237 -1047
  72. package/dist/chunk-Z34K6GY2.js +8 -0
  73. package/dist/claude-4LR3LJQZ.js +13 -0
  74. package/dist/claude-cli-UP6HGH7C.js +6 -0
  75. package/dist/claude-code-RLJ4GX77.js +11 -0
  76. package/dist/claude-code-teams-R37HJY3Y.js +29 -0
  77. package/dist/commands-LMUD5L6R.js +455 -0
  78. package/dist/compliance-GZ7UAOG3.js +6 -0
  79. package/dist/conductor-Y5IXELTL.js +4 -0
  80. package/dist/config-schema-HR7LDEQ6.js +2 -0
  81. package/dist/constellation-CG7C4WFE.js +13 -0
  82. package/dist/context-audit-RSSRX6XC.js +6 -0
  83. package/dist/cost-IDNVMAEV.js +10 -0
  84. package/dist/cost-PK4KIF7R.js +2 -0
  85. package/dist/cursor-cli-QKF7Z6M2.js +4 -0
  86. package/dist/cursorrules-U5O4G5T4.js +14 -0
  87. package/dist/decision-loader-2XPZE4EZ.js +2 -0
  88. package/dist/delete-P5VULXR4.js +14 -0
  89. package/dist/diff-RTFUKJHF.js +9 -0
  90. package/dist/discipline-H7LDI6NT.js +2 -0
  91. package/dist/dist-3ZCH25SG.js +2 -0
  92. package/dist/dist-KGRCLBJP-2QAPFYNF.js +39 -0
  93. package/dist/dist-R3RWD35F.js +2 -0
  94. package/dist/dist-VGFSP3XM.js +2 -0
  95. package/dist/dist-VXCZWVVJ.js +2 -0
  96. package/dist/dist-W3XCATBJ.js +2 -0
  97. package/dist/docs-EDQ2STFK.js +2 -0
  98. package/dist/docs-RXPN6CK7.js +12 -0
  99. package/dist/doctor-2T2QL6VM.js +2 -0
  100. package/dist/drift-ILZE5BFJ.js +13 -0
  101. package/dist/echo-UPTQUEDU.js +46 -0
  102. package/dist/edit-GUU3HBVW.js +9 -0
  103. package/dist/event-Y3VXC2RV.js +3 -0
  104. package/dist/explain-files-3GPZUETV.js +4 -0
  105. package/dist/export-CV5KCTPS.js +2 -0
  106. package/dist/flow-S3RQ4YPY.js +11 -0
  107. package/dist/global-C44FW4G2.js +13 -0
  108. package/dist/graduate-3BBSC27A.js +5 -0
  109. package/dist/graph-CNDE5TAT.js +2 -0
  110. package/dist/graph-server-COZR5C3Z.js +14 -0
  111. package/dist/habits-4J2KRYUL.js +42 -0
  112. package/dist/history-UW454SDP.js +12 -0
  113. package/dist/hooks-XH52VGOU.js +2 -0
  114. package/dist/index.js +15 -1039
  115. package/dist/init-24MAQJFM.js +2 -0
  116. package/dist/integrity-UYDOOJDP.js +7 -0
  117. package/dist/integrity-checker-DHGMZQDG.js +2 -0
  118. package/dist/journal-loader-GLH7XFTK.js +2 -0
  119. package/dist/lint-IGKE6UPS.js +26 -0
  120. package/dist/list-5IUGP3ZB.js +7 -0
  121. package/dist/list-YKIQNKGB.js +6 -0
  122. package/dist/lore-loader-RVQI5GXL.js +2 -0
  123. package/dist/lore-loader-XY5MZRR2.js +2 -0
  124. package/dist/lore-server-FC2GMDLT.js +14 -0
  125. package/dist/manual-RXSPSFLL.js +20 -0
  126. package/dist/mcp.js +93 -20529
  127. package/dist/migrate-X5OMAFAQ.js +59 -0
  128. package/dist/migrate-assessments-GEI5WMI2.js +4 -0
  129. package/dist/model-discovery-HMB3YI4L.js +2 -0
  130. package/dist/nomination-engine-XF7TWPAP.js +2 -0
  131. package/dist/notebook-PE3JSYZI.js +11 -0
  132. package/dist/notebook-loader-CENTDDUJ.js +2 -0
  133. package/dist/orchestrate-35HBQ3O3.js +8 -0
  134. package/dist/peers-P2KXU7ZK.js +5 -0
  135. package/dist/persona-STQWZH5P.js +29 -0
  136. package/dist/pipeline-MZUITRVN.js +4 -0
  137. package/dist/platform-server-2KXHGHFV.js +25 -0
  138. package/dist/plugin-update-checker-M7PW434O.js +2 -0
  139. package/dist/portal-check-3JVNLOEP.js +8 -0
  140. package/dist/portal-compliance-2UG4VKWH.js +2 -0
  141. package/dist/probe-5L5BQDGE.js +6 -0
  142. package/dist/project-type-SURTOIG7.js +2 -0
  143. package/dist/promote-NJQDZBZA.js +8 -0
  144. package/dist/providers-4PXMWA7V.js +8 -0
  145. package/dist/quiz-FE5UGAY2.js +10 -0
  146. package/dist/record-YXPB34MY.js +6 -0
  147. package/dist/reindex-PGDQSM42.js +2 -0
  148. package/dist/remember-MJRNTXYS.js +14 -0
  149. package/dist/retag-N5XF3KXP.js +6 -0
  150. package/dist/review-6UAH6V3R.js +11 -0
  151. package/dist/review-77QI6VOC.js +6 -0
  152. package/dist/ripple-ZGDITCGB.js +10 -0
  153. package/dist/roster-FLRZ5J42.js +2 -0
  154. package/dist/sentinel-HYAZ3CO5.js +19 -0
  155. package/dist/sentinel-bridge-VR357PKL.js +2 -0
  156. package/dist/sentinel-mcp.js +38 -3808
  157. package/dist/sentinel.js +1 -34
  158. package/dist/serve-JE6UF5P2.js +8 -0
  159. package/dist/serve-L52ZUTU6.js +10 -0
  160. package/dist/serve-OY6XYL7F.js +12 -0
  161. package/dist/server-2MNROHF6.js +7 -0
  162. package/dist/server-4YNUIK4W.js +8 -0
  163. package/dist/session-tracker-SKOMBDOW.js +2 -0
  164. package/dist/session-work-log-3MNUDEZ6.js +2 -0
  165. package/dist/session-work-log-J2H5OZBR.js +2 -0
  166. package/dist/setup-3F5IK7MO.js +31 -0
  167. package/dist/setup-KPIMRZ4Q.js +2 -0
  168. package/dist/shift-6GCNH666.js +11 -0
  169. package/dist/show-BOAVWZPZ.js +7 -0
  170. package/dist/show-PJ5LFLIL.js +5 -0
  171. package/dist/snapshot-L2G56RPL.js +8 -0
  172. package/dist/spawn-UH5RENSE.js +12 -0
  173. package/dist/status-77M3SDIF.js +8 -0
  174. package/dist/status-A37ECYNJ.js +6 -0
  175. package/dist/summary-ZJLQ6KHB.js +7 -0
  176. package/dist/sweep-HU74OPVW.js +17 -0
  177. package/dist/switch-CTW4PDGI.js +17 -0
  178. package/dist/symphony-3QMBGCZY.js +2 -0
  179. package/dist/symphony-QI63XL62.js +53 -0
  180. package/dist/symphony-loader-XACVV2E3.js +2 -0
  181. package/dist/symphony-peers-U4KHMKGI.js +2 -0
  182. package/dist/symphony-peers-X5NGWXFP.js +2 -0
  183. package/dist/symphony-relay-5GY5JIPT.js +3 -0
  184. package/dist/sync-QRDSFETO.js +2 -0
  185. package/dist/sync-llms-HL5PPW3M.js +15 -0
  186. package/dist/task-loader-NZFDTUQ5.js +2 -0
  187. package/dist/team-WGERKGNP.js +2 -0
  188. package/dist/test-BQJMS4Y2.js +111 -0
  189. package/dist/thread-HFXK65D4.js +41 -0
  190. package/dist/timeline-K3ZFKJ3R.js +6 -0
  191. package/dist/triage-FCWOZASE.js +18 -0
  192. package/dist/tutorial-UC6YQMNN.js +305 -0
  193. package/dist/university-content/courses/.purpose +74 -5
  194. package/dist/university-content/plsat/.purpose +3 -2
  195. package/dist/university-ui/assets/{index-BjewBB6s.js → index-CGFJczb1.js} +2 -2
  196. package/dist/university-ui/assets/{index-BjewBB6s.js.map → index-CGFJczb1.js.map} +1 -1
  197. package/dist/university-ui/index.html +1 -1
  198. package/dist/upgrade-B4IOLZYK.js +53 -0
  199. package/dist/validate-C6SMKGYD.js +9 -0
  200. package/dist/validate-LSCDOLBO.js +13 -0
  201. package/dist/validate-VZXTJHGO.js +6 -0
  202. package/dist/watch-LRM5XD46.js +8 -0
  203. package/dist/watch-PZCCUP6K.js +9 -0
  204. package/dist/wisdom-XZ3QKPNP.js +7 -0
  205. package/dist/work-log-loader-DL5GZ2BQ.js +2 -0
  206. package/dist/workspace-2ODL5WLY.js +2 -0
  207. package/package.json +1 -1
  208. package/platform-ui/dist/assets/AmbientSection-DqQ2mfCO.js +1 -0
  209. package/platform-ui/dist/assets/{CanvasSection-DwPTRdIN.js → CanvasSection-DLW0s-Bu.js} +1 -1
  210. package/platform-ui/dist/assets/{DocsSection-BJc_ws4I.js → DocsSection-BQ9Hi51g.js} +1 -1
  211. package/platform-ui/dist/assets/{GitSection-DhqBo1xc.js → GitSection-QQeUX6o3.js} +1 -1
  212. package/platform-ui/dist/assets/{GraphSection-D9fhVnZ0.js → GraphSection-0c9C-w7K.js} +2 -2
  213. package/platform-ui/dist/assets/{GraphSection-BlgXTl53.css → GraphSection-Bbs2a8sC.css} +1 -1
  214. package/platform-ui/dist/assets/LoreSection--t56kCj2.js +1 -0
  215. package/platform-ui/dist/assets/LoreSection-qnmm3o4y.css +1 -0
  216. package/platform-ui/dist/assets/SentinelSection-C4OoME9U.js +1 -0
  217. package/platform-ui/dist/assets/{SymphonySection-BRoBaUSS.js → SymphonySection-B-rvsLxq.js} +1 -1
  218. package/platform-ui/dist/assets/TeamSection-CBFmNEEo.js +1 -0
  219. package/platform-ui/dist/assets/index-Bxp0TVaf.css +1 -0
  220. package/platform-ui/dist/assets/index-DPpOdAtC.js +57 -0
  221. package/platform-ui/dist/index.html +2 -2
  222. package/dist/accept-orchestration-UQLM7PTQ.js +0 -189
  223. package/dist/add-FZRKEGH4.js +0 -81
  224. package/dist/agent-WERIO2XV.js +0 -523
  225. package/dist/agent-loader-TFIANSF4.js +0 -44
  226. package/dist/agent-state-S5DAWPTF.js +0 -24
  227. package/dist/agents-suggest-DNSYJ6IA.js +0 -83
  228. package/dist/aggregate-H57K7PNV.js +0 -88
  229. package/dist/assess-4WVXZLZQ.js +0 -68
  230. package/dist/auto-QFS5NHQU.js +0 -504
  231. package/dist/beacon-KXZXYQHX.js +0 -251
  232. package/dist/calibration-V46G7JTY.js +0 -135
  233. package/dist/check-OWAIWV23.js +0 -175
  234. package/dist/chunk-2IO7JAG2.js +0 -148
  235. package/dist/chunk-2T6BTYBN.js +0 -712
  236. package/dist/chunk-36TKPM5Z.js +0 -400
  237. package/dist/chunk-45MUDW6E.js +0 -804
  238. package/dist/chunk-4BLYIB7J.js +0 -5701
  239. package/dist/chunk-4L3UTYQX.js +0 -677
  240. package/dist/chunk-4NCFWYGG.js +0 -110
  241. package/dist/chunk-54LTTQBH.js +0 -138
  242. package/dist/chunk-5EWAQHFY.js +0 -269
  243. package/dist/chunk-5JGJACDU.js +0 -37
  244. package/dist/chunk-5OUOLN6M.js +0 -659
  245. package/dist/chunk-5VKJBNJL.js +0 -444
  246. package/dist/chunk-6N3JTACN.js +0 -2260
  247. package/dist/chunk-6QC3YGB6.js +0 -114
  248. package/dist/chunk-7N7GSU6K.js +0 -34
  249. package/dist/chunk-ABVQGRF7.js +0 -268
  250. package/dist/chunk-CL7JSK52.js +0 -129
  251. package/dist/chunk-CSD7IHSN.js +0 -152
  252. package/dist/chunk-EDOAWN7J.js +0 -717
  253. package/dist/chunk-EKGMAM62.js +0 -525
  254. package/dist/chunk-EZ3GOCYC.js +0 -132
  255. package/dist/chunk-F3BCHPYT.js +0 -143
  256. package/dist/chunk-FKJUBQU3.js +0 -3081
  257. package/dist/chunk-GT5QGC2H.js +0 -253
  258. package/dist/chunk-GZDFVP2N.js +0 -540
  259. package/dist/chunk-IRKUEJVW.js +0 -405
  260. package/dist/chunk-J2JEQRT3.js +0 -164
  261. package/dist/chunk-JASGXLK3.js +0 -679
  262. package/dist/chunk-KVDYJLTC.js +0 -121
  263. package/dist/chunk-L27I3CPZ.js +0 -357
  264. package/dist/chunk-LHLIAYQ3.js +0 -185
  265. package/dist/chunk-MCMOGQMU.js +0 -145
  266. package/dist/chunk-NQKQG45G.js +0 -688
  267. package/dist/chunk-PBHIFAL4.js +0 -259
  268. package/dist/chunk-PDX44BCA.js +0 -11
  269. package/dist/chunk-PMXRGPRQ.js +0 -305
  270. package/dist/chunk-RAB5IKPR.js +0 -487
  271. package/dist/chunk-RJE5G7WO.js +0 -590
  272. package/dist/chunk-RTHA3XRE.js +0 -880
  273. package/dist/chunk-S2HO5MLR.js +0 -621
  274. package/dist/chunk-S3ORKP3V.js +0 -716
  275. package/dist/chunk-TAIJOFOE.js +0 -124
  276. package/dist/chunk-TXESEO7Y.js +0 -245
  277. package/dist/chunk-UPLDI7CN.js +0 -1334
  278. package/dist/chunk-VL67H5IC.js +0 -506
  279. package/dist/chunk-VPPK3SY4.js +0 -1136
  280. package/dist/chunk-YMDLDELF.js +0 -314
  281. package/dist/chunk-YO6DVTL7.js +0 -99
  282. package/dist/chunk-YRZ5RPEB.js +0 -1561
  283. package/dist/chunk-ZDHLG5VP.js +0 -5676
  284. package/dist/chunk-ZGUAAVMA.js +0 -756
  285. package/dist/chunk-ZSYVKSY6.js +0 -2602
  286. package/dist/claude-FRRWJSTJ.js +0 -362
  287. package/dist/claude-cli-XJLK2X4L.js +0 -276
  288. package/dist/claude-code-HTBA4XRB.js +0 -126
  289. package/dist/claude-code-teams-T4SP24MD.js +0 -199
  290. package/dist/commands-5N4ILTPH.js +0 -5859
  291. package/dist/conductor-CQVGTEQN.js +0 -161
  292. package/dist/config-schema-EA4XALGG.js +0 -154
  293. package/dist/constellation-A26CCGQS.js +0 -225
  294. package/dist/context-audit-RLO3ETRP.js +0 -682
  295. package/dist/cost-BGM32XJU.js +0 -93
  296. package/dist/cost-VI46A4XL.js +0 -174
  297. package/dist/cursor-cli-JVEZGHWQ.js +0 -269
  298. package/dist/cursorrules-HLIKJJZT.js +0 -84
  299. package/dist/decision-loader-WWCLIQPJ.js +0 -20
  300. package/dist/delete-KBRPQLPC.js +0 -56
  301. package/dist/diff-D4X53HAC.js +0 -126
  302. package/dist/discipline-FA4OZXIS.js +0 -24
  303. package/dist/dist-34NA5RS5.js +0 -74
  304. package/dist/dist-5QE2BB2B-5S3T6Y3T.js +0 -6919
  305. package/dist/dist-77JDTVAY.js +0 -62
  306. package/dist/dist-OGTSAZ55.js +0 -1358
  307. package/dist/dist-QK4SQAK7.js +0 -64
  308. package/dist/dist-TA6LSC2Q.js +0 -20
  309. package/dist/docs-PBZB7LYP.js +0 -89
  310. package/dist/docs-QIYKO3BR.js +0 -155
  311. package/dist/doctor-ULBOHEIC.js +0 -11
  312. package/dist/drift-R5NRKFHI.js +0 -251
  313. package/dist/echo-O2LY7CC2.js +0 -248
  314. package/dist/edit-R2HNLMOG.js +0 -63
  315. package/dist/event-25OJKDCE.js +0 -31
  316. package/dist/export-IWVL7XLF.js +0 -38
  317. package/dist/flow-CRRVV3O3.js +0 -185
  318. package/dist/global-3NG5JXUB.js +0 -136
  319. package/dist/graduate-USAWGBJM.js +0 -160
  320. package/dist/graph-VHUMAAS6.js +0 -12
  321. package/dist/graph-server-YL22VBBN.js +0 -116
  322. package/dist/habits-OL5NGPXO.js +0 -1405
  323. package/dist/history-WOWC573W.js +0 -277
  324. package/dist/hooks-HFWSCGPV.js +0 -12
  325. package/dist/integrity-IHO4FZTS.js +0 -194
  326. package/dist/integrity-checker-PSKJA5SB.js +0 -12
  327. package/dist/journal-loader-5EYSBFFY.js +0 -18
  328. package/dist/lint-K6CJGGPH.js +0 -456
  329. package/dist/list-4YK7QKFF.js +0 -57
  330. package/dist/list-ENR7Q4CR.js +0 -56
  331. package/dist/lore-loader-7NO6N6FT.js +0 -26
  332. package/dist/lore-server-UNJY5KC3.js +0 -118
  333. package/dist/manual-G6FISID5.js +0 -204
  334. package/dist/migrate-LS45DNEV.js +0 -889
  335. package/dist/migrate-assessments-RGH4O6IX.js +0 -97
  336. package/dist/model-discovery-D2H3VBGC.js +0 -8
  337. package/dist/nomination-engine-RV5CNO5B.js +0 -42
  338. package/dist/notebook-YWIYGEHV.js +0 -155
  339. package/dist/orchestrate-JLILBBJE.js +0 -324
  340. package/dist/peers-DEOUIZM6.js +0 -82
  341. package/dist/persona-UHAHIVST.js +0 -390
  342. package/dist/pipeline-L4HCSBGN.js +0 -263
  343. package/dist/platform-server-H5YO3DQD.js +0 -1475
  344. package/dist/plugin-update-checker-KRRSGXMV.js +0 -12
  345. package/dist/portal-check-NPYGII2D.js +0 -42
  346. package/dist/portal-compliance-J7DGAPFX.js +0 -18
  347. package/dist/probe-MHL5HQZ2.js +0 -167
  348. package/dist/promote-F6ZYZZAL.js +0 -182
  349. package/dist/providers-GK7PB2OL.js +0 -104
  350. package/dist/quiz-M66SC7F7.js +0 -99
  351. package/dist/record-RA4WR2BO.js +0 -49
  352. package/dist/reindex-5LTD53ZC.js +0 -16
  353. package/dist/remember-HBWJ655S.js +0 -77
  354. package/dist/retag-3OLCVDEQ.js +0 -62
  355. package/dist/review-27ATYTD2.js +0 -33
  356. package/dist/review-57QMURZV.js +0 -334
  357. package/dist/ripple-JPBXP5I3.js +0 -215
  358. package/dist/sentinel-4XIG4STA.js +0 -63
  359. package/dist/sentinel-bridge-MDUXTQRL.js +0 -109
  360. package/dist/serve-CAH3PHE7.js +0 -33
  361. package/dist/serve-INL7SNBK.js +0 -36
  362. package/dist/serve-KBSE36PL.js +0 -49
  363. package/dist/server-54SKYFFY.js +0 -1647
  364. package/dist/server-XUOIO7E6.js +0 -338
  365. package/dist/session-tracker-C4BMD5WG.js +0 -13
  366. package/dist/session-work-log-MZ47OAPB.js +0 -20
  367. package/dist/setup-EDS27WUR.js +0 -25
  368. package/dist/setup-KO5AFC4K.js +0 -296
  369. package/dist/shift-D2JOHHBF.js +0 -668
  370. package/dist/show-5PV5KFJE.js +0 -176
  371. package/dist/show-NQKYX6WQ.js +0 -82
  372. package/dist/snapshot-BK4RBPCG.js +0 -62
  373. package/dist/spawn-RCHNXDHE.js +0 -196
  374. package/dist/status-WGIAQODY.js +0 -71
  375. package/dist/summary-NIRABMF5.js +0 -140
  376. package/dist/sweep-QMHNSIY5.js +0 -934
  377. package/dist/switch-6EJPZDIA.js +0 -232
  378. package/dist/symphony-4OCY36AI.js +0 -791
  379. package/dist/symphony-B75X2MME.js +0 -326
  380. package/dist/symphony-loader-UZGON56V.js +0 -90
  381. package/dist/symphony-peers-2ZQYLRNI.js +0 -34
  382. package/dist/symphony-peers-OL7F6M5S.js +0 -121
  383. package/dist/symphony-relay-UJYUXN65.js +0 -710
  384. package/dist/sync-VEHUH4OA.js +0 -11
  385. package/dist/sync-llms-YHCFIE6X.js +0 -166
  386. package/dist/task-loader-LDYWQSLM.js +0 -20
  387. package/dist/team-O5MIIFMA.js +0 -34
  388. package/dist/test-566CP5KC.js +0 -1017
  389. package/dist/thread-N754I4D5.js +0 -274
  390. package/dist/timeline-M3CICQFE.js +0 -112
  391. package/dist/triage-HHYGT3HY.js +0 -671
  392. package/dist/tutorial-KD22SUNO.js +0 -666
  393. package/dist/upgrade-H5PF32BW.js +0 -551
  394. package/dist/validate-CNKEKO6A.js +0 -134
  395. package/dist/validate-MB5ULIHS.js +0 -39
  396. package/dist/validate-QH3LADM6.js +0 -64
  397. package/dist/watch-2TKP5PVL.js +0 -199
  398. package/dist/watch-ZF4ML6CD.js +0 -111
  399. package/dist/wisdom-AATMGNFA.js +0 -319
  400. package/dist/work-log-loader-5L45XNYZ.js +0 -14
  401. package/dist/workspace-6E6OSRNU.js +0 -21
  402. package/platform-ui/dist/assets/AmbientSection-WtHfNedO.js +0 -1
  403. package/platform-ui/dist/assets/LoreSection-C3EixkjW.css +0 -1
  404. package/platform-ui/dist/assets/LoreSection-CwDDHrz9.js +0 -1
  405. package/platform-ui/dist/assets/SentinelSection-Cl7e5oZ6.js +0 -1
  406. package/platform-ui/dist/assets/TeamSection-CqSIMrKz.js +0 -1
  407. package/platform-ui/dist/assets/index-CfpZFjea.css +0 -1
  408. package/platform-ui/dist/assets/index-F0KL9xrN.js +0 -57
@@ -1,1405 +0,0 @@
1
- #!/usr/bin/env node
2
- import "./chunk-PDX44BCA.js";
3
-
4
- // src/commands/habits/index.ts
5
- import * as fs2 from "fs";
6
- import * as path3 from "path";
7
- import { execSync } from "child_process";
8
- import chalk from "chalk";
9
- import * as yaml2 from "js-yaml";
10
-
11
- // src/core/habits/loader.ts
12
- import * as fs from "fs";
13
- import * as path from "path";
14
- import * as yaml from "js-yaml";
15
-
16
- // src/core/habits/seed-habits.json
17
- var seed_habits_default = [
18
- {
19
- id: "explore-before-implement",
20
- name: "Explore Before Implementing",
21
- description: "Call ripple/navigate/search before modifying existing symbols to understand impact",
22
- category: "discovery",
23
- trigger: "preflight",
24
- severity: "advisory",
25
- check: {
26
- type: "tool-called",
27
- params: {
28
- tools: ["paradigm_ripple", "paradigm_navigate", "paradigm_search", "paradigm_related"]
29
- }
30
- },
31
- enabled: true
32
- },
33
- {
34
- id: "ripple-before-modify",
35
- name: "Ripple Before Modifying",
36
- description: "Run ripple analysis before modifying symbols with dependents",
37
- category: "discovery",
38
- trigger: "preflight",
39
- severity: "advisory",
40
- check: {
41
- type: "tool-called",
42
- params: {
43
- tools: ["paradigm_ripple"]
44
- }
45
- },
46
- enabled: true
47
- },
48
- {
49
- id: "check-fragility",
50
- name: "Check Fragility",
51
- description: "Check history fragility for symbols before modifying frequently-broken code",
52
- category: "discovery",
53
- trigger: "preflight",
54
- severity: "advisory",
55
- check: {
56
- type: "tool-called",
57
- params: {
58
- tools: ["paradigm_history_fragility"]
59
- }
60
- },
61
- enabled: true
62
- },
63
- {
64
- id: "wisdom-before-implement",
65
- name: "Check Team Wisdom",
66
- description: "Check team wisdom (preferences, antipatterns, decisions) before implementing",
67
- category: "collaboration",
68
- trigger: "preflight",
69
- severity: "advisory",
70
- check: {
71
- type: "tool-called",
72
- params: {
73
- tools: ["paradigm_wisdom_context", "paradigm_wisdom_expert"]
74
- }
75
- },
76
- enabled: true
77
- },
78
- {
79
- id: "verify-before-done",
80
- name: "Verify Before Done",
81
- description: "Run postflight compliance checks before finishing a session",
82
- category: "verification",
83
- trigger: "on-stop",
84
- severity: "warn",
85
- check: {
86
- type: "tool-called",
87
- params: {
88
- tools: ["paradigm_pm_postflight"]
89
- }
90
- },
91
- enabled: true
92
- },
93
- {
94
- id: "postflight-compliance",
95
- name: "Postflight Compliance",
96
- description: "Ensure postflight checks pass without errors before finishing",
97
- category: "verification",
98
- trigger: "on-stop",
99
- severity: "advisory",
100
- check: {
101
- type: "tool-called",
102
- params: {
103
- tools: ["paradigm_pm_postflight", "paradigm_reindex"]
104
- }
105
- },
106
- enabled: true
107
- },
108
- {
109
- id: "test-new-components",
110
- name: "Test New Components",
111
- description: "New components should have associated tests or test plan documented",
112
- category: "testing",
113
- trigger: "postflight",
114
- severity: "advisory",
115
- check: {
116
- type: "tests-exist",
117
- params: {
118
- patterns: ["**/*.test.*", "**/*.spec.*", "**/tests/**"]
119
- }
120
- },
121
- enabled: true
122
- },
123
- {
124
- id: "purpose-coverage",
125
- name: "Purpose File Coverage",
126
- description: "All modified source directories should have .purpose file coverage",
127
- category: "documentation",
128
- trigger: "postflight",
129
- severity: "warn",
130
- check: {
131
- type: "file-exists",
132
- params: {
133
- patterns: ["**/.purpose"]
134
- }
135
- },
136
- enabled: true
137
- },
138
- {
139
- id: "record-lore-for-significant",
140
- name: "Record Lore for Significant Changes",
141
- description: "Sessions modifying 3+ files should record a lore entry",
142
- category: "documentation",
143
- trigger: "on-stop",
144
- severity: "warn",
145
- check: {
146
- type: "lore-recorded",
147
- params: {}
148
- },
149
- enabled: true
150
- },
151
- {
152
- id: "gates-for-routes",
153
- name: "Gates for Routes",
154
- description: "API routes should have corresponding gate declarations in portal.yaml",
155
- category: "security",
156
- trigger: "postflight",
157
- severity: "warn",
158
- check: {
159
- type: "gates-declared",
160
- params: {
161
- requireRoutes: true
162
- }
163
- },
164
- enabled: true
165
- },
166
- {
167
- id: "commit-message-symbols",
168
- name: "Commit Message Format",
169
- description: "Commit messages should follow type(#symbol): format and include a Symbols: trailer",
170
- category: "documentation",
171
- trigger: "on-commit",
172
- severity: "advisory",
173
- check: {
174
- type: "commit-message-format",
175
- params: {
176
- messagePatterns: ["^(feat|fix|refactor|chore|docs|test|style|perf|ci|build)\\(", "Symbols:"]
177
- }
178
- },
179
- enabled: true
180
- },
181
- {
182
- id: "flow-coverage-for-multi-component",
183
- name: "Flow Coverage",
184
- description: "Changes spanning 3+ components should have a documented $flow",
185
- category: "documentation",
186
- trigger: "postflight",
187
- severity: "advisory",
188
- check: {
189
- type: "flow-coverage",
190
- params: {
191
- minSteps: 3
192
- }
193
- },
194
- enabled: true
195
- },
196
- {
197
- id: "context-session-awareness",
198
- name: "Context Awareness",
199
- description: "Use session recovery or context check tools for session continuity",
200
- category: "discovery",
201
- trigger: "preflight",
202
- severity: "advisory",
203
- check: {
204
- type: "context-checked",
205
- params: {
206
- contextTools: ["paradigm_context_check", "paradigm_session_recover", "paradigm_session_checkpoint"]
207
- }
208
- },
209
- enabled: true
210
- },
211
- {
212
- id: "aspect-anchors-valid",
213
- name: "Aspect Anchors Valid",
214
- description: "Aspects touched during the session should have their code anchors validated",
215
- category: "verification",
216
- trigger: "postflight",
217
- severity: "advisory",
218
- check: {
219
- type: "aspect-anchored",
220
- params: {
221
- checkAnchors: true
222
- }
223
- },
224
- enabled: true
225
- }
226
- ];
227
-
228
- // src/core/habits/loader.ts
229
- var SEED_HABITS = seed_habits_default;
230
- var DEFAULT_HABITS_CACHE_TTL_MS = 30 * 1e3;
231
- function getHabitsCacheTtl(rootDir) {
232
- try {
233
- const configPath = path.join(rootDir, ".paradigm", "config.yaml");
234
- if (fs.existsSync(configPath)) {
235
- const content = fs.readFileSync(configPath, "utf8");
236
- const config = yaml.load(content);
237
- const limits = config?.limits;
238
- if (limits?.habitsCacheTtlMs && typeof limits.habitsCacheTtlMs === "number") {
239
- return limits.habitsCacheTtlMs;
240
- }
241
- }
242
- } catch {
243
- }
244
- return DEFAULT_HABITS_CACHE_TTL_MS;
245
- }
246
- var habitsCache = /* @__PURE__ */ new Map();
247
- function loadHabits(rootDir) {
248
- const absoluteRoot = path.resolve(rootDir);
249
- const cached = habitsCache.get(absoluteRoot);
250
- const ttl = getHabitsCacheTtl(absoluteRoot);
251
- if (cached && Date.now() - cached.loadedAt < ttl) {
252
- return cached.habits;
253
- }
254
- const habits = loadHabitsFresh(absoluteRoot);
255
- habitsCache.set(absoluteRoot, {
256
- habits,
257
- loadedAt: Date.now()
258
- });
259
- return habits;
260
- }
261
- function loadHabitsFresh(rootDir) {
262
- const habitsById = /* @__PURE__ */ new Map();
263
- for (const seed of SEED_HABITS) {
264
- habitsById.set(seed.id, { ...seed });
265
- }
266
- const home = process.env.HOME || process.env.USERPROFILE || "~";
267
- const globalConfig = loadHabitsYaml(path.join(home, ".paradigm", "habits.yaml"));
268
- if (globalConfig) {
269
- mergeHabits(habitsById, globalConfig);
270
- }
271
- const globalHabitFiles = loadHabitFiles(path.join(home, ".paradigm", "habits"));
272
- for (const habit of globalHabitFiles) {
273
- habitsById.set(habit.id, habit);
274
- }
275
- const projectConfig = loadHabitsYaml(path.join(rootDir, ".paradigm", "habits.yaml"));
276
- if (projectConfig) {
277
- mergeHabits(habitsById, projectConfig);
278
- }
279
- const projectHabitFiles = loadHabitFiles(path.join(rootDir, ".paradigm", "habits"));
280
- for (const habit of projectHabitFiles) {
281
- habitsById.set(habit.id, habit);
282
- }
283
- return Array.from(habitsById.values());
284
- }
285
- function loadHabitFiles(dir) {
286
- if (!fs.existsSync(dir)) return [];
287
- try {
288
- const files = fs.readdirSync(dir).filter((f) => f.endsWith(".habit")).sort();
289
- const habits = [];
290
- for (const file of files) {
291
- try {
292
- const content = fs.readFileSync(path.join(dir, file), "utf8");
293
- const habit = yaml.load(content);
294
- if (habit?.id && habit?.name) {
295
- habits.push(habit);
296
- }
297
- } catch {
298
- }
299
- }
300
- return habits;
301
- } catch {
302
- return [];
303
- }
304
- }
305
- function loadHabitsYaml(filePath) {
306
- if (!fs.existsSync(filePath)) {
307
- return null;
308
- }
309
- try {
310
- const content = fs.readFileSync(filePath, "utf8");
311
- return yaml.load(content);
312
- } catch {
313
- return null;
314
- }
315
- }
316
- function mergeHabits(habitsById, config) {
317
- if (config.habits) {
318
- for (const habit of config.habits) {
319
- habitsById.set(habit.id, { ...habit });
320
- }
321
- }
322
- if (config.overrides) {
323
- for (const [habitId, override] of Object.entries(config.overrides)) {
324
- const existing = habitsById.get(habitId);
325
- if (existing) {
326
- applyOverride(existing, override);
327
- }
328
- }
329
- }
330
- }
331
- function applyOverride(habit, override) {
332
- if (override.severity !== void 0) {
333
- habit.severity = override.severity;
334
- }
335
- if (override.enabled !== void 0) {
336
- habit.enabled = override.enabled;
337
- }
338
- }
339
- function getHabitsByTrigger(habits, trigger) {
340
- return habits.filter((h) => h.enabled && h.trigger === trigger);
341
- }
342
- function getEnabledHabits(habits) {
343
- return habits.filter((h) => h.enabled);
344
- }
345
- function invalidateHabitsCache(rootDir) {
346
- const absoluteRoot = path.resolve(rootDir);
347
- habitsCache.delete(absoluteRoot);
348
- }
349
-
350
- // src/core/habits/evaluator.ts
351
- import * as path2 from "path";
352
- function evaluateHabits(habits, trigger, context) {
353
- const activeHabits = getHabitsByTrigger(habits, trigger);
354
- const evaluations = [];
355
- for (const habit of activeHabits) {
356
- const evaluation = evaluateHabit(habit, context);
357
- evaluations.push(evaluation);
358
- }
359
- const followed = evaluations.filter((e) => e.result === "followed").length;
360
- const skipped = evaluations.filter((e) => e.result === "skipped").length;
361
- const partial = evaluations.filter((e) => e.result === "partial").length;
362
- const blockingViolations = evaluations.filter(
363
- (e) => e.result === "skipped" && e.habit.severity === "block"
364
- ).length;
365
- return {
366
- trigger,
367
- evaluations,
368
- summary: {
369
- total: evaluations.length,
370
- followed,
371
- skipped,
372
- partial,
373
- blockingViolations
374
- },
375
- blocksCompletion: blockingViolations > 0
376
- };
377
- }
378
- function evaluateHabit(habit, context) {
379
- switch (habit.check.type) {
380
- case "tool-called":
381
- return evaluateToolCalled(habit, context);
382
- case "file-exists":
383
- return evaluateFileExists(habit, context);
384
- case "lore-recorded":
385
- return evaluateLoreRecorded(habit, context);
386
- case "symbols-registered":
387
- return evaluateSymbolsRegistered(habit, context);
388
- case "gates-declared":
389
- return evaluateGatesDeclared(habit, context);
390
- case "tests-exist":
391
- return evaluateTestsExist(habit, context);
392
- case "file-modified":
393
- return evaluateFileModified(habit, context);
394
- case "git-clean":
395
- return evaluateGitClean(habit, context);
396
- case "commit-message-format":
397
- return evaluateCommitMessageFormat(habit, context);
398
- case "flow-coverage":
399
- return evaluateFlowCoverage(habit, context);
400
- case "context-checked":
401
- return evaluateContextChecked(habit, context);
402
- case "aspect-anchored":
403
- return evaluateAspectAnchored(habit, context);
404
- default:
405
- return {
406
- habit,
407
- result: "partial",
408
- reason: `Unknown check type: ${habit.check.type}`
409
- };
410
- }
411
- }
412
- function evaluateToolCalled(habit, context) {
413
- const requiredTools = habit.check.params.tools || [];
414
- if (requiredTools.length === 0) {
415
- return { habit, result: "followed", reason: "No tools required" };
416
- }
417
- const calledTools = requiredTools.filter(
418
- (tool) => context.toolsCalled.includes(tool)
419
- );
420
- if (calledTools.length > 0) {
421
- return {
422
- habit,
423
- result: "followed",
424
- reason: `Called: ${calledTools.join(", ")}`,
425
- evidence: calledTools
426
- };
427
- }
428
- if (context.filesModified.length === 0 && context.symbolsTouched.length === 0) {
429
- return {
430
- habit,
431
- result: "followed",
432
- reason: "No modifications made, habit not applicable"
433
- };
434
- }
435
- return {
436
- habit,
437
- result: "skipped",
438
- reason: `None of [${requiredTools.join(", ")}] were called before modifying code`
439
- };
440
- }
441
- function evaluateFileExists(habit, context) {
442
- if (context.filesModified.length === 0) {
443
- return {
444
- habit,
445
- result: "followed",
446
- reason: "No files modified, check not applicable"
447
- };
448
- }
449
- const hasPurposeUpdates = context.filesModified.some(
450
- (f) => f.endsWith(".purpose") || f.includes(".paradigm/")
451
- );
452
- if (hasPurposeUpdates) {
453
- return {
454
- habit,
455
- result: "followed",
456
- reason: "Purpose files were updated alongside source changes"
457
- };
458
- }
459
- const sourceFiles = context.filesModified.filter(
460
- (f) => !f.endsWith(".md") && !f.endsWith(".json") && !f.endsWith(".yaml") && !f.endsWith(".yml") && !f.endsWith(".lock") && !f.endsWith(".purpose") && !f.includes(".paradigm/")
461
- );
462
- if (sourceFiles.length === 0) {
463
- return {
464
- habit,
465
- result: "followed",
466
- reason: "Only non-source files modified"
467
- };
468
- }
469
- return {
470
- habit,
471
- result: "skipped",
472
- reason: `${sourceFiles.length} source file(s) modified without .purpose updates`,
473
- evidence: sourceFiles.slice(0, 5)
474
- };
475
- }
476
- function evaluateLoreRecorded(habit, context) {
477
- const sourceFiles = context.filesModified.filter(
478
- (f) => !f.endsWith(".md") && !f.endsWith(".json") && !f.endsWith(".yaml") && !f.endsWith(".yml") && !f.endsWith(".lock") && !f.endsWith(".purpose") && !f.includes(".paradigm/")
479
- );
480
- if (sourceFiles.length < 3) {
481
- return {
482
- habit,
483
- result: "followed",
484
- reason: "Session not significant enough to require lore (< 3 source files)"
485
- };
486
- }
487
- if (context.loreRecorded) {
488
- return {
489
- habit,
490
- result: "followed",
491
- reason: "Lore entry was recorded for this session"
492
- };
493
- }
494
- if (context.toolsCalled.includes("paradigm_lore_record")) {
495
- return {
496
- habit,
497
- result: "followed",
498
- reason: "paradigm_lore_record was called during session"
499
- };
500
- }
501
- return {
502
- habit,
503
- result: "skipped",
504
- reason: `${sourceFiles.length} source files modified but no lore entry recorded`,
505
- evidence: sourceFiles.slice(0, 5)
506
- };
507
- }
508
- function evaluateSymbolsRegistered(habit, context) {
509
- if (context.symbolsTouched.length === 0) {
510
- return {
511
- habit,
512
- result: "followed",
513
- reason: "No symbols touched"
514
- };
515
- }
516
- const purposeTools = [
517
- "paradigm_purpose_add_component",
518
- "paradigm_purpose_add_signal",
519
- "paradigm_purpose_add_flow",
520
- "paradigm_purpose_add_gate",
521
- "paradigm_purpose_add_aspect",
522
- "paradigm_purpose_add_state",
523
- "paradigm_purpose_init"
524
- ];
525
- const calledPurposeTools = purposeTools.filter(
526
- (t) => context.toolsCalled.includes(t)
527
- );
528
- if (calledPurposeTools.length > 0) {
529
- return {
530
- habit,
531
- result: "followed",
532
- reason: `Purpose tools called: ${calledPurposeTools.join(", ")}`,
533
- evidence: calledPurposeTools
534
- };
535
- }
536
- return {
537
- habit,
538
- result: "partial",
539
- reason: `${context.symbolsTouched.length} symbol(s) touched but no purpose registration tools called`
540
- };
541
- }
542
- function evaluateGatesDeclared(habit, context) {
543
- if (!context.taskAddsRoutes) {
544
- return {
545
- habit,
546
- result: "followed",
547
- reason: "Task does not add routes"
548
- };
549
- }
550
- if (context.hasPortalRoutes) {
551
- return {
552
- habit,
553
- result: "followed",
554
- reason: "Portal.yaml has route declarations"
555
- };
556
- }
557
- const gateTools = [
558
- "paradigm_gates_for_route",
559
- "paradigm_portal_add_route",
560
- "paradigm_portal_add_gate"
561
- ];
562
- const calledGateTools = gateTools.filter(
563
- (t) => context.toolsCalled.includes(t)
564
- );
565
- if (calledGateTools.length > 0) {
566
- return {
567
- habit,
568
- result: "followed",
569
- reason: `Gate tools called: ${calledGateTools.join(", ")}`,
570
- evidence: calledGateTools
571
- };
572
- }
573
- return {
574
- habit,
575
- result: "skipped",
576
- reason: "Task adds routes but no gate declarations or portal tools called"
577
- };
578
- }
579
- function evaluateTestsExist(habit, context) {
580
- if (context.filesModified.length === 0) {
581
- return {
582
- habit,
583
- result: "followed",
584
- reason: "No files modified"
585
- };
586
- }
587
- const testFiles = context.filesModified.filter(
588
- (f) => f.includes(".test.") || f.includes(".spec.") || f.includes("/tests/") || f.includes("/test/") || f.includes("__tests__")
589
- );
590
- if (testFiles.length > 0) {
591
- return {
592
- habit,
593
- result: "followed",
594
- reason: `Test files modified: ${testFiles.length}`,
595
- evidence: testFiles.slice(0, 5)
596
- };
597
- }
598
- const newSourceFiles = context.filesModified.filter(
599
- (f) => !f.endsWith(".md") && !f.endsWith(".json") && !f.endsWith(".yaml") && !f.endsWith(".lock") && !f.endsWith(".purpose") && !f.includes(".paradigm/") && !f.includes("node_modules/")
600
- );
601
- if (newSourceFiles.length === 0) {
602
- return {
603
- habit,
604
- result: "followed",
605
- reason: "No new source files to test"
606
- };
607
- }
608
- return {
609
- habit,
610
- result: "partial",
611
- reason: `${newSourceFiles.length} source file(s) modified but no test files updated`,
612
- evidence: newSourceFiles.slice(0, 5)
613
- };
614
- }
615
- function evaluateFileModified(habit, context) {
616
- if (context.filesModified.length === 0) {
617
- return { habit, result: "followed", reason: "No files modified" };
618
- }
619
- const patterns = habit.check.params.patterns || [];
620
- if (patterns.length === 0) {
621
- return { habit, result: "followed", reason: "No patterns specified" };
622
- }
623
- const matched = context.filesModified.filter(
624
- (f) => patterns.some((p) => f.includes(p) || path2.basename(f) === p)
625
- );
626
- if (matched.length > 0) {
627
- return {
628
- habit,
629
- result: "followed",
630
- reason: `Matching files: ${matched.join(", ")}`,
631
- evidence: matched
632
- };
633
- }
634
- return {
635
- habit,
636
- result: "skipped",
637
- reason: `None of [${patterns.join(", ")}] found in modified files`
638
- };
639
- }
640
- function evaluateGitClean(habit, context) {
641
- if (context.filesModified.length === 0) {
642
- return { habit, result: "followed", reason: "No files modified" };
643
- }
644
- if (context.gitClean === void 0) {
645
- return { habit, result: "partial", reason: "Git status not available" };
646
- }
647
- if (context.gitClean) {
648
- return {
649
- habit,
650
- result: "followed",
651
- reason: "Working tree is clean \u2014 changes committed"
652
- };
653
- }
654
- return {
655
- habit,
656
- result: "skipped",
657
- reason: "Uncommitted changes in working tree"
658
- };
659
- }
660
- function evaluateCommitMessageFormat(habit, context) {
661
- if (!context.commitMessage) {
662
- return {
663
- habit,
664
- result: "followed",
665
- reason: "No commit message to check (not a commit trigger)"
666
- };
667
- }
668
- const patterns = habit.check.params.messagePatterns || [
669
- "^(feat|fix|refactor|chore|docs|test|style|perf|ci|build)\\(",
670
- "Symbols:"
671
- ];
672
- const matchedPatterns = patterns.filter(
673
- (p) => new RegExp(p, "m").test(context.commitMessage)
674
- );
675
- if (matchedPatterns.length === patterns.length) {
676
- return {
677
- habit,
678
- result: "followed",
679
- reason: "Commit message matches all required patterns",
680
- evidence: matchedPatterns
681
- };
682
- }
683
- if (matchedPatterns.length > 0) {
684
- const missing = patterns.filter(
685
- (p) => !new RegExp(p, "m").test(context.commitMessage)
686
- );
687
- return {
688
- habit,
689
- result: "partial",
690
- reason: `Commit message matches ${matchedPatterns.length}/${patterns.length} patterns. Missing: ${missing.join(", ")}`
691
- };
692
- }
693
- return {
694
- habit,
695
- result: "skipped",
696
- reason: "Commit message does not match required format patterns"
697
- };
698
- }
699
- function evaluateFlowCoverage(habit, context) {
700
- const componentSymbols = context.symbolsTouched.filter(
701
- (s) => s.startsWith("#")
702
- );
703
- if (componentSymbols.length < 3) {
704
- return {
705
- habit,
706
- result: "followed",
707
- reason: "Fewer than 3 components touched \u2014 flow not required"
708
- };
709
- }
710
- if (context.hasFlowCoverage) {
711
- return {
712
- habit,
713
- result: "followed",
714
- reason: "Flow coverage exists for multi-component changes"
715
- };
716
- }
717
- const flowTools = [
718
- "paradigm_flow_validate",
719
- "paradigm_flows_affected",
720
- "paradigm_purpose_add_flow"
721
- ];
722
- const calledFlowTools = flowTools.filter(
723
- (t) => context.toolsCalled.includes(t)
724
- );
725
- if (calledFlowTools.length > 0) {
726
- return {
727
- habit,
728
- result: "followed",
729
- reason: `Flow tools called: ${calledFlowTools.join(", ")}`,
730
- evidence: calledFlowTools
731
- };
732
- }
733
- return {
734
- habit,
735
- result: "skipped",
736
- reason: `${componentSymbols.length} components touched without flow coverage or flow tools called`,
737
- evidence: componentSymbols.slice(0, 5)
738
- };
739
- }
740
- function evaluateContextChecked(habit, context) {
741
- const contextTools = habit.check.params.contextTools || [
742
- "paradigm_context_check",
743
- "paradigm_session_recover",
744
- "paradigm_session_checkpoint"
745
- ];
746
- const calledTools = contextTools.filter(
747
- (t) => context.toolsCalled.includes(t)
748
- );
749
- if (calledTools.length > 0) {
750
- return {
751
- habit,
752
- result: "followed",
753
- reason: `Context tools called: ${calledTools.join(", ")}`,
754
- evidence: calledTools
755
- };
756
- }
757
- if (context.filesModified.length === 0 && context.symbolsTouched.length === 0) {
758
- return {
759
- habit,
760
- result: "followed",
761
- reason: "No modifications made, context check not applicable"
762
- };
763
- }
764
- return {
765
- habit,
766
- result: "skipped",
767
- reason: "No context/session tools called during session"
768
- };
769
- }
770
- function evaluateAspectAnchored(habit, context) {
771
- const aspectSymbols = context.symbolsTouched.filter(
772
- (s) => s.startsWith("~")
773
- );
774
- if (aspectSymbols.length === 0) {
775
- return {
776
- habit,
777
- result: "followed",
778
- reason: "No aspects touched"
779
- };
780
- }
781
- if (context.aspectAnchorsValid === true) {
782
- return {
783
- habit,
784
- result: "followed",
785
- reason: "Aspect anchors validated and valid"
786
- };
787
- }
788
- if (context.toolsCalled.includes("paradigm_aspect_check")) {
789
- return {
790
- habit,
791
- result: "followed",
792
- reason: "paradigm_aspect_check was called to validate anchors"
793
- };
794
- }
795
- return {
796
- habit,
797
- result: "skipped",
798
- reason: `${aspectSymbols.length} aspect(s) touched without anchor validation`,
799
- evidence: aspectSymbols.slice(0, 5)
800
- };
801
- }
802
- function buildEvaluationContext(params) {
803
- return {
804
- toolsCalled: params.toolsCalled || [],
805
- filesModified: params.filesModified || [],
806
- symbolsTouched: params.symbolsTouched || [],
807
- loreRecorded: params.loreRecorded || false,
808
- hasPortalRoutes: params.hasPortalRoutes || false,
809
- taskAddsRoutes: params.taskAddsRoutes || false,
810
- taskDescription: params.taskDescription,
811
- gitClean: params.gitClean,
812
- commitMessage: params.commitMessage,
813
- hasFlowCoverage: params.hasFlowCoverage,
814
- aspectAnchorsValid: params.aspectAnchorsValid
815
- };
816
- }
817
-
818
- // src/commands/habits/index.ts
819
- var HABITS_FILE = ".paradigm/habits.yaml";
820
- var SEED_HABIT_IDS = /* @__PURE__ */ new Set([
821
- "explore-before-implement",
822
- "ripple-before-modify",
823
- "check-fragility",
824
- "wisdom-before-implement",
825
- "verify-before-done",
826
- "postflight-compliance",
827
- "test-new-components",
828
- "purpose-coverage",
829
- "record-lore-for-significant",
830
- "gates-for-routes"
831
- ]);
832
- var VALID_CATEGORIES = ["discovery", "verification", "testing", "documentation", "collaboration", "security"];
833
- var VALID_TRIGGERS = ["preflight", "postflight", "on-stop", "on-commit"];
834
- var VALID_SEVERITIES = ["advisory", "warn", "block"];
835
- var VALID_CHECK_TYPES = ["tool-called", "file-exists", "file-modified", "lore-recorded", "symbols-registered", "gates-declared", "tests-exist", "git-clean"];
836
- function resolveHabitLocation(rootDir, habitId) {
837
- const projectPath = path3.join(rootDir, HABITS_FILE);
838
- const projectLocation = findInConfig(projectPath, habitId);
839
- if (projectLocation) return { source: "project", ...projectLocation };
840
- const home = process.env.HOME || process.env.USERPROFILE || "~";
841
- const globalPath = path3.join(home, ".paradigm", "habits.yaml");
842
- const globalLocation = findInConfig(globalPath, habitId);
843
- if (globalLocation) return { source: "global", ...globalLocation };
844
- if (SEED_HABIT_IDS.has(habitId)) return { source: "seed", filePath: "", index: -1 };
845
- return null;
846
- }
847
- function findInConfig(filePath, habitId) {
848
- if (!fs2.existsSync(filePath)) return null;
849
- try {
850
- const content = fs2.readFileSync(filePath, "utf8");
851
- const config = yaml2.load(content);
852
- if (!config?.habits) return null;
853
- const idx = config.habits.findIndex((h) => h.id === habitId);
854
- if (idx === -1) return null;
855
- return { filePath, index: idx };
856
- } catch {
857
- return null;
858
- }
859
- }
860
- function loadConfigFile(filePath) {
861
- const content = fs2.readFileSync(filePath, "utf8");
862
- const config = yaml2.load(content);
863
- if (!config.habits) config.habits = [];
864
- if (!config.overrides) config.overrides = {};
865
- return config;
866
- }
867
- function writeConfigFile(filePath, config) {
868
- fs2.writeFileSync(filePath, yaml2.dump(config, { lineWidth: 80, noRefs: true }), "utf8");
869
- }
870
- function ensureProjectConfig(rootDir) {
871
- const configPath = path3.join(rootDir, HABITS_FILE);
872
- if (!fs2.existsSync(configPath)) {
873
- const dir = path3.dirname(configPath);
874
- if (!fs2.existsSync(dir)) fs2.mkdirSync(dir, { recursive: true });
875
- const initial = { version: "1.0", habits: [], overrides: {} };
876
- writeConfigFile(configPath, initial);
877
- }
878
- return configPath;
879
- }
880
- async function habitsListCommand(options) {
881
- const rootDir = process.cwd();
882
- let habits;
883
- try {
884
- habits = loadHabits(rootDir);
885
- } catch (err) {
886
- console.log(chalk.red("Failed to load habits:"), err.message);
887
- return;
888
- }
889
- if (options.trigger) {
890
- habits = habits.filter((h) => h.trigger === options.trigger);
891
- }
892
- if (options.category) {
893
- habits = habits.filter((h) => h.category === options.category);
894
- }
895
- if (options.json) {
896
- console.log(JSON.stringify(habits, null, 2));
897
- return;
898
- }
899
- const enabled = habits.filter((h) => h.enabled);
900
- const disabled = habits.filter((h) => !h.enabled);
901
- console.log(chalk.magenta(`
902
- Habits (${enabled.length} active, ${disabled.length} disabled)
903
- `));
904
- const triggers = ["preflight", "postflight", "on-stop", "on-commit"];
905
- for (const trigger of triggers) {
906
- const group = habits.filter((h) => h.trigger === trigger);
907
- if (group.length === 0) continue;
908
- console.log(chalk.cyan(` ${trigger}:`));
909
- for (const h of group) {
910
- const status = h.enabled ? chalk.green("ON") : chalk.gray("OFF");
911
- const severity = h.severity === "block" ? chalk.red(h.severity) : h.severity === "warn" ? chalk.yellow(h.severity) : chalk.gray(h.severity);
912
- console.log(` ${status} ${chalk.white(h.id)} [${severity}] - ${h.name}`);
913
- console.log(chalk.gray(` ${h.description}`));
914
- }
915
- console.log();
916
- }
917
- const projectConfig = path3.join(rootDir, HABITS_FILE);
918
- if (fs2.existsSync(projectConfig)) {
919
- console.log(chalk.gray(` Config: ${HABITS_FILE}`));
920
- } else {
921
- console.log(chalk.gray(` Config: using seed habits only (run 'paradigm habits init' to customize)`));
922
- }
923
- console.log();
924
- }
925
- async function habitsStatusCommand(options) {
926
- const rootDir = process.cwd();
927
- let habits;
928
- try {
929
- habits = loadHabits(rootDir);
930
- } catch (err) {
931
- console.log(chalk.red("Failed to load habits:"), err.message);
932
- return;
933
- }
934
- const enabled = getEnabledHabits(habits);
935
- let practiceData = null;
936
- try {
937
- const { SentinelStorage } = await import("./dist-QK4SQAK7.js");
938
- const sentinelDir = path3.join(rootDir, ".paradigm", "sentinel");
939
- if (fs2.existsSync(sentinelDir)) {
940
- const storage = new SentinelStorage(sentinelDir);
941
- const period = options.period || "30d";
942
- const days = parseInt(period.replace("d", ""), 10) || 30;
943
- const dateFrom = period === "all" ? void 0 : new Date(Date.now() - days * 24 * 60 * 60 * 1e3).toISOString();
944
- const compliance = storage.getComplianceRate({ dateFrom });
945
- const events = storage.getPracticeEvents({ dateFrom, limit: 500 });
946
- const catStats = /* @__PURE__ */ new Map();
947
- for (const event of events) {
948
- const cat = event.habitCategory;
949
- const existing = catStats.get(cat) || { followed: 0, skipped: 0, partial: 0 };
950
- existing[event.result]++;
951
- catStats.set(cat, existing);
952
- }
953
- const byCategory = Array.from(catStats.entries()).map(([category, stats]) => {
954
- const total = stats.followed + stats.skipped + stats.partial;
955
- const rate = total > 0 ? Math.round((stats.followed + stats.partial * 0.5) / total * 100) : 100;
956
- return { category, rate, total };
957
- }).sort((a, b) => a.rate - b.rate);
958
- practiceData = {
959
- total: compliance.total,
960
- followed: compliance.followed,
961
- skipped: compliance.skipped,
962
- partial: compliance.partial,
963
- rate: compliance.rate,
964
- byCategory
965
- };
966
- }
967
- } catch {
968
- }
969
- if (options.json) {
970
- console.log(JSON.stringify({
971
- habits: { total: habits.length, enabled: enabled.length },
972
- practice: practiceData
973
- }, null, 2));
974
- return;
975
- }
976
- console.log(chalk.magenta("\n Habits Practice Profile\n"));
977
- console.log(chalk.white(` Total habits: ${habits.length} (${enabled.length} active)`));
978
- const byTrigger = /* @__PURE__ */ new Map();
979
- for (const h of enabled) {
980
- byTrigger.set(h.trigger, (byTrigger.get(h.trigger) || 0) + 1);
981
- }
982
- for (const [trigger, count] of byTrigger) {
983
- console.log(chalk.gray(` ${trigger}: ${count} habit(s)`));
984
- }
985
- console.log();
986
- if (practiceData && practiceData.total > 0) {
987
- const rateColor = practiceData.rate >= 80 ? chalk.green : practiceData.rate >= 60 ? chalk.yellow : chalk.red;
988
- console.log(chalk.white(` Compliance Rate: ${rateColor(`${practiceData.rate}%`)}`));
989
- console.log(chalk.gray(` Followed: ${practiceData.followed} | Skipped: ${practiceData.skipped} | Partial: ${practiceData.partial}`));
990
- console.log(chalk.gray(` Total events: ${practiceData.total}
991
- `));
992
- if (practiceData.byCategory.length > 0) {
993
- console.log(chalk.white(" By Category:"));
994
- for (const cat of practiceData.byCategory) {
995
- const catColor = cat.rate >= 80 ? chalk.green : cat.rate >= 60 ? chalk.yellow : chalk.red;
996
- const bar = "\u2588".repeat(Math.round(cat.rate / 5)) + "\u2591".repeat(20 - Math.round(cat.rate / 5));
997
- console.log(` ${cat.category.padEnd(15)} ${catColor(bar)} ${catColor(`${cat.rate}%`)} (${cat.total})`);
998
- }
999
- }
1000
- } else {
1001
- console.log(chalk.gray(" No practice events recorded yet."));
1002
- console.log(chalk.gray(" Call paradigm_habits_check via MCP to start recording.\n"));
1003
- }
1004
- console.log();
1005
- }
1006
- async function habitsInitCommand(options) {
1007
- const rootDir = process.cwd();
1008
- const configPath = path3.join(rootDir, HABITS_FILE);
1009
- if (fs2.existsSync(configPath) && !options.force) {
1010
- console.log(chalk.yellow(`${HABITS_FILE} already exists. Use --force to overwrite.`));
1011
- return;
1012
- }
1013
- const dir = path3.dirname(configPath);
1014
- if (!fs2.existsSync(dir)) {
1015
- fs2.mkdirSync(dir, { recursive: true });
1016
- }
1017
- const defaultConfig = {
1018
- version: "1.0",
1019
- habits: [],
1020
- overrides: {
1021
- "verify-before-done": {
1022
- severity: "warn"
1023
- }
1024
- }
1025
- };
1026
- const content = `# Paradigm Habits Configuration
1027
- # See: paradigm habits list (for all seed habits)
1028
- #
1029
- # Seed habits are built-in and active by default.
1030
- # Use 'overrides' to tune severity or disable specific habits.
1031
- # Add custom habits in the 'habits' section.
1032
-
1033
- ${yaml2.dump(defaultConfig, { lineWidth: 80, noRefs: true })}
1034
- # Example custom habit:
1035
- # habits:
1036
- # - id: my-custom-check
1037
- # name: "Custom Check"
1038
- # description: "Describe what this habit enforces"
1039
- # category: verification
1040
- # trigger: postflight
1041
- # severity: advisory
1042
- # check:
1043
- # type: tool-called
1044
- # params:
1045
- # tools: [paradigm_pm_postflight]
1046
- # enabled: true
1047
- #
1048
- # Override seed habits:
1049
- # overrides:
1050
- # verify-before-done:
1051
- # severity: block # Upgrade to blocking
1052
- # check-fragility:
1053
- # enabled: false # Disable this habit
1054
- `;
1055
- fs2.writeFileSync(configPath, content, "utf8");
1056
- invalidateHabitsCache(rootDir);
1057
- console.log(chalk.green(`Created ${HABITS_FILE}`));
1058
- console.log(chalk.gray(" 10 seed habits are active by default."));
1059
- console.log(chalk.gray(" Use overrides section to tune severity or disable habits."));
1060
- console.log(chalk.gray(" Run `paradigm habits list` to see all habits.\n"));
1061
- }
1062
- async function habitsAddCommand(options) {
1063
- const rootDir = process.cwd();
1064
- const configPath = path3.join(rootDir, HABITS_FILE);
1065
- if (!fs2.existsSync(configPath)) {
1066
- console.log(chalk.yellow(`No ${HABITS_FILE} found. Run 'paradigm habits init' first.`));
1067
- return;
1068
- }
1069
- if (!VALID_CATEGORIES.includes(options.category)) {
1070
- console.log(chalk.red(`Invalid category: ${options.category}. Valid: ${VALID_CATEGORIES.join(", ")}`));
1071
- return;
1072
- }
1073
- if (!VALID_TRIGGERS.includes(options.trigger)) {
1074
- console.log(chalk.red(`Invalid trigger: ${options.trigger}. Valid: ${VALID_TRIGGERS.join(", ")}`));
1075
- return;
1076
- }
1077
- if (options.severity && !VALID_SEVERITIES.includes(options.severity)) {
1078
- console.log(chalk.red(`Invalid severity: ${options.severity}. Valid: ${VALID_SEVERITIES.join(", ")}`));
1079
- return;
1080
- }
1081
- const checkType = options.checkType || "tool-called";
1082
- if (!VALID_CHECK_TYPES.includes(checkType)) {
1083
- console.log(chalk.red(`Invalid check-type: ${checkType}. Valid: ${VALID_CHECK_TYPES.join(", ")}`));
1084
- return;
1085
- }
1086
- let config;
1087
- try {
1088
- const content = fs2.readFileSync(configPath, "utf8");
1089
- config = yaml2.load(content);
1090
- if (!config.habits) config.habits = [];
1091
- } catch (err) {
1092
- console.log(chalk.red("Failed to parse habits.yaml:"), err.message);
1093
- return;
1094
- }
1095
- const existingIds = /* @__PURE__ */ new Set([
1096
- ...config.habits.map((h) => h.id),
1097
- ...loadHabits(rootDir).map((h) => h.id)
1098
- ]);
1099
- if (existingIds.has(options.id)) {
1100
- console.log(chalk.yellow(`Habit "${options.id}" already exists.`));
1101
- return;
1102
- }
1103
- const tools = options.tools ? options.tools.split(",").map((t) => t.trim()) : [];
1104
- const patterns = options.patterns ? options.patterns.split(",").map((p) => p.trim()) : [];
1105
- const checkParams = {};
1106
- if (checkType === "tool-called" && tools.length > 0) checkParams.tools = tools;
1107
- if ((checkType === "file-exists" || checkType === "file-modified" || checkType === "tests-exist") && patterns.length > 0) {
1108
- checkParams.patterns = patterns;
1109
- }
1110
- const newHabit = {
1111
- id: options.id,
1112
- name: options.name,
1113
- description: options.description,
1114
- category: options.category,
1115
- trigger: options.trigger,
1116
- severity: options.severity || "advisory",
1117
- check: {
1118
- type: checkType,
1119
- params: checkParams
1120
- },
1121
- enabled: true
1122
- };
1123
- config.habits.push(newHabit);
1124
- writeConfigFile(configPath, config);
1125
- invalidateHabitsCache(rootDir);
1126
- console.log(chalk.green(`Added habit: ${options.id}`));
1127
- console.log(chalk.gray(` Name: ${options.name}`));
1128
- console.log(chalk.gray(` Category: ${options.category} | Trigger: ${options.trigger} | Severity: ${options.severity || "advisory"}`));
1129
- console.log(chalk.gray(` Check: ${checkType}`));
1130
- if (tools.length > 0) console.log(chalk.gray(` Tools: ${tools.join(", ")}`));
1131
- if (patterns.length > 0) console.log(chalk.gray(` Patterns: ${patterns.join(", ")}`));
1132
- console.log();
1133
- }
1134
- async function habitsEditCommand(id, options) {
1135
- const rootDir = process.cwd();
1136
- if (options.category && !VALID_CATEGORIES.includes(options.category)) {
1137
- console.log(chalk.red(`Invalid category: ${options.category}. Valid: ${VALID_CATEGORIES.join(", ")}`));
1138
- return;
1139
- }
1140
- if (options.trigger && !VALID_TRIGGERS.includes(options.trigger)) {
1141
- console.log(chalk.red(`Invalid trigger: ${options.trigger}. Valid: ${VALID_TRIGGERS.join(", ")}`));
1142
- return;
1143
- }
1144
- if (options.severity && !VALID_SEVERITIES.includes(options.severity)) {
1145
- console.log(chalk.red(`Invalid severity: ${options.severity}. Valid: ${VALID_SEVERITIES.join(", ")}`));
1146
- return;
1147
- }
1148
- if (options.checkType && !VALID_CHECK_TYPES.includes(options.checkType)) {
1149
- console.log(chalk.red(`Invalid check-type: ${options.checkType}. Valid: ${VALID_CHECK_TYPES.join(", ")}`));
1150
- return;
1151
- }
1152
- const location = resolveHabitLocation(rootDir, id);
1153
- if (!location) {
1154
- console.log(chalk.red(`Habit not found: ${id}`));
1155
- return;
1156
- }
1157
- if (location.source === "seed") {
1158
- const nonOverrideFields = ["name", "description", "category", "trigger", "checkType", "patterns", "tools"];
1159
- const hasNonOverride = nonOverrideFields.some((f) => options[f] !== void 0);
1160
- if (hasNonOverride) {
1161
- console.log(chalk.yellow(`"${id}" is a seed habit. Only --severity and --enabled can be changed.`));
1162
- console.log(chalk.gray(" Other fields require creating a custom habit with the same functionality."));
1163
- return;
1164
- }
1165
- if (!options.severity && options.enabled === void 0) {
1166
- console.log(chalk.yellow("No changes specified. Use --severity or --enabled for seed habits."));
1167
- return;
1168
- }
1169
- const configPath = ensureProjectConfig(rootDir);
1170
- const config2 = loadConfigFile(configPath);
1171
- if (!config2.overrides) config2.overrides = {};
1172
- if (!config2.overrides[id]) config2.overrides[id] = {};
1173
- if (options.severity) config2.overrides[id].severity = options.severity;
1174
- if (options.enabled !== void 0) config2.overrides[id].enabled = options.enabled === "true";
1175
- writeConfigFile(configPath, config2);
1176
- invalidateHabitsCache(rootDir);
1177
- console.log(chalk.green(`Updated seed habit override: ${id}`));
1178
- if (options.severity) console.log(chalk.gray(` Severity: ${options.severity}`));
1179
- if (options.enabled !== void 0) console.log(chalk.gray(` Enabled: ${options.enabled}`));
1180
- console.log();
1181
- return;
1182
- }
1183
- const config = loadConfigFile(location.filePath);
1184
- const habit = config.habits[location.index];
1185
- if (options.name) habit.name = options.name;
1186
- if (options.description) habit.description = options.description;
1187
- if (options.category) habit.category = options.category;
1188
- if (options.trigger) habit.trigger = options.trigger;
1189
- if (options.severity) habit.severity = options.severity;
1190
- if (options.enabled !== void 0) habit.enabled = options.enabled === "true";
1191
- if (options.checkType) habit.check.type = options.checkType;
1192
- if (options.tools) habit.check.params.tools = options.tools.split(",").map((t) => t.trim());
1193
- if (options.patterns) habit.check.params.patterns = options.patterns.split(",").map((p) => p.trim());
1194
- config.habits[location.index] = habit;
1195
- writeConfigFile(location.filePath, config);
1196
- invalidateHabitsCache(rootDir);
1197
- const source = location.source === "global" ? "(global)" : "(project)";
1198
- console.log(chalk.green(`Updated habit: ${id} ${chalk.gray(source)}`));
1199
- console.log();
1200
- }
1201
- async function habitsRemoveCommand(id, options) {
1202
- const rootDir = process.cwd();
1203
- const location = resolveHabitLocation(rootDir, id);
1204
- if (!location) {
1205
- console.log(chalk.red(`Habit not found: ${id}`));
1206
- return;
1207
- }
1208
- if (location.source === "seed") {
1209
- console.log(chalk.yellow(`"${id}" is a seed habit and cannot be removed.`));
1210
- console.log(chalk.gray(` Use: paradigm habits edit ${id} --enabled false`));
1211
- return;
1212
- }
1213
- const config = loadConfigFile(location.filePath);
1214
- const habit = config.habits[location.index];
1215
- if (!options.yes) {
1216
- console.log(chalk.yellow(`
1217
- Will remove habit: ${habit.name} (${id})`));
1218
- console.log(chalk.gray(` Source: ${location.source} (${location.filePath})`));
1219
- console.log(chalk.gray(` Use --yes to confirm.
1220
- `));
1221
- return;
1222
- }
1223
- config.habits.splice(location.index, 1);
1224
- writeConfigFile(location.filePath, config);
1225
- invalidateHabitsCache(rootDir);
1226
- console.log(chalk.green(`Removed habit: ${id}`));
1227
- console.log();
1228
- }
1229
- async function habitsToggleCommand(id, action) {
1230
- const rootDir = process.cwd();
1231
- const enabled = action === "enable";
1232
- const location = resolveHabitLocation(rootDir, id);
1233
- if (!location) {
1234
- console.log(chalk.red(`Habit not found: ${id}`));
1235
- return;
1236
- }
1237
- if (location.source === "seed") {
1238
- const configPath = ensureProjectConfig(rootDir);
1239
- const config2 = loadConfigFile(configPath);
1240
- if (!config2.overrides) config2.overrides = {};
1241
- if (!config2.overrides[id]) config2.overrides[id] = {};
1242
- config2.overrides[id].enabled = enabled;
1243
- writeConfigFile(configPath, config2);
1244
- invalidateHabitsCache(rootDir);
1245
- console.log(chalk.green(`${enabled ? "Enabled" : "Disabled"} seed habit: ${id}`));
1246
- console.log();
1247
- return;
1248
- }
1249
- const config = loadConfigFile(location.filePath);
1250
- config.habits[location.index].enabled = enabled;
1251
- writeConfigFile(location.filePath, config);
1252
- invalidateHabitsCache(rootDir);
1253
- console.log(chalk.green(`${enabled ? "Enabled" : "Disabled"} habit: ${id}`));
1254
- console.log();
1255
- }
1256
- async function habitsCheckCommand(options) {
1257
- const rootDir = process.cwd();
1258
- const trigger = options.trigger;
1259
- let habits;
1260
- try {
1261
- habits = loadHabits(rootDir);
1262
- } catch (err) {
1263
- console.log(chalk.red("Failed to load habits:"), err.message);
1264
- process.exitCode = 1;
1265
- return;
1266
- }
1267
- const filesModified = options.files ? options.files.split(",").map((f) => f.trim()).filter(Boolean) : getGitModifiedFiles(rootDir);
1268
- const symbolsTouched = options.symbols ? options.symbols.split(",").map((s) => s.trim()).filter(Boolean) : [];
1269
- let gitClean;
1270
- try {
1271
- const status = execSync("git status --porcelain", {
1272
- cwd: rootDir,
1273
- encoding: "utf8",
1274
- timeout: 5e3
1275
- });
1276
- gitClean = status.trim() === "";
1277
- } catch {
1278
- }
1279
- const portalPath = path3.join(rootDir, "portal.yaml");
1280
- let hasPortalRoutes = false;
1281
- if (fs2.existsSync(portalPath)) {
1282
- try {
1283
- const portalContent = fs2.readFileSync(portalPath, "utf8");
1284
- const portal = yaml2.load(portalContent);
1285
- hasPortalRoutes = portal?.routes != null && Object.keys(portal.routes).length > 0;
1286
- } catch {
1287
- }
1288
- }
1289
- const evalContext = buildEvaluationContext({
1290
- toolsCalled: [],
1291
- // CLI has no session breadcrumbs
1292
- filesModified,
1293
- symbolsTouched,
1294
- loreRecorded: false,
1295
- hasPortalRoutes,
1296
- taskAddsRoutes: false,
1297
- gitClean
1298
- });
1299
- const evaluation = evaluateHabits(habits, trigger, evalContext);
1300
- let recordedCount = 0;
1301
- if (options.record && evaluation.evaluations.length > 0) {
1302
- try {
1303
- const sentinelDir = path3.join(rootDir, ".paradigm", "sentinel");
1304
- if (fs2.existsSync(sentinelDir)) {
1305
- const { SentinelStorage } = await import("./dist-QK4SQAK7.js");
1306
- const storage = new SentinelStorage(sentinelDir);
1307
- for (const e of evaluation.evaluations) {
1308
- storage.recordPracticeEvent({
1309
- habitId: e.habit.id,
1310
- habitCategory: e.habit.category,
1311
- result: e.result,
1312
- engineer: "agent",
1313
- sessionId: `cli-${Date.now().toString(36)}`,
1314
- symbolsTouched,
1315
- filesModified,
1316
- notes: e.reason
1317
- });
1318
- recordedCount++;
1319
- }
1320
- }
1321
- } catch {
1322
- }
1323
- }
1324
- const markerPath = path3.join(rootDir, ".paradigm", ".habits-blocking");
1325
- try {
1326
- if (trigger === "on-stop" && evaluation.blocksCompletion) {
1327
- const blocking = evaluation.evaluations.filter((e) => e.result === "skipped" && e.habit.severity === "block").map((e) => `${e.habit.name}: ${e.reason}`);
1328
- fs2.writeFileSync(markerPath, blocking.join("\n"), "utf8");
1329
- } else if (trigger === "on-stop") {
1330
- if (fs2.existsSync(markerPath)) fs2.unlinkSync(markerPath);
1331
- }
1332
- } catch {
1333
- }
1334
- if (options.json) {
1335
- console.log(JSON.stringify({
1336
- trigger,
1337
- evaluation: {
1338
- total: evaluation.summary.total,
1339
- followed: evaluation.summary.followed,
1340
- skipped: evaluation.summary.skipped,
1341
- partial: evaluation.summary.partial,
1342
- blockingViolations: evaluation.summary.blockingViolations,
1343
- blocksCompletion: evaluation.blocksCompletion
1344
- },
1345
- habits: evaluation.evaluations.map((e) => ({
1346
- id: e.habit.id,
1347
- name: e.habit.name,
1348
- category: e.habit.category,
1349
- severity: e.habit.severity,
1350
- result: e.result,
1351
- reason: e.reason,
1352
- evidence: e.evidence
1353
- })),
1354
- recorded: recordedCount
1355
- }, null, 2));
1356
- } else {
1357
- printHumanReadableResults(evaluation, recordedCount);
1358
- }
1359
- if (evaluation.blocksCompletion) {
1360
- process.exitCode = 1;
1361
- }
1362
- }
1363
- function getGitModifiedFiles(rootDir) {
1364
- try {
1365
- const output = execSync("git diff --name-only HEAD", {
1366
- cwd: rootDir,
1367
- encoding: "utf8",
1368
- timeout: 5e3
1369
- });
1370
- return output.trim().split("\n").filter(Boolean);
1371
- } catch {
1372
- return [];
1373
- }
1374
- }
1375
- function printHumanReadableResults(evaluation, recordedCount) {
1376
- const { summary } = evaluation;
1377
- console.log(chalk.magenta(`
1378
- Habits Check (${evaluation.trigger})
1379
- `));
1380
- for (const e of evaluation.evaluations) {
1381
- const icon = e.result === "followed" ? chalk.green("PASS") : e.result === "skipped" ? e.habit.severity === "block" ? chalk.red("BLOCK") : chalk.yellow("SKIP") : chalk.gray("PART");
1382
- const severity = e.habit.severity === "block" ? chalk.red(e.habit.severity) : e.habit.severity === "warn" ? chalk.yellow(e.habit.severity) : chalk.gray(e.habit.severity);
1383
- console.log(` ${icon} ${chalk.white(e.habit.id)} [${severity}]`);
1384
- console.log(chalk.gray(` ${e.reason}`));
1385
- }
1386
- console.log();
1387
- console.log(chalk.white(` Summary: ${summary.followed} followed, ${summary.skipped} skipped, ${summary.partial} partial`));
1388
- if (summary.blockingViolations > 0) {
1389
- console.log(chalk.red(` ${summary.blockingViolations} blocking violation(s) \u2014 exit code 1`));
1390
- }
1391
- if (recordedCount > 0) {
1392
- console.log(chalk.gray(` Recorded ${recordedCount} practice event(s) to Sentinel`));
1393
- }
1394
- console.log();
1395
- }
1396
- export {
1397
- habitsAddCommand,
1398
- habitsCheckCommand,
1399
- habitsEditCommand,
1400
- habitsInitCommand,
1401
- habitsListCommand,
1402
- habitsRemoveCommand,
1403
- habitsStatusCommand,
1404
- habitsToggleCommand
1405
- };