@a-company/paradigm 5.10.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 (409) 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 -20484
  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/courses/para-701.json +807 -0
  195. package/dist/university-content/plsat/.purpose +3 -2
  196. package/dist/university-ui/assets/{index-BjewBB6s.js → index-CGFJczb1.js} +2 -2
  197. package/dist/university-ui/assets/{index-BjewBB6s.js.map → index-CGFJczb1.js.map} +1 -1
  198. package/dist/university-ui/index.html +1 -1
  199. package/dist/upgrade-B4IOLZYK.js +53 -0
  200. package/dist/validate-C6SMKGYD.js +9 -0
  201. package/dist/validate-LSCDOLBO.js +13 -0
  202. package/dist/validate-VZXTJHGO.js +6 -0
  203. package/dist/watch-LRM5XD46.js +8 -0
  204. package/dist/watch-PZCCUP6K.js +9 -0
  205. package/dist/wisdom-XZ3QKPNP.js +7 -0
  206. package/dist/work-log-loader-DL5GZ2BQ.js +2 -0
  207. package/dist/workspace-2ODL5WLY.js +2 -0
  208. package/package.json +1 -1
  209. package/platform-ui/dist/assets/AmbientSection-DqQ2mfCO.js +1 -0
  210. package/platform-ui/dist/assets/{CanvasSection-DwPTRdIN.js → CanvasSection-DLW0s-Bu.js} +1 -1
  211. package/platform-ui/dist/assets/{DocsSection-BJc_ws4I.js → DocsSection-BQ9Hi51g.js} +1 -1
  212. package/platform-ui/dist/assets/{GitSection-DhqBo1xc.js → GitSection-QQeUX6o3.js} +1 -1
  213. package/platform-ui/dist/assets/{GraphSection-D9fhVnZ0.js → GraphSection-0c9C-w7K.js} +2 -2
  214. package/platform-ui/dist/assets/{GraphSection-BlgXTl53.css → GraphSection-Bbs2a8sC.css} +1 -1
  215. package/platform-ui/dist/assets/LoreSection--t56kCj2.js +1 -0
  216. package/platform-ui/dist/assets/LoreSection-qnmm3o4y.css +1 -0
  217. package/platform-ui/dist/assets/SentinelSection-C4OoME9U.js +1 -0
  218. package/platform-ui/dist/assets/{SymphonySection-BRoBaUSS.js → SymphonySection-B-rvsLxq.js} +1 -1
  219. package/platform-ui/dist/assets/TeamSection-CBFmNEEo.js +1 -0
  220. package/platform-ui/dist/assets/index-Bxp0TVaf.css +1 -0
  221. package/platform-ui/dist/assets/index-DPpOdAtC.js +57 -0
  222. package/platform-ui/dist/index.html +2 -2
  223. package/dist/accept-orchestration-UQLM7PTQ.js +0 -189
  224. package/dist/add-FZRKEGH4.js +0 -81
  225. package/dist/agent-WERIO2XV.js +0 -523
  226. package/dist/agent-loader-TFIANSF4.js +0 -44
  227. package/dist/agent-state-S5DAWPTF.js +0 -24
  228. package/dist/agents-suggest-DNSYJ6IA.js +0 -83
  229. package/dist/aggregate-H57K7PNV.js +0 -88
  230. package/dist/assess-4WVXZLZQ.js +0 -68
  231. package/dist/auto-QFS5NHQU.js +0 -504
  232. package/dist/beacon-KXZXYQHX.js +0 -251
  233. package/dist/calibration-V46G7JTY.js +0 -135
  234. package/dist/check-OWAIWV23.js +0 -175
  235. package/dist/chunk-2IO7JAG2.js +0 -148
  236. package/dist/chunk-2T6BTYBN.js +0 -712
  237. package/dist/chunk-36TKPM5Z.js +0 -400
  238. package/dist/chunk-45MUDW6E.js +0 -804
  239. package/dist/chunk-4BLYIB7J.js +0 -5701
  240. package/dist/chunk-4L3UTYQX.js +0 -677
  241. package/dist/chunk-4NCFWYGG.js +0 -110
  242. package/dist/chunk-54LTTQBH.js +0 -138
  243. package/dist/chunk-5EWAQHFY.js +0 -269
  244. package/dist/chunk-5JGJACDU.js +0 -37
  245. package/dist/chunk-5OUOLN6M.js +0 -659
  246. package/dist/chunk-5VKJBNJL.js +0 -444
  247. package/dist/chunk-6N3JTACN.js +0 -2260
  248. package/dist/chunk-6QC3YGB6.js +0 -114
  249. package/dist/chunk-7N7GSU6K.js +0 -34
  250. package/dist/chunk-ABVQGRF7.js +0 -268
  251. package/dist/chunk-CL7JSK52.js +0 -129
  252. package/dist/chunk-CSD7IHSN.js +0 -152
  253. package/dist/chunk-EDOAWN7J.js +0 -717
  254. package/dist/chunk-EKGMAM62.js +0 -525
  255. package/dist/chunk-EZ3GOCYC.js +0 -132
  256. package/dist/chunk-F3BCHPYT.js +0 -143
  257. package/dist/chunk-FKJUBQU3.js +0 -3081
  258. package/dist/chunk-GT5QGC2H.js +0 -253
  259. package/dist/chunk-GZDFVP2N.js +0 -540
  260. package/dist/chunk-IRKUEJVW.js +0 -405
  261. package/dist/chunk-J2JEQRT3.js +0 -164
  262. package/dist/chunk-JASGXLK3.js +0 -679
  263. package/dist/chunk-KVDYJLTC.js +0 -121
  264. package/dist/chunk-L27I3CPZ.js +0 -357
  265. package/dist/chunk-LHLIAYQ3.js +0 -185
  266. package/dist/chunk-MCMOGQMU.js +0 -145
  267. package/dist/chunk-NQKQG45G.js +0 -688
  268. package/dist/chunk-PBHIFAL4.js +0 -259
  269. package/dist/chunk-PDX44BCA.js +0 -11
  270. package/dist/chunk-PMXRGPRQ.js +0 -305
  271. package/dist/chunk-RAB5IKPR.js +0 -487
  272. package/dist/chunk-RJE5G7WO.js +0 -590
  273. package/dist/chunk-RTHA3XRE.js +0 -880
  274. package/dist/chunk-S2HO5MLR.js +0 -621
  275. package/dist/chunk-S3ORKP3V.js +0 -716
  276. package/dist/chunk-TAIJOFOE.js +0 -124
  277. package/dist/chunk-TXESEO7Y.js +0 -245
  278. package/dist/chunk-UPLDI7CN.js +0 -1334
  279. package/dist/chunk-VL67H5IC.js +0 -506
  280. package/dist/chunk-VPPK3SY4.js +0 -1136
  281. package/dist/chunk-YMDLDELF.js +0 -314
  282. package/dist/chunk-YO6DVTL7.js +0 -99
  283. package/dist/chunk-YRZ5RPEB.js +0 -1561
  284. package/dist/chunk-ZDHLG5VP.js +0 -5676
  285. package/dist/chunk-ZGUAAVMA.js +0 -756
  286. package/dist/chunk-ZSYVKSY6.js +0 -2602
  287. package/dist/claude-FRRWJSTJ.js +0 -362
  288. package/dist/claude-cli-XJLK2X4L.js +0 -276
  289. package/dist/claude-code-HTBA4XRB.js +0 -126
  290. package/dist/claude-code-teams-T4SP24MD.js +0 -199
  291. package/dist/commands-5N4ILTPH.js +0 -5859
  292. package/dist/conductor-CQVGTEQN.js +0 -161
  293. package/dist/config-schema-EA4XALGG.js +0 -154
  294. package/dist/constellation-A26CCGQS.js +0 -225
  295. package/dist/context-audit-RLO3ETRP.js +0 -682
  296. package/dist/cost-BGM32XJU.js +0 -93
  297. package/dist/cost-VI46A4XL.js +0 -174
  298. package/dist/cursor-cli-JVEZGHWQ.js +0 -269
  299. package/dist/cursorrules-HLIKJJZT.js +0 -84
  300. package/dist/decision-loader-WWCLIQPJ.js +0 -20
  301. package/dist/delete-KBRPQLPC.js +0 -56
  302. package/dist/diff-D4X53HAC.js +0 -126
  303. package/dist/discipline-FA4OZXIS.js +0 -24
  304. package/dist/dist-34NA5RS5.js +0 -74
  305. package/dist/dist-5QE2BB2B-5S3T6Y3T.js +0 -6919
  306. package/dist/dist-77JDTVAY.js +0 -62
  307. package/dist/dist-OGTSAZ55.js +0 -1358
  308. package/dist/dist-QK4SQAK7.js +0 -64
  309. package/dist/dist-TA6LSC2Q.js +0 -20
  310. package/dist/docs-PBZB7LYP.js +0 -89
  311. package/dist/docs-QIYKO3BR.js +0 -155
  312. package/dist/doctor-ULBOHEIC.js +0 -11
  313. package/dist/drift-R5NRKFHI.js +0 -251
  314. package/dist/echo-O2LY7CC2.js +0 -248
  315. package/dist/edit-R2HNLMOG.js +0 -63
  316. package/dist/event-25OJKDCE.js +0 -31
  317. package/dist/export-IWVL7XLF.js +0 -38
  318. package/dist/flow-CRRVV3O3.js +0 -185
  319. package/dist/global-3NG5JXUB.js +0 -136
  320. package/dist/graduate-USAWGBJM.js +0 -160
  321. package/dist/graph-VHUMAAS6.js +0 -12
  322. package/dist/graph-server-YL22VBBN.js +0 -116
  323. package/dist/habits-OL5NGPXO.js +0 -1405
  324. package/dist/history-WOWC573W.js +0 -277
  325. package/dist/hooks-HFWSCGPV.js +0 -12
  326. package/dist/integrity-IHO4FZTS.js +0 -194
  327. package/dist/integrity-checker-PSKJA5SB.js +0 -12
  328. package/dist/journal-loader-5EYSBFFY.js +0 -18
  329. package/dist/lint-K6CJGGPH.js +0 -456
  330. package/dist/list-4YK7QKFF.js +0 -57
  331. package/dist/list-ENR7Q4CR.js +0 -56
  332. package/dist/lore-loader-7NO6N6FT.js +0 -26
  333. package/dist/lore-server-UNJY5KC3.js +0 -118
  334. package/dist/manual-G6FISID5.js +0 -204
  335. package/dist/migrate-LS45DNEV.js +0 -889
  336. package/dist/migrate-assessments-RGH4O6IX.js +0 -97
  337. package/dist/model-discovery-D2H3VBGC.js +0 -8
  338. package/dist/nomination-engine-RV5CNO5B.js +0 -42
  339. package/dist/notebook-YWIYGEHV.js +0 -155
  340. package/dist/orchestrate-JLILBBJE.js +0 -324
  341. package/dist/peers-DEOUIZM6.js +0 -82
  342. package/dist/persona-UHAHIVST.js +0 -390
  343. package/dist/pipeline-L4HCSBGN.js +0 -263
  344. package/dist/platform-server-H5YO3DQD.js +0 -1475
  345. package/dist/plugin-update-checker-KRRSGXMV.js +0 -12
  346. package/dist/portal-check-NPYGII2D.js +0 -42
  347. package/dist/portal-compliance-J7DGAPFX.js +0 -18
  348. package/dist/probe-MHL5HQZ2.js +0 -167
  349. package/dist/promote-F6ZYZZAL.js +0 -182
  350. package/dist/providers-GK7PB2OL.js +0 -104
  351. package/dist/quiz-M66SC7F7.js +0 -99
  352. package/dist/record-RA4WR2BO.js +0 -49
  353. package/dist/reindex-5LTD53ZC.js +0 -16
  354. package/dist/remember-HBWJ655S.js +0 -77
  355. package/dist/retag-3OLCVDEQ.js +0 -62
  356. package/dist/review-27ATYTD2.js +0 -33
  357. package/dist/review-57QMURZV.js +0 -334
  358. package/dist/ripple-JPBXP5I3.js +0 -215
  359. package/dist/sentinel-4XIG4STA.js +0 -63
  360. package/dist/sentinel-bridge-MDUXTQRL.js +0 -109
  361. package/dist/serve-CAH3PHE7.js +0 -33
  362. package/dist/serve-INL7SNBK.js +0 -36
  363. package/dist/serve-KBSE36PL.js +0 -49
  364. package/dist/server-54SKYFFY.js +0 -1647
  365. package/dist/server-XUOIO7E6.js +0 -338
  366. package/dist/session-tracker-C4BMD5WG.js +0 -13
  367. package/dist/session-work-log-MZ47OAPB.js +0 -20
  368. package/dist/setup-EDS27WUR.js +0 -25
  369. package/dist/setup-KO5AFC4K.js +0 -296
  370. package/dist/shift-D2JOHHBF.js +0 -668
  371. package/dist/show-5PV5KFJE.js +0 -176
  372. package/dist/show-NQKYX6WQ.js +0 -82
  373. package/dist/snapshot-BK4RBPCG.js +0 -62
  374. package/dist/spawn-RCHNXDHE.js +0 -196
  375. package/dist/status-WGIAQODY.js +0 -71
  376. package/dist/summary-NIRABMF5.js +0 -140
  377. package/dist/sweep-QMHNSIY5.js +0 -934
  378. package/dist/switch-6EJPZDIA.js +0 -232
  379. package/dist/symphony-4OCY36AI.js +0 -791
  380. package/dist/symphony-B75X2MME.js +0 -326
  381. package/dist/symphony-loader-UZGON56V.js +0 -90
  382. package/dist/symphony-peers-2ZQYLRNI.js +0 -34
  383. package/dist/symphony-peers-OL7F6M5S.js +0 -121
  384. package/dist/symphony-relay-UJYUXN65.js +0 -710
  385. package/dist/sync-VEHUH4OA.js +0 -11
  386. package/dist/sync-llms-YHCFIE6X.js +0 -166
  387. package/dist/task-loader-LDYWQSLM.js +0 -20
  388. package/dist/team-O5MIIFMA.js +0 -34
  389. package/dist/test-566CP5KC.js +0 -1017
  390. package/dist/thread-N754I4D5.js +0 -274
  391. package/dist/timeline-M3CICQFE.js +0 -112
  392. package/dist/triage-HHYGT3HY.js +0 -671
  393. package/dist/tutorial-KD22SUNO.js +0 -666
  394. package/dist/upgrade-H5PF32BW.js +0 -551
  395. package/dist/validate-CNKEKO6A.js +0 -134
  396. package/dist/validate-MB5ULIHS.js +0 -39
  397. package/dist/validate-QH3LADM6.js +0 -64
  398. package/dist/watch-2TKP5PVL.js +0 -199
  399. package/dist/watch-ZF4ML6CD.js +0 -111
  400. package/dist/wisdom-AATMGNFA.js +0 -319
  401. package/dist/work-log-loader-5L45XNYZ.js +0 -14
  402. package/dist/workspace-6E6OSRNU.js +0 -21
  403. package/platform-ui/dist/assets/AmbientSection-WtHfNedO.js +0 -1
  404. package/platform-ui/dist/assets/LoreSection-C3EixkjW.css +0 -1
  405. package/platform-ui/dist/assets/LoreSection-CwDDHrz9.js +0 -1
  406. package/platform-ui/dist/assets/SentinelSection-Cl7e5oZ6.js +0 -1
  407. package/platform-ui/dist/assets/TeamSection-CqSIMrKz.js +0 -1
  408. package/platform-ui/dist/assets/index-CfpZFjea.css +0 -1
  409. package/platform-ui/dist/assets/index-F0KL9xrN.js +0 -57
