@tacuchi/agent-workflow-cli 25.8.0 → 26.0.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 (558) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/README.md +6 -3
  3. package/dist/adapters/git-cli.js +225 -17
  4. package/dist/adapters/git-cli.js.map +1 -1
  5. package/dist/adapters/node-file-system.js +48 -0
  6. package/dist/adapters/node-file-system.js.map +1 -1
  7. package/dist/application/amend-service.js +51 -14
  8. package/dist/application/amend-service.js.map +1 -1
  9. package/dist/application/branch-resolver.js +6 -3
  10. package/dist/application/branch-resolver.js.map +1 -1
  11. package/dist/application/capability/design-handler.js +218 -43
  12. package/dist/application/capability/design-handler.js.map +1 -1
  13. package/dist/application/capability/dispatcher.js +182 -19
  14. package/dist/application/capability/dispatcher.js.map +1 -1
  15. package/dist/application/capability/durable-effect.js +3 -0
  16. package/dist/application/capability/durable-effect.js.map +1 -1
  17. package/dist/application/capability/readiness.js +8 -54
  18. package/dist/application/capability/readiness.js.map +1 -1
  19. package/dist/application/capability/resolution.js +124 -192
  20. package/dist/application/capability/resolution.js.map +1 -1
  21. package/dist/application/check-branch-service.js +158 -19
  22. package/dist/application/check-branch-service.js.map +1 -1
  23. package/dist/application/checkpoint/markdown.js +2 -2
  24. package/dist/application/checkpoint/markdown.js.map +1 -1
  25. package/dist/application/checkpoint/state-reader.js +12 -0
  26. package/dist/application/checkpoint/state-reader.js.map +1 -1
  27. package/dist/application/checkpoint-service.js +12 -4
  28. package/dist/application/checkpoint-service.js.map +1 -1
  29. package/dist/application/checkpoint-write-service.js +91 -17
  30. package/dist/application/checkpoint-write-service.js.map +1 -1
  31. package/dist/application/claims-ledger.js +137 -11
  32. package/dist/application/claims-ledger.js.map +1 -1
  33. package/dist/application/claims-recovery.js +85 -44
  34. package/dist/application/claims-recovery.js.map +1 -1
  35. package/dist/application/database-tool-catalog.js +33 -0
  36. package/dist/application/database-tool-catalog.js.map +1 -1
  37. package/dist/application/design/consumer-document.js +2 -2
  38. package/dist/application/design/consumer-document.js.map +1 -1
  39. package/dist/application/design/design-content-gate-service.js +20 -2
  40. package/dist/application/design/design-content-gate-service.js.map +1 -1
  41. package/dist/application/design/design-gate-service.js +2 -0
  42. package/dist/application/design/design-gate-service.js.map +1 -1
  43. package/dist/application/design/design-index-service.js +4 -0
  44. package/dist/application/design/design-index-service.js.map +1 -1
  45. package/dist/application/design/design-publish-service.js +1 -4
  46. package/dist/application/design/design-publish-service.js.map +1 -1
  47. package/dist/application/design/design-record-service.js +13 -7
  48. package/dist/application/design/design-record-service.js.map +1 -1
  49. package/dist/application/design/design-resolver-service.js +22 -3
  50. package/dist/application/design/design-resolver-service.js.map +1 -1
  51. package/dist/application/design/design-simple-service.js +24 -5
  52. package/dist/application/design/design-simple-service.js.map +1 -1
  53. package/dist/application/design/digest.js +41 -0
  54. package/dist/application/design/digest.js.map +1 -0
  55. package/dist/application/dev-only-services.js +166 -20
  56. package/dist/application/dev-only-services.js.map +1 -1
  57. package/dist/application/doc-branch-ledger.js +145 -0
  58. package/dist/application/doc-branch-ledger.js.map +1 -0
  59. package/dist/application/docs-canon-service.js +1 -1
  60. package/dist/application/docs-canon-service.js.map +1 -1
  61. package/dist/application/doctor/dist-integrity.js +113 -0
  62. package/dist/application/doctor/dist-integrity.js.map +1 -0
  63. package/dist/application/doctor/hosts.js +5 -2
  64. package/dist/application/doctor/hosts.js.map +1 -1
  65. package/dist/application/doctor/prepare.js +3 -3
  66. package/dist/application/doctor/prepare.js.map +1 -1
  67. package/dist/application/doctor/provider-installation.js +39 -19
  68. package/dist/application/doctor/provider-installation.js.map +1 -1
  69. package/dist/application/doctor/provider-mcps.js +9 -1
  70. package/dist/application/doctor/provider-mcps.js.map +1 -1
  71. package/dist/application/doctor/provider-skills.js +29 -115
  72. package/dist/application/doctor/provider-skills.js.map +1 -1
  73. package/dist/application/doctor/provider-visibility.js +76 -3
  74. package/dist/application/doctor/provider-visibility.js.map +1 -1
  75. package/dist/application/doctor/provider-workspace-block.js +156 -0
  76. package/dist/application/doctor/provider-workspace-block.js.map +1 -0
  77. package/dist/application/doctor/repair-runner.js +36 -39
  78. package/dist/application/doctor/repair-runner.js.map +1 -1
  79. package/dist/application/doctor/report.js +24 -4
  80. package/dist/application/doctor/report.js.map +1 -1
  81. package/dist/application/export-catalog-check.js +200 -0
  82. package/dist/application/export-catalog-check.js.map +1 -0
  83. package/dist/application/export-service.js +716 -79
  84. package/dist/application/export-service.js.map +1 -1
  85. package/dist/application/fix-git-service.js +285 -64
  86. package/dist/application/fix-git-service.js.map +1 -1
  87. package/dist/application/flow/advance.js +202 -25
  88. package/dist/application/flow/advance.js.map +1 -1
  89. package/dist/application/flow/annul-service.js +3 -1
  90. package/dist/application/flow/annul-service.js.map +1 -1
  91. package/dist/application/flow/batch-commit.js +189 -0
  92. package/dist/application/flow/batch-commit.js.map +1 -0
  93. package/dist/application/flow/checkout-observation.js +63 -10
  94. package/dist/application/flow/checkout-observation.js.map +1 -1
  95. package/dist/application/flow/close-artifacts.js +105 -0
  96. package/dist/application/flow/close-artifacts.js.map +1 -0
  97. package/dist/application/flow/close-at-boundary.js +25 -14
  98. package/dist/application/flow/close-at-boundary.js.map +1 -1
  99. package/dist/application/flow/close-document-guidance.js +70 -0
  100. package/dist/application/flow/close-document-guidance.js.map +1 -0
  101. package/dist/application/flow/flow-service.js +46 -3
  102. package/dist/application/flow/flow-service.js.map +1 -1
  103. package/dist/application/flow/internal-actions.js +300 -82
  104. package/dist/application/flow/internal-actions.js.map +1 -1
  105. package/dist/application/flow/internal-drive.js +24 -1
  106. package/dist/application/flow/internal-drive.js.map +1 -1
  107. package/dist/application/flow/plan-entry.js +82 -0
  108. package/dist/application/flow/plan-entry.js.map +1 -0
  109. package/dist/application/flow/prove.js +32 -1
  110. package/dist/application/flow/prove.js.map +1 -1
  111. package/dist/application/flow/quick-checkouts.js +48 -0
  112. package/dist/application/flow/quick-checkouts.js.map +1 -0
  113. package/dist/application/flow/reinfer-batch.js +177 -0
  114. package/dist/application/flow/reinfer-batch.js.map +1 -0
  115. package/dist/application/flow/reopen-run.js +12 -5
  116. package/dist/application/flow/reopen-run.js.map +1 -1
  117. package/dist/application/flow/run-state-service.js +2 -0
  118. package/dist/application/flow/run-state-service.js.map +1 -1
  119. package/dist/application/flow/submit.js +584 -117
  120. package/dist/application/flow/submit.js.map +1 -1
  121. package/dist/application/generate-launch-service.js +16 -6
  122. package/dist/application/generate-launch-service.js.map +1 -1
  123. package/dist/application/git-flow-service.js +34 -3
  124. package/dist/application/git-flow-service.js.map +1 -1
  125. package/dist/application/history-publications.js +24 -0
  126. package/dist/application/history-publications.js.map +1 -1
  127. package/dist/application/history-reconcile-service.js +45 -0
  128. package/dist/application/history-reconcile-service.js.map +1 -0
  129. package/dist/application/history-table.js +61 -12
  130. package/dist/application/history-table.js.map +1 -1
  131. package/dist/application/history-update-service.js +25 -4
  132. package/dist/application/history-update-service.js.map +1 -1
  133. package/dist/application/hook-branch-check.js +25 -3
  134. package/dist/application/hook-branch-check.js.map +1 -1
  135. package/dist/application/hook-git-commit-advisor.js +3 -4
  136. package/dist/application/hook-git-commit-advisor.js.map +1 -1
  137. package/dist/application/hook-turn-start.js +51 -0
  138. package/dist/application/hook-turn-start.js.map +1 -0
  139. package/dist/application/host-memory/codex.js +1 -1
  140. package/dist/application/host-memory/codex.js.map +1 -1
  141. package/dist/application/hub-registry.js +135 -0
  142. package/dist/application/hub-registry.js.map +1 -0
  143. package/dist/application/local-proposal.js +72 -19
  144. package/dist/application/local-proposal.js.map +1 -1
  145. package/dist/application/mcp-host-reader.js +1 -1
  146. package/dist/application/mcp-host-reader.js.map +1 -1
  147. package/dist/application/mcp-host-writer.js +16 -10
  148. package/dist/application/mcp-host-writer.js.map +1 -1
  149. package/dist/application/merge-state-service.js +150 -34
  150. package/dist/application/merge-state-service.js.map +1 -1
  151. package/dist/application/multiroot/claude.js +17 -10
  152. package/dist/application/multiroot/claude.js.map +1 -1
  153. package/dist/application/multiroot/codex.js +17 -11
  154. package/dist/application/multiroot/codex.js.map +1 -1
  155. package/dist/application/multiroot-service.js +52 -28
  156. package/dist/application/multiroot-service.js.map +1 -1
  157. package/dist/application/parsers/execution-batches.js +64 -0
  158. package/dist/application/parsers/execution-batches.js.map +1 -0
  159. package/dist/application/parsers/phases.js +23 -2
  160. package/dist/application/parsers/phases.js.map +1 -1
  161. package/dist/application/parsers/project-block.js +146 -17
  162. package/dist/application/parsers/project-block.js.map +1 -1
  163. package/dist/application/parsers/tasks.js +16 -2
  164. package/dist/application/parsers/tasks.js.map +1 -1
  165. package/dist/application/parsers/toml.js +19 -0
  166. package/dist/application/parsers/toml.js.map +1 -0
  167. package/dist/application/paths-service.js +13 -16
  168. package/dist/application/paths-service.js.map +1 -1
  169. package/dist/application/persist-service.js +118 -5
  170. package/dist/application/persist-service.js.map +1 -1
  171. package/dist/application/plan-exec-batch-service.js +162 -22
  172. package/dist/application/plan-exec-batch-service.js.map +1 -1
  173. package/dist/application/plan-exec-decision-service.js +61 -12
  174. package/dist/application/plan-exec-decision-service.js.map +1 -1
  175. package/dist/application/plan-exec-plan-diff.js +105 -0
  176. package/dist/application/plan-exec-plan-diff.js.map +1 -0
  177. package/dist/application/plan-lint-service.js +33 -5
  178. package/dist/application/plan-lint-service.js.map +1 -1
  179. package/dist/application/plan-passes.js +41 -0
  180. package/dist/application/plan-passes.js.map +1 -0
  181. package/dist/application/preparation-receipts.js +58 -0
  182. package/dist/application/preparation-receipts.js.map +1 -0
  183. package/dist/application/project-md-upsert-service.js +191 -52
  184. package/dist/application/project-md-upsert-service.js.map +1 -1
  185. package/dist/application/project-tab-data.js +40 -10
  186. package/dist/application/project-tab-data.js.map +1 -1
  187. package/dist/application/release-data/artifacts.js +15 -7
  188. package/dist/application/release-data/artifacts.js.map +1 -1
  189. package/dist/application/release-data/bundles.js +52 -6
  190. package/dist/application/release-data/bundles.js.map +1 -1
  191. package/dist/application/release-data/common.js +2 -2
  192. package/dist/application/release-data/common.js.map +1 -1
  193. package/dist/application/release-data/rollback.js +7 -0
  194. package/dist/application/release-data/rollback.js.map +1 -0
  195. package/dist/application/release-data/sessions.js +2 -2
  196. package/dist/application/release-data/sessions.js.map +1 -1
  197. package/dist/application/release-pass-ledger.js +1 -1
  198. package/dist/application/render/history-row.js +2 -0
  199. package/dist/application/render/history-row.js.map +1 -1
  200. package/dist/application/render/project-block.js +28 -11
  201. package/dist/application/render/project-block.js.map +1 -1
  202. package/dist/application/reseal-service.js +1 -0
  203. package/dist/application/reseal-service.js.map +1 -1
  204. package/dist/application/resume-service.js +55 -8
  205. package/dist/application/resume-service.js.map +1 -1
  206. package/dist/application/retirement/apply.js +25 -7
  207. package/dist/application/retirement/apply.js.map +1 -1
  208. package/dist/application/retirement/attribution.js +122 -50
  209. package/dist/application/retirement/attribution.js.map +1 -1
  210. package/dist/application/retirement/prepare.js +17 -11
  211. package/dist/application/retirement/prepare.js.map +1 -1
  212. package/dist/application/retirement/preview.js +2 -1
  213. package/dist/application/retirement/preview.js.map +1 -1
  214. package/dist/application/self/clean-legacy.js +1 -2
  215. package/dist/application/self/clean-legacy.js.map +1 -1
  216. package/dist/application/self/codex-plugin.js +1 -1
  217. package/dist/application/self/codex-plugin.js.map +1 -1
  218. package/dist/application/self/host-states.js +3 -3
  219. package/dist/application/self/host-states.js.map +1 -1
  220. package/dist/application/self/install-hooks.js +1 -1
  221. package/dist/application/self/install-hooks.js.map +1 -1
  222. package/dist/application/self/install-skill.js +5 -49
  223. package/dist/application/self/install-skill.js.map +1 -1
  224. package/dist/application/self/mcp-config.js +19 -11
  225. package/dist/application/self/mcp-config.js.map +1 -1
  226. package/dist/application/self/opencode-plugin.js +1 -0
  227. package/dist/application/self/opencode-plugin.js.map +1 -1
  228. package/dist/application/self/skill-files.js +29 -0
  229. package/dist/application/self/skill-files.js.map +1 -0
  230. package/dist/application/self/uninstall.js +1 -1
  231. package/dist/application/self/uninstall.js.map +1 -1
  232. package/dist/application/semantic-operation/protocol.js +66 -5
  233. package/dist/application/semantic-operation/protocol.js.map +1 -1
  234. package/dist/application/session-archive-service.js +113 -0
  235. package/dist/application/session-archive-service.js.map +1 -0
  236. package/dist/application/session-binding-service.js +35 -0
  237. package/dist/application/session-binding-service.js.map +1 -1
  238. package/dist/application/session-close-service.js +390 -54
  239. package/dist/application/session-close-service.js.map +1 -1
  240. package/dist/application/session-create-service.js +97 -5
  241. package/dist/application/session-create-service.js.map +1 -1
  242. package/dist/application/session-custody-recorder.js +15 -12
  243. package/dist/application/session-custody-recorder.js.map +1 -1
  244. package/dist/application/session-custody-service.js +1 -0
  245. package/dist/application/session-custody-service.js.map +1 -1
  246. package/dist/application/session-narrative.js +42 -12
  247. package/dist/application/session-narrative.js.map +1 -1
  248. package/dist/application/session-pause-service.js +46 -0
  249. package/dist/application/session-pause-service.js.map +1 -0
  250. package/dist/application/session-resolver.js +36 -11
  251. package/dist/application/session-resolver.js.map +1 -1
  252. package/dist/application/session-resume-service.js +134 -13
  253. package/dist/application/session-resume-service.js.map +1 -1
  254. package/dist/application/sessions-service.js +4 -0
  255. package/dist/application/sessions-service.js.map +1 -1
  256. package/dist/application/sessions-sweep-service.js +77 -0
  257. package/dist/application/sessions-sweep-service.js.map +1 -0
  258. package/dist/application/settle-service.js +3 -1
  259. package/dist/application/settle-service.js.map +1 -1
  260. package/dist/application/skills-resolver-service.js +6 -92
  261. package/dist/application/skills-resolver-service.js.map +1 -1
  262. package/dist/application/source-add-service.js +37 -0
  263. package/dist/application/source-add-service.js.map +1 -0
  264. package/dist/application/source-boundary-policy.js +105 -8
  265. package/dist/application/source-boundary-policy.js.map +1 -1
  266. package/dist/application/source-pipeline.js +68 -0
  267. package/dist/application/source-pipeline.js.map +1 -0
  268. package/dist/application/source-remove-service.js +15 -3
  269. package/dist/application/source-remove-service.js.map +1 -1
  270. package/dist/application/sources-service.js +71 -16
  271. package/dist/application/sources-service.js.map +1 -1
  272. package/dist/application/status-service.js +55 -5
  273. package/dist/application/status-service.js.map +1 -1
  274. package/dist/application/unit-dependencies.js +100 -0
  275. package/dist/application/unit-dependencies.js.map +1 -0
  276. package/dist/application/unit-membership.js +37 -0
  277. package/dist/application/unit-membership.js.map +1 -0
  278. package/dist/application/unit-residue.js +72 -0
  279. package/dist/application/unit-residue.js.map +1 -0
  280. package/dist/application/visibility-doctor-service.js +66 -4
  281. package/dist/application/visibility-doctor-service.js.map +1 -1
  282. package/dist/application/working-branch-service.js +6 -0
  283. package/dist/application/working-branch-service.js.map +1 -1
  284. package/dist/application/workline-graph.js +1 -1
  285. package/dist/application/workline-graph.js.map +1 -1
  286. package/dist/application/workline-index-service.js +118 -17
  287. package/dist/application/workline-index-service.js.map +1 -1
  288. package/dist/application/workspace-commit-service.js +218 -0
  289. package/dist/application/workspace-commit-service.js.map +1 -0
  290. package/dist/application/workspace-init-service.js +64 -34
  291. package/dist/application/workspace-init-service.js.map +1 -1
  292. package/dist/application/workspace-local-config.js +90 -0
  293. package/dist/application/workspace-local-config.js.map +1 -0
  294. package/dist/application/workspace-materialization-service.js +52 -3
  295. package/dist/application/workspace-materialization-service.js.map +1 -1
  296. package/dist/application/workspace-migrate/apply.js +525 -4
  297. package/dist/application/workspace-migrate/apply.js.map +1 -1
  298. package/dist/application/workspace-migrate/markers.js +9 -6
  299. package/dist/application/workspace-migrate/markers.js.map +1 -1
  300. package/dist/application/workspace-migrate/plan.js +97 -5
  301. package/dist/application/workspace-migrate/plan.js.map +1 -1
  302. package/dist/application/workspace-move-service.js +270 -0
  303. package/dist/application/workspace-move-service.js.map +1 -0
  304. package/dist/application/workspace-untrack-service.js +28 -0
  305. package/dist/application/workspace-untrack-service.js.map +1 -0
  306. package/dist/application/worktree-service.js +654 -105
  307. package/dist/application/worktree-service.js.map +1 -1
  308. package/dist/cli/ascii.js +2 -0
  309. package/dist/cli/ascii.js.map +1 -1
  310. package/dist/cli/commands/add-source.js +38 -0
  311. package/dist/cli/commands/add-source.js.map +1 -0
  312. package/dist/cli/commands/amend.js +14 -3
  313. package/dist/cli/commands/amend.js.map +1 -1
  314. package/dist/cli/commands/capability.js +23 -4
  315. package/dist/cli/commands/capability.js.map +1 -1
  316. package/dist/cli/commands/designs.js +14 -5
  317. package/dist/cli/commands/designs.js.map +1 -1
  318. package/dist/cli/commands/dev-only.js +19 -6
  319. package/dist/cli/commands/dev-only.js.map +1 -1
  320. package/dist/cli/commands/doc-branch.js +184 -0
  321. package/dist/cli/commands/doc-branch.js.map +1 -0
  322. package/dist/cli/commands/doctor.js +5 -1
  323. package/dist/cli/commands/doctor.js.map +1 -1
  324. package/dist/cli/commands/export.js +78 -18
  325. package/dist/cli/commands/export.js.map +1 -1
  326. package/dist/cli/commands/fix-git.js +89 -14
  327. package/dist/cli/commands/fix-git.js.map +1 -1
  328. package/dist/cli/commands/flow.js +120 -15
  329. package/dist/cli/commands/flow.js.map +1 -1
  330. package/dist/cli/commands/generate-launch.js +14 -2
  331. package/dist/cli/commands/generate-launch.js.map +1 -1
  332. package/dist/cli/commands/history-update.js +1 -1
  333. package/dist/cli/commands/history-update.js.map +1 -1
  334. package/dist/cli/commands/history.js +14 -0
  335. package/dist/cli/commands/history.js.map +1 -0
  336. package/dist/cli/commands/hook.js +15 -2
  337. package/dist/cli/commands/hook.js.map +1 -1
  338. package/dist/cli/commands/index.js +18 -5
  339. package/dist/cli/commands/index.js.map +1 -1
  340. package/dist/cli/commands/merge-state.js +2 -2
  341. package/dist/cli/commands/merge-state.js.map +1 -1
  342. package/dist/cli/commands/persist.js +6 -5
  343. package/dist/cli/commands/persist.js.map +1 -1
  344. package/dist/cli/commands/project-md-upsert.js +5 -3
  345. package/dist/cli/commands/project-md-upsert.js.map +1 -1
  346. package/dist/cli/commands/release-pass.js +3 -3
  347. package/dist/cli/commands/release-pass.js.map +1 -1
  348. package/dist/cli/commands/resume.js +12 -3
  349. package/dist/cli/commands/resume.js.map +1 -1
  350. package/dist/cli/commands/self.js +8 -24
  351. package/dist/cli/commands/self.js.map +1 -1
  352. package/dist/cli/commands/session-close.js +64 -9
  353. package/dist/cli/commands/session-close.js.map +1 -1
  354. package/dist/cli/commands/session-create.js +4 -2
  355. package/dist/cli/commands/session-create.js.map +1 -1
  356. package/dist/cli/commands/session-pause.js +14 -0
  357. package/dist/cli/commands/session-pause.js.map +1 -0
  358. package/dist/cli/commands/sessions.js +16 -3
  359. package/dist/cli/commands/sessions.js.map +1 -1
  360. package/dist/cli/commands/set-branch.js +28 -4
  361. package/dist/cli/commands/set-branch.js.map +1 -1
  362. package/dist/cli/commands/set-edit-mode.js +20 -0
  363. package/dist/cli/commands/set-edit-mode.js.map +1 -0
  364. package/dist/cli/commands/set-pipeline.js +35 -0
  365. package/dist/cli/commands/set-pipeline.js.map +1 -0
  366. package/dist/cli/commands/skills.js +4 -11
  367. package/dist/cli/commands/skills.js.map +1 -1
  368. package/dist/cli/commands/sources.js +4 -0
  369. package/dist/cli/commands/sources.js.map +1 -1
  370. package/dist/cli/commands/status.js +35 -2
  371. package/dist/cli/commands/status.js.map +1 -1
  372. package/dist/cli/commands/unknown-flags.js +1 -0
  373. package/dist/cli/commands/unknown-flags.js.map +1 -1
  374. package/dist/cli/commands/visibility.js +1 -0
  375. package/dist/cli/commands/visibility.js.map +1 -1
  376. package/dist/cli/commands/workspace-commit.js +62 -0
  377. package/dist/cli/commands/workspace-commit.js.map +1 -0
  378. package/dist/cli/commands/workspace-init.js +39 -2
  379. package/dist/cli/commands/workspace-init.js.map +1 -1
  380. package/dist/cli/commands/workspace-migrate.js +31 -3
  381. package/dist/cli/commands/workspace-migrate.js.map +1 -1
  382. package/dist/cli/commands/workspace-move.js +42 -0
  383. package/dist/cli/commands/workspace-move.js.map +1 -0
  384. package/dist/cli/commands/worktree.js +4 -4
  385. package/dist/cli/commands/worktree.js.map +1 -1
  386. package/dist/cli/context-id.js +6 -0
  387. package/dist/cli/context-id.js.map +1 -1
  388. package/dist/cli/full-cli.js +555 -0
  389. package/dist/cli/full-cli.js.map +1 -0
  390. package/dist/cli/help-groups.js +76 -19
  391. package/dist/cli/help-groups.js.map +1 -1
  392. package/dist/cli/hook-stdin-cache.js +12 -0
  393. package/dist/cli/hook-stdin-cache.js.map +1 -0
  394. package/dist/cli/main.js +47 -453
  395. package/dist/cli/main.js.map +1 -1
  396. package/dist/cli/parser.js +4 -0
  397. package/dist/cli/parser.js.map +1 -1
  398. package/dist/cli/tui/app.js +3 -4
  399. package/dist/cli/tui/app.js.map +1 -1
  400. package/dist/cli/tui/components/host-admin-section.js +2 -13
  401. package/dist/cli/tui/components/host-admin-section.js.map +1 -1
  402. package/dist/cli/tui/components/tabs-config.js +1 -2
  403. package/dist/cli/tui/components/tabs-config.js.map +1 -1
  404. package/dist/cli/tui/components/workspace-init-form.js +4 -1
  405. package/dist/cli/tui/components/workspace-init-form.js.map +1 -1
  406. package/dist/cli/tui/data/workflow-content.js +6 -1
  407. package/dist/cli/tui/data/workflow-content.js.map +1 -1
  408. package/dist/cli/tui/tabs/mcp-tab.js +4 -3
  409. package/dist/cli/tui/tabs/mcp-tab.js.map +1 -1
  410. package/dist/cli/tui/tabs/project-tab.js +7 -2
  411. package/dist/cli/tui/tabs/project-tab.js.map +1 -1
  412. package/dist/cli/tui/tui-prefs.js +2 -0
  413. package/dist/cli/tui/tui-prefs.js.map +1 -1
  414. package/dist/dist-manifest.json +3973 -0
  415. package/dist/domain/capability/protocol.js +3 -1
  416. package/dist/domain/capability/protocol.js.map +1 -1
  417. package/dist/domain/decision-note.js +13 -0
  418. package/dist/domain/decision-note.js.map +1 -1
  419. package/dist/domain/design/artifact.js +22 -3
  420. package/dist/domain/design/artifact.js.map +1 -1
  421. package/dist/domain/design/capability.js +1 -0
  422. package/dist/domain/design/capability.js.map +1 -1
  423. package/dist/domain/design/expansion.js +1 -1
  424. package/dist/domain/design/expansion.js.map +1 -1
  425. package/dist/domain/design/maturity.js +16 -0
  426. package/dist/domain/design/maturity.js.map +1 -1
  427. package/dist/domain/design/reference.js +5 -0
  428. package/dist/domain/design/reference.js.map +1 -1
  429. package/dist/domain/doctor/operations.js +20 -12
  430. package/dist/domain/doctor/operations.js.map +1 -1
  431. package/dist/domain/effective-contract.js +3 -1
  432. package/dist/domain/effective-contract.js.map +1 -1
  433. package/dist/domain/elicitation.js +1 -1
  434. package/dist/domain/flow/answer.js +265 -130
  435. package/dist/domain/flow/answer.js.map +1 -1
  436. package/dist/domain/flow/authority.js +194 -37
  437. package/dist/domain/flow/authority.js.map +1 -1
  438. package/dist/domain/flow/batch-review.js +65 -0
  439. package/dist/domain/flow/batch-review.js.map +1 -0
  440. package/dist/domain/flow/decision-schema.js +47 -0
  441. package/dist/domain/flow/decision-schema.js.map +1 -0
  442. package/dist/domain/flow/directive.js +16 -0
  443. package/dist/domain/flow/directive.js.map +1 -1
  444. package/dist/domain/flow/execution-result.js +91 -2
  445. package/dist/domain/flow/execution-result.js.map +1 -1
  446. package/dist/domain/flow/run-state.js +352 -24
  447. package/dist/domain/flow/run-state.js.map +1 -1
  448. package/dist/domain/flow/test-run-evidence.js +285 -0
  449. package/dist/domain/flow/test-run-evidence.js.map +1 -0
  450. package/dist/domain/flow/unchanged-phase.js +15 -0
  451. package/dist/domain/flow/unchanged-phase.js.map +1 -0
  452. package/dist/domain/harnesses.js +14 -5
  453. package/dist/domain/harnesses.js.map +1 -1
  454. package/dist/domain/isolation-unit.js +2 -2
  455. package/dist/domain/isolation-unit.js.map +1 -1
  456. package/dist/domain/lineage.js +7 -2
  457. package/dist/domain/lineage.js.map +1 -1
  458. package/dist/domain/obligation-correspondence.js +4 -2
  459. package/dist/domain/obligation-correspondence.js.map +1 -1
  460. package/dist/domain/plan-handoff.js +5 -0
  461. package/dist/domain/plan-handoff.js.map +1 -0
  462. package/dist/domain/proposal.js +18 -7
  463. package/dist/domain/proposal.js.map +1 -1
  464. package/dist/domain/reservation.js +5 -3
  465. package/dist/domain/reservation.js.map +1 -1
  466. package/dist/domain/retirement/proposal.js +1 -0
  467. package/dist/domain/retirement/proposal.js.map +1 -1
  468. package/dist/domain/session/custody.js +10 -6
  469. package/dist/domain/session/custody.js.map +1 -1
  470. package/dist/domain/session/narrative.js +4 -1
  471. package/dist/domain/session/narrative.js.map +1 -1
  472. package/dist/domain/skills.js +4 -6
  473. package/dist/domain/skills.js.map +1 -1
  474. package/dist/domain/sql-lexer.js +1 -1
  475. package/dist/domain/sql-lexer.js.map +1 -1
  476. package/dist/runtime/namespace-resolver.js +4 -0
  477. package/dist/runtime/namespace-resolver.js.map +1 -1
  478. package/dist/runtime/workline-marker.js +35 -8
  479. package/dist/runtime/workline-marker.js.map +1 -1
  480. package/dist/runtime/workspace-resolution.js +123 -0
  481. package/dist/runtime/workspace-resolution.js.map +1 -0
  482. package/package.json +6 -5
  483. package/skills/w/SKILL.md +12 -17
  484. package/skills/w/artifacts/artifacts-core/CHECKPOINT.md +1 -1
  485. package/skills/w/artifacts/artifacts-core/SCRIPTS.rollback.sql +8 -0
  486. package/skills/w/artifacts/artifacts-core/SCRIPTS.sql +4 -8
  487. package/skills/w/commands/export-diagrams.md +3 -3
  488. package/skills/w/commands/export-manuals.md +6 -6
  489. package/skills/w/commands/export-reports.md +3 -3
  490. package/skills/w/commands/export-scripts.md +5 -5
  491. package/skills/w/commands/fix-git.md +12 -13
  492. package/skills/w/commands/persist.md +2 -2
  493. package/skills/w/commands/plan-exec.md +4 -2
  494. package/skills/w/commands/spec-new.md +1 -1
  495. package/skills/w/commands/workspace-init.md +2 -0
  496. package/skills/w/context/MANIFEST.json +1 -1
  497. package/skills/w/exports/README.md +4 -4
  498. package/skills/w/exports/export-diagrams/EXPORT.md +4 -4
  499. package/skills/w/exports/export-manuals/EXPORT.md +14 -16
  500. package/skills/w/exports/export-reports/EXPORT.md +3 -3
  501. package/skills/w/exports/export-scripts/EXPORT.md +46 -22
  502. package/skills/w/harness/HARNESS.md +4 -7
  503. package/skills/w/hooks/hooks.template.json +6 -4
  504. package/skills/w/loops/CHASSIS.md +12 -6
  505. package/skills/w/loops/CODE-POLICIES.md +8 -5
  506. package/skills/w/loops/README.md +2 -2
  507. package/skills/w/loops/plan-exec-loop/LOOP.md +23 -22
  508. package/skills/w/loops/plan-new-loop/LOOP.md +23 -31
  509. package/skills/w/loops/plan-refine-loop/LOOP.md +8 -2
  510. package/skills/w/loops/quick-loop/LOOP.md +7 -6
  511. package/skills/w/loops/spec-refine-loop/LOOP.md +1 -1
  512. package/skills/w/modules/DESIGN-REFERENCES.md +9 -11
  513. package/skills/w/modules/PLAN-EXECUTION-BATCHES.md +4 -4
  514. package/skills/w/modules/SESSION-NUMBERING.md +2 -0
  515. package/skills/w/roles/README.md +11 -47
  516. package/skills/w/roles/design/CONTRACT.md +6 -4
  517. package/skills/w/roles/design/ROLE.md +7 -3
  518. package/skills/w/roles/diagrams/ROLE.md +1 -1
  519. package/skills/w/roles/git/ROLE.md +17 -10
  520. package/skills/w/roles/research/ROLE.md +2 -2
  521. package/skills/w/roles/sql/ROLE.md +17 -15
  522. package/skills/w/schemas/design/ui-screen.v1.schema.json +9 -0
  523. package/dist/application/capability/descriptor-loader.js +0 -109
  524. package/dist/application/capability/descriptor-loader.js.map +0 -1
  525. package/dist/application/capability/installed-inventory.js +0 -168
  526. package/dist/application/capability/installed-inventory.js.map +0 -1
  527. package/dist/application/self/install-plugin-skills-git.js +0 -226
  528. package/dist/application/self/install-plugin-skills-git.js.map +0 -1
  529. package/dist/application/self/install-plugin-skills.js +0 -203
  530. package/dist/application/self/install-plugin-skills.js.map +0 -1
  531. package/dist/application/self/plugin-cache-clear.js +0 -133
  532. package/dist/application/self/plugin-cache-clear.js.map +0 -1
  533. package/dist/application/self/plugin-cache-reload.js +0 -141
  534. package/dist/application/self/plugin-cache-reload.js.map +0 -1
  535. package/dist/application/self/skills-apply.js +0 -623
  536. package/dist/application/self/skills-apply.js.map +0 -1
  537. package/dist/application/self/skills-catalog.js +0 -35
  538. package/dist/application/self/skills-catalog.js.map +0 -1
  539. package/dist/application/self/skills-change.js +0 -479
  540. package/dist/application/self/skills-change.js.map +0 -1
  541. package/dist/application/self/skills-discovery.js +0 -275
  542. package/dist/application/self/skills-discovery.js.map +0 -1
  543. package/dist/application/self/skills-manager.js +0 -253
  544. package/dist/application/self/skills-manager.js.map +0 -1
  545. package/dist/application/self/skills-payload.js +0 -566
  546. package/dist/application/self/skills-payload.js.map +0 -1
  547. package/dist/application/self/skills-registry.js +0 -107
  548. package/dist/application/self/skills-registry.js.map +0 -1
  549. package/dist/application/skill-index-service.js +0 -78
  550. package/dist/application/skill-index-service.js.map +0 -1
  551. package/dist/cli/commands/plugin-cache.js +0 -25
  552. package/dist/cli/commands/plugin-cache.js.map +0 -1
  553. package/dist/cli/commands/skill-index.js +0 -19
  554. package/dist/cli/commands/skill-index.js.map +0 -1
  555. package/dist/cli/tui/data/recommended-skills.js +0 -482
  556. package/dist/cli/tui/data/recommended-skills.js.map +0 -1
  557. package/dist/cli/tui/tabs/skills-tab.js +0 -664
  558. package/dist/cli/tui/tabs/skills-tab.js.map +0 -1
