@warpgogol/forge 5.2.3 → 5.3.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 (584) hide show
  1. package/AGENTS.md +34 -2
  2. package/README.md +1 -1
  3. package/README.uk.md +8 -8
  4. package/bin/cli.ts +1 -0
  5. package/dist/bin/cli.js +1 -0
  6. package/dist/bin/cli.js.map +1 -1
  7. package/dist/os/adr/adr.module.d.ts.map +1 -1
  8. package/dist/os/adr/adr.module.js +8 -3
  9. package/dist/os/adr/adr.module.js.map +1 -1
  10. package/dist/os/adr/frontmatter-io.js +5 -5
  11. package/dist/os/adr/frontmatter-io.js.map +1 -1
  12. package/dist/os/adr/handlers/archive.d.ts.map +1 -1
  13. package/dist/os/adr/handlers/archive.js +10 -4
  14. package/dist/os/adr/handlers/archive.js.map +1 -1
  15. package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
  16. package/dist/os/adr/handlers/implement-stamp.js +10 -9
  17. package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
  18. package/dist/os/adr/handlers/list-create.js +5 -5
  19. package/dist/os/adr/handlers/list-create.js.map +1 -1
  20. package/dist/os/adr/handlers/validate.js +1 -1
  21. package/dist/os/adr/handlers/validate.js.map +1 -1
  22. package/dist/os/audit/audit.module.js +3 -3
  23. package/dist/os/audit/audit.module.js.map +1 -1
  24. package/dist/os/audit/frontmatter-io.js +5 -5
  25. package/dist/os/audit/frontmatter-io.js.map +1 -1
  26. package/dist/os/audit/handlers/archive.d.ts.map +1 -1
  27. package/dist/os/audit/handlers/archive.js +10 -4
  28. package/dist/os/audit/handlers/archive.js.map +1 -1
  29. package/dist/os/compass/compass.module.d.ts.map +1 -1
  30. package/dist/os/compass/compass.module.js +17 -1
  31. package/dist/os/compass/compass.module.js.map +1 -1
  32. package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
  33. package/dist/os/compass/handlers/compass-audit-handler.js +12 -5
  34. package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
  35. package/dist/os/compass/handlers/compass-change-summary-handler.d.ts.map +1 -1
  36. package/dist/os/compass/handlers/compass-change-summary-handler.js +3 -2
  37. package/dist/os/compass/handlers/compass-change-summary-handler.js.map +1 -1
  38. package/dist/os/compass/handlers/compass-inventory-handler.d.ts.map +1 -1
  39. package/dist/os/compass/handlers/compass-inventory-handler.js +6 -4
  40. package/dist/os/compass/handlers/compass-inventory-handler.js.map +1 -1
  41. package/dist/os/compass/handlers/compass-inventory.d.ts.map +1 -1
  42. package/dist/os/compass/handlers/compass-inventory.js +10 -8
  43. package/dist/os/compass/handlers/compass-inventory.js.map +1 -1
  44. package/dist/os/compass/handlers/compass-migrate-handler.js +1 -1
  45. package/dist/os/compass/handlers/compass-migrate-handler.js.map +1 -1
  46. package/dist/os/compass/handlers/compass-migrate.d.ts.map +1 -1
  47. package/dist/os/compass/handlers/compass-migrate.js +6 -3
  48. package/dist/os/compass/handlers/compass-migrate.js.map +1 -1
  49. package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
  50. package/dist/os/compass/handlers/git-revision.js +9 -6
  51. package/dist/os/compass/handlers/git-revision.js.map +1 -1
  52. package/dist/os/compass/handlers/resolve-scan-root.js +1 -1
  53. package/dist/os/compass/handlers/resolve-scan-root.js.map +1 -1
  54. package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
  55. package/dist/os/compass/handlers/summary-record.js +8 -4
  56. package/dist/os/compass/handlers/summary-record.js.map +1 -1
  57. package/dist/os/core/core.module.d.ts.map +1 -1
  58. package/dist/os/core/core.module.js +57 -4
  59. package/dist/os/core/core.module.js.map +1 -1
  60. package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
  61. package/dist/os/core/handlers/assets-helpers.js +6 -3
  62. package/dist/os/core/handlers/assets-helpers.js.map +1 -1
  63. package/dist/os/core/handlers/build.js +1 -1
  64. package/dist/os/core/handlers/build.js.map +1 -1
  65. package/dist/os/core/handlers/determinism-check.d.ts.map +1 -1
  66. package/dist/os/core/handlers/determinism-check.js +10 -6
  67. package/dist/os/core/handlers/determinism-check.js.map +1 -1
  68. package/dist/os/core/handlers/dev.js +1 -1
  69. package/dist/os/core/handlers/dev.js.map +1 -1
  70. package/dist/os/core/handlers/file-size-lint.d.ts.map +1 -1
  71. package/dist/os/core/handlers/file-size-lint.js +11 -7
  72. package/dist/os/core/handlers/file-size-lint.js.map +1 -1
  73. package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
  74. package/dist/os/core/handlers/forge-autonomy-validate.js +9 -5
  75. package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
  76. package/dist/os/core/handlers/knowledge-compact.js +1 -1
  77. package/dist/os/core/handlers/knowledge-compact.js.map +1 -1
  78. package/dist/os/core/handlers/package-health.js +1 -1
  79. package/dist/os/core/handlers/package-health.js.map +1 -1
  80. package/dist/os/core/handlers/pinned-check.js +2 -2
  81. package/dist/os/core/handlers/pinned-check.js.map +1 -1
  82. package/dist/os/core/handlers/pinned-init.d.ts.map +1 -1
  83. package/dist/os/core/handlers/pinned-init.js +9 -8
  84. package/dist/os/core/handlers/pinned-init.js.map +1 -1
  85. package/dist/os/core/handlers/pinned-validate.js +3 -3
  86. package/dist/os/core/handlers/pinned-validate.js.map +1 -1
  87. package/dist/os/core/handlers/profile-resolve.js +1 -1
  88. package/dist/os/core/handlers/profile-resolve.js.map +1 -1
  89. package/dist/os/core/handlers/public-surface.js +1 -1
  90. package/dist/os/core/handlers/public-surface.js.map +1 -1
  91. package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
  92. package/dist/os/core/handlers/release-prepare.js +10 -6
  93. package/dist/os/core/handlers/release-prepare.js.map +1 -1
  94. package/dist/os/core/handlers/release-publish.js +6 -6
  95. package/dist/os/core/handlers/release-publish.js.map +1 -1
  96. package/dist/os/core/handlers/validate.js +1 -1
  97. package/dist/os/core/handlers/validate.js.map +1 -1
  98. package/dist/os/exploration/exploration.module.d.ts.map +1 -1
  99. package/dist/os/exploration/exploration.module.js +1 -0
  100. package/dist/os/exploration/exploration.module.js.map +1 -1
  101. package/dist/os/exploration/frontmatter-io.js +4 -4
  102. package/dist/os/exploration/frontmatter-io.js.map +1 -1
  103. package/dist/os/exploration/handlers/archive.js +3 -3
  104. package/dist/os/exploration/handlers/archive.js.map +1 -1
  105. package/dist/os/mission/handlers/archive.d.ts.map +1 -1
  106. package/dist/os/mission/handlers/archive.js +22 -19
  107. package/dist/os/mission/handlers/archive.js.map +1 -1
  108. package/dist/os/mission/mission.module.js +3 -3
  109. package/dist/os/mission/mission.module.js.map +1 -1
  110. package/dist/os/naming/naming-convention.d.ts.map +1 -1
  111. package/dist/os/naming/naming-convention.js +7 -3
  112. package/dist/os/naming/naming-convention.js.map +1 -1
  113. package/dist/os/naming/naming.module.d.ts.map +1 -1
  114. package/dist/os/naming/naming.module.js +4 -3
  115. package/dist/os/naming/naming.module.js.map +1 -1
  116. package/dist/os/notes/notes.module.d.ts.map +1 -1
  117. package/dist/os/notes/notes.module.js +6 -3
  118. package/dist/os/notes/notes.module.js.map +1 -1
  119. package/dist/os/plan/frontmatter-io.js +5 -5
  120. package/dist/os/plan/frontmatter-io.js.map +1 -1
  121. package/dist/os/plan/handlers/archive.d.ts.map +1 -1
  122. package/dist/os/plan/handlers/archive.js +10 -4
  123. package/dist/os/plan/handlers/archive.js.map +1 -1
  124. package/dist/os/plan/plan.module.js +3 -3
  125. package/dist/os/plan/plan.module.js.map +1 -1
  126. package/dist/os/plugin/plugin.module.d.ts.map +1 -1
  127. package/dist/os/plugin/plugin.module.js +6 -3
  128. package/dist/os/plugin/plugin.module.js.map +1 -1
  129. package/dist/os/program/discovery.js +2 -2
  130. package/dist/os/program/discovery.js.map +1 -1
  131. package/dist/os/program/handlers/complete.js +1 -1
  132. package/dist/os/program/handlers/complete.js.map +1 -1
  133. package/dist/os/program/handlers/lease.js +1 -1
  134. package/dist/os/program/handlers/lease.js.map +1 -1
  135. package/dist/os/program/handlers/seal.js +1 -1
  136. package/dist/os/program/handlers/seal.js.map +1 -1
  137. package/dist/os/program/lease.js +1 -1
  138. package/dist/os/program/lease.js.map +1 -1
  139. package/dist/os/program/program.module.d.ts.map +1 -1
  140. package/dist/os/program/program.module.js +9 -3
  141. package/dist/os/program/program.module.js.map +1 -1
  142. package/dist/os/queue/index.js +1 -1
  143. package/dist/os/queue/manifest.d.ts.map +1 -1
  144. package/dist/os/queue/manifest.js +4 -8
  145. package/dist/os/queue/manifest.js.map +1 -1
  146. package/dist/os/rfc/acceptance.d.ts.map +1 -1
  147. package/dist/os/rfc/acceptance.js +10 -6
  148. package/dist/os/rfc/acceptance.js.map +1 -1
  149. package/dist/os/rfc/decision-log.d.ts.map +1 -1
  150. package/dist/os/rfc/decision-log.js +4 -3
  151. package/dist/os/rfc/decision-log.js.map +1 -1
  152. package/dist/os/rfc/dna-trace.d.ts.map +1 -1
  153. package/dist/os/rfc/dna-trace.js +7 -2
  154. package/dist/os/rfc/dna-trace.js.map +1 -1
  155. package/dist/os/rfc/frontmatter-io.js +5 -5
  156. package/dist/os/rfc/frontmatter-io.js.map +1 -1
  157. package/dist/os/rfc/handlers/archive.d.ts.map +1 -1
  158. package/dist/os/rfc/handlers/archive.js +11 -5
  159. package/dist/os/rfc/handlers/archive.js.map +1 -1
  160. package/dist/os/rfc/handlers/check.d.ts.map +1 -1
  161. package/dist/os/rfc/handlers/check.js +6 -3
  162. package/dist/os/rfc/handlers/check.js.map +1 -1
  163. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  164. package/dist/os/rfc/handlers/implement-stamp.js +11 -10
  165. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  166. package/dist/os/rfc/handlers/index-graph.js +3 -3
  167. package/dist/os/rfc/handlers/index-graph.js.map +1 -1
  168. package/dist/os/rfc/handlers/lifecycle.d.ts.map +1 -1
  169. package/dist/os/rfc/handlers/lifecycle.js +6 -2
  170. package/dist/os/rfc/handlers/lifecycle.js.map +1 -1
  171. package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
  172. package/dist/os/rfc/handlers/list-create.js +7 -6
  173. package/dist/os/rfc/handlers/list-create.js.map +1 -1
  174. package/dist/os/rfc/handlers/shared.js +3 -3
  175. package/dist/os/rfc/handlers/shared.js.map +1 -1
  176. package/dist/os/rfc/handlers/supersede-propose.d.ts.map +1 -1
  177. package/dist/os/rfc/handlers/supersede-propose.js +7 -3
  178. package/dist/os/rfc/handlers/supersede-propose.js.map +1 -1
  179. package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
  180. package/dist/os/rfc/handlers/validate-rules.js +8 -5
  181. package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
  182. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  183. package/dist/os/rfc/rfc.module.js +44 -4
  184. package/dist/os/rfc/rfc.module.js.map +1 -1
  185. package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
  186. package/dist/os/rfc/verification-evidence.js +9 -5
  187. package/dist/os/rfc/verification-evidence.js.map +1 -1
  188. package/dist/os/rfc/verification-refresh.d.ts.map +1 -1
  189. package/dist/os/rfc/verification-refresh.js +4 -3
  190. package/dist/os/rfc/verification-refresh.js.map +1 -1
  191. package/dist/os/session/frontmatter-io.js +12 -12
  192. package/dist/os/session/frontmatter-io.js.map +1 -1
  193. package/dist/os/session/handlers/archive.d.ts.map +1 -1
  194. package/dist/os/session/handlers/archive.js +10 -4
  195. package/dist/os/session/handlers/archive.js.map +1 -1
  196. package/dist/os/session/handlers/metrics-aggregate.d.ts.map +1 -1
  197. package/dist/os/session/handlers/metrics-aggregate.js +9 -5
  198. package/dist/os/session/handlers/metrics-aggregate.js.map +1 -1
  199. package/dist/os/session/handlers/metrics-rfc.d.ts.map +1 -1
  200. package/dist/os/session/handlers/metrics-rfc.js +11 -8
  201. package/dist/os/session/handlers/metrics-rfc.js.map +1 -1
  202. package/dist/os/session/handlers/metrics-session.d.ts.map +1 -1
  203. package/dist/os/session/handlers/metrics-session.js +6 -3
  204. package/dist/os/session/handlers/metrics-session.js.map +1 -1
  205. package/dist/os/session/handlers/save.d.ts.map +1 -1
  206. package/dist/os/session/handlers/save.js +14 -8
  207. package/dist/os/session/handlers/save.js.map +1 -1
  208. package/dist/os/session/session.module.d.ts.map +1 -1
  209. package/dist/os/session/session.module.js +6 -0
  210. package/dist/os/session/session.module.js.map +1 -1
  211. package/dist/os/spec/live-spec-list.js +4 -4
  212. package/dist/os/spec/live-spec-list.js.map +1 -1
  213. package/dist/os/spec/live-spec-merge.js +5 -5
  214. package/dist/os/spec/live-spec-merge.js.map +1 -1
  215. package/dist/os/spec/live-spec-show.js +3 -3
  216. package/dist/os/spec/live-spec-show.js.map +1 -1
  217. package/dist/os/spec/live-spec-validate.js +4 -4
  218. package/dist/os/spec/live-spec-validate.js.map +1 -1
  219. package/dist/os/spec/spec-materialize.js +9 -9
  220. package/dist/os/spec/spec-materialize.js.map +1 -1
  221. package/dist/os/spec/spec-status.js +9 -9
  222. package/dist/os/spec/spec-status.js.map +1 -1
  223. package/dist/os/spec/spec-validate.js +7 -7
  224. package/dist/os/spec/spec-validate.js.map +1 -1
  225. package/dist/os/spec/spec.module.d.ts.map +1 -1
  226. package/dist/os/spec/spec.module.js +8 -0
  227. package/dist/os/spec/spec.module.js.map +1 -1
  228. package/dist/os/werkstatt/handlers/lock.js +16 -16
  229. package/dist/os/werkstatt/handlers/lock.js.map +1 -1
  230. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js +3 -3
  231. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js.map +1 -1
  232. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts.map +1 -1
  233. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js +3 -2
  234. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js.map +1 -1
  235. package/dist/os/werkstatt/werkstatt.module.d.ts.map +1 -1
  236. package/dist/os/werkstatt/werkstatt.module.js +6 -2
  237. package/dist/os/werkstatt/werkstatt.module.js.map +1 -1
  238. package/dist/os/workflow/handlers.d.ts.map +1 -1
  239. package/dist/os/workflow/handlers.js +8 -5
  240. package/dist/os/workflow/handlers.js.map +1 -1
  241. package/dist/os/workflow/workflow.module.d.ts.map +1 -1
  242. package/dist/os/workflow/workflow.module.js +6 -3
  243. package/dist/os/workflow/workflow.module.js.map +1 -1
  244. package/dist/src/compass/contract-registry.js +1 -1
  245. package/dist/src/compass/contract-registry.js.map +1 -1
  246. package/dist/src/config/forge-config.d.ts +10 -1
  247. package/dist/src/config/forge-config.d.ts.map +1 -1
  248. package/dist/src/config/forge-config.js +8 -1
  249. package/dist/src/config/forge-config.js.map +1 -1
  250. package/dist/src/knowledge/budgets.js +1 -1
  251. package/dist/src/knowledge/budgets.js.map +1 -1
  252. package/dist/src/knowledge/compact.js +1 -1
  253. package/dist/src/knowledge/compact.js.map +1 -1
  254. package/dist/src/knowledge/parse.js +1 -1
  255. package/dist/src/knowledge/parse.js.map +1 -1
  256. package/dist/src/knowledge/sync.d.ts.map +1 -1
  257. package/dist/src/knowledge/sync.js +3 -5
  258. package/dist/src/knowledge/sync.js.map +1 -1
  259. package/dist/src/migration-adapters/git-utils.js +2 -2
  260. package/dist/src/migration-adapters/git-utils.js.map +1 -1
  261. package/dist/src/migration-adapters/ignored-files.js +2 -2
  262. package/dist/src/migration-adapters/ignored-files.js.map +1 -1
  263. package/dist/src/migration-adapters/node-typescript-pnpm/index.js +1 -1
  264. package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
  265. package/dist/src/migration-adapters/phaser-pnpm/index.js +1 -1
  266. package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
  267. package/dist/src/onboarding/agents-generate.d.ts +2 -0
  268. package/dist/src/onboarding/agents-generate.d.ts.map +1 -1
  269. package/dist/src/onboarding/agents-generate.js +73 -48
  270. package/dist/src/onboarding/agents-generate.js.map +1 -1
  271. package/dist/src/onboarding/create.d.ts.map +1 -1
  272. package/dist/src/onboarding/create.js +10 -10
  273. package/dist/src/onboarding/create.js.map +1 -1
  274. package/dist/src/onboarding/doctor.d.ts +6 -0
  275. package/dist/src/onboarding/doctor.d.ts.map +1 -1
  276. package/dist/src/onboarding/doctor.js +179 -61
  277. package/dist/src/onboarding/doctor.js.map +1 -1
  278. package/dist/src/onboarding/init.d.ts.map +1 -1
  279. package/dist/src/onboarding/init.js +30 -1
  280. package/dist/src/onboarding/init.js.map +1 -1
  281. package/dist/src/onboarding/invariant-engine.js +1 -1
  282. package/dist/src/onboarding/invariant-engine.js.map +1 -1
  283. package/dist/src/onboarding/memory-compact.d.ts +22 -0
  284. package/dist/src/onboarding/memory-compact.d.ts.map +1 -0
  285. package/dist/src/onboarding/memory-compact.js +148 -0
  286. package/dist/src/onboarding/memory-compact.js.map +1 -0
  287. package/dist/src/onboarding/memory-scaffold.d.ts +1 -0
  288. package/dist/src/onboarding/memory-scaffold.d.ts.map +1 -1
  289. package/dist/src/onboarding/memory-scaffold.js +2 -2
  290. package/dist/src/onboarding/memory-scaffold.js.map +1 -1
  291. package/dist/src/onboarding/nested-agents-generate.d.ts +4 -1
  292. package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
  293. package/dist/src/onboarding/nested-agents-generate.js +35 -6
  294. package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
  295. package/dist/src/onboarding/nested-agents-templates.d.ts.map +1 -1
  296. package/dist/src/onboarding/nested-agents-templates.js +8 -12
  297. package/dist/src/onboarding/nested-agents-templates.js.map +1 -1
  298. package/dist/src/onboarding/npm-token-check.js +2 -2
  299. package/dist/src/onboarding/npm-token-check.js.map +1 -1
  300. package/dist/src/onboarding/prettierignore.d.ts +29 -0
  301. package/dist/src/onboarding/prettierignore.d.ts.map +1 -0
  302. package/dist/src/onboarding/prettierignore.js +231 -0
  303. package/dist/src/onboarding/prettierignore.js.map +1 -0
  304. package/dist/src/onboarding/profile-validate.d.ts.map +1 -1
  305. package/dist/src/onboarding/profile-validate.js +5 -4
  306. package/dist/src/onboarding/profile-validate.js.map +1 -1
  307. package/dist/src/onboarding/scaffold-project.d.ts.map +1 -1
  308. package/dist/src/onboarding/scaffold-project.js +35 -27
  309. package/dist/src/onboarding/scaffold-project.js.map +1 -1
  310. package/dist/src/onboarding/scaffold.js +1 -1
  311. package/dist/src/onboarding/scaffold.js.map +1 -1
  312. package/dist/src/onboarding/skill-markers.d.ts +27 -0
  313. package/dist/src/onboarding/skill-markers.d.ts.map +1 -0
  314. package/dist/src/onboarding/skill-markers.js +131 -0
  315. package/dist/src/onboarding/skill-markers.js.map +1 -0
  316. package/dist/src/onboarding/upgrade.d.ts +10 -0
  317. package/dist/src/onboarding/upgrade.d.ts.map +1 -1
  318. package/dist/src/onboarding/upgrade.js +215 -74
  319. package/dist/src/onboarding/upgrade.js.map +1 -1
  320. package/dist/src/onboarding/workspace-discovery.d.ts +1 -1
  321. package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
  322. package/dist/src/onboarding/workspace-discovery.js +15 -3
  323. package/dist/src/onboarding/workspace-discovery.js.map +1 -1
  324. package/dist/src/pipeline-status.d.ts +6 -5
  325. package/dist/src/pipeline-status.d.ts.map +1 -1
  326. package/dist/src/pipeline-status.js +24 -19
  327. package/dist/src/pipeline-status.js.map +1 -1
  328. package/dist/src/profiles/stack-profile.js +1 -1
  329. package/dist/src/profiles/stack-profile.js.map +1 -1
  330. package/dist/src/registry.d.ts +1 -1
  331. package/dist/src/registry.d.ts.map +1 -1
  332. package/dist/src/registry.js +3 -3
  333. package/dist/src/registry.js.map +1 -1
  334. package/dist/src/skill-schema.d.ts +1 -1
  335. package/dist/src/skill-schema.d.ts.map +1 -1
  336. package/dist/src/skill-schema.js +4 -1
  337. package/dist/src/skill-schema.js.map +1 -1
  338. package/dist/src/types.d.ts +116 -0
  339. package/dist/src/types.d.ts.map +1 -1
  340. package/dist/src/utils/editable-region.d.ts +46 -0
  341. package/dist/src/utils/editable-region.d.ts.map +1 -0
  342. package/dist/src/utils/editable-region.js +125 -0
  343. package/dist/src/utils/editable-region.js.map +1 -0
  344. package/dist/src/utils/fs-idempotent.d.ts +2 -1
  345. package/dist/src/utils/fs-idempotent.d.ts.map +1 -1
  346. package/dist/src/utils/fs-idempotent.js +11 -7
  347. package/dist/src/utils/fs-idempotent.js.map +1 -1
  348. package/dist/src/utils/generated-marker.d.ts +17 -0
  349. package/dist/src/utils/generated-marker.d.ts.map +1 -1
  350. package/dist/src/utils/generated-marker.js +29 -1
  351. package/dist/src/utils/generated-marker.js.map +1 -1
  352. package/dist/src/utils/index.d.ts +3 -1
  353. package/dist/src/utils/index.d.ts.map +1 -1
  354. package/dist/src/utils/index.js +3 -1
  355. package/dist/src/utils/index.js.map +1 -1
  356. package/dist/src/utils/io.d.ts +9 -0
  357. package/dist/src/utils/io.d.ts.map +1 -0
  358. package/dist/src/utils/io.js +130 -0
  359. package/dist/src/utils/io.js.map +1 -0
  360. package/dist/src/utils/markdown-table.d.ts +21 -0
  361. package/dist/src/utils/markdown-table.d.ts.map +1 -0
  362. package/dist/src/utils/markdown-table.js +116 -0
  363. package/dist/src/utils/markdown-table.js.map +1 -0
  364. package/dist/src/utils/sync-fs.d.ts +5 -0
  365. package/dist/src/utils/sync-fs.d.ts.map +1 -0
  366. package/dist/src/utils/sync-fs.js +26 -0
  367. package/dist/src/utils/sync-fs.js.map +1 -0
  368. package/dist/src/validators/note-frontmatter-validate.js +1 -1
  369. package/dist/src/validators/note-frontmatter-validate.js.map +1 -1
  370. package/dist/src/validators/note-link-validate.js +1 -1
  371. package/dist/src/validators/note-link-validate.js.map +1 -1
  372. package/dist/src/validators/note-orphan-detect.js +1 -1
  373. package/dist/src/validators/note-orphan-detect.js.map +1 -1
  374. package/dist/src/validators/port-validate.js +1 -1
  375. package/dist/src/validators/port-validate.js.map +1 -1
  376. package/dist/src/validators/skill-validate.d.ts.map +1 -1
  377. package/dist/src/validators/skill-validate.js +34 -13
  378. package/dist/src/validators/skill-validate.js.map +1 -1
  379. package/docs/reference/forge-yaml.md +12 -0
  380. package/os/adr/adr.module.ts +136 -132
  381. package/os/adr/frontmatter-io.ts +5 -5
  382. package/os/adr/handlers/archive.ts +8 -4
  383. package/os/adr/handlers/implement-stamp.ts +14 -9
  384. package/os/adr/handlers/list-create.ts +5 -5
  385. package/os/adr/handlers/validate.ts +1 -1
  386. package/os/audit/audit.module.ts +33 -34
  387. package/os/audit/frontmatter-io.ts +5 -5
  388. package/os/audit/handlers/archive.ts +8 -4
  389. package/os/compass/compass.module.ts +17 -1
  390. package/os/compass/handlers/compass-audit-handler.ts +13 -5
  391. package/os/compass/handlers/compass-change-summary-handler.ts +4 -2
  392. package/os/compass/handlers/compass-inventory-handler.ts +7 -4
  393. package/os/compass/handlers/compass-inventory.ts +11 -8
  394. package/os/compass/handlers/compass-migrate-handler.ts +1 -1
  395. package/os/compass/handlers/compass-migrate.ts +7 -3
  396. package/os/compass/handlers/git-revision.ts +11 -6
  397. package/os/compass/handlers/resolve-scan-root.ts +1 -1
  398. package/os/compass/handlers/summary-record.ts +10 -4
  399. package/os/compass/handlers/tests/compass-audit-plan.test.ts +2 -1
  400. package/os/core/core.module.ts +58 -4
  401. package/os/core/handlers/assets-helpers.ts +7 -3
  402. package/os/core/handlers/build.ts +1 -1
  403. package/os/core/handlers/determinism-check.ts +12 -6
  404. package/os/core/handlers/dev.ts +1 -1
  405. package/os/core/handlers/file-size-lint.ts +16 -9
  406. package/os/core/handlers/forge-autonomy-validate.ts +10 -5
  407. package/os/core/handlers/knowledge-compact.ts +1 -1
  408. package/os/core/handlers/package-health.ts +1 -1
  409. package/os/core/handlers/pinned-check.ts +2 -2
  410. package/os/core/handlers/pinned-init.ts +9 -8
  411. package/os/core/handlers/pinned-validate.ts +3 -3
  412. package/os/core/handlers/profile-resolve.ts +1 -1
  413. package/os/core/handlers/public-surface.ts +1 -1
  414. package/os/core/handlers/release-prepare.ts +11 -6
  415. package/os/core/handlers/release-publish.ts +6 -6
  416. package/os/core/handlers/validate.ts +1 -1
  417. package/os/exploration/exploration.module.ts +1 -0
  418. package/os/exploration/frontmatter-io.ts +4 -4
  419. package/os/exploration/handlers/archive.ts +3 -3
  420. package/os/mission/handlers/archive.ts +27 -19
  421. package/os/mission/mission.module.ts +38 -39
  422. package/os/naming/naming-convention.ts +9 -3
  423. package/os/naming/naming.module.ts +25 -25
  424. package/os/notes/notes.module.ts +87 -85
  425. package/os/plan/frontmatter-io.ts +5 -5
  426. package/os/plan/handlers/archive.ts +8 -4
  427. package/os/plan/plan.module.ts +33 -34
  428. package/os/plugin/plugin.module.ts +8 -6
  429. package/os/program/discovery.ts +2 -2
  430. package/os/program/handlers/complete.ts +1 -1
  431. package/os/program/handlers/lease.ts +1 -1
  432. package/os/program/handlers/seal.ts +1 -1
  433. package/os/program/lease.ts +1 -1
  434. package/os/program/program.module.ts +198 -193
  435. package/os/queue/index.ts +1 -1
  436. package/os/queue/manifest.ts +10 -9
  437. package/os/queue/queue-validate.test.ts +6 -15
  438. package/os/rfc/acceptance.ts +12 -6
  439. package/os/rfc/decision-log.ts +4 -3
  440. package/os/rfc/dna-trace.ts +8 -2
  441. package/os/rfc/frontmatter-io.ts +5 -5
  442. package/os/rfc/handlers/archive.ts +9 -5
  443. package/os/rfc/handlers/check.ts +5 -3
  444. package/os/rfc/handlers/implement-stamp.ts +15 -10
  445. package/os/rfc/handlers/index-graph.ts +3 -3
  446. package/os/rfc/handlers/lifecycle.ts +7 -2
  447. package/os/rfc/handlers/list-create.ts +7 -6
  448. package/os/rfc/handlers/shared.ts +3 -3
  449. package/os/rfc/handlers/supersede-propose.ts +8 -3
  450. package/os/rfc/handlers/validate-rules-rfc1006.test.ts +18 -6
  451. package/os/rfc/handlers/validate-rules.ts +10 -5
  452. package/os/rfc/rfc-create-concurrent.test.ts +11 -3
  453. package/os/rfc/rfc.module.ts +413 -374
  454. package/os/rfc/verification-evidence.ts +11 -5
  455. package/os/rfc/verification-refresh.ts +4 -3
  456. package/os/session/frontmatter-io.ts +14 -14
  457. package/os/session/handlers/archive.ts +8 -4
  458. package/os/session/handlers/metrics-aggregate.ts +34 -13
  459. package/os/session/handlers/metrics-rfc.ts +13 -8
  460. package/os/session/handlers/metrics-session.ts +7 -3
  461. package/os/session/handlers/save.ts +12 -8
  462. package/os/session/session.module.ts +6 -0
  463. package/os/spec/live-spec-list.ts +4 -4
  464. package/os/spec/live-spec-merge.ts +5 -5
  465. package/os/spec/live-spec-show.ts +3 -3
  466. package/os/spec/live-spec-validate.ts +4 -4
  467. package/os/spec/spec-materialize.ts +9 -9
  468. package/os/spec/spec-status.ts +9 -9
  469. package/os/spec/spec-validate.ts +7 -7
  470. package/os/spec/spec.module.ts +8 -0
  471. package/os/werkstatt/handlers/lock.ts +16 -16
  472. package/os/werkstatt/handlers/werkstatt-lock-recover.ts +3 -3
  473. package/os/werkstatt/handlers/werkstatt-operation-validate.ts +4 -2
  474. package/os/werkstatt/werkstatt.module.ts +8 -5
  475. package/os/workflow/handlers.ts +7 -5
  476. package/os/workflow/workflow.module.ts +45 -44
  477. package/package.json +1 -1
  478. package/profiles/forge-shell.yaml +3 -0
  479. package/profiles/godot-game.yaml +3 -0
  480. package/profiles/phaser-game.yaml +3 -0
  481. package/profiles/site-workshop.yaml +567 -564
  482. package/skills/fo/fo-add-tests/SKILL.md +2 -2
  483. package/skills/fo/fo-architecture/SKILL.md +2 -2
  484. package/skills/fo/fo-compass-annotate/SKILL.md +2 -2
  485. package/skills/fo/fo-design-summit/SKILL.md +2 -2
  486. package/skills/fo/fo-doc-audit/SKILL.md +2 -2
  487. package/skills/fo/fo-explore/SKILL.md +2 -2
  488. package/skills/fo/fo-extract-dna/SKILL.md +2 -2
  489. package/skills/fo/fo-fix/SKILL.md +2 -2
  490. package/skills/fo/fo-handoff/SKILL.md +2 -2
  491. package/skills/fo/fo-harvest/SKILL.md +2 -2
  492. package/skills/fo/fo-idea/SKILL.md +2 -2
  493. package/skills/fo/fo-idea-audit/SKILL.md +2 -2
  494. package/skills/fo/fo-idea-create-adr/SKILL.md +3 -3
  495. package/skills/fo/fo-idea-create-rfc/SKILL.md +3 -3
  496. package/skills/fo/fo-idea-enhance/SKILL.md +2 -2
  497. package/skills/fo/fo-idea-i-just-want-to-see-the-plan/SKILL.md +2 -2
  498. package/skills/fo/fo-idea-i-just-want-to-see-the-result/SKILL.md +1 -1
  499. package/skills/fo/fo-idea-implement/SKILL.md +2 -2
  500. package/skills/fo/fo-idea-plan/SKILL.md +2 -2
  501. package/skills/fo/fo-idea-status/SKILL.md +2 -2
  502. package/skills/fo/fo-knowledge-distill/SKILL.md +2 -2
  503. package/skills/fo/fo-memory-sync/SKILL.md +2 -2
  504. package/skills/fo/fo-qa/SKILL.md +2 -2
  505. package/skills/fo/fo-review/SKILL.md +2 -2
  506. package/skills/fo/fo-session-retro/SKILL.md +2 -2
  507. package/skills/fo/fo-session-save/SKILL.md +2 -2
  508. package/skills/fo/fo-spec-ingest/SKILL.md +2 -2
  509. package/skills/fo/fo-step-commit/SKILL.md +1 -1
  510. package/skills/fo/fo-triage/SKILL.md +2 -2
  511. package/skills/meta/forge-bootstrap/SKILL.md +1 -1
  512. package/skills/meta/port-to-forge/SKILL.md +1 -1
  513. package/skills/meta/skill-create/SKILL.md +1 -1
  514. package/skills/shared/grilling/SKILL.md +1 -1
  515. package/skills/shared/grilling/learned-principles.archive.md +17 -0
  516. package/skills/shared/grilling/learned-principles.md +0 -1
  517. package/skills/shared/knowledge/learned-principles.md +6 -0
  518. package/skills/shared/my-preferences/SKILL.md +1 -1
  519. package/skills/shared/windows-ai-tooling/SKILL.md +1 -1
  520. package/skills/shared/writing-great-skills/SKILL.md +1 -1
  521. package/src/compass/contract-registry.ts +1 -1
  522. package/src/config/forge-config.ts +12 -1
  523. package/src/knowledge/__tests__/sync.test.ts +2 -7
  524. package/src/knowledge/budgets.ts +1 -1
  525. package/src/knowledge/compact.ts +1 -1
  526. package/src/knowledge/parse.ts +1 -1
  527. package/src/knowledge/sync.ts +3 -5
  528. package/src/migration-adapters/git-utils.ts +2 -2
  529. package/src/migration-adapters/ignored-files.ts +2 -2
  530. package/src/migration-adapters/node-typescript-pnpm/index.ts +1 -1
  531. package/src/migration-adapters/phaser-pnpm/index.ts +1 -1
  532. package/src/onboarding/agents-generate.ts +91 -50
  533. package/src/onboarding/create.ts +10 -10
  534. package/src/onboarding/doctor.ts +199 -59
  535. package/src/onboarding/init.ts +38 -1
  536. package/src/onboarding/invariant-engine.ts +1 -1
  537. package/src/onboarding/memory-compact.ts +189 -0
  538. package/src/onboarding/memory-scaffold.ts +2 -2
  539. package/src/onboarding/nested-agents-generate.ts +50 -5
  540. package/src/onboarding/nested-agents-templates.ts +19 -13
  541. package/src/onboarding/npm-token-check.ts +2 -2
  542. package/src/onboarding/prettierignore.ts +263 -0
  543. package/src/onboarding/profile-validate.ts +5 -4
  544. package/src/onboarding/scaffold-project.ts +38 -27
  545. package/src/onboarding/scaffold.ts +1 -1
  546. package/src/onboarding/skill-markers.ts +162 -0
  547. package/src/onboarding/templates/behavioral-layer-core.md +2 -4
  548. package/src/onboarding/upgrade.ts +285 -89
  549. package/src/onboarding/workspace-discovery.ts +16 -2
  550. package/src/pipeline-status.test.ts +1 -4
  551. package/src/pipeline-status.ts +30 -13
  552. package/src/profiles/stack-profile.ts +1 -1
  553. package/src/registry.ts +4 -4
  554. package/src/skill-schema.ts +4 -1
  555. package/src/tests/acceptance-probe-kinds.test.ts +5 -15
  556. package/src/tests/agents-generate.test.ts +32 -7
  557. package/src/tests/contract-registry.test.ts +12 -6
  558. package/src/tests/doctor-dist-freshness.test.ts +110 -0
  559. package/src/tests/doctor-fix.test.ts +142 -0
  560. package/src/tests/doctor-nested-agents.test.ts +160 -0
  561. package/src/tests/editable-generated-region.test.ts +231 -0
  562. package/src/tests/file-size-lint.test.ts +8 -12
  563. package/src/tests/fixtures/agents-generate-business-before.txt +54 -54
  564. package/src/tests/markdown-table.test.ts +107 -0
  565. package/src/tests/memory-compact.test.ts +143 -0
  566. package/src/tests/prettierignore-manage.test.ts +134 -0
  567. package/src/tests/skill-agents-sync.test.ts +168 -0
  568. package/src/tests/skill-sync-marker.test.ts +134 -0
  569. package/src/tests/skill-validate.test.ts +12 -5
  570. package/src/tests/upgrade.test.ts +87 -41
  571. package/src/tests/workspace-discovery.test.ts +28 -0
  572. package/src/types.ts +123 -0
  573. package/src/utils/editable-region.ts +156 -0
  574. package/src/utils/fs-idempotent.ts +12 -6
  575. package/src/utils/generated-marker.ts +36 -2
  576. package/src/utils/index.ts +17 -0
  577. package/src/utils/io.ts +143 -0
  578. package/src/utils/markdown-table.ts +121 -0
  579. package/src/utils/sync-fs.ts +43 -0
  580. package/src/validators/note-frontmatter-validate.ts +1 -1
  581. package/src/validators/note-link-validate.ts +1 -1
  582. package/src/validators/note-orphan-detect.ts +1 -1
  583. package/src/validators/port-validate.ts +1 -1
  584. package/src/validators/skill-validate.ts +38 -13
