@warpgogol/forge 2.19.0 → 2.20.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 (718) hide show
  1. package/README.md +11 -0
  2. package/os/core/core.module.ts +1 -1
  3. package/os/spec/live-spec-merge.test.ts +76 -0
  4. package/os/spec/live-spec-merge.ts +14 -49
  5. package/package.json +1 -1
  6. package/profiles/godot-csharp.yaml +4 -4
  7. package/profiles/typescript-turborepo.yaml +222 -0
  8. package/src/tests/profile-schema.test.ts +1 -1
  9. package/src/types/werkstatt-engine-shims.d.ts +11 -0
  10. package/src/types/werkstatt-shared-shims.d.ts +71 -0
  11. package/dist/bin/cli.d.ts +0 -3
  12. package/dist/bin/cli.d.ts.map +0 -1
  13. package/dist/bin/cli.js +0 -291
  14. package/dist/bin/cli.js.map +0 -1
  15. package/dist/os/adr/adr.module.d.ts +0 -3
  16. package/dist/os/adr/adr.module.d.ts.map +0 -1
  17. package/dist/os/adr/adr.module.js +0 -146
  18. package/dist/os/adr/adr.module.js.map +0 -1
  19. package/dist/os/adr/frontmatter-io.d.ts +0 -12
  20. package/dist/os/adr/frontmatter-io.d.ts.map +0 -1
  21. package/dist/os/adr/frontmatter-io.js +0 -67
  22. package/dist/os/adr/frontmatter-io.js.map +0 -1
  23. package/dist/os/adr/handlers/archive.d.ts +0 -24
  24. package/dist/os/adr/handlers/archive.d.ts.map +0 -1
  25. package/dist/os/adr/handlers/archive.js +0 -194
  26. package/dist/os/adr/handlers/archive.js.map +0 -1
  27. package/dist/os/adr/handlers/implement-stamp.d.ts +0 -4
  28. package/dist/os/adr/handlers/implement-stamp.d.ts.map +0 -1
  29. package/dist/os/adr/handlers/implement-stamp.js +0 -264
  30. package/dist/os/adr/handlers/implement-stamp.js.map +0 -1
  31. package/dist/os/adr/handlers/list-create.d.ts +0 -5
  32. package/dist/os/adr/handlers/list-create.d.ts.map +0 -1
  33. package/dist/os/adr/handlers/list-create.js +0 -201
  34. package/dist/os/adr/handlers/list-create.js.map +0 -1
  35. package/dist/os/adr/handlers/validate.d.ts +0 -4
  36. package/dist/os/adr/handlers/validate.d.ts.map +0 -1
  37. package/dist/os/adr/handlers/validate.js +0 -279
  38. package/dist/os/adr/handlers/validate.js.map +0 -1
  39. package/dist/os/adr/index.d.ts +0 -8
  40. package/dist/os/adr/index.d.ts.map +0 -1
  41. package/dist/os/adr/index.js +0 -18
  42. package/dist/os/adr/index.js.map +0 -1
  43. package/dist/os/adr/types.d.ts +0 -76
  44. package/dist/os/adr/types.d.ts.map +0 -1
  45. package/dist/os/adr/types.js +0 -56
  46. package/dist/os/adr/types.js.map +0 -1
  47. package/dist/os/audit/audit.module.d.ts +0 -3
  48. package/dist/os/audit/audit.module.d.ts.map +0 -1
  49. package/dist/os/audit/audit.module.js +0 -45
  50. package/dist/os/audit/audit.module.js.map +0 -1
  51. package/dist/os/audit/frontmatter-io.d.ts +0 -12
  52. package/dist/os/audit/frontmatter-io.d.ts.map +0 -1
  53. package/dist/os/audit/frontmatter-io.js +0 -71
  54. package/dist/os/audit/frontmatter-io.js.map +0 -1
  55. package/dist/os/audit/handlers/archive.d.ts +0 -4
  56. package/dist/os/audit/handlers/archive.d.ts.map +0 -1
  57. package/dist/os/audit/handlers/archive.js +0 -207
  58. package/dist/os/audit/handlers/archive.js.map +0 -1
  59. package/dist/os/audit/index.d.ts +0 -6
  60. package/dist/os/audit/index.d.ts.map +0 -1
  61. package/dist/os/audit/index.js +0 -16
  62. package/dist/os/audit/index.js.map +0 -1
  63. package/dist/os/audit/types.d.ts +0 -12
  64. package/dist/os/audit/types.d.ts.map +0 -1
  65. package/dist/os/audit/types.js +0 -17
  66. package/dist/os/audit/types.js.map +0 -1
  67. package/dist/os/compass/compass.module.d.ts +0 -3
  68. package/dist/os/compass/compass.module.d.ts.map +0 -1
  69. package/dist/os/compass/compass.module.js +0 -183
  70. package/dist/os/compass/compass.module.js.map +0 -1
  71. package/dist/os/compass/handlers/compass-audit-handler.d.ts +0 -36
  72. package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +0 -1
  73. package/dist/os/compass/handlers/compass-audit-handler.js +0 -260
  74. package/dist/os/compass/handlers/compass-audit-handler.js.map +0 -1
  75. package/dist/os/compass/handlers/compass-change-summary-handler.d.ts +0 -19
  76. package/dist/os/compass/handlers/compass-change-summary-handler.d.ts.map +0 -1
  77. package/dist/os/compass/handlers/compass-change-summary-handler.js +0 -222
  78. package/dist/os/compass/handlers/compass-change-summary-handler.js.map +0 -1
  79. package/dist/os/compass/handlers/compass-inventory-handler.d.ts +0 -28
  80. package/dist/os/compass/handlers/compass-inventory-handler.d.ts.map +0 -1
  81. package/dist/os/compass/handlers/compass-inventory-handler.js +0 -377
  82. package/dist/os/compass/handlers/compass-inventory-handler.js.map +0 -1
  83. package/dist/os/compass/handlers/compass-inventory.d.ts +0 -30
  84. package/dist/os/compass/handlers/compass-inventory.d.ts.map +0 -1
  85. package/dist/os/compass/handlers/compass-inventory.js +0 -462
  86. package/dist/os/compass/handlers/compass-inventory.js.map +0 -1
  87. package/dist/os/compass/handlers/git-revision.d.ts +0 -8
  88. package/dist/os/compass/handlers/git-revision.d.ts.map +0 -1
  89. package/dist/os/compass/handlers/git-revision.js +0 -99
  90. package/dist/os/compass/handlers/git-revision.js.map +0 -1
  91. package/dist/os/compass/handlers/resolve-scan-root.d.ts +0 -3
  92. package/dist/os/compass/handlers/resolve-scan-root.d.ts.map +0 -1
  93. package/dist/os/compass/handlers/resolve-scan-root.js +0 -57
  94. package/dist/os/compass/handlers/resolve-scan-root.js.map +0 -1
  95. package/dist/os/compass/index.d.ts +0 -8
  96. package/dist/os/compass/index.d.ts.map +0 -1
  97. package/dist/os/compass/index.js +0 -19
  98. package/dist/os/compass/index.js.map +0 -1
  99. package/dist/os/core/core.module.d.ts +0 -3
  100. package/dist/os/core/core.module.d.ts.map +0 -1
  101. package/dist/os/core/core.module.js +0 -836
  102. package/dist/os/core/core.module.js.map +0 -1
  103. package/dist/os/core/handlers/assets-check.d.ts +0 -19
  104. package/dist/os/core/handlers/assets-check.d.ts.map +0 -1
  105. package/dist/os/core/handlers/assets-check.js +0 -89
  106. package/dist/os/core/handlers/assets-check.js.map +0 -1
  107. package/dist/os/core/handlers/assets-helpers.d.ts +0 -28
  108. package/dist/os/core/handlers/assets-helpers.d.ts.map +0 -1
  109. package/dist/os/core/handlers/assets-helpers.js +0 -128
  110. package/dist/os/core/handlers/assets-helpers.js.map +0 -1
  111. package/dist/os/core/handlers/assets-list.d.ts +0 -9
  112. package/dist/os/core/handlers/assets-list.d.ts.map +0 -1
  113. package/dist/os/core/handlers/assets-list.js +0 -72
  114. package/dist/os/core/handlers/assets-list.js.map +0 -1
  115. package/dist/os/core/handlers/build.d.ts +0 -16
  116. package/dist/os/core/handlers/build.d.ts.map +0 -1
  117. package/dist/os/core/handlers/build.js +0 -123
  118. package/dist/os/core/handlers/build.js.map +0 -1
  119. package/dist/os/core/handlers/determinism-check.d.ts +0 -20
  120. package/dist/os/core/handlers/determinism-check.d.ts.map +0 -1
  121. package/dist/os/core/handlers/determinism-check.js +0 -289
  122. package/dist/os/core/handlers/determinism-check.js.map +0 -1
  123. package/dist/os/core/handlers/dev.d.ts +0 -10
  124. package/dist/os/core/handlers/dev.d.ts.map +0 -1
  125. package/dist/os/core/handlers/dev.js +0 -102
  126. package/dist/os/core/handlers/dev.js.map +0 -1
  127. package/dist/os/core/handlers/forge-autonomy-validate.d.ts +0 -18
  128. package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +0 -1
  129. package/dist/os/core/handlers/forge-autonomy-validate.js +0 -115
  130. package/dist/os/core/handlers/forge-autonomy-validate.js.map +0 -1
  131. package/dist/os/core/handlers/knowledge-compact.d.ts +0 -4
  132. package/dist/os/core/handlers/knowledge-compact.d.ts.map +0 -1
  133. package/dist/os/core/handlers/knowledge-compact.js +0 -204
  134. package/dist/os/core/handlers/knowledge-compact.js.map +0 -1
  135. package/dist/os/core/handlers/package-health.d.ts +0 -17
  136. package/dist/os/core/handlers/package-health.d.ts.map +0 -1
  137. package/dist/os/core/handlers/package-health.js +0 -196
  138. package/dist/os/core/handlers/package-health.js.map +0 -1
  139. package/dist/os/core/handlers/pinned-check.d.ts +0 -49
  140. package/dist/os/core/handlers/pinned-check.d.ts.map +0 -1
  141. package/dist/os/core/handlers/pinned-check.js +0 -159
  142. package/dist/os/core/handlers/pinned-check.js.map +0 -1
  143. package/dist/os/core/handlers/pinned-init.d.ts +0 -19
  144. package/dist/os/core/handlers/pinned-init.d.ts.map +0 -1
  145. package/dist/os/core/handlers/pinned-init.js +0 -283
  146. package/dist/os/core/handlers/pinned-init.js.map +0 -1
  147. package/dist/os/core/handlers/pinned-types.d.ts +0 -29
  148. package/dist/os/core/handlers/pinned-types.d.ts.map +0 -1
  149. package/dist/os/core/handlers/pinned-types.js +0 -16
  150. package/dist/os/core/handlers/pinned-types.js.map +0 -1
  151. package/dist/os/core/handlers/pinned-validate.d.ts +0 -4
  152. package/dist/os/core/handlers/pinned-validate.d.ts.map +0 -1
  153. package/dist/os/core/handlers/pinned-validate.js +0 -248
  154. package/dist/os/core/handlers/pinned-validate.js.map +0 -1
  155. package/dist/os/core/handlers/profile-resolve.d.ts +0 -13
  156. package/dist/os/core/handlers/profile-resolve.d.ts.map +0 -1
  157. package/dist/os/core/handlers/profile-resolve.js +0 -65
  158. package/dist/os/core/handlers/profile-resolve.js.map +0 -1
  159. package/dist/os/core/handlers/release-prepare.d.ts +0 -25
  160. package/dist/os/core/handlers/release-prepare.d.ts.map +0 -1
  161. package/dist/os/core/handlers/release-prepare.js +0 -228
  162. package/dist/os/core/handlers/release-prepare.js.map +0 -1
  163. package/dist/os/core/handlers/release-publish.d.ts +0 -13
  164. package/dist/os/core/handlers/release-publish.d.ts.map +0 -1
  165. package/dist/os/core/handlers/release-publish.js +0 -173
  166. package/dist/os/core/handlers/release-publish.js.map +0 -1
  167. package/dist/os/core/handlers/validate.d.ts +0 -26
  168. package/dist/os/core/handlers/validate.d.ts.map +0 -1
  169. package/dist/os/core/handlers/validate.js +0 -208
  170. package/dist/os/core/handlers/validate.js.map +0 -1
  171. package/dist/os/core/index.d.ts +0 -2
  172. package/dist/os/core/index.d.ts.map +0 -1
  173. package/dist/os/core/index.js +0 -13
  174. package/dist/os/core/index.js.map +0 -1
  175. package/dist/os/exploration/exploration.module.d.ts +0 -3
  176. package/dist/os/exploration/exploration.module.d.ts.map +0 -1
  177. package/dist/os/exploration/exploration.module.js +0 -83
  178. package/dist/os/exploration/exploration.module.js.map +0 -1
  179. package/dist/os/exploration/frontmatter-io.d.ts +0 -13
  180. package/dist/os/exploration/frontmatter-io.d.ts.map +0 -1
  181. package/dist/os/exploration/frontmatter-io.js +0 -61
  182. package/dist/os/exploration/frontmatter-io.js.map +0 -1
  183. package/dist/os/exploration/handlers/archive.d.ts +0 -4
  184. package/dist/os/exploration/handlers/archive.d.ts.map +0 -1
  185. package/dist/os/exploration/handlers/archive.js +0 -141
  186. package/dist/os/exploration/handlers/archive.js.map +0 -1
  187. package/dist/os/exploration/handlers/list.d.ts +0 -4
  188. package/dist/os/exploration/handlers/list.d.ts.map +0 -1
  189. package/dist/os/exploration/handlers/list.js +0 -64
  190. package/dist/os/exploration/handlers/list.js.map +0 -1
  191. package/dist/os/exploration/handlers/show.d.ts +0 -4
  192. package/dist/os/exploration/handlers/show.d.ts.map +0 -1
  193. package/dist/os/exploration/handlers/show.js +0 -97
  194. package/dist/os/exploration/handlers/show.js.map +0 -1
  195. package/dist/os/exploration/index.d.ts +0 -7
  196. package/dist/os/exploration/index.d.ts.map +0 -1
  197. package/dist/os/exploration/index.js +0 -17
  198. package/dist/os/exploration/index.js.map +0 -1
  199. package/dist/os/exploration/types.d.ts +0 -38
  200. package/dist/os/exploration/types.d.ts.map +0 -1
  201. package/dist/os/exploration/types.js +0 -23
  202. package/dist/os/exploration/types.js.map +0 -1
  203. package/dist/os/mission/handlers/archive.d.ts +0 -4
  204. package/dist/os/mission/handlers/archive.d.ts.map +0 -1
  205. package/dist/os/mission/handlers/archive.js +0 -356
  206. package/dist/os/mission/handlers/archive.js.map +0 -1
  207. package/dist/os/mission/index.d.ts +0 -2
  208. package/dist/os/mission/index.d.ts.map +0 -1
  209. package/dist/os/mission/index.js +0 -2
  210. package/dist/os/mission/index.js.map +0 -1
  211. package/dist/os/mission/mission.module.d.ts +0 -3
  212. package/dist/os/mission/mission.module.d.ts.map +0 -1
  213. package/dist/os/mission/mission.module.js +0 -45
  214. package/dist/os/mission/mission.module.js.map +0 -1
  215. package/dist/os/mission/types.d.ts +0 -23
  216. package/dist/os/mission/types.d.ts.map +0 -1
  217. package/dist/os/mission/types.js +0 -18
  218. package/dist/os/mission/types.js.map +0 -1
  219. package/dist/os/naming/index.d.ts +0 -3
  220. package/dist/os/naming/index.d.ts.map +0 -1
  221. package/dist/os/naming/index.js +0 -14
  222. package/dist/os/naming/index.js.map +0 -1
  223. package/dist/os/naming/naming-convention.d.ts +0 -25
  224. package/dist/os/naming/naming-convention.d.ts.map +0 -1
  225. package/dist/os/naming/naming-convention.js +0 -324
  226. package/dist/os/naming/naming-convention.js.map +0 -1
  227. package/dist/os/naming/naming.module.d.ts +0 -3
  228. package/dist/os/naming/naming.module.d.ts.map +0 -1
  229. package/dist/os/naming/naming.module.js +0 -34
  230. package/dist/os/naming/naming.module.js.map +0 -1
  231. package/dist/os/notes/index.d.ts +0 -2
  232. package/dist/os/notes/index.d.ts.map +0 -1
  233. package/dist/os/notes/index.js +0 -10
  234. package/dist/os/notes/index.js.map +0 -1
  235. package/dist/os/notes/notes.module.d.ts +0 -3
  236. package/dist/os/notes/notes.module.d.ts.map +0 -1
  237. package/dist/os/notes/notes.module.js +0 -84
  238. package/dist/os/notes/notes.module.js.map +0 -1
  239. package/dist/os/plan/frontmatter-io.d.ts +0 -12
  240. package/dist/os/plan/frontmatter-io.d.ts.map +0 -1
  241. package/dist/os/plan/frontmatter-io.js +0 -69
  242. package/dist/os/plan/frontmatter-io.js.map +0 -1
  243. package/dist/os/plan/handlers/archive.d.ts +0 -4
  244. package/dist/os/plan/handlers/archive.d.ts.map +0 -1
  245. package/dist/os/plan/handlers/archive.js +0 -206
  246. package/dist/os/plan/handlers/archive.js.map +0 -1
  247. package/dist/os/plan/index.d.ts +0 -6
  248. package/dist/os/plan/index.d.ts.map +0 -1
  249. package/dist/os/plan/index.js +0 -16
  250. package/dist/os/plan/index.js.map +0 -1
  251. package/dist/os/plan/plan.module.d.ts +0 -3
  252. package/dist/os/plan/plan.module.d.ts.map +0 -1
  253. package/dist/os/plan/plan.module.js +0 -45
  254. package/dist/os/plan/plan.module.js.map +0 -1
  255. package/dist/os/plan/types.d.ts +0 -12
  256. package/dist/os/plan/types.d.ts.map +0 -1
  257. package/dist/os/plan/types.js +0 -17
  258. package/dist/os/plan/types.js.map +0 -1
  259. package/dist/os/plugin/plugin.module.d.ts +0 -25
  260. package/dist/os/plugin/plugin.module.d.ts.map +0 -1
  261. package/dist/os/plugin/plugin.module.js +0 -208
  262. package/dist/os/plugin/plugin.module.js.map +0 -1
  263. package/dist/os/program/discovery.d.ts +0 -61
  264. package/dist/os/program/discovery.d.ts.map +0 -1
  265. package/dist/os/program/discovery.js +0 -236
  266. package/dist/os/program/discovery.js.map +0 -1
  267. package/dist/os/program/handlers/complete.d.ts +0 -12
  268. package/dist/os/program/handlers/complete.d.ts.map +0 -1
  269. package/dist/os/program/handlers/complete.js +0 -362
  270. package/dist/os/program/handlers/complete.js.map +0 -1
  271. package/dist/os/program/handlers/lease.d.ts +0 -13
  272. package/dist/os/program/handlers/lease.d.ts.map +0 -1
  273. package/dist/os/program/handlers/lease.js +0 -328
  274. package/dist/os/program/handlers/lease.js.map +0 -1
  275. package/dist/os/program/handlers/seal.d.ts +0 -12
  276. package/dist/os/program/handlers/seal.d.ts.map +0 -1
  277. package/dist/os/program/handlers/seal.js +0 -277
  278. package/dist/os/program/handlers/seal.js.map +0 -1
  279. package/dist/os/program/handlers/validate.d.ts +0 -14
  280. package/dist/os/program/handlers/validate.d.ts.map +0 -1
  281. package/dist/os/program/handlers/validate.js +0 -170
  282. package/dist/os/program/handlers/validate.js.map +0 -1
  283. package/dist/os/program/lease.d.ts +0 -39
  284. package/dist/os/program/lease.d.ts.map +0 -1
  285. package/dist/os/program/lease.js +0 -129
  286. package/dist/os/program/lease.js.map +0 -1
  287. package/dist/os/program/program.module.d.ts +0 -3
  288. package/dist/os/program/program.module.d.ts.map +0 -1
  289. package/dist/os/program/program.module.js +0 -202
  290. package/dist/os/program/program.module.js.map +0 -1
  291. package/dist/os/program/schemas.d.ts +0 -225
  292. package/dist/os/program/schemas.d.ts.map +0 -1
  293. package/dist/os/program/schemas.js +0 -174
  294. package/dist/os/program/schemas.js.map +0 -1
  295. package/dist/os/program/state.d.ts +0 -38
  296. package/dist/os/program/state.d.ts.map +0 -1
  297. package/dist/os/program/state.js +0 -189
  298. package/dist/os/program/state.js.map +0 -1
  299. package/dist/os/rfc/acceptance.d.ts +0 -15
  300. package/dist/os/rfc/acceptance.d.ts.map +0 -1
  301. package/dist/os/rfc/acceptance.js +0 -318
  302. package/dist/os/rfc/acceptance.js.map +0 -1
  303. package/dist/os/rfc/decision-log.d.ts +0 -6
  304. package/dist/os/rfc/decision-log.d.ts.map +0 -1
  305. package/dist/os/rfc/decision-log.js +0 -269
  306. package/dist/os/rfc/decision-log.js.map +0 -1
  307. package/dist/os/rfc/dna-trace.d.ts +0 -27
  308. package/dist/os/rfc/dna-trace.d.ts.map +0 -1
  309. package/dist/os/rfc/dna-trace.js +0 -214
  310. package/dist/os/rfc/dna-trace.js.map +0 -1
  311. package/dist/os/rfc/frontmatter-io.d.ts +0 -18
  312. package/dist/os/rfc/frontmatter-io.d.ts.map +0 -1
  313. package/dist/os/rfc/frontmatter-io.js +0 -110
  314. package/dist/os/rfc/frontmatter-io.js.map +0 -1
  315. package/dist/os/rfc/handlers/archive.d.ts +0 -25
  316. package/dist/os/rfc/handlers/archive.d.ts.map +0 -1
  317. package/dist/os/rfc/handlers/archive.js +0 -247
  318. package/dist/os/rfc/handlers/archive.js.map +0 -1
  319. package/dist/os/rfc/handlers/check.d.ts +0 -4
  320. package/dist/os/rfc/handlers/check.d.ts.map +0 -1
  321. package/dist/os/rfc/handlers/check.js +0 -203
  322. package/dist/os/rfc/handlers/check.js.map +0 -1
  323. package/dist/os/rfc/handlers/implement-stamp.d.ts +0 -4
  324. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +0 -1
  325. package/dist/os/rfc/handlers/implement-stamp.js +0 -426
  326. package/dist/os/rfc/handlers/implement-stamp.js.map +0 -1
  327. package/dist/os/rfc/handlers/index-graph.d.ts +0 -13
  328. package/dist/os/rfc/handlers/index-graph.d.ts.map +0 -1
  329. package/dist/os/rfc/handlers/index-graph.js +0 -192
  330. package/dist/os/rfc/handlers/index-graph.js.map +0 -1
  331. package/dist/os/rfc/handlers/lifecycle.d.ts +0 -13
  332. package/dist/os/rfc/handlers/lifecycle.d.ts.map +0 -1
  333. package/dist/os/rfc/handlers/lifecycle.js +0 -155
  334. package/dist/os/rfc/handlers/lifecycle.js.map +0 -1
  335. package/dist/os/rfc/handlers/list-create.d.ts +0 -6
  336. package/dist/os/rfc/handlers/list-create.d.ts.map +0 -1
  337. package/dist/os/rfc/handlers/list-create.js +0 -260
  338. package/dist/os/rfc/handlers/list-create.js.map +0 -1
  339. package/dist/os/rfc/handlers/pipeline-status.d.ts +0 -26
  340. package/dist/os/rfc/handlers/pipeline-status.d.ts.map +0 -1
  341. package/dist/os/rfc/handlers/pipeline-status.js +0 -124
  342. package/dist/os/rfc/handlers/pipeline-status.js.map +0 -1
  343. package/dist/os/rfc/handlers/shared.d.ts +0 -22
  344. package/dist/os/rfc/handlers/shared.d.ts.map +0 -1
  345. package/dist/os/rfc/handlers/shared.js +0 -105
  346. package/dist/os/rfc/handlers/shared.js.map +0 -1
  347. package/dist/os/rfc/handlers/supersede-propose.d.ts +0 -4
  348. package/dist/os/rfc/handlers/supersede-propose.d.ts.map +0 -1
  349. package/dist/os/rfc/handlers/supersede-propose.js +0 -203
  350. package/dist/os/rfc/handlers/supersede-propose.js.map +0 -1
  351. package/dist/os/rfc/handlers/validate-rules.d.ts +0 -32
  352. package/dist/os/rfc/handlers/validate-rules.d.ts.map +0 -1
  353. package/dist/os/rfc/handlers/validate-rules.js +0 -590
  354. package/dist/os/rfc/handlers/validate-rules.js.map +0 -1
  355. package/dist/os/rfc/handlers/validate.d.ts +0 -4
  356. package/dist/os/rfc/handlers/validate.d.ts.map +0 -1
  357. package/dist/os/rfc/handlers/validate.js +0 -122
  358. package/dist/os/rfc/handlers/validate.js.map +0 -1
  359. package/dist/os/rfc/handlers.d.ts +0 -7
  360. package/dist/os/rfc/handlers.d.ts.map +0 -1
  361. package/dist/os/rfc/handlers.js +0 -19
  362. package/dist/os/rfc/handlers.js.map +0 -1
  363. package/dist/os/rfc/index.d.ts +0 -18
  364. package/dist/os/rfc/index.d.ts.map +0 -1
  365. package/dist/os/rfc/index.js +0 -24
  366. package/dist/os/rfc/index.js.map +0 -1
  367. package/dist/os/rfc/rfc.module.d.ts +0 -3
  368. package/dist/os/rfc/rfc.module.d.ts.map +0 -1
  369. package/dist/os/rfc/rfc.module.js +0 -367
  370. package/dist/os/rfc/rfc.module.js.map +0 -1
  371. package/dist/os/rfc/types.d.ts +0 -483
  372. package/dist/os/rfc/types.d.ts.map +0 -1
  373. package/dist/os/rfc/types.js +0 -100
  374. package/dist/os/rfc/types.js.map +0 -1
  375. package/dist/os/rfc/verification-evidence.d.ts +0 -8
  376. package/dist/os/rfc/verification-evidence.d.ts.map +0 -1
  377. package/dist/os/rfc/verification-evidence.js +0 -184
  378. package/dist/os/rfc/verification-evidence.js.map +0 -1
  379. package/dist/os/session/atif-parser.d.ts +0 -29
  380. package/dist/os/session/atif-parser.d.ts.map +0 -1
  381. package/dist/os/session/atif-parser.js +0 -140
  382. package/dist/os/session/atif-parser.js.map +0 -1
  383. package/dist/os/session/frontmatter-io.d.ts +0 -31
  384. package/dist/os/session/frontmatter-io.d.ts.map +0 -1
  385. package/dist/os/session/frontmatter-io.js +0 -146
  386. package/dist/os/session/frontmatter-io.js.map +0 -1
  387. package/dist/os/session/handlers/archive.d.ts +0 -4
  388. package/dist/os/session/handlers/archive.d.ts.map +0 -1
  389. package/dist/os/session/handlers/archive.js +0 -241
  390. package/dist/os/session/handlers/archive.js.map +0 -1
  391. package/dist/os/session/handlers/list.d.ts +0 -4
  392. package/dist/os/session/handlers/list.d.ts.map +0 -1
  393. package/dist/os/session/handlers/list.js +0 -147
  394. package/dist/os/session/handlers/list.js.map +0 -1
  395. package/dist/os/session/handlers/save.d.ts +0 -6
  396. package/dist/os/session/handlers/save.d.ts.map +0 -1
  397. package/dist/os/session/handlers/save.js +0 -297
  398. package/dist/os/session/handlers/save.js.map +0 -1
  399. package/dist/os/session/handlers/validate.d.ts +0 -4
  400. package/dist/os/session/handlers/validate.d.ts.map +0 -1
  401. package/dist/os/session/handlers/validate.js +0 -224
  402. package/dist/os/session/handlers/validate.js.map +0 -1
  403. package/dist/os/session/index.d.ts +0 -9
  404. package/dist/os/session/index.d.ts.map +0 -1
  405. package/dist/os/session/index.js +0 -20
  406. package/dist/os/session/index.js.map +0 -1
  407. package/dist/os/session/session.module.d.ts +0 -3
  408. package/dist/os/session/session.module.d.ts.map +0 -1
  409. package/dist/os/session/session.module.js +0 -116
  410. package/dist/os/session/session.module.js.map +0 -1
  411. package/dist/os/session/types.d.ts +0 -131
  412. package/dist/os/session/types.d.ts.map +0 -1
  413. package/dist/os/session/types.js +0 -59
  414. package/dist/os/session/types.js.map +0 -1
  415. package/dist/os/spec/live-spec-list.d.ts +0 -4
  416. package/dist/os/spec/live-spec-list.d.ts.map +0 -1
  417. package/dist/os/spec/live-spec-list.js +0 -72
  418. package/dist/os/spec/live-spec-list.js.map +0 -1
  419. package/dist/os/spec/live-spec-merge.d.ts +0 -4
  420. package/dist/os/spec/live-spec-merge.d.ts.map +0 -1
  421. package/dist/os/spec/live-spec-merge.js +0 -345
  422. package/dist/os/spec/live-spec-merge.js.map +0 -1
  423. package/dist/os/spec/live-spec-show.d.ts +0 -4
  424. package/dist/os/spec/live-spec-show.d.ts.map +0 -1
  425. package/dist/os/spec/live-spec-show.js +0 -105
  426. package/dist/os/spec/live-spec-show.js.map +0 -1
  427. package/dist/os/spec/live-spec-types.d.ts +0 -71
  428. package/dist/os/spec/live-spec-types.d.ts.map +0 -1
  429. package/dist/os/spec/live-spec-types.js +0 -14
  430. package/dist/os/spec/live-spec-types.js.map +0 -1
  431. package/dist/os/spec/live-spec-validate.d.ts +0 -4
  432. package/dist/os/spec/live-spec-validate.d.ts.map +0 -1
  433. package/dist/os/spec/live-spec-validate.js +0 -140
  434. package/dist/os/spec/live-spec-validate.js.map +0 -1
  435. package/dist/os/spec/spec-materialize.d.ts +0 -21
  436. package/dist/os/spec/spec-materialize.d.ts.map +0 -1
  437. package/dist/os/spec/spec-materialize.js +0 -342
  438. package/dist/os/spec/spec-materialize.js.map +0 -1
  439. package/dist/os/spec/spec-schema.d.ts +0 -126
  440. package/dist/os/spec/spec-schema.d.ts.map +0 -1
  441. package/dist/os/spec/spec-schema.js +0 -118
  442. package/dist/os/spec/spec-schema.js.map +0 -1
  443. package/dist/os/spec/spec-status.d.ts +0 -33
  444. package/dist/os/spec/spec-status.d.ts.map +0 -1
  445. package/dist/os/spec/spec-status.js +0 -228
  446. package/dist/os/spec/spec-status.js.map +0 -1
  447. package/dist/os/spec/spec-validate.d.ts +0 -4
  448. package/dist/os/spec/spec-validate.d.ts.map +0 -1
  449. package/dist/os/spec/spec-validate.js +0 -435
  450. package/dist/os/spec/spec-validate.js.map +0 -1
  451. package/dist/os/spec/spec.module.d.ts +0 -3
  452. package/dist/os/spec/spec.module.d.ts.map +0 -1
  453. package/dist/os/spec/spec.module.js +0 -120
  454. package/dist/os/spec/spec.module.js.map +0 -1
  455. package/dist/os/werkstatt/handlers/lock.d.ts +0 -10
  456. package/dist/os/werkstatt/handlers/lock.d.ts.map +0 -1
  457. package/dist/os/werkstatt/handlers/lock.js +0 -153
  458. package/dist/os/werkstatt/handlers/lock.js.map +0 -1
  459. package/dist/os/werkstatt/handlers/schema.d.ts +0 -33
  460. package/dist/os/werkstatt/handlers/schema.d.ts.map +0 -1
  461. package/dist/os/werkstatt/handlers/schema.js +0 -42
  462. package/dist/os/werkstatt/handlers/schema.js.map +0 -1
  463. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.d.ts +0 -15
  464. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.d.ts.map +0 -1
  465. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js +0 -152
  466. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js.map +0 -1
  467. package/dist/os/werkstatt/handlers/werkstatt-lock-status.d.ts +0 -18
  468. package/dist/os/werkstatt/handlers/werkstatt-lock-status.d.ts.map +0 -1
  469. package/dist/os/werkstatt/handlers/werkstatt-lock-status.js +0 -51
  470. package/dist/os/werkstatt/handlers/werkstatt-lock-status.js.map +0 -1
  471. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts +0 -11
  472. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts.map +0 -1
  473. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js +0 -79
  474. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js.map +0 -1
  475. package/dist/os/werkstatt/handlers/workspace-deps.d.ts +0 -12
  476. package/dist/os/werkstatt/handlers/workspace-deps.d.ts.map +0 -1
  477. package/dist/os/werkstatt/handlers/workspace-deps.js +0 -42
  478. package/dist/os/werkstatt/handlers/workspace-deps.js.map +0 -1
  479. package/dist/os/werkstatt/index.d.ts +0 -7
  480. package/dist/os/werkstatt/index.d.ts.map +0 -1
  481. package/dist/os/werkstatt/index.js +0 -18
  482. package/dist/os/werkstatt/index.js.map +0 -1
  483. package/dist/os/werkstatt/werkstatt.module.d.ts +0 -3
  484. package/dist/os/werkstatt/werkstatt.module.d.ts.map +0 -1
  485. package/dist/os/werkstatt/werkstatt.module.js +0 -59
  486. package/dist/os/werkstatt/werkstatt.module.js.map +0 -1
  487. package/dist/os/workflow/handlers.d.ts +0 -12
  488. package/dist/os/workflow/handlers.d.ts.map +0 -1
  489. package/dist/os/workflow/handlers.js +0 -262
  490. package/dist/os/workflow/handlers.js.map +0 -1
  491. package/dist/os/workflow/index.d.ts +0 -4
  492. package/dist/os/workflow/index.d.ts.map +0 -1
  493. package/dist/os/workflow/index.js +0 -18
  494. package/dist/os/workflow/index.js.map +0 -1
  495. package/dist/os/workflow/types.d.ts +0 -69
  496. package/dist/os/workflow/types.d.ts.map +0 -1
  497. package/dist/os/workflow/types.js +0 -23
  498. package/dist/os/workflow/types.js.map +0 -1
  499. package/dist/os/workflow/workflow.module.d.ts +0 -3
  500. package/dist/os/workflow/workflow.module.d.ts.map +0 -1
  501. package/dist/os/workflow/workflow.module.js +0 -49
  502. package/dist/os/workflow/workflow.module.js.map +0 -1
  503. package/dist/src/cli-output.d.ts +0 -5
  504. package/dist/src/cli-output.d.ts.map +0 -1
  505. package/dist/src/cli-output.js +0 -53
  506. package/dist/src/cli-output.js.map +0 -1
  507. package/dist/src/compass/contract-registry.d.ts +0 -7
  508. package/dist/src/compass/contract-registry.d.ts.map +0 -1
  509. package/dist/src/compass/contract-registry.js +0 -93
  510. package/dist/src/compass/contract-registry.js.map +0 -1
  511. package/dist/src/compass/types.d.ts +0 -28
  512. package/dist/src/compass/types.d.ts.map +0 -1
  513. package/dist/src/compass/types.js +0 -14
  514. package/dist/src/compass/types.js.map +0 -1
  515. package/dist/src/config/forge-config.d.ts +0 -242
  516. package/dist/src/config/forge-config.d.ts.map +0 -1
  517. package/dist/src/config/forge-config.js +0 -363
  518. package/dist/src/config/forge-config.js.map +0 -1
  519. package/dist/src/forge-module.d.ts +0 -17
  520. package/dist/src/forge-module.d.ts.map +0 -1
  521. package/dist/src/forge-module.js +0 -16
  522. package/dist/src/forge-module.js.map +0 -1
  523. package/dist/src/index.d.ts +0 -39
  524. package/dist/src/index.d.ts.map +0 -1
  525. package/dist/src/index.js +0 -59
  526. package/dist/src/index.js.map +0 -1
  527. package/dist/src/knowledge/budgets.d.ts +0 -38
  528. package/dist/src/knowledge/budgets.d.ts.map +0 -1
  529. package/dist/src/knowledge/budgets.js +0 -157
  530. package/dist/src/knowledge/budgets.js.map +0 -1
  531. package/dist/src/knowledge/compact.d.ts +0 -47
  532. package/dist/src/knowledge/compact.d.ts.map +0 -1
  533. package/dist/src/knowledge/compact.js +0 -320
  534. package/dist/src/knowledge/compact.js.map +0 -1
  535. package/dist/src/knowledge/index.d.ts +0 -7
  536. package/dist/src/knowledge/index.d.ts.map +0 -1
  537. package/dist/src/knowledge/index.js +0 -19
  538. package/dist/src/knowledge/index.js.map +0 -1
  539. package/dist/src/knowledge/parse.d.ts +0 -3
  540. package/dist/src/knowledge/parse.d.ts.map +0 -1
  541. package/dist/src/knowledge/parse.js +0 -205
  542. package/dist/src/knowledge/parse.js.map +0 -1
  543. package/dist/src/knowledge/promote.d.ts +0 -37
  544. package/dist/src/knowledge/promote.d.ts.map +0 -1
  545. package/dist/src/knowledge/promote.js +0 -120
  546. package/dist/src/knowledge/promote.js.map +0 -1
  547. package/dist/src/knowledge/schema.d.ts +0 -61
  548. package/dist/src/knowledge/schema.d.ts.map +0 -1
  549. package/dist/src/knowledge/schema.js +0 -64
  550. package/dist/src/knowledge/schema.js.map +0 -1
  551. package/dist/src/knowledge/serialize.d.ts +0 -3
  552. package/dist/src/knowledge/serialize.d.ts.map +0 -1
  553. package/dist/src/knowledge/serialize.js +0 -67
  554. package/dist/src/knowledge/serialize.js.map +0 -1
  555. package/dist/src/migration-adapters/git-utils.d.ts +0 -3
  556. package/dist/src/migration-adapters/git-utils.d.ts.map +0 -1
  557. package/dist/src/migration-adapters/git-utils.js +0 -64
  558. package/dist/src/migration-adapters/git-utils.js.map +0 -1
  559. package/dist/src/migration-adapters/ignored-files.d.ts +0 -12
  560. package/dist/src/migration-adapters/ignored-files.d.ts.map +0 -1
  561. package/dist/src/migration-adapters/ignored-files.js +0 -190
  562. package/dist/src/migration-adapters/ignored-files.js.map +0 -1
  563. package/dist/src/migration-adapters/index.d.ts +0 -8
  564. package/dist/src/migration-adapters/index.d.ts.map +0 -1
  565. package/dist/src/migration-adapters/index.js +0 -17
  566. package/dist/src/migration-adapters/index.js.map +0 -1
  567. package/dist/src/migration-adapters/node-typescript-pnpm/index.d.ts +0 -3
  568. package/dist/src/migration-adapters/node-typescript-pnpm/index.d.ts.map +0 -1
  569. package/dist/src/migration-adapters/node-typescript-pnpm/index.js +0 -141
  570. package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +0 -1
  571. package/dist/src/migration-adapters/phaser-pnpm/index.d.ts +0 -3
  572. package/dist/src/migration-adapters/phaser-pnpm/index.d.ts.map +0 -1
  573. package/dist/src/migration-adapters/phaser-pnpm/index.js +0 -142
  574. package/dist/src/migration-adapters/phaser-pnpm/index.js.map +0 -1
  575. package/dist/src/migration-adapters/registry.d.ts +0 -6
  576. package/dist/src/migration-adapters/registry.d.ts.map +0 -1
  577. package/dist/src/migration-adapters/registry.js +0 -55
  578. package/dist/src/migration-adapters/registry.js.map +0 -1
  579. package/dist/src/migration-adapters/types.d.ts +0 -35
  580. package/dist/src/migration-adapters/types.d.ts.map +0 -1
  581. package/dist/src/migration-adapters/types.js +0 -31
  582. package/dist/src/migration-adapters/types.js.map +0 -1
  583. package/dist/src/onboarding/agents-generate.d.ts +0 -31
  584. package/dist/src/onboarding/agents-generate.d.ts.map +0 -1
  585. package/dist/src/onboarding/agents-generate.js +0 -372
  586. package/dist/src/onboarding/agents-generate.js.map +0 -1
  587. package/dist/src/onboarding/create.d.ts +0 -12
  588. package/dist/src/onboarding/create.d.ts.map +0 -1
  589. package/dist/src/onboarding/create.js +0 -389
  590. package/dist/src/onboarding/create.js.map +0 -1
  591. package/dist/src/onboarding/doctor.d.ts +0 -45
  592. package/dist/src/onboarding/doctor.d.ts.map +0 -1
  593. package/dist/src/onboarding/doctor.js +0 -1190
  594. package/dist/src/onboarding/doctor.js.map +0 -1
  595. package/dist/src/onboarding/init.d.ts +0 -36
  596. package/dist/src/onboarding/init.d.ts.map +0 -1
  597. package/dist/src/onboarding/init.js +0 -362
  598. package/dist/src/onboarding/init.js.map +0 -1
  599. package/dist/src/onboarding/invariant-engine.d.ts +0 -17
  600. package/dist/src/onboarding/invariant-engine.d.ts.map +0 -1
  601. package/dist/src/onboarding/invariant-engine.js +0 -416
  602. package/dist/src/onboarding/invariant-engine.js.map +0 -1
  603. package/dist/src/onboarding/memory-scaffold.d.ts +0 -18
  604. package/dist/src/onboarding/memory-scaffold.d.ts.map +0 -1
  605. package/dist/src/onboarding/memory-scaffold.js +0 -151
  606. package/dist/src/onboarding/memory-scaffold.js.map +0 -1
  607. package/dist/src/onboarding/nested-agents-generate.d.ts +0 -18
  608. package/dist/src/onboarding/nested-agents-generate.d.ts.map +0 -1
  609. package/dist/src/onboarding/nested-agents-generate.js +0 -69
  610. package/dist/src/onboarding/nested-agents-generate.js.map +0 -1
  611. package/dist/src/onboarding/nested-agents-templates.d.ts +0 -26
  612. package/dist/src/onboarding/nested-agents-templates.d.ts.map +0 -1
  613. package/dist/src/onboarding/nested-agents-templates.js +0 -178
  614. package/dist/src/onboarding/nested-agents-templates.js.map +0 -1
  615. package/dist/src/onboarding/profile-validate.d.ts +0 -13
  616. package/dist/src/onboarding/profile-validate.d.ts.map +0 -1
  617. package/dist/src/onboarding/profile-validate.js +0 -109
  618. package/dist/src/onboarding/profile-validate.js.map +0 -1
  619. package/dist/src/onboarding/scaffold-project.d.ts +0 -12
  620. package/dist/src/onboarding/scaffold-project.d.ts.map +0 -1
  621. package/dist/src/onboarding/scaffold-project.js +0 -264
  622. package/dist/src/onboarding/scaffold-project.js.map +0 -1
  623. package/dist/src/onboarding/scaffold.d.ts +0 -15
  624. package/dist/src/onboarding/scaffold.d.ts.map +0 -1
  625. package/dist/src/onboarding/scaffold.js +0 -121
  626. package/dist/src/onboarding/scaffold.js.map +0 -1
  627. package/dist/src/onboarding/upgrade.d.ts +0 -27
  628. package/dist/src/onboarding/upgrade.d.ts.map +0 -1
  629. package/dist/src/onboarding/upgrade.js +0 -453
  630. package/dist/src/onboarding/upgrade.js.map +0 -1
  631. package/dist/src/onboarding/workspace-discovery.d.ts +0 -11
  632. package/dist/src/onboarding/workspace-discovery.d.ts.map +0 -1
  633. package/dist/src/onboarding/workspace-discovery.js +0 -138
  634. package/dist/src/onboarding/workspace-discovery.js.map +0 -1
  635. package/dist/src/plugin/ForgePluginManifest.d.ts +0 -38
  636. package/dist/src/plugin/ForgePluginManifest.d.ts.map +0 -1
  637. package/dist/src/plugin/ForgePluginManifest.js +0 -52
  638. package/dist/src/plugin/ForgePluginManifest.js.map +0 -1
  639. package/dist/src/profiles/profile-schema.d.ts +0 -361
  640. package/dist/src/profiles/profile-schema.d.ts.map +0 -1
  641. package/dist/src/profiles/profile-schema.js +0 -208
  642. package/dist/src/profiles/profile-schema.js.map +0 -1
  643. package/dist/src/profiles/stack-profile.d.ts +0 -173
  644. package/dist/src/profiles/stack-profile.d.ts.map +0 -1
  645. package/dist/src/profiles/stack-profile.js +0 -148
  646. package/dist/src/profiles/stack-profile.js.map +0 -1
  647. package/dist/src/profiles/terminology-utils.d.ts +0 -8
  648. package/dist/src/profiles/terminology-utils.d.ts.map +0 -1
  649. package/dist/src/profiles/terminology-utils.js +0 -31
  650. package/dist/src/profiles/terminology-utils.js.map +0 -1
  651. package/dist/src/registry.d.ts +0 -38
  652. package/dist/src/registry.d.ts.map +0 -1
  653. package/dist/src/registry.js +0 -174
  654. package/dist/src/registry.js.map +0 -1
  655. package/dist/src/skill-schema.d.ts +0 -30
  656. package/dist/src/skill-schema.d.ts.map +0 -1
  657. package/dist/src/skill-schema.js +0 -34
  658. package/dist/src/skill-schema.js.map +0 -1
  659. package/dist/src/types.d.ts +0 -154
  660. package/dist/src/types.d.ts.map +0 -1
  661. package/dist/src/types.js +0 -17
  662. package/dist/src/types.js.map +0 -1
  663. package/dist/src/utils/fs-atomic.d.ts +0 -7
  664. package/dist/src/utils/fs-atomic.d.ts.map +0 -1
  665. package/dist/src/utils/fs-atomic.js +0 -81
  666. package/dist/src/utils/fs-atomic.js.map +0 -1
  667. package/dist/src/utils/fs-idempotent.d.ts +0 -2
  668. package/dist/src/utils/fs-idempotent.d.ts.map +0 -1
  669. package/dist/src/utils/fs-idempotent.js +0 -39
  670. package/dist/src/utils/fs-idempotent.js.map +0 -1
  671. package/dist/src/utils/fs-trash-sync.d.ts +0 -2
  672. package/dist/src/utils/fs-trash-sync.d.ts.map +0 -1
  673. package/dist/src/utils/fs-trash-sync.js +0 -34
  674. package/dist/src/utils/fs-trash-sync.js.map +0 -1
  675. package/dist/src/utils/fs-trash.d.ts +0 -2
  676. package/dist/src/utils/fs-trash.d.ts.map +0 -1
  677. package/dist/src/utils/fs-trash.js +0 -24
  678. package/dist/src/utils/fs-trash.js.map +0 -1
  679. package/dist/src/utils/fs.d.ts +0 -8
  680. package/dist/src/utils/fs.d.ts.map +0 -1
  681. package/dist/src/utils/fs.js +0 -60
  682. package/dist/src/utils/fs.js.map +0 -1
  683. package/dist/src/utils/generated-marker.d.ts +0 -21
  684. package/dist/src/utils/generated-marker.d.ts.map +0 -1
  685. package/dist/src/utils/generated-marker.js +0 -128
  686. package/dist/src/utils/generated-marker.js.map +0 -1
  687. package/dist/src/utils/hash.d.ts +0 -2
  688. package/dist/src/utils/hash.d.ts.map +0 -1
  689. package/dist/src/utils/hash.js +0 -18
  690. package/dist/src/utils/hash.js.map +0 -1
  691. package/dist/src/utils/index.d.ts +0 -9
  692. package/dist/src/utils/index.d.ts.map +0 -1
  693. package/dist/src/utils/index.js +0 -21
  694. package/dist/src/utils/index.js.map +0 -1
  695. package/dist/src/utils/string-utils.d.ts +0 -2
  696. package/dist/src/utils/string-utils.d.ts.map +0 -1
  697. package/dist/src/utils/string-utils.js +0 -19
  698. package/dist/src/utils/string-utils.js.map +0 -1
  699. package/dist/src/validators/note-frontmatter-validate.d.ts +0 -20
  700. package/dist/src/validators/note-frontmatter-validate.d.ts.map +0 -1
  701. package/dist/src/validators/note-frontmatter-validate.js +0 -117
  702. package/dist/src/validators/note-frontmatter-validate.js.map +0 -1
  703. package/dist/src/validators/note-link-validate.d.ts +0 -21
  704. package/dist/src/validators/note-link-validate.d.ts.map +0 -1
  705. package/dist/src/validators/note-link-validate.js +0 -121
  706. package/dist/src/validators/note-link-validate.js.map +0 -1
  707. package/dist/src/validators/note-orphan-detect.d.ts +0 -19
  708. package/dist/src/validators/note-orphan-detect.d.ts.map +0 -1
  709. package/dist/src/validators/note-orphan-detect.js +0 -123
  710. package/dist/src/validators/note-orphan-detect.js.map +0 -1
  711. package/dist/src/validators/port-validate.d.ts +0 -12
  712. package/dist/src/validators/port-validate.d.ts.map +0 -1
  713. package/dist/src/validators/port-validate.js +0 -78
  714. package/dist/src/validators/port-validate.js.map +0 -1
  715. package/dist/src/validators/skill-validate.d.ts +0 -29
  716. package/dist/src/validators/skill-validate.d.ts.map +0 -1
  717. package/dist/src/validators/skill-validate.js +0 -689
  718. package/dist/src/validators/skill-validate.js.map +0 -1
