@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
@@ -0,0 +1,232 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>RFC-1536 (Q-2): shared governance-id allocation. A session
4
+ worktree's rfc.create/adr.create snapshot lags develop — a parallel session
5
+ can land the same id first. The shared reservation surface at
6
+ &lt;common-git-dir&gt;/forge/rfc-reservations.yaml is visible to every
7
+ checkout of the clone, so the next id is max(primary scan, worktree scan,
8
+ develop tip, reservations) + 1 and the claim is appended before the draft
9
+ file is written.</purpose>
10
+ <non-goals>
11
+ <item>No cross-clone uniqueness — the reservation surface lives in the common git dir; sessions on different clones still collide (bounded consequence, RFC-1536 failure modes).</item>
12
+ </non-goals>
13
+ </MODULE_CONTRACT>
14
+ <KEY_DECISIONS>
15
+ <item>The reservation file is shared local state, never a tracked artifact — it lives under the common git dir next to forge/registry.yaml.</item>
16
+ <item>Entries carry `kind` so the RFC and ADR namespaces share one file without sharing a number space (Q-2).</item>
17
+ <item>An unwritable surface degrades to the pre-RFC level: allocation falls back to max(scans)+1 with a warning — draft creation never hard-fails on the reservation layer.</item>
18
+ <item>A reservation whose draft never lands stays a harmless gap; flow.integrate prunes only its own session's entries.</item>
19
+ </KEY_DECISIONS>
20
+ <CHANGE_SUMMARY>
21
+ <item>RFC-1536: shared governance-id allocation surface (Q-2: RFC + ADR kinds)</item>
22
+ <item>RFC-1536: owning-checkout routing, FLOW-OPEN-01 dirty-primary warning, shared governance-id allocation (RFC+ADR)</item>
23
+ <item>RFC-1536: type forge flow and rfc io against forge's own WorkspaceIO
24
+
25
+ The standalone forge extract has no @warpgogol/werkstatt-shared; the type-only import failed extract-verify (FLOW-CUT-13) for the 9.4.0 cut.</item>
26
+ </CHANGE_SUMMARY>
27
+ */
28
+
29
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
30
+ import { join } from "node:path";
31
+
32
+ import { parse as yamlParse, stringify as yamlStringify } from "yaml";
33
+ import type { WorkspaceIO } from "../../src/types.ts";
34
+
35
+ import { git, listLocalBranches, topLevel } from "../flow/git.ts";
36
+ import { withFlowLock } from "../flow/locks.ts";
37
+ import { commonGitDir } from "../flow/registry.ts";
38
+ import { primaryWorktree } from "../flow/worktree-path.ts";
39
+
40
+ export type GovernanceKind = "rfc" | "adr";
41
+
42
+ export interface GovernanceIdAllocation {
43
+ id: number;
44
+ /** Which surface yielded the winning maximum. */
45
+ source: "primary" | "develop" | "reservation" | "worktree";
46
+ /** Non-empty when the reservation append failed and the run degraded. */
47
+ warnings: string[];
48
+ }
49
+
50
+ export interface ReservationEntry {
51
+ kind: GovernanceKind;
52
+ id: number;
53
+ /** Branch name when reserved inside a session worktree, else cwd's branch. */
54
+ session: string | null;
55
+ at: string;
56
+ }
57
+
58
+ const RESERVATIONS_RELATIVE = "forge/rfc-reservations.yaml";
59
+ const RESERVATIONS_LOCK_RELATIVE = "forge/rfc-reservations.lock";
60
+
61
+ const KIND_DIR: Record<GovernanceKind, string> = {
62
+ rfc: "docs/rfcs",
63
+ adr: "docs/adrs",
64
+ };
65
+
66
+ function idPattern(kind: GovernanceKind): RegExp {
67
+ return kind === "rfc" ? /^rfc-(\d{4})/ : /^adr-(\d{4})/;
68
+ }
69
+
70
+ async function scanDirMax(dir: string, pattern: RegExp, io: WorkspaceIO): Promise<number> {
71
+ if (!(await io.exists(dir))) return 0;
72
+ let max = 0;
73
+ for (const file of await io.readdir(dir)) {
74
+ const match = file.name.match(pattern);
75
+ if (match) max = Math.max(max, parseInt(match[1]!, 10));
76
+ }
77
+ return max;
78
+ }
79
+
80
+ /** Highest id of `kind` present on the develop tip — committed state even
81
+ * when the primary working copy is stale. 0 when develop is absent. */
82
+ async function scanDevelopMax(
83
+ cwd: string,
84
+ kind: GovernanceKind,
85
+ io: WorkspaceIO,
86
+ ): Promise<number> {
87
+ if (!(await listLocalBranches(cwd, io)).includes("develop")) return 0;
88
+ const r = await git(cwd, io, ["ls-tree", "--name-only", "develop", "--", KIND_DIR[kind]]);
89
+ if (r.exitCode !== 0) return 0;
90
+ const pattern = idPattern(kind);
91
+ let max = 0;
92
+ for (const line of r.stdout.split("\n")) {
93
+ const match = line.trim().match(pattern);
94
+ if (match) max = Math.max(max, parseInt(match[1]!, 10));
95
+ }
96
+ return max;
97
+ }
98
+
99
+ export async function readReservations(
100
+ commonGitDir: string,
101
+ ): Promise<ReservationEntry[]> {
102
+ const file = join(commonGitDir, RESERVATIONS_RELATIVE);
103
+ let raw: string;
104
+ try {
105
+ raw = await readFile(file, "utf8");
106
+ } catch {
107
+ return [];
108
+ }
109
+ const parsed = yamlParse(raw) as { reservations?: ReservationEntry[] } | null;
110
+ return Array.isArray(parsed?.reservations) ? parsed.reservations : [];
111
+ }
112
+
113
+ /**
114
+ * Append a reservation under a lock, pruning entries whose id already landed
115
+ * in `landedIds` (consumed — the draft is on disk/on develop). A lost-prune
116
+ * race is harmless: stale entries only raise the next id, never collide.
117
+ */
118
+ export async function appendReservation(
119
+ io: WorkspaceIO,
120
+ cwd: string,
121
+ entry: Omit<ReservationEntry, "at">,
122
+ landedIds: ReadonlySet<number>,
123
+ ): Promise<{ warnings: string[] }> {
124
+ const warnings: string[] = [];
125
+ try {
126
+ const common = await commonGitDir(io, cwd);
127
+ const file = join(common, RESERVATIONS_RELATIVE);
128
+ const lock = join(common, RESERVATIONS_LOCK_RELATIVE);
129
+ await withFlowLock(
130
+ lock,
131
+ { waitMs: 5_000, staleMs: 30_000 },
132
+ async () => {
133
+ const existing = await readReservations(common);
134
+ const kept = existing.filter(
135
+ (e) => !(e.kind === entry.kind && landedIds.has(e.id)),
136
+ );
137
+ kept.push({ ...entry, at: new Date().toISOString() });
138
+ await mkdir(join(common, "forge"), { recursive: true });
139
+ await writeFile(file, yamlStringify({ reservations: kept }), "utf8");
140
+ },
141
+ io,
142
+ );
143
+ } catch (error) {
144
+ warnings.push(`reservation skipped — ${(error as Error).message}`);
145
+ }
146
+ return { warnings };
147
+ }
148
+
149
+ /**
150
+ * Allocate the next governance id against every surface a session can see:
151
+ * the primary checkout's docs dir, `develop`'s committed tree, the shared
152
+ * reservation file, and the caller's own worktree scan (`worktreeMax` — the
153
+ * caller already holds the claim-seeded local maximum).
154
+ */
155
+ export async function allocateNextGovernanceId(
156
+ io: WorkspaceIO,
157
+ cwd: string,
158
+ kind: GovernanceKind,
159
+ worktreeMax: number,
160
+ ): Promise<GovernanceIdAllocation> {
161
+ const warnings: string[] = [];
162
+ let primaryMax = 0;
163
+ let reservations: ReservationEntry[] = [];
164
+ let developMax = 0;
165
+ try {
166
+ const repoRoot = await topLevel(cwd, io);
167
+ const root = repoRoot ?? cwd;
168
+ const primary = await primaryWorktree(io, root);
169
+ primaryMax = await scanDirMax(join(primary, KIND_DIR[kind]), idPattern(kind), io);
170
+ developMax = await scanDevelopMax(root, kind, io);
171
+ const common = await commonGitDir(io, root);
172
+ reservations = await readReservations(common);
173
+ } catch (error) {
174
+ warnings.push(`shared surfaces unreadable — falling back to worktree scan: ${(error as Error).message}`);
175
+ }
176
+
177
+ const reservationMax = reservations
178
+ .filter((e) => e.kind === kind)
179
+ .reduce((max, e) => Math.max(max, e.id), 0);
180
+
181
+ const candidates: Array<[number, GovernanceIdAllocation["source"]]> = [
182
+ [primaryMax, "primary"],
183
+ [developMax, "develop"],
184
+ [reservationMax, "reservation"],
185
+ [worktreeMax, "worktree"],
186
+ ];
187
+ const [maxId, source] = candidates.reduce((a, b) => (b[0] > a[0] ? b : a));
188
+ return { id: maxId + 1, source, warnings };
189
+ }
190
+
191
+ export async function allocateNextRfcId(
192
+ io: WorkspaceIO,
193
+ workspaceRoot: string,
194
+ worktreeMax: number,
195
+ ): Promise<GovernanceIdAllocation> {
196
+ return allocateNextGovernanceId(io, workspaceRoot, "rfc", worktreeMax);
197
+ }
198
+
199
+ export async function allocateNextAdrId(
200
+ io: WorkspaceIO,
201
+ workspaceRoot: string,
202
+ worktreeMax: number,
203
+ ): Promise<GovernanceIdAllocation> {
204
+ return allocateNextGovernanceId(io, workspaceRoot, "adr", worktreeMax);
205
+ }
206
+
207
+ /** Prune a session's own reservations — flow.integrate calls this once its
208
+ * session branch landed; other sessions' entries are untouched. */
209
+ export async function pruneReservationsForSession(
210
+ io: WorkspaceIO,
211
+ cwd: string,
212
+ sessionBranch: string,
213
+ ): Promise<void> {
214
+ try {
215
+ const common = await commonGitDir(io, cwd);
216
+ const file = join(common, RESERVATIONS_RELATIVE);
217
+ const lock = join(common, RESERVATIONS_LOCK_RELATIVE);
218
+ await withFlowLock(
219
+ lock,
220
+ { waitMs: 5_000, staleMs: 30_000 },
221
+ async () => {
222
+ const kept = (await readReservations(common)).filter(
223
+ (e) => e.session !== sessionBranch,
224
+ );
225
+ await writeFile(file, yamlStringify({ reservations: kept }), "utf8");
226
+ },
227
+ io,
228
+ );
229
+ } catch {
230
+ // Prune failure leaves harmless stale entries — never block integrate.
231
+ }
232
+ }
@@ -12,6 +12,7 @@
12
12
  */