@@ -6,13 +6,14 @@
6
6
  </non-goals>
7
7
  </MODULE_CONTRACT>
8
8
  <CHANGE_SUMMARY>
9
- <item>RFC-0374: initial forgeCompassModule registering 12 compass commands.</item>
10
9
  <item>RFC-0538: renamed compass.changesummary.tidy to compass.summary.trim, removed compass.annotate, compass.clear, compass.markup.migrate, compass.invariant.add.</item>
11
10
  <item>RFC-0556: removed dynamic import of @warpgogol/site-kernel-checks, all handlers now inlined in forge/os/compass/handlers/.</item>
12
11
  <item>RFC-1095: compass.summary.record, trim repair rewrite, commit integration</item>
13
12
  <item>RFC-1097: steps 1-4 — compass.migrate codemod
14
13
 
15
14
  Add the v1 to v2 Compass header codemod: migrateFile pure transform (collapse, strip, seed, reorder, purpose-flag actions), migrateWorkspace walker, runCompassMigrate handler with dirty-tree refusal and --force/--files/--dry-run flags, module registration, and 15 unit tests.</item>
15
+ <item>RFC-1173: declare mutatesState on all kernel commands — collectDeclarationDiagnostics emits error-severity MUTATES-STATE-DECLARED, command.manifest.validate is the blocking consumer in packages.check, sweep declares the flag on every command definition (factories hardcode false for read-only check specs)</item>
16
+ <history>RFC-0374</history>
16
17
  </CHANGE_SUMMARY>
