@warpgogol/forge 9.3.1 → 9.4.1

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 (509) hide show
  1. package/AGENTS.md +32 -0
  2. package/CHANGELOG.md +40 -0
  3. package/README.md +6 -4
  4. package/README.uk.md +10 -8
  5. package/bin/cli.ts +4 -4
  6. package/dist/bin/cli.js +4 -4
  7. package/dist/bin/cli.js.map +1 -1
  8. package/dist/os/adr/handlers/list-create.d.ts.map +1 -1
  9. package/dist/os/adr/handlers/list-create.js +23 -2
  10. package/dist/os/adr/handlers/list-create.js.map +1 -1
  11. package/dist/os/adr/types.d.ts +2 -0
  12. package/dist/os/adr/types.d.ts.map +1 -1
  13. package/dist/os/adr/types.js +2 -2
  14. package/dist/os/adr/types.js.map +1 -1
  15. package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
  16. package/dist/os/compass/handlers/compass-audit-handler.js +3 -1
  17. package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
  18. package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -1
  19. package/dist/os/compass/handlers/compass-header-scaffold-handler.js +6 -12
  20. package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -1
  21. package/dist/os/compass/handlers/git-revision.d.ts +2 -0
  22. package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
  23. package/dist/os/compass/handlers/git-revision.js +7 -2
  24. package/dist/os/compass/handlers/git-revision.js.map +1 -1
  25. package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
  26. package/dist/os/compass/handlers/summary-record.js +24 -14
  27. package/dist/os/compass/handlers/summary-record.js.map +1 -1
  28. package/dist/os/conformance/conformance.module.d.ts.map +1 -1
  29. package/dist/os/conformance/conformance.module.js +21 -4
  30. package/dist/os/conformance/conformance.module.js.map +1 -1
  31. package/dist/os/conformance/handlers/conformance-validate.d.ts.map +1 -1
  32. package/dist/os/conformance/handlers/conformance-validate.js +64 -8
  33. package/dist/os/conformance/handlers/conformance-validate.js.map +1 -1
  34. package/dist/os/core/archive-regen.d.ts +99 -0
  35. package/dist/os/core/archive-regen.d.ts.map +1 -0
  36. package/dist/os/core/archive-regen.js +220 -0
  37. package/dist/os/core/archive-regen.js.map +1 -0
  38. package/dist/os/core/core.module.d.ts.map +1 -1
  39. package/dist/os/core/core.module.js +159 -18
  40. package/dist/os/core/core.module.js.map +1 -1
  41. package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
  42. package/dist/os/core/handlers/assets-helpers.js +8 -3
  43. package/dist/os/core/handlers/assets-helpers.js.map +1 -1
  44. package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
  45. package/dist/os/core/handlers/forge-autonomy-validate.js +3 -1
  46. package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
  47. package/dist/os/core/handlers/package-health.d.ts +130 -0
  48. package/dist/os/core/handlers/package-health.d.ts.map +1 -1
  49. package/dist/os/core/handlers/package-health.js +548 -7
  50. package/dist/os/core/handlers/package-health.js.map +1 -1
  51. package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
  52. package/dist/os/core/handlers/release-prepare.js +5 -2
  53. package/dist/os/core/handlers/release-prepare.js.map +1 -1
  54. package/dist/os/flow/digest.d.ts.map +1 -1
  55. package/dist/os/flow/digest.js +3 -1
  56. package/dist/os/flow/digest.js.map +1 -1
  57. package/dist/os/flow/dirty-classify.d.ts +51 -0
  58. package/dist/os/flow/dirty-classify.d.ts.map +1 -0
  59. package/dist/os/flow/dirty-classify.js +83 -0
  60. package/dist/os/flow/dirty-classify.js.map +1 -0
  61. package/dist/os/flow/flow.module.d.ts.map +1 -1
  62. package/dist/os/flow/flow.module.js +110 -19
  63. package/dist/os/flow/flow.module.js.map +1 -1
  64. package/dist/os/flow/gate-engine.d.ts +13 -0
  65. package/dist/os/flow/gate-engine.d.ts.map +1 -0
  66. package/dist/os/flow/gate-engine.js +32 -0
  67. package/dist/os/flow/gate-engine.js.map +1 -0
  68. package/dist/os/flow/git.d.ts +45 -4
  69. package/dist/os/flow/git.d.ts.map +1 -1
  70. package/dist/os/flow/git.js +95 -27
  71. package/dist/os/flow/git.js.map +1 -1
  72. package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -1
  73. package/dist/os/flow/handlers/flow-backmerge.js +12 -5
  74. package/dist/os/flow/handlers/flow-backmerge.js.map +1 -1
  75. package/dist/os/flow/handlers/flow-check.d.ts.map +1 -1
  76. package/dist/os/flow/handlers/flow-check.js +25 -3
  77. package/dist/os/flow/handlers/flow-check.js.map +1 -1
  78. package/dist/os/flow/handlers/flow-cut.d.ts +4 -1
  79. package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
  80. package/dist/os/flow/handlers/flow-cut.js +75 -38
  81. package/dist/os/flow/handlers/flow-cut.js.map +1 -1
  82. package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -1
  83. package/dist/os/flow/handlers/flow-discard.js +33 -5
  84. package/dist/os/flow/handlers/flow-discard.js.map +1 -1
  85. package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
  86. package/dist/os/flow/handlers/flow-fix.js +13 -10
  87. package/dist/os/flow/handlers/flow-fix.js.map +1 -1
  88. package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -1
  89. package/dist/os/flow/handlers/flow-hold.js +13 -7
  90. package/dist/os/flow/handlers/flow-hold.js.map +1 -1
  91. package/dist/os/flow/handlers/flow-install.d.ts +2 -1
  92. package/dist/os/flow/handlers/flow-install.d.ts.map +1 -1
  93. package/dist/os/flow/handlers/flow-install.js +56 -13
  94. package/dist/os/flow/handlers/flow-install.js.map +1 -1
  95. package/dist/os/flow/handlers/flow-integrate.d.ts +54 -2
  96. package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
  97. package/dist/os/flow/handlers/flow-integrate.js +614 -65
  98. package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
  99. package/dist/os/flow/handlers/flow-open.d.ts +14 -0
  100. package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
  101. package/dist/os/flow/handlers/flow-open.js +117 -12
  102. package/dist/os/flow/handlers/flow-open.js.map +1 -1
  103. package/dist/os/flow/handlers/flow-peers.d.ts +24 -0
  104. package/dist/os/flow/handlers/flow-peers.d.ts.map +1 -0
  105. package/dist/os/flow/handlers/flow-peers.js +99 -0
  106. package/dist/os/flow/handlers/flow-peers.js.map +1 -0
  107. package/dist/os/flow/handlers/flow-status.d.ts +13 -0
  108. package/dist/os/flow/handlers/flow-status.d.ts.map +1 -1
  109. package/dist/os/flow/handlers/flow-status.js +35 -14
  110. package/dist/os/flow/handlers/flow-status.js.map +1 -1
  111. package/dist/os/flow/index.d.ts +3 -0
  112. package/dist/os/flow/index.d.ts.map +1 -1
  113. package/dist/os/flow/index.js +7 -2
  114. package/dist/os/flow/index.js.map +1 -1
  115. package/dist/os/flow/line-version.d.ts.map +1 -1
  116. package/dist/os/flow/line-version.js +2 -1
  117. package/dist/os/flow/line-version.js.map +1 -1
  118. package/dist/os/flow/locks.d.ts +37 -1
  119. package/dist/os/flow/locks.d.ts.map +1 -1
  120. package/dist/os/flow/locks.js +34 -14
  121. package/dist/os/flow/locks.js.map +1 -1
  122. package/dist/os/flow/ops-registry.d.ts +33 -0
  123. package/dist/os/flow/ops-registry.d.ts.map +1 -0
  124. package/dist/os/flow/ops-registry.js +177 -0
  125. package/dist/os/flow/ops-registry.js.map +1 -0
  126. package/dist/os/flow/preflight.d.ts +157 -0
  127. package/dist/os/flow/preflight.d.ts.map +1 -0
  128. package/dist/os/flow/preflight.js +772 -0
  129. package/dist/os/flow/preflight.js.map +1 -0
  130. package/dist/os/flow/publish.d.ts +7 -0
  131. package/dist/os/flow/publish.d.ts.map +1 -1
  132. package/dist/os/flow/publish.js +165 -3
  133. package/dist/os/flow/publish.js.map +1 -1
  134. package/dist/os/flow/registry.d.ts +26 -1
  135. package/dist/os/flow/registry.d.ts.map +1 -1
  136. package/dist/os/flow/registry.js +27 -6
  137. package/dist/os/flow/registry.js.map +1 -1
  138. package/dist/os/flow/scripts.d.ts +4 -0
  139. package/dist/os/flow/scripts.d.ts.map +1 -1
  140. package/dist/os/flow/scripts.js +8 -2
  141. package/dist/os/flow/scripts.js.map +1 -1
  142. package/dist/os/flow/session-checkout.d.ts +33 -0
  143. package/dist/os/flow/session-checkout.d.ts.map +1 -0
  144. package/dist/os/flow/session-checkout.js +151 -0
  145. package/dist/os/flow/session-checkout.js.map +1 -0
  146. package/dist/os/flow/standalone-invoke.d.ts +11 -0
  147. package/dist/os/flow/standalone-invoke.d.ts.map +1 -0
  148. package/dist/os/flow/standalone-invoke.js +75 -0
  149. package/dist/os/flow/standalone-invoke.js.map +1 -0
  150. package/dist/os/flow/worktree-path.d.ts.map +1 -1
  151. package/dist/os/flow/worktree-path.js +9 -3
  152. package/dist/os/flow/worktree-path.js.map +1 -1
  153. package/dist/os/instructions/handlers/budget-validate.d.ts +1 -0
  154. package/dist/os/instructions/handlers/budget-validate.d.ts.map +1 -1
  155. package/dist/os/instructions/handlers/budget-validate.js +12 -4
  156. package/dist/os/instructions/handlers/budget-validate.js.map +1 -1
  157. package/dist/os/instructions/instructions.module.d.ts.map +1 -1
  158. package/dist/os/instructions/instructions.module.js +4 -1
  159. package/dist/os/instructions/instructions.module.js.map +1 -1
  160. package/dist/os/mission/handlers/archive.d.ts.map +1 -1
  161. package/dist/os/mission/handlers/archive.js +12 -8
  162. package/dist/os/mission/handlers/archive.js.map +1 -1
  163. package/dist/os/mission/importer-block.d.ts +19 -0
  164. package/dist/os/mission/importer-block.d.ts.map +1 -0
  165. package/dist/os/mission/importer-block.js +124 -0
  166. package/dist/os/mission/importer-block.js.map +1 -0
  167. package/dist/os/mission/lockfile.d.ts +17 -0
  168. package/dist/os/mission/lockfile.d.ts.map +1 -1
  169. package/dist/os/mission/lockfile.js +38 -0
  170. package/dist/os/mission/lockfile.js.map +1 -1
  171. package/dist/os/mission/open-missions.d.ts +8 -0
  172. package/dist/os/mission/open-missions.d.ts.map +1 -0
  173. package/dist/os/mission/open-missions.js +42 -0
  174. package/dist/os/mission/open-missions.js.map +1 -0
  175. package/dist/os/queue/manifest.d.ts.map +1 -1
  176. package/dist/os/queue/manifest.js +11 -1
  177. package/dist/os/queue/manifest.js.map +1 -1
  178. package/dist/os/rfc/acceptance.d.ts +14 -0
  179. package/dist/os/rfc/acceptance.d.ts.map +1 -1
  180. package/dist/os/rfc/acceptance.js +18 -10
  181. package/dist/os/rfc/acceptance.js.map +1 -1
  182. package/dist/os/rfc/decision-log.d.ts.map +1 -1
  183. package/dist/os/rfc/decision-log.js +11 -2
  184. package/dist/os/rfc/decision-log.js.map +1 -1
  185. package/dist/os/rfc/frontmatter-io.d.ts +23 -0
  186. package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
  187. package/dist/os/rfc/frontmatter-io.js +82 -1
  188. package/dist/os/rfc/frontmatter-io.js.map +1 -1
  189. package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -1
  190. package/dist/os/rfc/handlers/implement-stamp-deviations.js +24 -2
  191. package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -1
  192. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  193. package/dist/os/rfc/handlers/implement-stamp.js +16 -3
  194. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  195. package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
  196. package/dist/os/rfc/handlers/index-graph.js +5 -4
  197. package/dist/os/rfc/handlers/index-graph.js.map +1 -1
  198. package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
  199. package/dist/os/rfc/handlers/list-create.js +107 -10
  200. package/dist/os/rfc/handlers/list-create.js.map +1 -1
  201. package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts +48 -0
  202. package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -1
  203. package/dist/os/rfc/handlers/rfc-evidence-sync.js +131 -2
  204. package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -1
  205. package/dist/os/rfc/handlers/validate-rules.d.ts +21 -1
  206. package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
  207. package/dist/os/rfc/handlers/validate-rules.js +77 -5
  208. package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
  209. package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
  210. package/dist/os/rfc/handlers/validate.js +64 -6
  211. package/dist/os/rfc/handlers/validate.js.map +1 -1
  212. package/dist/os/rfc/next-id.d.ts +38 -0
  213. package/dist/os/rfc/next-id.d.ts.map +1 -0
  214. package/dist/os/rfc/next-id.js +165 -0
  215. package/dist/os/rfc/next-id.js.map +1 -0
  216. package/dist/os/rfc/probe-batch.d.ts.map +1 -1
  217. package/dist/os/rfc/probe-batch.js +6 -1
  218. package/dist/os/rfc/probe-batch.js.map +1 -1
  219. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  220. package/dist/os/rfc/rfc.module.js +36 -8
  221. package/dist/os/rfc/rfc.module.js.map +1 -1
  222. package/dist/os/rfc/types.d.ts +42 -6
  223. package/dist/os/rfc/types.d.ts.map +1 -1
  224. package/dist/os/rfc/types.js +6 -6
  225. package/dist/os/rfc/types.js.map +1 -1
  226. package/dist/os/rfc/verification-evidence.d.ts +1 -1
  227. package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
  228. package/dist/os/rfc/verification-evidence.js +81 -28
  229. package/dist/os/rfc/verification-evidence.js.map +1 -1
  230. package/dist/os/rfc/verification-origin.d.ts +8 -0
  231. package/dist/os/rfc/verification-origin.d.ts.map +1 -1
  232. package/dist/os/rfc/verification-origin.js +47 -0
  233. package/dist/os/rfc/verification-origin.js.map +1 -1
  234. package/dist/os/session/handlers/save.d.ts.map +1 -1
  235. package/dist/os/session/handlers/save.js +31 -7
  236. package/dist/os/session/handlers/save.js.map +1 -1
  237. package/dist/os/spec/spec-schema.d.ts +8 -0
  238. package/dist/os/spec/spec-schema.d.ts.map +1 -1
  239. package/dist/os/spec/spec-schema.js +1 -0
  240. package/dist/os/spec/spec-schema.js.map +1 -1
  241. package/dist/os/spec/spec-status.d.ts +8 -0
  242. package/dist/os/spec/spec-status.d.ts.map +1 -1
  243. package/dist/os/spec/spec-status.js +18 -6
  244. package/dist/os/spec/spec-status.js.map +1 -1
  245. package/dist/os/spec/spec-validate.d.ts.map +1 -1
  246. package/dist/os/spec/spec-validate.js +62 -15
  247. package/dist/os/spec/spec-validate.js.map +1 -1
  248. package/dist/os/spec/spec.module.d.ts.map +1 -1
  249. package/dist/os/spec/spec.module.js +13 -5
  250. package/dist/os/spec/spec.module.js.map +1 -1
  251. package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -1
  252. package/dist/os/system/handlers/system-map-validate.js +2 -1
  253. package/dist/os/system/handlers/system-map-validate.js.map +1 -1
  254. package/dist/os/system/handlers/system-outbox-scan.d.ts +11 -0
  255. package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -1
  256. package/dist/os/system/handlers/system-outbox-scan.js +54 -6
  257. package/dist/os/system/handlers/system-outbox-scan.js.map +1 -1
  258. package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -1
  259. package/dist/os/system/handlers/system-task-collect.js +11 -5
  260. package/dist/os/system/handlers/system-task-collect.js.map +1 -1
  261. package/dist/os/system/handlers/system-task-create.d.ts.map +1 -1
  262. package/dist/os/system/handlers/system-task-create.js +6 -1
  263. package/dist/os/system/handlers/system-task-create.js.map +1 -1
  264. package/dist/os/system/handlers/system-versionset-record.d.ts +14 -0
  265. package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -1
  266. package/dist/os/system/handlers/system-versionset-record.js +246 -6
  267. package/dist/os/system/handlers/system-versionset-record.js.map +1 -1
  268. package/dist/os/system/repo.d.ts +1 -1
  269. package/dist/os/system/repo.d.ts.map +1 -1
  270. package/dist/os/system/repo.js +53 -3
  271. package/dist/os/system/repo.js.map +1 -1
  272. package/dist/os/system/scenario-schemas.d.ts +109 -3
  273. package/dist/os/system/scenario-schemas.d.ts.map +1 -1
  274. package/dist/os/system/scenario-schemas.js +66 -10
  275. package/dist/os/system/scenario-schemas.js.map +1 -1
  276. package/dist/os/system/system.module.d.ts.map +1 -1
  277. package/dist/os/system/system.module.js +69 -17
  278. package/dist/os/system/system.module.js.map +1 -1
  279. package/dist/os/system/tests/contract-fixtures.d.ts +17 -0
  280. package/dist/os/system/tests/contract-fixtures.d.ts.map +1 -0
  281. package/dist/os/system/tests/contract-fixtures.js +109 -0
  282. package/dist/os/system/tests/contract-fixtures.js.map +1 -0
  283. package/dist/src/config/forge-config.d.ts +54 -18
  284. package/dist/src/config/forge-config.d.ts.map +1 -1
  285. package/dist/src/config/forge-config.js +41 -9
  286. package/dist/src/config/forge-config.js.map +1 -1
  287. package/dist/src/conformance/index.d.ts +6 -0
  288. package/dist/src/conformance/index.d.ts.map +1 -1
  289. package/dist/src/conformance/index.js +36 -1
  290. package/dist/src/conformance/index.js.map +1 -1
  291. package/dist/src/formal/proof-runner.d.ts.map +1 -1
  292. package/dist/src/formal/proof-runner.js +10 -2
  293. package/dist/src/formal/proof-runner.js.map +1 -1
  294. package/dist/src/migration-adapters/node-typescript-pnpm/index.js +3 -1
  295. package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
  296. package/dist/src/migration-adapters/phaser-pnpm/index.js +3 -1
  297. package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
  298. package/dist/src/onboarding/agents-generate.js +4 -4
  299. package/dist/src/onboarding/agents-generate.js.map +1 -1
  300. package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
  301. package/dist/src/onboarding/nested-agents-generate.js +3 -1
  302. package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
  303. package/dist/src/onboarding/prettierignore.d.ts.map +1 -1
  304. package/dist/src/onboarding/prettierignore.js +2 -0
  305. package/dist/src/onboarding/prettierignore.js.map +1 -1
  306. package/dist/src/onboarding/scaffold-project.js +2 -2
  307. package/dist/src/onboarding/scaffold-project.js.map +1 -1
  308. package/dist/src/onboarding/upgrade.d.ts.map +1 -1
  309. package/dist/src/onboarding/upgrade.js +14 -2
  310. package/dist/src/onboarding/upgrade.js.map +1 -1
  311. package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
  312. package/dist/src/onboarding/workspace-discovery.js +3 -1
  313. package/dist/src/onboarding/workspace-discovery.js.map +1 -1
  314. package/dist/src/skill-schema.d.ts +3 -0
  315. package/dist/src/skill-schema.d.ts.map +1 -1
  316. package/dist/src/skill-schema.js +9 -2
  317. package/dist/src/skill-schema.js.map +1 -1
  318. package/dist/src/spec/resolve-spec-source.d.ts +45 -0
  319. package/dist/src/spec/resolve-spec-source.d.ts.map +1 -0
  320. package/dist/src/spec/resolve-spec-source.js +153 -0
  321. package/dist/src/spec/resolve-spec-source.js.map +1 -0
  322. package/dist/src/utils/command-inventory.d.ts +28 -0
  323. package/dist/src/utils/command-inventory.d.ts.map +1 -0
  324. package/dist/src/utils/command-inventory.js +84 -0
  325. package/dist/src/utils/command-inventory.js.map +1 -0
  326. package/dist/src/utils/io.d.ts.map +1 -1
  327. package/dist/src/utils/io.js +6 -1
  328. package/dist/src/utils/io.js.map +1 -1
  329. package/dist/src/utils/repo-path.d.ts +10 -0
  330. package/dist/src/utils/repo-path.d.ts.map +1 -0
  331. package/dist/src/utils/repo-path.js +52 -0
  332. package/dist/src/utils/repo-path.js.map +1 -0
  333. package/dist/src/utils/spawn.d.ts +23 -0
  334. package/dist/src/utils/spawn.d.ts.map +1 -0
  335. package/dist/src/utils/spawn.js +83 -0
  336. package/dist/src/utils/spawn.js.map +1 -0
  337. package/docs/branch-model.md +1 -1
  338. package/docs/guides/existing-project.md +1 -1
  339. package/docs/maintainers/publishing.md +1 -1
  340. package/docs/reference/cli.md +8 -2
  341. package/docs/reference/profiles.md +1 -1
  342. package/os/adr/handlers/list-create.ts +26 -2
  343. package/os/adr/types.ts +4 -2
  344. package/os/compass/handlers/compass-audit-handler.ts +6 -1
  345. package/os/compass/handlers/compass-header-scaffold-handler.ts +12 -11
  346. package/os/compass/handlers/git-revision.ts +8 -2
  347. package/os/compass/handlers/summary-record.ts +25 -14
  348. package/os/compass/handlers/tests/compass-invariant-binding.test.ts +3 -2
  349. package/os/conformance/conformance.module.ts +21 -4
  350. package/os/conformance/handlers/conformance-validate.ts +108 -16
  351. package/os/conformance/handlers/tests/conformance-package-consumer.test.ts +200 -0
  352. package/os/core/archive-regen.ts +279 -0
  353. package/os/core/core.module.ts +176 -29
  354. package/os/core/docs-archive.test.ts +413 -3
  355. package/os/core/handlers/assets-helpers.ts +8 -3
  356. package/os/core/handlers/forge-autonomy-validate.ts +3 -1
  357. package/os/core/handlers/package-health.test.ts +418 -4
  358. package/os/core/handlers/package-health.ts +629 -7
  359. package/os/core/handlers/release-prepare.ts +5 -2
  360. package/os/flow/digest.ts +3 -1
  361. package/os/flow/dirty-classify.ts +120 -0
  362. package/os/flow/flow.module.ts +119 -24
  363. package/os/flow/gate-engine.ts +45 -0
  364. package/os/flow/git.ts +117 -29
  365. package/os/flow/handlers/flow-backmerge.ts +14 -4
  366. package/os/flow/handlers/flow-check.ts +27 -2
  367. package/os/flow/handlers/flow-cut.ts +124 -56
  368. package/os/flow/handlers/flow-discard.ts +33 -5
  369. package/os/flow/handlers/flow-fix.ts +22 -10
  370. package/os/flow/handlers/flow-hold.ts +20 -7
  371. package/os/flow/handlers/flow-install.ts +59 -12
  372. package/os/flow/handlers/flow-integrate.ts +933 -180
  373. package/os/flow/handlers/flow-open.ts +135 -11
  374. package/os/flow/handlers/flow-peers.ts +142 -0
  375. package/os/flow/handlers/flow-status.ts +45 -13
  376. package/os/flow/index.ts +8 -2
  377. package/os/flow/line-version.ts +2 -1
  378. package/os/flow/locks.ts +56 -14
  379. package/os/flow/ops-registry.ts +194 -0
  380. package/os/flow/preflight.ts +974 -0
  381. package/os/flow/publish.ts +200 -5
  382. package/os/flow/registry.ts +43 -7
  383. package/os/flow/scripts.ts +13 -2
  384. package/os/flow/session-checkout.ts +186 -0
  385. package/os/flow/standalone-invoke.ts +85 -0
  386. package/os/flow/tests/dirty-classify.test.ts +251 -0
  387. package/os/flow/tests/fixtures/branch-names.yaml +40 -40
  388. package/os/flow/tests/flow-cut.test.ts +21 -0
  389. package/os/flow/tests/flow-discard.test.ts +32 -0
  390. package/os/flow/tests/flow-guard-parity.test.ts +10 -2
  391. package/os/flow/tests/flow-install.test.ts +7 -3
  392. package/os/flow/tests/flow-integrate.gate-report.test.ts +144 -0
  393. package/os/flow/tests/flow-integrate.preflight.test.ts +565 -0
  394. package/os/flow/tests/flow-integrate.reattach.test.ts +197 -0
  395. package/os/flow/tests/flow-integrate.remediation.test.ts +254 -0
  396. package/os/flow/tests/flow-integrate.test.ts +698 -17
  397. package/os/flow/tests/flow-open.pending.test.ts +277 -0
  398. package/os/flow/tests/flow-open.test.ts +52 -9
  399. package/os/flow/tests/flow-push-publish.test.ts +124 -0
  400. package/os/flow/tests/flow-status.test.ts +31 -1
  401. package/os/flow/tests/locks.test.ts +39 -3
  402. package/os/flow/tests/ops-registry.test.ts +136 -0
  403. package/os/flow/tests/scripts.test.ts +5 -2
  404. package/os/flow/tests/state-roots.test.ts +8 -5
  405. package/os/flow/worktree-path.ts +9 -3
  406. package/os/formal/handlers/proof-check.test.ts +6 -3
  407. package/os/instructions/budget.test.ts +31 -0
  408. package/os/instructions/handlers/budget-validate.ts +13 -4
  409. package/os/instructions/instructions.module.ts +4 -1
  410. package/os/mission/handlers/archive.ts +22 -14
  411. package/os/mission/importer-block.ts +119 -0
  412. package/os/mission/lockfile.ts +41 -0
  413. package/os/mission/open-missions.ts +50 -0
  414. package/os/queue/decision-ledger.test.ts +18 -0
  415. package/os/queue/manifest.ts +17 -1
  416. package/os/rfc/acceptance.ts +30 -10
  417. package/os/rfc/decision-log.ts +13 -2
  418. package/os/rfc/frontmatter-io.ts +89 -1
  419. package/os/rfc/handlers/implement-stamp-deviations.test.ts +83 -0
  420. package/os/rfc/handlers/implement-stamp-deviations.ts +22 -2
  421. package/os/rfc/handlers/implement-stamp-stale.test.ts +5 -1
  422. package/os/rfc/handlers/implement-stamp.ts +16 -3
  423. package/os/rfc/handlers/index-graph.ts +5 -4
  424. package/os/rfc/handlers/lifecycle.test.ts +136 -0
  425. package/os/rfc/handlers/list-create.test.ts +126 -0
  426. package/os/rfc/handlers/list-create.ts +130 -10
  427. package/os/rfc/handlers/rfc-evidence-sync.test.ts +504 -0
  428. package/os/rfc/handlers/rfc-evidence-sync.ts +192 -2
  429. package/os/rfc/handlers/tests/index-graph.test.ts +2 -1
  430. package/os/rfc/handlers/validate-rules-rfc1454.test.ts +73 -0
  431. package/os/rfc/handlers/validate-rules.ts +103 -7
  432. package/os/rfc/handlers/validate.ts +68 -4
  433. package/os/rfc/next-id.ts +232 -0
  434. package/os/rfc/probe-batch.ts +6 -1
  435. package/os/rfc/rfc.module.ts +41 -8
  436. package/os/rfc/types.ts +31 -6
  437. package/os/rfc/verification-emit-freshness.test.ts +5 -1
  438. package/os/rfc/verification-emit.test.ts +5 -1
  439. package/os/rfc/verification-evidence.ts +99 -33
  440. package/os/rfc/verification-origin.ts +59 -0
  441. package/os/rfc/verification-refresh.test.ts +5 -1
  442. package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +5 -1
  443. package/os/session/handlers/save.ts +35 -7
  444. package/os/session/tests/session-save.test.ts +154 -0
  445. package/os/spec/spec-schema.ts +3 -0
  446. package/os/spec/spec-status.ts +22 -6
  447. package/os/spec/spec-validate.package-source.test.ts +187 -0
  448. package/os/spec/spec-validate.ts +65 -14
  449. package/os/spec/spec.module.ts +13 -5
  450. package/os/system/handlers/system-map-validate.ts +4 -2
  451. package/os/system/handlers/system-outbox-scan.ts +65 -21
  452. package/os/system/handlers/system-task-collect.ts +11 -5
  453. package/os/system/handlers/system-task-create.ts +6 -1
  454. package/os/system/handlers/system-versionset-record.ts +301 -16
  455. package/os/system/repo.ts +59 -18
  456. package/os/system/scenario-schemas.ts +91 -12
  457. package/os/system/system.module.ts +70 -17
  458. package/os/system/tests/contract-fixtures.ts +139 -0
  459. package/os/system/tests/scenario-pin-drift-check.test.ts +114 -0
  460. package/os/system/tests/scenario-validator-check.test.ts +96 -0
  461. package/os/system/tests/system-task-collect.test.ts +16 -0
  462. package/os/system/tests/system-task-dispatch.test.ts +4 -1
  463. package/os/system/tests/system-versionset.test.ts +7 -3
  464. package/os/system/tests/version-set-v2.test.ts +78 -0
  465. package/package.json +9 -1
  466. package/skills/fo/fo-doctor/SKILL.md +151 -0
  467. package/skills/fo/fo-handoff/SKILL.md +22 -0
  468. package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +2 -1
  469. package/skills/fo/fo-idea-implement/SKILL.md +5 -2
  470. package/skills/fo/fo-idea-plan/SKILL.md +5 -5
  471. package/skills/fo/fo-session-retro/SKILL.md +45 -13
  472. package/skills/fo/fo-spec-ingest/SKILL.md +8 -0
  473. package/skills/fo/fo-system-dispatch/SKILL.md +1 -0
  474. package/skills/meta/skill-create/SKILL.md +2 -1
  475. package/src/bin-entry.test.ts +3 -1
  476. package/src/config/forge-config.ts +57 -13
  477. package/src/conformance/index.ts +46 -1
  478. package/src/formal/proof-runner.ts +10 -2
  479. package/src/migration-adapters/node-typescript-pnpm/index.ts +3 -1
  480. package/src/migration-adapters/phaser-pnpm/index.ts +3 -1
  481. package/src/onboarding/agents-generate.ts +4 -4
  482. package/src/onboarding/nested-agents-generate.ts +3 -1
  483. package/src/onboarding/prettierignore.ts +2 -0
  484. package/src/onboarding/scaffold-project.ts +2 -2
  485. package/src/onboarding/upgrade.ts +13 -2
  486. package/src/onboarding/workspace-discovery.ts +3 -1
  487. package/src/pipeline-status.test.ts +1 -1
  488. package/src/skill-schema.ts +9 -2
  489. package/src/spec/resolve-spec-source.ts +184 -0
  490. package/src/tests/acceptance-probe-kinds.test.ts +3 -1
  491. package/src/tests/agents-generate-domain.test.ts +3 -2
  492. package/src/tests/agents-generate.test.ts +2 -1
  493. package/src/tests/create-flow.test.ts +3 -1
  494. package/src/tests/create.test.ts +12 -2
  495. package/src/tests/editable-generated-region.test.ts +2 -2
  496. package/src/tests/fixtures/agents-generate-business-before.txt +2 -0
  497. package/src/tests/implement-stamp.test.ts +5 -2
  498. package/src/tests/prettierignore-manage.test.ts +11 -0
  499. package/src/tests/rfc-implement-stamp-governance.test.ts +6 -2
  500. package/src/tests/rfc-verification-verdict-ingest.test.ts +5 -1
  501. package/src/tests/scaffold-project.test.ts +3 -1
  502. package/src/tests/upgrade.test.ts +79 -3
  503. package/src/tests/workspace-discovery.test.ts +4 -3
  504. package/src/utils/command-inventory.ts +105 -0
  505. package/src/utils/io.ts +6 -1
  506. package/src/utils/repo-path.ts +49 -0
  507. package/src/utils/spawn.ts +88 -0
  508. package/src/tests/rfc-evidence-sync.test.ts +0 -369
  509. package/src/tests/skill-agents-sync.test.ts +0 -192