@@ -1,934 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- recordLore,
4
- resolveAuthor
5
- } from "./chunk-EKGMAM62.js";
6
- import {
7
- log
8
- } from "./chunk-4NCFWYGG.js";
9
- import "./chunk-PDX44BCA.js";
10
-
11
- // src/commands/sweep/index.ts
12
- import * as fs from "fs";
13
- import * as path from "path";
14
- import chalk from "chalk";
15
- import ora from "ora";
16
- import * as yaml from "js-yaml";
17
- import { glob } from "glob";
18
- var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", "dist", ".git", ".next", "build", "coverage", "__pycache__", "target"]);
19
- var CODE_EXTS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".py", ".rs", ".go", ".java", ".rb", ".ex", ".exs"]);
20
- var STALE_THRESHOLD_DAYS = 14;
21
- var COVERAGE_THRESHOLD = 90;
22
- function todayISO() {
23
- return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
24
- }
25
- function shouldFix(options) {
26
- return !options.dry && !options.skipFix;
27
- }
28
- function findPurposeFilesSync(rootDir) {
29
- const found = [];
30
- function walk(dir) {
31
- let entries;
32
- try {
33
- entries = fs.readdirSync(dir, { withFileTypes: true });
34
- } catch {
35
- return;
36
- }
37
- for (const entry of entries) {
38
- if (SKIP_DIRS.has(entry.name)) continue;
39
- const full = path.join(dir, entry.name);
40
- if (entry.isDirectory()) {
41
- walk(full);
42
- } else if (entry.name === ".purpose") {
43
- found.push(full);
44
- }
45
- }
46
- }
47
- walk(rootDir);
48
- return found;
49
- }
50
- function findSourceDirs(rootDir) {
51
- const dirs = /* @__PURE__ */ new Set();
52
- function walk(dir) {
53
- let entries;
54
- try {
55
- entries = fs.readdirSync(dir, { withFileTypes: true });
56
- } catch {
57
- return;
58
- }
59
- let hasCode = false;
60
- for (const entry of entries) {
61
- if (SKIP_DIRS.has(entry.name)) continue;
62
- const full = path.join(dir, entry.name);
63
- if (entry.isDirectory()) {
64
- walk(full);
65
- } else if (CODE_EXTS.has(path.extname(entry.name))) {
66
- hasCode = true;
67
- }
68
- }
69
- if (hasCode) {
70
- dirs.add(dir);
71
- }
72
- }
73
- walk(rootDir);
74
- return [...dirs];
75
- }
76
- function loadScanIndex(rootDir) {
77
- const indexPath = path.join(rootDir, ".paradigm", "scan-index.json");
78
- if (!fs.existsSync(indexPath)) return null;
79
- try {
80
- return JSON.parse(fs.readFileSync(indexPath, "utf8"));
81
- } catch {
82
- return null;
83
- }
84
- }
85
- function loadFlowIndex(rootDir) {
86
- const indexPath = path.join(rootDir, ".paradigm", "flow-index.json");
87
- if (!fs.existsSync(indexPath)) return null;
88
- try {
89
- return JSON.parse(fs.readFileSync(indexPath, "utf8"));
90
- } catch {
91
- return null;
92
- }
93
- }
94
- function extractAllSymbols(index) {
95
- const map = /* @__PURE__ */ new Map();
96
- const categories = ["components", "features", "flows", "state", "gates", "signals", "aspects"];
97
- for (const cat of categories) {
98
- const bucket = index[cat];
99
- if (!bucket || typeof bucket !== "object") continue;
100
- for (const entry of Object.values(bucket)) {
101
- if (entry.symbol) {
102
- map.set(entry.symbol, entry);
103
- }
104
- }
105
- }
106
- return map;
107
- }
108
- function countCrossReferences(symbol, purposeFiles, definitionFile) {
109
- let count = 0;
110
- for (const pf of purposeFiles) {
111
- if (pf === definitionFile) continue;
112
- try {
113
- const content = fs.readFileSync(pf, "utf8");
114
- if (content.includes(symbol)) {
115
- count++;
116
- }
117
- } catch {
118
- }
119
- }
120
- return count;
121
- }
122
- function checkOrphanedSymbols(_rootDir, index, purposeFiles, options) {
123
- const results = [];
124
- if (!index) {
125
- results.push({ check: "orphaned-symbols", category: "orphaned", status: "ok", message: "Skipped \u2014 no scan-index.json" });
126
- return results;
127
- }
128
- const allSymbols = extractAllSymbols(index);
129
- let orphanCount = 0;
130
- let fixedCount = 0;
131
- for (const [symbol, entry] of allSymbols) {
132
- const refs = countCrossReferences(symbol, purposeFiles, entry.path);
133
- if (refs === 0) {
134
- orphanCount++;
135
- if (shouldFix(options)) {
136
- const purposePath = entry.path.endsWith(".purpose") ? entry.path : path.join(entry.path, ".purpose");
137
- if (fs.existsSync(purposePath)) {
138
- try {
139
- let content = fs.readFileSync(purposePath, "utf8");
140
- if (!content.includes(`# orphan-detected:`) || !content.includes(symbol)) {
141
- content += `
142
- # orphan-detected: ${todayISO()} \u2014 ${symbol} has 0 cross-references
143
- `;
144
- fs.writeFileSync(purposePath, content, "utf8");
145
- fixedCount++;
146
- results.push({
147
- check: "orphaned-symbols",
148
- category: "orphaned",
149
- status: "fixed",
150
- symbol,
151
- file: purposePath,
152
- message: `${symbol} \u2014 0 cross-references, marked orphan`,
153
- fixAction: "Added orphan-detected comment"
154
- });
155
- continue;
156
- }
157
- } catch {
158
- }
159
- }
160
- }
161
- results.push({
162
- check: "orphaned-symbols",
163
- category: "orphaned",
164
- status: "entropy",
165
- symbol,
166
- file: entry.path,
167
- message: `${symbol} \u2014 0 cross-references from other .purpose files`
168
- });
169
- }
170
- }
171
- if (orphanCount === 0) {
172
- results.push({ check: "orphaned-symbols", category: "orphaned", status: "ok", message: `All ${allSymbols.size} symbols have cross-references` });
173
- }
174
- return results;
175
- }
176
- function checkStalePurpose(rootDir, purposeFiles, options) {
177
- const results = [];
178
- let staleCount = 0;
179
- for (const pf of purposeFiles) {
180
- const dir = path.dirname(pf);
181
- let purposeMtime;
182
- try {
183
- purposeMtime = fs.statSync(pf).mtime.getTime();
184
- } catch {
185
- continue;
186
- }
187
- let newestCodeMtime = 0;
188
- let newestCodeFile = "";
189
- try {
190
- const entries = fs.readdirSync(dir, { withFileTypes: true });
191
- for (const entry of entries) {
192
- if (!entry.isFile()) continue;
193
- if (!CODE_EXTS.has(path.extname(entry.name))) continue;
194
- const stat = fs.statSync(path.join(dir, entry.name));
195
- if (stat.mtime.getTime() > newestCodeMtime) {
196
- newestCodeMtime = stat.mtime.getTime();
197
- newestCodeFile = entry.name;
198
- }
199
- }
200
- } catch {
201
- continue;
202
- }
203
- if (newestCodeMtime === 0) continue;
204
- const diffDays = (newestCodeMtime - purposeMtime) / (1e3 * 60 * 60 * 24);
205
- if (diffDays > STALE_THRESHOLD_DAYS) {
206
- staleCount++;
207
- const relPath = path.relative(rootDir, pf);
208
- const staleDays = Math.floor(diffDays);
209
- if (shouldFix(options)) {
210
- try {
211
- let content = fs.readFileSync(pf, "utf8");
212
- if (!content.includes("# stale-since:")) {
213
- content += `
214
- # stale-since: ${todayISO()} \u2014 code in ${newestCodeFile} is ${staleDays} days newer
215
- `;
216
- fs.writeFileSync(pf, content, "utf8");
217
- results.push({
218
- check: "stale-purpose",
219
- category: "stale",
220
- status: "fixed",
221
- file: relPath,
222
- message: `${relPath} \u2014 ${staleDays} days behind ${newestCodeFile}`,
223
- fixAction: "Added stale-since marker"
224
- });
225
- continue;
226
- }
227
- } catch {
228
- }
229
- }
230
- results.push({
231
- check: "stale-purpose",
232
- category: "stale",
233
- status: "entropy",
234
- file: relPath,
235
- message: `${relPath} \u2014 ${staleDays} days behind ${newestCodeFile}`
236
- });
237
- }
238
- }
239
- if (staleCount === 0) {
240
- results.push({ check: "stale-purpose", category: "stale", status: "ok", message: `All ${purposeFiles.length} .purpose files are fresh (within ${STALE_THRESHOLD_DAYS} days)` });
241
- }
242
- return results;
243
- }
244
- async function checkPhantomGates(rootDir, options) {
245
- const results = [];
246
- const portalPath = path.join(rootDir, "portal.yaml");
247
- if (!fs.existsSync(portalPath)) {
248
- results.push({ check: "phantom-gates", category: "phantom", status: "ok", message: "No portal.yaml \u2014 skipped" });
249
- return results;
250
- }
251
- let portalContent;
252
- try {
253
- portalContent = fs.readFileSync(portalPath, "utf8");
254
- } catch {
255
- results.push({ check: "phantom-gates", category: "phantom", status: "ok", message: "Could not read portal.yaml \u2014 skipped" });
256
- return results;
257
- }
258
- const portal = yaml.load(portalContent);
259
- if (!portal?.gates) {
260
- results.push({ check: "phantom-gates", category: "phantom", status: "ok", message: "No gates defined in portal.yaml" });
261
- return results;
262
- }
263
- const gateNames = Object.keys(portal.gates);
264
- let phantomCount = 0;
265
- const codeFiles = await glob("**/*.{ts,tsx,js,jsx,py,rs,go,java,rb}", {
266
- cwd: rootDir,
267
- absolute: true,
268
- ignore: ["**/node_modules/**", "**/dist/**", "**/.git/**", "**/build/**", "**/coverage/**"]
269
- });
270
- for (const gateName of gateNames) {
271
- const bareGate = gateName.startsWith("^") ? gateName.slice(1) : gateName;
272
- let found = false;
273
- for (const codeFile of codeFiles) {
274
- try {
275
- const content = fs.readFileSync(codeFile, "utf8");
276
- if (content.includes(bareGate)) {
277
- found = true;
278
- break;
279
- }
280
- } catch {
281
- continue;
282
- }
283
- }
284
- if (!found) {
285
- phantomCount++;
286
- const symbol = gateName.startsWith("^") ? gateName : `^${gateName}`;
287
- if (shouldFix(options)) {
288
- try {
289
- const freshContent = fs.readFileSync(portalPath, "utf8");
290
- const freshPortal = yaml.load(freshContent);
291
- if (freshPortal.gates && freshPortal.gates[gateName]) {
292
- delete freshPortal.gates[gateName];
293
- }
294
- if (freshPortal.routes) {
295
- for (const [route, gates] of Object.entries(freshPortal.routes)) {
296
- if (Array.isArray(gates) && gates.includes(symbol)) {
297
- const filtered = gates.filter((g) => g !== symbol);
298
- if (filtered.length === 0) {
299
- delete freshPortal.routes[route];
300
- } else {
301
- freshPortal.routes[route] = filtered;
302
- }
303
- }
304
- }
305
- }
306
- fs.writeFileSync(portalPath, yaml.dump(freshPortal, { lineWidth: -1, noRefs: true }), "utf8");
307
- results.push({
308
- check: "phantom-gates",
309
- category: "phantom",
310
- status: "fixed",
311
- symbol,
312
- file: "portal.yaml",
313
- message: `${symbol} \u2014 no code implementation found`,
314
- fixAction: "Removed from portal.yaml"
315
- });
316
- continue;
317
- } catch {
318
- }
319
- }
320
- results.push({
321
- check: "phantom-gates",
322
- category: "phantom",
323
- status: "entropy",
324
- symbol,
325
- file: "portal.yaml",
326
- message: `${symbol} \u2014 defined in portal.yaml but no code references "${bareGate}"`
327
- });
328
- }
329
- }
330
- if (phantomCount === 0) {
331
- results.push({ check: "phantom-gates", category: "phantom", status: "ok", message: `All ${gateNames.length} gates have code references` });
332
- }
333
- return results;
334
- }
335
- async function checkDeadSignals(rootDir, index, _purposeFiles, options) {
336
- const results = [];
337
- if (!index) {
338
- results.push({ check: "dead-signals", category: "dead", status: "ok", message: "Skipped \u2014 no scan-index.json" });
339
- return results;
340
- }
341
- const signals = index.signals || {};
342
- const signalEntries = Object.values(signals);
343
- if (signalEntries.length === 0) {
344
- results.push({ check: "dead-signals", category: "dead", status: "ok", message: "No signals defined" });
345
- return results;
346
- }
347
- const codeFiles = await glob("**/*.{ts,tsx,js,jsx,py,rs,go,java,rb}", {
348
- cwd: rootDir,
349
- absolute: true,
350
- ignore: ["**/node_modules/**", "**/dist/**", "**/.git/**", "**/build/**", "**/coverage/**"]
351
- });
352
- let deadCount = 0;
353
- for (const signal of signalEntries) {
354
- const bareSignal = signal.id;
355
- let found = false;
356
- for (const codeFile of codeFiles) {
357
- try {
358
- const content = fs.readFileSync(codeFile, "utf8");
359
- if (content.includes(bareSignal)) {
360
- found = true;
361
- break;
362
- }
363
- } catch {
364
- continue;
365
- }
366
- }
367
- if (!found) {
368
- deadCount++;
369
- const symbol = signal.symbol;
370
- if (shouldFix(options)) {
371
- const purposePath = signal.path.endsWith(".purpose") ? signal.path : path.join(signal.path, ".purpose");
372
- if (fs.existsSync(purposePath)) {
373
- try {
374
- let content = fs.readFileSync(purposePath, "utf8");
375
- if (!content.includes(`# dead-signal: ${symbol}`)) {
376
- content += `
377
- # dead-signal: ${symbol} \u2014 no handler/listener found (${todayISO()})
378
- `;
379
- fs.writeFileSync(purposePath, content, "utf8");
380
- results.push({
381
- check: "dead-signals",
382
- category: "dead",
383
- status: "fixed",
384
- symbol,
385
- file: purposePath,
386
- message: `${symbol} \u2014 no handler or listener in codebase`,
387
- fixAction: "Added dead-signal marker"
388
- });
389
- continue;
390
- }
391
- } catch {
392
- }
393
- }
394
- }
395
- results.push({
396
- check: "dead-signals",
397
- category: "dead",
398
- status: "entropy",
399
- symbol,
400
- file: signal.path,
401
- message: `${symbol} \u2014 no handler or listener references in codebase`
402
- });
403
- }
404
- }
405
- if (deadCount === 0) {
406
- results.push({ check: "dead-signals", category: "dead", status: "ok", message: `All ${signalEntries.length} signals have code references` });
407
- }
408
- return results;
409
- }
410
- function checkBrokenFlows(rootDir, index, flowIndex, options) {
411
- const results = [];
412
- if (!flowIndex) {
413
- results.push({ check: "broken-flows", category: "broken", status: "ok", message: "No flow-index.json \u2014 skipped" });
414
- return results;
415
- }
416
- if (!index) {
417
- results.push({ check: "broken-flows", category: "broken", status: "ok", message: "No scan-index.json \u2014 skipped" });
418
- return results;
419
- }
420
- const allSymbols = extractAllSymbols(index);
421
- let brokenCount = 0;
422
- for (const [flowId, flow] of Object.entries(flowIndex.flows)) {
423
- for (const step of flow.steps) {
424
- if (!step.symbol) continue;
425
- if (!allSymbols.has(step.symbol)) {
426
- brokenCount++;
427
- if (shouldFix(options)) {
428
- const purposePath = path.join(rootDir, flow.definedIn);
429
- if (fs.existsSync(purposePath)) {
430
- try {
431
- let content = fs.readFileSync(purposePath, "utf8");
432
- if (!content.includes(`# broken: ${step.symbol}`)) {
433
- content += `
434
- # broken: ${step.symbol} not found \u2014 ${flowId} step ${step.id} (${todayISO()})
435
- `;
436
- fs.writeFileSync(purposePath, content, "utf8");
437
- results.push({
438
- check: "broken-flows",
439
- category: "broken",
440
- status: "fixed",
441
- symbol: step.symbol,
442
- file: flow.definedIn,
443
- message: `${flowId} step ${step.id} references ${step.symbol} \u2014 not found`,
444
- fixAction: "Added broken step comment"
445
- });
446
- continue;
447
- }
448
- } catch {
449
- }
450
- }
451
- }
452
- results.push({
453
- check: "broken-flows",
454
- category: "broken",
455
- status: "entropy",
456
- symbol: step.symbol,
457
- file: flow.definedIn,
458
- message: `${flowId} step ${step.id} references ${step.symbol} \u2014 symbol not in scan-index`
459
- });
460
- }
461
- }
462
- }
463
- if (brokenCount === 0) {
464
- results.push({ check: "broken-flows", category: "broken", status: "ok", message: `All flow steps reference valid symbols (${Object.keys(flowIndex.flows).length} flows)` });
465
- }
466
- return results;
467
- }
468
- function checkLoreRot(rootDir, index, options) {
469
- const results = [];
470
- const loreDir = path.join(rootDir, ".paradigm", "lore", "entries");
471
- if (!fs.existsSync(loreDir)) {
472
- results.push({ check: "lore-rot", category: "lore-rot", status: "ok", message: "No lore entries \u2014 skipped" });
473
- return results;
474
- }
475
- const allSymbols = index ? extractAllSymbols(index) : /* @__PURE__ */ new Map();
476
- let rotCount = 0;
477
- let dateDirs;
478
- try {
479
- dateDirs = fs.readdirSync(loreDir).filter((d) => {
480
- const full = path.join(loreDir, d);
481
- return fs.statSync(full).isDirectory();
482
- });
483
- } catch {
484
- results.push({ check: "lore-rot", category: "lore-rot", status: "ok", message: "Could not read lore directory \u2014 skipped" });
485
- return results;
486
- }
487
- let entryCount = 0;
488
- for (const dateDir of dateDirs) {
489
- const datePath = path.join(loreDir, dateDir);
490
- let files;
491
- try {
492
- files = fs.readdirSync(datePath).filter((f) => f.endsWith(".yaml") || f.endsWith(".lore"));
493
- } catch {
494
- continue;
495
- }
496
- for (const file of files) {
497
- entryCount++;
498
- const filePath = path.join(datePath, file);
499
- let entry;
500
- try {
501
- entry = yaml.load(fs.readFileSync(filePath, "utf8"));
502
- } catch {
503
- continue;
504
- }
505
- const symbolsTouched = entry.symbols_touched || [];
506
- const filesModified = entry.files_modified || [];
507
- const filesCreated = entry.files_created || [];
508
- const tags = entry.tags || [];
509
- const deadSymbols = [];
510
- if (index) {
511
- for (const sym of symbolsTouched) {
512
- if (!allSymbols.has(sym)) {
513
- deadSymbols.push(sym);
514
- }
515
- }
516
- }
517
- const deadFiles = [];
518
- for (const f of [...filesModified, ...filesCreated]) {
519
- const absFile = path.isAbsolute(f) ? f : path.join(rootDir, f);
520
- if (!fs.existsSync(absFile)) {
521
- deadFiles.push(f);
522
- }
523
- }
524
- if (deadSymbols.length > 0 || deadFiles.length > 0) {
525
- rotCount++;
526
- const entryId = entry.id || file;
527
- const details = [
528
- ...deadSymbols.length > 0 ? [`dead symbols: ${deadSymbols.join(", ")}`] : [],
529
- ...deadFiles.length > 0 ? [`missing files: ${deadFiles.length}`] : []
530
- ].join("; ");
531
- if (shouldFix(options)) {
532
- try {
533
- if (!tags.includes("stale")) {
534
- const updatedTags = [...tags, "stale"];
535
- entry.tags = updatedTags;
536
- fs.writeFileSync(filePath, yaml.dump(entry, { lineWidth: -1, noRefs: true }), "utf8");
537
- results.push({
538
- check: "lore-rot",
539
- category: "lore-rot",
540
- status: "fixed",
541
- symbol: entryId,
542
- file: filePath,
543
- message: `${entryId} \u2014 ${details}`,
544
- fixAction: "Added stale tag"
545
- });
546
- continue;
547
- }
548
- } catch {
549
- }
550
- }
551
- results.push({
552
- check: "lore-rot",
553
- category: "lore-rot",
554
- status: "entropy",
555
- symbol: entryId,
556
- file: filePath,
557
- message: `${entryId} \u2014 ${details}`
558
- });
559
- }
560
- }
561
- }
562
- if (rotCount === 0) {
563
- results.push({ check: "lore-rot", category: "lore-rot", status: "ok", message: `All ${entryCount} lore entries have valid references` });
564
- }
565
- return results;
566
- }
567
- function checkTagOrphans(rootDir, purposeFiles, options) {
568
- const results = [];
569
- const tagsPath = path.join(rootDir, ".paradigm", "tags.yaml");
570
- if (!fs.existsSync(tagsPath)) {
571
- results.push({ check: "tag-orphans", category: "tag-orphan", status: "ok", message: "No tags.yaml \u2014 skipped" });
572
- return results;
573
- }
574
- let tagsData;
575
- try {
576
- tagsData = yaml.load(fs.readFileSync(tagsPath, "utf8"));
577
- } catch {
578
- results.push({ check: "tag-orphans", category: "tag-orphan", status: "ok", message: "Could not parse tags.yaml \u2014 skipped" });
579
- return results;
580
- }
581
- const definedTags = /* @__PURE__ */ new Set();
582
- for (const section of ["core", "project"]) {
583
- const bucket = tagsData[section];
584
- if (bucket && typeof bucket === "object") {
585
- for (const tag of Object.keys(bucket)) {
586
- definedTags.add(tag);
587
- }
588
- }
589
- }
590
- if (definedTags.size === 0) {
591
- results.push({ check: "tag-orphans", category: "tag-orphan", status: "ok", message: "No tags defined" });
592
- return results;
593
- }
594
- const usedTags = /* @__PURE__ */ new Set();
595
- for (const pf of purposeFiles) {
596
- try {
597
- const content = fs.readFileSync(pf, "utf8");
598
- const tagMatches = content.matchAll(/tags:\s*\[([^\]]*)\]/g);
599
- for (const match of tagMatches) {
600
- const tagList = match[1].split(",").map((t) => t.trim().replace(/['"]/g, "")).filter(Boolean);
601
- for (const tag of tagList) {
602
- usedTags.add(tag);
603
- }
604
- }
605
- const yamlData = yaml.load(content);
606
- if (yamlData) {
607
- let collectTags2 = function(obj) {
608
- if (Array.isArray(obj)) {
609
- for (const item of obj) collectTags2(item);
610
- } else if (obj && typeof obj === "object") {
611
- const rec = obj;
612
- if (Array.isArray(rec.tags)) {
613
- for (const t of rec.tags) {
614
- if (typeof t === "string") usedTags.add(t);
615
- }
616
- }
617
- for (const v of Object.values(rec)) collectTags2(v);
618
- }
619
- };
620
- var collectTags = collectTags2;
621
- collectTags2(yamlData);
622
- }
623
- } catch {
624
- continue;
625
- }
626
- }
627
- let orphanCount = 0;
628
- for (const tag of definedTags) {
629
- if (!usedTags.has(tag)) {
630
- orphanCount++;
631
- if (shouldFix(options)) {
632
- try {
633
- const freshData = yaml.load(fs.readFileSync(tagsPath, "utf8"));
634
- let removed = false;
635
- for (const section of ["core", "project"]) {
636
- if (freshData[section] && freshData[section][tag]) {
637
- delete freshData[section][tag];
638
- removed = true;
639
- }
640
- }
641
- if (removed) {
642
- fs.writeFileSync(tagsPath, yaml.dump(freshData, { lineWidth: -1, noRefs: true }), "utf8");
643
- results.push({
644
- check: "tag-orphans",
645
- category: "tag-orphan",
646
- status: "fixed",
647
- symbol: tag,
648
- file: "tags.yaml",
649
- message: `Tag "${tag}" \u2014 not used in any .purpose file`,
650
- fixAction: "Removed from tags.yaml"
651
- });
652
- continue;
653
- }
654
- } catch {
655
- }
656
- }
657
- results.push({
658
- check: "tag-orphans",
659
- category: "tag-orphan",
660
- status: "entropy",
661
- symbol: tag,
662
- file: ".paradigm/tags.yaml",
663
- message: `Tag "${tag}" \u2014 defined in tag bank but not used in any .purpose file`
664
- });
665
- }
666
- }
667
- if (orphanCount === 0) {
668
- results.push({ check: "tag-orphans", category: "tag-orphan", status: "ok", message: `All ${definedTags.size} tags are in use` });
669
- }
670
- return results;
671
- }
672
- function checkAspectSemanticDrift(rootDir, index, _options) {
673
- const results = [];
674
- const dbPath = path.join(rootDir, ".paradigm", "aspect-graph.db");
675
- if (!fs.existsSync(dbPath)) {
676
- results.push({ check: "aspect-semantic-drift", category: "semantic-drift", status: "ok", message: "No aspect-graph.db \u2014 skipped" });
677
- return results;
678
- }
679
- if (!index || !index.aspects) {
680
- results.push({ check: "aspect-semantic-drift", category: "semantic-drift", status: "ok", message: "No aspects in scan-index \u2014 skipped" });
681
- return results;
682
- }
683
- const aspects = index.aspects;
684
- let driftCount = 0;
685
- for (const [, aspect] of Object.entries(aspects)) {
686
- const purposePath = aspect.path.endsWith(".purpose") ? aspect.path : path.join(aspect.path, ".purpose");
687
- if (!fs.existsSync(purposePath)) continue;
688
- try {
689
- const content = fs.readFileSync(purposePath, "utf8");
690
- const anchorPattern = /anchors?:\s*\n((?:\s+-\s+.+\n?)*)/g;
691
- const anchorMatch = anchorPattern.exec(content);
692
- if (!anchorMatch) continue;
693
- const anchorLines = anchorMatch[1].split("\n").filter((l) => l.trim().startsWith("-"));
694
- for (const line of anchorLines) {
695
- const match = line.match(/- (.+):(\d+)(?:-(\d+))?/);
696
- if (!match) continue;
697
- const anchorFile = match[1].trim();
698
- const startLine = parseInt(match[2], 10);
699
- const endLine = match[3] ? parseInt(match[3], 10) : startLine;
700
- const absAnchorFile = path.isAbsolute(anchorFile) ? anchorFile : path.join(rootDir, anchorFile);
701
- if (!fs.existsSync(absAnchorFile)) continue;
702
- try {
703
- const fileContent = fs.readFileSync(absAnchorFile, "utf8");
704
- const lineCount = fileContent.split("\n").length;
705
- if (startLine > lineCount || endLine > lineCount) {
706
- driftCount++;
707
- }
708
- } catch {
709
- }
710
- }
711
- } catch {
712
- continue;
713
- }
714
- }
715
- if (driftCount > 0) {
716
- results.push({
717
- check: "aspect-semantic-drift",
718
- category: "semantic-drift",
719
- status: "entropy",
720
- message: `${driftCount} aspect anchor(s) reference lines beyond file bounds \u2014 run "paradigm drift check" to repair`
721
- });
722
- } else {
723
- results.push({ check: "aspect-semantic-drift", category: "semantic-drift", status: "ok", message: `Aspect anchors stable (use "paradigm drift check" for deep analysis)` });
724
- }
725
- return results;
726
- }
727
- function checkCoverageDecay(rootDir, purposeFiles, options) {
728
- const results = [];
729
- const sourceDirs = findSourceDirs(rootDir);
730
- if (sourceDirs.length === 0) {
731
- results.push({ check: "coverage-decay", category: "coverage-decay", status: "ok", message: "No source directories found" });
732
- return results;
733
- }
734
- const purposeDirs = new Set(purposeFiles.map((pf) => path.dirname(pf)));
735
- const uncoveredDirs = [];
736
- for (const dir of sourceDirs) {
737
- let covered = false;
738
- let current = dir;
739
- while (current.startsWith(rootDir)) {
740
- if (purposeDirs.has(current)) {
741
- covered = true;
742
- break;
743
- }
744
- const parent = path.dirname(current);
745
- if (parent === current) break;
746
- current = parent;
747
- }
748
- if (!covered) {
749
- uncoveredDirs.push(dir);
750
- }
751
- }
752
- const coveragePct = sourceDirs.length > 0 ? Math.round((sourceDirs.length - uncoveredDirs.length) / sourceDirs.length * 100) : 100;
753
- if (coveragePct < COVERAGE_THRESHOLD) {
754
- if (shouldFix(options)) {
755
- let generatedCount = 0;
756
- for (const dir of uncoveredDirs) {
757
- const purposePath = path.join(dir, ".purpose");
758
- if (!fs.existsSync(purposePath)) {
759
- try {
760
- const dirName = path.basename(dir);
761
- const relDir = path.relative(rootDir, dir);
762
- const skeleton = [
763
- `# ${dirName}`,
764
- `# Auto-generated by paradigm sweep \u2014 ${todayISO()}`,
765
- `# TODO: Add component descriptions and symbol declarations`,
766
- ``,
767
- `#${dirName}:`,
768
- ` description: "${relDir}"`,
769
- ` tags: []`,
770
- ``
771
- ].join("\n");
772
- fs.writeFileSync(purposePath, skeleton, "utf8");
773
- generatedCount++;
774
- } catch {
775
- }
776
- }
777
- }
778
- if (generatedCount > 0) {
779
- results.push({
780
- check: "coverage-decay",
781
- category: "coverage-decay",
782
- status: "fixed",
783
- message: `Coverage at ${coveragePct}% (threshold: ${COVERAGE_THRESHOLD}%) \u2014 generated ${generatedCount} skeleton .purpose files`,
784
- fixAction: `Generated ${generatedCount} skeleton .purpose files`
785
- });
786
- return results;
787
- }
788
- }
789
- results.push({
790
- check: "coverage-decay",
791
- category: "coverage-decay",
792
- status: "entropy",
793
- message: `Coverage at ${coveragePct}% \u2014 below ${COVERAGE_THRESHOLD}% threshold (${uncoveredDirs.length} directories uncovered)`
794
- });
795
- } else {
796
- results.push({
797
- check: "coverage-decay",
798
- category: "coverage-decay",
799
- status: "ok",
800
- message: `Coverage at ${coveragePct}% (${sourceDirs.length} source dirs, ${purposeFiles.length} .purpose files)`
801
- });
802
- }
803
- return results;
804
- }
805
- async function recordSweepLore(rootDir, allResults) {
806
- const entropyResults = allResults.filter((r) => r.status === "entropy");
807
- const fixedResults = allResults.filter((r) => r.status === "fixed");
808
- const okResults = allResults.filter((r) => r.status === "ok");
809
- const categories = new Set(allResults.map((r) => r.category));
810
- const symbolsTouched = allResults.filter((r) => r.symbol).map((r) => r.symbol).filter((s, i, arr) => arr.indexOf(s) === i).slice(0, 20);
811
- const summary = [
812
- `Sweep completed: ${categories.size} categories checked.`,
813
- entropyResults.length > 0 ? `${entropyResults.length} entropy issue(s) found.` : "",
814
- fixedResults.length > 0 ? `${fixedResults.length} issue(s) auto-resolved.` : "",
815
- `${okResults.length} categories healthy.`
816
- ].filter(Boolean).join(" ");
817
- const entry = {
818
- id: "",
819
- type: "insight",
820
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
821
- author: resolveAuthor(),
822
- title: `Sweep: ${entropyResults.length + fixedResults.length} issues, ${fixedResults.length} fixed`,
823
- summary,
824
- symbols_touched: symbolsTouched,
825
- tags: ["arc:sweep", "automated"]
826
- };
827
- try {
828
- await recordLore(rootDir, entry);
829
- return entry.id;
830
- } catch {
831
- return null;
832
- }
833
- }
834
- async function sweepCommand(options) {
835
- const rootDir = options.rootDir || process.cwd();
836
- const quiet = options.quiet;
837
- const spinner = ora();
838
- const tracker = log.command("sweep").start("Running entropy detection");
839
- if (!quiet) {
840
- console.log(chalk.blue("\nParadigm Sweep Report") + chalk.gray(` \u2014 ${todayISO()}`));
841
- console.log(chalk.gray("==================================="));
842
- if (options.dry || options.skipFix) {
843
- console.log(chalk.yellow(" Mode: dry run (no fixes applied)\n"));
844
- }
845
- }
846
- spinner.start("Loading project data...");
847
- const purposeFiles = findPurposeFilesSync(rootDir);
848
- const scanIndex = loadScanIndex(rootDir);
849
- const flowIndex = loadFlowIndex(rootDir);
850
- spinner.succeed(`Loaded: ${purposeFiles.length} .purpose files, scan-index ${scanIndex ? "present" : "absent"}`);
851
- const allResults = [];
852
- const checks = [
853
- { name: "Orphaned symbols", run: () => checkOrphanedSymbols(rootDir, scanIndex, purposeFiles, options) },
854
- { name: "Stale purpose files", run: () => checkStalePurpose(rootDir, purposeFiles, options) },
855
- { name: "Phantom gates", run: () => checkPhantomGates(rootDir, options) },
856
- { name: "Dead signals", run: () => checkDeadSignals(rootDir, scanIndex, purposeFiles, options) },
857
- { name: "Broken flows", run: () => checkBrokenFlows(rootDir, scanIndex, flowIndex, options) },
858
- { name: "Lore rot", run: () => checkLoreRot(rootDir, scanIndex, options) },
859
- { name: "Tag orphans", run: () => checkTagOrphans(rootDir, purposeFiles, options) },
860
- { name: "Aspect semantic drift", run: () => checkAspectSemanticDrift(rootDir, scanIndex, options) },
861
- { name: "Coverage decay", run: () => checkCoverageDecay(rootDir, purposeFiles, options) }
862
- ];
863
- for (const check of checks) {
864
- spinner.start(`Checking: ${check.name}...`);
865
- const checkResults = await check.run();
866
- allResults.push(...checkResults);
867
- const hasEntropy2 = checkResults.some((r) => r.status === "entropy");
868
- const hasFixed = checkResults.some((r) => r.status === "fixed");
869
- if (hasEntropy2) {
870
- spinner.warn(chalk.yellow(`${check.name}`));
871
- } else if (hasFixed) {
872
- spinner.succeed(chalk.green(`${check.name} (auto-fixed)`));
873
- } else {
874
- spinner.succeed(chalk.green(check.name));
875
- }
876
- }
877
- if (!quiet) {
878
- const symbolCount = scanIndex ? extractAllSymbols(scanIndex).size : 0;
879
- console.log(chalk.gray(`
880
- Checked: 9 categories, ${symbolCount} symbols, ${purposeFiles.length} .purpose files
881
- `));
882
- const entropyResults = allResults.filter((r) => r.status === "entropy");
883
- if (entropyResults.length > 0) {
884
- console.log(chalk.red.bold("ENTROPY FOUND:"));
885
- for (const r of entropyResults) {
886
- console.log(` ${chalk.red(`[${r.category}]`)} ${r.message}`);
887
- }
888
- console.log();
889
- }
890
- const okResults = allResults.filter((r) => r.status === "ok");
891
- if (okResults.length > 0) {
892
- console.log(chalk.green.bold("HEALTHY:"));
893
- for (const r of okResults) {
894
- console.log(` ${chalk.green("[ok]")} ${r.check} \u2014 ${r.message}`);
895
- }
896
- console.log();
897
- }
898
- const fixedResults = allResults.filter((r) => r.status === "fixed");
899
- if (fixedResults.length > 0) {
900
- console.log(chalk.cyan.bold("RESOLVED (auto-fixed):"));
901
- for (const r of fixedResults) {
902
- console.log(` ${chalk.cyan("[fixed]")} ${r.message}`);
903
- if (r.fixAction) {
904
- console.log(chalk.gray(` ${r.fixAction}`));
905
- }
906
- }
907
- console.log();
908
- }
909
- const loreId = await recordSweepLore(rootDir, allResults);
910
- const issueCount = entropyResults.length + fixedResults.length;
911
- const parts = [
912
- `${issueCount} issue${issueCount !== 1 ? "s" : ""} found`,
913
- fixedResults.length > 0 ? `${fixedResults.length} auto-resolved` : null,
914
- loreId ? `Lore recorded: ${loreId}` : null
915
- ].filter(Boolean).join(", ");
916
- console.log(chalk.gray(`Summary: ${parts}`));
917
- console.log();
918
- }
919
- const hasEntropy = allResults.some((r) => r.status === "entropy");
920
- if (hasEntropy) {
921
- tracker.error("Entropy detected", {
922
- entropy: allResults.filter((r) => r.status === "entropy").length,
923
- fixed: allResults.filter((r) => r.status === "fixed").length
924
- });
925
- } else {
926
- tracker.success("Clean sweep", {
927
- fixed: allResults.filter((r) => r.status === "fixed").length,
928
- ok: allResults.filter((r) => r.status === "ok").length
929
- });
930
- }
931
- }
932
- export {
933
- sweepCommand
934
- };