17
18
  */
18
19
 
@@ -59,6 +60,7 @@ export const forgeCompassModule: ForgeModule = {
59
60
  commands: [
60
61
  {
61
62
  name: "compass.inventory",
63
+ mutatesState: true,
62
64
  description: "Generate the repository-wide Compass source inventory XML report.",
63
65
  scope: "workspace",
64
66
  supportsAllSites: true,
@@ -72,6 +74,7 @@ export const forgeCompassModule: ForgeModule = {
72
74
  },
73
75
  {
74
76
  name: "compass.validate",
77
+ mutatesState: false,
75
78
  contract: "compass",
76
79
  rules: [],
77
80
  description:
@@ -99,6 +102,7 @@ export const forgeCompassModule: ForgeModule = {
99
102
  "packages/**/*.{astro,ts,tsx,js,mjs,css,cs,tscn,tres,gd,md}",
100
103
  "services/**/*.{ts,tsx,js,mjs,css,cs,tscn,tres,gd,md}",
101
104
  ],
105
+ generates: [],
102
106
  reads: [
103
107
  "packages/**/*.{ts,tsx,astro,js,mjs,css,cs,tscn,tres,gd,md}",
104
108
  "apps/**/*.{ts,tsx,astro,js,mjs,css,cs,tscn,tres,gd,md}",
@@ -137,6 +141,7 @@ export const forgeCompassModule: ForgeModule = {
137
141
  "packages/**/*.{astro,ts,tsx,js,mjs,css,cs,tscn,tres,gd,md}",
138
142
  "services/**/*.{ts,tsx,js,mjs,css,cs,tscn,tres,gd,md}",
139
143
  ],
144
+ generates: [],
140
145
  reads: [
141
146
  "packages/**/*.{ts,tsx,astro,js,mjs,css,cs,tscn,tres,gd,md}",
142
147
  "apps/**/*.{ts,tsx,astro,js,mjs,css,cs,tscn,tres,gd,md}",
@@ -164,6 +169,7 @@ export const forgeCompassModule: ForgeModule = {
164
169
  "packages/**/*.{astro,ts,tsx,js,mjs,css,cs,tscn,tres,gd,md}",
165
170
  "services/**/*.{ts,tsx,js,mjs,css,cs,tscn,tres,gd,md}",
166
171
  ],
172
+ generates: [],
167
173
  reads: [
168
174
  "packages/**/*.{ts,tsx,astro,js,mjs,css,cs,tscn,tres,gd,md}",
169
175
  "apps/**/*.{ts,tsx,astro,js,mjs,css,cs,tscn,tres,gd,md}",
@@ -189,6 +195,8 @@ export const forgeCompassModule: ForgeModule = {
189
195
  },
190
196
  {
191
197
  name: "compass.audit.plan",
198
+ mutatesState: false,
199
+ execOnReadOnly: true,
192
200
  description:
193
201
  "Emit a deterministic work-order of files whose revision has advanced past the threshold since their last Compass audit (RFC-0352). Read-only, no LLM.",
194
202
  scope: "workspace",
@@ -210,12 +218,14 @@ export const forgeCompassModule: ForgeModule = {
210
218
  },
211
219
  {
212
220
  name: "compass.audit.record",
221
+ modulePath: "packages/forge/os/compass/compass.module.ts",
213
222
  description:
214
223
  "Stamp a file's audit verdict and current revision into the compass-audit ledger (RFC-0352). Mutating. Required flags: `--file`, `--verdict`.",
215
224
  scope: "workspace",
216
225
  mutatesState: true,
217
226
  supportsAllSites: true,
218
227
  writes: ["docs/compass-audit-ledger.generated.yaml"],
228
+ generates: [{ path: "docs/compass-audit-ledger.generated.yaml", phase: "on-demand" }],
219
229
  reads: ["docs/compass-audit-ledger.generated.yaml"],
220
230
  cacheable: false,
221
231
  flags: {
@@ -231,12 +241,16 @@ export const forgeCompassModule: ForgeModule = {
231
241
  },
232
242
  {
233
243
  name: "compass.audit.baseline",
244
+ modulePath: "packages/forge/os/compass/compass.module.ts",
234
245
  description:
235
246
  "Seed the compass-audit ledger for every authored file at its current revision with verdict=baseline (RFC-0352). One-time bootstrap.",
236
247
  scope: "workspace",
237
248
  mutatesState: true,
238
249
  supportsAllSites: true,
239
250
  writes: ["docs/compass-audit-ledger.generated.yaml"],
251
+ // Artifact ownership is claimed by compass.audit.record (GENERATES-PATH-
252
+ // COLLISION forbids two owners on a non-glob path); baseline only writes it.
253
+ generates: [],
240
254
  reads: [
241
255
  "packages/**/*.{ts,tsx,astro,js,mjs,css,cs,tscn,tres,gd,md}",
242
256
  "apps/**/*.{ts,tsx,astro,js,mjs,css,cs,tscn,tres,gd,md}",
@@ -248,6 +262,8 @@ export const forgeCompassModule: ForgeModule = {
248
262
  },
249
263
  {
250
264
  name: "compass.audit.validate",
265
+ mutatesState: false,
266
+ execOnReadOnly: true,
251
267
  contract: "compass",
252
268
  rules: [],
253
269
  description:
@@ -18,9 +18,9 @@ mode (RFC-0556). Drives per-file semantic-truth auditing on a revision cadence (
18
18
  </CHANGE_SUMMARY>
19
19
  */
20
20
 
21
- import { mkdir, readFile } from "node:fs/promises";
22
21
  import { resolve, relative } from "node:path";
23
- import { execFile, execFileSync } from "node:child_process";
22
+ import { ambientIo, resolveIo } from "../../../src/utils/io.ts";
23
+ import { execFile, execFileSync } from "../../../src/utils/sync-fs.ts";
24
24
  import { promisify } from "node:util";
25
25
  import { createCompassInventoryEntries } from "./compass-inventory.ts";
26
26
  import { resolveCompassPolicy } from "../policy.ts";
@@ -36,6 +36,10 @@ import type {
36
36
  } from "../../../src/types.ts";
37
37
  import { parse as yamlParse, stringify as yamlStringify } from "yaml";
38
38
 
39
+ // Ambient default for helper fns without a context param — handlers override
40
+ // with `const io = resolveIo(context.io)` inside their own scope.
41
+ const io = ambientIo;
42
+
39
43
  const execFileAsync = promisify(execFile);
40
44
  const LEDGER_PATH = "docs/compass-audit-ledger.generated.yaml";
41
45
  const DEFAULT_THRESHOLD = 30;
@@ -93,7 +97,7 @@ function withLedgerAdvisory(ledger: Partial<CompassAuditLedger>): CompassAuditLe
93
97
  async function loadLedger(workspaceRoot: string): Promise<CompassAuditLedger> {
94
98
  const abs = resolve(workspaceRoot, LEDGER_PATH);
95
99
  try {
96
- const content = await readFile(abs, "utf8");
100
+ const content = await io.readFile(abs);
97
101
  return withLedgerAdvisory(yamlParse(content) as Partial<CompassAuditLedger>);
98
102
  } catch {
99
103
  return withLedgerAdvisory({});
@@ -104,7 +108,7 @@ async function saveLedger(workspaceRoot: string, ledger: CompassAuditLedger): Pr
104
108
  const normalized = withLedgerAdvisory(ledger);
105
109
  normalized.entries.sort((a, b) => a.path.localeCompare(b.path));
106
110
  const abs = resolve(workspaceRoot, LEDGER_PATH);
107
- await mkdir(resolve(abs, ".."), { recursive: true });
111
+ await io.mkdir(resolve(abs, ".."));
108
112
  const header = buildGeneratedHeader({
109
113
  ownerCommand: "compass.audit.record",
110
114
  filePath: LEDGER_PATH,
@@ -194,6 +198,7 @@ export async function runCompassAuditPlan(
194
198
  skippedIneligible: number;
195
199
  }>
196
200
  > {
201
+ const io = resolveIo(context.io);
197
202
  const scanRoot = resolveCompassScanRoot(input, context);
198
203
  const policy = resolveCompassPolicy(context.workspaceRoot, context.forgeRoot);
199
204
  const entries = await createCompassInventoryEntries(
@@ -238,7 +243,7 @@ export async function runCompassAuditPlan(
238
243
  }
239
244
 
240
245
  const absPath = resolve(context.workspaceRoot, entry.path);
241
- const source = await readFile(absPath, "utf8");
246
+ const source = await io.readFile(absPath);
242
247
  const moduleContract = extractBlock(source, "MODULE_CONTRACT");
243
248
  const keyDecisions = extractBlock(source, "KEY_DECISIONS");
244
249
  const changeSummary = extractBlock(source, "CHANGE_SUMMARY");
@@ -285,6 +290,7 @@ export async function runCompassAuditRecord(
285
290
  action: "recorded";
286
291
  }>
287
292
  > {
293
+ const _io = resolveIo(context.io);
288
294
  const rawFilePath = input.flags["file"] as string | undefined;
289
295
  const verdict = input.flags["verdict"] as CompassAuditVerdict | undefined;
290
296
  const agentFlag = input.flags["agent"] as string | undefined;
@@ -366,6 +372,7 @@ export async function runCompassAuditBaseline(
366
372
  total: number;
367
373
  }>
368
374
  > {
375
+ const _io = resolveIo(context.io);
369
376
  const scanRoot = resolveCompassScanRoot(input, context);
370
377
  const policy = resolveCompassPolicy(context.workspaceRoot, context.forgeRoot);
371
378
  const entries = await createCompassInventoryEntries(
@@ -444,6 +451,7 @@ export async function runCompassAuditValidate(
444
451
  skippedPaths: string[];
445
452
  }>
446
453
  > {
454
+ const _io = resolveIo(context.io);
447
455
  const strict = input.flags["strict"] === true;
448
456
  const scanRoot = resolveCompassScanRoot(input, context);
449
457
  const policy = resolveCompassPolicy(context.workspaceRoot, context.forgeRoot);
@@ -20,7 +20,8 @@
20
20
  */
21
21
 
22
22
  import { resolve } from "node:path";
23
- import { readFile } from "node:fs/promises";
23
+ import { resolveIo } from "../../../src/utils/io.ts";
24
+
24
25
  import { createCompassInventoryEntries } from "./compass-inventory.ts";
25
26
  import { resolveCompassPolicy } from "../policy.ts";
26
27
  import { resolveCompassScanRoot } from "./resolve-scan-root.ts";
@@ -49,6 +50,7 @@ export async function runCompassSummaryTrim(
49
50
  files: Array<{ path: string; removed: string[]; kept: number }>;
50
51
  }>
51
52
  > {
53
+ const io = resolveIo(context.io);
52
54
  const mode = input.flags["mode"];
53
55
  if (mode !== undefined && mode !== "repair") {
54
56
  context.logger.error(
@@ -83,7 +85,7 @@ export async function runCompassSummaryTrim(
83
85
  }
84
86
 
85
87
  const absPath = resolve(context.workspaceRoot, entry.path);
86
- const source = await readFile(absPath, "utf8");
88
+ const source = await io.readFile(absPath);
87
89
  const blockMatch = source.match(CHANGE_SUMMARY_BLOCK_RE);
88
90
  if (!blockMatch) continue;
89
91
 
@@ -26,7 +26,8 @@ Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PU
26
26
  */
27
27
 
28
28
  import { resolve } from "node:path";
29
- import { readFile } from "node:fs/promises";
29
+ import { resolveIo } from "../../../src/utils/io.ts";
30
+
30
31
  import {
31
32
  createCompassInventoryEntries,
32
33
  evaluateV2Rules,
@@ -267,6 +268,7 @@ export async function runCompassInventory(
267
268
  policySource: CompassPolicySource;
268
269
  }>
269
270
  > {
271
+ const _io = resolveIo(context.io);
270
272
  const scanRoot = resolveCompassScanRoot(input, context) ?? context.workspaceRoot;
271
273
  const policy = resolveCompassPolicy(scanRoot, context.forgeRoot);
272
274
  const entries = await createCompassInventoryEntries(scanRoot, input, undefined, policy);
@@ -332,6 +334,7 @@ export async function runCompassValidation(
332
334
  }>;
333
335
  }>
334
336
  > {
337
+ const io = resolveIo(context.io);
335
338
  const scanRoot = resolveCompassScanRoot(input, context);
336
339
  let mode: ReturnType<typeof resolveCompassMode>;
337
340
  try {
@@ -383,7 +386,7 @@ export async function runCompassValidation(
383
386
  );
384
387
  for (const entry of authoredEntries) {
385
388
  const absPath = resolve(context.workspaceRoot, entry.path);
386
- const source = getEntrySource(entry) ?? (await readFile(absPath, "utf8"));
389
+ const source = getEntrySource(entry) ?? (await io.readFile(absPath));
387
390
  for (const v2 of evaluateV2Rules(entry, source, policy)) {
388
391
  if (!V2_VALIDATE_RULE_PREFIXES.some((prefix) => v2.ruleId.startsWith(prefix))) {
389
392
  continue;
@@ -449,7 +452,7 @@ export async function runCompassValidation(
449
452
  }
450
453
 
451
454
  const absPath = resolve(context.workspaceRoot, entry.path);
452
- const source = await readFile(absPath, "utf8");
455
+ const source = await io.readFile(absPath);
453
456
  if (TODO_COMPASS_RE.test(source)) {
454
457
  context.logger.error(
455
458
  `[compass.validate] COMPASS-TODO-01: ${entry.path}: unfilled ${compassTodoLabel} sentinel in Compass block`,
@@ -496,7 +499,7 @@ export async function runCompassValidation(
496
499
  if (applicableSpecs.length === 0) continue;
497
500
 
498
501
  const absPath = resolve(context.workspaceRoot, entry.path);
499
- const source = await readFile(absPath, "utf8");
502
+ const source = await io.readFile(absPath);
500
503
 
501
504
  for (const spec of applicableSpecs) {
502
505
  const blockMarker = `<${spec.blockId.toUpperCase().replace(/-/g, "_")}>`;
@@ -29,10 +29,14 @@ Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PU
29
29
 
30
30
  */
31
31
 
32
- import { readdir, readFile } from "node:fs/promises";
33
32
  import { join, relative, resolve } from "node:path";
33
+ import { ambientIo } from "../../../src/utils/io.ts";
34
34
  import type { ForgeCommandInput } from "../../../src/types.ts";
35
35
  import { hasGeneratedMarker } from "../../../src/utils/generated-marker.ts";
36
+
37
+ // Ambient default for helper fns without a context param — handlers override
38
+ // with `const io = resolveIo(context.io)` inside their own scope.
39
+ const io = ambientIo;
36
40
  import {
37
41
  parseGovernanceIdParts,
38
42
  resolveCompassPolicy,
@@ -158,19 +162,18 @@ function hasRelevantExtension(filePath: string, policy: CompassPolicy): boolean
158
162
  async function collectSourceFiles(targetPath: string, policy: CompassPolicy): Promise<string[]> {
159
163
  let stat;
160
164
  try {
161
- const { stat: fsStat } = await import("node:fs/promises");
162
- stat = await fsStat(targetPath);
165
+ stat = await io.stat(targetPath);
163
166
  } catch {
164
167
  return [];
165
168
  }
166
169
 
167
- if (stat.isFile()) {
170
+ if (stat.isFile) {
168
171
  return hasRelevantExtension(targetPath, policy) ? [targetPath] : [];
169
172
  }
170
173
 
171
174
  let entries;
172
175
  try {
173
- entries = await readdir(targetPath, { withFileTypes: true });
176
+ entries = await io.readdir(targetPath);
174
177
  } catch {
175
178
  return [];
176
179
  }
@@ -179,7 +182,7 @@ async function collectSourceFiles(targetPath: string, policy: CompassPolicy): Pr
179
182
  for (const entry of entries) {
180
183
  const absolutePath = join(targetPath, entry.name);
181
184
 
182
- if (entry.isDirectory()) {
185
+ if (entry.isDirectory) {
183
186
  if (shouldIgnoreDirectory(entry.name, policy)) {
184
187
  continue;
185
188
  }
@@ -188,7 +191,7 @@ async function collectSourceFiles(targetPath: string, policy: CompassPolicy): Pr
188
191
  continue;
189
192
  }
190
193
 
191
- if (entry.isFile() && hasRelevantExtension(absolutePath, policy)) {
194
+ if (entry.isFile && hasRelevantExtension(absolutePath, policy)) {
192
195
  files.push(absolutePath);
193
196
  }
194
197
  }
@@ -722,7 +725,7 @@ export async function createCompassInventoryEntries(
722
725
  const entries: CompassInventoryEntry[] = [];
723
726
 
724
727
  for (const filePath of files.sort()) {
725
- const source = await readFile(filePath, "utf8");
728
+ const source = await io.readFile(filePath);
726
729
  const pathFromRoot = relative(workspaceRoot, filePath).replace(/\\/g, "/");
727
730
  const segments = getRelativeSegments(filePath, workspaceRoot);
728
731
  const relativePathWithinWorkspace = leafWorkspaceRoot
@@ -25,7 +25,7 @@ compass-migrate-handler hint used a consumer-specific run command — switched t
25
25
  </CHANGE_SUMMARY>
26
26
  */
27
27
 
28
- import { execFileSync } from "node:child_process";
28
+ import { execFileSync } from "../../../src/utils/sync-fs.ts";
29
29
  import { migrateWorkspace, type MigrateResult } from "./compass-migrate.ts";
30
30
  import { resolveCompassScanRoot } from "./resolve-scan-root.ts";
31
31
  import { resolveCompassPolicy } from "../policy.ts";
@@ -26,8 +26,8 @@ Add the v1 to v2 Compass header codemod: migrateFile pure transform (collapse, s
26
26
  </CHANGE_SUMMARY>
27
27
  */
28
28
 
29
- import { readFile } from "node:fs/promises";
30
29
  import { relative, resolve } from "node:path";
30
+ import { ambientIo } from "../../../src/utils/io.ts";
31
31
  import {
32
32
  createCompassInventoryEntries,
33
33
  detectRiskClass,
@@ -46,6 +46,10 @@ import { writeFileIfChanged } from "../../../src/utils/fs-idempotent.ts";
46
46
  import type { CompassPolicy } from "../policy.ts";
47
47
  import type { ForgeCommandInput } from "../../../src/types.ts";
48
48
 
49
+ // Ambient default for helper fns without a context param — handlers override
50
+ // with `const io = resolveIo(context.io)` inside their own scope.
51
+ const io = ambientIo;
52
+
49
53
  export type MigrateAction =
50
54
  | "collapsed"
51
55
  | "stripped"
@@ -324,7 +328,7 @@ export async function migrateWorkspace(
324
328
  const target = toTarget(workspaceRoot, absPath, policy);
325
329
  let source: string;
326
330
  try {
327
- source = await readFile(absPath, "utf8");
331
+ source = await io.readFile(absPath);
328
332
  } catch {
329
333
  result.files.push({ path: file, actions: ["unparseable"] });
330
334
  continue;
@@ -354,7 +358,7 @@ export async function migrateWorkspace(
354
358
  if (entry.authoringStatus !== "authored") continue;
355
359
  result.scanned += 1;
356
360
  const absPath = resolve(workspaceRoot, entry.path);
357
- const source = getEntrySource(entry) ?? (await readFile(absPath, "utf8"));
361
+ const source = getEntrySource(entry) ?? (await io.readFile(absPath));
358
362
  const segments = getRelativeSegments(absPath, workspaceRoot);
359
363
  const workspaceRelativePath = getWorkspaceRelativeSegments(segments, policy).join("/");
360
364
  const migrated = migrateFile(source, policy, entry.path, workspaceRelativePath);
@@ -14,12 +14,17 @@ with integrity-registry lookup and git-history fallback, plus getFileRevisionFro
14
14
  </CHANGE_SUMMARY>
15
15
  */
16
16
 
17
- import { execFile } from "node:child_process";
17
+ import { execFile } from "../../../src/utils/sync-fs.ts";
18
+ import { ambientIo } from "../../../src/utils/io.ts";
18
19
  import { promisify } from "node:util";
19
20
  import { createHash } from "node:crypto";
20
- import { readFile } from "node:fs/promises";
21
+
21
22
  import { resolve, join } from "node:path";
22
23
 
24
+ // Ambient default for helper fns without a context param — handlers override
25
+ // with `const io = resolveIo(context.io)` inside their own scope.
26
+ const io = ambientIo;
27
+
23
28
  const execFileAsync = promisify(execFile);
24
29
  const DEFAULT_GIT_TIMEOUT_MS = 15_000;
25
30
 
@@ -73,7 +78,7 @@ type PathsCurrent = Record<string, string>;
73
78
  async function loadEntitiesById(cwd: string): Promise<EntitiesById> {
74
79
  const filePath = join(cwd, ".integrity", "index", "entities.by-id.json");
75
80
  try {
76
- const content = await readFile(filePath, "utf8");
81
+ const content = await io.readFile(filePath);
77
82
  return JSON.parse(content) as EntitiesById;
78
83
  } catch {
79
84
  return {};
@@ -83,7 +88,7 @@ async function loadEntitiesById(cwd: string): Promise<EntitiesById> {
83
88
  async function loadPathsCurrent(cwd: string): Promise<PathsCurrent> {
84
89
  const filePath = join(cwd, ".integrity", "index", "paths.current.json");
85
90
  try {
86
- const content = await readFile(filePath, "utf8");
91
+ const content = await io.readFile(filePath);
87
92
  return JSON.parse(content) as PathsCurrent;
88
93
  } catch {
89
94
  return {};
@@ -110,7 +115,7 @@ export async function getRevisionByPath(
110
115
  let contentHash = entity.contentHash;
111
116
  try {
112
117
  const abs = resolve(cwd, repoPath);
113
- const content = await readFile(abs, "utf8");
118
+ const content = await io.readFile(abs);
114
119
  contentHash = "sha256-" + createHash("sha256").update(content).digest("hex");
115
120
  } catch {
116
121
  // keep registry hash
@@ -127,7 +132,7 @@ export async function getRevisionByPath(
127
132
  let contentHash = "";
128
133
  try {
129
134
  const abs = resolve(cwd, repoPath);
130
- const content = await readFile(abs, "utf8");
135
+ const content = await io.readFile(abs);
131
136
  contentHash = "sha256-" + createHash("sha256").update(content).digest("hex");
132
137
  } catch {
133
138
  // file may not exist
@@ -23,7 +23,7 @@ compass-migrate-handler hint used a consumer-specific run command — switched t
23
23
  </CHANGE_SUMMARY>
24
24
  */
25
25
 
26
- import { existsSync } from "node:fs";
26
+ import { existsSync } from "../../../src/utils/sync-fs.ts";
27
27
  import { resolve } from "node:path";
28
28
  import type { ForgeCommandInput, ForgeRuntimeContext } from "../../../src/types.ts";
29
29
 
@@ -32,13 +32,18 @@ compass-migrate-handler hint used a consumer-specific run command — switched t
32
32
  </CHANGE_SUMMARY>
33
33
  */
34
34
 
35
- import { existsSync } from "node:fs";
36
- import { readFile } from "node:fs/promises";
35
+ import { existsSync } from "../../../src/utils/sync-fs.ts";
36
+ import { ambientIo, resolveIo } from "../../../src/utils/io.ts";
37
+
37
38
  import { resolve, relative } from "node:path";
38
39
  import { detectRiskClass, getWorkspaceRelativeSegments } from "./compass-inventory.ts";
39
40
  import { parseGovernanceIdParts, resolveCompassPolicy, type CompassPolicy } from "../policy.ts";
40
41
  import { resolveCompassScanRoot } from "./resolve-scan-root.ts";
41
42
  import { writeFileIfChanged } from "../../../src/utils/fs-idempotent.ts";
43
+
44
+ // Ambient default for helper fns without a context param — handlers override
45
+ // with `const io = resolveIo(context.io)` inside their own scope.
46
+ const io = ambientIo;
42
47
  import type {
43
48
  ForgeCommandInput,
44
49
  ForgeCommandResult,
@@ -185,7 +190,7 @@ export async function recordSummaryItem(
185
190
  dryRun: boolean,
186
191
  policy: CompassPolicy,
187
192
  ): Promise<RecordOutcome> {
188
- const source = await readFile(absPath, "utf8");
193
+ const source = await io.readFile(absPath);
189
194
  const blockMatch = source.match(CHANGE_SUMMARY_BLOCK_RE);
190
195
  // Header-region guard: a CHANGE_SUMMARY is a header only when it sits at the
191
196
  // top of the file. Blocks deeper in the source are examples inside template
@@ -243,6 +248,7 @@ export async function runCompassSummaryRecord(
243
248
  input: ForgeCommandInput,
244
249
  context: ForgeRuntimeContext,
245
250
  ): Promise<ForgeCommandResult<SummaryRecordResult>> {
251
+ const io = resolveIo(context.io);
246
252
  const scanRoot = resolveCompassScanRoot(input, context);
247
253
  const baseRoot = scanRoot ?? context.workspaceRoot;
248
254
  const policy = resolveCompassPolicy(baseRoot, context.forgeRoot);
@@ -291,7 +297,7 @@ export async function runCompassSummaryRecord(
291
297
  if (outcome.recorded) {
292
298
  result.recorded.push(relPath);
293
299
  if (outcome.collapsed) result.collapsed.push(relPath);
294
- const source = await readFile(absPath, "utf8");
300
+ const source = await io.readFile(absPath);
295
301
  if (riskReminderNeeded(relPath, source, policy)) {
296
302
  result.keyDecisionsReminders.push(relPath);
297
303
  context.logger.warn(`[compass.summary.record] review KEY_DECISIONS in ${relPath}`);
@@ -16,6 +16,7 @@ import { execFile } from "node:child_process";
16
16
  import { promisify } from "node:util";
17
17
  import { runCompassAuditPlan } from "../compass-audit-handler.ts";
18
18
  import type { ForgeCommandInput, ForgeRuntimeContext } from "../../../../src/types.ts";
19
+ import { ambientIo } from "../../../../src/utils/io.ts";
19
20
 
20
21
  const execFileAsync = promisify(execFile);
21
22
 
@@ -38,7 +39,7 @@ function makeContext(workspaceRoot: string): ForgeRuntimeContext {
38
39
  logger: logger as never,
39
40
  dryRun: false,
40
41
  outputFormat: "json",
41
- io: {} as never,
42
+ io: ambientIo,
42
43
  actualState: undefined as never,
43
44
  fileIntents: [],
44
45
  } as unknown as ForgeRuntimeContext;