@@ -1,8 +1,14 @@
1
1
  # CHASSIS — the loop engine
2
2
 
3
- The **common engine** of the Workline loops: every loop reads it from its `## Inherits`, **always, before its deltas**. Edit the engine **here**; heirs only reference it.
3
+ The **common engine** of Workline loops: heirs read it before their deltas and only reference it.
4
4
 
5
- > **When each step below happens is no longer this document's call:** the deterministic steps below are decided by the CLI (`aw flow advance`), not by this document. They consume no model worker, subagent or external process: the CLI advances them locally to the first real frontier. What stays is what each rule is FOR — the half no engine carries. Answering the frontier it stops at is `aw flow submit`, and its envelope — which fields each kind of frontier demands, and where each digest comes from — is **read** with `aw flow --help`, never guessed.
5
+ > **When:** the deterministic steps below are decided by the CLI (`aw flow advance`), not by this document. `aw flow submit` answers the frontier. Read its envelope and digest from `aw flow --help`, never guess. Use `--adopt` for an existing run; `aw flow recover` restores a no-effect exhausted frontier, `aw flow restart` handles stuck runs, `aw flow annul` reopens miscredited batches, and `aw flow prove` binds evidence to the checkout.
6
+
7
+ ## Host execution rules
8
+
9
+ - Write JSON envelopes with the file tool, never heredoc or shell-built JSON; redirect the file to stdin.
10
+ - Use a CLI verb before editing the runtime; make one call per approvable effect.
11
+ - The user executes force-push; on Windows set `PYTHONUTF8=1` for Python consumers.
6
12
 
