@warpgogol/forge 9.1.1 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (539) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/bin/cli.ts +5 -3
  3. package/dist/bin/cli.js +5 -3
  4. package/dist/bin/cli.js.map +1 -1
  5. package/dist/os/adr/handlers/implement-stamp.d.ts +6 -0
  6. package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
  7. package/dist/os/adr/handlers/implement-stamp.js +23 -15
  8. package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
  9. package/dist/os/checks/handlers/counters-journal.d.ts.map +1 -1
  10. package/dist/os/checks/handlers/counters-journal.js +9 -1
  11. package/dist/os/checks/handlers/counters-journal.js.map +1 -1
  12. package/dist/os/core/core.module.d.ts.map +1 -1
  13. package/dist/os/core/core.module.js +32 -39
  14. package/dist/os/core/core.module.js.map +1 -1
  15. package/dist/os/core/lock-holder.d.ts +32 -0
  16. package/dist/os/core/lock-holder.d.ts.map +1 -0
  17. package/dist/os/core/lock-holder.js +81 -0
  18. package/dist/os/core/lock-holder.js.map +1 -0
  19. package/dist/os/core/stamp-lock.d.ts +30 -0
  20. package/dist/os/core/stamp-lock.d.ts.map +1 -0
  21. package/dist/os/core/stamp-lock.js +112 -0
  22. package/dist/os/core/stamp-lock.js.map +1 -0
  23. package/dist/os/flow/branch-name.d.ts +56 -0
  24. package/dist/os/flow/branch-name.d.ts.map +1 -0
  25. package/dist/os/flow/branch-name.js +108 -0
  26. package/dist/os/flow/branch-name.js.map +1 -0
  27. package/dist/os/flow/digest.d.ts +92 -0
  28. package/dist/os/flow/digest.d.ts.map +1 -0
  29. package/dist/os/flow/digest.js +663 -0
  30. package/dist/os/flow/digest.js.map +1 -0
  31. package/dist/os/flow/flow.module.d.ts +3 -0
  32. package/dist/os/flow/flow.module.d.ts.map +1 -0
  33. package/dist/os/flow/flow.module.js +771 -0
  34. package/dist/os/flow/flow.module.js.map +1 -0
  35. package/dist/os/flow/git.d.ts +68 -0
  36. package/dist/os/flow/git.d.ts.map +1 -0
  37. package/dist/os/flow/git.js +257 -0
  38. package/dist/os/flow/git.js.map +1 -0
  39. package/dist/os/flow/guard-files.d.ts +50 -0
  40. package/dist/os/flow/guard-files.d.ts.map +1 -0
  41. package/dist/os/flow/guard-files.js +147 -0
  42. package/dist/os/flow/guard-files.js.map +1 -0
  43. package/dist/os/flow/handlers/flow-backmerge.d.ts +27 -0
  44. package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -0
  45. package/dist/os/flow/handlers/flow-backmerge.js +332 -0
  46. package/dist/os/flow/handlers/flow-backmerge.js.map +1 -0
  47. package/dist/os/flow/handlers/flow-check.d.ts +42 -0
  48. package/dist/os/flow/handlers/flow-check.d.ts.map +1 -0
  49. package/dist/os/flow/handlers/flow-check.js +347 -0
  50. package/dist/os/flow/handlers/flow-check.js.map +1 -0
  51. package/dist/os/flow/handlers/flow-cut.d.ts +71 -0
  52. package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -0
  53. package/dist/os/flow/handlers/flow-cut.js +722 -0
  54. package/dist/os/flow/handlers/flow-cut.js.map +1 -0
  55. package/dist/os/flow/handlers/flow-digest.d.ts +5 -0
  56. package/dist/os/flow/handlers/flow-digest.d.ts.map +1 -0
  57. package/dist/os/flow/handlers/flow-digest.js +116 -0
  58. package/dist/os/flow/handlers/flow-digest.js.map +1 -0
  59. package/dist/os/flow/handlers/flow-discard.d.ts +22 -0
  60. package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -0
  61. package/dist/os/flow/handlers/flow-discard.js +204 -0
  62. package/dist/os/flow/handlers/flow-discard.js.map +1 -0
  63. package/dist/os/flow/handlers/flow-fix.d.ts +47 -0
  64. package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -0
  65. package/dist/os/flow/handlers/flow-fix.js +532 -0
  66. package/dist/os/flow/handlers/flow-fix.js.map +1 -0
  67. package/dist/os/flow/handlers/flow-hold.d.ts +32 -0
  68. package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -0
  69. package/dist/os/flow/handlers/flow-hold.js +359 -0
  70. package/dist/os/flow/handlers/flow-hold.js.map +1 -0
  71. package/dist/os/flow/handlers/flow-install.d.ts +92 -0
  72. package/dist/os/flow/handlers/flow-install.d.ts.map +1 -0
  73. package/dist/os/flow/handlers/flow-install.js +883 -0
  74. package/dist/os/flow/handlers/flow-install.js.map +1 -0
  75. package/dist/os/flow/handlers/flow-integrate.d.ts +35 -0
  76. package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -0
  77. package/dist/os/flow/handlers/flow-integrate.js +436 -0
  78. package/dist/os/flow/handlers/flow-integrate.js.map +1 -0
  79. package/dist/os/flow/handlers/flow-open.d.ts +63 -0
  80. package/dist/os/flow/handlers/flow-open.d.ts.map +1 -0
  81. package/dist/os/flow/handlers/flow-open.js +294 -0
  82. package/dist/os/flow/handlers/flow-open.js.map +1 -0
  83. package/dist/os/flow/handlers/flow-publication-retire.d.ts +17 -0
  84. package/dist/os/flow/handlers/flow-publication-retire.d.ts.map +1 -0
  85. package/dist/os/flow/handlers/flow-publication-retire.js +132 -0
  86. package/dist/os/flow/handlers/flow-publication-retire.js.map +1 -0
  87. package/dist/os/flow/handlers/flow-push.d.ts +29 -0
  88. package/dist/os/flow/handlers/flow-push.d.ts.map +1 -0
  89. package/dist/os/flow/handlers/flow-push.js +397 -0
  90. package/dist/os/flow/handlers/flow-push.js.map +1 -0
  91. package/dist/os/flow/handlers/flow-status.d.ts +65 -0
  92. package/dist/os/flow/handlers/flow-status.d.ts.map +1 -0
  93. package/dist/os/flow/handlers/flow-status.js +193 -0
  94. package/dist/os/flow/handlers/flow-status.js.map +1 -0
  95. package/dist/os/flow/handlers/flow-unhold.d.ts +20 -0
  96. package/dist/os/flow/handlers/flow-unhold.d.ts.map +1 -0
  97. package/dist/os/flow/handlers/flow-unhold.js +158 -0
  98. package/dist/os/flow/handlers/flow-unhold.js.map +1 -0
  99. package/dist/os/flow/handlers/flow-version.d.ts +39 -0
  100. package/dist/os/flow/handlers/flow-version.d.ts.map +1 -0
  101. package/dist/os/flow/handlers/flow-version.js +122 -0
  102. package/dist/os/flow/handlers/flow-version.js.map +1 -0
  103. package/dist/os/flow/index.d.ts +30 -0
  104. package/dist/os/flow/index.d.ts.map +1 -0
  105. package/dist/os/flow/index.js +83 -0
  106. package/dist/os/flow/index.js.map +1 -0
  107. package/dist/os/flow/line-version.d.ts +23 -0
  108. package/dist/os/flow/line-version.d.ts.map +1 -0
  109. package/dist/os/flow/line-version.js +83 -0
  110. package/dist/os/flow/line-version.js.map +1 -0
  111. package/dist/os/flow/locks.d.ts +39 -0
  112. package/dist/os/flow/locks.d.ts.map +1 -0
  113. package/dist/os/flow/locks.js +177 -0
  114. package/dist/os/flow/locks.js.map +1 -0
  115. package/dist/os/flow/markers.d.ts +49 -0
  116. package/dist/os/flow/markers.d.ts.map +1 -0
  117. package/dist/os/flow/markers.js +112 -0
  118. package/dist/os/flow/markers.js.map +1 -0
  119. package/dist/os/flow/publication-order.d.ts +25 -0
  120. package/dist/os/flow/publication-order.d.ts.map +1 -0
  121. package/dist/os/flow/publication-order.js +75 -0
  122. package/dist/os/flow/publication-order.js.map +1 -0
  123. package/dist/os/flow/publish.d.ts +46 -0
  124. package/dist/os/flow/publish.d.ts.map +1 -0
  125. package/dist/os/flow/publish.js +209 -0
  126. package/dist/os/flow/publish.js.map +1 -0
  127. package/dist/os/flow/registry.d.ts +142 -0
  128. package/dist/os/flow/registry.d.ts.map +1 -0
  129. package/dist/os/flow/registry.js +199 -0
  130. package/dist/os/flow/registry.js.map +1 -0
  131. package/dist/os/flow/release-level.d.ts +23 -0
  132. package/dist/os/flow/release-level.d.ts.map +1 -0
  133. package/dist/os/flow/release-level.js +102 -0
  134. package/dist/os/flow/release-level.js.map +1 -0
  135. package/dist/os/flow/release-lines.d.ts +25 -0
  136. package/dist/os/flow/release-lines.d.ts.map +1 -0
  137. package/dist/os/flow/release-lines.js +172 -0
  138. package/dist/os/flow/release-lines.js.map +1 -0
  139. package/dist/os/flow/release-tags.d.ts +73 -0
  140. package/dist/os/flow/release-tags.d.ts.map +1 -0
  141. package/dist/os/flow/release-tags.js +167 -0
  142. package/dist/os/flow/release-tags.js.map +1 -0
  143. package/dist/os/flow/repo-kind.d.ts +41 -0
  144. package/dist/os/flow/repo-kind.d.ts.map +1 -0
  145. package/dist/os/flow/repo-kind.js +92 -0
  146. package/dist/os/flow/repo-kind.js.map +1 -0
  147. package/dist/os/flow/scripts.d.ts +20 -0
  148. package/dist/os/flow/scripts.d.ts.map +1 -0
  149. package/dist/os/flow/scripts.js +50 -0
  150. package/dist/os/flow/scripts.js.map +1 -0
  151. package/dist/os/flow/semver.d.ts +21 -0
  152. package/dist/os/flow/semver.d.ts.map +1 -0
  153. package/dist/os/flow/semver.js +73 -0
  154. package/dist/os/flow/semver.js.map +1 -0
  155. package/dist/os/flow/task-files.d.ts +11 -0
  156. package/dist/os/flow/task-files.d.ts.map +1 -0
  157. package/dist/os/flow/task-files.js +51 -0
  158. package/dist/os/flow/task-files.js.map +1 -0
  159. package/dist/os/flow/tests/helpers.d.ts +55 -0
  160. package/dist/os/flow/tests/helpers.d.ts.map +1 -0
  161. package/dist/os/flow/tests/helpers.js +193 -0
  162. package/dist/os/flow/tests/helpers.js.map +1 -0
  163. package/dist/os/flow/version-files.d.ts +21 -0
  164. package/dist/os/flow/version-files.d.ts.map +1 -0
  165. package/dist/os/flow/version-files.js +94 -0
  166. package/dist/os/flow/version-files.js.map +1 -0
  167. package/dist/os/flow/worktree-path.d.ts +31 -0
  168. package/dist/os/flow/worktree-path.d.ts.map +1 -0
  169. package/dist/os/flow/worktree-path.js +80 -0
  170. package/dist/os/flow/worktree-path.js.map +1 -0
  171. package/dist/os/mission/handlers/archive.d.ts.map +1 -1
  172. package/dist/os/mission/handlers/archive.js +44 -51
  173. package/dist/os/mission/handlers/archive.js.map +1 -1
  174. package/dist/os/mission/lockfile.d.ts +21 -0
  175. package/dist/os/mission/lockfile.d.ts.map +1 -0
  176. package/dist/os/mission/lockfile.js +76 -0
  177. package/dist/os/mission/lockfile.js.map +1 -0
  178. package/dist/os/mission/mission.module.d.ts.map +1 -1
  179. package/dist/os/mission/mission.module.js +2 -1
  180. package/dist/os/mission/mission.module.js.map +1 -1
  181. package/dist/os/program/handlers/seal.d.ts.map +1 -1
  182. package/dist/os/program/handlers/seal.js +1 -1
  183. package/dist/os/program/handlers/seal.js.map +1 -1
  184. package/dist/os/program/handlers/validate.d.ts.map +1 -1
  185. package/dist/os/program/handlers/validate.js +1 -1
  186. package/dist/os/program/handlers/validate.js.map +1 -1
  187. package/dist/os/program/program.module.d.ts.map +1 -1
  188. package/dist/os/program/program.module.js +2 -1
  189. package/dist/os/program/program.module.js.map +1 -1
  190. package/dist/os/program/schemas.d.ts +4 -6
  191. package/dist/os/program/schemas.d.ts.map +1 -1
  192. package/dist/os/program/schemas.js +16 -6
  193. package/dist/os/program/schemas.js.map +1 -1
  194. package/dist/os/program/state.d.ts +0 -1
  195. package/dist/os/program/state.d.ts.map +1 -1
  196. package/dist/os/program/state.js +1 -7
  197. package/dist/os/program/state.js.map +1 -1
  198. package/dist/os/rfc/acceptance.d.ts +21 -0
  199. package/dist/os/rfc/acceptance.d.ts.map +1 -1
  200. package/dist/os/rfc/acceptance.js +62 -13
  201. package/dist/os/rfc/acceptance.js.map +1 -1
  202. package/dist/os/rfc/frontmatter-io.d.ts +19 -0
  203. package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
  204. package/dist/os/rfc/frontmatter-io.js +65 -12
  205. package/dist/os/rfc/frontmatter-io.js.map +1 -1
  206. package/dist/os/rfc/handlers/implement-stamp.d.ts +6 -0
  207. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  208. package/dist/os/rfc/handlers/implement-stamp.js +24 -19
  209. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  210. package/dist/os/rfc/handlers/validate-rules.d.ts +2 -5
  211. package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
  212. package/dist/os/rfc/handlers/validate-rules.js +10 -8
  213. package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
  214. package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
  215. package/dist/os/rfc/handlers/validate.js +15 -5
  216. package/dist/os/rfc/handlers/validate.js.map +1 -1
  217. package/dist/os/rfc/index.d.ts +2 -2
  218. package/dist/os/rfc/index.d.ts.map +1 -1
  219. package/dist/os/rfc/index.js +5 -2
  220. package/dist/os/rfc/index.js.map +1 -1
  221. package/dist/os/rfc/probe-batch.d.ts +71 -0
  222. package/dist/os/rfc/probe-batch.d.ts.map +1 -0
  223. package/dist/os/rfc/probe-batch.js +251 -0
  224. package/dist/os/rfc/probe-batch.js.map +1 -0
  225. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  226. package/dist/os/rfc/rfc.module.js +16 -2
  227. package/dist/os/rfc/rfc.module.js.map +1 -1
  228. package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
  229. package/dist/os/rfc/verification-evidence.js +21 -10
  230. package/dist/os/rfc/verification-evidence.js.map +1 -1
  231. package/dist/os/rfc/verification-refresh.d.ts.map +1 -1
  232. package/dist/os/rfc/verification-refresh.js +20 -13
  233. package/dist/os/rfc/verification-refresh.js.map +1 -1
  234. package/dist/os/system/handlers/outbox-validate.d.ts +8 -0
  235. package/dist/os/system/handlers/outbox-validate.d.ts.map +1 -0
  236. package/dist/os/system/handlers/outbox-validate.js +102 -0
  237. package/dist/os/system/handlers/outbox-validate.js.map +1 -0
  238. package/dist/os/system/handlers/system-map-validate.d.ts +13 -0
  239. package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -0
  240. package/dist/os/system/handlers/system-map-validate.js +78 -0
  241. package/dist/os/system/handlers/system-map-validate.js.map +1 -0
  242. package/dist/os/system/handlers/system-outbox-scan.d.ts +10 -0
  243. package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -0
  244. package/dist/os/system/handlers/system-outbox-scan.js +195 -0
  245. package/dist/os/system/handlers/system-outbox-scan.js.map +1 -0
  246. package/dist/os/system/handlers/system-task-collect.d.ts +13 -0
  247. package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -0
  248. package/dist/os/system/handlers/system-task-collect.js +238 -0
  249. package/dist/os/system/handlers/system-task-collect.js.map +1 -0
  250. package/dist/os/system/handlers/system-task-create.d.ts +32 -0
  251. package/dist/os/system/handlers/system-task-create.d.ts.map +1 -0
  252. package/dist/os/system/handlers/system-task-create.js +216 -0
  253. package/dist/os/system/handlers/system-task-create.js.map +1 -0
  254. package/dist/os/system/handlers/system-task-dispatch.d.ts +14 -0
  255. package/dist/os/system/handlers/system-task-dispatch.d.ts.map +1 -0
  256. package/dist/os/system/handlers/system-task-dispatch.js +290 -0
  257. package/dist/os/system/handlers/system-task-dispatch.js.map +1 -0
  258. package/dist/os/system/handlers/system-task-move.d.ts +12 -0
  259. package/dist/os/system/handlers/system-task-move.d.ts.map +1 -0
  260. package/dist/os/system/handlers/system-task-move.js +217 -0
  261. package/dist/os/system/handlers/system-task-move.js.map +1 -0
  262. package/dist/os/system/handlers/system-task-status.d.ts +20 -0
  263. package/dist/os/system/handlers/system-task-status.d.ts.map +1 -0
  264. package/dist/os/system/handlers/system-task-status.js +139 -0
  265. package/dist/os/system/handlers/system-task-status.js.map +1 -0
  266. package/dist/os/system/handlers/system-versionset-record.d.ts +12 -0
  267. package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -0
  268. package/dist/os/system/handlers/system-versionset-record.js +332 -0
  269. package/dist/os/system/handlers/system-versionset-record.js.map +1 -0
  270. package/dist/os/system/index.d.ts +6 -0
  271. package/dist/os/system/index.d.ts.map +1 -0
  272. package/dist/os/system/index.js +18 -0
  273. package/dist/os/system/index.js.map +1 -0
  274. package/dist/os/system/outbox-schema.d.ts +30 -0
  275. package/dist/os/system/outbox-schema.d.ts.map +1 -0
  276. package/dist/os/system/outbox-schema.js +29 -0
  277. package/dist/os/system/outbox-schema.js.map +1 -0
  278. package/dist/os/system/repo.d.ts +64 -0
  279. package/dist/os/system/repo.d.ts.map +1 -0
  280. package/dist/os/system/repo.js +364 -0
  281. package/dist/os/system/repo.js.map +1 -0
  282. package/dist/os/system/scenario-schemas.d.ts +26 -0
  283. package/dist/os/system/scenario-schemas.d.ts.map +1 -0
  284. package/dist/os/system/scenario-schemas.js +53 -0
  285. package/dist/os/system/scenario-schemas.js.map +1 -0
  286. package/dist/os/system/schemas.d.ts +63 -0
  287. package/dist/os/system/schemas.d.ts.map +1 -0
  288. package/dist/os/system/schemas.js +83 -0
  289. package/dist/os/system/schemas.js.map +1 -0
  290. package/dist/os/system/system.module.d.ts +3 -0
  291. package/dist/os/system/system.module.d.ts.map +1 -0
  292. package/dist/os/system/system.module.js +429 -0
  293. package/dist/os/system/system.module.js.map +1 -0
  294. package/dist/os/system/task-schemas.d.ts +108 -0
  295. package/dist/os/system/task-schemas.d.ts.map +1 -0
  296. package/dist/os/system/task-schemas.js +152 -0
  297. package/dist/os/system/task-schemas.js.map +1 -0
  298. package/dist/os/system/task-store.d.ts +41 -0
  299. package/dist/os/system/task-store.d.ts.map +1 -0
  300. package/dist/os/system/task-store.js +142 -0
  301. package/dist/os/system/task-store.js.map +1 -0
  302. package/dist/os/system/tests/helpers.d.ts +30 -0
  303. package/dist/os/system/tests/helpers.d.ts.map +1 -0
  304. package/dist/os/system/tests/helpers.js +178 -0
  305. package/dist/os/system/tests/helpers.js.map +1 -0
  306. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.d.ts.map +1 -1
  307. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js +21 -7
  308. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js.map +1 -1
  309. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts.map +1 -1
  310. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js +1 -1
  311. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js.map +1 -1
  312. package/dist/os/werkstatt/werkstatt.module.d.ts.map +1 -1
  313. package/dist/os/werkstatt/werkstatt.module.js +2 -82
  314. package/dist/os/werkstatt/werkstatt.module.js.map +1 -1
  315. package/dist/src/config/forge-config.d.ts +0 -3
  316. package/dist/src/config/forge-config.d.ts.map +1 -1
  317. package/dist/src/config/forge-config.js +2 -4
  318. package/dist/src/config/forge-config.js.map +1 -1
  319. package/dist/src/index.d.ts +6 -0
  320. package/dist/src/index.d.ts.map +1 -1
  321. package/dist/src/index.js +7 -4
  322. package/dist/src/index.js.map +1 -1
  323. package/dist/src/onboarding/agents-generate.d.ts.map +1 -1
  324. package/dist/src/onboarding/agents-generate.js +49 -4
  325. package/dist/src/onboarding/agents-generate.js.map +1 -1
  326. package/dist/src/onboarding/create.d.ts +13 -0
  327. package/dist/src/onboarding/create.d.ts.map +1 -1
  328. package/dist/src/onboarding/create.js +95 -9
  329. package/dist/src/onboarding/create.js.map +1 -1
  330. package/dist/src/onboarding/doctor.d.ts.map +1 -1
  331. package/dist/src/onboarding/doctor.js +2 -47
  332. package/dist/src/onboarding/doctor.js.map +1 -1
  333. package/dist/src/onboarding/upgrade.d.ts +5 -0
  334. package/dist/src/onboarding/upgrade.d.ts.map +1 -1
  335. package/dist/src/onboarding/upgrade.js +70 -1
  336. package/dist/src/onboarding/upgrade.js.map +1 -1
  337. package/dist/src/types.d.ts +9 -0
  338. package/dist/src/types.d.ts.map +1 -1
  339. package/dist/src/types.js +2 -2
  340. package/docs/branch-model.md +98 -0
  341. package/docs/maintainers/publishing.md +10 -8
  342. package/docs/reference/cli.md +0 -3
  343. package/os/adr/handlers/implement-stamp-lock.test.ts +90 -0
  344. package/os/adr/handlers/implement-stamp.ts +29 -20
  345. package/os/checks/handlers/counters-journal.test.ts +10 -0
  346. package/os/checks/handlers/counters-journal.ts +8 -1
  347. package/os/core/core.module.ts +38 -39
  348. package/os/core/lock-holder.ts +88 -0
  349. package/os/core/stamp-lock.ts +142 -0
  350. package/os/flow/assets/flow-guard.sh +176 -0
  351. package/os/flow/branch-name.ts +139 -0
  352. package/os/flow/digest.ts +803 -0
  353. package/os/flow/flow.module.ts +796 -0
  354. package/os/flow/git.ts +342 -0
  355. package/os/flow/guard-files.ts +172 -0
  356. package/os/flow/handlers/flow-backmerge.ts +488 -0
  357. package/os/flow/handlers/flow-check.ts +450 -0
  358. package/os/flow/handlers/flow-cut.ts +1025 -0
  359. package/os/flow/handlers/flow-digest.ts +130 -0
  360. package/os/flow/handlers/flow-discard.ts +310 -0
  361. package/os/flow/handlers/flow-fix.ts +703 -0
  362. package/os/flow/handlers/flow-hold.ts +500 -0
  363. package/os/flow/handlers/flow-install.ts +1185 -0
  364. package/os/flow/handlers/flow-integrate.ts +623 -0
  365. package/os/flow/handlers/flow-open.ts +447 -0
  366. package/os/flow/handlers/flow-publication-retire.ts +156 -0
  367. package/os/flow/handlers/flow-push.ts +488 -0
  368. package/os/flow/handlers/flow-status.ts +283 -0
  369. package/os/flow/handlers/flow-unhold.ts +220 -0
  370. package/os/flow/handlers/flow-version.ts +196 -0
  371. package/os/flow/index.ts +102 -0
  372. package/os/flow/line-version.ts +113 -0
  373. package/os/flow/locks.ts +227 -0
  374. package/os/flow/markers.ts +135 -0
  375. package/os/flow/publication-order.ts +99 -0
  376. package/os/flow/publish.ts +272 -0
  377. package/os/flow/registry.ts +269 -0
  378. package/os/flow/release-level.ts +139 -0
  379. package/os/flow/release-lines.ts +208 -0
  380. package/os/flow/release-tags.ts +232 -0
  381. package/os/flow/repo-kind.ts +117 -0
  382. package/os/flow/scripts.ts +75 -0
  383. package/os/flow/semver.ts +82 -0
  384. package/os/flow/task-files.ts +59 -0
  385. package/os/flow/tests/branch-name.test.ts +136 -0
  386. package/os/flow/tests/fixtures/branch-names.yaml +56 -0
  387. package/os/flow/tests/flow-backmerge.test.ts +267 -0
  388. package/os/flow/tests/flow-check-version.test.ts +138 -0
  389. package/os/flow/tests/flow-check.test.ts +213 -0
  390. package/os/flow/tests/flow-cut-prepare.test.ts +298 -0
  391. package/os/flow/tests/flow-cut.rerun.test.ts +95 -0
  392. package/os/flow/tests/flow-cut.test.ts +323 -0
  393. package/os/flow/tests/flow-digest.test.ts +313 -0
  394. package/os/flow/tests/flow-discard.test.ts +220 -0
  395. package/os/flow/tests/flow-fix.test.ts +359 -0
  396. package/os/flow/tests/flow-guard-merge.test.ts +100 -0
  397. package/os/flow/tests/flow-guard-parity.test.ts +115 -0
  398. package/os/flow/tests/flow-guard-push.test.ts +100 -0
  399. package/os/flow/tests/flow-guard.test.ts +135 -0
  400. package/os/flow/tests/flow-hold.test.ts +465 -0
  401. package/os/flow/tests/flow-install-baseline.rerun.test.ts +73 -0
  402. package/os/flow/tests/flow-install-baseline.test.ts +164 -0
  403. package/os/flow/tests/flow-install-markers.test.ts +161 -0
  404. package/os/flow/tests/flow-install.rerun.test.ts +212 -0
  405. package/os/flow/tests/flow-install.test.ts +330 -0
  406. package/os/flow/tests/flow-integrate.rerun.test.ts +92 -0
  407. package/os/flow/tests/flow-integrate.test.ts +229 -0
  408. package/os/flow/tests/flow-open.test.ts +200 -0
  409. package/os/flow/tests/flow-publication-retire.test.ts +191 -0
  410. package/os/flow/tests/flow-push-publish.test.ts +282 -0
  411. package/os/flow/tests/flow-push-supersede.test.ts +221 -0
  412. package/os/flow/tests/flow-push.test.ts +160 -0
  413. package/os/flow/tests/flow-stale.test.ts +136 -0
  414. package/os/flow/tests/flow-status.test.ts +93 -0
  415. package/os/flow/tests/flow-task-files.test.ts +59 -0
  416. package/os/flow/tests/flow-version-level.test.ts +116 -0
  417. package/os/flow/tests/flow-version.test.ts +169 -0
  418. package/os/flow/tests/helpers.ts +239 -0
  419. package/os/flow/tests/is-flow-adopted.test.ts +71 -0
  420. package/os/flow/tests/locks.test.ts +219 -0
  421. package/os/flow/tests/publication-order.test.ts +102 -0
  422. package/os/flow/tests/registry.test.ts +150 -0
  423. package/os/flow/tests/repository-line-version.test.ts +100 -0
  424. package/os/flow/tests/scripts.test.ts +97 -0
  425. package/os/flow/tests/state-roots.test.ts +127 -0
  426. package/os/flow/tests/version-files.test.ts +145 -0
  427. package/os/flow/version-files.ts +115 -0
  428. package/os/flow/worktree-path.ts +107 -0
  429. package/os/mission/handlers/archive.test.ts +108 -36
  430. package/os/mission/handlers/archive.ts +46 -51
  431. package/os/mission/lockfile.ts +84 -0
  432. package/os/mission/mission.module.ts +2 -1
  433. package/os/program/handlers/seal.ts +1 -1
  434. package/os/program/handlers/validate.ts +1 -1
  435. package/os/program/program.module.ts +2 -1
  436. package/os/program/schemas.ts +51 -34
  437. package/os/program/state.ts +1 -9
  438. package/os/rfc/acceptance.ts +84 -19
  439. package/os/rfc/frontmatter-io.ts +78 -12
  440. package/os/rfc/handlers/implement-stamp-lock.test.ts +133 -0
  441. package/os/rfc/handlers/implement-stamp-stale.test.ts +22 -0
  442. package/os/rfc/handlers/implement-stamp.ts +30 -24
  443. package/os/rfc/handlers/validate-rules.test.ts +9 -6
  444. package/os/rfc/handlers/validate-rules.ts +12 -10
  445. package/os/rfc/handlers/validate.ts +17 -5
  446. package/os/rfc/index.ts +13 -1
  447. package/os/rfc/probe-batch.ts +329 -0
  448. package/os/rfc/rfc.module.ts +19 -2
  449. package/os/rfc/verification-emit-check.test.ts +22 -0
  450. package/os/rfc/verification-emit-freshness.test.ts +22 -0
  451. package/os/rfc/verification-emit.test.ts +22 -0
  452. package/os/rfc/verification-evidence.ts +21 -16
  453. package/os/rfc/verification-refresh.test.ts +22 -0
  454. package/os/rfc/verification-refresh.ts +20 -18
  455. package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +9 -0
  456. package/os/system/handlers/outbox-validate.ts +120 -0
  457. package/os/system/handlers/system-map-validate.ts +107 -0
  458. package/os/system/handlers/system-outbox-scan.ts +320 -0
  459. package/os/system/handlers/system-task-collect.ts +305 -0
  460. package/os/system/handlers/system-task-create.ts +271 -0
  461. package/os/system/handlers/system-task-dispatch.ts +387 -0
  462. package/os/system/handlers/system-task-move.ts +353 -0
  463. package/os/system/handlers/system-task-status.ts +176 -0
  464. package/os/system/handlers/system-versionset-record.ts +476 -0
  465. package/os/system/index.ts +47 -0
  466. package/os/system/outbox-schema.ts +47 -0
  467. package/os/system/repo.ts +451 -0
  468. package/os/system/scenario-schemas.ts +62 -0
  469. package/os/system/schemas.ts +102 -0
  470. package/os/system/system.module.ts +449 -0
  471. package/os/system/task-schemas.ts +190 -0
  472. package/os/system/task-store.ts +184 -0
  473. package/os/system/tests/helpers.ts +189 -0
  474. package/os/system/tests/outbox-validate.test.ts +92 -0
  475. package/os/system/tests/system-map-validate.test.ts +321 -0
  476. package/os/system/tests/system-outbox-scan.test.ts +273 -0
  477. package/os/system/tests/system-profile.test.ts +90 -0
  478. package/os/system/tests/system-task-collect.test.ts +293 -0
  479. package/os/system/tests/system-task-dispatch.test.ts +279 -0
  480. package/os/system/tests/system-task-status.test.ts +153 -0
  481. package/os/system/tests/system-task.test.ts +330 -0
  482. package/os/system/tests/system-versionset.test.ts +314 -0
  483. package/os/werkstatt/handlers/werkstatt-lock-recover.ts +22 -5
  484. package/os/werkstatt/handlers/werkstatt-operation-validate.ts +1 -1
  485. package/os/werkstatt/werkstatt.module.ts +2 -85
  486. package/package.json +49 -1
  487. package/profiles/forge-shell.yaml +22 -10
  488. package/profiles/godot-game.yaml +24 -13
  489. package/profiles/knowledge.yaml +19 -0
  490. package/profiles/phaser-game.yaml +25 -13
  491. package/profiles/site-workshop.yaml +27 -10
  492. package/profiles/system.yaml +650 -0
  493. package/profiles/typescript.yaml +26 -9
  494. package/skills/fo/fo-outbox/SKILL.md +71 -0
  495. package/skills/fo/fo-session-retro/SKILL.md +18 -7
  496. package/skills/fo/fo-step-commit/SKILL.md +2 -1
  497. package/skills/fo/fo-system-dispatch/SKILL.md +65 -0
  498. package/skills/fo/fo-task-run/SKILL.md +75 -0
  499. package/src/config/forge-config.ts +2 -6
  500. package/src/index.ts +19 -4
  501. package/src/onboarding/agents-generate.ts +49 -5
  502. package/src/onboarding/create.ts +101 -9
  503. package/src/onboarding/doctor.ts +2 -51
  504. package/src/onboarding/upgrade.ts +86 -1
  505. package/src/tests/agents-generate-flow.test.ts +132 -0
  506. package/src/tests/create-flow.test.ts +114 -0
  507. package/src/tests/create.test.ts +22 -21
  508. package/src/tests/doctor-autonomy.test.ts +2 -1
  509. package/src/tests/fixtures/agents-generate-business-before.txt +6 -0
  510. package/src/tests/implement-stamp.test.ts +26 -3
  511. package/src/tests/profile-flow-hooks.test.ts +77 -0
  512. package/src/tests/profile-schema.test.ts +2 -1
  513. package/src/tests/program-schemas.test.ts +66 -6
  514. package/src/tests/program-spec-node.test.ts +1 -5
  515. package/src/tests/rfc-evidence-sync.test.ts +22 -0
  516. package/src/tests/rfc-implement-stamp-governance.test.ts +25 -1
  517. package/src/tests/rfc-verification-verdict-ingest.test.ts +22 -0
  518. package/src/tests/upgrade-flow.test.ts +174 -0
  519. package/src/types.ts +11 -2
  520. package/dist/os/werkstatt/handlers/session-close.d.ts +0 -13
  521. package/dist/os/werkstatt/handlers/session-close.d.ts.map +0 -1
  522. package/dist/os/werkstatt/handlers/session-close.js +0 -56
  523. package/dist/os/werkstatt/handlers/session-close.js.map +0 -1
  524. package/dist/os/werkstatt/handlers/session-engine.d.ts +0 -3
  525. package/dist/os/werkstatt/handlers/session-engine.d.ts.map +0 -1
  526. package/dist/os/werkstatt/handlers/session-engine.js +0 -28
  527. package/dist/os/werkstatt/handlers/session-engine.js.map +0 -1
  528. package/dist/os/werkstatt/handlers/session-open.d.ts +0 -10
  529. package/dist/os/werkstatt/handlers/session-open.d.ts.map +0 -1
  530. package/dist/os/werkstatt/handlers/session-open.js +0 -46
  531. package/dist/os/werkstatt/handlers/session-open.js.map +0 -1
  532. package/dist/os/werkstatt/handlers/session-status.d.ts +0 -9
  533. package/dist/os/werkstatt/handlers/session-status.d.ts.map +0 -1
  534. package/dist/os/werkstatt/handlers/session-status.js +0 -34
  535. package/dist/os/werkstatt/handlers/session-status.js.map +0 -1
  536. package/os/werkstatt/handlers/session-close.ts +0 -82
  537. package/os/werkstatt/handlers/session-engine.ts +0 -34
  538. package/os/werkstatt/handlers/session-open.ts +0 -68
  539. package/os/werkstatt/handlers/session-status.ts +0 -55
