@warpgogol/forge 9.3.0 → 9.4.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 (472) hide show
  1. package/AGENTS.md +32 -0
  2. package/CHANGELOG.md +33 -0
  3. package/README.md +2 -2
  4. package/bin/cli.ts +4 -4
  5. package/dist/bin/cli.js +4 -4
  6. package/dist/bin/cli.js.map +1 -1
  7. package/dist/os/adr/handlers/list-create.d.ts.map +1 -1
  8. package/dist/os/adr/handlers/list-create.js +23 -2
  9. package/dist/os/adr/handlers/list-create.js.map +1 -1
  10. package/dist/os/adr/types.d.ts +2 -0
  11. package/dist/os/adr/types.d.ts.map +1 -1
  12. package/dist/os/adr/types.js +2 -2
  13. package/dist/os/adr/types.js.map +1 -1
  14. package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
  15. package/dist/os/compass/handlers/compass-audit-handler.js +3 -1
  16. package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
  17. package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -1
  18. package/dist/os/compass/handlers/compass-header-scaffold-handler.js +6 -12
  19. package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -1
  20. package/dist/os/compass/handlers/git-revision.d.ts +2 -0
  21. package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
  22. package/dist/os/compass/handlers/git-revision.js +7 -2
  23. package/dist/os/compass/handlers/git-revision.js.map +1 -1
  24. package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
  25. package/dist/os/compass/handlers/summary-record.js +24 -14
  26. package/dist/os/compass/handlers/summary-record.js.map +1 -1
  27. package/dist/os/conformance/conformance.module.d.ts.map +1 -1
  28. package/dist/os/conformance/conformance.module.js +21 -4
  29. package/dist/os/conformance/conformance.module.js.map +1 -1
  30. package/dist/os/conformance/handlers/conformance-validate.d.ts.map +1 -1
  31. package/dist/os/conformance/handlers/conformance-validate.js +64 -8
  32. package/dist/os/conformance/handlers/conformance-validate.js.map +1 -1
  33. package/dist/os/core/archive-regen.d.ts +99 -0
  34. package/dist/os/core/archive-regen.d.ts.map +1 -0
  35. package/dist/os/core/archive-regen.js +220 -0
  36. package/dist/os/core/archive-regen.js.map +1 -0
  37. package/dist/os/core/core.module.d.ts.map +1 -1
  38. package/dist/os/core/core.module.js +159 -18
  39. package/dist/os/core/core.module.js.map +1 -1
  40. package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
  41. package/dist/os/core/handlers/assets-helpers.js +8 -3
  42. package/dist/os/core/handlers/assets-helpers.js.map +1 -1
  43. package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
  44. package/dist/os/core/handlers/forge-autonomy-validate.js +3 -1
  45. package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
  46. package/dist/os/core/handlers/package-health.d.ts +130 -0
  47. package/dist/os/core/handlers/package-health.d.ts.map +1 -1
  48. package/dist/os/core/handlers/package-health.js +548 -7
  49. package/dist/os/core/handlers/package-health.js.map +1 -1
  50. package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
  51. package/dist/os/core/handlers/release-prepare.js +5 -2
  52. package/dist/os/core/handlers/release-prepare.js.map +1 -1
  53. package/dist/os/flow/digest.d.ts.map +1 -1
  54. package/dist/os/flow/digest.js +3 -1
  55. package/dist/os/flow/digest.js.map +1 -1
  56. package/dist/os/flow/dirty-classify.d.ts +48 -0
  57. package/dist/os/flow/dirty-classify.d.ts.map +1 -0
  58. package/dist/os/flow/dirty-classify.js +81 -0
  59. package/dist/os/flow/dirty-classify.js.map +1 -0
  60. package/dist/os/flow/flow.module.d.ts.map +1 -1
  61. package/dist/os/flow/flow.module.js +85 -19
  62. package/dist/os/flow/flow.module.js.map +1 -1
  63. package/dist/os/flow/gate-engine.d.ts +13 -0
  64. package/dist/os/flow/gate-engine.d.ts.map +1 -0
  65. package/dist/os/flow/gate-engine.js +32 -0
  66. package/dist/os/flow/gate-engine.js.map +1 -0
  67. package/dist/os/flow/git.d.ts +45 -4
  68. package/dist/os/flow/git.d.ts.map +1 -1
  69. package/dist/os/flow/git.js +95 -27
  70. package/dist/os/flow/git.js.map +1 -1
  71. package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -1
  72. package/dist/os/flow/handlers/flow-backmerge.js +12 -5
  73. package/dist/os/flow/handlers/flow-backmerge.js.map +1 -1
  74. package/dist/os/flow/handlers/flow-check.d.ts.map +1 -1
  75. package/dist/os/flow/handlers/flow-check.js +25 -3
  76. package/dist/os/flow/handlers/flow-check.js.map +1 -1
  77. package/dist/os/flow/handlers/flow-cut.d.ts +4 -1
  78. package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
  79. package/dist/os/flow/handlers/flow-cut.js +54 -31
  80. package/dist/os/flow/handlers/flow-cut.js.map +1 -1
  81. package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -1
  82. package/dist/os/flow/handlers/flow-discard.js +33 -5
  83. package/dist/os/flow/handlers/flow-discard.js.map +1 -1
  84. package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
  85. package/dist/os/flow/handlers/flow-fix.js +13 -10
  86. package/dist/os/flow/handlers/flow-fix.js.map +1 -1
  87. package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -1
  88. package/dist/os/flow/handlers/flow-hold.js +13 -7
  89. package/dist/os/flow/handlers/flow-hold.js.map +1 -1
  90. package/dist/os/flow/handlers/flow-install.d.ts +2 -1
  91. package/dist/os/flow/handlers/flow-install.d.ts.map +1 -1
  92. package/dist/os/flow/handlers/flow-install.js +56 -13
  93. package/dist/os/flow/handlers/flow-install.js.map +1 -1
  94. package/dist/os/flow/handlers/flow-integrate.d.ts +48 -2
  95. package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
  96. package/dist/os/flow/handlers/flow-integrate.js +536 -65
  97. package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
  98. package/dist/os/flow/handlers/flow-open.d.ts +14 -0
  99. package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
  100. package/dist/os/flow/handlers/flow-open.js +117 -12
  101. package/dist/os/flow/handlers/flow-open.js.map +1 -1
  102. package/dist/os/flow/handlers/flow-status.d.ts +13 -0
  103. package/dist/os/flow/handlers/flow-status.d.ts.map +1 -1
  104. package/dist/os/flow/handlers/flow-status.js +35 -14
  105. package/dist/os/flow/handlers/flow-status.js.map +1 -1
  106. package/dist/os/flow/index.d.ts +1 -0
  107. package/dist/os/flow/index.d.ts.map +1 -1
  108. package/dist/os/flow/index.js +3 -1
  109. package/dist/os/flow/index.js.map +1 -1
  110. package/dist/os/flow/line-version.d.ts.map +1 -1
  111. package/dist/os/flow/line-version.js +2 -1
  112. package/dist/os/flow/line-version.js.map +1 -1
  113. package/dist/os/flow/locks.d.ts +37 -1
  114. package/dist/os/flow/locks.d.ts.map +1 -1
  115. package/dist/os/flow/locks.js +34 -14
  116. package/dist/os/flow/locks.js.map +1 -1
  117. package/dist/os/flow/preflight.d.ts +114 -0
  118. package/dist/os/flow/preflight.d.ts.map +1 -0
  119. package/dist/os/flow/preflight.js +620 -0
  120. package/dist/os/flow/preflight.js.map +1 -0
  121. package/dist/os/flow/publish.d.ts +7 -0
  122. package/dist/os/flow/publish.d.ts.map +1 -1
  123. package/dist/os/flow/publish.js +165 -3
  124. package/dist/os/flow/publish.js.map +1 -1
  125. package/dist/os/flow/registry.d.ts +26 -1
  126. package/dist/os/flow/registry.d.ts.map +1 -1
  127. package/dist/os/flow/registry.js +27 -6
  128. package/dist/os/flow/registry.js.map +1 -1
  129. package/dist/os/flow/scripts.d.ts +4 -0
  130. package/dist/os/flow/scripts.d.ts.map +1 -1
  131. package/dist/os/flow/scripts.js +13 -3
  132. package/dist/os/flow/scripts.js.map +1 -1
  133. package/dist/os/flow/session-checkout.d.ts +33 -0
  134. package/dist/os/flow/session-checkout.d.ts.map +1 -0
  135. package/dist/os/flow/session-checkout.js +151 -0
  136. package/dist/os/flow/session-checkout.js.map +1 -0
  137. package/dist/os/flow/worktree-path.d.ts.map +1 -1
  138. package/dist/os/flow/worktree-path.js +9 -3
  139. package/dist/os/flow/worktree-path.js.map +1 -1
  140. package/dist/os/instructions/handlers/budget-validate.d.ts +1 -0
  141. package/dist/os/instructions/handlers/budget-validate.d.ts.map +1 -1
  142. package/dist/os/instructions/handlers/budget-validate.js +12 -4
  143. package/dist/os/instructions/handlers/budget-validate.js.map +1 -1
  144. package/dist/os/instructions/instructions.module.d.ts.map +1 -1
  145. package/dist/os/instructions/instructions.module.js +4 -1
  146. package/dist/os/instructions/instructions.module.js.map +1 -1
  147. package/dist/os/mission/open-missions.d.ts +8 -0
  148. package/dist/os/mission/open-missions.d.ts.map +1 -0
  149. package/dist/os/mission/open-missions.js +42 -0
  150. package/dist/os/mission/open-missions.js.map +1 -0
  151. package/dist/os/queue/manifest.d.ts.map +1 -1
  152. package/dist/os/queue/manifest.js +11 -1
  153. package/dist/os/queue/manifest.js.map +1 -1
  154. package/dist/os/rfc/acceptance.d.ts +14 -0
  155. package/dist/os/rfc/acceptance.d.ts.map +1 -1
  156. package/dist/os/rfc/acceptance.js +18 -10
  157. package/dist/os/rfc/acceptance.js.map +1 -1
  158. package/dist/os/rfc/decision-log.d.ts.map +1 -1
  159. package/dist/os/rfc/decision-log.js +11 -2
  160. package/dist/os/rfc/decision-log.js.map +1 -1
  161. package/dist/os/rfc/frontmatter-io.d.ts +23 -0
  162. package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
  163. package/dist/os/rfc/frontmatter-io.js +82 -1
  164. package/dist/os/rfc/frontmatter-io.js.map +1 -1
  165. package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -1
  166. package/dist/os/rfc/handlers/implement-stamp-deviations.js +24 -2
  167. package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -1
  168. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  169. package/dist/os/rfc/handlers/implement-stamp.js +16 -3
  170. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  171. package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
  172. package/dist/os/rfc/handlers/index-graph.js +5 -4
  173. package/dist/os/rfc/handlers/index-graph.js.map +1 -1
  174. package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
  175. package/dist/os/rfc/handlers/list-create.js +83 -8
  176. package/dist/os/rfc/handlers/list-create.js.map +1 -1
  177. package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts +48 -0
  178. package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -1
  179. package/dist/os/rfc/handlers/rfc-evidence-sync.js +131 -2
  180. package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -1
  181. package/dist/os/rfc/handlers/validate-rules.d.ts +21 -1
  182. package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
  183. package/dist/os/rfc/handlers/validate-rules.js +77 -5
  184. package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
  185. package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
  186. package/dist/os/rfc/handlers/validate.js +64 -6
  187. package/dist/os/rfc/handlers/validate.js.map +1 -1
  188. package/dist/os/rfc/next-id.d.ts +38 -0
  189. package/dist/os/rfc/next-id.d.ts.map +1 -0
  190. package/dist/os/rfc/next-id.js +165 -0
  191. package/dist/os/rfc/next-id.js.map +1 -0
  192. package/dist/os/rfc/probe-batch.d.ts.map +1 -1
  193. package/dist/os/rfc/probe-batch.js +6 -1
  194. package/dist/os/rfc/probe-batch.js.map +1 -1
  195. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  196. package/dist/os/rfc/rfc.module.js +36 -8
  197. package/dist/os/rfc/rfc.module.js.map +1 -1
  198. package/dist/os/rfc/types.d.ts +35 -6
  199. package/dist/os/rfc/types.d.ts.map +1 -1
  200. package/dist/os/rfc/types.js +6 -6
  201. package/dist/os/rfc/types.js.map +1 -1
  202. package/dist/os/rfc/verification-evidence.d.ts +1 -1
  203. package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
  204. package/dist/os/rfc/verification-evidence.js +81 -28
  205. package/dist/os/rfc/verification-evidence.js.map +1 -1
  206. package/dist/os/rfc/verification-origin.d.ts +8 -0
  207. package/dist/os/rfc/verification-origin.d.ts.map +1 -1
  208. package/dist/os/rfc/verification-origin.js +47 -0
  209. package/dist/os/rfc/verification-origin.js.map +1 -1
  210. package/dist/os/session/handlers/save.d.ts.map +1 -1
  211. package/dist/os/session/handlers/save.js +31 -7
  212. package/dist/os/session/handlers/save.js.map +1 -1
  213. package/dist/os/spec/spec-schema.d.ts +8 -0
  214. package/dist/os/spec/spec-schema.d.ts.map +1 -1
  215. package/dist/os/spec/spec-schema.js +1 -0
  216. package/dist/os/spec/spec-schema.js.map +1 -1
  217. package/dist/os/spec/spec-status.d.ts +8 -0
  218. package/dist/os/spec/spec-status.d.ts.map +1 -1
  219. package/dist/os/spec/spec-status.js +18 -6
  220. package/dist/os/spec/spec-status.js.map +1 -1
  221. package/dist/os/spec/spec-validate.d.ts.map +1 -1
  222. package/dist/os/spec/spec-validate.js +62 -15
  223. package/dist/os/spec/spec-validate.js.map +1 -1
  224. package/dist/os/spec/spec.module.d.ts.map +1 -1
  225. package/dist/os/spec/spec.module.js +13 -5
  226. package/dist/os/spec/spec.module.js.map +1 -1
  227. package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -1
  228. package/dist/os/system/handlers/system-map-validate.js +2 -1
  229. package/dist/os/system/handlers/system-map-validate.js.map +1 -1
  230. package/dist/os/system/handlers/system-outbox-scan.d.ts +11 -0
  231. package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -1
  232. package/dist/os/system/handlers/system-outbox-scan.js +54 -6
  233. package/dist/os/system/handlers/system-outbox-scan.js.map +1 -1
  234. package/dist/os/system/handlers/system-task-create.d.ts.map +1 -1
  235. package/dist/os/system/handlers/system-task-create.js +6 -1
  236. package/dist/os/system/handlers/system-task-create.js.map +1 -1
  237. package/dist/os/system/handlers/system-versionset-record.d.ts +14 -0
  238. package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -1
  239. package/dist/os/system/handlers/system-versionset-record.js +246 -6
  240. package/dist/os/system/handlers/system-versionset-record.js.map +1 -1
  241. package/dist/os/system/repo.d.ts +1 -1
  242. package/dist/os/system/repo.d.ts.map +1 -1
  243. package/dist/os/system/repo.js +53 -3
  244. package/dist/os/system/repo.js.map +1 -1
  245. package/dist/os/system/scenario-schemas.d.ts +109 -3
  246. package/dist/os/system/scenario-schemas.d.ts.map +1 -1
  247. package/dist/os/system/scenario-schemas.js +66 -10
  248. package/dist/os/system/scenario-schemas.js.map +1 -1
  249. package/dist/os/system/system.module.d.ts.map +1 -1
  250. package/dist/os/system/system.module.js +69 -17
  251. package/dist/os/system/system.module.js.map +1 -1
  252. package/dist/os/system/tests/contract-fixtures.d.ts +17 -0
  253. package/dist/os/system/tests/contract-fixtures.d.ts.map +1 -0
  254. package/dist/os/system/tests/contract-fixtures.js +109 -0
  255. package/dist/os/system/tests/contract-fixtures.js.map +1 -0
  256. package/dist/src/config/forge-config.d.ts +54 -18
  257. package/dist/src/config/forge-config.d.ts.map +1 -1
  258. package/dist/src/config/forge-config.js +41 -9
  259. package/dist/src/config/forge-config.js.map +1 -1
  260. package/dist/src/conformance/index.d.ts +6 -0
  261. package/dist/src/conformance/index.d.ts.map +1 -1
  262. package/dist/src/conformance/index.js +36 -1
  263. package/dist/src/conformance/index.js.map +1 -1
  264. package/dist/src/formal/proof-runner.d.ts.map +1 -1
  265. package/dist/src/formal/proof-runner.js +10 -2
  266. package/dist/src/formal/proof-runner.js.map +1 -1
  267. package/dist/src/migration-adapters/node-typescript-pnpm/index.js +3 -1
  268. package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
  269. package/dist/src/migration-adapters/phaser-pnpm/index.js +3 -1
  270. package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
  271. package/dist/src/onboarding/agents-generate.js +4 -4
  272. package/dist/src/onboarding/agents-generate.js.map +1 -1
  273. package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
  274. package/dist/src/onboarding/nested-agents-generate.js +3 -1
  275. package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
  276. package/dist/src/onboarding/scaffold-project.js +2 -2
  277. package/dist/src/onboarding/scaffold-project.js.map +1 -1
  278. package/dist/src/onboarding/upgrade.d.ts.map +1 -1
  279. package/dist/src/onboarding/upgrade.js +14 -2
  280. package/dist/src/onboarding/upgrade.js.map +1 -1
  281. package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
  282. package/dist/src/onboarding/workspace-discovery.js +3 -1
  283. package/dist/src/onboarding/workspace-discovery.js.map +1 -1
  284. package/dist/src/skill-schema.d.ts +3 -0
  285. package/dist/src/skill-schema.d.ts.map +1 -1
  286. package/dist/src/skill-schema.js +9 -2
  287. package/dist/src/skill-schema.js.map +1 -1
  288. package/dist/src/spec/resolve-spec-source.d.ts +45 -0
  289. package/dist/src/spec/resolve-spec-source.d.ts.map +1 -0
  290. package/dist/src/spec/resolve-spec-source.js +153 -0
  291. package/dist/src/spec/resolve-spec-source.js.map +1 -0
  292. package/dist/src/utils/command-inventory.d.ts +28 -0
  293. package/dist/src/utils/command-inventory.d.ts.map +1 -0
  294. package/dist/src/utils/command-inventory.js +84 -0
  295. package/dist/src/utils/command-inventory.js.map +1 -0
  296. package/dist/src/utils/io.d.ts.map +1 -1
  297. package/dist/src/utils/io.js +6 -1
  298. package/dist/src/utils/io.js.map +1 -1
  299. package/dist/src/utils/repo-path.d.ts +10 -0
  300. package/dist/src/utils/repo-path.d.ts.map +1 -0
  301. package/dist/src/utils/repo-path.js +52 -0
  302. package/dist/src/utils/repo-path.js.map +1 -0
  303. package/dist/src/utils/spawn.d.ts +23 -0
  304. package/dist/src/utils/spawn.d.ts.map +1 -0
  305. package/dist/src/utils/spawn.js +83 -0
  306. package/dist/src/utils/spawn.js.map +1 -0
  307. package/docs/branch-model.md +1 -1
  308. package/docs/guides/existing-project.md +1 -1
  309. package/docs/maintainers/publishing.md +1 -1
  310. package/docs/reference/cli.md +8 -2
  311. package/docs/reference/profiles.md +1 -1
  312. package/os/adr/handlers/list-create.ts +26 -2
  313. package/os/adr/types.ts +4 -2
  314. package/os/compass/handlers/compass-audit-handler.ts +6 -1
  315. package/os/compass/handlers/compass-header-scaffold-handler.ts +12 -11
  316. package/os/compass/handlers/git-revision.ts +8 -2
  317. package/os/compass/handlers/summary-record.ts +25 -14
  318. package/os/compass/handlers/tests/compass-invariant-binding.test.ts +3 -2
  319. package/os/conformance/conformance.module.ts +21 -4
  320. package/os/conformance/handlers/conformance-validate.ts +108 -16
  321. package/os/conformance/handlers/tests/conformance-package-consumer.test.ts +200 -0
  322. package/os/core/archive-regen.ts +279 -0
  323. package/os/core/core.module.ts +176 -29
  324. package/os/core/docs-archive.test.ts +413 -3
  325. package/os/core/handlers/assets-helpers.ts +8 -3
  326. package/os/core/handlers/forge-autonomy-validate.ts +3 -1
  327. package/os/core/handlers/package-health.test.ts +418 -4
  328. package/os/core/handlers/package-health.ts +629 -7
  329. package/os/core/handlers/release-prepare.ts +5 -2
  330. package/os/flow/digest.ts +3 -1
  331. package/os/flow/dirty-classify.ts +112 -0
  332. package/os/flow/flow.module.ts +92 -24
  333. package/os/flow/gate-engine.ts +45 -0
  334. package/os/flow/git.ts +117 -29
  335. package/os/flow/handlers/flow-backmerge.ts +14 -4
  336. package/os/flow/handlers/flow-check.ts +27 -2
  337. package/os/flow/handlers/flow-cut.ts +97 -46
  338. package/os/flow/handlers/flow-discard.ts +33 -5
  339. package/os/flow/handlers/flow-fix.ts +22 -10
  340. package/os/flow/handlers/flow-hold.ts +20 -7
  341. package/os/flow/handlers/flow-install.ts +59 -12
  342. package/os/flow/handlers/flow-integrate.ts +808 -182
  343. package/os/flow/handlers/flow-open.ts +135 -11
  344. package/os/flow/handlers/flow-status.ts +45 -13
  345. package/os/flow/index.ts +3 -1
  346. package/os/flow/line-version.ts +2 -1
  347. package/os/flow/locks.ts +56 -14
  348. package/os/flow/preflight.ts +763 -0
  349. package/os/flow/publish.ts +200 -5
  350. package/os/flow/registry.ts +43 -7
  351. package/os/flow/scripts.ts +23 -7
  352. package/os/flow/session-checkout.ts +186 -0
  353. package/os/flow/tests/dirty-classify.test.ts +116 -0
  354. package/os/flow/tests/fixtures/branch-names.yaml +40 -40
  355. package/os/flow/tests/flow-discard.test.ts +32 -0
  356. package/os/flow/tests/flow-guard-parity.test.ts +10 -2
  357. package/os/flow/tests/flow-install.test.ts +7 -3
  358. package/os/flow/tests/flow-integrate.gate-report.test.ts +144 -0
  359. package/os/flow/tests/flow-integrate.preflight.test.ts +561 -0
  360. package/os/flow/tests/flow-integrate.reattach.test.ts +197 -0
  361. package/os/flow/tests/flow-integrate.remediation.test.ts +254 -0
  362. package/os/flow/tests/flow-integrate.test.ts +348 -17
  363. package/os/flow/tests/flow-open.pending.test.ts +277 -0
  364. package/os/flow/tests/flow-open.test.ts +52 -9
  365. package/os/flow/tests/flow-push-publish.test.ts +124 -0
  366. package/os/flow/tests/flow-status.test.ts +31 -1
  367. package/os/flow/tests/locks.test.ts +39 -3
  368. package/os/flow/tests/scripts.test.ts +18 -2
  369. package/os/flow/tests/state-roots.test.ts +8 -5
  370. package/os/flow/worktree-path.ts +9 -3
  371. package/os/formal/handlers/proof-check.test.ts +6 -3
  372. package/os/instructions/budget.test.ts +31 -0
  373. package/os/instructions/handlers/budget-validate.ts +13 -4
  374. package/os/instructions/instructions.module.ts +4 -1
  375. package/os/mission/open-missions.ts +50 -0
  376. package/os/queue/decision-ledger.test.ts +18 -0
  377. package/os/queue/manifest.ts +17 -1
  378. package/os/rfc/acceptance.ts +30 -10
  379. package/os/rfc/decision-log.ts +13 -2
  380. package/os/rfc/frontmatter-io.ts +89 -1
  381. package/os/rfc/handlers/implement-stamp-deviations.test.ts +83 -0
  382. package/os/rfc/handlers/implement-stamp-deviations.ts +22 -2
  383. package/os/rfc/handlers/implement-stamp-stale.test.ts +5 -1
  384. package/os/rfc/handlers/implement-stamp.ts +16 -3
  385. package/os/rfc/handlers/index-graph.ts +5 -4
  386. package/os/rfc/handlers/lifecycle.test.ts +136 -0
  387. package/os/rfc/handlers/list-create.test.ts +82 -0
  388. package/os/rfc/handlers/list-create.ts +101 -8
  389. package/os/rfc/handlers/rfc-evidence-sync.test.ts +504 -0
  390. package/os/rfc/handlers/rfc-evidence-sync.ts +192 -2
  391. package/os/rfc/handlers/tests/index-graph.test.ts +2 -1
  392. package/os/rfc/handlers/validate-rules-rfc1454.test.ts +73 -0
  393. package/os/rfc/handlers/validate-rules.ts +103 -7
  394. package/os/rfc/handlers/validate.ts +68 -4
  395. package/os/rfc/next-id.ts +232 -0
  396. package/os/rfc/probe-batch.ts +6 -1
  397. package/os/rfc/rfc.module.ts +41 -8
  398. package/os/rfc/types.ts +28 -6
  399. package/os/rfc/verification-emit-freshness.test.ts +5 -1
  400. package/os/rfc/verification-emit.test.ts +5 -1
  401. package/os/rfc/verification-evidence.ts +99 -33
  402. package/os/rfc/verification-origin.ts +59 -0
  403. package/os/rfc/verification-refresh.test.ts +5 -1
  404. package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +5 -1
  405. package/os/session/handlers/save.ts +35 -7
  406. package/os/session/tests/session-save.test.ts +154 -0
  407. package/os/spec/spec-schema.ts +3 -0
  408. package/os/spec/spec-status.ts +22 -6
  409. package/os/spec/spec-validate.package-source.test.ts +187 -0
  410. package/os/spec/spec-validate.ts +65 -14
  411. package/os/spec/spec.module.ts +13 -5
  412. package/os/system/handlers/system-map-validate.ts +4 -2
  413. package/os/system/handlers/system-outbox-scan.ts +65 -21
  414. package/os/system/handlers/system-task-create.ts +6 -1
  415. package/os/system/handlers/system-versionset-record.ts +301 -16
  416. package/os/system/repo.ts +59 -18
  417. package/os/system/scenario-schemas.ts +91 -12
  418. package/os/system/system.module.ts +70 -17
  419. package/os/system/tests/contract-fixtures.ts +139 -0
  420. package/os/system/tests/scenario-pin-drift-check.test.ts +114 -0
  421. package/os/system/tests/scenario-validator-check.test.ts +96 -0
  422. package/os/system/tests/system-task-dispatch.test.ts +4 -1
  423. package/os/system/tests/system-versionset.test.ts +7 -3
  424. package/os/system/tests/version-set-v2.test.ts +78 -0
  425. package/package.json +9 -1
  426. package/profiles/forge-shell.yaml +1 -2
  427. package/profiles/knowledge.yaml +1 -1
  428. package/profiles/system.yaml +2 -2
  429. package/profiles/typescript.yaml +0 -1
  430. package/skills/fo/fo-doctor/SKILL.md +151 -0
  431. package/skills/fo/fo-handoff/SKILL.md +22 -0
  432. package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +2 -1
  433. package/skills/fo/fo-idea-implement/SKILL.md +5 -2
  434. package/skills/fo/fo-idea-plan/SKILL.md +5 -5
  435. package/skills/fo/fo-session-retro/SKILL.md +37 -11
  436. package/skills/fo/fo-spec-ingest/SKILL.md +8 -0
  437. package/skills/fo/fo-system-dispatch/SKILL.md +1 -0
  438. package/skills/meta/skill-create/SKILL.md +2 -1
  439. package/src/bin-entry.test.ts +3 -1
  440. package/src/config/forge-config.ts +57 -13
  441. package/src/conformance/index.ts +46 -1
  442. package/src/formal/proof-runner.ts +10 -2
  443. package/src/migration-adapters/node-typescript-pnpm/index.ts +3 -1
  444. package/src/migration-adapters/phaser-pnpm/index.ts +3 -1
  445. package/src/onboarding/agents-generate.ts +4 -4
  446. package/src/onboarding/nested-agents-generate.ts +3 -1
  447. package/src/onboarding/scaffold-project.ts +2 -2
  448. package/src/onboarding/upgrade.ts +13 -2
  449. package/src/onboarding/workspace-discovery.ts +3 -1
  450. package/src/pipeline-status.test.ts +1 -1
  451. package/src/skill-schema.ts +9 -2
  452. package/src/spec/resolve-spec-source.ts +184 -0
  453. package/src/tests/acceptance-probe-kinds.test.ts +3 -1
  454. package/src/tests/agents-generate-domain.test.ts +3 -2
  455. package/src/tests/agents-generate.test.ts +2 -1
  456. package/src/tests/create-flow.test.ts +3 -1
  457. package/src/tests/create.test.ts +12 -2
  458. package/src/tests/editable-generated-region.test.ts +2 -2
  459. package/src/tests/fixtures/agents-generate-business-before.txt +2 -0
  460. package/src/tests/implement-stamp.test.ts +5 -2
  461. package/src/tests/profile-flow-hooks.test.ts +15 -0
  462. package/src/tests/rfc-implement-stamp-governance.test.ts +6 -2
  463. package/src/tests/rfc-verification-verdict-ingest.test.ts +5 -1
  464. package/src/tests/scaffold-project.test.ts +3 -1
  465. package/src/tests/upgrade.test.ts +79 -3
  466. package/src/tests/workspace-discovery.test.ts +4 -3
  467. package/src/utils/command-inventory.ts +105 -0
  468. package/src/utils/io.ts +6 -1
  469. package/src/utils/repo-path.ts +49 -0
  470. package/src/utils/spawn.ts +88 -0
  471. package/src/tests/rfc-evidence-sync.test.ts +0 -369
  472. package/src/tests/skill-agents-sync.test.ts +0 -192