7
13
  ## Heirs (canonical list)
8
14
 
@@ -18,9 +24,9 @@ The two that edit code also apply [`CODE-POLICIES.md`](CODE-POLICIES.md).
18
24
 
19
25
  ## Persistent objective
20
26
 
21
- A loop **is a persistent objective**: it exists to fulfill the `SESSION.Objective` declared at start, and **it is not finished until the convergence gate confirms the objective was met**. Gap-driven iteration is the *method*; the artifacts are the *record*; the objective is the *frame*.
27
+ A loop fulfills `SESSION.Objective` until its convergence gate confirms it. Gaps are the method; artifacts the record.
22
28
 
23
- "Don't stop until convergence" is sustained by the loop itself — its `repeat:` plus the convergence gate — never by a host hook, which is what makes it harness-agnostic.
29
+ The loop's `repeat:` and gate sustain convergence, not a host hook.
24
30
 
25
31
  > **Inter-turn continuity.** The same `CHECKPOINT`+resume governs the **next prompt**: the objective persists **across turns**, not only within a run. Its canonical rules have their **single source** in [`../SKILL.md`](../SKILL.md) § *Operating context*; this engine executes them via *Compact / resume* (case 3).
26
32
 
@@ -125,11 +131,11 @@ Resume **keys off the `CHECKPOINT`** of the run's session, not the existence of
125
131
  ## Convergence / exit