@@ -0,0 +1,75 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>Pure pending-publication selection for flow.digest and flow.push
4
+ (RFC-1503): per package line, group the candidate tags, drop retired tags,
5
+ supersede candidates at or below the newest published version on sight
6
+ (by = that tag), and of the remainder attempt only the highest version
7
+ (lower ones are superseded-by-null until the highest publishes). Ordering
8
+ is semver-strict — 9.10.0 outranks 9.9.0.</purpose>
9
+ <non-goals>
10
+ <item>No git or journal access — callers pass parsed tags and the
11
+ published/retired tag sets.</item>
12
+ </non-goals>
13
+ </MODULE_CONTRACT>
14
+ <CHANGE_SUMMARY>
15
+ <item>RFC-1503: step 2 — planPublications pure selection</item>
16
+ <item>RFC-1503: steps 1-5 — highest-per-line pending selection, publish-superseded/publish-retired journal events, flow.publication.retire</item>
17
+ </CHANGE_SUMMARY>
18
+ */
19
+ import { compareVersions } from "./semver.js";
20
+ /**
21
+ * Partition `candidates` into the tags the next push attempts and the ones it
22
+ * supersedes. `published` carries every tag with a `publish` journal event;
23
+ * `retired` every tag with a `publish-retired` event. `versionOf` parses a
24
+ * tag's version for a line (null when the tag does not match the line's
25
+ * prefix or its suffix is not strict semver) — such tags stay out of both
26
+ * lists, so callers surface them through the baseline/pending paths they
27
+ * already own.
28
+ */
29
+ export function planPublications(candidates, published, retired, versionOf) {
30
+ const attempt = [];
31
+ const superseded = [];
32
+ const byLine = new Map();
33
+ for (const c of candidates) {
34
+ if (published.has(c.tag) || retired.has(c.tag))
35
+ continue;
36
+ const list = byLine.get(c.line) ?? [];
37
+ list.push(c);
38
+ byLine.set(c.line, list);
39
+ }
40
+ for (const [line, list] of byLine) {
41
+ // Newest published version of this line — the "superseded on sight" bar.
42
+ let bar = null;
43
+ let barTag = null;
44
+ for (const tag of published) {
45
+ const v = versionOf(tag, line);
46
+ if (v !== null && (bar === null || compareVersions(v, bar) > 0)) {
47
+ bar = v;
48
+ barTag = tag;
49
+ }
50
+ }
51
+ const parsed = [];
52
+ for (const entry of list) {
53
+ const v = versionOf(entry.tag, line);
54
+ if (v === null)
55
+ continue;
56
+ if (bar !== null && compareVersions(v, bar) <= 0) {
57
+ superseded.push({ ...entry, by: barTag });
58
+ continue;
59
+ }
60
+ parsed.push({ entry, version: v });
61
+ }
62
+ if (parsed.length === 0)
63
+ continue;
64
+ parsed.sort((a, b) => compareVersions(b.version, a.version));
65
+ attempt.push(parsed[0].entry);
66
+ for (const lower of parsed.slice(1)) {
67
+ superseded.push({ ...lower.entry, by: null });
68
+ }
69
+ }
70
+ const entrySort = (a, b) => a.line === b.line ? a.tag.localeCompare(b.tag) : a.line.localeCompare(b.line);
71
+ attempt.sort(entrySort);
72
+ superseded.sort(entrySort);
73
+ return { attempt, superseded };
74
+ }
75
+ //# sourceMappingURL=publication-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publication-order.js","sourceRoot":"","sources":["../../../os/flow/publication-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,EAAE,eAAe,EAAe,MAAM,aAAa,CAAC;AAkB3D;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAAkC,EAClC,SAA8B,EAC9B,OAA4B,EAC5B,SAAuD;IAEvD,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,MAAM,UAAU,GAAsB,EAAE,CAAC;IAEzC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkC,CAAC;IACzD,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;YAAE,SAAS;QACzD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,C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S;QAClC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC,CAAC;QAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACpC,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,CAAC,CAAuB,EAAE,CAAuB,EAAE,EAAE,CACrE,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAChF,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxB,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3B,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { WorkspaceIO } from "../../src/types.ts";
2
+ import { type FlowScriptResult } from "./scripts.ts";
3
+ import type { ReleaseLine } from "./release-lines.ts";
4
+ export interface PublicationRow {
5
+ tag: string;
6
+ line: string;
7
+ status: "published" | "failed" | "skipped-baseline" | "pending";
8
+ dest: string | null;
9
+ verify: FlowScriptResult | null;
10
+ reconciled: boolean;
11
+ destHead: string | null;
12
+ /** FLOW-PUSH-05 detail when status === "failed". */
13
+ error?: string;
14
+ }
15
+ /** `destBase`/`destName` from extract.config.yaml, anchored at dirname(primary) (resolveDest parity). */
16
+ export declare function resolveExtractDest(primary: string, io: WorkspaceIO, line: ReleaseLine): Promise<string | null>;
17
+ /** The annotation's `level:` field — baseline tags are never published. */
18
+ export declare function tagAnnotationLevel(repoRoot: string, io: WorkspaceIO, tag: string): Promise<string | null>;
19
+ /**
20
+ * Publish one package-line tag: extract at the tag ref, verify via the hook,
21
+ * push the destination. A non-fast-forward rejection reconciles once with
22
+ * fetch + ours-merge (local tree is the authoritative export), never force.
23
+ */
24
+ export declare function publishTag(primary: string, io: WorkspaceIO, opts: {
25
+ line: ReleaseLine;
26
+ tag: string;
27
+ }): Promise<PublicationRow>;
28
+ export interface LineVerifyResult {
29
+ ok: boolean;
30
+ /** True when the line carries no extract.config.yaml — nothing to verify. */
31
+ skipped: boolean;
32
+ /** FLOW-CUT-13 detail when ok === false. */
33
+ detail: string;
34
+ }
35
+ /**
36
+ * Pre-tag extract verification (RFC-1502): extract the line at `ref` into a
37
+ * scratch directory under os.tmpdir() — `--dest` redirects the output, the
38
+ * configured destination is never written — then run the extract-verify
39
+ * hook against the scratch. The scratch is always removed. A line without
40
+ * an extract.config.yaml is skipped (nothing publishable to verify).
41
+ */
42
+ export declare function verifyLineAtRef(primary: string, io: WorkspaceIO, opts: {
43
+ line: ReleaseLine;
44
+ ref: string;
45
+ }): Promise<LineVerifyResult>;
46
+ //# sourceMappingURL=publish.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../os/flow/publish.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,GAAG,QAA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the package line's extract repo at the tag, run the
5
+ extract-verify hook, push the destination once — reconciling with a single
6
+ ours-merge only on a non-fast-forward rejection, never force-pushing —
7
+ and return the RFC publications[] row for the journal.</purpose>
8
+ <non-goals>
9
+ <item>No push orchestration — handlers/flow-push.ts owns preflight and the atomic push.</item>
10
+ <item>No real repo-extract in tests — fixtures install a fake node_modules/.bin/repo-extract.</item>
11
+ </non-goals>
12
+ </MODULE_CONTRACT>
13
+ <KEY_DECISIONS>
14
+ <item>Destination resolution mirrors the retired publish-forge.mjs (RFC-1499) resolveDest(): destBase/destName parsed from extract.config.yaml, anchored at dirname(primary), destBase default "packages".</item>
15
+ <item>Reconcile only on non-fast-forward (the same regex as the retired publish-forge.mjs, RFC-1499) — auth, hook and transient failures never trigger an ours-merge.</item>
16
+ <item>verifyLineAtRef (RFC-1502) extracts into an mkdtemp scratch via `--dest` — the configured destination is never touched — and a spawn failure of the repo-extract binary reports as a verification failure, not a crash.</item>
17
+ </KEY_DECISIONS>
18
+ <CHANGE_SUMMARY>
19
+ <item>RFC-1491: independent-review pass — shared lock constants, publishable pending filter, declared rules, hold ordering, sha-pinned refspecs</item>
20
+ <item>RFC-1499: step 2 — retire publish-forge/bump-forge scripts, add extract-verify hook</item>
21
+ <item>RFC-1502: steps 1-5 — release-prepare hook, pre-tag extract verification, ordered steps</item>
22
+ <item>RFC-1502: step 7 — remediation entries, docs, deviations, generated indexes</item>
23
+ <item>RFC-1502: review r1 — fix-cut rollback on FLOW-CUT-12/13, populated steps[], hook validation, GIT_* env scrub</item>
24
+ <history>RFC-1491</history>
25
+ </CHANGE_SUMMARY>
26
+ */
27
+ import { mkdtemp, rm } from "node:fs/promises";
28
+ import { tmpdir } from "node:os";
29
+ import { dirname, join, resolve } from "node:path";
30
+ import { git, gitCommit } from "./git.js";
31
+ import { runFlowScript } from "./scripts.js";
32
+ /** `destBase`/`destName` from extract.config.yaml, anchored at dirname(primary) (resolveDest parity). */
33
+ export async function resolveExtractDest(primary, io, line) {
34
+ const dir = line.paths[0];
35
+ if (dir === undefined)
36
+ return null;
37
+ const configPath = join(primary, dir, "extract.config.yaml");
38
+ if (!(await io.exists(configPath)))
39
+ return null;
40
+ const raw = await io.readFile(configPath);
41
+ const unquote = (v) => v?.replace(/^["']|["']$/g, "");
42
+ const destBase = unquote(raw.match(/^destBase:\s*(\S+)\s*$/m)?.[1]);
43
+ const destName = unquote(raw.match(/^destName:\s*(\S+)\s*$/m)?.[1]);
44
+ if (destName === undefined)
45
+ return null;
46
+ return resolve(dirname(primary), destBase ?? "packages", destName);
47
+ }
48
+ /** The annotation's `level:` field — baseline tags are never published. */
49
+ export async function tagAnnotationLevel(repoRoot, io, tag) {
50
+ const result = await git(repoRoot, io, [
51
+ "for-each-ref",
52
+ `refs/tags/${tag}`,
53
+ "--format=%(contents)",
54
+ ]);
55
+ if (result.exitCode !== 0)
56
+ return null;
57
+ return result.stdout.match(/^level:\s*(\S+)\s*$/m)?.[1] ?? null;
58
+ }
59
+ /**
60
+ * Publish one package-line tag: extract at the tag ref, verify via the hook,
61
+ * push the destination. A non-fast-forward rejection reconciles once with
62
+ * fetch + ours-merge (local tree is the authoritative export), never force.
63
+ */
64
+ export async function publishTag(primary, io, opts) {
65
+ const { line, tag } = opts;
66
+ const row = {
67
+ tag,
68
+ line: line.id,
69
+ status: "published",
70
+ dest: null,
71
+ verify: null,
72
+ reconciled: false,
73
+ destHead: null,
74
+ };
75
+ const dir = line.paths[0];
76
+ if (dir === undefined) {
77
+ row.status = "failed";
78
+ row.error = `line ${line.id} has no package directory`;
79
+ return row;
80
+ }
81
+ const level = await tagAnnotationLevel(primary, io, tag);
82
+ if (level === "baseline") {
83
+ row.status = "skipped-baseline";
84
+ return row;
85
+ }
86
+ // 1. Extract — the binary lives in the adopting repository's own install.
87
+ const extract = await io.exec(join(primary, "node_modules", ".bin", "repo-extract"), ["--config", `${dir}/extract.config.yaml`, "--ref", tag, "--no-push"], { cwd: primary });
88
+ if (extract.exitCode !== 0) {
89
+ row.status = "failed";
90
+ row.error = `repo-extract failed (exit ${extract.exitCode}): ${extract.stderr.trim().split("\n").slice(-1)[0] ?? ""}`;
91
+ return row;
92
+ }
93
+ // 2. Destination — same resolution as the retired publish-forge.mjs (RFC-1499).
94
+ const dest = await resolveExtractDest(primary, io, line);
95
+ row.dest = dest;
96
+ if (dest === null || !(await io.exists(join(dest, ".git")))) {
97
+ row.status = "failed";
98
+ row.error = `extract destination could not be resolved for ${tag} (destName in ${dir}/extract.config.yaml)`;
99
+ return row;
100
+ }
101
+ // 3. Verify hook — absent script reports skipped, a failure stops here.
102
+ const verify = await runFlowScript(io, "extract-verify", {
103
+ primary,
104
+ cwd: primary,
105
+ env: {
106
+ FORGE_FLOW_EXTRACT_DEST: dest,
107
+ FORGE_FLOW_TAG: tag,
108
+ FORGE_FLOW_LINE: line.id,
109
+ },
110
+ });
111
+ row.verify = verify;
112
+ if (verify.status === "failed") {
113
+ row.status = "failed";
114
+ row.error = `extract-verify failed (exit ${verify.exitCode}): ${verify.stderrTail}`;
115
+ return row;
116
+ }
117
+ // 4. Push the extract destination — `branch --show-current` first, the
118
+ // rev-parse fallback keeps a detached export HEAD pushable.
119
+ const branchShown = await git(dest, io, ["branch", "--show-current"]);
120
+ const branch = branchShown.stdout.trim() ||
121
+ (await git(dest, io, ["rev-parse", "--abbrev-ref", "HEAD"])).stdout.trim();
122
+ const firstPush = await git(dest, io, ["push", "-u", "origin", branch]);
123
+ if (firstPush.exitCode !== 0) {
124
+ const out = `${firstPush.stdout}\n${firstPush.stderr}`;
125
+ if (!/non-fast-forward|\(fetch first\)/i.test(out)) {
126
+ row.status = "failed";
127
+ row.error = `destination push failed: ${out.trim().split("\n").slice(-1)[0] ?? ""}`;
128
+ return row;
129
+ }
130
+ // Reconcile once — the exported tree is authoritative; remote history
131
+ // is preserved. Never force-push.
132
+ row.reconciled = true;
133
+ await git(dest, io, ["fetch", "origin"]);
134
+ const merge = await gitCommit(dest, io, [
135
+ "merge",
136
+ "-s",
137
+ "ours",
138
+ "--allow-unrelated-histories",
139
+ "-m",
140
+ "merge: reconcile remote export history (local tree is authoritative export)",
141
+ `origin/${branch}`,
142
+ ], "publish");
143
+ if (merge.exitCode !== 0) {
144
+ row.status = "failed";
145
+ row.error = `reconcile merge failed: ${merge.stderr.trim().split("\n").slice(-1)[0] ?? ""}`;
146
+ return row;
147
+ }
148
+ const retry = await git(dest, io, ["push", "-u", "origin", branch]);
149
+ if (retry.exitCode !== 0) {
150
+ row.status = "failed";
151
+ row.error = `destination push failed after reconcile: ${retry.stderr.trim().split("\n").slice(-1)[0] ?? ""}`;
152
+ return row;
153
+ }
154
+ }
155
+ row.destHead = (await git(dest, io, ["rev-parse", "HEAD"])).stdout.trim();
156
+ return row;
157
+ }
158
+ /**
159
+ * Pre-tag extract verification (RFC-1502): extract the line at `ref` into a
160
+ * scratch directory under os.tmpdir() — `--dest` redirects the output, the
161
+ * configured destination is never written — then run the extract-verify
162
+ * hook against the scratch. The scratch is always removed. A line without
163
+ * an extract.config.yaml is skipped (nothing publishable to verify).
164
+ */
165
+ export async function verifyLineAtRef(primary, io, opts) {
166
+ const { line, ref } = opts;
167
+ const dir = line.paths[0];
168
+ if (dir === undefined || !(await io.exists(join(primary, dir, "extract.config.yaml")))) {
169
+ return { ok: true, skipped: true, detail: "" };
170
+ }
171
+ const scratch = await mkdtemp(join(tmpdir(), "flow-extract-"));
172
+ try {
173
+ const extractBin = join(primary, "node_modules", ".bin", "repo-extract");
174
+ let extract;
175
+ try {
176
+ extract = await io.exec(extractBin, ["--config", `${dir}/extract.config.yaml`, "--ref", ref, "--dest", scratch, "--no-push"], { cwd: primary });
177
+ }
178
+ catch (error) {
179
+ return {
180
+ ok: false,
181
+ skipped: false,
182
+ detail: `repo-extract could not run at ${extractBin}: ${error instanceof Error ? error.message : String(error)}`,
183
+ };
184
+ }
185
+ if (extract.exitCode !== 0) {
186
+ const last = extract.stderr.trim().split("\n").filter((l) => l.length > 0).slice(-1)[0] ?? "";
187
+ return { ok: false, skipped: false, detail: `repo-extract failed (exit ${extract.exitCode}): ${last}` };
188
+ }
189
+ const verify = await runFlowScript(io, "extract-verify", {
190
+ primary,
191
+ cwd: primary,
192
+ env: {
193
+ FORGE_FLOW_EXTRACT_DEST: scratch,
194
+ FORGE_FLOW_REF: ref,
195
+ FORGE_FLOW_LINE: line.id,
196
+ },
197
+ });
198
+ if (verify.status === "failed") {
199
+ return { ok: false, skipped: false, detail: `extract-verify failed (exit ${verify.exitCode}): ${verify.stderrTail}` };
200
+ }
201
+ return { ok: true, skipped: false, detail: "" };
202
+ }
203
+ finally {
204
+ // Scratch removal is best-effort — a removal failure must not mask a
205
+ // computed verification result (nor crash the cut after ok was decided).
206
+ await rm(scratch, { recursive: true, force: true }).catch(() => { });
207
+ }
208
+ }
209
+ //# sourceMappingURL=publish.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../os/flow/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;EAyBE;AAEF,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGnD,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAyB,MAAM,cAAc,CAAC;AAepE,yGAAyG;AACzG,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAe,EACf,EAAe,EACf,IAAiB;IAEjB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACnC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,qBAAqB,CAAC,CAAC;IAC7D,I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AC,EAAE,EAAE,gBAAgB,EAAE;YACvD,OAAO;YACP,GAAG,EAAE,OAAO;YACZ,GAAG,EAAE;gBACH,uBAAuB,EAAE,OAAO;gBAChC,cAAc,EAAE,GAAG;gBACnB,eAAe,EAAE,IAAI,CAAC,EAAE;aACzB;SACF,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,+BAA+B,MAAM,CAAC,QAAQ,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;QACxH,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAClD,CAAC;YAAS,CAAC;QACT,qEAAqE;QACrE,yEAAyE;QACzE,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACtE,CAAC;AACH,CAAC"}
@@ -0,0 +1,142 @@
1
+ import { z } from "zod";
2
+ import type { WorkspaceIO } from "../../src/types.ts";
3
+ export declare const STALE_AFTER_HOURS = 72;
4
+ export declare const REGISTRY_RELATIVE_PATH = "forge/registry.yaml";
5
+ export declare const REGISTRY_LOCK_RELATIVE_PATH = "forge/registry.lock";
6
+ export declare const INTEGRATE_LOCK_RELATIVE_PATH = "forge/integrate.lock";
7
+ export declare const JOURNAL_RELATIVE_PATH = "forge/journal.jsonl";
8
+ export declare const REGISTRY_LOCK_WAIT_MS = 10000;
9
+ export declare const REGISTRY_LOCK_STALE_MS = 60000;
10
+ /** Fixed risk categories for digest items and held entries (RFC-1491). */
11
+ export declare const RISK_CATEGORIES: readonly ["contract", "migration", "invariant", "capability-removal", "major-dependency", "other"];
12
+ export type RiskCategory = (typeof RISK_CATEGORIES)[number];
13
+ export declare const flowRegistryEntrySchema: z.ZodObject<{
14
+ name: z.ZodString;
15
+ kind: z.ZodEnum<{
16
+ fix: "fix";
17
+ task: "task";
18
+ session: "session";
19
+ }>;
20
+ base: z.ZodEnum<{
21
+ main: "main";
22
+ develop: "develop";
23
+ }>;
24
+ baseSha: z.ZodString;
25
+ worktree: z.ZodNullable<z.ZodString>;
26
+ owner: z.ZodObject<{
27
+ kind: z.ZodEnum<{
28
+ task: "task";
29
+ session: "session";
30
+ }>;
31
+ id: z.ZodString;
32
+ }, z.core.$strict>;
33
+ brief: z.ZodNullable<z.ZodString>;
34
+ openedAt: z.ZodString;
35
+ updatedAt: z.ZodString;
36
+ held: z.ZodNullable<z.ZodObject<{
37
+ heldAt: z.ZodString;
38
+ riskCategory: z.ZodEnum<{
39
+ contract: "contract";
40
+ other: "other";
41
+ migration: "migration";
42
+ invariant: "invariant";
43
+ "capability-removal": "capability-removal";
44
+ "major-dependency": "major-dependency";
45
+ }>;
46
+ reason: z.ZodString;
47
+ tip: z.ZodString;
48
+ }, z.core.$strict>>;
49
+ port: z.ZodDefault<z.ZodNullable<z.ZodObject<{
50
+ mainSha: z.ZodString;
51
+ tags: z.ZodArray<z.ZodString>;
52
+ }, z.core.$strict>>>;
53
+ }, z.core.$strict>;
54
+ export declare const flowRegistrySchema: z.ZodObject<{
55
+ schema: z.ZodLiteral<"forge/flow-registry@1">;
56
+ branches: z.ZodArray<z.ZodObject<{
57
+ name: z.ZodString;
58
+ kind: z.ZodEnum<{
59
+ fix: "fix";
60
+ task: "task";
61
+ session: "session";
62
+ }>;
63
+ base: z.ZodEnum<{
64
+ main: "main";
65
+ develop: "develop";
66
+ }>;
67
+ baseSha: z.ZodString;
68
+ worktree: z.ZodNullable<z.ZodString>;
69
+ owner: z.ZodObject<{
70
+ kind: z.ZodEnum<{
71
+ task: "task";
72
+ session: "session";
73
+ }>;
74
+ id: z.ZodString;
75
+ }, z.core.$strict>;
76
+ brief: z.ZodNullable<z.ZodString>;
77
+ openedAt: z.ZodString;
78
+ updatedAt: z.ZodString;
79
+ held: z.ZodNullable<z.ZodObject<{
80
+ heldAt: z.ZodString;
81
+ riskCategory: z.ZodEnum<{
82
+ contract: "contract";
83
+ other: "other";
84
+ migration: "migration";
85
+ invariant: "invariant";
86
+ "capability-removal": "capability-removal";
87
+ "major-dependency": "major-dependency";
88
+ }>;
89
+ reason: z.ZodString;
90
+ tip: z.ZodString;
91
+ }, z.core.$strict>>;
92
+ port: z.ZodDefault<z.ZodNullable<z.ZodObject<{
93
+ mainSha: z.ZodString;
94
+ tags: z.ZodArray<z.ZodString>;
95
+ }, z.core.$strict>>>;
96
+ }, z.core.$strict>>;
97
+ }, z.core.$strict>;
98
+ export type FlowRegistryEntry = z.infer<typeof flowRegistryEntrySchema>;
99
+ export type FlowRegistryV1 = z.infer<typeof flowRegistrySchema>;
100
+ export declare class FlowRegistrySchemaError extends Error {
101
+ readonly file: string;
102
+ readonly detail: string;
103
+ constructor(file: string, detail: string);
104
+ }
105
+ export interface FlowJournalEvent {
106
+ at: string;
107
+ event: "open" | "integrate" | "discard" | "cut" | "fix" | "backmerge" | "hold" | "unhold" | "push" | "publish" | "publish-superseded" | "publish-retired";
108
+ branch: string;
109
+ sha: string;
110
+ detail: string;
111
+ /** develop before (integrate/backmerge/cut/hold); branch base (discard) — W1-1. */
112
+ base?: string;
113
+ /** hold only — the new (base, sha] range of every replayed item. */
114
+ rewrites?: Array<{
115
+ branch: string;
116
+ kind: "integration" | "backmerge" | "release";
117
+ base: string;
118
+ sha: string;
119
+ }>;
120
+ }
121
+ export declare function emptyRegistry(): FlowRegistryV1;
122
+ export declare function registryPath(commonGitDir: string): string;
123
+ /**
124
+ * Absolute path of the repository's common git dir — shared across all
125
+ * worktrees. `git rev-parse --git-common-dir` may answer relative to cwd.
126
+ */
127
+ export declare function commonGitDir(io: WorkspaceIO, cwd: string): Promise<string>;
128
+ /** Read the registry; a missing file yields the empty registry. */
129
+ export declare function readRegistry(io: WorkspaceIO, commonGitDir: string): Promise<FlowRegistryV1>;
130
+ /**
131
+ * Read-mutate-write under the registry lock (10 s wait, 60 s stale).
132
+ * Branches are stored sorted by name; the write is temp file + rename so a
133
+ * reader never sees a torn document.
134
+ */
135
+ export declare function updateRegistry(io: WorkspaceIO, commonGitDir: string, mutate: (r: FlowRegistryV1) => FlowRegistryV1): Promise<FlowRegistryV1>;
136
+ /** Append one journal line — best-effort bookkeeping, append-only. */
137
+ export declare function appendJournal(io: WorkspaceIO, commonGitDir: string, event: Omit<FlowJournalEvent, "at"> & {
138
+ at?: string;
139
+ }): Promise<void>;
140
+ /** Read every journal line in append order; a missing file yields []. */
141
+ export declare function readJournal(io: WorkspaceIO, commonGitDir: string): Promise<FlowJournalEvent[]>;
142
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../os/flow/registry.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKtD,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAC5D,eAAO,MAAM,2BAA2B,wBAAwB,CAAC;AACjE,eAAO,MAAM,4BAA4B,yBAAyB,CAAC;AACnE,eAAO,MAAM,qBAAqB,wBAAwB,CAAC;AAE3D,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAC5C,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C,0EAA0E;AAC1E,eAAO,MAAM,eAAe,oGAOlB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwChC,CAAC;AAEL,eAAO,MAA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