@@ -6,7 +6,6 @@
6
6
  </non-goals>
7
7
  </MODULE_CONTRACT>
8
8
  <CHANGE_SUMMARY>
9
- <item>RFC-1391: make the formal verification tier checker-bound (RFC-1391)</item>
10
9
  <item>RFC-1391: close RFC-1391 review r1 findings — evidence freshness, config classification, contract guards
11
10
 
12
11
  REVIEW-CODE-2026-10-24-04 (warning): a stale .cache/proofs report could
@@ -18,7 +17,8 @@ record log, counterexample stays the refuted-path record.</item>
18
17
  <item>RFC-1453: executed outcome probes, IMP-14 surface gate, outcome.serve + V-47/V-48</item>
19
18
  <item>RFC-1481: close REVIEW-CODE-2026-11-01-11 findings on resolver safety, IO boundaries, and reporting</item>
20
19
  <item>RFC-1493: step 4 — remove per-commit version bump, PC-01..04, version log; one commit path with universal X-RFC/X-ADR trailers</item>
21
- <history>RFC-0391, RFC-0393, RFC-0537, RFC-0538, RFC-0539, RFC-0540, RFC-0543, RFC-0546, RFC-0639, RFC-0640, RFC-0643, RFC-0661, RFC-0662, RFC-0704, RFC-1097, RFC-1224, RFC-1332, RFC-1365</history>
20
+ <item>RFC-1539: package-sourced specs and published consumer validators in Forge</item>
21
+ <history>RFC-0391, RFC-0393, RFC-0537, RFC-0538, RFC-0539, RFC-0540, RFC-0543, RFC-0546, RFC-0639, RFC-0640, RFC-0643, RFC-0661, RFC-0662, RFC-0704, RFC-1097, RFC-1224, RFC-1332, RFC-1365, RFC-1391</history>
22
22
  </CHANGE_SUMMARY>