126
132
 
127
133
  - **No material gaps** → **convergence gate** (read-only) = **`Success criteria` green** (*verification-first*). Whatever fails **comes back as a gap**; if it passes → the loop **flips the green criteria** in `SESSION.md` (`- [ ]` → `- [x]`) and offers its closing action. The checklist must reflect the real final state: a criterion left unchecked at `finalize` needs an explicit reason. Each heir names its own instance of this gate, and those instances are what realize it.
128
- - `Cerrar` (the `flow` control, at any time) → `finalize`, the last step of every journey. **`finalize` always persists `CHECKPOINT.md`** (resumable) and, **only if** something was deferred, writes `BACKLOG.md` (close reason + the deferred items); closes the session and reports. Progress survives even without a prior `Compactar`.
134
+ - Finish sources → approve exact workspace paths/message or skip → `finalize` persists CHECKPOINT, deferred BACKLOG if needed, archive and HISTORY; an approved commit runs last, never push. `Cerrar` at any time uses `finalize` and preserves progress.
129
135
 
130
136
  ## docs/ boundary — no auto-export (hard rule)
131
137
 
132
- A loop writes into `docs/` **only** its own flow's doc plus, when it composes a capability whose own deliverable is a `docs/` category, that category — today only the **UI Design Package** under `docs/designs` (`design`). Which folders that is per flow, and refusing any delegated step whose target leaves them, is the CLI's. **Published, never graduated**: the test is the origin, not the folder. No loop **graduates/promotes artifacts** into `docs/` — migrations → `docs/scripts`, manuals → `docs/manuals`, diagrams → `docs/diagrams` are the separate **`export-*`** skills', an explicit later step; artifacts stay in their sessions until then. A task creating a tool has it documented in `docs/tools` by the ambient `creating-tools` skill (auto-discovered; Workline does not bind it).
138
+ A loop writes into `docs/` **only** its own flow's doc plus, when it composes a capability whose own deliverable is a `docs/` category, that category — today only the **UI Design Package** under `docs/designs` (`design`). Which folders that is per flow, and refusing any delegated step whose target leaves them, is the CLI's. **Published, never graduated**: the test is the origin, not the folder. No loop **graduates/promotes artifacts** into `docs/` — migrations → `docs/scripts`, manuals → `docs/manuals`, diagrams → `docs/diagrams` are the separate **`export-*`** skills', an explicit later step; artifacts stay in their sessions until then. Reusable tooling follows the `docs/tools` contract and closing review; host help is optional.
133
139
 
134
140
  ## Conditional modules
135
141
 
@@ -6,19 +6,22 @@ closing-review invariants.
6
6
 
7
7
  ## Safe git — verified branch + proposed commits
8
8
 
9
- Sources are edited on a **verified** branch (`aw check-branch`), and the unit's commits are
10
- **proposed**: exactly one commit per affected source — at effective-batch close in plan-exec, at task
11
- close in quick — never `push`/`--amend`/`--no-verify`, and never a destructive clean or a branch
9
+ Sources are edited on a **verified** branch (`aw check-branch`), and commits are
10
+ **proposed**: in plan-exec the CLI commits only the batch's approved paths once per source; in quick
11
+ the task closes with one proposed commit. Never `push`/`--amend`/`--no-verify`, a destructive clean or a branch
12
12
  switch without confirmation. A **rejected** commit leaves the changes in the tree and the unit
13
13
  recorded as uncommitted in `CHECKPOINT` and `BACKLOG`. Between units each working tree is clean or
14
14
  explicitly acknowledged; a `continuous` batch is the narrow exception that intentionally co-mingles
15
15
  its internal phases in one reviewed commit, and no batch may co-mingle with another.
16
16
 
17
- Concurrent flows never share a working tree: a run declares its sources and takes an **isolation
17
+ Concurrent flows declare sources. By default a run takes an **isolation
18
18
  unit** in each before writing — a worktree on its own branch
19
19
  (`aw worktree ensure | list | release`). An edit outside is
20
20
  blocked naming the command that gets one, and at close `aw worktree integrate` merges each into
21
21
  the source's work branch; a conflict is reported, routed to `aw fix-git --path`, never alone.