13
13
 
14
14
  import { spawn } from "../../src/utils/sync-fs.ts";
15
+ import { resolveSpawnPlan } from "../../src/utils/spawn.ts";
15
16
  import { mkdtempSync, rmSync } from "node:fs";
16
17
  import { tmpdir } from "node:os";
17
18
  import path from "node:path";
@@ -129,9 +130,13 @@ export async function spawnBatchedVitest(
129
130
 
130
131
  let stderrTail = "";
131
132
  const exit = await new Promise<{ exitCode: number | null; timedOut: boolean }>((resolve) => {
132
- const child = spawn("pnpm", args, {
133
+ // pnpm is a .cmd shim on Windows — PATHEXT resolution routes it through
134
+ // cmd.exe; a missing pnpm keeps spawn ENOENT for the caller to classify.
135
+ const plan = resolveSpawnPlan("pnpm", args);
136
+ const child = spawn(plan.command, plan.args, {
133
137
  cwd: workspaceRoot,
134
138
  stdio: ["ignore", "ignore", "pipe"],
139
+ windowsVerbatimArguments: plan.verbatim,
135
140
  });
136
141
  child.stderr?.on("data", (chunk: Buffer) => {
137
142
  stderrTail = (stderrTail + chunk.toString()).slice(-2000);
@@ -7,16 +7,14 @@
7
7
  </non-goals>
8
8
  </MODULE_CONTRACT>
9
9
  <CHANGE_SUMMARY>
10
- <item>RFC-1474: per-rule check-execution counters
11
-
12
- Append-only counters.jsonl journaled per evaluated rule ({runId, ruleId, contract, outcome, at}; runId = commandInvocationId; outcomes pass|diagnostic|skipped|ensured; dry-run suppressed; append failures warn never fail). checks.counters.validate audits the journal against the validator inventory (COUNT-01/02); checks.counters.export projects deterministic per-rule totals (COUNT-03, generatedAt = max journal at; producer-tail tolerated). checks.contribution.report joins counters as the canonical firing source (CONTRIB-03 on absent/empty journal; coverage none|partial|complete; live effectiveCoverage positive). Validator inventory now includes every rules[]-declaring command — fail-closed gate surfaced 9 contract-declaration defects, fixed with domain contracts.</item>
13
- <item>RFC-1474: check-execution counters — apply re-review findings (structural skip flag, violations extraction, Date.parse ordering, DEV-5/6)</item>
14
- <item>RFC-1482: emit validation-compliant RFC skeletons and surface contract breaches at authoring time</item>
15
10
  <item>RFC-1483: self-sufficient implement stamp — default repair pass, ordered remediation checklist, --no-repair</item>
16
11
  <item>RFC-1489: batch test probes through one instrumented Vitest run + frontmatter corpus reads
17
12
 
18
13
  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>
19
- <history>RFC-0260, RFC-0795, RFC-1097, RFC-1173, RFC-1231, RFC-1237, RFC-1249, RFC-1271, RFC-1306, RFC-1322, RFC-1333, RFC-1351, RFC-1354, RFC-1364, RFC-1453, RFC-1458, RFC-1461, RFC-1463, RFC-1467</history>
14
+ <item>RFC-1516: add an evidence-freshness window to the stamp-sync chain for rfc-1516</item>
15
+ <item>RFC-1528: close review findings — manifest-union command inventory for regen/preflight</item>
16
+ <item>RFC-1534: lint probe patterns, sync amends counterparts, name next free ledger id</item>
17
+ <history>RFC-0260, RFC-0795, RFC-1097, RFC-1173, RFC-1231, RFC-1237, RFC-1249, RFC-1271, RFC-1306, RFC-1322, RFC-1333, RFC-1351, RFC-1354, RFC-1364, RFC-1453, RFC-1458, RFC-1461, RFC-1463, RFC-1467, RFC-1474, RFC-1482</history>
20
18
  </CHANGE_SUMMARY>
21
19
  */
22
20
 
@@ -127,6 +125,11 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
127
125
  description:
128
126
  "RFC-1482: comma-separated command names seeded into commands.added; each name gets one `probe: reachable` acceptance stub.",
129
127
  },
128
+ amends: {
129
+ kind: "string",
130
+ description:
131
+ "RFC-1534: RFC-NNNN this draft amends — seeds amends: and writes the amendedBy counterpart on the amended file in the same pass.",
132
+ },
130
133
  },
131
134
  execute: runRfcCreate,
132
135
  },
@@ -154,6 +157,11 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
154
157
  scope: "workspace",
155
158
  flags: {
156
159
  id: { kind: "string", description: "Target a single RFC by id (e.g. RFC-0609)." },
160
+ fix: {
161
+ kind: "boolean",
162
+ description:
163
+ "RFC-1534: repair V-19 amends/amendedBy asymmetries by merging the missing counterpart into the referenced file.",
164
+ },
157
165
  },
158
166
  reads: ["docs/rfcs/**/*.md"],
159
167
  execute: runRfcValidate,
@@ -213,7 +221,14 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
213
221
  },
214
222
  reads: ["docs/rfcs/**/*.md"],
215
223
  writes: ["docs/rfcs/index.yaml"],
216
- generates: [],
224
+ generates: [
225
+ {
226
+ path: "docs/rfcs/index.yaml",
227
+ phase: "on-demand",
228
+ markerPolicy: "registry-only",
229
+ volatile: true,
230
+ },
231
+ ],
217
232
  cacheable: false,
218
233
  execute: runRfcIndexGenerate,
219
234
  },
@@ -351,6 +366,11 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
351
366
  description:
352
367
  "RFC-1489: disable test-probe batching — run each probe in its own Vitest process (diagnostic escape).",
353
368
  },
369
+ "no-evidence-reuse": {
370
+ kind: "boolean",
371
+ description:
372
+ "RFC-1516: disable the evidence-freshness window — every probe (run/test/page/proof and cheap kinds) re-executes even when the committed green envelope is in-window.",
373
+ },
354
374
  },
