@warpgogol/forge 9.3.1 → 9.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (509) hide show
  1. package/AGENTS.md +32 -0
  2. package/CHANGELOG.md +40 -0
  3. package/README.md +6 -4
  4. package/README.uk.md +10 -8
  5. package/bin/cli.ts +4 -4
  6. package/dist/bin/cli.js +4 -4
  7. package/dist/bin/cli.js.map +1 -1
  8. package/dist/os/adr/handlers/list-create.d.ts.map +1 -1
  9. package/dist/os/adr/handlers/list-create.js +23 -2
  10. package/dist/os/adr/handlers/list-create.js.map +1 -1
  11. package/dist/os/adr/types.d.ts +2 -0
  12. package/dist/os/adr/types.d.ts.map +1 -1
  13. package/dist/os/adr/types.js +2 -2
  14. package/dist/os/adr/types.js.map +1 -1
  15. package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
  16. package/dist/os/compass/handlers/compass-audit-handler.js +3 -1
  17. package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
  18. package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -1
  19. package/dist/os/compass/handlers/compass-header-scaffold-handler.js +6 -12
  20. package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -1
  21. package/dist/os/compass/handlers/git-revision.d.ts +2 -0
  22. package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
  23. package/dist/os/compass/handlers/git-revision.js +7 -2
  24. package/dist/os/compass/handlers/git-revision.js.map +1 -1
  25. package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
  26. package/dist/os/compass/handlers/summary-record.js +24 -14
  27. package/dist/os/compass/handlers/summary-record.js.map +1 -1
  28. package/dist/os/conformance/conformance.module.d.ts.map +1 -1
  29. package/dist/os/conformance/conformance.module.js +21 -4
  30. package/dist/os/conformance/conformance.module.js.map +1 -1
  31. package/dist/os/conformance/handlers/conformance-validate.d.ts.map +1 -1
  32. package/dist/os/conformance/handlers/conformance-validate.js +64 -8
  33. package/dist/os/conformance/handlers/conformance-validate.js.map +1 -1
  34. package/dist/os/core/archive-regen.d.ts +99 -0
  35. package/dist/os/core/archive-regen.d.ts.map +1 -0
  36. package/dist/os/core/archive-regen.js +220 -0
  37. package/dist/os/core/archive-regen.js.map +1 -0
  38. package/dist/os/core/core.module.d.ts.map +1 -1
  39. package/dist/os/core/core.module.js +159 -18
  40. package/dist/os/core/core.module.js.map +1 -1
  41. package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
  42. package/dist/os/core/handlers/assets-helpers.js +8 -3
  43. package/dist/os/core/handlers/assets-helpers.js.map +1 -1
  44. package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
  45. package/dist/os/core/handlers/forge-autonomy-validate.js +3 -1
  46. package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
  47. package/dist/os/core/handlers/package-health.d.ts +130 -0
  48. package/dist/os/core/handlers/package-health.d.ts.map +1 -1
  49. package/dist/os/core/handlers/package-health.js +548 -7
  50. package/dist/os/core/handlers/package-health.js.map +1 -1
  51. package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
  52. package/dist/os/core/handlers/release-prepare.js +5 -2
  53. package/dist/os/core/handlers/release-prepare.js.map +1 -1
  54. package/dist/os/flow/digest.d.ts.map +1 -1
  55. package/dist/os/flow/digest.js +3 -1
  56. package/dist/os/flow/digest.js.map +1 -1
  57. package/dist/os/flow/dirty-classify.d.ts +51 -0
  58. package/dist/os/flow/dirty-classify.d.ts.map +1 -0
  59. package/dist/os/flow/dirty-classify.js +83 -0
  60. package/dist/os/flow/dirty-classify.js.map +1 -0
  61. package/dist/os/flow/flow.module.d.ts.map +1 -1
  62. package/dist/os/flow/flow.module.js +110 -19
  63. package/dist/os/flow/flow.module.js.map +1 -1
  64. package/dist/os/flow/gate-engine.d.ts +13 -0
  65. package/dist/os/flow/gate-engine.d.ts.map +1 -0
  66. package/dist/os/flow/gate-engine.js +32 -0
  67. package/dist/os/flow/gate-engine.js.map +1 -0
  68. package/dist/os/flow/git.d.ts +45 -4
  69. package/dist/os/flow/git.d.ts.map +1 -1
  70. package/dist/os/flow/git.js +95 -27
  71. package/dist/os/flow/git.js.map +1 -1
  72. package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -1
  73. package/dist/os/flow/handlers/flow-backmerge.js +12 -5
  74. package/dist/os/flow/handlers/flow-backmerge.js.map +1 -1
  75. package/dist/os/flow/handlers/flow-check.d.ts.map +1 -1
  76. package/dist/os/flow/handlers/flow-check.js +25 -3
  77. package/dist/os/flow/handlers/flow-check.js.map +1 -1
  78. package/dist/os/flow/handlers/flow-cut.d.ts +4 -1
  79. package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
  80. package/dist/os/flow/handlers/flow-cut.js +75 -38
  81. package/dist/os/flow/handlers/flow-cut.js.map +1 -1
  82. package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -1
  83. package/dist/os/flow/handlers/flow-discard.js +33 -5
  84. package/dist/os/flow/handlers/flow-discard.js.map +1 -1
  85. package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
  86. package/dist/os/flow/handlers/flow-fix.js +13 -10
  87. package/dist/os/flow/handlers/flow-fix.js.map +1 -1
  88. package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -1
  89. package/dist/os/flow/handlers/flow-hold.js +13 -7
  90. package/dist/os/flow/handlers/flow-hold.js.map +1 -1
  91. package/dist/os/flow/handlers/flow-install.d.ts +2 -1
  92. package/dist/os/flow/handlers/flow-install.d.ts.map +1 -1
  93. package/dist/os/flow/handlers/flow-install.js +56 -13
  94. package/dist/os/flow/handlers/flow-install.js.map +1 -1
  95. package/dist/os/flow/handlers/flow-integrate.d.ts +54 -2
  96. package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
  97. package/dist/os/flow/handlers/flow-integrate.js +614 -65
  98. package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
  99. package/dist/os/flow/handlers/flow-open.d.ts +14 -0
  100. package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
  101. package/dist/os/flow/handlers/flow-open.js +117 -12
  102. package/dist/os/flow/handlers/flow-open.js.map +1 -1
  103. package/dist/os/flow/handlers/flow-peers.d.ts +24 -0
  104. package/dist/os/flow/handlers/flow-peers.d.ts.map +1 -0
  105. package/dist/os/flow/handlers/flow-peers.js +99 -0
  106. package/dist/os/flow/handlers/flow-peers.js.map +1 -0
  107. package/dist/os/flow/handlers/flow-status.d.ts +13 -0
  108. package/dist/os/flow/handlers/flow-status.d.ts.map +1 -1
  109. package/dist/os/flow/handlers/flow-status.js +35 -14
  110. package/dist/os/flow/handlers/flow-status.js.map +1 -1
  111. package/dist/os/flow/index.d.ts +3 -0
  112. package/dist/os/flow/index.d.ts.map +1 -1
  113. package/dist/os/flow/index.js +7 -2
  114. package/dist/os/flow/index.js.map +1 -1
  115. package/dist/os/flow/line-version.d.ts.map +1 -1
  116. package/dist/os/flow/line-version.js +2 -1
  117. package/dist/os/flow/line-version.js.map +1 -1
  118. package/dist/os/flow/locks.d.ts +37 -1
  119. package/dist/os/flow/locks.d.ts.map +1 -1
  120. package/dist/os/flow/locks.js +34 -14
  121. package/dist/os/flow/locks.js.map +1 -1
  122. package/dist/os/flow/ops-registry.d.ts +33 -0
  123. package/dist/os/flow/ops-registry.d.ts.map +1 -0
  124. package/dist/os/flow/ops-registry.js +177 -0
  125. package/dist/os/flow/ops-registry.js.map +1 -0
  126. package/dist/os/flow/preflight.d.ts +157 -0
  127. package/dist/os/flow/preflight.d.ts.map +1 -0
  128. package/dist/os/flow/preflight.js +772 -0
  129. package/dist/os/flow/preflight.js.map +1 -0
  130. package/dist/os/flow/publish.d.ts +7 -0
  131. package/dist/os/flow/publish.d.ts.map +1 -1
  132. package/dist/os/flow/publish.js +165 -3
  133. package/dist/os/flow/publish.js.map +1 -1
  134. package/dist/os/flow/registry.d.ts +26 -1
  135. package/dist/os/flow/registry.d.ts.map +1 -1
  136. package/dist/os/flow/registry.js +27 -6
  137. package/dist/os/flow/registry.js.map +1 -1
  138. package/dist/os/flow/scripts.d.ts +4 -0
  139. package/dist/os/flow/scripts.d.ts.map +1 -1
  140. package/dist/os/flow/scripts.js +8 -2
  141. package/dist/os/flow/scripts.js.map +1 -1
  142. package/dist/os/flow/session-checkout.d.ts +33 -0
  143. package/dist/os/flow/session-checkout.d.ts.map +1 -0
  144. package/dist/os/flow/session-checkout.js +151 -0
  145. package/dist/os/flow/session-checkout.js.map +1 -0
  146. package/dist/os/flow/standalone-invoke.d.ts +11 -0
  147. package/dist/os/flow/standalone-invoke.d.ts.map +1 -0
  148. package/dist/os/flow/standalone-invoke.js +75 -0
  149. package/dist/os/flow/standalone-invoke.js.map +1 -0
  150. package/dist/os/flow/worktree-path.d.ts.map +1 -1
  151. package/dist/os/flow/worktree-path.js +9 -3
  152. package/dist/os/flow/worktree-path.js.map +1 -1
  153. package/dist/os/instructions/handlers/budget-validate.d.ts +1 -0
  154. package/dist/os/instructions/handlers/budget-validate.d.ts.map +1 -1
  155. package/dist/os/instructions/handlers/budget-validate.js +12 -4
  156. package/dist/os/instructions/handlers/budget-validate.js.map +1 -1
  157. package/dist/os/instructions/instructions.module.d.ts.map +1 -1
  158. package/dist/os/instructions/instructions.module.js +4 -1
  159. package/dist/os/instructions/instructions.module.js.map +1 -1
  160. package/dist/os/mission/handlers/archive.d.ts.map +1 -1
  161. package/dist/os/mission/handlers/archive.js +12 -8
  162. package/dist/os/mission/handlers/archive.js.map +1 -1
  163. package/dist/os/mission/importer-block.d.ts +19 -0
  164. package/dist/os/mission/importer-block.d.ts.map +1 -0
  165. package/dist/os/mission/importer-block.js +124 -0
  166. package/dist/os/mission/importer-block.js.map +1 -0
  167. package/dist/os/mission/lockfile.d.ts +17 -0
  168. package/dist/os/mission/lockfile.d.ts.map +1 -1
  169. package/dist/os/mission/lockfile.js +38 -0
  170. package/dist/os/mission/lockfile.js.map +1 -1
  171. package/dist/os/mission/open-missions.d.ts +8 -0
  172. package/dist/os/mission/open-missions.d.ts.map +1 -0
  173. package/dist/os/mission/open-missions.js +42 -0
  174. package/dist/os/mission/open-missions.js.map +1 -0
  175. package/dist/os/queue/manifest.d.ts.map +1 -1
  176. package/dist/os/queue/manifest.js +11 -1
  177. package/dist/os/queue/manifest.js.map +1 -1
  178. package/dist/os/rfc/acceptance.d.ts +14 -0
  179. package/dist/os/rfc/acceptance.d.ts.map +1 -1
  180. package/dist/os/rfc/acceptance.js +18 -10
  181. package/dist/os/rfc/acceptance.js.map +1 -1
  182. package/dist/os/rfc/decision-log.d.ts.map +1 -1
  183. package/dist/os/rfc/decision-log.js +11 -2
  184. package/dist/os/rfc/decision-log.js.map +1 -1
  185. package/dist/os/rfc/frontmatter-io.d.ts +23 -0
  186. package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
  187. package/dist/os/rfc/frontmatter-io.js +82 -1
  188. package/dist/os/rfc/frontmatter-io.js.map +1 -1
  189. package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -1
  190. package/dist/os/rfc/handlers/implement-stamp-deviations.js +24 -2
  191. package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -1
  192. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  193. package/dist/os/rfc/handlers/implement-stamp.js +16 -3
  194. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  195. package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
  196. package/dist/os/rfc/handlers/index-graph.js +5 -4
  197. package/dist/os/rfc/handlers/index-graph.js.map +1 -1
  198. package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
  199. package/dist/os/rfc/handlers/list-create.js +107 -10
  200. package/dist/os/rfc/handlers/list-create.js.map +1 -1
  201. package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts +48 -0
  202. package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -1
  203. package/dist/os/rfc/handlers/rfc-evidence-sync.js +131 -2
  204. package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -1
  205. package/dist/os/rfc/handlers/validate-rules.d.ts +21 -1
  206. package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
  207. package/dist/os/rfc/handlers/validate-rules.js +77 -5
  208. package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
  209. package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
  210. package/dist/os/rfc/handlers/validate.js +64 -6
  211. package/dist/os/rfc/handlers/validate.js.map +1 -1
  212. package/dist/os/rfc/next-id.d.ts +38 -0
  213. package/dist/os/rfc/next-id.d.ts.map +1 -0
  214. package/dist/os/rfc/next-id.js +165 -0
  215. package/dist/os/rfc/next-id.js.map +1 -0
  216. package/dist/os/rfc/probe-batch.d.ts.map +1 -1
  217. package/dist/os/rfc/probe-batch.js +6 -1
  218. package/dist/os/rfc/probe-batch.js.map +1 -1
  219. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  220. package/dist/os/rfc/rfc.module.js +36 -8
  221. package/dist/os/rfc/rfc.module.js.map +1 -1
  222. package/dist/os/rfc/types.d.ts +42 -6
  223. package/dist/os/rfc/types.d.ts.map +1 -1
  224. package/dist/os/rfc/types.js +6 -6
  225. package/dist/os/rfc/types.js.map +1 -1
  226. package/dist/os/rfc/verification-evidence.d.ts +1 -1
  227. package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
  228. package/dist/os/rfc/verification-evidence.js +81 -28
  229. package/dist/os/rfc/verification-evidence.js.map +1 -1
  230. package/dist/os/rfc/verification-origin.d.ts +8 -0
  231. package/dist/os/rfc/verification-origin.d.ts.map +1 -1
  232. package/dist/os/rfc/verification-origin.js +47 -0
  233. package/dist/os/rfc/verification-origin.js.map +1 -1
  234. package/dist/os/session/handlers/save.d.ts.map +1 -1
  235. package/dist/os/session/handlers/save.js +31 -7
  236. package/dist/os/session/handlers/save.js.map +1 -1
  237. package/dist/os/spec/spec-schema.d.ts +8 -0
  238. package/dist/os/spec/spec-schema.d.ts.map +1 -1
  239. package/dist/os/spec/spec-schema.js +1 -0
  240. package/dist/os/spec/spec-schema.js.map +1 -1
  241. package/dist/os/spec/spec-status.d.ts +8 -0
  242. package/dist/os/spec/spec-status.d.ts.map +1 -1
  243. package/dist/os/spec/spec-status.js +18 -6
  244. package/dist/os/spec/spec-status.js.map +1 -1
  245. package/dist/os/spec/spec-validate.d.ts.map +1 -1
  246. package/dist/os/spec/spec-validate.js +62 -15
  247. package/dist/os/spec/spec-validate.js.map +1 -1
  248. package/dist/os/spec/spec.module.d.ts.map +1 -1
  249. package/dist/os/spec/spec.module.js +13 -5
  250. package/dist/os/spec/spec.module.js.map +1 -1
  251. package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -1
  252. package/dist/os/system/handlers/system-map-validate.js +2 -1
  253. package/dist/os/system/handlers/system-map-validate.js.map +1 -1
  254. package/dist/os/system/handlers/system-outbox-scan.d.ts +11 -0
  255. package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -1
  256. package/dist/os/system/handlers/system-outbox-scan.js +54 -6
  257. package/dist/os/system/handlers/system-outbox-scan.js.map +1 -1
  258. package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -1
  259. package/dist/os/system/handlers/system-task-collect.js +11 -5
  260. package/dist/os/system/handlers/system-task-collect.js.map +1 -1
  261. package/dist/os/system/handlers/system-task-create.d.ts.map +1 -1
  262. package/dist/os/system/handlers/system-task-create.js +6 -1
  263. package/dist/os/system/handlers/system-task-create.js.map +1 -1
  264. package/dist/os/system/handlers/system-versionset-record.d.ts +14 -0
  265. package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -1
  266. package/dist/os/system/handlers/system-versionset-record.js +246 -6
  267. package/dist/os/system/handlers/system-versionset-record.js.map +1 -1
  268. package/dist/os/system/repo.d.ts +1 -1
  269. package/dist/os/system/repo.d.ts.map +1 -1
  270. package/dist/os/system/repo.js +53 -3
  271. package/dist/os/system/repo.js.map +1 -1
  272. package/dist/os/system/scenario-schemas.d.ts +109 -3
  273. package/dist/os/system/scenario-schemas.d.ts.map +1 -1
  274. package/dist/os/system/scenario-schemas.js +66 -10
  275. package/dist/os/system/scenario-schemas.js.map +1 -1
  276. package/dist/os/system/system.module.d.ts.map +1 -1
  277. package/dist/os/system/system.module.js +69 -17
  278. package/dist/os/system/system.module.js.map +1 -1
  279. package/dist/os/system/tests/contract-fixtures.d.ts +17 -0
  280. package/dist/os/system/tests/contract-fixtures.d.ts.map +1 -0
  281. package/dist/os/system/tests/contract-fixtures.js +109 -0
  282. package/dist/os/system/tests/contract-fixtures.js.map +1 -0
  283. package/dist/src/config/forge-config.d.ts +54 -18
  284. package/dist/src/config/forge-config.d.ts.map +1 -1
  285. package/dist/src/config/forge-config.js +41 -9
  286. package/dist/src/config/forge-config.js.map +1 -1
  287. package/dist/src/conformance/index.d.ts +6 -0
  288. package/dist/src/conformance/index.d.ts.map +1 -1
  289. package/dist/src/conformance/index.js +36 -1
  290. package/dist/src/conformance/index.js.map +1 -1
  291. package/dist/src/formal/proof-runner.d.ts.map +1 -1
  292. package/dist/src/formal/proof-runner.js +10 -2
  293. package/dist/src/formal/proof-runner.js.map +1 -1
  294. package/dist/src/migration-adapters/node-typescript-pnpm/index.js +3 -1
  295. package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
  296. package/dist/src/migration-adapters/phaser-pnpm/index.js +3 -1
  297. package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
  298. package/dist/src/onboarding/agents-generate.js +4 -4
  299. package/dist/src/onboarding/agents-generate.js.map +1 -1
  300. package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
  301. package/dist/src/onboarding/nested-agents-generate.js +3 -1
  302. package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
  303. package/dist/src/onboarding/prettierignore.d.ts.map +1 -1
  304. package/dist/src/onboarding/prettierignore.js +2 -0
  305. package/dist/src/onboarding/prettierignore.js.map +1 -1
  306. package/dist/src/onboarding/scaffold-project.js +2 -2
  307. package/dist/src/onboarding/scaffold-project.js.map +1 -1
  308. package/dist/src/onboarding/upgrade.d.ts.map +1 -1
  309. package/dist/src/onboarding/upgrade.js +14 -2
  310. package/dist/src/onboarding/upgrade.js.map +1 -1
  311. package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
  312. package/dist/src/onboarding/workspace-discovery.js +3 -1
  313. package/dist/src/onboarding/workspace-discovery.js.map +1 -1
  314. package/dist/src/skill-schema.d.ts +3 -0
  315. package/dist/src/skill-schema.d.ts.map +1 -1
  316. package/dist/src/skill-schema.js +9 -2
  317. package/dist/src/skill-schema.js.map +1 -1
  318. package/dist/src/spec/resolve-spec-source.d.ts +45 -0
  319. package/dist/src/spec/resolve-spec-source.d.ts.map +1 -0
  320. package/dist/src/spec/resolve-spec-source.js +153 -0
  321. package/dist/src/spec/resolve-spec-source.js.map +1 -0
  322. package/dist/src/utils/command-inventory.d.ts +28 -0
  323. package/dist/src/utils/command-inventory.d.ts.map +1 -0
  324. package/dist/src/utils/command-inventory.js +84 -0
  325. package/dist/src/utils/command-inventory.js.map +1 -0
  326. package/dist/src/utils/io.d.ts.map +1 -1
  327. package/dist/src/utils/io.js +6 -1
  328. package/dist/src/utils/io.js.map +1 -1
  329. package/dist/src/utils/repo-path.d.ts +10 -0
  330. package/dist/src/utils/repo-path.d.ts.map +1 -0
  331. package/dist/src/utils/repo-path.js +52 -0
  332. package/dist/src/utils/repo-path.js.map +1 -0
  333. package/dist/src/utils/spawn.d.ts +23 -0
  334. package/dist/src/utils/spawn.d.ts.map +1 -0
  335. package/dist/src/utils/spawn.js +83 -0
  336. package/dist/src/utils/spawn.js.map +1 -0
  337. package/docs/branch-model.md +1 -1
  338. package/docs/guides/existing-project.md +1 -1
  339. package/docs/maintainers/publishing.md +1 -1
  340. package/docs/reference/cli.md +8 -2
  341. package/docs/reference/profiles.md +1 -1
  342. package/os/adr/handlers/list-create.ts +26 -2
  343. package/os/adr/types.ts +4 -2
  344. package/os/compass/handlers/compass-audit-handler.ts +6 -1
  345. package/os/compass/handlers/compass-header-scaffold-handler.ts +12 -11
  346. package/os/compass/handlers/git-revision.ts +8 -2
  347. package/os/compass/handlers/summary-record.ts +25 -14
  348. package/os/compass/handlers/tests/compass-invariant-binding.test.ts +3 -2
  349. package/os/conformance/conformance.module.ts +21 -4
  350. package/os/conformance/handlers/conformance-validate.ts +108 -16
  351. package/os/conformance/handlers/tests/conformance-package-consumer.test.ts +200 -0
  352. package/os/core/archive-regen.ts +279 -0
  353. package/os/core/core.module.ts +176 -29
  354. package/os/core/docs-archive.test.ts +413 -3
  355. package/os/core/handlers/assets-helpers.ts +8 -3
  356. package/os/core/handlers/forge-autonomy-validate.ts +3 -1
  357. package/os/core/handlers/package-health.test.ts +418 -4
  358. package/os/core/handlers/package-health.ts +629 -7
  359. package/os/core/handlers/release-prepare.ts +5 -2
  360. package/os/flow/digest.ts +3 -1
  361. package/os/flow/dirty-classify.ts +120 -0
  362. package/os/flow/flow.module.ts +119 -24
  363. package/os/flow/gate-engine.ts +45 -0
  364. package/os/flow/git.ts +117 -29
  365. package/os/flow/handlers/flow-backmerge.ts +14 -4
  366. package/os/flow/handlers/flow-check.ts +27 -2
  367. package/os/flow/handlers/flow-cut.ts +124 -56
  368. package/os/flow/handlers/flow-discard.ts +33 -5
  369. package/os/flow/handlers/flow-fix.ts +22 -10
  370. package/os/flow/handlers/flow-hold.ts +20 -7
  371. package/os/flow/handlers/flow-install.ts +59 -12
  372. package/os/flow/handlers/flow-integrate.ts +933 -180
  373. package/os/flow/handlers/flow-open.ts +135 -11
  374. package/os/flow/handlers/flow-peers.ts +142 -0
  375. package/os/flow/handlers/flow-status.ts +45 -13
  376. package/os/flow/index.ts +8 -2
  377. package/os/flow/line-version.ts +2 -1
  378. package/os/flow/locks.ts +56 -14
  379. package/os/flow/ops-registry.ts +194 -0
  380. package/os/flow/preflight.ts +974 -0
  381. package/os/flow/publish.ts +200 -5
  382. package/os/flow/registry.ts +43 -7
  383. package/os/flow/scripts.ts +13 -2
  384. package/os/flow/session-checkout.ts +186 -0
  385. package/os/flow/standalone-invoke.ts +85 -0
  386. package/os/flow/tests/dirty-classify.test.ts +251 -0
  387. package/os/flow/tests/fixtures/branch-names.yaml +40 -40
  388. package/os/flow/tests/flow-cut.test.ts +21 -0
  389. package/os/flow/tests/flow-discard.test.ts +32 -0
  390. package/os/flow/tests/flow-guard-parity.test.ts +10 -2
  391. package/os/flow/tests/flow-install.test.ts +7 -3
  392. package/os/flow/tests/flow-integrate.gate-report.test.ts +144 -0
  393. package/os/flow/tests/flow-integrate.preflight.test.ts +565 -0
  394. package/os/flow/tests/flow-integrate.reattach.test.ts +197 -0
  395. package/os/flow/tests/flow-integrate.remediation.test.ts +254 -0
  396. package/os/flow/tests/flow-integrate.test.ts +698 -17
  397. package/os/flow/tests/flow-open.pending.test.ts +277 -0
  398. package/os/flow/tests/flow-open.test.ts +52 -9
  399. package/os/flow/tests/flow-push-publish.test.ts +124 -0
  400. package/os/flow/tests/flow-status.test.ts +31 -1
  401. package/os/flow/tests/locks.test.ts +39 -3
  402. package/os/flow/tests/ops-registry.test.ts +136 -0
  403. package/os/flow/tests/scripts.test.ts +5 -2
  404. package/os/flow/tests/state-roots.test.ts +8 -5
  405. package/os/flow/worktree-path.ts +9 -3
  406. package/os/formal/handlers/proof-check.test.ts +6 -3
  407. package/os/instructions/budget.test.ts +31 -0
  408. package/os/instructions/handlers/budget-validate.ts +13 -4
  409. package/os/instructions/instructions.module.ts +4 -1
  410. package/os/mission/handlers/archive.ts +22 -14
  411. package/os/mission/importer-block.ts +119 -0
  412. package/os/mission/lockfile.ts +41 -0
  413. package/os/mission/open-missions.ts +50 -0
  414. package/os/queue/decision-ledger.test.ts +18 -0
  415. package/os/queue/manifest.ts +17 -1
  416. package/os/rfc/acceptance.ts +30 -10
  417. package/os/rfc/decision-log.ts +13 -2
  418. package/os/rfc/frontmatter-io.ts +89 -1
  419. package/os/rfc/handlers/implement-stamp-deviations.test.ts +83 -0
  420. package/os/rfc/handlers/implement-stamp-deviations.ts +22 -2
  421. package/os/rfc/handlers/implement-stamp-stale.test.ts +5 -1
  422. package/os/rfc/handlers/implement-stamp.ts +16 -3
  423. package/os/rfc/handlers/index-graph.ts +5 -4
  424. package/os/rfc/handlers/lifecycle.test.ts +136 -0
  425. package/os/rfc/handlers/list-create.test.ts +126 -0
  426. package/os/rfc/handlers/list-create.ts +130 -10
  427. package/os/rfc/handlers/rfc-evidence-sync.test.ts +504 -0
  428. package/os/rfc/handlers/rfc-evidence-sync.ts +192 -2
  429. package/os/rfc/handlers/tests/index-graph.test.ts +2 -1
  430. package/os/rfc/handlers/validate-rules-rfc1454.test.ts +73 -0
  431. package/os/rfc/handlers/validate-rules.ts +103 -7
  432. package/os/rfc/handlers/validate.ts +68 -4
  433. package/os/rfc/next-id.ts +232 -0
  434. package/os/rfc/probe-batch.ts +6 -1
  435. package/os/rfc/rfc.module.ts +41 -8
  436. package/os/rfc/types.ts +31 -6
  437. package/os/rfc/verification-emit-freshness.test.ts +5 -1
  438. package/os/rfc/verification-emit.test.ts +5 -1
  439. package/os/rfc/verification-evidence.ts +99 -33
  440. package/os/rfc/verification-origin.ts +59 -0
  441. package/os/rfc/verification-refresh.test.ts +5 -1
  442. package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +5 -1
  443. package/os/session/handlers/save.ts +35 -7
  444. package/os/session/tests/session-save.test.ts +154 -0
  445. package/os/spec/spec-schema.ts +3 -0
  446. package/os/spec/spec-status.ts +22 -6
  447. package/os/spec/spec-validate.package-source.test.ts +187 -0
  448. package/os/spec/spec-validate.ts +65 -14
  449. package/os/spec/spec.module.ts +13 -5
  450. package/os/system/handlers/system-map-validate.ts +4 -2
  451. package/os/system/handlers/system-outbox-scan.ts +65 -21
  452. package/os/system/handlers/system-task-collect.ts +11 -5
  453. package/os/system/handlers/system-task-create.ts +6 -1
  454. package/os/system/handlers/system-versionset-record.ts +301 -16
  455. package/os/system/repo.ts +59 -18
  456. package/os/system/scenario-schemas.ts +91 -12
  457. package/os/system/system.module.ts +70 -17
  458. package/os/system/tests/contract-fixtures.ts +139 -0
  459. package/os/system/tests/scenario-pin-drift-check.test.ts +114 -0
  460. package/os/system/tests/scenario-validator-check.test.ts +96 -0
  461. package/os/system/tests/system-task-collect.test.ts +16 -0
  462. package/os/system/tests/system-task-dispatch.test.ts +4 -1
  463. package/os/system/tests/system-versionset.test.ts +7 -3
  464. package/os/system/tests/version-set-v2.test.ts +78 -0
  465. package/package.json +9 -1
  466. package/skills/fo/fo-doctor/SKILL.md +151 -0
  467. package/skills/fo/fo-handoff/SKILL.md +22 -0
  468. package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +2 -1
  469. package/skills/fo/fo-idea-implement/SKILL.md +5 -2
  470. package/skills/fo/fo-idea-plan/SKILL.md +5 -5
  471. package/skills/fo/fo-session-retro/SKILL.md +45 -13
  472. package/skills/fo/fo-spec-ingest/SKILL.md +8 -0
  473. package/skills/fo/fo-system-dispatch/SKILL.md +1 -0
  474. package/skills/meta/skill-create/SKILL.md +2 -1
  475. package/src/bin-entry.test.ts +3 -1
  476. package/src/config/forge-config.ts +57 -13
  477. package/src/conformance/index.ts +46 -1
  478. package/src/formal/proof-runner.ts +10 -2
  479. package/src/migration-adapters/node-typescript-pnpm/index.ts +3 -1
  480. package/src/migration-adapters/phaser-pnpm/index.ts +3 -1
  481. package/src/onboarding/agents-generate.ts +4 -4
  482. package/src/onboarding/nested-agents-generate.ts +3 -1
  483. package/src/onboarding/prettierignore.ts +2 -0
  484. package/src/onboarding/scaffold-project.ts +2 -2
  485. package/src/onboarding/upgrade.ts +13 -2
  486. package/src/onboarding/workspace-discovery.ts +3 -1
  487. package/src/pipeline-status.test.ts +1 -1
  488. package/src/skill-schema.ts +9 -2
  489. package/src/spec/resolve-spec-source.ts +184 -0
  490. package/src/tests/acceptance-probe-kinds.test.ts +3 -1
  491. package/src/tests/agents-generate-domain.test.ts +3 -2
  492. package/src/tests/agents-generate.test.ts +2 -1
  493. package/src/tests/create-flow.test.ts +3 -1
  494. package/src/tests/create.test.ts +12 -2
  495. package/src/tests/editable-generated-region.test.ts +2 -2
  496. package/src/tests/fixtures/agents-generate-business-before.txt +2 -0
  497. package/src/tests/implement-stamp.test.ts +5 -2
  498. package/src/tests/prettierignore-manage.test.ts +11 -0
  499. package/src/tests/rfc-implement-stamp-governance.test.ts +6 -2
  500. package/src/tests/rfc-verification-verdict-ingest.test.ts +5 -1
  501. package/src/tests/scaffold-project.test.ts +3 -1
  502. package/src/tests/upgrade.test.ts +79 -3
  503. package/src/tests/workspace-discovery.test.ts +4 -3
  504. package/src/utils/command-inventory.ts +105 -0
  505. package/src/utils/io.ts +6 -1
  506. package/src/utils/repo-path.ts +49 -0
  507. package/src/utils/spawn.ts +88 -0
  508. package/src/tests/rfc-evidence-sync.test.ts +0 -369
  509. package/src/tests/skill-agents-sync.test.ts +0 -192