22
+ An in-place workspace declares `Modo de edición: in-place`; a plan may override it with `> Aislamiento: unidad`. In-place declares and approves only its own paths against the acquisition snapshot, without integration.
23
+
24
+ For frontend sources, install dependencies (`npm ci` if the lockfile changes) inside each acquired unit: `node_modules` belongs to that worktree, never to a sibling checkout.
22
25
 
23
26
  > **When the branch is verified, when a commit becomes available and what an approval covers is not this document's call:** the deterministic steps below are decided by the CLI (`aw flow advance`), not by this document. Approving is the person's act and committing is a separate effect that comes back as the units' own git state — which is what makes "the checks passed" impossible to assert without having run them.
24
27
 
@@ -33,7 +36,7 @@ same gate before any pending commit.
33
36
  - **Minimality lens** (floor — holds with **no external skill**; chassis § *Minimality*): re-read the diff for over-building. Flag `delete` (dead/speculative code), `stdlib` (reinvented standard library), `native` (a dep or code doing what the platform already does), `yagni` (one-implementation abstraction, config nobody sets, one-caller layer), `shrink` (same behavior, fewer lines). An installed ambient review skill *raises* this; it never lowers it.
34
37
  - **Test-value lens** (floor, next to minimality): every test the diff adds must demonstrate an observable behavior, protect a business rule, verify a contract, exercise a real integration or prevent a known regression. Flag `overtest` for the ones that only mirror structure — a test per class or method, mocked call chains, the same happy path re-asserted at every layer, trivial getters/setters/mappers, cases written for coverage, broad snapshots where a functional assertion is clearer. Bounded by *Gate integrity*: `overtest` prunes redundancy, **never** a check that guards behavior, a trust boundary, security or accessibility.
35
38
  - **Temporary simulation check** (only when the change carries one): stubs, fakes and in-memory adapters are **explicit and named as such** (`Stub…` / `Fake…`), they sit at the boundary the plan declares, and no configuration can select them in a production runtime. A simulation still active on the main path with no declared removal is a finding, not a detail.