@@ -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;
@@ -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");
@@ -60,9 +60,11 @@ beforeEach(async () => {
60
60
  git(tempDir, ["config", "user.email", "flow-test@example.invalid"]);
61
61
  });
62
62
 
63
+ // rm of a scaffolded node_modules is minutes-slow on Windows — the 10s
64
+ // default hook budget cannot hold it.
63
65
  afterEach(async () => {
64
66
  await rm(tempDir, { recursive: true, force: true });
65
- });
67
+ }, 180000);
66
68
 
67
69
  describe("RFC-1500: forge.create adopts the fixed branch model", () => {
68
70
  test("AC-1: create leaves develop + main with the primary on develop", async () => {
@@ -49,9 +49,11 @@ beforeEach(async () => {
49
49
  tempDir = await mkdtemp(join(tmpdir(), "create-test-"));
50
50
  });
51
51
 
52
+ // rm of a scaffolded node_modules is minutes-slow on Windows — the 10s
53
+ // default hook budget cannot hold it.
52
54
  afterEach(async () => {
53
55
  await rm(tempDir, { recursive: true, force: true });
54
- });
56
+ }, 180000);
55
57
 
56
58
  test("forge create --in-place scaffolds in cwd with forge.yaml and docs dirs", async () => {
57
59
  const result = await runCreate(
@@ -355,10 +357,18 @@ test("forge create --profile phaser-game writes compass.fileExtensions into forg
355
357
  { argv: [], flags: { "in-place": true, "no-flow": true, profile: "phaser-game", name: "my-phaser-game" } },
356
358
  makeContext(tempDir),
357
359
  );
360
+ // Printed live so a cancelled CI log still carries the failing payload.
361
+ if (result.exitCode !== 0) {
362
+ console.log(
363
+ `[phaser-create] exitCode=${String(result.exitCode)} errors=${JSON.stringify(result.data?.errors ?? null)} summary=${JSON.stringify(result.summary ?? null)}`,
364
+ );
365
+ }
358
366
  expect(result.exitCode).toBe(0);
359
367
 
360
368
  const { readFile: readFileAsync } = await import("node:fs/promises");
361
369
  const forgeYaml = await readFileAsync(join(tempDir, "forge.yaml"), "utf8");
362
370
  expect(forgeYaml).toContain("compass:");
363
371
  expect(forgeYaml).toContain("fileExtensions:");
364
- }, 120000);
372
+ // phaser pulls real packages over the network — cold-store installs on
373
+ // Windows runners legitimately exceed the default scaffold timeouts.
374
+ }, 600000);
@@ -191,7 +191,7 @@ test("generateNestedAgentsMd regenerates the head and preserves the custom tail"
191
191
 
192
192
  // First run — fresh file gains the marker + hint
193
193
  const first = await generateNestedAgentsMd(tempDir, config, false);
194
- expect(first.generated).toContain(join("packages", "pkg", "AGENTS.md"));
194
+ expect(first.generated).toContain("packages/pkg/AGENTS.md");
195
195
  const agentsPath = join(tempDir, "packages", "pkg", "AGENTS.md");
196
196
  const initial = await readFile(agentsPath, "utf8");
197
197
  expect(initial).toContain(MD_MARKER);
@@ -202,7 +202,7 @@ test("generateNestedAgentsMd regenerates the head and preserves the custom tail"
202
202
 
203
203
  // Second run — head regenerated, tail preserved verbatim
204
204
  const second = await generateNestedAgentsMd(tempDir, config, false);
205
- expect(second.preserved).toContain(join("packages", "pkg", "AGENTS.md"));
205
+ expect(second.preserved).toContain("packages/pkg/AGENTS.md");
206
206
  const merged = await readFile(agentsPath, "utf8");
207
207
  expect(merged).toContain("## Workspace rules");
208
208
  expect(merged).toContain("- never touch dist/");
@@ -54,6 +54,7 @@ Treat these XML documents as the primary semantic layer for AI work and keep the
54
54
  | fo-compass-annotate | fo | user | content-mutation |
55
55
  | fo-design-summit | fo | user | document-only |
56
56
  | fo-doc-audit | fo | user | document-only |
57
+ | fo-doctor | fo | user | document-only |
57
58
  | fo-explore | fo | user | document-only |
58
59
  | fo-extract-dna | fo | user | document-only |
59
60
  | fo-fix | fo | user | code-mutation |
@@ -126,6 +127,7 @@ When the operator expresses an intent in natural language, the agent routes to t
126
127
  | "manage Compass headers", "annotate source files with Compass", "audit Compass module contracts" | `fo-compass-annotate` |
127
128
  | "design summit", "multi-persona review", "party mode" | `fo-design-summit` |
128
129
  | "audit documentation sync", "update docs after code changes", "check AGENTS.md and README are in sync" | `fo-doc-audit` |
130
+ | "check my session environment", "agent turns keep stalling", "session doctor", "environment audit" | `fo-doctor` |
129
131
  | "нам надо закрыть открытые вопросы", "explore this idea", "let me think about this", "what are the options for", "what if we" | `fo-explore` |
130
132
  | "extract DNA invariant", "discover architectural invariants", "formalize implicit architectural rules" | `fo-extract-dna` |
131
133
  | "исправим", "примени findings", "fix all", "fix issues from review", "apply review findings and fix" | `fo-fix` |
@@ -8,13 +8,13 @@ Unit tests for implement stamp covering rfc.implement.stamp. It also guards the
8
8
  </non-goals>
9
9
  </MODULE_CONTRACT>
10
10
  <CHANGE_SUMMARY>
11
- <item>RFC-1322: fo-review fix pass — stale-envelope refresh, probes-less fail-closed, empty/dir/escape paths, line-ranges, --sync composition, fully-checked no-op</item>
12
11
  <item>RFC-1322: evidence annotation extraction takes the last occurrence — prose mentions no longer shadow the annotation</item>
13
12
  <item>RFC-1383: pins for the --check-criteria remedy hint, residual no-no-op, and N-of-M success output</item>
14
13
  <item>RFC-1483: self-sufficient implement stamp — default repair pass, ordered remediation checklist, --no-repair</item>
15
14
  <item>RFC-1489: batch test probes through one instrumented Vitest run + frontmatter corpus reads
16
15
 
17
16
  runProbeSet is the single shared execution point: barrier-free segments of test probes sharing one effective bound run in one vitest --reporter=json --outputFile process with per-(file,testName) attribution; missing files/reports yield unverified. run/page/proof and all non-test kinds are barriers. --no-batch escapes to the legacy path on acceptance.run, verification.emit and verification.refresh. rfc.validate reads non-target corpus files frontmatter-only via readRfcFrontmatter (64 KiB bound, full-parse fallback); emit/refresh/acceptance corpus scans use the same accessor. Corpus map slimmed to RfcCorpusEntry {fileName, frontmatter}.</item>
17
+ <item>RFC-1516: add an evidence-freshness window to the stamp-sync chain for rfc-1516</item>
18
18
  <history>RFC-1310, RFC-1311, RFC-1322</history>
19
19
  </CHANGE_SUMMARY>
20
20
  */
@@ -27,7 +27,10 @@ import { execFileSync } from "node:child_process";
27
27
  import { parse as yamlParse, stringify as yamlStringify } from "yaml";
28
28
 
29
29
  const { mockRunProbe } = vi.hoisted(() => ({ mockRunProbe: vi.fn() }));
30
- vi.mock("../../os/rfc/acceptance.ts", () => ({
30
+ vi.mock("../../os/rfc/acceptance.ts", async (importOriginal) => ({
31
+ // RFC-1516: keep classifyProbeReuse (and every non-execution export) real —
32
+ // emit's reuse path calls it when a committed envelope is present.
33
+ ...(await importOriginal<typeof import("../../os/rfc/acceptance.ts")>()),
31
34
  runProbe: mockRunProbe,
32
35
  // RFC-1489: emit (which stamp composes) drives runProbeSet — the shim
33
36
  // preserves the per-probe mock contract.