355
375
  execute: runRfcVerificationEmit,
356
376
  },
@@ -610,6 +630,11 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
610
630
  "RFC-1483: restore the pre-self-repair blocking behavior — no criteria flips, " +
611
631
  "no in-process envelope emit; the first prerequisite defect fails the run.",
612
632
  },
633
+ "no-evidence-reuse": {
634
+ kind: "boolean",
635
+ description:
636
+ "RFC-1516: forwarded to rfc.evidence.sync and the in-process emit calls — every acceptance probe re-executes even inside the evidence-freshness window.",
637
+ },
613
638
  },
614
639
  execute: runRfcImplementStamp,
615
640
  },
@@ -630,7 +655,10 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
630
655
  scope: "workspace",
631
656
  mutatesState: true,
632
657
  contract: "rfc",
633
- rules: [{ id: "EVIDENCE-SYNC-01", severity: "error" }, { id: "EVIDENCE-SYNC-02", severity: "error" }],
658
+ rules: [
659
+ { id: "EVIDENCE-SYNC-01", severity: "error" },
660
+ { id: "EVIDENCE-SYNC-02", severity: "error" },
661
+ ],
634
662
  flags: {
635
663
  id: {
636
664
  kind: "string",
@@ -640,6 +668,11 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
640
668
  kind: "boolean",
641
669
  description: "List the steps without executing (honors context.dryRun, DNA-110).",
642
670
  },
671
+ "no-evidence-reuse": {
672
+ kind: "boolean",
673
+ description:
674
+ "RFC-1516: forward to the emit step — every acceptance probe re-executes even when the committed green envelope is inside the evidence-freshness window.",
675
+ },
643
676
  },