36
- - **Tooling check** (`docs/tools`): did the run create **reusable auxiliary tooling** (support scripts/CLIs/generators/reusable configs — not product code, not session probes)? → the host applies the **ambient `creating-tools` skill** (auto-discovered; Workline does not bind it), which homes it under `docs/tools/<slug>/` per its contract. Host without such a skill → the loop still **never writes `docs/tools` itself**: **declare the gap** — the homeless tool goes to the plan's `Open questions` + `BACKLOG` (in quick, `BACKLOG`) — never silent.
39
+ - **Tooling check** (`docs/tools`): reusable support scripts/CLIs/generators/configs (not product code or session probes) belong under `docs/tools/<slug>/`, with README, run/output structure and an index row in `docs/tools/README.md`. Review their usability and evidence before closing. Any host help is optional, from any origin; its absence never defers the tool.
37
40
  - **Findings**: **fix** them in the working tree and **re-run validation** (the gate does not replace the tests: it re-verifies after fixing), or **defer them justified** (→ the plan's `Open questions` + `BACKLOG`; in quick, `BACKLOG`); the non-obvious → `DECISION`. Gate integrity (see [`CHASSIS.md`](CHASSIS.md) § *Verification-first*): never weaken a check or lower a convention to pass.
38
41
  - **Artifact-first + verification-first**: seed `CHECKPOINT.Next = "review <batch/task>"`; Success
39
42
  criteria require the whole diff to pass before commits.
@@ -47,11 +47,11 @@ The **5 loops** are heirs: they use `## Inherits` (a one-line reference to [`CHA
47
47
 
48
48
  ## Chassis / heirs
49
49
 
50
- The **engine lives in [`CHASSIS.md`](CHASSIS.md)** (a referenced doc, not a skill); the 5 loops — including `spec-refine-loop` — are **heirs** of that engine. The canonical heirs list and their deltas live in the chassis itself (§ *Heirs*). The chassis is **not a bindable capability**: it is the loop engine; what is pluggable are the **capabilities** a loop composes (e.g. `design`, `sql`, `git`), resolved via `.workflow/skills.toml`.
50
+ The **engine lives in [`CHASSIS.md`](CHASSIS.md)** (a referenced doc, not a skill); all 5 loops inherit it. It is never a binding. The `design` capability has a Workline-owned floor; other assistance comes from the host when available.
51
51
 
52
52
  ## Composed capabilities (roles)
53
53
 
54
- Loops compose **capabilities by role**, never concrete skills; the skill fulfilling the role is resolved via `.workflow/skills.toml` (cascade: built-in → global → workspace; `off` = disabled — the loop continues and says so if it was needed). Catalog, defaults and ambient-conventions doctrine: [../roles/README.md](../roles/README.md).
54
+ Only Workline-owned roles resolve through `.workflow/skills.toml`. External help is ambient; it is not a prerequisite, binding or gate proof. See [../roles/README.md](../roles/README.md).
55
55
 
56
56
  ## Index
57
57
 
@@ -111,8 +111,11 @@ reconciliation** in `CHECKPOINT`, never reported as published.
111
111
 
112
112
  ## Delta 1 — One session per run; execution-unit cycle in the plan-doc
113
113
 
114
+ `aw flow advance --adopt` adopts an existing plan; `aw flow recover` restores exhausted no-effect frontiers, `aw flow restart` unsticks runs, `aw flow annul` reopens miscredited batches. `aw flow prove --source <alias>` supplies checkout-bound evidence to `aw flow submit` after validation.
115
+
114
116
  - Walk the plan's `### Fn` blocks under `## Tasks` in dependency order inside one session. Infer
115
117
  effective `continuous`/`isolated` batches first; legacy `## Phases` tables degrade the same way.
118
+ - In-place `branch-precondition`: clean on another branch → offer switch, change document branch or cancel; dirty on another branch → pause; expected branch with user changes → proceed. Switch only with consent; the hook guards edits and the commit fences HEAD/branch against acquisition.
116
119
  - **Execution-unit cycle:** seed one batch intent; implement all its phases in order; validate and
117
120
  review at unit close; then update states/`CHECKPOINT` and enter Git. An isolated unit contains
118
121
  one phase. A continuous unit follows `PLAN-EXECUTION-BATCHES`: no proof, runner, build, lint,
@@ -123,7 +126,7 @@ reconciliation** in `CHECKPOINT`, never reported as published.
123
126
  **Never** because all its checkboxes are ticked.
124
127
  - **Intermediate states:** `bloqueada` = the phase is stopped on a live checkout blocker — recorded in `CHECKPOINT` + the plan's `## Open questions`, back to `en ejecución` when it clears; it counts as **not validated**. A proof that cannot run **stays `bloqueada`**. A deferred check never counts as a passed one. A script awaiting real-world application is a **handoff**, not a blocker: local fixture/ephemeral validation can still establish the promised behavior and the phase may become `validada`.
125
128
  - **A blocker without a reason is not a blocker (hard rule).** Writing `> Estado: bloqueada` **always** writes its `> Bloqueo:` line in the same edit: a state that says "stopped" without saying on what is a dead end for whoever reads `aw status` next. The runtime tolerates a legacy block that states none (`blocker: null`) — this loop never produces one. `CHECKPOINT.Next` names **the action that unblocks it** in the checkout, never an operator's deployed run.
126
- - **Plan-doc residue (hard rule):** execution writes into the plan-doc **only** five things — checkbox flips (`- [ ]` → `- [x]`), the phase's own `> Estado:` line, its `> Bloqueo:` line while blocked, deferrals appended to its `## Open questions`, and the plan's own status mark (its `> Estado:` line and, on close, its `> Cierre:` line — Delta 6). The declared-gap hatch is Deltas 4, 5 and 7. Per-phase results, review-gate findings and metrics go to the session's `DECISION`/`CHECKPOINT` — **never** into the plan-doc. Phase blocks are updated **in place — NEVER append a duplicate `### Fn` block** (same contract as CHECKPOINT sections). The entry gate's consented normalization is the single exception, and it lands before execution starts.
129
+ - **Plan-doc residue (hard rule):** execution writes **only** checkbox flips (`- [ ]` → `- [x]`), phase `> Estado:` and `> Bloqueo:` while blocked, deferrals in `## Open questions`, and the plan's title-level `> Estado:`, `> Cierre:` and `> Assurance:` (CLI-sealed at close). Deltas 4, 5 and 7 permit declared gaps; consented normalization occurs before execution. Results, findings and metrics belong in session `DECISION`/`CHECKPOINT`, **never** the plan. Update phases **in place — NEVER append a duplicate `### Fn` block**.
127
130
  - **CHECKPOINT per execution unit:** record its effective grouping, functional states, simulation
128
131
  boundary when applicable, checks/results, decisions, deferrals and next intent. The task boxes
129
132
  and `en ejecución` marks preserve an intra-batch resume.
@@ -222,20 +225,22 @@ adds nothing of its own beyond running on a verified branch and never
222
225
  1. **phase proof** — component interaction, endpoint smoke test, vertical run down to the stub, persistence integration, or the main path end to end;
223
226
  2. **focused tests** — added when the layer carries its own rules, a relevant transformation, error handling, persistence, transactions, temporal logic or external integration;
224
227
  3. **risk tests** — security, concurrency, idempotency, retries, known regressions.
225
- - **One vertical proof per operation while wiring** (request → controller → use case → repository → fake or stub → expected response): it demonstrates the path once instead of re-asserting the same happy path at every layer. Trivial mappers, plain DTOs and framework behavior get no dedicated test.
228
+ - **One vertical proof per operation**; don't repeat happy paths or test trivial mappers/DTOs.
226
229
  - `isolated` remains compatible with literal TDD. A continuous batch may author evidence before
227
230
  code, but first runs it at batch close. No phase becomes `validada` before its exit is demonstrated.
228
231
  - **Continuous means all checks at batch close.** Do not run its phase proofs, focused/risk tests,
229
232
  build, typecheck, lint or review while implementing internal phases. At close run proofs in phase
230
233
  order, then the justified checks and cross-cutting validations. `isolated` runs the same stack for
231
234
  its single phase.
232
- - Each added test is re-weighed at the closing review gate ([`../CODE-POLICIES.md`](../CODE-POLICIES.md) § *Closing review gate* → *Test-value lens*, tag `overtest`): over-testing is a **finding to fix or justify**, never an automatic rejection.
233
- - Also run the plan's `## Validations` (cross-cutting rules and constraints) + the Final behavior block of `## Solution` (legacy plans: the `## Final behavior` section). **What execution runs is the PLAN's evidence, never the spec's prose:** `plan-new` already derived those validations from the spec's acceptance criteria and its `## Scenarios`, so the spec is confirmed functionally **through** them. A criterion no validation covers is a gap of the plan, not a test to improvise here.
235
+ - Review each test's value at close (`CODE-POLICIES.md`, `overtest`); over-testing is a finding to fix or justify, never an automatic rejection.
236
+ - Run the plan's `## Validations` and `## Solution` Final behavior (legacy: `## Final behavior`). The PLAN's evidence, derived from spec criteria and scenarios, decides closure; a criterion without evidence is a plan gap.
234
237
  - A validation that **runs and fails** → back into the phase (gap): no advancing, no `validada`.
235
238
 
236
239
  - **SQL delivery**: validate the migration's behavior against a fixture or ephemeral database in the acquired checkout. The forward/rollback script is delivered through `SCRIPTS.sql` and `export-scripts`; a real application is an optional handoff and never keeps a phase or the plan open.
237
240
 
238
- > The **final validation** is PLAN-exec's **convergence gate** = **`Success criteria` green** (*verification-first*; analogous to SPEC's *analyze gate* and plan-new's *coherence gate*): the plan is not marked *done* until local proof passes. For code and persistence these are checkout commands/tests; a script's real-world application is never a closing criterion.
241
+ > **Final validation** is the convergence gate: `Success criteria` green on local checkout proof before `done`. A script's real-world application is never a closing criterion.
242
+
243
+ For each code source, the final-validation directive names its required build and tests and whether each came from the plan's `## Validations` override or the source's versioned pipeline. A missing command leaves the gate open with the action to declare it in either place. Run both commands in the acquired checkout and return each command's real output as its own evidence; a test suite that did not run never counts. The final gate cannot be omitted by the adaptive route.
239
244
 
240
245
  ## Delta 5 — Closing review gate (conventions, pre-commit)
241
246
 
@@ -250,24 +255,23 @@ without subagents runs a clean re-read instead, and the closing report declares
250
255
 
251
256
  ## Delta 6 — Completion / close
252
257
 
253
- - A phase closes when its `> Estado:` reads `validada`: work done, exit condition true and proof
254
- passed. In a continuous batch every phase waits for the batch review; an operative handoff leaves
255
- the affected phase `bloqueada` and the unit uncommitted.
256
- - **The plan's own state is the third axis, and it stays `open` during the whole run.** Every phase `validada` is **not** the plan closed: the final validation still has to run. Keep `> Estado: open` under the title while executing — stamping it on the first write if the plan carries none — and never write `done` from the counters — a legacy plan with every box ticked is not closed by that fact (§ *Legacy plans degrade safely*).
258
+ - A phase closes as `validada` only after its exit, proof and batch review pass. An operative handoff leaves it `bloqueada` and uncommitted.
259
+ - Check each known outdated spec/plan line with `aw amend apply … --check` before closing; propose its path, edit only with approval.
260
+ - **The plan stays `open` until final validation.** Every phase `validada` is **not** the plan closed; keep `> Estado: open` under the title (stamp it if absent); never write `done` from the counters (§ *Legacy plans degrade safely*).
257
261
  - **Every phase `validada` + final validation passed** unlocks completion, and the mark is written
258
262
  **after Git**: commit each unit, integrate it, and only then seal `done`. A run that isolates its
259
263
  writing holds commits that live on `aw/<session>` and nowhere else, so a `done` stamped before the
260
264
  merge would be true of no branch anybody reads.
261
265
  - **Integrating is part of closing, not a chore after it.** `aw worktree integrate --code <NNN>`
262
- merges every unit of the session into its source's working branch, in alias order, one at a time
263
- over the live branch — never a rebase, a force, a push or a silent branch switch. A **conflict is a
266
+ merges each unit into its sealed base, in alias order, over the live branch — never a rebase,
267
+ force, push or silent branch switch. A **conflict is a
264
268
  live state, not a failure**: the unit, its commits and the merge are kept, the receipt names the
265
- plan, the source and the files, and `aw fix-git --path <source>` (`prepare` → `apply` →
269
+ plan, the source and the files, and `aw fix-git --path <reported merge path>` (`prepare` → `apply` →
266
270
  `commit --confirm`) resolves it; then integrate again to confirm and give the unit back. The plan
267
271
  is not `done` and the session does not close while a unit is still alive.
268
- - **Marking done = ONE status line in the plan-doc**, under the title's blockquote: `> Estado: done`, updated in place on a re-run. The machine value **stands alone** — the date and session go on their own `> Cierre: YYYY-MM-DD · sesión NNN` line right under it, for the same reason a blocker never rides on a phase's state line. It never replaces the per-phase lines inside the `### Fn` blocks — position tells the two apart. No per-phase result tables, no ✅ suffixes — that record lives in the session (`DECISION`/`CHECKPOINT`).
272
+ - **Marking done = ONE status line in the plan-doc** under the title: `> Estado: done`. The CLI seals `> Cierre:` with evidence of the run and `> Assurance: verified|partially_verified|unverified_accepted` on separate lines. Position distinguishes title from phase states; no per-phase result tables or suffixes (use session `DECISION`/`CHECKPOINT`).
269
273
  - **Legacy status line, migrated on write.** A plan carrying the old single-line form (`> Estado: done — YYYY-MM-DD · sesión NNN`) is still **read** as closed; the first time this loop legitimately writes that document, it is rewritten to the two-line form. Compatibility is for reading old plans — every new write uses the normalized contract.
270
- - **No automatic export**: the artifacts (`SCRIPTS.sql`, `DECISION`, …) stay in the session. Promoting them to `docs/` (scripts, manuals, …) is a separate step via `export-*`.
274
+ - **No automatic export**: session artifacts stay there; only a later explicit `export-*` promotes them to `docs/`.
271
275
 
272
276
  ## Sequence
273
277
 
@@ -281,8 +285,6 @@ plan-exec-loop(PPP-plan-<slug>.md):
281
285
  batches = infer_effective_batches(pending phases, plan + live checkout)
282
286
  may merge/split declared rows without asking; legacy absence is allowed
283
287
  record batches + declaration drift in CHECKPOINT
284
- commit_authorization = explicit conditional pre-authorization from the user, if any
285
- record it before editing; otherwise approval is deferred to each green batch close
286
288
  for each Batch in batches:
287
289
  verify every affected source's branch; mismatch → stop + human
288
290
  seed CHECKPOINT.Next = Batch Bn (mode + phases + tasks)
@@ -306,16 +308,15 @@ plan-exec-loop(PPP-plan-<slug>.md):
306
308
  if any proof/check/review/exit condition is not green:
307
309
  preserve actual states + combined uncommitted diff; record unblocking action; stop
308
310
  set every Batch phase > Estado: validada; update CHECKPOINT
309
- prepare exactly one commit per affected source, in its own isolation unit
310
- pre-authorized → commit without another question
311
- else → one consolidated approval for all source commits
312
- rejected → changes stay; record "batch uncommitted"
311
+ propose one message and exact paths per changed source; show them for batch approval
312
+ approved → CLI commits those paths, verifies git and stores receipts before the next batch
313
+ Cerrar → persist the pending batch and its uncommitted changes
313
314
  if last Batch + final validation green:
314
315
  integrate: aw worktree integrate --code NNN # every unit, alias order, live branch
315
- conflict → keep unit + merge; report plan/source/files; aw fix-git --path <source>
316
+ conflict → keep unit + merge; report plan/source/files; aw fix-git --path <reported merge path>
316
317
  (prepare → apply → commit --confirm) → integrate again → release
317
318
  refused (dirty checkout / off branch / uncommitted unit) → fix what it names; retry
318
- then mark plan done: > Estado: done + > Cierre: YYYY-MM-DD · sesión NNN under the title (Delta 6)
319
+ then CLI seals plan: > Estado: done + > Cierre: run evidence + > Assurance: verdict (Delta 6)
319
320
  next-batch precondition: working trees clean or acknowledged
320
321
  if no Batch ran and phases are already validada:
321
322
  run final validation now; if green → same integrate-then-mark-done branch
@@ -52,38 +52,33 @@ Technical detail and roadmap stay inline:
52
52
  > Derived from docs/specs/NNN-spec-<slug>.md · generated by plan-new-loop
53
53
  > Estado: open
54
54
  > Límite de ejecución: checkout
55
+ > Aislamiento: unidad
55
56
 
56
57
  ## Origin source spec/prompt or adopted source + attribution
57
58
  ## Solution AS-IS → TO-BE + "Final behavior" block (core)
58
59
  ## Impacted sources (core)
59
- ## Dependencies docs · sources · DBs · sessions · inter-plan order (opt.)
60
- ## Design references the baselines this plan's roots pin (opt. — only with UI)
60
+ ## Dependencies docs · sources · order (opt.)
61
+ ## Design references the baselines this plan's roots pin (opt. — UI)
61
62
  ## Tasks `### Fn` blocks: the ONLY source of phases (core)
62
63
  ## Execution batches complete phase partition (core)
63
64
  ## Validations proof (core)
64
65
  ## Implementation decisions decisions, controls, risk (when used)
65
- ## Risks / impact technical risks and impacts (opt.)
66
- ## Assumptions delta over the spec only (opt.)
67
- ## Open questions pending; core when any exist; OMIT the section when empty
66
+ ## Risks / impact risks, impact (opt.)
67
+ ## Assumptions (opt.)
68
+ ## Handoff operativo `- Pase a cert|prod: <corte>` (opt.; no boxes)
69
+ ## Open questions pending; OMIT the section when empty
68
70
  ```
69
71
 
70
- Core sections always appear; optional ones only when warranted. Legacy readers tolerate the old
71
- separate sections, which new plans never write.
72
+ Core sections are mandatory; optional ones need a cause. Legacy sections are read, never authored.
72
73
 
73
- > **Header, seal and evidence.** A plan born from the conversation carries
74
- > `> Standalone: <origen> · generated by plan-new-loop` instead of `> Derived from …` (fixed label, free
75
- > prose): it seals no baseline and its deviations go to the session, never to a contract note. With a
76
- > spec, the `> Baseline:` the CLI seals is a **functional** digest of it: an editorial edit leaves this
77
- > plan aligned, and a seal still reading one as divergent is re-sealed (`aw reseal`: `prepare` → `apply
78
- > --approval`, or a re-publication), never redesigned. `## Validations` **derives** from the spec's
79
- > acceptance criteria and `## Scenarios` — tests, evidence and commands live here, outcomes there.
74
+ > **Header, seal and evidence.** Without a spec use `> Standalone: <origen> · generated by plan-new-loop`, no baseline; deviations stay in the session. Otherwise `> Derived from …` and CLI-sealed functional `> Baseline:` apply. Editorial drift calls for `aw reseal` (`prepare` → `apply --approval`) or re-publication. `## Validations` **derives** from the spec's acceptance criteria and `## Scenarios`: outcomes there, commands here.
80
75
 
81
76
  Batch syntax, inference and runtime semantics are defined once in
82
77
  [`PLAN-EXECUTION-BATCHES`](../../modules/PLAN-EXECUTION-BATCHES.md).
83
78
 
84
79
  ## Phase contract (canonical)
85
80
 
86
- A `### Fn` block is a **verifiable state of the system**, never a list of layers, files or classes.
81
+ A `### Fn` is a **verifiable state of the system**, never a list of layers, files or classes.
87
82
 
88
83
  ```markdown
89
84
  ### F1 — <result-oriented name>
@@ -97,32 +92,27 @@ A `### Fn` block is a **verifiable state of the system**, never a list of layers
97
92
  **Condición de salida:** <falsifiable result · contract preserved>
98
93
  ```
99
94
 
100
- **Required**: `Resultado` · `Trabajo` · `Validación de fase` · `Condición de salida` · the state
101
- line · `Fuentes`. Every task declares `_(fuentes: …)_`, a phase subset (`workspace` or an exact
102
- `AGENTS.md > Fuentes` alias); `Impacted` never substitutes them. **Conditional**: `Estado inicial` when unclear · `Recorrido afectado` for a distributed
103
- change · `Dependencias` when direct sequence is insufficient · `Límite de simulación` (**only** when temporary behavior exists) · `Diferido` when work was consciously excluded.
104
- **A new phase never writes an empty conditional block.**
95
+ **Required**: `Resultado`, `Trabajo`, `Validación de fase`, `Condición de salida`, state and `Fuentes`. Every task declares `_(fuentes: …)_` within its phase (`workspace` or `AGENTS.md > Fuentes`); `Impacted` is no substitute. **Conditional**: `Estado inicial` if unclear; `Recorrido afectado` if distributed; `Dependencias` if sequence is insufficient; `Límite de simulación` (**only** when temporary behavior exists); `Diferido` for excluded work. **A new phase never writes an empty conditional block.**
105
96
 
106
- **Checkout is the only closing surface**: proof is a local command, fixture, ephemeral DB or checkout
107
- inspection — a deployed host, product or remote read is research or a non-blocking `Handoff operativo`.
97
+ **Preexisting failures (conditional):** only when observed, add
98
+ `> Rojos previos: [{"file":"tests/x.test.ts","case":"suite > case"}]` inside the phase.
99
+ Use exact runner file/full-case identifiers (JVM: class/method), no wildcards.
100
+ `passed: true` then means no failures outside that list; unidentified failures still reject.
108
101
 
109
- **Phase state = machine state.** One bare `> Estado: <value>` line uses `pendiente` | `en ejecución`
110
- | `bloqueada` | `validada`. It is updated in place and counted
111
- **alongside — not instead of —** checkboxes. `validada` requires completed work, a true exit
112
- condition, its validation **ran and passed**, and a green review gate. **Never** because all its checkboxes are ticked.
113
- Legacy blocks have no line; a missing one reads `pendiente`, and nothing is back-filled.
102
+ **Checkout is the only closing surface**: use local commands, fixtures, ephemeral DB or inspection; deployed hosts and remote reads are research or non-blocking `Handoff operativo`.
103
+
104
+ **Phase state = machine state.** One bare `> Estado: <value>` line uses `pendiente` | `en ejecución` | `bloqueada` | `validada`. It is updated in place and counted **alongside — not instead of —** checkboxes. `validada` requires completed work, a true exit condition, its validation **ran and passed**, and a green review gate. **Never** because all its checkboxes are ticked. Legacy blocks have no line; a missing one reads `pendiente`, and nothing is back-filled.
114
105
 
115
106
  **The state line carries its value alone**; an annotated value reads as `pendiente`. A blocker
116
107
  uses its own `> Bloqueo: <reason>` line and the session records.
117
108
 
118
109
  **The plan carries its own state, and it is a different axis.** Its title-level value is `open` | `done`;
119
- only final validation writes `done` plus `> Cierre: YYYY-MM-DD · sesión NNN`.
110
+ only the CLI seals `done`, `> Cierre:` (run evidence) and `> Assurance:` after final validation.
120
111
  Position disambiguates the two marks. `done` with open work is `inconsistent`; all phases green without
121
112
  closure is `final_validation_pending`.
122
113
 
123
- **Granularity is semantic, not mechanical.** A phase leaves a demonstrable state. A task is a
124
- coherent purpose and may touch many files; an edit operation is a **micro step**, never a plan
125
- entry. Size labels inform risk and scope; they never force a mechanical split.
114
+ **Granularity is semantic, not mechanical.** Tasks express purposes across files.
115
+ An edit is a **micro step**, not a task. Size informs risk, never forces splits.
126
116
 
127
117
  ## Delta 2 — Gap taxonomy (of "plan")
128
118
 
@@ -149,6 +139,8 @@ Replaces the spec taxonomy with a planning one:
149
139
 
150
140
  > **Author the Solution the laziest-that-works way** (chassis § *Minimality*, generative side): reuse what the codebase/stdlib/platform already provides before adding abstractions, layers or dependencies — the gate then *confirms* minimality instead of repairing over-engineering.
151
141
 
142
+ Final validation uses source pipelines. Override under `## Validations`: `- Validación final · \`<alias>\` · build \`<comando>\` · tests \`<comando>\``. Either command may be omitted. Alias must be a phase source, not `workspace`; each clause needs local proof.
143
+
152
144
  ## Delta 3 — What research investigates here
153
145
 
154
146
  Inline research maps affected code, AS-IS wiring and dependencies into `Solution`/`Impacted`.
@@ -29,7 +29,10 @@ This loop turns a plan into a sequence of **verifiable states of the system**. E
29
29
 
30
30
  > `plan-exec` can implement every phase **without inventing** contracts, observable states, structural order, simulation boundary or exit evidence.
31
31
 
32
- The phase contract is defined **once** in [`plan-new-loop`](../plan-new-loop/LOOP.md) § *Phase contract (canonical)* — this loop **applies** it and never redefines it: a `### Fn` block is a state the system reaches, with its `> Estado:` line, its work, its evidence and its exit condition.
32
+ This loop **applies** it and never redefines it: [`plan-new-loop`](../plan-new-loop/LOOP.md)
33
+ § *Phase contract (canonical)*, including conditional
34
+ `> Rojos previos:` JSON file/case lists when failures are observed. Preserve exact identities;
35
+ never add an empty list or waive unidentified failures. A `### Fn` demonstrates a system state.
33
36
 
34
37
  The plan's execution-unit interface is likewise defined once in
35
38
  [`PLAN-EXECUTION-BATCHES`](../../modules/PLAN-EXECUTION-BATCHES.md). This loop re-infers and
@@ -37,7 +40,8 @@ writes its complete phase partition; it never asks the human to choose an optimi
37
40
  can establish.
38
41
 
39
42
  ## Auxiliary / NOT mandatory
40
- `plan-exec` runs **any** plan that is already executable, refined or not — there is **no** gate requiring plan-refine. This loop exists to incorporate changes (new requirements, scope adjustments, deps/risks spotted on re-read) **before** executing, and to give an unexecutable plan the shape its execution needs, without regenerating it from scratch.
43
+ `plan-exec` runs **any executable plan**, refined or not. This optional loop incorporates changes
44
+ before execution and repairs unexecutable structure in place.
41
45
 
42
46
  ## Started by
43
47
  `/w:plan-refine` — **resumable** (same chassis mechanism, keyed off CHECKPOINT) and **re-runnable on demand** (see *Compact / resume*). Second path: **the return from execution** — `plan-exec` derives here when its entry check finds a structural gap it cannot normalize, or when it stops mid-run on a structural deviation (§ *Replanning executed work*).
@@ -137,6 +141,8 @@ This loop's instance of the chassis convergence gate — the same one `plan-exec
137
141
  - **Execution batches** — every phase appears once; maximal continuous ranges cross no decision, proof, handoff, irreversible action or required recovery boundary.
138
142
  - **Resumability** — tasks legible enough for a `CHECKPOINT`, intermediate states stable, pending work distinguishable from work already `validada`.
139
143
 
144
+ The CLI alone seals `> Cierre:` with run evidence and `> Assurance:` after final validation; refinement only changes the plan's structure.
145
+
140
146
  ## Sequence
141
147
 
142
148
  ```
@@ -34,7 +34,7 @@ QUICK
34
34
 
35
35
  ## Internal session
36
36
 
37
- - **ALWAYS** creates a light session with descriptor `<slug>-quick` → `NNN-<slug>-quick` (Type = `quick`, ≈ `exec`): `SESSION` · `DECISION` · `SCRIPTS.sql` · `CHECKPOINT` (+ `BACKLOG` only if something is deferred). A single session. Research is **inline** inside it (`ANALYSIS-FILE`/`CONCLUSIONS` + read-only `SCRIPTS.sql` in its folder). **Exception:** an entry-gate escalation to SPEC creates no quick session — the run never comes to exist and the session is the `spec-refine-loop` one.
37
+ - **ALWAYS** creates a light session with descriptor `<slug>-quick` → `NNN-<slug>-quick` (Type = `quick`, ≈ `exec`): `SESSION` · `DECISION` · `SCRIPTS.sql` · `CHECKPOINT` (+ `BACKLOG` only if something is deferred). Research stays **inline** (`ANALYSIS-FILE`/`CONCLUSIONS` + read-only `SCRIPTS.sql`). Escalation closes this session before SPEC continues.
38
38
 
39
39
  ## Inherits
40
40
 
@@ -42,7 +42,7 @@ Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **a
42
42
 
43
43
  ## Composes
44
44
 
45
- `git` · `sql` (DB rule) · `research` (inline). Resolved via `.workflow/skills.toml`.
45
+ Git safety, DB scripts-only and inline research are loop rules. Host-native help is optional and does not override them.
46
46
 
47
47
  ## QUICK delta — minimal ceremony
48
48
 
@@ -53,16 +53,16 @@ Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **a
53
53
  - **Git and DB inline** (full policies in [`../CODE-POLICIES.md`](../CODE-POLICIES.md)): before editing, verify each source's expected branch (`aw check-branch`); **proposed** commit (approve first) — never `push`/`--amend`/`--no-verify`. The AI **never executes DML/DDL**: migrations are drafted into the session's `SCRIPTS.sql`; fixture/ephemeral checks are local proof and any remote read is research context, never closure.
54
54
  - **Fix preview, before executing**: declare the fix you are about to make — files to touch, intent, expected shape of the diff. It is **proportional**: one line for something trivial; approach, files and risks for something complex. Above the same signal threshold that fires the entry size gate (below), a person approves it (`Ejecutar tal cual` · `Ajustar el enfoque` · `Escalar a spec` → *Mid-loop escalation*). **Below the threshold there is no human stop**: the preview stays declared in the session and the task executes.
55
55
  - **One session. One commit** proposed at the end (only if there were code changes), **after the proportional closing review gate** ([`../CODE-POLICIES.md`](../CODE-POLICIES.md) § *Closing review gate*): diff re-read + ambient conventions; fix or defer; nothing reaches the commit unreviewed.
56
- - **Entry SIZE GATE** (before creating the session): a quick that should have been a spec costs more than the ceremony it saved, so the size of the objective is judged **before** anything exists. Your part is recognizing the signals; the threshold, its anti-duplicate search, the question and its options are the CLI's. A signal already resolved by *adopted context* is **not** a signal (chassis § *Adopted context*). A **resume** of an existing quick never re-fires it.
56
+ - **Entry SIZE GATE** (before implementation): a quick that should have been a spec costs more than the ceremony it saved. Recognize the signals; the threshold, anti-duplicate search and alternatives are the CLI's. A signal resolved by *adopted context* is **not** a signal (chassis § *Adopted context*). A **resume** never re-fires the gate.
57
57
  - **`Recortar alcance`**, if chosen: propose the **sub-task that DOES fit** a quick (`SESSION.Objective` = the sub-task; the original prompt goes into `## Origin`) and defer the rest to `BACKLOG` ("trimmed at the gate — may warrant its own spec, `/w:spec-new`").
58
- - **`Cambiar a SPEC`**, if chosen: **no quick session is created** — run the *Live transition to SPEC* (next bullet).
58
+ - **`Cambiar a SPEC`** closes the existing quick, preserving its request for *Live transition to SPEC*.
59
59
  - **Live transition to SPEC** (shared by the gate and mid-loop escalation). On acceptance, the work line **moves to the SPEC flow**: the explicit consent in the structured-choice **equals invoking the destination command** (*consented exception* — rule 3 of the *Continuity rule*, [`../../SKILL.md`](../../SKILL.md) § *Operating context*). On the SPEC side:
60
60
  1. **Materialize the draft** via the [`../../commands/spec-new.md`](../../commands/spec-new.md) procedure: `aw next-number docs/specs --publish spec-<slug>.md` with the finished draft on stdin (one atomic act: number assigned, document written, no reservation left), schema, single-pass **NO RESEARCH** — its bounded reconnaissance does **not** re-fire (this run's context arrives adopted). `## Origin` = "escalated from `/w:quick`" + the original prompt (+ the origin quick session if it exists). The draft is born `status: draft`: only the SPEC gate promotes it to `ready-for-plan`.
61
61
  2. **Load and execute** [`../spec-refine-loop/LOOP.md`](../spec-refine-loop/LOOP.md) — over that spec (trampoline pattern).
62
62
  3. The run's session is that loop's **normal** `NNN-<slug>-spec-refine` (the CLI numbers it; its `## Origin` records the escalation). **Invariant 2 intact**: quick, while it is quick, never writes `docs/` — the draft is written by the SPEC flow, post-consent.
63
63
  - **Mid-loop escalation + handoff**: if the task grows, declare the signals again — the CLI applies the same threshold and, if it fires, asks. If the user accepts moving up:
64
64
  1. **Any already-edited code stays** in the working tree (never reverted) and is **recorded** in `CHECKPOINT` + `BACKLOG`: "uncommitted changes in `<source>` — decide commit/discard on resume" (the "rejected commit" pattern of *Safe git*).
65
- 2. The quick session goes to `finalize` with the **pointer** in `BACKLOG`: to **PLAN** → "escalated to `docs/plans/PPP` — resume there" (**deferred**: seed + pointer, no live entry); to **SPEC** → "escalated to `docs/specs/NNN` — **continued live** (session `NNN-<slug>-spec-refine`)", or "escalated at the preview — continue in `/w:spec-new`" when no code and no `NNN` exist yet.
65
+ 2. The CLI writes the escalation pointer in `BACKLOG` before closing the quick. **SPEC** continues through `/w:spec-new` with the preserved request; **PLAN** stays deferred (seed + pointer, no live entry).
66
66
  3. The artifacts (`DECISION`, `SCRIPTS.sql`) **stay in the quick session** as referenceable context, never migrated.
67
67
  4. **SPEC enters live**: after `finalize`, run the *Live transition to SPEC* (draft **only if no spec exists** for this objective; then the loop). **Asymmetry** intact: PLAN can **absorb** the progress (plan-exec picks up the existing working tree); SPEC **restarts** the design cycle and treats the half-done code as context/reference, never as ingested work.
68
68
 
@@ -71,7 +71,7 @@ Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **a
71
71
  ```
72
72
  quick-loop(prompt):
73
73
  # `Cambiar a SPEC` → live transition (see delta): draft (spec-new procedure) +
74
- # load and execute ../spec-refine-loop/LOOP.md → END (no quick session)
74
+ # load ../spec-refine-loop/LOOP.md → END (quick closed by CLI)
75
75
  if the conversation already established analysis/conclusions → # adopted context (chassis)
76
76
  adopt them (SESSION.Origin = "adopted from host conversation"; reference in CONCLUSIONS) — never re-derive/re-ask
77
77
  author SESSION.Success criteria = the deliverable's check # test(s) if code · short RATIFIED rubric if analysis/design
@@ -99,6 +99,7 @@ finalize: CHECKPOINT (AFTER: Pending→Completed) + BACKLOG (only if something i
99
99
 
100
100
  ## Convergence / exit
101
101
 
102
+ - Before closing, run `aw amend apply … --check` for each spec/plan line known to be outdated. Propose its returned path; never edit without approval.
102
103
  - Closing review gate passed and commit proposed if there was code (or skipping it approved) → `Cerrar`.
103
104
  - `Cerrar`/`Compactar` (`flow` control) → persists `CHECKPOINT` + `BACKLOG` (resumable).
104
105
  - **No export**: nothing goes to `docs/` (§ *Writes*); escalating is the only way up.
@@ -75,7 +75,7 @@ The **UI unspecified** gap (when the requirement involves UI; see *Gap taxonomy*
75
75
 
76
76
  Other transversal capabilities the engine always uses: `research` (**inline** — chassis § *Research*), `sql` (DB rule inside research — chassis). All resolved by config; `off` → the loop continues without the capability and, if it was needed, says so or asks. The spec's **prose** follows the **ambient** writing conventions (the host auto-applies an installed writing skill if present), not a composed role.
77
77
 
78
- > **Ambient conventions (not roles):** code/testing/writing standards and `creating-tools` are standalone skills the host auto-discovers by `description` — Workline neither binds nor depends on them. Full doctrine: [../../roles/README.md](../../roles/README.md).
78
+ > **Ambient conventions (not roles):** host help for code/testing/writing or tooling may come from any origin; Workline neither binds nor depends on it. Full doctrine: [../../roles/README.md](../../roles/README.md).
79
79
 
80
80
  ## Current-behavior baseline (brownfield first)
81
81
 
@@ -23,16 +23,16 @@ identical for both, and the mode decides which task-pin form is legal.
23
23
  digest: `sha256:<64 hex>`
24
24
  ```
25
25
 
26
- A simple design's hint is its `DESIGN.md`.
26
+ A simple design hints `DESIGN.md`; archiving its revision keeps the hint valid.
27
27
 
28
28
  - `package` pins **identity and revision**. `latest`, a folder slug, a bare
29
29
  `DES-001` or a title are rejected: each answers a different question next year.
30
- - `baseline_hint` is a **location hint**, never the identity. A renamed dossier
31
- keeps the reference valid and reports the hint as stale.
30
+ - `baseline_hint` is a **location hint**, never identity. A renamed dossier
31
+ warns stale; archiving a simple revision does not.
32
32
  - `digest` seals the exact bytes; one that no longer matches never resolves
33
33
  quietly.
34
- - Several designs are several blocks. One named in prose **without being pinned**
35
- is reported, not ignored.
34
+ - Several designs are several blocks. A bare id warns only if the plan pins or
35
+ attempts a reference; `DES-001@alias` always warns.
36
36
 
37
37
  **Never in the document**: Screen Specifications, flow graphs, state inventories,
38
38
  region or component tables, mockups, embedded images. Those live at their own
@@ -87,12 +87,10 @@ claim.
87
87
 
88
88
  ## quick — read it, never rewrite it
89
89
 
90
- `quick` **reads and validates** (`aw designs`, `aw designs --plan`); it changes
91
- nothing a baseline seals — normative content, a maturity, an approval. A tweak
92
- that needs a new state or a redrawn journey **escalates with the evidence it
93
- gathered**: `plan-refine` for the package, `spec-refine` when behavior or
94
- acceptance moves. Editing silently moves the revision while every consumer stays
95
- pinned to the old digest.
90
+ `quick` **reads and validates** (`aw designs`, `aw designs --plan`); it never
91
+ changes sealed content, maturity or approval. A new state or journey escalates with the
92
+ evidence it gathered: `plan-refine` for the package, `spec-refine` when behavior
93
+ or acceptance moves.
96
94
 
97
95
  ## plan-refine — the delta, and only the delta
98
96
 
@@ -57,9 +57,9 @@ action go to `CHECKPOINT`.
57
57
 
58
58
  ## Git authorization
59
59
 
60
- A green batch produces exactly one proposed commit per affected source. Approving is not committing,
61
- and a check that never ran is not a green batch. For the last pending batch the same approval also
62
- covers marking the fully validated plan `done`, so that final write rides in the source's single
63
- commit instead of asking a second time.
60
+ A green batch proposes one message and exact paths per changed source. After its approval the CLI
61
+ commits only those paths and verifies git before the next batch; approval alone is not a commit.
62
+ No paths means no commit. `done` is sealed after git/integration in the workspace plan, not in a
63
+ source commit; a later workspace-close commit may carry it. An unrun check is never green.
64
64
 
65
65
  > **What proves the batch was green is not this document's call:** the deterministic steps below are decided by the CLI (`aw flow advance`), not by this document — positionally, behind the delegated validation and the review, neither of which a narration can pass.
@@ -14,6 +14,8 @@ Loaded when the run has to locate or name a session beyond creating its own (sig
14
14
 
15
15
  **Reopen to continue**: `aw session-resume --code <NNN> --reopen` reactivates a **closed** session (removes `.closed` → active) to keep working in it; without `--reopen`, resume is read-only. To detect the most recent closed one: `aw resume-summary --include-recent-closed` (or `aw sessions --state all`).
16
16
 
17
+ **User-owned states:** only the person marks a session `paused` (`aw session-pause --code <NNN>`) or `abandoned` (`aw session-close --code <NNN> --abandon`). A loop never assigns either state by itself. `aw session-resume --code <NNN>` activates a paused session again; an abandoned one requires the person's explicit `--reopen`.
18
+
17
19
  ## When the durable record fails to update
18
20
 
19
21
  `aw session-close` also upserts the session's row in `.workflow/HISTORY.md` — the durable record, since `sessions/` is gitignored. That upsert is **non-fatal**: on `history_error` in its output, re-run `aw history-update --code <NNN> --state closed`. `aw session-artifacts` inspects what a session holds.