@@ -1,1190 +0,0 @@
1
- /*
2
- <MODULE_CONTRACT>
3
- <purpose>forge.doctor — diagnoses forge state in an existing project.
4
- Checks for forge.yaml, AGENTS.md, PREFERENCES.md, .agents/skills/, docs/rfcs/,
5
- @warpgogol/* import autonomy guard, and bindings contract (RFC-0393).</purpose>
6
- <non-goals>
7
- <item>Do not modify files — doctor is read-only diagnostics.</item>
8
- </non-goals>
9
- </MODULE_CONTRACT>
10
- <CHANGE_SUMMARY>
11
- <item>Initial forge.doctor handler for autonomy refactor.</item>
12
- <item>RFC-0391: added @warpgogol/* forbidden-imports autonomy guard.</item>
13
- <item>RFC-0393: added bindings validation — resolved/absent/invalid reporting.</item>
14
- <item>RFC-0524: added stale knowledge file detection — compares source and .agents/ copies.</item>
15
- <item>RFC-0539: extended knowledge file check to iterate pack skills via discoverPackSkills. Added pack-skills check for stale/missing copies and skillPacks config validation.</item>
16
- <item>RFC-0540: added defaultable-binding-null notices for forge-CLI-backed bindings.</item>
17
- <item>RFC-0611: added nested AGENTS.md checks — missing, stale (dryRun comparison), hand-written improvement.</item>
18
- <item>RFC-0640: added domain reporting, invariant listing (reported-only), terminology resolution, --strict flag, and software-specific check skipping for non-software domains.</item>
19
- <item>RFC-0675: upgraded domain-invariants check from advisory to enforcement using invariant engine.</item>
20
- <item>RFC-0660: added legacy-section count reporting for structured knowledge files.</item>
21
- <item>RFC-0661: added knowledge-budgets check — validates override shape, computes per-skill budget reports, reports summary with headroom %.</item>
22
- <item>RFC-0663: added knowledge-duplicates check (cross-skill L2 duplicate detection) and shared-knowledge-file check (schema/id uniqueness for the shared layer).</item>
23
- <item>RFC-0664: added memory-layer health check (budget usage, gitignore coverage, daily-file leak risk).</item>
24
- <item>RFC-0704: added independent-version-packages check — validates that paths in independentVersionPackages exist and contain package.json.</item>
25
- <item>RFC-0941: added pack-manifests advisory check — validates forge.plugin.yaml existence and schema for each declared skill pack.</item>
26
- </CHANGE_SUMMARY>
27
- */
28
- import { readFile, readdir, stat } from "node:fs/promises";
29
- import { readFileSync, existsSync } from "node:fs";
30
- import { join, relative, dirname, resolve } from "node:path";
31
- import { parse as parseYaml } from "yaml";
32
- import { forgePluginManifestSchema } from "../plugin/ForgePluginManifest.js";
33
- import { resolveForgeRoot, loadForgeConfig, resolveBinding, resolveTerminology, FORGE_CLI_BINDING_DEFAULTS, resolvePmRunner } from "../config/forge-config.js";
34
- import { FORGE_SKILLS, discoverPackSkills } from "../registry.js";
35
- import { discoverWorkspaces } from "./workspace-discovery.js";
36
- import { buildNestedAgentsMd, selectNestedTemplate } from "./nested-agents-templates.js";
37
- import { readPackageInfo } from "./nested-agents-generate.js";
38
- import { listStackProfiles } from "../profiles/stack-profile.js";
39
- import { resolveAllTerminology } from "../profiles/terminology-utils.js";
40
- import { TERMINOLOGY_DEFAULTS } from "../profiles/profile-schema.js";
41
- import { runProfileValidate } from "./profile-validate.js";
42
- import { parseKnowledgeFile } from "../knowledge/index.js";
43
- import { computeLayerBudgets, resolveKnowledgeBudgets, DEFAULT_KNOWLEDGE_BUDGETS } from "../knowledge/budgets.js";
44
- import { detectDuplicatePrinciples } from "../knowledge/index.js";
45
- import { checkMemoryLayerHealth } from "./memory-scaffold.js";
46
- import { checkInvariants } from "./invariant-engine.js";
47
- import { execSync } from "node:child_process";
48
- async function pathExists(target) {
49
- try {
50
- await stat(target);
51
- return true;
52
- }
53
- catch {
54
- return false;
55
- }
56
- }
57
- const FORBIDDEN_IMPORT_PATTERN = /(?:^|\n)\s*(?:import\s+[^;]+?\s+from\s+|require\s*\(\s*)["'`](@warpgogol\/[^"'`]+)["'`]/g;
58
- async function scanForForbiddenImports(dir, workspaceRoot) {
59
- const violations = [];
60
- const entries = await readdir(dir, { withFileTypes: true }).catch(() => []);
61
- for (const entry of entries) {
62
- const fullPath = join(dir, entry.name);
63
- if (entry.isDirectory()) {
64
- if (entry.name === "node_modules" || entry.name === "tests")
65
- continue;
66
- const sub = await scanForForbiddenImports(fullPath, workspaceRoot);
67
- violations.push(...sub);
68
- }
69
- else if (entry.name.endsWith(".ts")) {
70
- const content = await readFile(fullPath, "utf8").catch(() => "");
71
- let match;
72
- const pattern = new RegExp(FORBIDDEN_IMPORT_PATTERN.source, "g");
73
- while ((match = pattern.exec(content)) !== null) {
74
- violations.push({
75
- file: relative(workspaceRoot, fullPath),
76
- specifier: match[1],
77
- });
78
- }
79
- }
80
- }
81
- return violations;
82
- }
83
- // ---------------------------------------------------------------------------
84
- // Bindings validation (RFC-0393)
85
- // ---------------------------------------------------------------------------
86
- const BINDING_PATH_KEYS = [
87
- "paths.invariantsFile",
88
- "paths.reviewsDir",
89
- "paths.handoffsDir",
90
- "paths.sessionsDir",
91
- ];
92
- const BINDING_COMMAND_KEYS = [
93
- "commands.validateRfc",
94
- "commands.validateAdr",
95
- "commands.implementStamp",
96
- "commands.typecheck",
97
- "commands.test",
98
- "commands.scopedBuild",
99
- "commands.specValidate",
100
- "commands.sessionSave",
101
- ];
102
- async function validateBindings(workspaceRoot) {
103
- const result = { resolved: [], absent: [], invalid: [], notices: [] };
104
- let config;
105
- try {
106
- config = loadForgeConfig(workspaceRoot);
107
- }
108
- catch {
109
- return result;
110
- }
111
- if (!config.bindings) {
112
- return result;
113
- }
114
- for (const key of BINDING_PATH_KEYS) {
115
- const value = resolveBinding(config, key);
116
- if (value === null) {
117
- result.absent.push(key);
118
- }
119
- else if (typeof value === "string") {
120
- const exists = await pathExists(join(workspaceRoot, value));
121
- if (exists) {
122
- result.resolved.push(key);
123
- }
124
- else {
125
- result.invalid.push(`${key} (path not found: ${value})`);
126
- }
127
- }
128
- }
129
- const compassDocs = resolveBinding(config, "paths.compassDocs");
130
- if (Array.isArray(compassDocs) && compassDocs.length > 0) {
131
- for (const docPath of compassDocs) {
132
- const exists = await pathExists(join(workspaceRoot, docPath));
133
- if (exists) {
134
- result.resolved.push(`paths.compassDocs[${docPath}]`);
135
- }
136
- else {
137
- result.invalid.push(`paths.compassDocs[${docPath}] (path not found)`);
138
- }
139
- }
140
- }
141
- else {
142
- result.absent.push("paths.compassDocs");
143
- }
144
- for (const key of BINDING_COMMAND_KEYS) {
145
- const value = resolveBinding(config, key);
146
- if (value === null) {
147
- result.absent.push(key);
148
- }
149
- else if (typeof value === "string") {
150
- result.resolved.push(key);
151
- }
152
- }
153
- // RFC-0540: Emit defaultable-binding-null notices for forge-CLI-backed bindings
154
- const pm = config.project.packageManager;
155
- const runner = resolvePmRunner(pm);
156
- for (const entry of FORGE_CLI_BINDING_DEFAULTS) {
157
- const value = resolveBinding(config, entry.key);
158
- if (value === null) {
159
- result.notices.push({
160
- key: entry.key,
161
- rule: "defaultable-binding-null",
162
- suggestion: `${runner} ${entry.template}`,
163
- });
164
- }
165
- }
166
- return result;
167
- }
168
- // ---------------------------------------------------------------------------
169
- // Stale knowledge file detection (RFC-0524)
170
- // ---------------------------------------------------------------------------
171
- async function checkStaleKnowledgeFiles(workspaceRoot, forgeRoot) {
172
- const stale = [];
173
- let config;
174
- try {
175
- config = loadForgeConfig(workspaceRoot);
176
- }
177
- catch {
178
- return { name: "knowledge-files", status: "pass", message: "No forge.yaml — knowledge file check skipped" };
179
- }
180
- const agentsSkillsDir = join(workspaceRoot, config.paths.skillsDir);
181
- for (const skill of FORGE_SKILLS) {
182
- if (!skill.knowledge || skill.knowledge.length === 0)
183
- continue;
184
- const skillSrcDir = dirname(join(forgeRoot, skill.path));
185
- for (const kf of skill.knowledge) {
186
- const srcPath = join(skillSrcDir, kf);
187
- const destPath = join(agentsSkillsDir, skill.name, kf);
188
- const srcExists = await pathExists(srcPath);
189
- const destExists = await pathExists(destPath);
190
- if (srcExists && destExists) {
191
- const srcContent = await readFile(srcPath, "utf8").catch(() => "");
192
- const destContent = await readFile(destPath, "utf8").catch(() => "");
193
- if (srcContent !== destContent) {
194
- stale.push(`${skill.name}/${kf}`);
195
- }
196
- }
197
- // If source exists but dest doesn't, skip — expected on first install
198
- // If source doesn't exist, SKILL-13 in forge.skill.validate catches it
199
- }
200
- }
201
- // RFC-0539: Check pack skill knowledge files
202
- let packSkills = [];
203
- try {
204
- packSkills = discoverPackSkills(workspaceRoot, config);
205
- }
206
- catch {
207
- // Manifest missing or invalid — skip pack skill checks
208
- }
209
- for (const skill of packSkills) {
210
- if (!skill.knowledge || skill.knowledge.length === 0)
211
- continue;
212
- const skillSrcDir = dirname(join(workspaceRoot, skill.dir, skill.path));
213
- for (const kf of skill.knowledge) {
214
- const srcPath = join(skillSrcDir, kf);
215
- const destPath = join(agentsSkillsDir, skill.name, kf);
216
- const srcExists = await pathExists(srcPath);
217
- const destExists = await pathExists(destPath);
218
- if (srcExists && destExists) {
219
- const srcContent = await readFile(srcPath, "utf8").catch(() => "");
220
- const destContent = await readFile(destPath, "utf8").catch(() => "");
221
- if (srcContent !== destContent) {
222
- stale.push(`${skill.name}/${kf}`);
223
- }
224
- }
225
- }
226
- }
227
- return {
228
- name: "knowledge-files",
229
- status: stale.length === 0 ? "pass" : "warn",
230
- message: stale.length === 0
231
- ? "All knowledge files in sync"
232
- : `${stale.length} stale knowledge file(s): ${stale.join(", ")} — run 'forge create' to sync`,
233
- };
234
- }
235
- // ---------------------------------------------------------------------------
236
- // Legacy section detection (RFC-0660)
237
- // ---------------------------------------------------------------------------
238
- function checkLegacyKnowledgeSections(workspaceRoot, forgeRoot) {
239
- let config;
240
- try {
241
- config = loadForgeConfig(workspaceRoot);
242
- }
243
- catch {
244
- return { name: "knowledge-legacy", status: "pass", message: "No forge.yaml — legacy section check skipped" };
245
- }
246
- let totalLegacy = 0;
247
- let filesWithLegacy = 0;
248
- // Check forge skills
249
- for (const skill of FORGE_SKILLS) {
250
- if (!skill.knowledge || skill.knowledge.length === 0)
251
- continue;
252
- const skillDir = join(forgeRoot, dirname(skill.path));
253
- for (const kf of skill.knowledge) {
254
- const kfPath = join(skillDir, kf);
255
- try {
256
- const parsed = parseKnowledgeFile(kfPath);
257
- if (parsed.isKnowledgeAdjacent)
258
- continue;
259
- if (parsed.legacySections.length > 0) {
260
- totalLegacy += parsed.legacySections.length;
261
- filesWithLegacy++;
262
- }
263
- }
264
- catch {
265
- // File read errors are handled by stale knowledge check
266
- }
267
- }
268
- }
269
- // Check pack skills
270
- let packSkills = [];
271
- try {
272
- packSkills = discoverPackSkills(workspaceRoot, config);
273
- }
274
- catch {
275
- // Manifest missing or invalid — skip pack skill checks
276
- }
277
- for (const skill of packSkills) {
278
- if (!skill.knowledge || skill.knowledge.length === 0)
279
- continue;
280
- const skillDir = join(workspaceRoot, skill.dir, dirname(skill.path));
281
- for (const kf of skill.knowledge) {
282
- const kfPath = join(skillDir, kf);
283
- try {
284
- const parsed = parseKnowledgeFile(kfPath);
285
- if (parsed.isKnowledgeAdjacent)
286
- continue;
287
- if (parsed.legacySections.length > 0) {
288
- totalLegacy += parsed.legacySections.length;
289
- filesWithLegacy++;
290
- }
291
- }
292
- catch {
293
- // File read errors are handled by stale knowledge check
294
- }
295
- }
296
- }
297
- return {
298
- name: "knowledge-legacy",
299
- status: totalLegacy === 0 ? "pass" : "warn",
300
- message: totalLegacy === 0
301
- ? "No legacy knowledge sections"
302
- : `${totalLegacy} legacy section${totalLegacy === 1 ? "" : "s"} across ${filesWithLegacy} knowledge file${filesWithLegacy === 1 ? "" : "s"} — run the knowledge compaction command to migrate`,
303
- };
304
- }
305
- // ---------------------------------------------------------------------------
306
- // Knowledge budget check (RFC-0661)
307
- // ---------------------------------------------------------------------------
308
- function checkKnowledgeBudgets(workspaceRoot, forgeRoot) {
309
- let config;
310
- try {
311
- config = loadForgeConfig(workspaceRoot);
312
- }
313
- catch {
314
- return { name: "knowledge-budgets", status: "pass", message: "No forge.yaml — budget check skipped" };
315
- }
316
- // Validate override shape if present
317
- const overrideWarnings = [];
318
- const effectiveBudgets = resolveKnowledgeBudgets(workspaceRoot);
319
- let usingDefaults = true;
320
- try {
321
- const forgeYamlPath = join(workspaceRoot, "forge.yaml");
322
- const content = readFileSync(forgeYamlPath, "utf8");
323
- const parsed = parseYaml(content);
324
- const bindings = parsed?.bindings;
325
- const knowledge = bindings?.knowledge;
326
- const budgets = knowledge?.budgets;
327
- if (budgets) {
328
- usingDefaults = false;
329
- if (typeof budgets.hot !== "number" || budgets.hot <= 0 || !Number.isInteger(budgets.hot)) {
330
- overrideWarnings.push(`bindings.knowledge.budgets.hot invalid (got ${String(budgets.hot)}), using default ${DEFAULT_KNOWLEDGE_BUDGETS.hot}`);
331
- }
332
- if (typeof budgets.warm !== "number" || budgets.warm <= 0 || !Number.isInteger(budgets.warm)) {
333
- overrideWarnings.push(`bindings.knowledge.budgets.warm invalid (got ${String(budgets.warm)}), using default ${DEFAULT_KNOWLEDGE_BUDGETS.warm}`);
334
- }
335
- }
336
- }
337
- catch {
338
- // forge.yaml not readable — defaults already applied
339
- }
340
- // Collect all parsed knowledge files from forge skills and pack skills
341
- const parsedFiles = [];
342
- for (const skill of FORGE_SKILLS) {
343
- if (!skill.knowledge || skill.knowledge.length === 0)
344
- continue;
345
- const skillDir = join(forgeRoot, dirname(skill.path));
346
- for (const kf of skill.knowledge) {
347
- const kfPath = join(skillDir, kf);
348
- try {
349
- const parsed = parseKnowledgeFile(kfPath);
350
- if (parsed.layer !== null && parsed.layer !== "L0" && !parsed.isKnowledgeAdjacent && parsed.parseIssues.length === 0) {
351
- parsedFiles.push({ file: parsed, skillName: skill.name });
352
- }
353
- }
354
- catch {
355
- // File read errors are handled by stale knowledge check
356
- }
357
- }
358
- }
359
- let packSkills = [];
360
- try {
361
- packSkills = discoverPackSkills(workspaceRoot, config);
362
- }
363
- catch {
364
- // Manifest missing or invalid — skip pack skill checks
365
- }
366
- for (const skill of packSkills) {
367
- if (!skill.knowledge || skill.knowledge.length === 0)
368
- continue;
369
- const skillDir = join(workspaceRoot, skill.dir, dirname(skill.path));
370
- for (const kf of skill.knowledge) {
371
- const kfPath = join(skillDir, kf);
372
- try {
373
- const parsed = parseKnowledgeFile(kfPath);
374
- if (parsed.layer !== null && parsed.layer !== "L0" && !parsed.isKnowledgeAdjacent && parsed.parseIssues.length === 0) {
375
- parsedFiles.push({ file: parsed, skillName: skill.name, pack: skill.pack });
376
- }
377
- }
378
- catch {
379
- // File read errors are handled by stale knowledge check
380
- }
381
- }
382
- }
383
- // Compute budget reports
384
- const filesForBudget = parsedFiles.map((p) => p.file);
385
- const skillNames = new Map();
386
- for (const p of parsedFiles) {
387
- skillNames.set(p.file.path, p.skillName);
388
- }
389
- const reports = computeLayerBudgets(filesForBudget, effectiveBudgets, skillNames);
390
- // Build summary
391
- const budgetSource = usingDefaults ? "defaults" : "override";
392
- const parts = [`budgets: hot=${effectiveBudgets.hot} warm=${effectiveBudgets.warm} (${budgetSource})`];
393
- if (reports.length > 0) {
394
- const summary = reports.map((r) => {
395
- const pct = Math.round((r.activeChars / r.budget) * 100);
396
- return `${r.skill}/${r.file}[${r.layer}]: ${r.activeChars}/${r.budget} (${pct}%)`;
397
- });
398
- parts.push(`${reports.length} file${reports.length === 1 ? "" : "s"}: ${summary.join(", ")}`);
399
- }
400
- else {
401
- parts.push("no hot/warm knowledge files to check");
402
- }
403
- if (overrideWarnings.length > 0) {
404
- parts.push(overrideWarnings.join("; "));
405
- }
406
- const status = overrideWarnings.length > 0 ? "warn" : "pass";
407
- return {
408
- name: "knowledge-budgets",
409
- status,
410
- message: parts.join(" | "),
411
- };
412
- }
413
- // ---------------------------------------------------------------------------
414
- // Knowledge duplicate detection (RFC-0663)
415
- // ---------------------------------------------------------------------------
416
- function collectL2Files(workspaceRoot, forgeRoot) {
417
- let config;
418
- try {
419
- config = loadForgeConfig(workspaceRoot);
420
- }
421
- catch {
422
- return [];
423
- }
424
- const files = [];
425
- for (const skill of FORGE_SKILLS) {
426
- if (!skill.knowledge || skill.knowledge.length === 0)
427
- continue;
428
- const skillDir = join(forgeRoot, dirname(skill.path));
429
- for (const kf of skill.knowledge) {
430
- if (kf !== "learned-principles.md")
431
- continue;
432
- const kfPath = join(skillDir, kf);
433
- try {
434
- const parsed = parseKnowledgeFile(kfPath);
435
- if (parsed.isKnowledgeAdjacent)
436
- continue;
437
- if (parsed.parseIssues.length > 0)
438
- continue;
439
- files.push({ skill: skill.name, parsed });
440
- }
441
- catch {
442
- // File read errors are handled by stale knowledge check
443
- }
444
- }
445
- }
446
- let packSkills = [];
447
- try {
448
- packSkills = discoverPackSkills(workspaceRoot, config);
449
- }
450
- catch {
451
- // Manifest missing or invalid — skip pack skill checks
452
- }
453
- for (const skill of packSkills) {
454
- if (!skill.knowledge || skill.knowledge.length === 0)
455
- continue;
456
- const skillDir = join(workspaceRoot, skill.dir, dirname(skill.path));
457
- for (const kf of skill.knowledge) {
458
- if (kf !== "learned-principles.md")
459
- continue;
460
- const kfPath = join(skillDir, kf);
461
- try {
462
- const parsed = parseKnowledgeFile(kfPath);
463
- if (parsed.isKnowledgeAdjacent)
464
- continue;
465
- if (parsed.parseIssues.length > 0)
466
- continue;
467
- files.push({ skill: skill.name, parsed });
468
- }
469
- catch {
470
- // File read errors are handled by stale knowledge check
471
- }
472
- }
473
- }
474
- const sharedPath = join(forgeRoot, "skills", "shared", "knowledge", "learned-principles.md");
475
- try {
476
- const parsed = parseKnowledgeFile(sharedPath);
477
- if (!parsed.isKnowledgeAdjacent && parsed.parseIssues.length === 0 && parsed.entries.length > 0) {
478
- files.push({ skill: "shared", parsed });
479
- }
480
- }
481
- catch {
482
- // Shared layer not initialized — not an error
483
- }
484
- return files;
485
- }
486
- function checkKnowledgeDuplicates(workspaceRoot, forgeRoot) {
487
- const l2Files = collectL2Files(workspaceRoot, forgeRoot);
488
- if (l2Files.length === 0) {
489
- return { name: "knowledge-duplicates", status: "pass", message: "No L2 knowledge files to check" };
490
- }
491
- const pairs = detectDuplicatePrinciples(l2Files);
492
- if (pairs.length === 0) {
493
- return { name: "knowledge-duplicates", status: "pass", message: "No cross-skill duplicate principles detected" };
494
- }
495
- const pairSummaries = pairs.map((p) => `${p.a.skill}/${p.a.entryId} ↔ ${p.b.skill}/${p.b.entryId} (${p.kind})`);
496
- return {
497
- name: "knowledge-duplicates",
498
- status: "warn",
499
- message: `${pairs.length} duplicate pair${pairs.length === 1 ? "" : "s"} detected — run fo-knowledge-distill to promote: ${pairSummaries.join("; ")}`,
500
- };
501
- }
502
- // ---------------------------------------------------------------------------
503
- // Shared knowledge file validation (RFC-0663)
504
- // ---------------------------------------------------------------------------
505
- function checkSharedKnowledgeFile(workspaceRoot, forgeRoot) {
506
- const sharedPath = join(forgeRoot, "skills", "shared", "knowledge", "learned-principles.md");
507
- let parsed;
508
- try {
509
- parsed = parseKnowledgeFile(sharedPath);
510
- }
511
- catch {
512
- return { name: "shared-knowledge-file", status: "pass", message: "Shared knowledge layer not initialized — created on first promotion" };
513
- }
514
- if (parsed.isKnowledgeAdjacent) {
515
- return { name: "shared-knowledge-file", status: "pass", message: "Shared knowledge layer is empty (no structured entries)" };
516
- }
517
- const issues = [];
518
- for (const issue of parsed.parseIssues) {
519
- issues.push(`line ${issue.line}: ${issue.message}`);
520
- }
521
- const seenIds = new Set();
522
- for (const entry of parsed.entries) {
523
- if (seenIds.has(entry.meta.id)) {
524
- issues.push(`duplicate entry id: ${entry.meta.id}`);
525
- }
526
- seenIds.add(entry.meta.id);
527
- }
528
- if (issues.length > 0) {
529
- return {
530
- name: "shared-knowledge-file",
531
- status: "fail",
532
- message: `${issues.length} issue${issues.length === 1 ? "" : "s"}: ${issues.join("; ")}`,
533
- };
534
- }
535
- return {
536
- name: "shared-knowledge-file",
537
- status: "pass",
538
- message: `Shared knowledge layer: ${parsed.entries.length} entr${parsed.entries.length === 1 ? "y" : "ies"}`,
539
- };
540
- }
541
- // ---------------------------------------------------------------------------
542
- // Independent version packages diagnostics (RFC-0704)
543
- // ---------------------------------------------------------------------------
544
- async function checkIndependentVersionPackages(workspaceRoot) {
545
- let config;
546
- try {
547
- config = loadForgeConfig(workspaceRoot);
548
- }
549
- catch {
550
- return { name: "independent-version-packages", status: "pass", message: "No forge.yaml — independent version packages check skipped" };
551
- }
552
- if (!config.independentVersionPackages || config.independentVersionPackages.length === 0) {
553
- return { name: "independent-version-packages", status: "pass", message: "No independent version packages declared" };
554
- }
555
- const issues = [];
556
- let validCount = 0;
557
- for (const pkgPath of config.independentVersionPackages) {
558
- const dirExists = await pathExists(join(workspaceRoot, pkgPath));
559
- const pkgJsonExists = await pathExists(join(workspaceRoot, pkgPath, "package.json"));
560
- if (!dirExists) {
561
- issues.push(`path '${pkgPath}' does not exist`);
562
- }
563
- else if (!pkgJsonExists) {
564
- issues.push(`path '${pkgPath}' has no package.json`);
565
- }
566
- else {
567
- validCount++;
568
- }
569
- }
570
- if (issues.length === 0) {
571
- return {
572
- name: "independent-version-packages",
573
- status: "pass",
574
- message: `${validCount} independent version package${validCount === 1 ? "" : "s"} declared`,
575
- };
576
- }
577
- return {
578
- name: "independent-version-packages",
579
- status: "warn",
580
- message: `${issues.length} issue${issues.length === 1 ? "" : "s"}: ${issues.join(", ")}`,
581
- };
582
- }
583
- // ---------------------------------------------------------------------------
584
- // Pack skill diagnostics (RFC-0539)
585
- // ---------------------------------------------------------------------------
586
- async function checkPackSkills(workspaceRoot) {
587
- let config;
588
- try {
589
- config = loadForgeConfig(workspaceRoot);
590
- }
591
- catch {
592
- return { name: "pack-skills", status: "pass", message: "No forge.yaml — pack skill check skipped" };
593
- }
594
- if (!config.skillPacks || config.skillPacks.length === 0) {
595
- return { name: "pack-skills", status: "pass", message: "No skill packs declared" };
596
- }
597
- const issues = [];
598
- // Validate skillPacks config: unique prefixes, unique dirs, no 'fo' prefix, dir exists
599
- const prefixes = new Set();
600
- const dirs = new Set();
601
- for (const pack of config.skillPacks) {
602
- if (prefixes.has(pack.prefix)) {
603
- issues.push(`duplicate prefix '${pack.prefix}'`);
604
- }
605
- prefixes.add(pack.prefix);
606
- if (pack.prefix === "fo") {
607
- issues.push(`prefix 'fo' is reserved for forge`);
608
- }
609
- if (dirs.has(pack.dir)) {
610
- issues.push(`duplicate dir '${pack.dir}'`);
611
- }
612
- dirs.add(pack.dir);
613
- const packDirExists = await pathExists(join(workspaceRoot, pack.dir));
614
- if (!packDirExists) {
615
- issues.push(`pack dir '${pack.dir}' does not exist`);
616
- }
617
- }
618
- // Check for stale/missing pack skill copies
619
- let packSkills = [];
620
- try {
621
- packSkills = discoverPackSkills(workspaceRoot, config);
622
- }
623
- catch {
624
- // Manifest missing or invalid — skip pack skill checks
625
- }
626
- const agentsSkillsDir = join(workspaceRoot, config.paths.skillsDir);
627
- for (const skill of packSkills) {
628
- const srcPath = join(workspaceRoot, skill.dir, skill.path);
629
- const destPath = join(agentsSkillsDir, skill.name, "SKILL.md");
630
- const srcExists = await pathExists(srcPath);
631
- const destExists = await pathExists(destPath);
632
- if (srcExists && destExists) {
633
- const srcContent = await readFile(srcPath, "utf8").catch(() => "");
634
- const destContent = await readFile(destPath, "utf8").catch(() => "");
635
- if (srcContent !== destContent) {
636
- issues.push(`stale copy of '${skill.name}'`);
637
- }
638
- }
639
- else if (srcExists && !destExists) {
640
- issues.push(`missing copy of '${skill.name}'`);
641
- }
642
- }
643
- return {
644
- name: "pack-skills",
645
- status: issues.length === 0 ? "pass" : "warn",
646
- message: issues.length === 0
647
- ? `${packSkills.length} pack skill(s) in sync`
648
- : `${issues.length} issue(s): ${issues.join(", ")} — run 'forge create' to sync`,
649
- };
650
- }
651
- // ---------------------------------------------------------------------------
652
- // Pack manifest diagnostics (RFC-0941)
653
- // ---------------------------------------------------------------------------
654
- async function checkPackManifests(workspaceRoot) {
655
- let config;
656
- try {
657
- config = loadForgeConfig(workspaceRoot);
658
- }
659
- catch {
660
- return {
661
- name: "pack-manifests",
662
- status: "pass",
663
- message: "forge.yaml not loadable — pack manifest check skipped",
664
- };
665
- }
666
- if (!config.skillPacks || config.skillPacks.length === 0) {
667
- return { name: "pack-manifests", status: "pass", message: "No skill packs declared" };
668
- }
669
- const issues = [];
670
- for (const pack of config.skillPacks) {
671
- const packDir = resolve(workspaceRoot, pack.dir);
672
- const manifestPath = join(packDir, "forge.plugin.yaml");
673
- if (!existsSync(manifestPath)) {
674
- issues.push(`pack '${pack.prefix}': forge.plugin.yaml missing at ${pack.dir}`);
675
- continue;
676
- }
677
- try {
678
- const raw = readFileSync(manifestPath, "utf-8");
679
- const parsed = parseYaml(raw);
680
- const result = forgePluginManifestSchema.safeParse(parsed);
681
- if (!result.success) {
682
- const errs = result.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ");
683
- issues.push(`pack '${pack.prefix}': invalid manifest — ${errs}`);
684
- }
685
- }
686
- catch (err) {
687
- issues.push(`pack '${pack.prefix}': failed to read manifest — ${err.message}`);
688
- }
689
- }
690
- return {
691
- name: "pack-manifests",
692
- status: issues.length === 0 ? "pass" : "warn",
693
- message: issues.length === 0
694
- ? `${config.skillPacks.length} pack manifest(s) valid`
695
- : `${issues.length} issue(s): ${issues.join(", ")}`,
696
- };
697
- }
698
- // ---------------------------------------------------------------------------
699
- // Nested AGENTS.md diagnostics (RFC-0611)
700
- // ---------------------------------------------------------------------------
701
- async function checkNestedAgentsMd(workspaceRoot, workspaceTypes) {
702
- let config;
703
- try {
704
- config = loadForgeConfig(workspaceRoot);
705
- }
706
- catch {
707
- return {
708
- name: "nested-AGENTS.md",
709
- status: "pass",
710
- message: "forge.yaml not loadable — nested AGENTS.md check skipped",
711
- };
712
- }
713
- const workspaces = discoverWorkspaces(workspaceRoot, workspaceTypes);
714
- if (workspaces.length === 0) {
715
- return {
716
- name: "nested-AGENTS.md",
717
- status: "pass",
718
- message: "no workspace directories found",
719
- };
720
- }
721
- const issues = [];
722
- let missing = 0;
723
- let stale = 0;
724
- let handwritten = 0;
725
- for (const ws of workspaces) {
726
- if (!ws.hasAgentsMd) {
727
- missing++;
728
- issues.push(`${ws.path}/AGENTS.md missing`);
729
- continue;
730
- }
731
- if (!ws.isGenerated) {
732
- handwritten++;
733
- const suggestions = [];
734
- try {
735
- const content = await readFile(join(workspaceRoot, ws.path, "AGENTS.md"), "utf8");
736
- if (!content.includes("AGENTS.md")) {
737
- suggestions.push("reference root AGENTS.md");
738
- }
739
- }
740
- catch {
741
- // unreadable — skip
742
- }
743
- if (suggestions.length > 0) {
744
- issues.push(`${ws.path}/AGENTS.md hand-written — consider: ${suggestions.join(", ")}`);
745
- }
746
- continue;
747
- }
748
- // Stale check: compare in-memory render to committed file
749
- // Must match the generate pipeline: readPackageInfo + buildNestedAgentsMd + selectNestedTemplate
750
- try {
751
- const packageInfo = readPackageInfo(workspaceRoot, ws.path);
752
- const fallback = buildNestedAgentsMd(ws, config, packageInfo);
753
- const profile = config.profile;
754
- const terminology = resolveAllTerminology(config, profile);
755
- const wsType = workspaceTypes?.find((wt) => wt.id === ws.type);
756
- const expected = selectNestedTemplate(wsType, profile, terminology, fallback);
757
- const actual = await readFile(join(workspaceRoot, ws.path, "AGENTS.md"), "utf8");
758
- if (expected !== actual) {
759
- stale++;
760
- issues.push(`${ws.path}/AGENTS.md stale — run 'forge agents generate'`);
761
- }
762
- }
763
- catch {
764
- // unreadable — skip
765
- }
766
- }
767
- if (issues.length === 0) {
768
- return {
769
- name: "nested-AGENTS.md",
770
- status: "pass",
771
- message: `${workspaces.length} workspace(s) — all AGENTS.md in sync`,
772
- };
773
- }
774
- const parts = [];
775
- if (missing > 0)
776
- parts.push(`${missing} missing`);
777
- if (stale > 0)
778
- parts.push(`${stale} stale`);
779
- if (handwritten > 0)
780
- parts.push(`${handwritten} hand-written`);
781
- return {
782
- name: "nested-AGENTS.md",
783
- status: stale > 0 ? "warn" : "pass",
784
- message: `${parts.join(", ")} — ${issues.slice(0, 3).join("; ")}${issues.length > 3 ? ` (+${issues.length - 3} more)` : ""}`,
785
- };
786
- }
787
- function buildTerminologyMap(config, profileTerminology) {
788
- const result = {};
789
- for (const key of Object.keys(TERMINOLOGY_DEFAULTS)) {
790
- result[key] = resolveTerminology(config, profileTerminology, key);
791
- }
792
- // Also include any custom keys from bindings.terminology
793
- if (config.bindings?.terminology) {
794
- for (const key of Object.keys(config.bindings.terminology)) {
795
- if (!(key in result)) {
796
- result[key] = resolveTerminology(config, profileTerminology, key);
797
- }
798
- }
799
- }
800
- return result;
801
- }
802
- function resolveDomainReport(workspaceRoot, forgeRoot) {
803
- // 1. Try forge.yaml domain field
804
- try {
805
- const config = loadForgeConfig(workspaceRoot);
806
- if (config.project.domain) {
807
- const terminology = buildTerminologyMap(config);
808
- const register = readRegisterFromPrefs(workspaceRoot);
809
- return {
810
- domain: config.project.domain,
811
- register,
812
- terminology,
813
- invariants: [],
814
- source: "forge.yaml",
815
- };
816
- }
817
- }
818
- catch {
819
- // forge.yaml not loadable
820
- }
821
- // 2. Try to find domain from stack profile matching config.project.stack
822
- try {
823
- const config = loadForgeConfig(workspaceRoot);
824
- const profiles = listStackProfiles(forgeRoot);
825
- for (const stackId of config.project.stack) {
826
- const profile = profiles.find((p) => p.id === stackId);
827
- if (profile?.domain) {
828
- const terminology = buildTerminologyMap(config, profile.terminology);
829
- const register = profile.register ?? readRegisterFromPrefs(workspaceRoot);
830
- return {
831
- domain: profile.domain,
832
- register,
833
- terminology,
834
- invariants: profile.invariants ?? [],
835
- source: "profile",
836
- profileId: profile.id,
837
- };
838
- }
839
- }
840
- }
841
- catch {
842
- // config or profiles not loadable
843
- }
844
- // 3. Default: software domain
845
- return {
846
- domain: "software",
847
- register: null,
848
- terminology: {},
849
- invariants: [],
850
- source: "default",
851
- };
852
- }
853
- function readRegisterFromPrefs(workspaceRoot) {
854
- try {
855
- const prefsPath = join(workspaceRoot, "PREFERENCES.md");
856
- const content = readFileSync(prefsPath, "utf8");
857
- const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
858
- if (fmMatch) {
859
- const fm = parseYaml(fmMatch[1]);
860
- if (fm["register"] === "creative")
861
- return "creative";
862
- if (fm["register"] === "business")
863
- return "business";
864
- }
865
- }
866
- catch {
867
- // PREFERENCES.md missing or unreadable
868
- }
869
- return null;
870
- }
871
- function checkDomainInfo(domainReport) {
872
- const parts = [`domain: ${domainReport.domain}`, `source: ${domainReport.source}`];
873
- if (domainReport.register) {
874
- parts.push(`register: ${domainReport.register}`);
875
- }
876
- if (Object.keys(domainReport.terminology).length > 0) {
877
- const terms = Object.entries(domainReport.terminology)
878
- .map(([k, v]) => `${k}=${v}`)
879
- .join(", ");
880
- parts.push(`terminology: ${terms}`);
881
- }
882
- if (domainReport.invariants.length > 0) {
883
- parts.push(`invariants: ${domainReport.invariants.length} declared`);
884
- }
885
- return {
886
- name: "domain-info",
887
- status: "pass",
888
- message: parts.join(", "),
889
- };
890
- }
891
- // RFC-0664: Memory layer health check
892
- function checkMemoryLayer(workspaceRoot) {
893
- const health = checkMemoryLayerHealth(workspaceRoot);
894
- if (!health.memoryMdExists) {
895
- return {
896
- name: "memory-layer",
897
- status: "pass",
898
- message: "Memory layer not initialized — run 'forge create' or 'forge upgrade' to scaffold .agents/memory/",
899
- };
900
- }
901
- const overBudget = health.memoryMdChars > health.budget;
902
- const leakRisk = !health.gitignoreCoversDaily && health.dailyFileCount > 0;
903
- if (overBudget && leakRisk) {
904
- return {
905
- name: "memory-layer",
906
- status: "warn",
907
- message: `MEMORY.md over budget (${health.memoryMdChars}/${health.budget} chars); ${health.dailyFileCount} daily file(s) untracked by .gitignore — add forge-agent-memory block`,
908
- };
909
- }
910
- if (overBudget) {
911
- return {
912
- name: "memory-layer",
913
- status: "warn",
914
- message: `MEMORY.md over budget (${health.memoryMdChars}/${health.budget} chars) — compact or promote to skill knowledge`,
915
- };
916
- }
917
- if (leakRisk) {
918
- return {
919
- name: "memory-layer",
920
- status: "warn",
921
- message: `${health.dailyFileCount} daily file(s) not covered by .gitignore — add forge-agent-memory block to prevent committing ephemeral logs`,
922
- };
923
- }
924
- return {
925
- name: "memory-layer",
926
- status: "pass",
927
- message: `MEMORY.md ${health.memoryMdChars}/${health.budget} chars; ${health.dailyFileCount} daily file(s); gitignore ${health.gitignoreCoversDaily ? "covers" : "absent (no daily files)"}`,
928
- };
929
- }
930
- // ---------------------------------------------------------------------------
931
- // Prerequisite checks (profile-declared system dependencies)
932
- // ---------------------------------------------------------------------------
933
- function checkPrerequisites(prerequisites) {
934
- if (prerequisites.length === 0) {
935
- return { name: "prerequisites", status: "pass", message: "No prerequisites declared" };
936
- }
937
- const results = [];
938
- for (const prereq of prerequisites) {
939
- try {
940
- execSync(prereq.check, { stdio: "pipe", timeout: 10000 });
941
- results.push({ id: prereq.id, name: prereq.name, status: "pass", message: `${prereq.name} found` });
942
- }
943
- catch {
944
- const hint = prereq.installHint ? ` — install: ${prereq.installHint}` : "";
945
- results.push({ id: prereq.id, name: prereq.name, status: "fail", message: `${prereq.name} not found${hint}` });
946
- }
947
- }
948
- const failed = results.filter((r) => r.status === "fail");
949
- const hasErrors = failed.some((r) => prerequisites.find((p) => p.id === r.id)?.severity === "error");
950
- const hasWarnings = failed.some((r) => prerequisites.find((p) => p.id === r.id)?.severity === "warning");
951
- const status = hasErrors ? "fail" : hasWarnings ? "warn" : "pass";
952
- const parts = results.map((r) => `${r.name}: ${r.status === "pass" ? "ok" : "missing"}`);
953
- return {
954
- name: "prerequisites",
955
- status,
956
- message: `${results.length} prerequisite(s): ${parts.join(", ")}`,
957
- };
958
- }
959
- export async function runDoctor(input, context) {
960
- const { workspaceRoot, logger, outputFormat } = context;
961
- const strict = input.flags["strict"] === true;
962
- const checks = [];
963
- // Check forge.yaml
964
- const forgeYamlExists = await pathExists(join(workspaceRoot, "forge.yaml"));
965
- checks.push({
966
- name: "forge.yaml",
967
- status: forgeYamlExists ? "pass" : "warn",
968
- message: forgeYamlExists
969
- ? "forge.yaml found"
970
- : "forge.yaml not found — run 'forge create' to create project configuration",
971
- });
972
- // Check AGENTS.md
973
- const agentsMdExists = await pathExists(join(workspaceRoot, "AGENTS.md"));
974
- checks.push({
975
- name: "AGENTS.md",
976
- status: agentsMdExists ? "pass" : "warn",
977
- message: agentsMdExists
978
- ? "AGENTS.md found"
979
- : "AGENTS.md not found — run 'forge create' to deploy agent instructions",
980
- });
981
- // Check PREFERENCES.md
982
- const preferencesExists = await pathExists(join(workspaceRoot, "PREFERENCES.md"));
983
- checks.push({
984
- name: "PREFERENCES.md",
985
- status: preferencesExists ? "pass" : "warn",
986
- message: preferencesExists
987
- ? "PREFERENCES.md found"
988
- : "PREFERENCES.md not found — run 'forge create' to create preferences file",
989
- });
990
- // Check .agents/skills/
991
- const skillsDirExists = await pathExists(join(workspaceRoot, ".agents", "skills"));
992
- checks.push({
993
- name: ".agents/skills/",
994
- status: skillsDirExists ? "pass" : "fail",
995
- message: skillsDirExists
996
- ? ".agents/skills/ directory found"
997
- : ".agents/skills/ directory not found — run 'forge create' to deploy skills",
998
- });
999
- // Check docs/rfcs/
1000
- const rfcsDirExists = await pathExists(join(workspaceRoot, "docs", "rfcs"));
1001
- checks.push({
1002
- name: "docs/rfcs/",
1003
- status: rfcsDirExists ? "pass" : "warn",
1004
- message: rfcsDirExists
1005
- ? "docs/rfcs/ directory found"
1006
- : "docs/rfcs/ directory not found — run 'forge create' to create RFC directory",
1007
- });
1008
- // Check docs/adrs/
1009
- const adrsDirExists = await pathExists(join(workspaceRoot, "docs", "adrs"));
1010
- checks.push({
1011
- name: "docs/adrs/",
1012
- status: adrsDirExists ? "pass" : "warn",
1013
- message: adrsDirExists
1014
- ? "docs/adrs/ directory found"
1015
- : "docs/adrs/ directory not found — run 'forge create' to create ADR directory",
1016
- });
1017
- // Check @warpgogol/* forbidden imports (autonomy guard)
1018
- let forgeRoot;
1019
- try {
1020
- forgeRoot = resolveForgeRoot(workspaceRoot);
1021
- }
1022
- catch {
1023
- forgeRoot = join(workspaceRoot, "packages", "forge");
1024
- }
1025
- // RFC-0640: Resolve domain report for domain-aware checks
1026
- const domainReport = resolveDomainReport(workspaceRoot, forgeRoot);
1027
- // RFC-0640: Domain info check
1028
- checks.push(checkDomainInfo(domainReport));
1029
- // RFC-0675: Enforce invariants using the invariant engine
1030
- if (domainReport.invariants.length > 0) {
1031
- const profiles = listStackProfiles(forgeRoot);
1032
- const profile = domainReport.profileId
1033
- ? profiles.find((p) => p.id === domainReport.profileId)
1034
- : undefined;
1035
- const invariantResults = profile
1036
- ? checkInvariants(profile, workspaceRoot)
1037
- : [];
1038
- const allViolations = invariantResults.flatMap((r) => r.violations);
1039
- const errorViolations = allViolations.filter((v) => v.severity === "error");
1040
- const warningViolations = allViolations.filter((v) => v.severity === "warning");
1041
- const checkedCount = invariantResults.filter((r) => r.checked).length;
1042
- const advisoryCount = invariantResults.filter((r) => !r.checked).length;
1043
- const status = errorViolations.length > 0 ? "fail" :
1044
- warningViolations.length > 0 ? "warn" :
1045
- "pass";
1046
- const parts = [];
1047
- if (allViolations.length > 0) {
1048
- parts.push(`${allViolations.length} violation${allViolations.length === 1 ? "" : "s"}`);
1049
- for (const v of allViolations.slice(0, 3)) {
1050
- parts.push(`${v.invariantId}: ${v.file} — ${v.message}`);
1051
- }
1052
- if (allViolations.length > 3)
1053
- parts.push(`(+${allViolations.length - 3} more)`);
1054
- }
1055
- else {
1056
- parts.push(`${checkedCount} checked, ${advisoryCount} advisory`);
1057
- }
1058
- checks.push({
1059
- name: "domain-invariants",
1060
- status,
1061
- message: parts.join("; "),
1062
- invariantViolations: allViolations.length > 0 ? allViolations : undefined,
1063
- });
1064
- }
1065
- // Prerequisite checks (profile-declared system dependencies)
1066
- if (domainReport.profileId) {
1067
- const profiles = listStackProfiles(forgeRoot);
1068
- const profile = profiles.find((p) => p.id === domainReport.profileId);
1069
- if (profile?.prerequisites && profile.prerequisites.length > 0) {
1070
- checks.push(checkPrerequisites(profile.prerequisites));
1071
- }
1072
- }
1073
- // RFC-0640: Run forge.profile.validate as advisory check (warn on failure, not fail)
1074
- const profileValidateResult = await runProfileValidate({ argv: [], flags: {} }, { ...context, forgeRoot });
1075
- const invalidProfiles = profileValidateResult.data?.profiles.filter((p) => !p.valid) ?? [];
1076
- checks.push({
1077
- name: "profile-validate",
1078
- status: invalidProfiles.length === 0 ? "pass" : "warn",
1079
- message: invalidProfiles.length === 0
1080
- ? `${profileValidateResult.data?.profiles.length ?? 0} profile(s) valid`
1081
- : `${invalidProfiles.length} profile(s) invalid (advisory): ${invalidProfiles.map((p) => p.id).join(", ")}`,
1082
- });
1083
- const forbiddenImports = await scanForForbiddenImports(forgeRoot, workspaceRoot);
1084
- checks.push({
1085
- name: "autonomy-guard",
1086
- status: forbiddenImports.length === 0 ? "pass" : "fail",
1087
- message: forbiddenImports.length === 0
1088
- ? "No @warpgogol/* imports in forge source"
1089
- : `${forbiddenImports.length} @warpgogol/* import(s) found in forge source — remove them`,
1090
- });
1091
- // Check bindings contract (RFC-0393)
1092
- const bindingsResult = await validateBindings(workspaceRoot);
1093
- checks.push({
1094
- name: "bindings",
1095
- status: bindingsResult.invalid.length === 0 ? "pass" : "fail",
1096
- message: bindingsResult.invalid.length === 0
1097
- ? `Bindings: ${bindingsResult.resolved.length} resolved, ${bindingsResult.absent.length} absent`
1098
- : `Bindings: ${bindingsResult.invalid.length} invalid — ${bindingsResult.invalid.join(", ")}`,
1099
- });
1100
- // Check stale knowledge files (RFC-0524, RFC-0539)
1101
- const staleCheck = await checkStaleKnowledgeFiles(workspaceRoot, forgeRoot);
1102
- checks.push(staleCheck);
1103
- // RFC-0660: Check legacy sections in knowledge files
1104
- const legacyCheck = checkLegacyKnowledgeSections(workspaceRoot, forgeRoot);
1105
- checks.push(legacyCheck);
1106
- // RFC-0661: Check knowledge layer token budgets
1107
- const budgetCheck = checkKnowledgeBudgets(workspaceRoot, forgeRoot);
1108
- checks.push(budgetCheck);
1109
- // RFC-0663: Check cross-skill duplicate principles
1110
- const duplicatesCheck = checkKnowledgeDuplicates(workspaceRoot, forgeRoot);
1111
- checks.push(duplicatesCheck);
1112
- // RFC-0663: Validate shared knowledge layer file
1113
- const sharedKnowledgeCheck = checkSharedKnowledgeFile(workspaceRoot, forgeRoot);
1114
- checks.push(sharedKnowledgeCheck);
1115
- // RFC-0664: Check memory layer health (budget, gitignore coverage, leak risk)
1116
- checks.push(checkMemoryLayer(workspaceRoot));
1117
- // RFC-0539: Check pack skills — stale/missing copies and config validation
1118
- const packCheck = await checkPackSkills(workspaceRoot);
1119
- checks.push(packCheck);
1120
- // RFC-0941: Check pack manifests — forge.plugin.yaml existence and validity
1121
- const packManifestCheck = await checkPackManifests(workspaceRoot);
1122
- checks.push(packManifestCheck);
1123
- // RFC-0704: Check independent version packages — paths must exist and contain package.json
1124
- const independentCheck = await checkIndependentVersionPackages(workspaceRoot);
1125
- checks.push(independentCheck);
1126
- // RFC-0611: Check nested AGENTS.md — missing, stale, hand-written
1127
- // RFC-0640: Use profile-driven workspace types when available (all domains)
1128
- // RFC-0640 fix: previously gated by isSoftwareDomain, which skipped the check
1129
- // entirely for non-software domains. Now runs for all domains — profile-driven
1130
- // wsTypes replace hardcoded detection when present.
1131
- {
1132
- let wsTypes;
1133
- try {
1134
- const config = loadForgeConfig(workspaceRoot);
1135
- // RFC-0643: prefer config.profile (loaded by loadForgeConfig)
1136
- if (config.profile?.workspaceTypes && config.profile.workspaceTypes.length > 0) {
1137
- wsTypes = config.profile.workspaceTypes;
1138
- }
1139
- else {
1140
- const profiles = listStackProfiles(forgeRoot);
1141
- for (const stackId of config.project.stack) {
1142
- const profile = profiles.find((p) => p.id === stackId);
1143
- if (profile?.workspaceTypes && profile.workspaceTypes.length > 0) {
1144
- wsTypes = profile.workspaceTypes;
1145
- break;
1146
- }
1147
- }
1148
- }
1149
- }
1150
- catch {
1151
- // profiles not loadable
1152
- }
1153
- const nestedCheck = await checkNestedAgentsMd(workspaceRoot, wsTypes);
1154
- checks.push(nestedCheck);
1155
- }
1156
- // RFC-0640: --strict flag elevates warn to fail for domain-related checks
1157
- const finalChecks = strict
1158
- ? checks.map((c) => c.status === "warn" &&
1159
- (c.name === "domain-invariants" || c.name === "profile-validate")
1160
- ? { ...c, status: "fail" }
1161
- : c)
1162
- : checks;
1163
- const allPass = finalChecks.every((c) => c.status === "pass");
1164
- const hasFails = finalChecks.some((c) => c.status === "fail");
1165
- if (outputFormat === "pretty") {
1166
- logger.section(`Forge Doctor — ${workspaceRoot}`);
1167
- for (const check of finalChecks) {
1168
- const icon = check.status === "pass" ? "✓" : check.status === "warn" ? "⚠" : "✖";
1169
- const fn = check.status === "pass" ? logger.success : check.status === "warn" ? logger.warn : logger.error;
1170
- fn(`${icon} ${check.name}: ${check.message}`);
1171
- }
1172
- if (allPass) {
1173
- logger.success("All checks passed — forge is properly configured.");
1174
- }
1175
- else if (hasFails) {
1176
- logger.error("Some checks failed — run 'forge create' to fix.");
1177
- }
1178
- else {
1179
- logger.warn("Some checks warn — review above.");
1180
- }
1181
- }
1182
- return {
1183
- data: { command: "forge.doctor", checks: finalChecks, allPass, forbiddenImports, bindings: bindingsResult, domain: domainReport },
1184
- exitCode: hasFails ? 1 : 0,
1185
- summary: allPass
1186
- ? "forge.doctor: all checks passed"
1187
- : `forge.doctor: ${finalChecks.filter((c) => c.status === "fail").length} fail(s), ${finalChecks.filter((c) => c.status === "warn").length} warn(s)`,
1188
- };
1189
- }
1190
- //# sourceMappingURL=doctor.js.map