644
677
  reads: ["docs/rfcs/**/*.md"],
645
678
  // The artifacts below stay owned by the delegated generators — sync
package/os/rfc/types.ts CHANGED
@@ -12,12 +12,12 @@
12
12
  * </non-goals>
13
13
  * </MODULE_CONTRACT>
14
14
  * * <CHANGE_SUMMARY>
15
- <item>RFC-1458: emit requirement-mapped verdict events from deploy.smoke.run</item>
16
- <item>RFC-1467: block rfc.create on terminal-kind near-duplicates until --revisit acknowledges + V-52 validate mirror</item>
17
- <item>RFC-1467: address review r1 findings — object-shaped colliding payload, cite all colliding siblings, reviewBand field, supersede.propose escalation, flag-shape guard</item>
18
- <item>RFC-1467: declare supersede.propose escalation fields + repair dead related-injector regex</item>
19
- <item>RFC-1483: self-sufficient implement stamp — default repair pass, ordered remediation checklist, --no-repair</item>
20
- <history>RFC-0465, RFC-0478, RFC-0480, RFC-0795, RFC-0998, RFC-0999, RFC-1097, RFC-1249, RFC-1271, RFC-1306, RFC-1310, RFC-1320, RFC-1322, RFC-1330, RFC-1333, RFC-1334, RFC-1336, RFC-1364, RFC-1383, RFC-1391, RFC-1401, RFC-1445, RFC-1453, RFC-1454, RFC-1455</history>
15
+ <item>RFC-1516: bind evidence reuse to the oldest replayed result and harden committed-envelope reads for rfc-1516</item>
16
+ <item>RFC-1514: attach corrected invocations to blocking diagnostics so retry is one-shot</item>
17
+ <item>RFC-1536: owning-checkout routing, FLOW-OPEN-01 dirty-primary warning, shared governance-id allocation (RFC+ADR)</item>
18
+ <item>RFC-1534: lint probe patterns, sync amends counterparts, name next free ledger id</item>
19
+ <item>RFC-1546: derive-and-repair recoverable state across flow surfaces (AC-1..AC-5)</item>
20
+ <history>RFC-0465, RFC-0478, RFC-0480, RFC-0795, RFC-0998, RFC-0999, RFC-1097, RFC-1249, RFC-1271, RFC-1306, RFC-1310, RFC-1320, RFC-1322, RFC-1330, RFC-1333, RFC-1334, RFC-1336, RFC-1364, RFC-1383, RFC-1391, RFC-1401, RFC-1445, RFC-1453, RFC-1454, RFC-1455, RFC-1458, RFC-1467, RFC-1483, RFC-1516</history>
21
21
  </CHANGE_SUMMARY>
