@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,83 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>Public release-line version reader (RFC-1493): the exported
4
+ `resolveRepositoryLineVersion(repoRoot, io)` consumers outside Forge call so
5
+ they never re-read the tag grammar. For the repository line it returns the
6
+ derived `X.Y.Z+N.&lt;head9&gt;[.dirty]` when an annotated release tag is
7
+ reachable, else the version-file value.</purpose>
8
+ <non-goals>
9
+ <item>No package-line reporting — flow.version owns the full report.</item>
10
+ <item>No diagnostics surface — this is a library function; failure states throw.</item>
11
+ </non-goals>
12
+ </MODULE_CONTRACT>
13
+ <KEY_DECISIONS>
14
+ <item>One implementation — deriveLineVersion in line-version.ts is the same derivation flow.version prints (RFC-1465 canonical-reader rule).</item>
15
+ <item>Untagged is not an error — it resolves to the version-file value; only a missing or unparsable version file throws.</item>
16
+ </KEY_DECISIONS>
17
+ <CHANGE_SUMMARY>
18
+ <item>RFC-1493: step 1 — public os/flow export resolveRepositoryLineVersion</item>
19
+ <item>RFC-1493: step 1 — forge public release-line version reader</item>
20
+ <item>RFC-1494: step 1 — isFlowAdopted public export</item>
21
+ <item>RFC-1495: step 1 - forge state roots</item>
22
+ <item>RFC-1495: steps 2-3 - workshop paths resolver and call-site migration</item>
23
+ </CHANGE_SUMMARY>
24
+ */
25
+ import { branchExists, git, worktreeList } from "./git.js";
26
+ import { hasManagedBlock, PRECOMMIT_FILE } from "./guard-files.js";
27
+ import { deriveLineVersion } from "./line-version.js";
28
+ import { detectRepoKind } from "./repo-kind.js";
29
+ import { discoverReleaseLines } from "./release-lines.js";
30
+ import { primaryWorktree, resolveStateRoots, } from "./worktree-path.js";
31
+ // RFC-1495: state-root resolution — Forge owns the roots (mission.archive,
32
+ // werkstatt.lock.recover build state paths and Forge must not import
33
+ // @warpgogol/*). The engine's workshop-paths builds the names on top.
34
+ export { primaryWorktree, resolveStateRoots, worktreeList };
35
+ /**
36
+ * Resolve the repository release line's version: the derived
37
+ * `X.Y.Z+N.<head9>[.dirty]` anchored to the last reachable annotated `v*`
38
+ * tag, or the root package.json `version` when the line was never tagged.
39
+ * Throws only when the version cannot be resolved at all (missing or
40
+ * unparsable version file on an untagged line, or HEAD unresolvable on a
41
+ * tagged one).
42
+ */
43
+ export async function resolveRepositoryLineVersion(repoRoot, io) {
44
+ const { lines, diagnostics } = await discoverReleaseLines(repoRoot, io);
45
+ const discoveryError = diagnostics.find((d) => d.severity === "error");
46
+ if (discoveryError) {
47
+ throw new Error(`resolveRepositoryLineVersion: ${discoveryError.message}`);
48
+ }
49
+ const repoLine = lines.find((line) => line.id === "repo");
50
+ if (!repoLine) {
51
+ throw new Error("resolveRepositoryLineVersion: no 'repo' release line discovered");
52
+ }
53
+ const derived = await deriveLineVersion(repoRoot, repoLine, io);
54
+ if (derived.version === null) {
55
+ throw new Error(derived.source === "version-file"
56
+ ? "resolveRepositoryLineVersion: root package.json is missing or unparsable"
57
+ : "resolveRepositoryLineVersion: release tag present but HEAD is unresolvable");
58
+ }
59
+ return {
60
+ version: derived.version,
61
+ source: derived.source,
62
+ lastTag: derived.lastTag?.name ?? null,
63
+ };
64
+ }
65
+ /**
66
+ * Adopted into the fixed branch model (FLOW-CUT-01 / FLOW-FIX-01):
67
+ * governed + develop exists + the pre-commit managed block COMMITTED on
68
+ * develop — the committed state is the signal (worktrees check out committed
69
+ * content; a working-tree-only block would not reach a release worktree).
70
+ * RFC-1494: the same test backs leitstand's platform precondition.
71
+ */
72
+ export async function isFlowAdopted(repoRoot, io) {
73
+ const detection = await detectRepoKind(repoRoot, io);
74
+ if (!detection.ok || detection.repoKind.kind !== "governed")
75
+ return false;
76
+ if (!(await branchExists(repoRoot, io, "develop")))
77
+ return false;
78
+ const committed = await git(repoRoot, io, ["show", `develop:${PRECOMMIT_FILE}`]);
79
+ if (committed.exitCode !== 0)
80
+ return false;
81
+ return hasManagedBlock(committed.stdout);
82
+ }
83
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../os/flow/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AAGF,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACL,eAAe,EACf,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAE5B,2EAA2E;AAC3E,qEAAqE;AACrE,sEAAsE;AACtE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AAW5D;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,QAAgB,EAChB,EAAe;IAEf,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,MAAM,oBAAoB,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACxE,MAAM,cAAc,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;IACvE,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;IAC1D,IAAI,CAAC,QAAQ,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ts";
3
+ import type { SemVer } from "./semver.ts";
4
+ export interface DerivedLineVersion {
5
+ /** `X.Y.Z+N.<head9>[.dirty]` for a tagged line, else the version-file value (null when unreadable). */
6
+ version: string | null;
7
+ source: "release-tag" | "version-file";
8
+ lastTag: {
9
+ name: string;
10
+ version: SemVer;
11
+ } | null;
12
+ commitsSince: number;
13
+ head: string | null;
14
+ dirty: boolean;
15
+ }
16
+ /**
17
+ * Derive a line's version: `X.Y.Z+N.<head9>[.dirty]` anchored to the highest
18
+ * reachable annotated tag when one exists, else the version-file value.
19
+ * Never throws for the untagged state; `version` is null only when both the
20
+ * tag and the version file are unreadable.
21
+ */
22
+ export declare function deriveLineVersion(repoRoot: string, line: ReleaseLine, io: WorkspaceIO): Promise<DerivedLineVersion>;
23
+ //# sourceMappingURL=line-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-version.d.ts","sourceRoot":"","sources":["../../../os/flow/line-version.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,kBAAkB;IACjC,uGAAuG;IACvG,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,aAAa,GAAG,cAAc,CAAC;IACvC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;CAChB;AAoCD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,kBAAkB,CAAC,CA6B7B"}
@@ -0,0 +1,83 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>Derived release-line version (RFC-1488, RFC-1493): the single
4
+ implementation of `X.Y.Z+N.&lt;head9&gt;[.dirty]` anchored to the last
5
+ reachable annotated tag, plus the version-file fallback for untagged lines.
6
+ flow.version and the public os/flow reader share this — werkstatt never
7
+ re-reads the tag grammar itself.</purpose>
8
+ <non-goals>
9
+ <item>No pending-level math — release-level.ts owns it.</item>
10
+ <item>No diagnostics surface — callers decide which states are findings.</item>
11
+ </non-goals>
12
+ </MODULE_CONTRACT>
13
+ <KEY_DECISIONS>
14
+ <item>Derived version is anchored to the last tag, never the version file — the file is a release-time write and diverging is a FLOW-08 finding, not a second anchor.</item>
15
+ <item>An untagged line resolves to the version-file value with source "version-file" — never throws for the untagged state itself (RFC-1493).</item>
16
+ </KEY_DECISIONS>
17
+ <CHANGE_SUMMARY>
18
+ <item>RFC-1493: step 1 — shared derived-version extraction consumed by flow.version and resolveRepositoryLineVersion</item>
19
+ <item>RFC-1493: step 1 — forge public release-line version reader</item>
20
+ <item>RFC-1493: step 2 — platform identity command, migrator-cursor pin comparison</item>
21
+ </CHANGE_SUMMARY>
22
+ */
23
+ import { git, statusTracked } from "./git.js";
24
+ import { readLineVersionFile } from "./release-lines.js";
25
+ import { listLineTags } from "./release-tags.js";
26
+ /** Count commits in `since..<ref>` (or all of <ref> when since is empty) touching `paths`. */
27
+ async function commitsSinceRef(repoRoot, since, paths, io, ref = "HEAD") {
28
+ const range = since === "" ? ref : `${since}..${ref}`;
29
+ const args = ["rev-list", "--count", range];
30
+ if (paths.length > 0)
31
+ args.push("--", ...paths);
32
+ const result = await git(repoRoot, io, args);
33
+ return result.exitCode === 0 ? Number.parseInt(result.stdout.trim(), 10) || 0 : 0;
34
+ }
35
+ /** Tracked modifications inside `paths` (empty = whole worktree). Non-git workdirs read as clean — the version-file fallback then applies. */
36
+ async function dirtyPaths(repoRoot, paths, io) {
37
+ let entries;
38
+ try {
39
+ entries = await statusTracked(repoRoot, io);
40
+ }
41
+ catch {
42
+ return 0;
43
+ }
44
+ if (paths.length === 0)
45
+ return entries.length;
46
+ return entries.filter((entry) => {
47
+ const file = entry.slice(3).split(" -> ").pop() ?? "";
48
+ return paths.some((p) => file === p || file.startsWith(`${p}/`));
49
+ }).length;
50
+ }
51
+ /**
52
+ * Derive a line's version: `X.Y.Z+N.<head9>[.dirty]` anchored to the highest
53
+ * reachable annotated tag when one exists, else the version-file value.
54
+ * Never throws for the untagged state; `version` is null only when both the
55
+ * tag and the version file are unreadable.
56
+ */
57
+ export async function deriveLineVersion(repoRoot, line, io) {
58
+ const [tags, currentVersion, dirtyCount, headResult] = await Promise.all([
59
+ listLineTags(repoRoot, line, io),
60
+ readLineVersionFile(repoRoot, line, io),
61
+ dirtyPaths(repoRoot, line.paths, io),
62
+ git(repoRoot, io, ["rev-parse", "--short=9", "HEAD"]),
63
+ ]);
64
+ const head = headResult.exitCode === 0 ? headResult.stdout.trim() : null;
65
+ const dirty = dirtyCount > 0;
66
+ const commitsSince = await commitsSinceRef(repoRoot, tags.lastTag?.name ?? "", line.paths, io);
67
+ if (tags.lastTag === null || head === null) {
68
+ return {
69
+ version: tags.lastTag === null ? currentVersion : null,
70
+ source: tags.lastTag === null ? "version-file" : "release-tag",
71
+ lastTag: tags.lastTag,
72
+ commitsSince,
73
+ head,
74
+ dirty,
75
+ };
76
+ }
77
+ const base = commitsSince > 0
78
+ ? `${tags.lastTag.name.slice(line.tagPrefix.length)}+${commitsSince}.${head}`
79
+ : tags.lastTag.name.slice(line.tagPrefix.length);
80
+ const version = dirty && commitsSince === 0 ? `${base}+0.${head}.dirty` : dirty ? `${base}.dirty` : base;
81
+ return { version, source: "release-tag", lastTag: tags.lastTag, commitsSince, head, dirty };
82
+ }
83
+ //# sourceMappingURL=line-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-version.js","sourceRoot":"","sources":["../../../os/flow/line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,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC3C,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI;YACtD,MAAM,EAAE,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa;YAC9D,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,YAAY;YACZ,IAAI;YACJ,KAAK;SACN,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GACR,YAAY,GAAG,CAAC;QACd,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,YAAY,IAAI,IAAI,EAAE;QAC7E,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACrD,MAAM,OAAO,GACX,KAAK,IAAI,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC9F,CAAC"}
@@ -0,0 +1,39 @@
1
+ export interface FlowLockOptions {
2
+ /** Maximum time to wait for a live lock before throwing LockTimeoutError. */
3
+ waitMs: number;
4
+ /** A lock whose `at` is older than this is broken with an onStale warning. */
5
+ staleMs: number;
6
+ /** Emit onProgress at this interval while waiting (0/undefined = silent). */
7
+ progressEveryMs?: number;
8
+ onProgress?: (message: string) => void;
9
+ /** Called when a stale lock is broken — the caller logs the warning.
10
+ * `reason` is "dead-holder" for an immediate dead-pid/boot-id break and
11
+ * "stale-age" for the classic age break. */
12
+ onStale?: (lock: {
13
+ path: string;
14
+ at: string;
15
+ ageMs: number;
16
+ reason: "dead-holder" | "stale-age";
17
+ pid?: number;
18
+ host?: string;
19
+ }) => void;
20
+ /** Injectable clock for tests. */
21
+ now?: () => number;
22
+ /** Injectable sleep for tests. */
23
+ sleep?: (ms: number) => Promise<void>;
24
+ }
25
+ /** Thrown when the wait budget elapses while a live lock is held. */
26
+ export declare class LockTimeoutError extends Error {
27
+ readonly lockPath: string;
28
+ constructor(lockPath: string, waitedMs: number);
29
+ }
30
+ /**
31
+ * Hold `lockPath` exclusively for the duration of `fn`. Waits while a live
32
+ * holder exists, breaks a lock older than `staleMs` with an onStale warning,
33
+ * throws LockTimeoutError when the budget elapses. The lock is always
34
+ * released — a failed `fn` never leaks it.
35
+ */
36
+ export declare function withFlowLock<T>(lockPath: string, opts: FlowLockOptions, fn: () => Promise<T>, io: {
37
+ readFile: (path: string) => Promise<string>;
38
+ }): Promise<T>;
39
+ //# sourceMappingURL=locks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locks.d.ts","sourceRoot":"","sources":["../../../os/flow/locks.ts"],"names":[],"mappings":"AAsCA,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;gDAE4C;IAC5C,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE;QACf,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,aAAa,GAAG,WAAW,CAAC;QACpC,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;IACX,kCAAkC;IAClC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,kCAAkC;IAClC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED,qEAAqE;AACrE,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBACd,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAK/C;AA4DD;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,eAAe,EACrB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,GAClD,OAAO,CAAC,CAAC,CAAC,CAoFZ"}
@@ -0,0 +1,177 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>Exclusive file locks for flow commands (RFC-1487): O_EXCL lock files
4
+ carrying { pid, host, at, bootId? }, wait-with-progress while a live holder
5
+ exists, dead holders (dead pid on this host, or a foreign boot id) and stale
6
+ locks broken, always released in finally. Used for the short registry lock
7
+ (10 s) and the long integration lock (30 min).</purpose>
8
+ <non-goals>
9
+ <item>No registry semantics — callers choose paths, budgets and diagnostics.</item>
10
+ </non-goals>
11
+ </MODULE_CONTRACT>
12
+ <KEY_DECISIONS>
13
+ <item>Staleness reads the lock file's `at` timestamp, not mtime — a crashed holder leaves a frozen file whose content is authoritative (DNA-105).</item>
14
+ <item>Timeout throws LockTimeoutError naming the file — each command maps it to its own diagnostic (FLOW-07 for the registry, FLOW-INT-08 for integrate).</item>
15
+ </KEY_DECISIONS>
16
+ <CHANGE_SUMMARY>
17
+ <item>RFC-1487: step 1 — exclusive file locks</item>
18
+ <item>RFC-1487: step 1 — worktree path contracts, O_EXCL locks, branch registry and journal</item>
19
+ <item>RFC-1487: close rfc-1487 review findings — dirty-check parity with git worktree remove, ownership-verified lock release, FLOW-07 registry-error mapping, residual RFC-1462 docs removed
20
+
21
+ The dirty gate for session worktrees now uses full porcelain status
22
+ (untracked files included) because it predicts 'git worktree remove';
23
+ the primary-clean gate keeps tracked-only semantics because it predicts
24
+ 'merge --ff-only'. Lock release verifies the held payload before
25
+ unlinking. Registry/journal failures map to FLOW-07 in every handler.
26
+ The final branch-name collision reports FLOW-OPEN-04, flow.discard
27
+ propagates its teardown result and predicts FLOW-DIS-03 on --dry-run,
28
+ and integrate exposes teardown as its own field.</item>
29
+ <item>RFC-1504: steps 2-3 — holderIsDead, boot-id payload, dead-holder break in withFlowLock</item>
30
+ <item>RFC-1504: review fixes — single io.readFile parse per iteration, real ageMs on dead-holder onStale, atomic break claim</item>
31
+ </CHANGE_SUMMARY>
32
+ */
33
+ import { hostname } from "node:os";
34
+ import { open, rm } from "node:fs/promises";
35
+ import { claimLockBreak, currentBootId, holderIsDead } from "../core/lock-holder.js";
36
+ /** Thrown when the wait budget elapses while a live lock is held. */
37
+ export class LockTimeoutError extends Error {
38
+ lockPath;
39
+ constructor(lockPath, waitedMs) {
40
+ super(`lock ${lockPath} still held after ${waitedMs} ms`);
41
+ this.name = "LockTimeoutError";
42
+ this.lockPath = lockPath;
43
+ }
44
+ }
45
+ const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
46
+ async function tryAcquire(lockPath, content) {
47
+ try {
48
+ const handle = await open(lockPath, "wx");
49
+ try {
50
+ await handle.writeFile(JSON.stringify(content));
51
+ }
52
+ finally {
53
+ await handle.close();
54
+ }
55
+ return true;
56
+ }
57
+ catch (error) {
58
+ if (error.code === "EEXIST")
59
+ return false;
60
+ throw error;
61
+ }
62
+ }
63
+ /**
64
+ * Holder fields of the current lock file read through the injected io —
65
+ * one parse per wait iteration feeds both the dead-holder and the age
66
+ * checks; null when the file vanished or is unreadable.
67
+ */
68
+ async function readHolder(lockPath, readFile) {
69
+ try {
70
+ const parsed = JSON.parse(await readFile(lockPath));
71
+ if (typeof parsed["pid"] !== "number")
72
+ return null;
73
+ return {
74
+ pid: parsed["pid"],
75
+ host: typeof parsed["host"] === "string" ? parsed["host"] : undefined,
76
+ at: typeof parsed["at"] === "string" ? parsed["at"] : "",
77
+ bootId: typeof parsed["bootId"] === "string" ? parsed["bootId"] : undefined,
78
+ };
79
+ }
80
+ catch {
81
+ return null;
82
+ }
83
+ }
84
+ /**
85
+ * Hold `lockPath` exclusively for the duration of `fn`. Waits while a live
86
+ * holder exists, breaks a lock older than `staleMs` with an onStale warning,
87
+ * throws LockTimeoutError when the budget elapses. The lock is always
88
+ * released — a failed `fn` never leaks it.
89
+ */
90
+ export async function withFlowLock(lockPath, opts, fn, io) {
91
+ const now = opts.now ?? (() => Date.now());
92
+ const sleep = opts.sleep ?? defaultSleep;
93
+ const deadline = now() + opts.waitMs;
94
+ let nextProgress = now() + (opts.progressEveryMs ?? Number.POSITIVE_INFINITY);
95
+ const ownBootId = currentBootId();
96
+ let heldPayload = null;
97
+ for (;;) {
98
+ const at = new Date(now()).toISOString();
99
+ const content = {
100
+ pid: process.pid,
101
+ host: hostname(),
102
+ at,
103
+ };
104
+ if (ownBootId !== undefined)
105
+ content.bootId = ownBootId;
106
+ const acquired = await tryAcquire(lockPath, content);
107
+ if (acquired) {
108
+ heldPayload = { pid: process.pid, at };
109
+ break;
110
+ }
111
+ // RFC-1504: a dead holder's lock is claimed and retried at once —
112
+ // before the age rule, so a crashed process never makes anyone wait.
113
+ const holder = await readHolder(lockPath, io.readFile);
114
+ const heldAtMs = holder !== null && holder.at.length > 0 ? Date.parse(holder.at) : NaN;
115
+ const age = Number.isNaN(heldAtMs) ? null : now() - heldAtMs;
116
+ if (holder !== null && holderIsDead(holder, ownBootId)) {
117
+ opts.onStale?.({
118
+ path: lockPath,
119
+ at: holder.at,
120
+ ageMs: age ?? 0,
121
+ reason: "dead-holder",
122
+ pid: holder.pid,
123
+ host: holder.host,
124
+ });
125
+ const tomb = await claimLockBreak(lockPath, holder);
126
+ if (tomb !== null)
127
+ await rm(tomb, { force: true });
128
+ continue;
129
+ }
130
+ if (age !== null && age > opts.staleMs) {
131
+ opts.onStale?.({
132
+ path: lockPath,
133
+ at: holder?.at ?? new Date(now() - age).toISOString(),
134
+ ageMs: age,
135
+ reason: "stale-age",
136
+ pid: holder?.pid,
137
+ host: holder?.host,
138
+ });
139
+ const tomb = await claimLockBreak(lockPath, holder);
140
+ if (tomb !== null)
141
+ await rm(tomb, { force: true });
142
+ continue;
143
+ }
144
+ if (now() >= deadline) {
145
+ throw new LockTimeoutError(lockPath, now() - (deadline - opts.waitMs));
146
+ }
147
+ if (opts.progressEveryMs && now() >= nextProgress) {
148
+ opts.onProgress?.(`waiting for ${lockPath}`);
149
+ nextProgress = now() + opts.progressEveryMs;
150
+ }
151
+ await sleep(Math.min(50, Math.max(1, deadline - now())));
152
+ }
153
+ try {
154
+ return await fn();
155
+ }
156
+ finally {
157
+ // Release only the lock we hold: after a stale-break takeover the file
158
+ // may carry a newer holder's payload — unlinking it would leave no
159
+ // mutual exclusion at all.
160
+ let stillOurs = false;
161
+ try {
162
+ const raw = await io.readFile(lockPath);
163
+ const parsed = JSON.parse(raw);
164
+ stillOurs = parsed.pid === heldPayload?.pid && parsed.at === heldPayload?.at;
165
+ }
166
+ catch {
167
+ stillOurs = false;
168
+ }
169
+ // Residual TOCTOU: a takeover between the read above and this rm could
170
+ // still unlink a fresh holder's lock — only reachable once our own lock
171
+ // aged past staleMs, which the stale-breaker already accepts as dead.
172
+ // A true fix needs compare-and-delete semantics the filesystem lacks.
173
+ if (stillOurs)
174
+ await rm(lockPath, { force: true });
175
+ }
176
+ }
177
+ //# sourceMappingURL=locks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locks.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,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC;QAC9C,CAAC;QACD,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,EAAE,CAAC;IACpB,CAAC;YAAS,CAAC;QACT,uEAAuE;QACvE,mEAAmE;QACnE,2BAA2B;QAC3B,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACxC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkC,CAAC;YAChE,SAAS,GAAG,MAAM,CAAC,GAAG,KAAK,WAAW,EAAE,GAAG,IAAI,MAAM,CAAC,EAAE,KAAK,WAAW,EAAE,EAAE,CAAC;QAC/E,CAAC;QAAC,MAAM,CAAC;YACP,SAAS,GAAG,KAAK,CAAC;QACpB,CAAC;QACD,uEAAuE;QACvE,wEAAwE;QACxE,sEAAsE;QACtE,sEAAsE;QACtE,IAAI,SAAS;YAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { WorkspaceIO } from "../../src/types.ts";
2
+ import { type ReleaseLine } from "./release-lines.ts";
3
+ export declare const MARKER_FILE = "forge.generated.yaml";
4
+ export declare const MARKER_SCHEMA = "forge/generated@1";
5
+ export declare const MARKER_GENERATOR = "repo-extract";
6
+ export interface LineMarker {
7
+ /** Release-line id (the package directory basename). */
8
+ line: string;
9
+ /** The package line directory relative to the repository root. */
10
+ dir: string;
11
+ /** Absolute marker path. */
12
+ file: string;
13
+ }
14
+ /** Marker file content for one package line directory. */
15
+ export declare function markerContent(source: string): string;
16
+ /** Why an origin URL was rejected as a marker source (RFC-1498). */
17
+ export type RejectedOriginKind = "local-path" | "file-url";
18
+ /**
19
+ * True for origins that can reach a remote: a network scheme
20
+ * (http, https, ssh, git) or the scp form `<user>@<host>:<path>`
21
+ * (RFC-1498). Local paths, `file://` URLs and anything else are not
22
+ * marker sources — they would leak a machine-local path into the
23
+ * extract repository's forge.generated.yaml.
24
+ */
25
+ export declare function isNetworkOriginUrl(url: string): boolean;
26
+ /**
27
+ * The marker `source` value for a repository (RFC-1498): the
28
+ * credential-stripped `origin` URL when it is network-shaped, else the
29
+ * repository directory basename with `rejectedOrigin` naming the kind —
30
+ * never the path itself, so no machine-local path is written into an
31
+ * extract repository.
32
+ */
33
+ export declare function markerSource(repoRoot: string, io: WorkspaceIO): Promise<{
34
+ source: string;
35
+ rejectedOrigin: RejectedOriginKind | null;
36
+ }>;
37
+ /** True when marker content parses and carries the schema + generator. */
38
+ export declare function markerContentIsValid(content: string | null): boolean;
39
+ /** True when `file` parses and carries the marker schema + generator. */
40
+ export declare function markerIsValid(file: string, io: WorkspaceIO): Promise<boolean>;
41
+ /**
42
+ * Package lines whose directory lacks a valid marker. The repo line
43
+ * (`paths: []`) never gets one — a root marker would exempt the monorepo.
44
+ */
45
+ export declare function missingLineMarkers(repoRoot: string, io: WorkspaceIO): Promise<{
46
+ markers: LineMarker[];
47
+ lines: ReleaseLine[];
48
+ }>;
49
+ //# sourceMappingURL=markers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../../os/flow/markers.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE5E,eAAO,MAAM,WAAW,yBAAyB,CAAC;AAClD,eAAO,MAAM,aAAa,sBAAsB,CAAC;AACjD,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,0DAA0D;AAC1D,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,oEAAoE;AACpE,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAIvD;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,WAAW,GACd,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,kBAAkB,GAAG,IAAI,CAAA;CAAE,CAAC,CAiBxE;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAWpE;AAED,yEAAyE;AACzE,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAGnF;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,WAAW,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IAAC,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,CAY1D"}
@@ -0,0 +1,112 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>The forge.generated.yaml extract marker (RFC-1491): written into
4
+ every package-line directory by flow.install's `markers` step, checked by
5
+ flow.check FLOW-10 and flow.push FLOW-PUSH-06. repo-extract copies the
6
+ marker into the extract repository, where the top-level presence exempts
7
+ that repository from the flow guard.</purpose>
8
+ <non-goals>
9
+ <item>No marker creation at the repository root — a root marker would exempt the monorepo itself.</item>
10
+ <item>No npm packaging policy — package `files` lists keep the marker out of tarballs.</item>
11
+ </non-goals>
12
+ </MODULE_CONTRACT>
13
+ <KEY_DECISIONS>
14
+ <item>"Valid" is the strict content contract: parseable YAML carrying schema forge/generated@1 and generator repo-extract — the flow.check FLOW-10 wording matches exactly this test.</item>
15
+ <item>`source` accepts only network origins (RFC-1498): http/https/ssh/git schemes or scp form, userinfo stripped; a local path or file:// URL falls back to the directory basename and reports its rejection kind — the path is never written into a marker.</item>
16
+ </KEY_DECISIONS>
17
+ <CHANGE_SUMMARY>
18
+ <item>RFC-1491: step 2 — extract markers (flow.install step, FLOW-10, FLOW-PUSH-06 input)</item>
19
+ <item>RFC-1491: step 2 — pre-push guard mode, install steps pre-push + markers, FLOW-10</item>
20
+ <item>RFC-1498: step 2 — network-only marker source + rejectedOrigin reporting</item>
21
+ </CHANGE_SUMMARY>
22
+ */
23
+ import { basename, join } from "node:path";
24
+ import { parse as yamlParse } from "yaml";
25
+ import { git } from "./git.js";
26
+ import { discoverReleaseLines } from "./release-lines.js";
27
+ export const MARKER_FILE = "forge.generated.yaml";
28
+ export const MARKER_SCHEMA = "forge/generated@1";
29
+ export const MARKER_GENERATOR = "repo-extract";
30
+ /** Marker file content for one package line directory. */
31
+ export function markerContent(source) {
32
+ return `schema: ${MARKER_SCHEMA}\ngenerator: ${MARKER_GENERATOR}\nsource: ${source}\n`;
33
+ }
34
+ /**
35
+ * True for origins that can reach a remote: a network scheme
36
+ * (http, https, ssh, git) or the scp form `<user>@<host>:<path>`
37
+ * (RFC-1498). Local paths, `file://` URLs and anything else are not
38
+ * marker sources — they would leak a machine-local path into the
39
+ * extract repository's forge.generated.yaml.
40
+ */
41
+ export function isNetworkOriginUrl(url) {
42
+ if (/^(https?|ssh|git):\/\//i.test(url))
43
+ return true;
44
+ // scp-like syntax — user@host:path (git's shorthand for ssh).
45
+ return /^[^/@\s]+@[^:/\s]+:[^\s]+$/.test(url);
46
+ }
47
+ /**
48
+ * The marker `source` value for a repository (RFC-1498): the
49
+ * credential-stripped `origin` URL when it is network-shaped, else the
50
+ * repository directory basename with `rejectedOrigin` naming the kind —
51
+ * never the path itself, so no machine-local path is written into an
52
+ * extract repository.
53
+ */
54
+ export async function markerSource(repoRoot, io) {
55
+ const url = await git(repoRoot, io, ["remote", "get-url", "origin"]);
56
+ const raw = url.exitCode === 0 ? url.stdout.trim() : "";
57
+ if (raw.length === 0) {
58
+ return { source: basename(repoRoot), rejectedOrigin: null };
59
+ }
60
+ if (isNetworkOriginUrl(raw)) {
61
+ // Strip userinfo — https://user:pass@host/path → https://host/path.
62
+ return {
63
+ source: raw.replace(/^([a-z][a-z0-9+.-]*:\/\/)[^/@]*@/i, "$1"),
64
+ rejectedOrigin: null,
65
+ };
66
+ }
67
+ return {
68
+ source: basename(repoRoot),
69
+ rejectedOrigin: /^file:/i.test(raw) ? "file-url" : "local-path",
70
+ };
71
+ }
72
+ /** True when marker content parses and carries the schema + generator. */
73
+ export function markerContentIsValid(content) {
74
+ if (content === null)
75
+ return false;
76
+ let raw;
77
+ try {
78
+ raw = yamlParse(content);
79
+ }
80
+ catch {
81
+ return false;
82
+ }
83
+ if (raw === null || typeof raw !== "object")
84
+ return false;
85
+ const rec = raw;
86
+ return rec.schema === MARKER_SCHEMA && rec.generator === MARKER_GENERATOR;
87
+ }
88
+ /** True when `file` parses and carries the marker schema + generator. */
89
+ export async function markerIsValid(file, io) {
90
+ if (!(await io.exists(file)))
91
+ return false;
92
+ return markerContentIsValid(await io.readFile(file));
93
+ }
94
+ /**
95
+ * Package lines whose directory lacks a valid marker. The repo line
96
+ * (`paths: []`) never gets one — a root marker would exempt the monorepo.
97
+ */
98
+ export async function missingLineMarkers(repoRoot, io) {
99
+ const { lines } = await discoverReleaseLines(repoRoot, io);
100
+ const markers = [];
101
+ for (const line of lines) {
102
+ const dir = line.paths[0];
103
+ if (dir === undefined)
104
+ continue; // repo line — no marker
105
+ const file = join(repoRoot, dir, MARKER_FILE);
106
+ if (!(await markerIsValid(file, io))) {
107
+ markers.push({ line: line.id, dir, file });
108
+ }
109
+ }
110
+ return { markers, lines };
111
+ }
112
+ //# sourceMappingURL=markers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markers.js","sourceRoot":"","sources":["../../../os/flow/markers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAI1C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAoB,MAAM,oBAAoB,CAAC;AAE5E,MAAM,CAAC,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAClD,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAW/C,0DAA0D;AAC1D,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,WAAW,aAAa,gBAAgB,gBAAgB,aAAa,MAAM,IAAI,CAAC;AACzF,CAAC;AAKD;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,IAAI,yBAAyB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACrD,8DAA8D;IAC9D,OAAO,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,QAAgB,EAChB,EAAe;IAEf,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC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IAC/D,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,oBAAoB,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAgB,EAChB,EAAe;IAEf,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,oBAAoB,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,GAAG,KAAK,SAAS;YAAE,SAAS,CAAC,wBAAwB;QACzD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;QAC9C,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;YACrC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { type SemVer } from "./semver.ts";
2
+ export interface PublicationPlanEntry {
3
+ tag: string;
4
+ line: string;
5
+ }
6
+ export interface SupersededEntry extends PublicationPlanEntry {
7
+ /** Superseding tag — null when the tag is shadowed by a higher candidate
8
+ * that has not published yet. */
9
+ by: string | null;
10
+ }
11
+ export interface PublicationPlan {
12
+ attempt: PublicationPlanEntry[];
13
+ superseded: SupersededEntry[];
14
+ }
15
+ /**
16
+ * Partition `candidates` into the tags the next push attempts and the ones it
17
+ * supersedes. `published` carries every tag with a `publish` journal event;
18
+ * `retired` every tag with a `publish-retired` event. `versionOf` parses a
19
+ * tag's version for a line (null when the tag does not match the line's
20
+ * prefix or its suffix is not strict semver) — such tags stay out of both
21
+ * lists, so callers surface them through the baseline/pending paths they
22
+ * already own.
23
+ */
24
+ export declare function planPublications(candidates: PublicationPlanEntry[], published: ReadonlySet<string>, retired: ReadonlySet<string>, versionOf: (tag: string, line: string) => SemVer | null): PublicationPlan;
25
+ //# sourceMappingURL=publication-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publication-order.d.ts","sourceRoot":"","sources":["../../../os/flow/publication-order.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAmB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAgB,SAAQ,oBAAoB;IAC3D;qCACiC;IACjC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,oBAAoB,EAAE,EAClC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,EAC9B,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GACtD,eAAe,CA+CjB"}