23
23
  */
24
24
 
@@ -204,18 +204,33 @@ export interface ForgeMigrationAdapter {
204
204
  * authoritative validator inside the sibling consumer checkout. Entries
205
205
  * passthrough so follow-up fields (e.g. a consumer pin) land without churn.
206
206
  */
207
+ const conformanceValidatorSchema = z.object({
208
+ argv: z.array(z.string().min(1)).min(1),
209
+ timeoutMs: z.number().int().positive().optional(),
210
+ });
211
+
207
212
  export const contractProducerSchema = z
208
213
  .object({
209
214
  id: z.string().min(1),
210
215
  emit: z.object({ argv: z.array(z.string().min(1)).min(1) }),
211
216
  mirror: z.object({ argv: z.array(z.string().min(1)).min(1) }).optional(),
212
- consumer: z.object({
213
- root: z.string().min(1),
214
- validator: z.object({
215
- argv: z.array(z.string().min(1)).min(1),
216
- timeoutMs: z.number().int().positive().optional(),
217
- }),
218
- }),
217
+ // RFC-1539: `root` names a sibling consumer checkout; `package` names the
218
+ // consumer's published validator package (exact-pinned devDependency,
219
+ // argv[0] resolves to its bin) — a package consumer never self-skips.
220
+ consumer: z.union([
221
+ z
222
+ .object({
223
+ root: z.string().min(1),
224
+ validator: conformanceValidatorSchema,
225
+ })
226
+ .strict(),
227
+ z
228
+ .object({
229
+ package: z.string().min(1),
230
+ validator: conformanceValidatorSchema,
231
+ })
232
+ .strict(),
233
+ ]),
219
234
  test: z.string().min(1).optional(),
220
235
  })
221
236
  .passthrough();
@@ -224,13 +239,38 @@ export interface ContractProducerEntry {
224
239
  id: string;
225
240
  emit: { argv: string[] };
226
241
  mirror?: { argv: string[] };
227
- consumer: {
228
- root: string;
229
- validator: { argv: string[]; timeoutMs?: number };
230
- };
242
+ consumer: ContractProducerConsumer;
231
243
  test?: string;
232
244
  }
233
245
 
246
+ /** RFC-1539: a sibling checkout (`root`) or a published validator package (`package`). */
247
+ export type ContractProducerConsumer =
248
+ | { root: string; package?: undefined; validator: { argv: string[]; timeoutMs?: number } }
249
+ | { package: string; root?: undefined; validator: { argv: string[]; timeoutMs?: number } };
250
+
251
+ // ---------------------------------------------------------------------------
252
+ // Spec packages schema (RFC-1539)
253
+ // ---------------------------------------------------------------------------
254
+
255
+ /**
256
+ * A published spec consumed as an installed npm package instead of a vendored
257
+ * docs/specs/ directory (RFC-1539, DNA-55): `id` is the spec id without its
258
+ * version suffix; the installed package version completes it
259
+ * (`<id>-v<version>`). Ids must be unique (SPEC-18) — checked by the spec
260
+ * source resolver, not the schema, so the violation carries its rule code.
261
+ */
262
+ export const specPackageSchema = z
263
+ .object({
264
+ id: z.string().regex(/^[a-z0-9]+(-[a-z0-9]+)*$/),
265
+ package: z.string().min(1),
266
+ })
267
+ .strict();
268
+
269
+ export interface SpecPackageEntry {
270
+ id: string;
271
+ package: string;
272
+ }
273
+
234
274
  // ---------------------------------------------------------------------------
235
275
  // Formal proof tools schema (RFC-1391)
236
276
  // ---------------------------------------------------------------------------
@@ -295,6 +335,8 @@ export const forgeConfigSchema = z
295
335
  migrationAdapters: z.array(forgeMigrationAdapterSchema).optional(),
296
336
  /** Contract producers (RFC-1365). Optional — absent means no declared producers. */
297
337
  contractProducers: z.array(contractProducerSchema).optional(),
338
+ /** Published spec packages (RFC-1539). Optional — absent means vendored specs only. */
339
+ specPackages: z.array(specPackageSchema).optional(),
298
340
  /** External proof checkers (RFC-1391). Optional — absent means only the built-in `exhaustive` tool. */
299
341
  formal: z
300
342
  .object({
@@ -351,6 +393,8 @@ export interface ForgeConfig {
351
393
  migrationAdapters?: ForgeMigrationAdapter[];
352
394
  /** Contract producers (RFC-1365). Optional — absent means no declared producers. */
353
395
  contractProducers?: ContractProducerEntry[];
396
+ /** Published spec packages (RFC-1539). Optional — absent means vendored specs only. */
397
+ specPackages?: SpecPackageEntry[];
354
398
  /** External proof checkers (RFC-1391). Optional — absent means only the built-in `exhaustive` tool. */
355
399
  formal?: { tools: Record<string, FormalToolEntry> };
356
400
  /** Forge sync metadata (RFC-0543). Optional — absent means never synced. */
@@ -8,11 +8,12 @@
8
8
  </non-goals>
9
9
  </MODULE_CONTRACT>
10
10
  <CHANGE_SUMMARY>
11
- <item>RFC-1365: initial conformance execution path — emit/mirror/consumer legs, tail-bounded output, skip/require verdicts.</item>
12
11
  <item>RFC-1365: step 1 — contractProducers schema + conformance execution path</item>
13
12
  <item>RFC-1365: step 2 — forge.conformance.run/validate commands + dual-surface registration</item>
14
13
  <item>RFC-1365: compass header fix — drop forbidden keywords/responsibilities tags, expand purpose</item>
15
14
  <item>RFC-1365: review round 1 — CONF-03 rescoped producer-side (Q-9), producers[] json shape, crash guard + leg output, transport attribution, env semantics, writes declared, regen sweep</item>
15
+ <item>RFC-1539: package-sourced specs and published consumer validators in Forge</item>
16
+ <history>RFC-1365</history>
16
17
  </CHANGE_SUMMARY>
17
18
  */
18
19
 
@@ -158,6 +159,18 @@ async function executeLeg(
158
159
  * invoke the authoritative consumer validator inside the consumer checkout.
159
160
  * The tmpdir is removed in `finally`; nothing is written into the repo.
160
161
  */
162
+ /**
163
+ * RFC-1539: absolute path of a published validator's bin inside the producer
164
+ * repository (`<repoRoot>/node_modules/.bin/<name>`, `.cmd` shim on win32), or
165
+ * null when it is not installed.
166
+ */
167
+ export function resolvePackageConsumerBin(repoRoot: string, name: string): string | null {
168
+ const base = join(repoRoot, "node_modules", ".bin", name);
169
+ const candidates = process.platform === "win32" ? [`${base}.cmd`, base] : [base];
170
+ for (const candidate of candidates) if (existsSync(candidate)) return candidate;
171
+ return null;
172
+ }
173
+
161
174
  export async function runProducerConformance(
162
175
  decl: ContractProducerDecl,
163
176
  opts: { repoRoot: string; requireConsumer?: boolean },
@@ -238,6 +251,38 @@ export async function runProducerConformance(
238
251
  }
239
252
  }
240
253
 
254
+ // --- consumer leg, package form (RFC-1539): the published validator's bin, never skipped ---
255
+ if (decl.consumer.package !== undefined) {
256
+ const [bin, ...rest] = decl.consumer.validator.argv;
257
+ const binPath = resolvePackageConsumerBin(opts.repoRoot, bin);
258
+ if (binPath === null) {
259
+ legs.push({ leg: "consumer", status: "fail", durationMs: 0 });
260
+ diagnostics.push(
261
+ `consumer-missing: consumer.package ${decl.consumer.package} is not installed or has no bin "${bin}" in node_modules/.bin — a package consumer never self-skips (RFC-1539)`,
262
+ );
263
+ return verdict("fail", "consumer");
264
+ }
265
+ leg = await executeLeg(
266
+ "consumer",
267
+ [binPath, ...rest],
268
+ opts.repoRoot,
269
+ bundleDir,
270
+ decl.consumer.validator.timeoutMs ?? CONFORMANCE_DEFAULT_TIMEOUT_MS,
271
+ );
272
+ legs.push(leg);
273
+ if (leg.status === "fail") {
274
+ diagnostics.push(
275
+ leg.transport === "spawn-error"
276
+ ? `consumer validator spawn failed: ${leg.errorDetail ?? "unknown spawn error"} — transport failure, not a bundle verdict`
277
+ : leg.transport === "timeout"
278
+ ? `consumer validator timed out after ${decl.consumer.validator.timeoutMs ?? CONFORMANCE_DEFAULT_TIMEOUT_MS}ms — transport failure, not a bundle verdict`
279
+ : `consumer validator ${decl.consumer.package} exited ${leg.exitCode} — see captured output`,
280
+ );
281
+ return verdict("fail", "consumer");
282
+ }
283
+ return verdict("pass", undefined);
284
+ }
285
+
241
286
  // --- consumer leg: the authoritative validator in the sibling checkout ---
242
287
  const consumerRoot = resolveConsumerRoot(decl.consumer.root, opts.repoRoot);
243
288
  if (!existsSync(consumerRoot)) {
@@ -71,6 +71,7 @@ import {
71
71
  type ExhaustiveResult,
72
72
  } from "./exhaustive.ts";
73
73
  import { proofSpecSchema, type ProofCheckResult, type ProofSpec } from "./proof-spec.ts";
74
+ import { resolveSpawnPlan } from "../utils/spawn.ts";
74
75
 
75
76
  /** Default per-run bound when the caller passes no timeoutMs (RFC-1391: 30 min). */
76
77
  export const PROOF_CHECK_DEFAULT_TIMEOUT_MS = 30 * 60_000;
@@ -124,10 +125,15 @@ function spawnArgv(
124
125
  opts: { cwd: string; timeoutMs: number; env?: NodeJS.ProcessEnv },
125
126
  ): Promise<SpawnOutcome> {
126
127
  return new Promise((res) => {
127
- const child = spawn(argv[0]!, argv.slice(1), {
128
+ // Bare package-manager names (pnpm/npm/yarn/bun) are .cmd shims on
129
+ // Windows — resolved via PATHEXT; unresolved names keep ENOENT so a
130
+ // missing checker still reports `unavailable`, never a refuted exit.
131
+ const plan = resolveSpawnPlan(argv[0]!, argv.slice(1));
132
+ const child = spawn(plan.command, plan.args, {
128
133
  cwd: opts.cwd,
129
134
  env: opts.env ?? process.env,
130
135
  stdio: ["ignore", "pipe", "pipe"],
136
+ windowsVerbatimArguments: plan.verbatim,
131
137
  });
132
138
  let out = "";
133
139
  let err = "";
@@ -188,7 +194,9 @@ function persistLog(
188
194
  if (!content.trim()) return undefined;
189
195
  const dir = proofsDir(workspaceRoot);
190
196
  mkdirSync(dir, { recursive: true });
191
- const rel = join(".cache", "proofs", `${specId}.${name}`);
197
+ // The returned path is a repo-relative report path — forward slashes so
198
+ // callers can print and re-resolve it identically on every platform.
199
+ const rel = join(".cache", "proofs", `${specId}.${name}`).replace(/\\/g, "/");
192
200
  writeFileSync(join(dir, `${specId}.${name}`), tail(content));
193
201
  return rel;
194
202
  }
@@ -152,7 +152,9 @@ function copyDirectory(
152
152
  for (const entry of entries) {
153
153
  const srcPath = path.join(src, entry.name);
154
154
  const destPath = path.join(dest, entry.name);
155
- const relPath = path.relative(rootSrc, srcPath);
155
+ // Logical repo-relative path — forward slashes so exclusion patterns and
156
+ // the reported filesCopied/filesSkipped lists are platform-stable.
157
+ const relPath = path.relative(rootSrc, srcPath).replace(/\\/g, "/");
156
158
 
157
159
  if (entry.isDirectory()) {
158
160
  if (isExcluded(relPath, excludePatterns)) continue;
@@ -152,7 +152,9 @@ function copyDirectory(
152
152
  for (const entry of entries) {
153
153
  const srcPath = path.join(src, entry.name);
154
154
  const destPath = path.join(dest, entry.name);
155
- const relPath = path.relative(rootSrc, srcPath);
155
+ // Logical repo-relative path — forward slashes so exclusion patterns and
156
+ // the reported filesCopied/filesSkipped lists are platform-stable.
157
+ const relPath = path.relative(rootSrc, srcPath).replace(/\\/g, "/");
156
158
 
157
159
  if (entry.isDirectory()) {
158
160
  if (isExcluded(relPath, excludePatterns)) continue;
@@ -7,13 +7,13 @@
7
7
  </non-goals>
8
8
  </MODULE_CONTRACT>
9
9
  <CHANGE_SUMMARY>
10
- <item>RFC-1097: sweep — packages/forge + services clean
11
-
12
- Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PURPOSE-02), headers on mission/index + gen-upstreams, sanitizeItemText in summary.record (literal Compass tags corrupted history), excludedPaths for wrangler types, test-fixtures testPattern. forge+services now 0 diagnostics under --mode error.</item>
13
10
  <item>RFC-1255: Single blank line after the generated header — header ends in a newline so "\n\n" produced two blank lines that prettier collapsed, ping-ponging doctor's stale check. wsTypes resolution moved to shared resolveWorkspaceTypes.</item>
14
11
  <item>RFC-1365: step 4 — DNA-115, CONF-* remediation entries, agents-generate convention section</item>
15
12
  <item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
16
13
  <item>RFC-1500: step 4 — branch-model AGENTS section and consumer docs</item>
14
+ <item>RFC-1539: amend dna-55 and dna-115 for published spec packages
15
+
16
+ Guides, fo-spec-ingest routing, command descriptions and regenerated command docs, remediation entries for SPEC-15..18 and CONF-07..09; resyncs the stale .agents fo-system-dispatch mirror (ADR-0126 source line).</item>
17
17
  <history>RFC-0391, RFC-0393, RFC-0548, RFC-0549, RFC-0551, RFC-0611, RFC-0640, RFC-0643, RFC-0664, RFC-1097, RFC-1253</history>
18
18
  </CHANGE_SUMMARY>
19
19
  */
@@ -448,7 +448,7 @@ export async function runAgentsGenerate(
448
448
  if ((config.contractProducers ?? []).length > 0) {
449
449
  dynamicLines.push("## Golden conformance for declared contract producers");
450
450
  dynamicLines.push("");
451
- dynamicLines.push("This repository declares `contractProducers[]` in `forge.yaml` — every declared producer MUST keep a working golden-conformance path: `emit` writes the bundle into the forge-provided dir (`{bundle}` argv placeholder / `FORGE_CONFORMANCE_BUNDLE_DIR`), the optional `mirror` leg re-checks the same bundle, and the `consumer` leg invokes the authoritative consumer validator inside `consumer.root` (DNA-115).");
451
+ dynamicLines.push("This repository declares `contractProducers[]` in `forge.yaml` — every declared producer MUST keep a working golden-conformance path: `emit` writes the bundle into the forge-provided dir (`{bundle}` argv placeholder / `FORGE_CONFORMANCE_BUNDLE_DIR`), the optional `mirror` leg re-checks the same bundle, and the `consumer` leg invokes the authoritative consumer validator — the installed bin of a published validator package (`consumer.package`, exact-pinned devDependency, never self-skips — RFC-1539) or, for consumers without a published validator, inside the sibling checkout `consumer.root` (DNA-115).");
452
452
  dynamicLines.push("");
453
453
  dynamicLines.push("- One execution path serves both surfaces: `forge.conformance.run --producer <id>` (or `--all`) for operator/CI runs, and the `@warpgogol/forge/conformance` helper (`consumerAvailable` + `runProducerConformance`) for vitest wrappers — never hand-roll spawn/mkdtemp/skip plumbing in producer tests.");
454
454
  dynamicLines.push("- An absent `consumer.root` self-skips with an explicit verdict; use `--require-consumer` or `FORGE_CONFORMANCE_REQUIRE=1` in environments where the checkout is guaranteed so the guard fails closed instead of silently degrading.");
@@ -108,7 +108,9 @@ export async function generateNestedAgentsMd(
108
108
  semanticLayerBlock,
109
109
  NESTED_AGENTS_FOOTER,
110
110
  );
111
- const relPath = path.join(ws.path, "AGENTS.md");
111
+ // relPath is a logical repo-relative report path — forward slashes on
112
+ // every platform (ws.path is already slash-normalized by discovery).
113
+ const relPath = path.posix.join(ws.path, "AGENTS.md");
112
114
 
113
115
  if (dryRun) {
114
116
  renderedFiles[relPath] = content;
@@ -22,6 +22,7 @@ operator-owned.
22
22
  <CHANGE_SUMMARY>
23
23
  <item>RFC-1154: initial implementation — plan/apply + delimited-block reconcile.</item>
24
24
  <item>RFC-1255: Enumerate generated AGENTS.md paths (root + nested workspaces via discoverWorkspaces) in the managed block — prettier normalization byte-diverges from the generator render and trips doctor's stale check on every format-on-commit.</item>
25
+ <item>RFC-1550: FIXED_ENTRIES gains `.forge/task/` — forge-owned task scratch paths are prettier-irrelevant and must not be normalized or linted by consumers.</item>
25
26
  </CHANGE_SUMMARY>
26
27
  */
27
28
 
@@ -57,6 +58,7 @@ const PRETTIER_CONFIG_NAMES = [
57
58
 
58
59
  /** Non-skill generated-artifact entries, in stable order. */
59
60
  const FIXED_ENTRIES = [
61
+ ".forge/task/",
60
62
  "**/*.generated.yaml",
61
63
  "docs/sessions/",
62
64
  "docs/metrics/",
@@ -197,7 +197,7 @@ export async function runScaffoldProject(
197
197
  if (outputFormat === "pretty") {
198
198
  logger.info(`Running: ${cmd}`);
199
199
  }
200
- const res = await execCommand(cmd, workspaceRoot, 60000);
200
+ const res = await execCommand(cmd, workspaceRoot, 300000);
201
201
  if (res.ok) {
202
202
  installLog.push(`${cmd} — ok`);
203
203
  if (outputFormat === "pretty") {
@@ -236,7 +236,7 @@ export async function runScaffoldProject(
236
236
  if (outputFormat === "pretty") {
237
237
  logger.info(`Running: ${cmd}`);
238
238
  }
239
- const res2 = await execCommand(cmd, wsDir, 60000);
239
+ const res2 = await execCommand(cmd, wsDir, 300000);
240
240
  if (res2.ok) {
241
241
  installLog.push(`${cmd} — ok`);
242
242
  if (outputFormat === "pretty") {
@@ -11,12 +11,12 @@ With --update-npm, also updates @warpgogol/forge from npm before syncing (skippe
11
11
  </non-goals>
12
12
  </MODULE_CONTRACT>
13
13
  <CHANGE_SUMMARY>
14
- <item>RFC-1154: sync skills/_shared/ convention docs to .agents/skills/_shared/ — fo-* SKILL.md references dangled for npm consumers</item>
15
14
  <item>RFC-1255: Knowledge conflicts land in .forge/knowledge-conflicts.txt (summary + path in console instead of a 60+ entry dump); exposed as knowledgeConflicts/knowledgeConflictsReport on UpgradeResult. Prettierignore plan now enumerates generated AGENTS.md paths.</item>
16
15
  <item>RFC-1481: add knowledge.conflicts.resolve next steps on same-version and regular upgrade results.</item>
17
16
  <item>RFC-1481: collapse compass summaries and add missing contract blocks</item>
18
17
  <item>RFC-1500: step 3 — forge.upgrade reports flow state</item>
19
- <history>RFC-0543, RFC-0611, RFC-0663, RFC-0664, RFC-1097, RFC-1224</history>
18
+ <item>RFC-1515: harden forge flow worktree lifecycle against vanished paths, forge-local state, dead-holder locks and generated drift</item>
19
+ <history>RFC-0543, RFC-0611, RFC-0663, RFC-0664, RFC-1097, RFC-1154, RFC-1224</history>
20
20
  </CHANGE_SUMMARY>
21
21
  */
22
22
 
@@ -555,6 +555,17 @@ async function writeKnowledgeConflictsReport(
555
555
  ): Promise<string | null> {
556
556
  const rel = ".forge/knowledge-conflicts.txt";
557
557
  try {
558
+ // RFC-1515 AC-5: the writer self-ensures .gitignore coverage — the report
559
+ // must never count as worktree dirt (the pinned-audit.log pattern).
560
+ const gitignorePath = path.join(workspaceRoot, ".gitignore");
561
+ try {
562
+ const existing = await io.readFile(gitignorePath);
563
+ if (!existing.split("\n").some((line) => line.trim() === rel)) {
564
+ await io.writeFile(gitignorePath, `${existing.trimEnd()}\n${rel}\n`);
565
+ }
566
+ } catch {
567
+ await io.writeFile(gitignorePath, `${rel}\n`);
568
+ }
558
569
  await io.writeFile(
559
570
  path.join(workspaceRoot, rel),
560
571
  [
@@ -191,7 +191,9 @@ export function discoverWorkspaces(
191
191
  }
192
192
 
193
193
  results.push({
194
- path: path.relative(workspaceRoot, childPath),
194
+ // Repo-relative logical path — always forward slashes so generated/
195
+ // skipped/renderedFiles report keys are platform-stable.
196
+ path: path.relative(workspaceRoot, childPath).replace(/\\/g, "/"),
195
197
  type,
196
198
  hasAgentsMd,
197
199
  isGenerated,
@@ -68,7 +68,7 @@ describe("resolveDocument", () => {
68
68
  "---\nid: RFC-1002\nstatus: implemented\n---\n# RFC-1002\n",
69
69
  );
70
70
  const doc = await resolveDocument(tmpDir, "RFC-1002");
71
- expect(doc?.file).toContain("archive/implemented");
71
+ expect(doc?.file).toContain(path.join("archive", "implemented"));
72
72
  expect(doc?.frontmatter["status"]).toBe("implemented");
73
73
  });
74
74
 
@@ -6,12 +6,12 @@
6
6
  </non-goals>
7
7
  </MODULE_CONTRACT>
8
8
  <CHANGE_SUMMARY>
9
- <item>RFC-0393: added optional bindings field (requires/optional arrays of binding keys).</item>
10
9
  <item>RFC-0523: expanded concerns enum from binary to four-level taxonomy (read-only | document-only | content-mutation | code-mutation).</item>
11
10
  <item>RFC-0524: added optional knowledge field (array of file names relative to SKILL.md directory).</item>
12
11
  <item>RFC-0548: added optional triggers field (array of natural-language trigger phrases, max 5 entries, each 5-100 chars) for intent-to-skill routing.</item>
13
12
  <item>RFC-1271: added optional notApplicableWhen and costNotes fields — skill applicability metadata for mode-aware routing.</item>
14
- <history>RFC-0374</history>
13
+ <item>ADR-0122: vendor OpenDesign craft knowledge axis + craft.requires loader/lint</item>
14
+ <history>RFC-0374, RFC-0393</history>
15
15
  </CHANGE_SUMMARY>
16
16
  */
17
17
 
@@ -32,6 +32,13 @@ export const skillFrontmatterSchema = z.object({
32
32
  })
33
33
  .optional(),
34
34
  knowledge: z.array(z.string()).optional(),
35
+ // ADR-0122: vendored craft-knowledge slugs the skill wants loaded — resolved
36
+ // tolerantly by the craft axis loader; craft.validate fails on unknown slugs.
37
+ craft: z
38
+ .object({
39
+ requires: z.array(z.string()).default([]),
40
+ })
41
+ .optional(),
35
42
  // Named triggerPhrases, not triggers — agent-IDE skill loaders (Devin CLI,
36
43
  // Windsurf) reserve `triggers` for invocation modes (user/model); a list of
37
44
  // phrases parses to zero valid modes and the skill is dropped entirely.
@@ -0,0 +1,184 @@
1
+ /**
2
+ <MODULE_CONTRACT>
3
+ <purpose>RFC-1539 spec source resolver — one answer to "where is spec X": vendored docs/specs/ directories (DNA-55) and published spec packages declared in forge.yaml specPackages[] and installed from the workspace root. spec.validate, spec.status and consumer code generators read through it.</purpose>
4
+ <non-goals>
5
+ <item>Never writes into node_modules or docs/specs/.</item>
6
+ <item>Never searches nested workspace packages — a spec package is a root dependency (SPEC-17).</item>
7
+ </non-goals>
8
+ </MODULE_CONTRACT>
9
+ <CHANGE_SUMMARY>
10
+ <item>RFC-1539: resolveSpecSource/listSpecSources + SPEC-15..18 declaration diagnostics</item>
11
+ <item>RFC-1539: package-sourced specs and published consumer validators in Forge</item>
12
+ </CHANGE_SUMMARY>
13
+ */
14
+
15
+ import { existsSync, readdirSync, readFileSync } from "node:fs";
16
+ import { createRequire } from "node:module";
17
+ import path from "node:path";
18
+ import { loadForgeConfig, type SpecPackageEntry } from "../config/forge-config.ts";
19
+
20
+ export type SpecSource =
21
+ | { kind: "vendored"; specId: string; dir: string }
22
+ | { kind: "package"; specId: string; dir: string; package: string; version: string };
23
+
24
+ export interface SpecSourceDiagnostic {
25
+ rule: "SPEC-15" | "SPEC-16" | "SPEC-17" | "SPEC-18";
26
+ severity: "error" | "warning";
27
+ specId?: string;
28
+ message: string;
29
+ }
30
+
31
+ export interface SpecSourceListing {
32
+ sources: SpecSource[];
33
+ diagnostics: SpecSourceDiagnostic[];
34
+ }
35
+
36
+ /** An exact semver pin: no range operators, wildcards, tags or protocols. */
37
+ const EXACT_PIN = /^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
38
+
39
+ function readJson(file: string): Record<string, unknown> | null {
40
+ try {
41
+ return JSON.parse(readFileSync(file, "utf-8")) as Record<string, unknown>;
42
+ } catch {
43
+ return null;
44
+ }
45
+ }
46
+
47
+ function rootPin(workspaceRoot: string, pkg: string): string | undefined {
48
+ const manifest = readJson(path.join(workspaceRoot, "package.json"));
49
+ if (!manifest) return undefined;
50
+ for (const field of ["dependencies", "devDependencies"] as const) {
51
+ const deps = manifest[field] as Record<string, string> | undefined;
52
+ if (deps && typeof deps[pkg] === "string") return deps[pkg];
53
+ }
54
+ return undefined;
55
+ }
56
+
57
+ /** The installed package root and version, resolved from the workspace root only. */
58
+ function installedPackage(
59
+ workspaceRoot: string,
60
+ pkg: string,
61
+ ): { dir: string; version: string } | null {
62
+ try {
63
+ const req = createRequire(path.join(workspaceRoot, "package.json"));
64
+ const manifestPath = req.resolve(`${pkg}/package.json`);
65
+ const manifest = readJson(manifestPath);
66
+ if (!manifest || typeof manifest.version !== "string") return null;
67
+ return { dir: path.dirname(manifestPath), version: manifest.version };
68
+ } catch {
69
+ return null;
70
+ }
71
+ }
72
+
73
+ function specsDirOf(workspaceRoot: string): string {
74
+ try {
75
+ return loadForgeConfig(workspaceRoot).paths.specsDir;
76
+ } catch {
77
+ return "docs/specs";
78
+ }
79
+ }
80
+
81
+ function declaredSpecPackages(workspaceRoot: string): SpecPackageEntry[] {
82
+ try {
83
+ return loadForgeConfig(workspaceRoot).specPackages ?? [];
84
+ } catch {
85
+ return [];
86
+ }
87
+ }
88
+
89
+ /** Vendored spec dirs (those with forge-spec.yaml) plus every resolvable declared package. */
90
+ export function listSpecSources(
91
+ workspaceRoot: string,
92
+ declared: SpecPackageEntry[] = declaredSpecPackages(workspaceRoot),
93
+ ): SpecSourceListing {
94
+ const diagnostics: SpecSourceDiagnostic[] = [];
95
+ const sources: SpecSource[] = [];
96
+
97
+ const specsRoot = path.join(workspaceRoot, specsDirOf(workspaceRoot));
98
+ const vendored = existsSync(specsRoot)
99
+ ? readdirSync(specsRoot)
100
+ .filter((name) => existsSync(path.join(specsRoot, name, "forge-spec.yaml")))
101
+ .sort()
102
+ : [];
103
+ for (const name of vendored) {
104
+ sources.push({ kind: "vendored", specId: name, dir: path.join(specsRoot, name) });
105
+ }
106
+
107
+ const seen = new Set<string>();
108
+ for (const entry of declared) {
109
+ if (seen.has(entry.id)) {
110
+ diagnostics.push({
111
+ rule: "SPEC-18",
112
+ severity: "error",
113
+ message: `specPackages[] declares id "${entry.id}" more than once`,
114
+ });
115
+ continue;
116
+ }
117
+ seen.add(entry.id);
118
+
119
+ const pin = rootPin(workspaceRoot, entry.package);
120
+ if (pin === undefined || !EXACT_PIN.test(pin)) {
121
+ diagnostics.push({
122
+ rule: "SPEC-17",
123
+ severity: "error",
124
+ message: `spec package ${entry.package} must be an exact-pinned dependency of the workspace root package.json (found ${pin === undefined ? "no entry" : `"${pin}"`})`,
125
+ });
126
+ }
127
+
128
+ const installed = installedPackage(workspaceRoot, entry.package);
129
+ if (!installed) {
130
+ diagnostics.push({
131
+ rule: "SPEC-16",
132
+ severity: "error",
133
+ message: `spec package ${entry.package} is declared in specPackages[] but not installed — run the package manager install`,
134
+ });
135
+ continue;
136
+ }
137
+ const specId = `${entry.id}-v${installed.version}`;
138
+ sources.push({
139
+ kind: "package",
140
+ specId,
141
+ dir: installed.dir,
142
+ package: entry.package,
143
+ version: installed.version,
144
+ });
145
+
146
+ for (const name of vendored) {
147
+ if (name.startsWith(`${entry.id}-v`)) {
148
+ diagnostics.push({
149
+ rule: "SPEC-15",
150
+ severity: "warning",
151
+ specId: name,
152
+ message: `vendored copy of a published spec — delete ${path.relative(workspaceRoot, path.join(specsRoot, name))} and rely on specPackages[] (${entry.package})`,
153
+ });
154
+ }
155
+ }
156
+ }
157
+
158
+ return { sources, diagnostics };
159
+ }
160
+
161
+ /**
162
+ * Resolve one spec by full spec id (`<id>-v<version>`) or by package-declared
163
+ * id. A package source wins over a vendored dir of the same spec id; a spec id
164
+ * whose version differs from the installed package throws with the installed
165
+ * version — it never falls back to a vendored copy.
166
+ */
167
+ export function resolveSpecSource(workspaceRoot: string, idOrSpecId: string): SpecSource {
168
+ const { sources } = listSpecSources(workspaceRoot);
169
+ const packages = sources.filter(
170
+ (s): s is Extract<SpecSource, { kind: "package" }> => s.kind === "package",
171
+ );
172
+ for (const p of packages) {
173
+ const baseId = p.specId.slice(0, -`-v${p.version}`.length);
174
+ if (idOrSpecId === p.specId || idOrSpecId === baseId) return p;
175
+ if (idOrSpecId.startsWith(`${baseId}-v`)) {
176
+ throw new Error(
177
+ `spec ${idOrSpecId} is package-sourced (${p.package}) but the installed version is ${p.specId} — bump the pin instead of reading a vendored copy`,
178
+ );
179
+ }
180
+ }
181
+ const vendored = sources.find((s) => s.kind === "vendored" && s.specId === idOrSpecId);
182
+ if (vendored) return vendored;
183
+ throw new Error(`spec ${idOrSpecId} not found (vendored or package)`);
184
+ }
@@ -204,7 +204,9 @@ describe("runProbe — json-schema probe", () => {
204
204
  await writeFile(artifactPath, JSON.stringify({ name: "test", version: 1 }));
205
205
  const probe: AcceptanceProbe = {
206
206
  probe: "json-schema",
207
- artifact: path.relative("/fake/workspace", artifactPath),
207
+ // runProbe resolves `artifact` under the passed workspace (tempDir) —
208
+ // the same bare relative name the sibling AC-4 case uses.
209
+ artifact: "valid.json",
208
210
  schemaInline: {
209
211
  type: "object",
210
212
  properties: {
@@ -9,6 +9,7 @@ path traversal rejection, details field, and regression.</purpose>
9
9
  </MODULE_CONTRACT>
10
10
  <CHANGE_SUMMARY>
11
11
  <item>RFC-0643: initial domain template tests — terminology substitution, register selection, nested templates, fallback, path traversal, details field, regression.</item>
12
+ <item>RFC-1517: make pkg-health-10 shipped-set faithful and scan the publish ref</item>
12
13
  </CHANGE_SUMMARY>
13
14
  */
14
15
 
@@ -171,7 +172,7 @@ test("selectRootTemplate with missing rootAgentsMdTemplate falls back to registe
171
172
  test("selectRootTemplate rejects path traversal in rootAgentsMdTemplate", () => {
172
173
  const profile = {
173
174
  id: "evil-profile",
174
- rootAgentsMdTemplate: "../../../etc/passwd",
175
+ rootAgentsMdTemplate: "../../../etc/passwd", // pkg-health-10: adversarial fixture input — traversal rejection is the behavior under test
175
176
  } as StackProfile;
176
177
  const content = selectRootTemplate("business", profile);
177
178
  expect(content).toContain("{{projectName}}");
@@ -214,7 +215,7 @@ test("selectNestedTemplate rejects path traversal (..) with fallback", () => {
214
215
  const wsType: ProfileWorkspaceType = {
215
216
  id: "evil",
216
217
  detect: { glob: "*" },
217
- agentsMdTemplate: "../../../etc/passwd",
218
+ agentsMdTemplate: "../../../etc/passwd", // pkg-health-10: adversarial fixture input — traversal rejection is the behavior under test
218
219
  };
219
220
  const profile = { id: "evil-profile" } as StackProfile;
220
221
  const result = selectNestedTemplate(wsType, profile, {}, "FALLBACK");
@@ -637,7 +637,8 @@ test("agents-generate expands the sentinel in a hand-written nested guide", asyn
637
637
  );
638
638
 
639
639
  const result = await runAgentsGenerate({ argv: [], flags: {} }, makeContext(tempDir));
640
- expect(result.data?.injected).toContain(join("packages", "my-pkg", "AGENTS.md"));
640
+ // Reported paths are repo-relative logical paths — forward slashes on every platform.
641
+ expect(result.data?.injected).toContain("packages/my-pkg/AGENTS.md");
641
642
 
642
643
  const nested = await readFile(join(tempDir, "packages", "my-pkg", "AGENTS.md"), "utf8");
643
644
  expect(nested).toContain("## Semantic layer — read first");