22
22
  ***************************************************************/
23
23
 
@@ -489,6 +489,13 @@ export interface VerificationEvidence {
489
489
  filesModified?: string[];
490
490
  /** RFC-1453: operator waiver recorded when RFC-IMP-14 was bypassed via --waive-outcome. */
491
491
  outcomeWaiver?: { reason: string; by: string };
492
+ /** RFC-1516: freshness anchor — the timestamp the heaviest replayed
493
+ * results were actually measured at (the reused envelope's `resultsFrom`,
494
+ * falling back to its `emittedAt`). Present only on envelopes that
495
+ * replayed committed probe records; `evaluateEvidenceReuse` binds the
496
+ * window to `resultsFrom ?? emittedAt` so chained replays cannot extend
497
+ * result age beyond the window. */
498
+ resultsFrom?: string;
492
499
  }
493
500
 
494
501
  export interface VerificationDelta {
@@ -506,6 +513,12 @@ export interface RfcVerificationEmitResult {
506
513
  file: string;
507
514
  overall: "pass" | "fail";
508
515
  previousOverall?: "pass" | "fail";
516
+ /** RFC-1516: freshness-window verdict — `{reusable, reason, reusedFrom}`
517
+ * (shape declared in rfc-evidence-sync.ts; kept structural here to avoid
518
+ * a types↔handler import cycle). */
519
+ reuse?: { reusable: boolean; reason: string; reusedFrom?: string };
520
+ heavyProbesReused?: string[];
521
+ cheapProbesReRun?: string[];
509
522
  }>;
510
523
  // RFC-1320: "stale-generated-artifact" — EVIDENCE-FRESH-01 blocked the
511
524
  // pre-probe freshness gate; "unknown-probe-kind" — EVIDENCE-FRESH-03, a
@@ -612,6 +625,8 @@ export interface RfcCreateResult {
612
625
  status: "ok" | "blocked";
613
626
  file?: string;
614
627
  id?: string;
628
+ /** RFC-1536: which allocation surface yielded the winning maximum. */
629
+ idSource?: "primary" | "develop" | "reservation" | "worktree";
615
630
  satisfies?: string[];
616
631
  /** RFC-0329: prior decisions consulted at creation time. */
617
632
  consultedDecisions?: ConsultedDecision[];
@@ -623,6 +638,12 @@ export interface RfcCreateResult {
623
638
  blocked?: boolean;
624
639
  /** RFC-1467: the operator-visible remedy for a blocked create. */
625
640
  remedy?: string;
641
+ /** RFC-1534: --amends counterpart outcome — wroteCounterpart false means
642
+ * the amended file was missing/unreadable and V-19 still applies. */
643
+ amendsSync?: { amended: string; wroteCounterpart: boolean };
644
+ /** RFC-1546: ecosystem.manifest.generate outcome when commands.* seeds were
645
+ * written — invoked false means the kernel invoke port was unavailable. */
646
+ manifestRegen?: { invoked: boolean; ok: boolean; summary?: string };
626
647
  }
627
648
 
628
649
  export interface RfcNextIdResult {
@@ -662,6 +683,10 @@ export interface ConsultedDecision {
662
683
  title: string;
663
684
  score: number;
664
685
  file: string;
686
+ /** RFC-1514: proposed-title tokens matched inside this entry's title (+3 each). */
687
+ matchedTitleTokens: string[];
688
+ /** RFC-1514: proposed-title tokens matched inside the decision/alternatives text (+1 each; title hits count too — they also scored the +1). */
689
+ matchedTextTokens: string[];
665
690
  } // ─── RFC-0334: supersede propose ─────────────────────────────────────────────
666
691
  export interface RfcSupersedeProposeResult {
667
692
  command: "rfc.supersede.propose";
@@ -13,6 +13,7 @@ RFC-1320 unit tests for the pre-probe generated-artifact freshness gate inside r
13
13
  <item>RFC-1489: batch test probes through one instrumented Vitest run + frontmatter corpus reads
14
14
 
15
15
  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>
16
+ <item>RFC-1516: add an evidence-freshness window to the stamp-sync chain for rfc-1516</item>
16
17
  </CHANGE_SUMMARY>
17
18
  */
18
19
 
@@ -29,7 +30,10 @@ const { mockRunProbe } = vi.hoisted(() => ({
29
30
  mockRunProbe: vi.fn(),
30
31
  }));
31
32
 
32
- vi.mock("./acceptance.ts", () => ({
33
+ vi.mock("./acceptance.ts", async (importOriginal) => ({
34
+ // RFC-1516: keep classifyProbeReuse (and every non-execution export) real —
35
+ // emit's reuse path calls it when a committed envelope is present.
36
+ ...(await importOriginal<typeof import("./acceptance.ts")>()),
33
37
  runProbe: mockRunProbe,
34
38
  // RFC-1489: emit drives runProbeSet — the shim preserves the per-probe
35
39
  // mock contract so these tests observe the same probe calls as before.
@@ -12,6 +12,7 @@ Unit tests for verification emit covering rfc.verification.emit — baseline emi
12
12
  <item>RFC-1489: batch test probes through one instrumented Vitest run + frontmatter corpus reads
13
13
 
14
14
  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>
15
+ <item>RFC-1516: add an evidence-freshness window to the stamp-sync chain for rfc-1516</item>
15
16
  </CHANGE_SUMMARY>
16
17
  */
17
18
 
@@ -33,7 +34,10 @@ const { mockRunProbe } = vi.hoisted(() => ({
33
34
  mockRunProbe: vi.fn(),
34
35
  }));
35
36
 
36
- vi.mock("./acceptance.ts", () => ({
37
+ vi.mock("./acceptance.ts", async (importOriginal) => ({
38
+ // RFC-1516: keep classifyProbeReuse (and every non-execution export) real —
39
+ // emit's reuse path calls it when a committed envelope is present.
40
+ ...(await importOriginal<typeof import("./acceptance.ts")>()),
37
41
  runProbe: mockRunProbe,
38
42
  // RFC-1489: emit drives runProbeSet — the shim preserves the per-probe
39
43
  // mock contract so these tests observe the same probe calls as before.