@@ -0,0 +1,78 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>RFC-1541 AC-1..AC-3 — version-set@2 contracts resolved from root lockfile importers; @1 files stay readable; SYSTEM-VS-06.</purpose>
4
+ <non-goals><item>Check kinds are covered by the validator/pin-drift test files.</item></non-goals>
5
+ </MODULE_CONTRACT>
6
+ */
7
+ // @vitest-environment node
8
+ import { readFile } from "node:fs/promises";
9
+ import path from "node:path";
10
+ import { describe, expect, it } from "vitest";
11
+ import YAML from "yaml";
12
+ import { runSystemVersionSetRecord } from "../handlers/system-versionset-record.ts";
13
+ import { lockfileVersion } from "../handlers/system-versionset-record.ts";
14
+ import { versionSetSchema } from "../scenario-schemas.ts";
15
+ import { makeContext } from "./helpers.ts";
16
+ import { SPEC_PKG, TAG, scenario, specConsumer, systemWith } from "./contract-fixtures.ts";
17
+
18
+ const ok = ` - product: beta\n argv: ["${process.execPath}", "-e", "0"]\n`;
19
+
20
+ describe("version-set@2 (RFC-1541)", () => {
21
+ it("AC-1: records contracts from the tag's root lockfile importer, peer suffix stripped", async () => {
22
+ const beta = await specConsumer("0.1.9");
23
+ const root = await systemWith(
24
+ { beta },
25
+ { "system/scenarios/s.yaml": scenario("s", ["beta"], ok) },
26
+ );
27
+ const res = await runSystemVersionSetRecord(
28
+ { argv: [], flags: { products: `beta=${TAG}`, scenarios: "s" } },
29
+ makeContext(root),
30
+ );
31
+ expect(res.exitCode).toBe(0);
32
+ const set = YAML.parse(
33
+ await readFile(path.join(root, "system/version-sets/VS-0001.yaml"), "utf8"),
34
+ );
35
+ expect(set.schema).toBe("forge/version-set@2");
36
+ expect(set.contracts).toEqual({ beta: { [SPEC_PKG]: "0.1.9" } });
37
+ expect(set.warnings).toEqual([]);
38
+ expect(versionSetSchema.safeParse(set).success).toBe(true);
39
+ });
40
+
41
+ it("AC-2: an existing @1 set (VS-0002 shape) still parses", () => {
42
+ const v1 = {
43
+ schema: "forge/version-set@1",
44
+ id: "VS-0002",
45
+ products: { werkstatt: "v6.458.1", lagebild: "v0.1.1" },
46
+ scenarios: ["verbund-spec-conformance"],
47
+ evidence: { "verbund-spec-conformance": `sha256:${"0".repeat(64)}` },
48
+ verifiedAt: "2026-11-05T11:49:07.870Z",
49
+ };
50
+ expect(versionSetSchema.safeParse(v1).success).toBe(true);
51
+ });
52
+
53
+ it("AC-3: a declared package with no resolvable version fails with SYSTEM-VS-06", async () => {
54
+ const beta = await specConsumer(null);
55
+ const root = await systemWith(
56
+ { beta },
57
+ { "system/scenarios/s.yaml": scenario("s", ["beta"], ok) },
58
+ );
59
+ const res = await runSystemVersionSetRecord(
60
+ { argv: [], flags: { products: `beta=${TAG}`, scenarios: "s" } },
61
+ makeContext(root),
62
+ );
63
+ expect(res.exitCode).toBe(1);
64
+ expect(res.data!.diagnostics.map((d) => d.ruleId)).toContain("SYSTEM-VS-06");
65
+ expect(res.data!.created).toBe(false);
66
+ });
67
+
68
+ it("lockfileVersion reads devDependencies and ignores nested importers", () => {
69
+ const lock = {
70
+ importers: {
71
+ ".": { devDependencies: { x: { version: "1.2.3(peer@1.0.0)" } } },
72
+ "packages/a": { dependencies: { y: { version: "9.9.9" } } },
73
+ },
74
+ };
75
+ expect(lockfileVersion(lock, "x")).toBe("1.2.3");
76
+ expect(lockfileVersion(lock, "y")).toBeNull();
77
+ });
78
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warpgogol/forge",
3
- "version": "9.3.1",
3
+ "version": "9.4.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -52,6 +52,10 @@
52
52
  "types": "./src/reachability/command-mentions.ts",
53
53
  "default": "./src/reachability/command-mentions.ts"
54
54
  },
55
+ "./spec": {
56
+ "types": "./src/spec/resolve-spec-source.ts",
57
+ "default": "./src/spec/resolve-spec-source.ts"
58
+ },
55
59
  "./compass": {
56
60
  "types": "./src/compass/index.ts",
57
61
  "default": "./src/compass/index.ts"
@@ -502,6 +506,10 @@
502
506
  "types": "./dist/src/conformance/index.d.ts",
503
507
  "default": "./dist/src/conformance/index.js"
504
508
  },
509
+ "./spec": {
510
+ "types": "./dist/src/spec/resolve-spec-source.d.ts",
511
+ "default": "./dist/src/spec/resolve-spec-source.js"
512
+ },
505
513
  "./formal": {
506
514
  "types": "./dist/src/formal/index.d.ts",
507
515
  "default": "./dist/src/formal/index.js"
@@ -0,0 +1,151 @@
1
+ ---
2
+ name: fo-doctor
3
+ description: Audit the agent session environment — window discipline, watcher excludes, rule-file budget, session DB health, stall metrics. Read-only except an opt-in write offer for missing config.
4
+ invocation: user
5
+ category: fo
6
+ concerns: document-only
7
+ dependsOn: ['my-preferences']
8
+ languagePolicy: ref(PREFERENCES.md)
9
+ triggerPhrases: ["check my session environment", "agent turns keep stalling", "session doctor", "environment audit"]
10
+ ---
11
+
12
+ <!--
13
+ <MODULE_CONTRACT>
14
+ <purpose>fo-doctor skill — RFC-1522: reusable session-environment audit. Turns the agent-turn-stall investigation (F-0002) into durable checks a session can run at start or on demand. Read-only except the explicit opt-in "write missing config" offer — a doctor must be safe to run anywhere, including a superfolder with no git gates.</purpose>
15
+ <non-goals>
16
+ <item>Do not execute skill logic — this document instructs agents; it is not runnable code.</item>
17
+ <item>Do not fix findings autonomously — report + offer; the operator decides.</item>
18
+ </non-goals>
19
+ </MODULE_CONTRACT>
20
+ <CHANGE_SUMMARY>
21
+ <item>RFC-1522: initial skill — five checks (windows, watchers, rule budget, DB health, stall metrics) + sessions.db prune runbook.</item>
22
+ <item>RFC-1522: add fo-doctor session-environment audit skill
23
+
24
+ Five checks (window discipline, watcher/index excludes, instructions.budget.validate, sessions.db health vs 2 GB, stall metrics via continue-nudge/lazy-load queries) plus the sessions.db prune runbook. Read-only except the opt-in write-missing-config offer. agents-generate golden fixture regenerated for the new skill row.</item>
25
+ <item>RFC-1522: slim AGENTS.md to injection-safe skeletons + extract docs/agent-guides + budget gate
26
+
27
+ 8 rule files (1.19 MB -> 50.6 KB total) split into <=12,288-byte skeletons; 212 moved ## sections preserved verbatim across 21 guides (heading parity verified). forge.yaml instructions.budget.enforce promotes INSTR-01 to an error gate at the 3072-token ceiling. Withdrawn rules.budget.check removed — dedupe onto the RFC-1466 command. fo-doctor invokes the real gate.</item>
28
+ <item>RFC-1522: fix sessions.db prune runbook — seconds cutoff, contentless-delete FTS prune, full table list</item>
29
+ </CHANGE_SUMMARY>
30
+ -->
31
+
32
+ # fo-doctor
33
+
34
+ Before starting, read `PREFERENCES.md` at the repository root. If the file is missing or `aiLanguage` is unset, ask the operator once and create the file using the `my-preferences` skill semantics.
35
+
36
+ Audit the environment the session is running in. The failure modes this catches are all observable but were previously checked by hand: agent turns that end silently after file edits, oversized rule files that fail IDE injection, doubled file-event processing, a bloated local session database. Every check is read-only; the single exception is the explicit write offer in check 2 — ask before writing anything.
37
+
38
+ ## Process
39
+
40
+ Run all five checks, then report one table: `check | status (ok|warn|fail|n/a) | finding | remedy`. `n/a` means the substrate is absent (e.g. no Devin session DB on a non-Devin host) — report it, never fake a pass.
41
+
42
+ ### 1. Window discipline
43
+
44
+ Determine whether the IDE workspace root is a **superfolder** (contains independent repos plus `*@*` session worktrees) or a single repo, and whether both a superfolder AND a `<repo>@<branch>` worktree are open at once.
45
+
46
+ - List directories matching `*@*` next to the workspace root: `ls -d <parent>/*@* 2>/dev/null`.
47
+ - If the current workspace root itself is a superfolder containing `*@*` dirs → **warn**: "superfolder window is processing every worktree file event; prefer working from the session-worktree window only, or close the superfolder window while a worktree session runs."
48
+ - One window total is the rule (superfolder AGENTS.md): the session worktree OR the superfolder, never both.
49
+
50
+ ### 2. Watcher / index excludes
51
+
52
+ Only meaningful at a superfolder root. Verify:
53
+
54
+ - `.windsurfignore` exists and excludes `*@*/`, `systems-cache/`, `systems-git/`, `systems-retired/`, frozen/transient snapshot dirs, `.cache/`.
55
+ - `.vscode/settings.json` `files.watcherExclude` + `search.exclude` cover the same set plus `**/node_modules/**`, and `git.autoRepositoryDetection` is `openEditors` (limits SCM scanning in multi-repo roots).
56
+
57
+ Missing or incomplete → **warn** and OFFER to write the missing blocks (show the exact diff first, wait for approval — this is the skill's only write path).
58
+
59
+ ### 3. Rule-file budget
60
+
61
+ Run the budget gate and list offenders:
62
+
63
+ ```sh
64
+ pnpm exec forge instructions.budget.validate --json
65
+ # or, where forge is not on PATH for this repo:
66
+ pnpm exec werkstatt run instructions.budget.validate --json
67
+ ```
68
+
69
+ - exit 0 → ok, report `filesScanned` and the diagnostic count.
70
+ - exit 1 (only under `instructions.budget.enforce: true` in `forge.yaml`) or any `INSTR-01` row → **warn**: list each over-budget file; remedy is extraction into `docs/agent-guides/<topic>.md` under a slimmed skeleton, never budget inflation. A repo missing `enforce: true` gets a recommendation to enable it so the ceiling gates rather than only reports.
71
+
72
+ ### 4. Session DB health
73
+
74
+ Report the local Devin session store size vs threshold (warn > 2 GB):
75
+
76
+ ```sh
77
+ du -sh ~/.local/share/devin/cli/sessions.db*
78
+ ```
79
+
80
+ - Missing → `n/a` (non-Devin host).
81
+ - Over threshold → **warn** + point at the prune runbook below. Pruning requires Devin Desktop fully quit — never attempt it inside a live session.
82
+
83
+ ### 5. Stall metrics (regression baseline)
84
+
85
+ When `sessions.db` exists, count the two stall signatures over recent sessions:
86
+
87
+ ```sh
88
+ cd ~/.local/share/devin/cli
89
+
90
+ # `continue` nudges per session (top offenders)
91
+ sqlite3 -readonly sessions.db "
92
+ SELECT session_id, COUNT(*) FROM message_nodes
93
+ WHERE json_extract(chat_message,'\$.role')='user'
94
+ AND json_extract(chat_message,'\$.content')='continue'
95
+ GROUP BY session_id ORDER BY 2 DESC LIMIT 10;"
96
+
97
+ # lazy-load-failure rows per session
98
+ sqlite3 -readonly sessions.db "
99
+ SELECT session_id, COUNT(*) FROM message_nodes
100
+ WHERE chat_message LIKE '%could not be injected due to token limits%'
101
+ GROUP BY session_id ORDER BY 2 DESC LIMIT 10;"
102
+ ```
103
+
104
+ - `sqlite3` absent → `n/a`.
105
+ - Any recent session with `continue` count > 5 or lazy-load rows > 0 → **warn** with the counts; this is the metric the rule-budget work should drive to ~0 over time.
106
+
107
+ ## Report
108
+
109
+ Close with the five-row table plus a one-line verdict. Only `fail`/`warn` rows need a remedy column; remedies are actions for the OPERATOR or a follow-up session — the doctor does not restructure files, quit the IDE, or prune the DB itself.
110
+
111
+ ## Reference: sessions.db prune runbook (operator-run, Devin quit first)
112
+
113
+ Session history is local-only; pruning loses old chat history in the Devin panel. Default scope: keep last ~14 days — confirm with the operator.
114
+
115
+ ```sh
116
+ # 1. quit Devin Desktop (all windows), verify no processes remain
117
+ pgrep -f "devin-desktop|devin acp" || echo "clean"
118
+
119
+ # 2. checkpoint the WAL back into the main file
120
+ sqlite3 ~/.local/share/devin/cli/sessions.db "PRAGMA wal_checkpoint(TRUNCATE);"
121
+
122
+ # 3. verify the timestamp unit BEFORE deleting — last_activity_at is INTEGER but
123
+ # schema-dependent: ~1.7e9 = seconds (use -14 days as below), ~1.7e12 = millis
124
+ # (append *1000). A wrong guess toward seconds silently deletes EVERYTHING.
125
+ sqlite3 ~/.local/share/devin/cli/sessions.db "SELECT last_activity_at FROM sessions ORDER BY last_activity_at DESC LIMIT 1;"
126
+
127
+ # 4. drop sessions older than 14 days across all session-scoped tables
128
+ # (cutoff shown for seconds — see step 3), then prune FTS ghosts
129
+ sqlite3 ~/.local/share/devin/cli/sessions.db "
130
+ DELETE FROM message_nodes WHERE session_id IN (SELECT id FROM sessions WHERE last_activity_at < strftime('%s','now','-14 days'));
131
+ DELETE FROM tool_call_state WHERE session_id IN (SELECT id FROM sessions WHERE last_activity_at < strftime('%s','now','-14 days'));
132
+ DELETE FROM rendered_commits WHERE session_id IN (SELECT id FROM sessions WHERE last_activity_at < strftime('%s','now','-14 days'));
133
+ DELETE FROM subagent_heads WHERE session_id IN (SELECT id FROM sessions WHERE last_activity_at < strftime('%s','now','-14 days'));
134
+ DELETE FROM live_row_times WHERE session_id IN (SELECT id FROM sessions WHERE last_activity_at < strftime('%s','now','-14 days'));
135
+ DELETE FROM prompt_history WHERE session_id IN (SELECT id FROM sessions WHERE last_activity_at < strftime('%s','now','-14 days'));
136
+ DELETE FROM sessions WHERE last_activity_at < strftime('%s','now','-14 days');
137
+ DELETE FROM message_search WHERE NOT EXISTS (SELECT 1 FROM message_nodes WHERE message_nodes.rowid = message_search.rowid);
138
+ VACUUM;"
139
+
140
+ # 5. stale session locks are safe to drop too
141
+ rm -f ~/.local/share/devin/cli/session_locks/*.lock
142
+ ```
143
+
144
+ `message_search` is a `contentless_delete=1` FTS5 shadow whose rowid mirrors `message_nodes.rowid` — `INSERT ... VALUES('rebuild')` is **rejected** on contentless tables, so ghost entries go via the `NOT EXISTS` delete above (keeps search intact for retained sessions). On schema drift, verify before trusting: `SELECT sql FROM sqlite_master WHERE name='message_search'` and `PRAGMA table_info(<table>)`. Nuclear alternative: quit Devin, `mv sessions.db sessions.db.bak-<date>` + remove `-wal`/`-shm` — the DB recreates empty.
145
+
146
+ ## Constraints
147
+
148
+ - **Read-only by default.** The only permitted write is the check-2 excludes/config offer, and only after showing the operator the exact content.
149
+ - **Never prune `sessions.db` inside a live session** — live `devin acp` processes hold the DB; the runbook is for the operator between sessions.
150
+ - **Report `n/a` honestly** when a substrate is absent (non-Devin host, no sqlite3, no superfolder) — a skipped check is not a pass.
151
+ - **Session summary.** End every session with the closing block defined in `_shared/fo-session-summary.md`.
@@ -21,6 +21,9 @@ triggerPhrases: ["create a handoff document", "compact conversation for next age
21
21
 
22
22
  Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from frontmatter description). Fix non-skill-markdown exclusion to check filename not workspace-relative path (packages/AGENTS.md escaped it). Add .coverage to ignoredDirs.</item>
23
23
  <item>RFC-1154: commit references resolve by project type — ecosystem.commit where registered, plain git commit in forge workshops</item>
24
+ <item>RFC-1522: defer mid-session rule-file edits and add handoff state checkpoint
25
+
26
+ fo-idea-implement + fo-idea-plan: rule-file edits collect during plan steps and apply in one pass before rfc.verification.emit (F-0002 — every save re-arms IDE rules re-resolution). fo-handoff: every handoff carries a compact state: YAML block (goal/constraints/verified/changed/validation/rejected/next); dying sessions write it to .agents/memory/daily/<date>.md.</item>
24
27
  </CHANGE_SUMMARY>
25
28
  -->
26
29
 
@@ -58,6 +61,25 @@ Include:
58
61
  - **Next steps** — concrete, actionable items the next agent should pick up.
59
62
  - **Memory layer pointer** — tell the next agent to read `.agents/memory/MEMORY.md` and recent `.agents/memory/daily/` files for project context.
60
63
 
64
+ ### 2a. Structured state checkpoint
65
+
66
+ Every handoff carries a compact machine-shaped state block — a resumed session reloads it for a fraction of a transcript tail's cost, and stalls make resumes routine (F-0002). Emit it as a `state:` YAML fence inside the handoff document (single greppable file) or a sidecar `state.yaml` next to it:
67
+
68
+ ```yaml
69
+ state:
70
+ goal: <one line>
71
+ constraints: [<hard rules in force>]
72
+ verified: [<facts confirmed by commands/tests>]
73
+ changed: [<files touched>]
74
+ validation: { unit: passed|not_run, e2e: passed|failed|not_run }
75
+ rejected: [<hypotheses tested and dropped — prevents re-trying>]
76
+ next: [<ordered remaining steps>]
77
+ ```
78
+
79
+ Properties that matter: `verified` facts are distinct from assumptions (anything not confirmed by a command or test does not belong here); `rejected` hypotheses persist across resumes (agents otherwise re-run dead ends); the block stays small enough to re-inject at session start (tens of lines, not hundreds).
80
+
81
+ **Dying-session fallback:** an agent that realizes a session is degrading mid-task (repeated silent turn-ends, forced `continue` nudges) writes this same block to `.agents/memory/daily/<date>.md` *before* continuing — the file the ecosystem already maintains — so the state survives even if no full handoff is ever emitted.
82
+
61
83
  Do not duplicate content already captured in other artifacts (specs, plans, ADRs, issues, commits, diffs). Reference them by path or URL instead. Do not duplicate content from `.agents/memory/` — reference it by path.
62
84
 
63
85
  Redact any sensitive information, such as API keys, passwords, or personally identifiable information.
@@ -79,7 +79,8 @@ Before submitting criteria, run this line-level reject check. A criterion that t
79
79
  1. **Not atomic** — two independently testable behaviors joined by "and" in a single criterion. Split into separate `AC-N` items. (V-39)
80
80
  2. **Unbounded quantity** — unitless numeric concepts: "fast", "scalable", "reasonable load", "efficiently", "high performance", "low latency". Replace with a specific number or reference the decision that sets it. (V-40)
81
81
  3. **Weasel verb** — closed set: "handle gracefully", "behave correctly", "as appropriate", "robust", "user-friendly", "works correctly", "is reliable". Replace with a specific observable behavior. (V-41)
82
- 4. **No verification mapping** — a checked criterion without `(evidence: ...)` pointing to a mechanism. Already enforced by V-27 and V-37.
82
+ 4. **Fixed input without a containing pattern** — every `## Fixed inputs` row must bind to an `AC-N` whose bound `file-contains`/`page` probe pattern literally contains the FI value; a FI bound to a test-only criterion fails V-50. (V-50)
83
+ 5. **No verification mapping** — a checked criterion without `(evidence: ...)` pointing to a mechanism. Already enforced by V-27 and V-37.
83
84
 
84
85
  The trigger lists for V-40 and V-41 are configuration constants in `validate-rules.ts` — they can be extended without an RFC.
85
86
 
@@ -20,7 +20,6 @@ triggerPhrases: ["implement this RFC", "execute the implementation plan", "reali
20
20
  </non-goals>
21
21
  </MODULE_CONTRACT>
22
22
  <CHANGE_SUMMARY>
23
- <item>RFC-1333: step 4 — acceptance verification mode in fo-review, step 4.4b in fo-idea-implement, RFC-IMP-12 docs</item>
24
23
  <item>COMMIT-02: commit templates — governed ids moved to the scope position (fix(rfc-xxxx): repair …, never fix: RFC-XXXX — …); illegal trace: prefix replaced with docs(adr-xxxx):</item>
25
24
  <item>RFC-1440: fo-reproduce skill + pipeline wiring
26
25
 
@@ -31,7 +30,10 @@ verify step, fo-add-tests defect branch; AGENTS.md reproduction-first rule;
31
30
  compass inventory regenerated.</item>
32
31
  <item>RFC-1454: review deviations recorded in the RFC — IMP-15 gate, V-49 provenance, skill contract</item>
33
32
  <item>RFC-1460: recurring frictions escalate to mechanical measures — FRICTION-06/07/08, registry flips, session-retro escalation</item>
34
- <history>RFC-1097, RFC-1224, RFC-1250, RFC-1310, RFC-1317, RFC-1322, RFC-1332</history>
33
+ <item>RFC-1522: defer mid-session rule-file edits and add handoff state checkpoint
34
+
35
+ fo-idea-implement + fo-idea-plan: rule-file edits collect during plan steps and apply in one pass before rfc.verification.emit (F-0002 — every save re-arms IDE rules re-resolution). fo-handoff: every handoff carries a compact state: YAML block (goal/constraints/verified/changed/validation/rejected/next); dying sessions write it to .agents/memory/daily/<date>.md.</item>
36
+ <history>RFC-1097, RFC-1224, RFC-1250, RFC-1310, RFC-1317, RFC-1322, RFC-1332, RFC-1333</history>
35
37
  </CHANGE_SUMMARY>
36
38
  -->
37
39
 
@@ -138,6 +140,7 @@ Stage only the files touched by this step. Do not stage unrelated changes — an
138
140
  - **Falsified-routes ledger.** Before choosing or changing a step's approach, read the plan's `## Falsified routes` section — a `Forbidden retry: yes` row rejects the approach unless you can state a new fact that invalidates its root cause. A plan-prescribed route matching a forbidden row counts as an approach change — the consult applies even when the route was chosen by a previous session. When an approach is abandoned after a real attempt, append a row (route, root cause, falsified-at evidence) before moving on. See `_shared/fo-pipeline-conventions.md` §Falsified-routes ledger.
139
141
  - **Compass scaffolding.** New non-trivial source files in `apps/` or `packages/` must carry `MODULE_CONTRACT` and `CHANGE_SUMMARY` scaffolding. Check the project's invariants file for the canonical Compass markup rule.
140
142
  - **Compass terminology.** Use Compass (not GRACE) in all new code, documentation, and log messages.
143
+ - **Defer rule-file edits.** Do not edit `AGENTS.md`, `.windsurfrules`, `CLAUDE.md`, `*.xml` rule surfaces, or skill files during plan steps — every save re-triggers the IDE's rules re-resolution and stalls the agent turn mid-stream (F-0002). Collect required rule-file changes (e.g. AC-probe literals) in the plan's working notes and apply them in ONE edit pass immediately before `rfc.verification.emit`, so probes still see final content while mid-session churn is eliminated.
141
144
 
142
145
  #### 4.3b. Add tests only with a reason
143
146
 
@@ -20,10 +20,6 @@ triggerPhrases: ["plan the implementation for this RFC", "create implementation
20
20
  </non-goals>
21
21
  </MODULE_CONTRACT>
22
22
  <CHANGE_SUMMARY>
23
- <item>RFC-1250: collect-mode contract — open questions and grilling emit to
24
- the decision ledger; draft plan carries PENDING DECISION markers;
25
- draft-to-accepted transition deferred to the resolution phase (window =
26
- acceptance act).</item>
27
23
  <item>RFC-1097: sweep — SKILL.md headers + classification fixes
28
24
 
29
25
  Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from frontmatter description). Fix non-skill-markdown exclusion to check filename not workspace-relative path (packages/AGENTS.md escaped it). Add .coverage to ignoredDirs.</item>
@@ -41,6 +37,10 @@ maturation skips parked/deferred items; uncovered imperative ask sites
41
37
  gain collect riders (ADR code-trace, NC markers, audit-verdict guard).</item>
42
38
  <item>RFC-1322: resolve fo-review findings — resolver hardening, shared gate evaluator, dry-run JSON</item>
43
39
  <item>RFC-1332: step 1 — verifyReproduction binding key; drop platform ids from pipeline skill text (SKILL-17)</item>
40
+ <item>RFC-1522: defer mid-session rule-file edits and add handoff state checkpoint
41
+
42
+ fo-idea-implement + fo-idea-plan: rule-file edits collect during plan steps and apply in one pass before rfc.verification.emit (F-0002 — every save re-arms IDE rules re-resolution). fo-handoff: every handoff carries a compact state: YAML block (goal/constraints/verified/changed/validation/rejected/next); dying sessions write it to .agents/memory/daily/<date>.md.</item>
43
+ <history>RFC-1250</history>
44
44
  </CHANGE_SUMMARY>
45
45
  -->
46
46
 
@@ -176,7 +176,7 @@ Step ordering follows the contract-first pattern:
176
176
 
177
177
  1. **Contracts** — types, schemas, frontmatter fields, ontology catalogs.
178
178
  2. **Commands** — Site OS command handlers, registry, pipeline wiring.
179
- 3. **Documentation** — `AGENTS.md`, Compass XML (`ref(forge.yaml bindings.paths.compassDocs)`), `ref(forge.yaml bindings.paths.invariantsFile)` (if new DNA invariant).
179
+ 3. **Documentation** — `AGENTS.md`, Compass XML (`ref(forge.yaml bindings.paths.compassDocs)`), `ref(forge.yaml bindings.paths.invariantsFile)` (if new DNA invariant). Rule-file edits (`AGENTS.md`, `.windsurfrules`, `CLAUDE.md`, `*.xml` rule surfaces, skill files) MUST be planned as ONE late step immediately before Evidence, never spread across implementation steps — every mid-session save re-triggers the IDE's rules re-resolution and stalls the agent turn (F-0002). Earlier steps collect the required rule-file changes in their working notes; probe-required literals still land before `rfc.verification.emit`.
180
180
  4. **Tests** — unit tests, fixture files, test matrix.
181
181
  5. **Validation** — run `rfc.validate`, `build:check`, acceptance probes.
182
182
  6. **Evidence** — run `rfc.verification.emit`, commit evidence file.
@@ -20,12 +20,17 @@ triggerPhrases: ["завершаем", "протокол завершения",
20
20
  </non-goals>
21
21
  </MODULE_CONTRACT>
22
22
  <CHANGE_SUMMARY>
23
- <item>RFC-1460: recurring frictions escalate to mechanical measures — FRICTION-06/07/08, registry flips, session-retro escalation</item>
24
- <item>RFC-1460: address review r1 findings — F-0007 obligation token, escalated-match autopsy branch, FRICTION-08 path-shape + governance-doc inference</item>
25
- <item>RFC-1487: step 7 — remove RFC-1462 session-worktree paths, COMMIT-FGN-01 guard, and .sessions model; document flow lifecycle</item>
26
- <item>RFC-1487: drop RFC-1487 id from fo-session-retro instruction text (SKILL-17)</item>
27
- <item>RFC-1491: step 6 — outbound AGENTS paragraphs, retro step 3f, FLOW-PUSH/HOLD/GUARD-05/10/INT-11 catalog</item>
28
- <history>ADR-0119, ADR-0121, RFC-1097, RFC-1247, RFC-1433</history>
23
+ <item>RFC-1528: worktree-first preamble — session-end writes go through a dedicated session worktree; docs.archive prefers the kernel host</item>
24
+ <item>RFC-1531: add flow.integrate remediation flags on the shared dirty classifier</item>
25
+ <item>RFC-1534: lint probe patterns, sync amends counterparts, name next free ledger id</item>
26
+ <item>ADR-0126: docs-rule batch — 16 friction measures landed</item>
27
+ <item>RFC-1460: draft mechanical-obligation RFCs and land harvest doc rules
28
+
29
+ RFC-1460 harvest wave 2026-11-09: five draft RFCs (derive-and-repair flow
30
+ surfaces, quiet kernel output, staged-commit/invocation guards, fixed-branch
31
+ onboarding-status routing, forge task prettier coverage), seven docs-rule
32
+ landings, registry flips — 25 entries served, F-0025 stays external.</item>
33
+ <history>ADR-0119, ADR-0121, RFC-1097, RFC-1247, RFC-1433, RFC-1460, RFC-1487, RFC-1491</history>
29
34
  </CHANGE_SUMMARY>
30
35
  -->
31
36
 
@@ -62,6 +67,24 @@ When the operator says any of the following, the agent's response is **BLOCKED**
62
67
 
63
68
  This skill IS the session-end protocol — it runs transcript save, temp cleanup, docs.archive, clean tree check, RFC verification, insight triage, the friction autopsy, and produces the closing block. Do not substitute it with a manual summary. The closing block comes from this skill's report, not from the agent directly.
64
69
 
70
+ ## Worktree-first preamble (NON-NEGOTIABLE on the fixed branch model)
71
+
72
+ Session-end writes (transcript save, `docs.archive` moves, `frictions.yaml` updates, rule edits, retro commits) MUST NOT be produced in the primary checkout — the primary stays clean, and every tracked write rides a session worktree into `develop` through `flow.integrate`. Before Step 0, decide whether this retro will produce tracked writes:
73
+
74
+ - **Writes expected** (nearly always — the Step 0 transcript alone counts when `saveSessions` is true) AND the current directory is a **primary checkout** on the fixed branch model → open a dedicated session worktree FIRST:
75
+
76
+ ```bash
77
+ rtk pnpm exec werkstatt run flow.open --kind session --slug session-retro-<stamp>
78
+ ```
79
+
80
+ `<stamp>` is `YYYYMMDD-HHMM` of the invocation moment. Detection: `flow.status` lists registered `auto/session-*` branches — when cwd is already a flow worktree (its branch is registered), skip this step; writes already land in the right place. Repositories not on the fixed branch model (`flow.status` refuses, no registered branches) skip this step silently.
81
+
82
+ - **Read-only retro** (the session produced zero tracked writes and none of Steps 0–4 will create any — e.g. `saveSessions: false` with a clean tree and no insights to route) → no worktree needed; run the retro in place.
83
+
84
+ When the preamble opened a worktree, every subsequent step — Step 0 transcript, archive, friction/registry writes, retro commits — runs inside it. All writes batch into a single `flow.integrate` at Step 3e. Do NOT open one worktree per write, and do NOT integrate from the primary checkout.
85
+
86
+ **Artifact home (F-0105):** every retro artifact — the Step 0 transcript, memory writes, frictions.yaml entries, routed rules — lands in the operator's working repo (the PREFERENCES home whose `forge.yaml` resolves this run), never in the resolved skill's host repo. A skill twin resolving from another checkout does not relocate the writes.
87
+
65
88
  ## Step 0: Save session transcript (NON-NEGOTIABLE when saveSessions is true)
66
89
 
67
90
  This step ensures the session transcript is persisted to `docs/sessions/` before any retro work begins. Without it, the transcript is lost when the conversation closes.
@@ -85,7 +108,8 @@ The agent reconstructs the current session's conversation from its context windo
85
108
 
86
109
  **Instructions:**
87
110
 
88
- 1. Create the directory `docs/sessions/.raw/` if it does not exist.
111
+ 1. Create the directory `docs/sessions/.raw/` if it does not exist. **Synthesized timestamps MUST fall inside the real session window** — `session.save` derives the session id from the first timestamp, so a 2025-epoch placeholder produces a wrongly-dated session file and forces a redo. Anchor the first line to the session's actual start and step forward from there.
112
+
89
113
  2. Generate a timestamp-based filename: `<YYYY-MM-DD-HH-MM-SS>-session.atif` (use current time in the operator's timezone).
90
114
  3. Reconstruct the conversation from context — include every user message and assistant response you can recall from the current session, in chronological order. This is a best-effort reconstruction: the agent's context window is the source, not an external export tool.
91
115
  4. **Redact sensitive information** — remove API keys, passwords, PII, and secret values before writing. Replace with `<redacted>`.
@@ -119,8 +143,13 @@ Remove leftover `tmp-*` and `tmp/` directories created by unit tests anywhere in
119
143
  > Commands below assume RTK is installed. To check, run `rtk --version` (this is the detection command — it is not prefixed with `rtk` because it IS an `rtk` command). If `rtk --version` fails, RTK is not installed — run all commands without the `rtk` prefix.
120
144
 
121
145
  ```bash
122
- rtk find . -type d -name 'tmp-*' -not -path './.git/*' -exec rm -rf {} + 2>/dev/null
123
- rtk find . -type d -name 'tmp' -not -path './.git/*' -not -path './node_modules/*' -exec rm -rf {} + 2>/dev/null
146
+ # rtk find accepts only single predicates (F-0025) — locate with one
147
+ # predicate per call, then delete the listed dirs explicitly; skip hits
148
+ # under ./.git/** and ./node_modules/**.
149
+ rtk find . -type d -name 'tmp-*'
150
+ rtk find . -type d -name tmp
151
+ # remove each listed dir (never a -not/-exec/-o compound — rtk rejects them):
152
+ rtk rm -rf <dir> [<dir>…]
124
153
  ```
125
154
 
126
155
  This is safe to auto-run.
@@ -130,10 +159,12 @@ This is safe to auto-run.
130
159
  Run the `docs.archive` umbrella command to move terminal RFCs, ADRs, plans, audits, sessions, and missions into their respective `archive/` subdirectories:
131
160
 
132
161
  ```bash
133
- rtk pnpm exec forge docs.archive
162
+ rtk pnpm exec werkstatt run docs.archive
134
163
  ```
135
164
 
136
- The command is idempotent — re-running is safe. If files were moved, commit them in step 3 as part of the clean tree check (they are "our" changes).
165
+ Prefer the kernel host — under `werkstatt run` the archive regenerates every generated artifact invalidated by the moves (e.g. `docs/ecosystem.generated.yaml`, `docs/rfcs/index.yaml`) and reports them. Under a standalone forge install (`pnpm exec forge docs.archive`) the command still archives but regeneration is skipped with a printed note.
166
+
167
+ The command is idempotent — re-running is safe. If files were moved or regenerated, commit them in step 3 as part of the clean tree check (they are "our" changes).
137
168
 
138
169
  ### Step 3: Clean tree check (NON-NEGOTIABLE)
139
170
 
@@ -171,11 +202,12 @@ for d in missions/*/workpiece; do [ -d "$d/.git" ] && echo "=== $d ===" && rtk g
171
202
  - List every unattributed file left dirty on the `### <Left untouched>` line of the Step 7 report, one per tree.
172
203
  - If the tree is now clean (or was clean from the start), proceed silently.
173
204
 
174
- **3e. Integrate or discard the session flow branch (dormant until the session-worktree switch-over):**
205
+ **3e. Integrate or discard the session flow branch:**
175
206
 
176
- - This step applies only when the session's cwd is a flow worktree — its branch is a registered `auto/session-*` entry (check `flow.status`; repositories not on the fixed branch model have no registered branches → skip silently).
207
+ - This step applies only when the session's cwd is a flow worktree — its branch is a registered `auto/session-*` entry (check `flow.status`; repositories not on the fixed branch model have no registered branches → skip silently). When the worktree-first preamble opened a retro worktree, run the integration from that worktree — the whole session's writes ride it.
177
208
  - After the clean-tree commit, run `flow.integrate` from the session worktree — it rebases the branch onto `develop`, runs the primary checkout's `hooks/integration-gate.sh`, and fast-forwards `develop`.
178
209
  - On a FLOW-INT-02 (rebase conflict) or FLOW-INT-05 (gate refusal) diagnostic, report the refusal and leave the branch for the next session — do not force-resolve inside session end.
210
+ - A FLOW-INT-01 dirty refusal is different: `data.entries` carries each path's class (`disposable`/`work`/…) — remediate via the flow.integrate remediation flags (`--auto-clean` when every entry is disposable, `--autocommit` to sweep the rest into the fixed-subject commit) or leave the branch for the next session with the classification reported.
179
211
  - When the operator said to drop the work, run `flow.discard --reason "<operator words>"` instead of `flow.integrate`.
180
212
 
181
213
  **3f. List pending outbound items (dormant when not on the fixed branch model):**
@@ -23,6 +23,10 @@ triggerPhrases: ["ingest external specification", "vendor spec package into docs
23
23
  <item>RFC-1097: sweep — SKILL.md headers + classification fixes
24
24
 
25
25
  Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from frontmatter description). Fix non-skill-markdown exclusion to check filename not workspace-relative path (packages/AGENTS.md escaped it). Add .coverage to ignoredDirs.</item>
26
+ <item>RFC-1539: amend dna-55 and dna-115 for published spec packages
27
+
28
+ Guides, fo-spec-ingest routing, command descriptions and regenerated command docs, remediation entries for SPEC-15..18 and CONF-07..09; resyncs the stale .agents fo-system-dispatch mirror (ADR-0126 source line).</item>
29
+ <item>RFC-1539: drop platform ids from the fo-spec-ingest published-packages rule (SKILL-17)</item>
26
30
  </CHANGE_SUMMARY>
27
31
  -->
28
32
 
@@ -38,6 +42,10 @@ Before starting, read `PREFERENCES.md` at the repository root. If the file is mi
38
42
 
39
43
  Invoked as `/fo-spec-ingest <path-to-package>` when the operator has an external specification package (e.g. a consultant deliverable, a markdown vault export).
40
44
 
45
+ ### Published packages
46
+
47
+ If the specification's authority publishes it as an npm package, do not vendor it. Add the package as an exact-pinned root dependency, declare it in `forge.yaml` `specPackages[]` (`{ id, package }`), install, and run `spec.validate`. The installed package is the immutable snapshot. Ingest mode is only for packages that are not published; a vendored copy of a declared spec package is SPEC-15.
48
+
41
49
  ### Authoring mode
42
50
 
43
51
  Invoked inline by `fo-idea` when decomposition yields more than 7 atomic decisions with at least one dependency edge. The skeleton is built from `fo-idea`'s decomposition + grilling output instead of an external package.
@@ -63,3 +63,4 @@ Task files, briefs and collected reports live under `queue/` in the system repos
63
63
  - **Never commit or integrate inside a product checkout.** Integration is the product session's own governed step.
64
64
  - **A `needs-decision` report becomes one operator question** — relay it verbatim, do not answer it yourself.
65
65
  - **Briefs are the whole contract.** If a brief would not let a cold session finish the task, rewrite the brief before dispatching.
66
+ - **Task state changes only through `system.task.move`, dispatch, and collect** — free text goes into the brief or the report, never into `history` (F-0141).
@@ -19,6 +19,7 @@ languagePolicy: ref(PREFERENCES.md)
19
19
  <item>RFC-1097: sweep — SKILL.md headers + classification fixes
20
20
 
21
21
  Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from frontmatter description). Fix non-skill-markdown exclusion to check filename not workspace-relative path (packages/AGENTS.md escaped it). Add .coverage to ignoredDirs.</item>
22
+ <item>RFC-1513: land friction docs-rule measures</item>
22
23
  </CHANGE_SUMMARY>
23
24
  -->
24
25
 
@@ -68,7 +69,7 @@ Run `port.scaffold --name <name> --type skill --category <category>` to generate
68
69
 
69
70
  ### 3. Write the body
70
71
 
71
- Fill the SKILL.md body with the skill's behavioral instructions. Follow the conventions in `writing-great-skills`.
72
+ Fill the SKILL.md body with the skill's behavioral instructions. Follow the conventions in `writing-great-skills`. Platform governance ids (RFC-/ADR-/DNA- tokens) stay inside `<!-- -->` metadata headers or change-summary comments — never in instruction prose; SKILL-17 rejects prose-carried ids late, at full-suite time (F-0077).
72
73
 
73
74
  ### 4. Validate
74
75
 
@@ -21,7 +21,9 @@ describe("resolveForgeEntry (RFC-1302)", () => {
21
21
  const binDir = path.join("/repo", "packages", "forge", "bin");
22
22
  expect(resolveForgeEntry(binDir, all)).toEqual({
23
23
  kind: "src",
24
- path: path.join(binDir, "cli.ts"),
24
+ // resolveForgeEntry returns path.resolve output — absolute on the cwd
25
+ // drive under Windows, where join("\repo", ...) stays drive-relative.
26
+ path: path.resolve(binDir, "cli.ts"),
25
27
  });
26
28
  });
27
29