@opengsd/gsd-path 1.3.1 → 1.5.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 (481) hide show
  1. package/AGENTS.md +2 -207
  2. package/CHANGELOG.md +331 -69
  3. package/DOCS.md +25 -9
  4. package/FULL.md +12 -5
  5. package/GUIDE.md +1 -1
  6. package/HOOKS.md +104 -14
  7. package/QUICK.md +5 -2
  8. package/README.md +131 -111
  9. package/RUNTIME.md +2 -2
  10. package/UPDATE.md +61 -11
  11. package/WORKFLOW.md +44 -7
  12. package/package.json +13 -9
  13. package/platforms/shared-agents/dispatch.md +13 -0
  14. package/scripts/_common.py +619 -18
  15. package/scripts/archive_milestone.py +160 -86
  16. package/scripts/bootstrap_repository.py +8 -5
  17. package/scripts/build_recovery.py +100 -32
  18. package/scripts/build_state.py +143 -24
  19. package/scripts/check_docs_audit.py +91 -7
  20. package/scripts/check_handoffs.py +662 -50
  21. package/scripts/check_task_briefs.py +338 -30
  22. package/scripts/check_update.py +2 -2
  23. package/scripts/core_hook_gate.py +10 -1
  24. package/scripts/core_hook_settings.py +11 -4
  25. package/scripts/detect_project.py +587 -32
  26. package/scripts/discussion_records.py +19 -13
  27. package/scripts/discussion_validate.py +152 -50
  28. package/scripts/dispatch_driver.py +501 -46
  29. package/scripts/git_guard.py +118 -31
  30. package/scripts/guard_hook.py +1567 -194
  31. package/scripts/install.mjs +77 -46
  32. package/scripts/install.py +611 -50
  33. package/scripts/integration.py +580 -25
  34. package/scripts/isolation.py +1438 -57
  35. package/scripts/lean_verification.py +99 -19
  36. package/scripts/loop_run.py +31 -29
  37. package/scripts/members.py +706 -0
  38. package/scripts/migrate_core.py +2 -2
  39. package/scripts/path_config.py +5 -5
  40. package/scripts/pipeline_diagnose.py +82 -31
  41. package/scripts/pipeline_git.py +124 -34
  42. package/scripts/pipeline_state.py +287 -87
  43. package/scripts/pipeline_undo.py +218 -30
  44. package/scripts/promote_lookahead.py +1 -1
  45. package/scripts/review_panel.py +1 -1
  46. package/scripts/runtime_store.py +55 -11
  47. package/scripts/skill-resources.json +37 -5
  48. package/scripts/state_checkpoint.py +135 -44
  49. package/scripts/state_promote.py +2 -0
  50. package/scripts/status_runtime.py +58 -10
  51. package/scripts/sync_skill_resources.py +8 -7
  52. package/scripts/task_context.py +12 -3
  53. package/scripts/token_budget.py +12 -8
  54. package/scripts/wizard.mjs +1 -0
  55. package/scripts/workflow_run.py +107 -30
  56. package/scripts/worktree_paths.py +72 -10
  57. package/skills/gsd-path/BUILD.md +7 -1
  58. package/skills/gsd-path/DECIDE.md +11 -4
  59. package/skills/gsd-path/DEFINE.md +36 -4
  60. package/skills/gsd-path/DOCS-AUDIT.md +6 -4
  61. package/skills/gsd-path/INSPECT.md +5 -4
  62. package/skills/gsd-path/PLAN.md +18 -4
  63. package/skills/gsd-path/RESEARCH.md +13 -1
  64. package/skills/gsd-path/ROADMAP.md +2 -1
  65. package/skills/gsd-path/SHIP.md +33 -11
  66. package/skills/gsd-path/SKILL.md +45 -1
  67. package/skills/gsd-path/references/build-native.md +63 -15
  68. package/skills/gsd-path/references/codebase-mapper.md +2 -1
  69. package/skills/gsd-path/references/dispatch.md +13 -0
  70. package/skills/gsd-path/references/docs-auditor.md +7 -1
  71. package/skills/gsd-path/references/operating-rules.md +214 -0
  72. package/skills/gsd-path/references/planner.md +22 -4
  73. package/skills/gsd-path/references/reviewer-final.md +20 -2
  74. package/skills/gsd-path/references/reviewer-wave.md +18 -5
  75. package/skills/gsd-path/references/reviewer.md +3 -1
  76. package/skills/gsd-path/references/spec-probes.md +150 -0
  77. package/skills/gsd-path/scripts/_common.py +619 -18
  78. package/skills/gsd-path/scripts/archive_milestone.py +160 -86
  79. package/skills/gsd-path/scripts/bootstrap_repository.py +8 -5
  80. package/skills/gsd-path/scripts/build_recovery.py +100 -32
  81. package/skills/gsd-path/scripts/build_state.py +143 -24
  82. package/skills/gsd-path/scripts/check_docs_audit.py +91 -7
  83. package/skills/gsd-path/scripts/check_handoffs.py +662 -50
  84. package/skills/gsd-path/scripts/check_task_briefs.py +338 -30
  85. package/skills/gsd-path/scripts/check_update.py +2 -2
  86. package/skills/gsd-path/scripts/detect_project.py +587 -32
  87. package/skills/gsd-path/scripts/discussion_records.py +19 -13
  88. package/skills/gsd-path/scripts/discussion_validate.py +152 -50
  89. package/skills/gsd-path/scripts/dispatch_driver.py +501 -46
  90. package/skills/gsd-path/scripts/git_guard.py +118 -31
  91. package/skills/gsd-path/scripts/integration.py +580 -25
  92. package/skills/gsd-path/scripts/isolation.py +1438 -57
  93. package/skills/gsd-path/scripts/lean_verification.py +99 -19
  94. package/skills/gsd-path/scripts/loop_run.py +31 -29
  95. package/skills/gsd-path/scripts/members.py +706 -0
  96. package/skills/gsd-path/scripts/path_config.py +5 -5
  97. package/skills/gsd-path/scripts/pipeline_git.py +124 -34
  98. package/skills/gsd-path/scripts/pipeline_state.py +287 -87
  99. package/skills/gsd-path/scripts/promote_lookahead.py +1 -1
  100. package/skills/gsd-path/scripts/review_panel.py +1 -1
  101. package/skills/gsd-path/scripts/state_checkpoint.py +135 -44
  102. package/skills/gsd-path/scripts/state_promote.py +2 -0
  103. package/skills/gsd-path/scripts/status_runtime.py +58 -10
  104. package/skills/gsd-path/scripts/task_context.py +12 -3
  105. package/skills/gsd-path/scripts/token_budget.py +12 -8
  106. package/skills/gsd-path/scripts/workflow_run.py +107 -30
  107. package/skills/gsd-path/scripts/worktree_paths.py +72 -10
  108. package/skills/gsd-path/templates/codebase.md +1 -1
  109. package/skills/gsd-path/templates/docs-audit.md +6 -2
  110. package/skills/gsd-path/templates/final-review.md +16 -4
  111. package/skills/gsd-path/templates/gap-review.md +2 -1
  112. package/skills/gsd-path/templates/intent.md +30 -0
  113. package/skills/gsd-path/templates/patch-findings.md +3 -3
  114. package/skills/gsd-path/templates/plan.md +17 -2
  115. package/skills/gsd-path/templates/research-handoff.md +14 -3
  116. package/skills/gsd-path/templates/state.md +1 -1
  117. package/skills/gsd-path/templates/task.md +1 -0
  118. package/skills/gsd-path/templates/wave-review.md +16 -4
  119. package/skills/gsd-path-build/SKILL.md +7 -1
  120. package/skills/gsd-path-build/references/build-native.md +63 -15
  121. package/skills/gsd-path-build/references/dispatch.md +13 -0
  122. package/skills/gsd-path-build/references/operating-rules.md +214 -0
  123. package/skills/gsd-path-build/references/reviewer-final.md +20 -2
  124. package/skills/gsd-path-build/references/reviewer-wave.md +18 -5
  125. package/skills/gsd-path-build/references/reviewer.md +3 -1
  126. package/skills/gsd-path-build/references/spec-probes.md +150 -0
  127. package/skills/gsd-path-build/scripts/_common.py +619 -18
  128. package/skills/gsd-path-build/scripts/archive_milestone.py +160 -86
  129. package/skills/gsd-path-build/scripts/build_recovery.py +100 -32
  130. package/skills/gsd-path-build/scripts/build_state.py +143 -24
  131. package/skills/gsd-path-build/scripts/check_handoffs.py +662 -50
  132. package/skills/gsd-path-build/scripts/check_task_briefs.py +338 -30
  133. package/skills/gsd-path-build/scripts/detect_project.py +587 -32
  134. package/skills/gsd-path-build/scripts/discussion_records.py +19 -13
  135. package/skills/gsd-path-build/scripts/discussion_validate.py +152 -50
  136. package/skills/gsd-path-build/scripts/dispatch_driver.py +501 -46
  137. package/skills/gsd-path-build/scripts/integration.py +580 -25
  138. package/skills/gsd-path-build/scripts/isolation.py +1438 -57
  139. package/skills/gsd-path-build/scripts/loop_run.py +31 -29
  140. package/skills/gsd-path-build/scripts/members.py +706 -0
  141. package/skills/gsd-path-build/scripts/path_config.py +5 -5
  142. package/skills/gsd-path-build/scripts/pipeline_git.py +124 -34
  143. package/skills/gsd-path-build/scripts/pipeline_state.py +287 -87
  144. package/skills/gsd-path-build/scripts/promote_lookahead.py +1 -1
  145. package/skills/gsd-path-build/scripts/review_panel.py +1 -1
  146. package/skills/gsd-path-build/scripts/state_checkpoint.py +135 -44
  147. package/skills/gsd-path-build/scripts/state_promote.py +2 -0
  148. package/skills/gsd-path-build/scripts/task_context.py +12 -3
  149. package/skills/gsd-path-build/scripts/token_budget.py +12 -8
  150. package/skills/gsd-path-build/scripts/workflow_run.py +107 -30
  151. package/skills/gsd-path-build/scripts/worktree_paths.py +72 -10
  152. package/skills/gsd-path-build/templates/task.md +1 -0
  153. package/skills/gsd-path-build/templates/wave-review.md +16 -4
  154. package/skills/gsd-path-decide/SKILL.md +11 -4
  155. package/skills/gsd-path-decide/references/dispatch.md +13 -0
  156. package/skills/gsd-path-decide/references/operating-rules.md +214 -0
  157. package/skills/gsd-path-decide/scripts/_common.py +619 -18
  158. package/skills/gsd-path-decide/scripts/archive_milestone.py +160 -86
  159. package/skills/gsd-path-decide/scripts/build_recovery.py +100 -32
  160. package/skills/gsd-path-decide/scripts/check_handoffs.py +662 -50
  161. package/skills/gsd-path-decide/scripts/check_task_briefs.py +338 -30
  162. package/skills/gsd-path-decide/scripts/detect_project.py +587 -32
  163. package/skills/gsd-path-decide/scripts/discussion_records.py +19 -13
  164. package/skills/gsd-path-decide/scripts/discussion_validate.py +152 -50
  165. package/skills/gsd-path-decide/scripts/integration.py +580 -25
  166. package/skills/gsd-path-decide/scripts/isolation.py +1438 -57
  167. package/skills/gsd-path-decide/scripts/loop_run.py +31 -29
  168. package/skills/gsd-path-decide/scripts/members.py +706 -0
  169. package/skills/gsd-path-decide/scripts/path_config.py +5 -5
  170. package/skills/gsd-path-decide/scripts/pipeline_git.py +124 -34
  171. package/skills/gsd-path-decide/scripts/pipeline_state.py +287 -87
  172. package/skills/gsd-path-decide/scripts/promote_lookahead.py +1 -1
  173. package/skills/gsd-path-decide/scripts/review_panel.py +1 -1
  174. package/skills/gsd-path-decide/scripts/state_checkpoint.py +135 -44
  175. package/skills/gsd-path-decide/scripts/state_promote.py +2 -0
  176. package/skills/gsd-path-decide/scripts/worktree_paths.py +72 -10
  177. package/skills/gsd-path-define/SKILL.md +36 -4
  178. package/skills/gsd-path-define/references/operating-rules.md +214 -0
  179. package/skills/gsd-path-define/references/spec-probes.md +150 -0
  180. package/skills/gsd-path-define/scripts/_common.py +619 -18
  181. package/skills/gsd-path-define/scripts/archive_milestone.py +160 -86
  182. package/skills/gsd-path-define/scripts/build_recovery.py +100 -32
  183. package/skills/gsd-path-define/scripts/check_handoffs.py +662 -50
  184. package/skills/gsd-path-define/scripts/check_task_briefs.py +338 -30
  185. package/skills/gsd-path-define/scripts/detect_project.py +587 -32
  186. package/skills/gsd-path-define/scripts/discussion_records.py +19 -13
  187. package/skills/gsd-path-define/scripts/discussion_validate.py +152 -50
  188. package/skills/gsd-path-define/scripts/integration.py +580 -25
  189. package/skills/gsd-path-define/scripts/isolation.py +1438 -57
  190. package/skills/gsd-path-define/scripts/loop_run.py +31 -29
  191. package/skills/gsd-path-define/scripts/members.py +706 -0
  192. package/skills/gsd-path-define/scripts/path_config.py +5 -5
  193. package/skills/gsd-path-define/scripts/pipeline_git.py +124 -34
  194. package/skills/gsd-path-define/scripts/pipeline_state.py +287 -87
  195. package/skills/gsd-path-define/scripts/promote_lookahead.py +1 -1
  196. package/skills/gsd-path-define/scripts/review_panel.py +1 -1
  197. package/skills/gsd-path-define/scripts/state_checkpoint.py +135 -44
  198. package/skills/gsd-path-define/scripts/state_promote.py +2 -0
  199. package/skills/gsd-path-define/scripts/worktree_paths.py +72 -10
  200. package/skills/gsd-path-define/templates/intent.md +30 -0
  201. package/skills/gsd-path-define/templates/state.md +1 -1
  202. package/skills/gsd-path-discuss/SKILL.md +2 -1
  203. package/skills/gsd-path-discuss/references/operating-rules.md +214 -0
  204. package/skills/gsd-path-discuss/scripts/_common.py +619 -18
  205. package/skills/gsd-path-discuss/scripts/discussion_records.py +19 -13
  206. package/skills/gsd-path-discuss/scripts/loop_run.py +31 -29
  207. package/skills/gsd-path-discuss/scripts/path_config.py +5 -5
  208. package/skills/gsd-path-discuss/scripts/review_panel.py +1 -1
  209. package/skills/gsd-path-discuss/scripts/worktree_paths.py +72 -10
  210. package/skills/gsd-path-docs-audit/SKILL.md +6 -4
  211. package/skills/gsd-path-docs-audit/references/dispatch.md +13 -0
  212. package/skills/gsd-path-docs-audit/references/docs-auditor.md +7 -1
  213. package/skills/gsd-path-docs-audit/references/operating-rules.md +214 -0
  214. package/skills/gsd-path-docs-audit/scripts/_common.py +619 -18
  215. package/skills/gsd-path-docs-audit/scripts/archive_milestone.py +160 -86
  216. package/skills/gsd-path-docs-audit/scripts/build_recovery.py +100 -32
  217. package/skills/gsd-path-docs-audit/scripts/check_docs_audit.py +91 -7
  218. package/skills/gsd-path-docs-audit/scripts/check_handoffs.py +662 -50
  219. package/skills/gsd-path-docs-audit/scripts/check_task_briefs.py +338 -30
  220. package/skills/gsd-path-docs-audit/scripts/detect_project.py +587 -32
  221. package/skills/gsd-path-docs-audit/scripts/discussion_records.py +19 -13
  222. package/skills/gsd-path-docs-audit/scripts/discussion_validate.py +152 -50
  223. package/skills/gsd-path-docs-audit/scripts/integration.py +580 -25
  224. package/skills/gsd-path-docs-audit/scripts/isolation.py +1438 -57
  225. package/skills/gsd-path-docs-audit/scripts/loop_run.py +31 -29
  226. package/skills/gsd-path-docs-audit/scripts/members.py +706 -0
  227. package/skills/gsd-path-docs-audit/scripts/path_config.py +5 -5
  228. package/skills/gsd-path-docs-audit/scripts/pipeline_git.py +124 -34
  229. package/skills/gsd-path-docs-audit/scripts/pipeline_state.py +287 -87
  230. package/skills/gsd-path-docs-audit/scripts/promote_lookahead.py +1 -1
  231. package/skills/gsd-path-docs-audit/scripts/review_panel.py +1 -1
  232. package/skills/gsd-path-docs-audit/scripts/state_checkpoint.py +135 -44
  233. package/skills/gsd-path-docs-audit/scripts/state_promote.py +2 -0
  234. package/skills/gsd-path-docs-audit/scripts/worktree_paths.py +72 -10
  235. package/skills/gsd-path-docs-audit/templates/docs-audit.md +6 -2
  236. package/skills/gsd-path-forensics/SKILL.md +2 -1
  237. package/skills/gsd-path-forensics/references/operating-rules.md +214 -0
  238. package/skills/gsd-path-forensics/scripts/_common.py +619 -18
  239. package/skills/gsd-path-forensics/scripts/discussion_records.py +19 -13
  240. package/skills/gsd-path-forensics/scripts/loop_run.py +31 -29
  241. package/skills/gsd-path-forensics/scripts/path_config.py +5 -5
  242. package/skills/gsd-path-forensics/scripts/pipeline_diagnose.py +82 -31
  243. package/skills/gsd-path-forensics/scripts/pipeline_undo.py +218 -30
  244. package/skills/gsd-path-forensics/scripts/review_panel.py +1 -1
  245. package/skills/gsd-path-forensics/scripts/worktree_paths.py +72 -10
  246. package/skills/gsd-path-inspect/SKILL.md +5 -4
  247. package/skills/gsd-path-inspect/references/codebase-mapper.md +2 -1
  248. package/skills/gsd-path-inspect/references/dispatch.md +13 -0
  249. package/skills/gsd-path-inspect/references/docs-auditor.md +7 -1
  250. package/skills/gsd-path-inspect/references/operating-rules.md +214 -0
  251. package/skills/gsd-path-inspect/scripts/_common.py +619 -18
  252. package/skills/gsd-path-inspect/scripts/archive_milestone.py +160 -86
  253. package/skills/gsd-path-inspect/scripts/build_recovery.py +100 -32
  254. package/skills/gsd-path-inspect/scripts/check_docs_audit.py +91 -7
  255. package/skills/gsd-path-inspect/scripts/check_handoffs.py +662 -50
  256. package/skills/gsd-path-inspect/scripts/check_task_briefs.py +338 -30
  257. package/skills/gsd-path-inspect/scripts/detect_project.py +587 -32
  258. package/skills/gsd-path-inspect/scripts/discussion_records.py +19 -13
  259. package/skills/gsd-path-inspect/scripts/discussion_validate.py +152 -50
  260. package/skills/gsd-path-inspect/scripts/integration.py +580 -25
  261. package/skills/gsd-path-inspect/scripts/isolation.py +1438 -57
  262. package/skills/gsd-path-inspect/scripts/loop_run.py +31 -29
  263. package/skills/gsd-path-inspect/scripts/members.py +706 -0
  264. package/skills/gsd-path-inspect/scripts/path_config.py +5 -5
  265. package/skills/gsd-path-inspect/scripts/pipeline_git.py +124 -34
  266. package/skills/gsd-path-inspect/scripts/pipeline_state.py +287 -87
  267. package/skills/gsd-path-inspect/scripts/promote_lookahead.py +1 -1
  268. package/skills/gsd-path-inspect/scripts/review_panel.py +1 -1
  269. package/skills/gsd-path-inspect/scripts/state_checkpoint.py +135 -44
  270. package/skills/gsd-path-inspect/scripts/state_promote.py +2 -0
  271. package/skills/gsd-path-inspect/scripts/workflow_run.py +107 -30
  272. package/skills/gsd-path-inspect/scripts/worktree_paths.py +72 -10
  273. package/skills/gsd-path-inspect/templates/codebase.md +1 -1
  274. package/skills/gsd-path-inspect/templates/docs-audit.md +6 -2
  275. package/skills/gsd-path-inspect/templates/state.md +1 -1
  276. package/skills/gsd-path-loop/SKILL.md +2 -1
  277. package/skills/gsd-path-loop/references/operating-rules.md +214 -0
  278. package/skills/gsd-path-loop/scripts/_common.py +619 -18
  279. package/skills/gsd-path-loop/scripts/discussion_records.py +19 -13
  280. package/skills/gsd-path-loop/scripts/loop_run.py +31 -29
  281. package/skills/gsd-path-loop/scripts/path_config.py +5 -5
  282. package/skills/gsd-path-loop/scripts/review_panel.py +1 -1
  283. package/skills/gsd-path-loop/scripts/worktree_paths.py +72 -10
  284. package/skills/gsd-path-migrate/SKILL.md +2 -1
  285. package/skills/gsd-path-migrate/references/operating-rules.md +214 -0
  286. package/skills/gsd-path-migrate/scripts/_common.py +619 -18
  287. package/skills/gsd-path-migrate/scripts/core_hook_gate.py +10 -1
  288. package/skills/gsd-path-migrate/scripts/core_hook_settings.py +11 -4
  289. package/skills/gsd-path-migrate/scripts/discussion_records.py +19 -13
  290. package/skills/gsd-path-migrate/scripts/loop_run.py +31 -29
  291. package/skills/gsd-path-migrate/scripts/migrate_core.py +2 -2
  292. package/skills/gsd-path-migrate/scripts/path_config.py +5 -5
  293. package/skills/gsd-path-migrate/scripts/review_panel.py +1 -1
  294. package/skills/gsd-path-plan/SKILL.md +18 -4
  295. package/skills/gsd-path-plan/references/dispatch.md +13 -0
  296. package/skills/gsd-path-plan/references/operating-rules.md +214 -0
  297. package/skills/gsd-path-plan/references/planner.md +22 -4
  298. package/skills/gsd-path-plan/references/spec-probes.md +150 -0
  299. package/skills/gsd-path-plan/scripts/_common.py +619 -18
  300. package/skills/gsd-path-plan/scripts/archive_milestone.py +160 -86
  301. package/skills/gsd-path-plan/scripts/build_recovery.py +100 -32
  302. package/skills/gsd-path-plan/scripts/check_handoffs.py +662 -50
  303. package/skills/gsd-path-plan/scripts/check_task_briefs.py +338 -30
  304. package/skills/gsd-path-plan/scripts/detect_project.py +587 -32
  305. package/skills/gsd-path-plan/scripts/discussion_records.py +19 -13
  306. package/skills/gsd-path-plan/scripts/discussion_validate.py +152 -50
  307. package/skills/gsd-path-plan/scripts/integration.py +580 -25
  308. package/skills/gsd-path-plan/scripts/isolation.py +1438 -57
  309. package/skills/gsd-path-plan/scripts/loop_run.py +31 -29
  310. package/skills/gsd-path-plan/scripts/members.py +706 -0
  311. package/skills/gsd-path-plan/scripts/path_config.py +5 -5
  312. package/skills/gsd-path-plan/scripts/pipeline_git.py +124 -34
  313. package/skills/gsd-path-plan/scripts/pipeline_state.py +287 -87
  314. package/skills/gsd-path-plan/scripts/promote_lookahead.py +1 -1
  315. package/skills/gsd-path-plan/scripts/review_panel.py +1 -1
  316. package/skills/gsd-path-plan/scripts/state_checkpoint.py +135 -44
  317. package/skills/gsd-path-plan/scripts/state_promote.py +2 -0
  318. package/skills/gsd-path-plan/scripts/workflow_run.py +107 -30
  319. package/skills/gsd-path-plan/scripts/worktree_paths.py +72 -10
  320. package/skills/gsd-path-plan/templates/patch-findings.md +3 -3
  321. package/skills/gsd-path-plan/templates/plan.md +17 -2
  322. package/skills/gsd-path-plan/templates/task.md +1 -0
  323. package/skills/gsd-path-research/SKILL.md +13 -1
  324. package/skills/gsd-path-research/references/dispatch.md +13 -0
  325. package/skills/gsd-path-research/references/operating-rules.md +214 -0
  326. package/skills/gsd-path-research/scripts/_common.py +619 -18
  327. package/skills/gsd-path-research/scripts/archive_milestone.py +160 -86
  328. package/skills/gsd-path-research/scripts/build_recovery.py +100 -32
  329. package/skills/gsd-path-research/scripts/check_handoffs.py +662 -50
  330. package/skills/gsd-path-research/scripts/check_task_briefs.py +338 -30
  331. package/skills/gsd-path-research/scripts/detect_project.py +587 -32
  332. package/skills/gsd-path-research/scripts/discussion_records.py +19 -13
  333. package/skills/gsd-path-research/scripts/discussion_validate.py +152 -50
  334. package/skills/gsd-path-research/scripts/integration.py +580 -25
  335. package/skills/gsd-path-research/scripts/isolation.py +1438 -57
  336. package/skills/gsd-path-research/scripts/loop_run.py +31 -29
  337. package/skills/gsd-path-research/scripts/members.py +706 -0
  338. package/skills/gsd-path-research/scripts/path_config.py +5 -5
  339. package/skills/gsd-path-research/scripts/pipeline_git.py +124 -34
  340. package/skills/gsd-path-research/scripts/pipeline_state.py +287 -87
  341. package/skills/gsd-path-research/scripts/promote_lookahead.py +1 -1
  342. package/skills/gsd-path-research/scripts/review_panel.py +1 -1
  343. package/skills/gsd-path-research/scripts/state_checkpoint.py +135 -44
  344. package/skills/gsd-path-research/scripts/state_promote.py +2 -0
  345. package/skills/gsd-path-research/scripts/worktree_paths.py +72 -10
  346. package/skills/gsd-path-research/templates/research-handoff.md +14 -3
  347. package/skills/gsd-path-roadmap/SKILL.md +2 -1
  348. package/skills/gsd-path-roadmap/references/dispatch.md +13 -0
  349. package/skills/gsd-path-roadmap/references/operating-rules.md +214 -0
  350. package/skills/gsd-path-roadmap/scripts/_common.py +619 -18
  351. package/skills/gsd-path-roadmap/scripts/archive_milestone.py +160 -86
  352. package/skills/gsd-path-roadmap/scripts/build_recovery.py +100 -32
  353. package/skills/gsd-path-roadmap/scripts/check_handoffs.py +662 -50
  354. package/skills/gsd-path-roadmap/scripts/check_task_briefs.py +338 -30
  355. package/skills/gsd-path-roadmap/scripts/detect_project.py +587 -32
  356. package/skills/gsd-path-roadmap/scripts/discussion_records.py +19 -13
  357. package/skills/gsd-path-roadmap/scripts/discussion_validate.py +152 -50
  358. package/skills/gsd-path-roadmap/scripts/integration.py +580 -25
  359. package/skills/gsd-path-roadmap/scripts/isolation.py +1438 -57
  360. package/skills/gsd-path-roadmap/scripts/loop_run.py +31 -29
  361. package/skills/gsd-path-roadmap/scripts/members.py +706 -0
  362. package/skills/gsd-path-roadmap/scripts/path_config.py +5 -5
  363. package/skills/gsd-path-roadmap/scripts/pipeline_git.py +124 -34
  364. package/skills/gsd-path-roadmap/scripts/pipeline_state.py +287 -87
  365. package/skills/gsd-path-roadmap/scripts/promote_lookahead.py +1 -1
  366. package/skills/gsd-path-roadmap/scripts/review_panel.py +1 -1
  367. package/skills/gsd-path-roadmap/scripts/state_checkpoint.py +135 -44
  368. package/skills/gsd-path-roadmap/scripts/state_promote.py +2 -0
  369. package/skills/gsd-path-roadmap/scripts/worktree_paths.py +72 -10
  370. package/skills/gsd-path-ship/SKILL.md +33 -11
  371. package/skills/gsd-path-ship/references/dispatch.md +13 -0
  372. package/skills/gsd-path-ship/references/operating-rules.md +214 -0
  373. package/skills/gsd-path-ship/references/reviewer-final.md +20 -2
  374. package/skills/gsd-path-ship/references/reviewer-wave.md +18 -5
  375. package/skills/gsd-path-ship/references/reviewer.md +3 -1
  376. package/skills/gsd-path-ship/references/spec-probes.md +150 -0
  377. package/skills/gsd-path-ship/scripts/_common.py +619 -18
  378. package/skills/gsd-path-ship/scripts/archive_milestone.py +160 -86
  379. package/skills/gsd-path-ship/scripts/build_recovery.py +100 -32
  380. package/skills/gsd-path-ship/scripts/build_state.py +143 -24
  381. package/skills/gsd-path-ship/scripts/check_handoffs.py +662 -50
  382. package/skills/gsd-path-ship/scripts/check_task_briefs.py +338 -30
  383. package/skills/gsd-path-ship/scripts/detect_project.py +587 -32
  384. package/skills/gsd-path-ship/scripts/discussion_records.py +19 -13
  385. package/skills/gsd-path-ship/scripts/discussion_validate.py +152 -50
  386. package/skills/gsd-path-ship/scripts/integration.py +580 -25
  387. package/skills/gsd-path-ship/scripts/isolation.py +1438 -57
  388. package/skills/gsd-path-ship/scripts/lean_verification.py +99 -19
  389. package/skills/gsd-path-ship/scripts/loop_run.py +31 -29
  390. package/skills/gsd-path-ship/scripts/members.py +706 -0
  391. package/skills/gsd-path-ship/scripts/path_config.py +5 -5
  392. package/skills/gsd-path-ship/scripts/pipeline_git.py +124 -34
  393. package/skills/gsd-path-ship/scripts/pipeline_state.py +287 -87
  394. package/skills/gsd-path-ship/scripts/promote_lookahead.py +1 -1
  395. package/skills/gsd-path-ship/scripts/review_panel.py +1 -1
  396. package/skills/gsd-path-ship/scripts/state_checkpoint.py +135 -44
  397. package/skills/gsd-path-ship/scripts/state_promote.py +2 -0
  398. package/skills/gsd-path-ship/scripts/workflow_run.py +107 -30
  399. package/skills/gsd-path-ship/scripts/worktree_paths.py +72 -10
  400. package/skills/gsd-path-ship/templates/final-review.md +16 -4
  401. package/skills/gsd-path-ship/templates/gap-review.md +2 -1
  402. package/skills/gsd-path-ship/templates/patch-findings.md +3 -3
  403. package/skills/gsd-path-ship/templates/wave-review.md +16 -4
  404. package/skills/gsd-path-undo/SKILL.md +2 -1
  405. package/skills/gsd-path-undo/references/operating-rules.md +214 -0
  406. package/skills/gsd-path-undo/scripts/_common.py +619 -18
  407. package/skills/gsd-path-undo/scripts/discussion_records.py +19 -13
  408. package/skills/gsd-path-undo/scripts/loop_run.py +31 -29
  409. package/skills/gsd-path-undo/scripts/path_config.py +5 -5
  410. package/skills/gsd-path-undo/scripts/pipeline_undo.py +218 -30
  411. package/skills/gsd-path-undo/scripts/review_panel.py +1 -1
  412. package/skills/gsd-path-undo/scripts/worktree_paths.py +72 -10
  413. package/skills/path/BUILD.md +7 -1
  414. package/skills/path/DECIDE.md +11 -4
  415. package/skills/path/DEFINE.md +36 -4
  416. package/skills/path/DOCS-AUDIT.md +6 -4
  417. package/skills/path/INSPECT.md +5 -4
  418. package/skills/path/PLAN.md +18 -4
  419. package/skills/path/RESEARCH.md +13 -1
  420. package/skills/path/ROADMAP.md +2 -1
  421. package/skills/path/SHIP.md +33 -11
  422. package/skills/path/SKILL.md +45 -1
  423. package/skills/path/references/build-native.md +63 -15
  424. package/skills/path/references/codebase-mapper.md +2 -1
  425. package/skills/path/references/dispatch.md +13 -0
  426. package/skills/path/references/docs-auditor.md +7 -1
  427. package/skills/path/references/operating-rules.md +214 -0
  428. package/skills/path/references/planner.md +22 -4
  429. package/skills/path/references/reviewer-final.md +20 -2
  430. package/skills/path/references/reviewer-wave.md +18 -5
  431. package/skills/path/references/reviewer.md +3 -1
  432. package/skills/path/references/spec-probes.md +150 -0
  433. package/skills/path/scripts/_common.py +619 -18
  434. package/skills/path/scripts/archive_milestone.py +160 -86
  435. package/skills/path/scripts/bootstrap_repository.py +8 -5
  436. package/skills/path/scripts/build_recovery.py +100 -32
  437. package/skills/path/scripts/build_state.py +143 -24
  438. package/skills/path/scripts/check_docs_audit.py +91 -7
  439. package/skills/path/scripts/check_handoffs.py +662 -50
  440. package/skills/path/scripts/check_task_briefs.py +338 -30
  441. package/skills/path/scripts/check_update.py +2 -2
  442. package/skills/path/scripts/detect_project.py +587 -32
  443. package/skills/path/scripts/discussion_records.py +19 -13
  444. package/skills/path/scripts/discussion_validate.py +152 -50
  445. package/skills/path/scripts/dispatch_driver.py +501 -46
  446. package/skills/path/scripts/git_guard.py +118 -31
  447. package/skills/path/scripts/integration.py +580 -25
  448. package/skills/path/scripts/isolation.py +1438 -57
  449. package/skills/path/scripts/lean_verification.py +99 -19
  450. package/skills/path/scripts/loop_run.py +31 -29
  451. package/skills/path/scripts/members.py +706 -0
  452. package/skills/path/scripts/path_config.py +5 -5
  453. package/skills/path/scripts/pipeline_git.py +124 -34
  454. package/skills/path/scripts/pipeline_state.py +287 -87
  455. package/skills/path/scripts/promote_lookahead.py +1 -1
  456. package/skills/path/scripts/review_panel.py +1 -1
  457. package/skills/path/scripts/state_checkpoint.py +135 -44
  458. package/skills/path/scripts/state_promote.py +2 -0
  459. package/skills/path/scripts/status_runtime.py +58 -10
  460. package/skills/path/scripts/task_context.py +12 -3
  461. package/skills/path/scripts/token_budget.py +12 -8
  462. package/skills/path/scripts/workflow_run.py +107 -30
  463. package/skills/path/scripts/worktree_paths.py +72 -10
  464. package/skills/path/templates/codebase.md +1 -1
  465. package/skills/path/templates/docs-audit.md +6 -2
  466. package/skills/path/templates/final-review.md +16 -4
  467. package/skills/path/templates/gap-review.md +2 -1
  468. package/skills/path/templates/intent.md +30 -0
  469. package/skills/path/templates/patch-findings.md +3 -3
  470. package/skills/path/templates/plan.md +17 -2
  471. package/skills/path/templates/research-handoff.md +14 -3
  472. package/skills/path/templates/state.md +1 -1
  473. package/skills/path/templates/task.md +1 -0
  474. package/skills/path/templates/wave-review.md +16 -4
  475. package/skills/gsd-path/scripts/__pycache__/_common.cpython-312.pyc +0 -0
  476. package/skills/gsd-path/scripts/__pycache__/check_handoffs.cpython-312.pyc +0 -0
  477. package/skills/gsd-path-build/scripts/__pycache__/_common.cpython-312.pyc +0 -0
  478. package/skills/gsd-path-build/scripts/__pycache__/check_handoffs.cpython-312.pyc +0 -0
  479. package/skills/gsd-path-inspect/scripts/__pycache__/_common.cpython-312.pyc +0 -0
  480. package/skills/gsd-path-plan/scripts/__pycache__/_common.cpython-312.pyc +0 -0
  481. package/skills/gsd-path-ship/scripts/__pycache__/_common.cpython-312.pyc +0 -0
@@ -16,14 +16,20 @@ from pathlib import Path
16
16
  from typing import Iterator, Optional, Sequence
17
17
 
18
18
  def _load_pipeline_modules():
19
- try:
20
- import archive_milestone
21
- import pipeline_state
22
- import _common
19
+ if __package__:
20
+ from . import archive_milestone
21
+ from . import pipeline_state
22
+ from . import _common
23
23
  return _common, archive_milestone, pipeline_state
24
- except ModuleNotFoundError as error:
25
- if error.name not in {"archive_milestone", "pipeline_state", "_common"}:
26
- raise
24
+ else:
25
+ try:
26
+ import archive_milestone
27
+ import pipeline_state
28
+ import _common
29
+ return _common, archive_milestone, pipeline_state
30
+ except ModuleNotFoundError as error:
31
+ if error.name not in {"archive_milestone", "pipeline_state", "_common"}:
32
+ raise
27
33
  try:
28
34
  from scripts import archive_milestone, pipeline_state, _common
29
35
  return _common, archive_milestone, pipeline_state
@@ -111,7 +117,7 @@ def record_count(directory: Path) -> int:
111
117
  def validate_or_empty(directory: Path) -> None:
112
118
  if directory.is_symlink() or not directory.is_dir():
113
119
  raise DiscussionError("discussion records must be a real directory")
114
- if sorted(path.name for path in directory.iterdir()) != sorted(FILES):
120
+ if sorted(path.name for path in directory.iterdir() if not _common.is_ignored_junk(path)) != sorted(FILES):
115
121
  raise DiscussionError("discussion directory must contain exactly DIALOGUE.md and ANSWERS.md")
116
122
  if record_count(directory) == 0:
117
123
  if "### D" in (directory / "DIALOGUE.md").read_text(encoding="utf-8"):
@@ -170,7 +176,7 @@ def validate_contents(project: Path, files: dict) -> None:
170
176
  staging.mkdir()
171
177
  try:
172
178
  for name in FILES:
173
- (staging / name).write_text(files[name], encoding="utf-8")
179
+ (staging / name).write_bytes(files[name].encode("utf-8"))
174
180
  validate_or_empty(staging)
175
181
  finally:
176
182
  shutil.rmtree(staging)
@@ -187,11 +193,11 @@ def initialize_records(discussion: Path, dialogue_template: Path, answers_templa
187
193
  shutil.rmtree(staging)
188
194
  staging.mkdir()
189
195
  try:
190
- (staging / "DIALOGUE.md").write_text(
191
- template_header(dialogue_template, "### D001"), encoding="utf-8"
196
+ (staging / "DIALOGUE.md").write_bytes(
197
+ template_header(dialogue_template, "### D001").encode("utf-8")
192
198
  )
193
- (staging / "ANSWERS.md").write_text(
194
- template_header(answers_template, "## Answer A001"), encoding="utf-8"
199
+ (staging / "ANSWERS.md").write_bytes(
200
+ template_header(answers_template, "## Answer A001").encode("utf-8")
195
201
  )
196
202
  os.replace(staging, discussion)
197
203
  finally:
@@ -32,10 +32,10 @@ from datetime import datetime, timedelta, timezone
32
32
  from pathlib import Path
33
33
  from typing import Iterator, Optional, Sequence
34
34
 
35
- if sys.platform == "win32":
36
- import msvcrt
37
- else:
38
- import fcntl
35
+ try:
36
+ from . import _common
37
+ except ImportError:
38
+ import _common
39
39
 
40
40
 
41
41
  class LoopError(RuntimeError):
@@ -119,25 +119,8 @@ def log_path(fields: dict) -> Path:
119
119
  def log_lock(fields: dict) -> Iterator[None]:
120
120
  path = log_path(fields)
121
121
  path.parent.mkdir(parents=True, exist_ok=True)
122
- lock_path = path.with_name(f".{path.name}.lock")
123
- with lock_path.open("a+b") as handle:
124
- if sys.platform == "win32":
125
- handle.seek(0, os.SEEK_END)
126
- if handle.tell() == 0:
127
- handle.write(b"\0")
128
- handle.flush()
129
- handle.seek(0)
130
- msvcrt.locking(handle.fileno(), msvcrt.LK_LOCK, 1)
131
- else:
132
- fcntl.flock(handle.fileno(), fcntl.LOCK_EX)
133
- try:
134
- yield
135
- finally:
136
- if sys.platform == "win32":
137
- handle.seek(0)
138
- msvcrt.locking(handle.fileno(), msvcrt.LK_UNLCK, 1)
139
- else:
140
- fcntl.flock(handle.fileno(), fcntl.LOCK_UN)
122
+ with _common.exclusive_lock(path.with_name(f".{path.name}.lock")):
123
+ yield
141
124
 
142
125
 
143
126
  def load_log(fields: dict) -> list[dict]:
@@ -528,15 +511,34 @@ def command_claim(fields: dict) -> dict:
528
511
 
529
512
 
530
513
  def run_shell(command: str, timeout: float) -> tuple[Optional[int], str]:
531
- """Run one spec command; a hung command counts as failed (exit None)."""
514
+ """Run one spec command; a hung command counts as failed (exit None).
515
+
516
+ POSIX runs /bin/sh as shell=True did; Windows runs Git for Windows bash, not
517
+ cmd.exe. A timeout kills the whole process group when possible; if output
518
+ pipes stay open, drain them with a short grace timeout and then close them.
519
+ """
520
+ argv = _common.bash_argv(command) if os.name == "nt" else ["/bin/sh", "-c", command]
521
+ process = _common.popen_group(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
522
+ stdout = b""
523
+ stderr = b""
532
524
  try:
533
- completed = subprocess.run(
534
- command, shell=True, capture_output=True, text=True, check=False, timeout=timeout
535
- )
525
+ stdout, stderr = process.communicate(timeout=timeout)
536
526
  except subprocess.TimeoutExpired as expired:
537
- output = (expired.stdout or b"").decode(errors="replace") + (expired.stderr or b"").decode(errors="replace")
527
+ _common.kill_tree(process)
528
+ try:
529
+ stdout, stderr = process.communicate(timeout=5)
530
+ except subprocess.TimeoutExpired as drained:
531
+ stdout = drained.stdout or expired.stdout or b""
532
+ stderr = drained.stderr or expired.stderr or b""
533
+ if process.stdout:
534
+ process.stdout.close()
535
+ if process.stderr:
536
+ process.stderr.close()
537
+ process.kill()
538
+ process.wait(timeout=5)
539
+ output = stdout.decode("utf-8", errors="replace") + stderr.decode("utf-8", errors="replace")
538
540
  return None, f"{output}\ntimed out at the admitted wall-clock deadline"
539
- return completed.returncode, completed.stdout + completed.stderr
541
+ return process.returncode, (stdout + stderr).decode("utf-8", errors="replace")
540
542
 
541
543
 
542
544
  def command_verify(fields: dict, claim_identifier: Optional[str]) -> dict:
@@ -13,7 +13,7 @@ sys.dont_write_bytecode = True
13
13
  ROLES = ('coder', 'reviewer', 'review_panel', 'skeptic', 'inspect_codebase',
14
14
  'inspect_docs', 'docs_audit', 'research', 'decide', 'roadmap', 'plan', 'plan_patch')
15
15
  HOSTS = ('codex', 'claude', 'grok', 'opencode', 'copilot', 'qwen', 'antigravity',
16
- 'cursor', 'zed', 'kiro', 'kimi')
16
+ 'cursor', 'zed', 'kiro', 'kimi', 'muse')
17
17
 
18
18
 
19
19
  def sibling(name):
@@ -73,8 +73,8 @@ def validate_value(key, value):
73
73
  if not isinstance(value, str) or not value or value != value.strip():
74
74
  raise ValueError(f'{key} requires a nonempty string')
75
75
  if key == 'integration':
76
- if value not in ('direct', 'pull-request'):
77
- raise ValueError('integration must be direct or pull-request')
76
+ if value not in ('direct', 'pull-request', 'external-landing'):
77
+ raise ValueError('integration must be direct, pull-request, or external-landing')
78
78
  elif key == 'review_panel':
79
79
  if any(char.isspace() for char in value):
80
80
  raise ValueError('use off, detected, or comma-separated families without spaces')
@@ -174,13 +174,13 @@ def set_value(repo, scope, key, value, reset=False):
174
174
  if scope == 'project':
175
175
  state, _, _ = sibling('pipeline_state').load_state(repo)
176
176
  branch = subprocess.run(['git', '-C', str(repo), 'branch', '--show-current'],
177
- capture_output=True, text=True)
177
+ capture_output=True, encoding="utf-8", errors="replace")
178
178
  if branch.returncode or not state.branch or branch.stdout.strip() != state.branch:
179
179
  raise ValueError('Run the router to bind the project branch before editing settings.')
180
180
  head = subprocess.run(['git', '-C', str(repo), 'rev-parse', '--verify', 'HEAD'], capture_output=True)
181
181
  if head.returncode == 0:
182
182
  closed = subprocess.run([sys.executable, '-B', str(Path(__file__).with_name('git_guard.py')),
183
- 'closed-milestone'], cwd=repo, capture_output=True, text=True)
183
+ 'closed-milestone'], cwd=repo, capture_output=True, encoding="utf-8", errors="replace")
184
184
  if closed.returncode:
185
185
  raise ValueError(closed.stderr.strip() or 'Cannot verify the milestone branch is open.')
186
186
  if scope == 'project' and key == 'integration':
@@ -470,7 +470,7 @@ def merge_artifacts(
470
470
  lines.append(artifact["text"].rstrip())
471
471
  lines.append("")
472
472
  output.parent.mkdir(parents=True, exist_ok=True)
473
- output.write_text("\n".join(lines).rstrip() + "\n", encoding="utf-8")
473
+ output.write_bytes(("\n".join(lines).rstrip() + "\n").encode("utf-8"))
474
474
  return {
475
475
  "output": str(output.resolve()),
476
476
  "families": families,
@@ -13,10 +13,34 @@ import os
13
13
  import tempfile
14
14
  from pathlib import Path
15
15
 
16
- try:
17
- import _common
18
- except ImportError:
19
- from scripts import _common
16
+ if __package__:
17
+ from . import _common
18
+ else:
19
+ try:
20
+ import _common
21
+ except ImportError:
22
+ from scripts import _common
23
+
24
+
25
+ def _worktree_list_porcelain(primary: Path) -> tuple[str, bool]:
26
+ try:
27
+ if __package__:
28
+ from . import pipeline_git as pg
29
+ else:
30
+ from scripts import pipeline_git as pg
31
+ except ImportError:
32
+ try:
33
+ import pipeline_git as pg
34
+ except ImportError:
35
+ pg = None
36
+ if pg is not None:
37
+ return pg.worktree_list_porcelain(primary)
38
+ try:
39
+ output = _git(primary, "worktree", "list", "--porcelain", "-z")
40
+ return output, True
41
+ except ValueError:
42
+ output = _git(primary, "worktree", "list", "--porcelain")
43
+ return output, False
20
44
 
21
45
 
22
46
  def _git(primary: Path, *args: str) -> str:
@@ -27,7 +51,10 @@ def _git(primary: Path, *args: str) -> str:
27
51
 
28
52
 
29
53
  def _identity(path: Path) -> str:
30
- return hashlib.sha256(os.fsencode(path)).hexdigest()
54
+ digest = hashlib.sha256(os.fsencode(path)).hexdigest()
55
+ # Two identities nest in every managed path; full digests would use about
56
+ # 130 of Windows' 260-character MAX_PATH before any repository content.
57
+ return digest[:16] if os.name == "nt" else digest
31
58
 
32
59
 
33
60
  def _workspace(primary: Path, pin: bool) -> Path:
@@ -65,7 +92,7 @@ def _workspace(primary: Path, pin: bool) -> Path:
65
92
  receipt.parent.mkdir(parents=True, exist_ok=True)
66
93
  fd, temporary = tempfile.mkstemp(dir=receipt.parent)
67
94
  try:
68
- with os.fdopen(fd, "w", encoding="utf-8") as handle:
95
+ with os.fdopen(fd, "w", encoding="utf-8", newline="\n") as handle:
69
96
  json.dump({"primary": str(primary), "root": str(workspace)}, handle)
70
97
  try:
71
98
  os.link(temporary, receipt)
@@ -76,17 +103,52 @@ def _workspace(primary: Path, pin: bool) -> Path:
76
103
  return workspace
77
104
 
78
105
 
106
+ def release_workspace(primary: Path) -> bool:
107
+ """Forget the pinned placement receipt once no linked worktrees remain.
108
+
109
+ Lets GSD_PATH_WORKTREE_ROOT (or a new default) apply again at the next
110
+ milestone's first allocation. Returns True when a receipt was removed;
111
+ any remaining linked worktree (including one only still registered) keeps
112
+ the pin.
113
+ """
114
+ primary = primary.resolve()
115
+ common = Path(_git(primary, "rev-parse", "--git-common-dir"))
116
+ common = (primary / common).resolve()
117
+ receipt = common / "gsd-path" / "workspaces" / f"{_identity(primary)}.json"
118
+ if not receipt.is_file():
119
+ return False
120
+ output, nul_separated = _worktree_list_porcelain(primary)
121
+ records = output.split("\0\0") if nul_separated else [
122
+ block for block in output.strip().split("\n\n") if block.strip()
123
+ ]
124
+ for record in records:
125
+ fields = record.split("\0") if nul_separated else record.splitlines()
126
+ for field in fields:
127
+ if field.startswith("worktree ") and Path(field[len("worktree "):]).resolve() != primary:
128
+ return False
129
+ receipt.unlink()
130
+ return True
131
+
132
+
79
133
  def worktree_path(primary: Path, kind: str, name: str, *, pin: bool = False) -> Path:
80
134
  primary = primary.resolve()
81
- if kind not in {"task", "verify", "integrate"} or not name or Path(name).name != name or name in {".", ".."}:
135
+ if kind not in {"task", "verify", "integrate", "bound"} or not name or Path(name).name != name or name in {".", ".."}:
82
136
  raise ValueError("invalid managed worktree kind or name")
137
+ if kind == "bound":
138
+ return _workspace(primary, pin) / kind / name
83
139
  legacy = (primary.parent / f".{primary.name}-gsd-path-integrate-{name}"
84
140
  if kind == "integrate" else primary.parent / f"{primary.name}.gsd-path" / kind / name)
85
141
  branch = f"refs/heads/gsd-path-{kind}/{name}"
86
- records = _git(primary, "worktree", "list", "--porcelain", "-z").split("\0\0")
142
+ output, nul_separated = _worktree_list_porcelain(primary)
143
+ if nul_separated:
144
+ records = output.split("\0\0")
145
+ else:
146
+ records = [block for block in output.strip().split("\n\n") if block.strip()]
87
147
  for record in records:
88
- fields = record.split("\0")
89
- if f"worktree {legacy}" in fields and f"branch {branch}" in fields:
148
+ fields = record.split("\0") if nul_separated else record.splitlines()
149
+ # Compare as paths: git prints forward slashes on Windows.
150
+ worktrees = [Path(field[len("worktree "):]) for field in fields if field.startswith("worktree ")]
151
+ if legacy in worktrees and f"branch {branch}" in fields:
90
152
  return legacy
91
153
  # Keep collision checks and missing-directory recovery at the old location.
92
154
  if os.path.lexists(legacy):
@@ -3,7 +3,8 @@ name: gsd-path-docs-audit
3
3
  description: Verify Markdown claims against the actual code, commands, and GSD Path artifacts. Use only when the user explicitly invokes $gsd-path-docs-audit or an active $gsd-path router explicitly routes to this phase.
4
4
  ---
5
5
 
6
- Before executing project helpers, read [runtime selection](references/runtime-selection.md).
6
+ Before executing project helpers, read [runtime selection](references/runtime-selection.md)
7
+ and [operating rules](references/operating-rules.md).
7
8
 
8
9
  # GSD Path Docs Audit
9
10
 
@@ -59,7 +60,8 @@ would dirty execution, invalidate review, or mutate shipped history.
59
60
  non-`.project` worktree changes, the orchestrator creates a verify sidecar
60
61
  with `python3 <absolute isolation.py> isolate-verify --repo <absolute
61
62
  primary> --base <HEAD> --name docs-audit` for project commands. The auditor
62
- writes only its assigned output under that sidecar. Gate it there before
63
+ writes only its assigned output under that sidecar; its `Repo root` header
64
+ still names the absolute primary. Gate it there before
63
65
  collection. Then run `python3 <absolute isolation.py> collect-artifact
64
66
  --repo <absolute primary> --source <returned worktree> --base <recorded
65
67
  HEAD> --branch <returned branch> --source-path
@@ -74,8 +76,8 @@ would dirty execution, invalidate review, or mutate shipped history.
74
76
  it carries `none`. The auditor writes that baseline as `Audited HEAD`.
75
77
  2. Gate the artifact with the bundled helper: write the frozen inventory to
76
78
  a temporary file (one path per line) and run
77
- `python3 <absolute check_docs_audit.py> --repo <docs sidecar> --inventory
78
- <file> [--prior-audit <temporary prior-audit file>] [--changed <temporary
79
+ `python3 <absolute check_docs_audit.py> --repo <docs sidecar> --primary
80
+ <absolute primary> --inventory <file> [--prior-audit <temporary prior-audit file>] [--changed <temporary
79
81
  changed-set file>]`.
80
82
  It enforces the contract — every doc with at least one testable claim has
81
83
  a claims table, every claim a valid type and verdict with evidence, every
@@ -44,6 +44,19 @@ use exactly one matching branch:
44
44
  create another worktree. Encode task dependencies explicitly; launch
45
45
  independent children concurrently up to the host's advertised
46
46
  concurrent-subagent capacity.
47
+ - A `muse.subagent_spawn` tool (with `muse.subagent_wait`,
48
+ `muse.subagent_read_result`, and `muse.subagent_send_message` siblings) is
49
+ Muse Code. Omit `subagent_type` (general-purpose, full capability), pass the
50
+ logical task name as `task_name` and `role`, and the complete brief as
51
+ `objective`. Never set `worktree_isolation`. Keep the returned
52
+ `subagent_id`; send a correction to a still-live child with
53
+ `muse.subagent_send_message` mode `followup` and the complete new prompt,
54
+ otherwise start a fresh child. Collect with `muse.subagent_wait`
55
+ (`wait_for: task_terminal`) then `muse.subagent_read_result`; on
56
+ `root_capacity_exhausted`, wait for a child to finish and retry. Spawn has no
57
+ model or effort argument, so record no such capability. If only
58
+ `muse.workflow` is exposed (untrusted workspace), do not script or inline
59
+ the work; stop and report that the workspace must be trusted.
47
60
 
48
61
  For every branch:
49
62
 
@@ -11,7 +11,8 @@ actually does. Read-only: change nothing outside your single output file.
11
11
  - Read AGENTS.md and the template before auditing. Stop on a missing path.
12
12
  - Write only the assigned output using the template. When the brief supplies a
13
13
  disposable root, write the output under that root at the relative handoff
14
- path; the orchestrator transfers it after validation. Do not ask the user
14
+ path; the orchestrator transfers it after validation. `Repo root` still names
15
+ the primary repo root, never the disposable root. Do not ask the user
15
16
  questions.
16
17
 
17
18
  ## Method
@@ -58,6 +59,11 @@ actually does. Read-only: change nothing outside your single output file.
58
59
  5. **Classify remediation** for every non-verified claim: `fix-doc`,
59
60
  `fix-code`, or `NEEDS-USER` when the right side of the conflict is not
60
61
  yours to decide.
62
+ Number queue rows with unique, strictly increasing positive integers; they
63
+ need not be contiguous. A row that persists from the prior audit keeps its
64
+ number. A new row takes a number greater than every prior queue number and
65
+ every `## User rulings` Queue #. Never reuse a retired number: a ruling
66
+ stays bound to the item it was made for.
61
67
 
62
68
  ## Rules
63
69
 
@@ -0,0 +1,214 @@
1
+ # Operating rules for phase work
2
+
3
+ These rules extend the project `AGENTS.md` block. Every GSD Path skill
4
+ bundles this file; spawned agents follow their role brief instead.
5
+
6
+ ## Files and state
7
+
8
+ - `.project/discuss/DIALOGUE.md` and `.project/discuss/ANSWERS.md` are the
9
+ append-only memory for any-phase discussion. Read them before continuing an
10
+ existing thread; never treat chat history alone as durable context.
11
+ - The discussion skill never commits. Every phase orchestrator treats only
12
+ complete append-only discussion records as expected bookkeeping and includes
13
+ them in its next normal `.project/` checkpoint; build does so before its next
14
+ clean layer base, and ship includes them in its transaction.
15
+ - Write every output to the handoff path in WORKFLOW.md, using the absolute
16
+ bundled template path supplied by the active phase skill. An output that
17
+ needs verbal explanation is defective.
18
+ - With no `.project/STATE.md`, route through the bundled
19
+ `scripts/detect_project.py initialize --repo <absolute-root> --template
20
+ <absolute-state-template> --require-git` helper; `route: setup-repository`
21
+ leaves the invocation folder unchanged and routes to repository setup before
22
+ state creation or branch binding. Never delete the invocation folder or its
23
+ state to satisfy bootstrap path checks. Do not classify from a directory listing
24
+ or conversation. Follow its JSON `verdict` and `route`. Reserve `classify`
25
+ for read-only inspection; do not use it as a state-initialization preflight.
26
+ - `.project/STATE.md` tracks phase position. Parse and validate it only with
27
+ the bundled `scripts/pipeline_state.py validate` command, route with its
28
+ `route` command, and make ordinary phase transitions only with its
29
+ expected-state `transition`. A journaled transaction helper may write only
30
+ the state fields its contract explicitly owns. Never reproduce these
31
+ deterministic operations in model reasoning. The
32
+ orchestrator alone owns task frontmatter base, isolated worktree/branch,
33
+ status, and agent; the landing commit is proven from git by `isolation.py
34
+ recover`, never recorded. Require `pipeline: gsd-path/v2`; never
35
+ consume an ambiguous or differently owned state file. Artifacts outrank
36
+ summaries; reconcile STATE.md when it disagrees with task frontmatter.
37
+ During a program build, `.project/next/STATE.md` may hold
38
+ the lookahead planning track for the next milestone; it follows the same
39
+ marker rule, owns no task frontmatter, and never binds a branch.
40
+ - STATE.integration_default is the project closeout choice and
41
+ STATE.integration is the current milestone choice. Both are `direct` or
42
+ `pull-request`; STATE.integration_source is `default` or `milestone` and
43
+ preserves explicit override provenance. Older v2 state defaults to `direct`,
44
+ and modes may be changed only through `pipeline_state.py
45
+ configure-integration` before build. A next milestone resets its current
46
+ choice from the project default.
47
+ - Spawned agents have isolated context. Follow the installed runtime dispatch
48
+ contract and brief them with exact input and output paths, constraints, a
49
+ deterministic logical task name, and a bounded responsibility. Independent
50
+ briefs may run in parallel up to available child capacity; a dependent
51
+ brief runs as soon as its dependencies complete.
52
+
53
+ ## Stay in role
54
+
55
+ - The codebase mapper and docs auditor observe and verify; they are strictly
56
+ read-only, report observations rather than judgments, and never resolve a
57
+ doc-vs-code conflict — that ruling belongs to the user.
58
+ - Build, test, lint, and help commands are not presumed read-safe. Read-only
59
+ roles run project commands only in orchestrator-created disposable worktrees
60
+ at a recorded revision; otherwise they use static evidence or mark the check
61
+ unverifiable. They never create worktrees or run commands in the source tree.
62
+ - Researchers gather evidence; they do not decide. A dimension is researched
63
+ only when it has open questions; the research phase records dispatched and
64
+ skipped dimensions. Brownfield adds `evidence-codebase.md` as settled input.
65
+ - The decider works from existing evidence; it does not re-research. An
66
+ unresolved or uncited required decision fails the synthesis gate.
67
+ - The planner reads both INTENT.md and SYNTHESIS.md and specs
68
+ deliverable-sized outcomes and constraints; every INTENT success criterion
69
+ maps to a task AC and Verify in PLAN.md Intent coverage. Coders own
70
+ implementation decisions inside those bounds.
71
+ - Coders implement only their full task contract, including owned INTENT
72
+ success criteria read from INTENT.md, and append their result to the
73
+ task Log. They never change task state, review acceptance, stage, commit, or
74
+ freelance outside declared files.
75
+ - The orchestrator dispatches, arbitrates, and creates task isolation and
76
+ verify sidecars through the bundled `scripts/isolation.py` helper — named
77
+ branches only, never a detached HEAD — lands task work serially, and
78
+ records each clean base in task frontmatter; `land` stamps the landed
79
+ state into the task's own commit, so a task has exactly one commit. It
80
+ writes no product code. When a done task's work already sits on the bound
81
+ branch without a landing commit, only an explicit owner ruling through
82
+ `isolation.py attest` may stand in for it: one `.project/`-only commit that
83
+ names the base, the attested HEAD, the declared files that changed, the
84
+ task Verify recorded as passing at that HEAD, and the ruling verbatim.
85
+ `recover` reports it as `attested`, never as a proven landing.
86
+ - All pipeline work for a milestone lives on `gsd-path/M00N` (M001, M002,
87
+ …) bound in STATE.branch. The next milestone binds a new unused
88
+ `gsd-path/M00N` at the remote default after the previous ship integrates.
89
+ Integration at ship is the only path from the bound branch to the default
90
+ branch — either Path's direct merge or a Path-owned PR merged by the user.
91
+ The bound branch never receives merges or back-merges and is never the
92
+ GitHub default.
93
+ - After initialization writes STATE.md, and before entering the first pipeline
94
+ phase in an existing Git repository, the router calls
95
+ `scripts/pipeline_git.py bind-initial` with the selected M00N and exact
96
+ fetched `origin/main` SHA. The helper alone checks worktree identity and
97
+ cleanliness, exact base, and every local, remote, and other-worktree
98
+ collision before creating or adopting the branch. The sole cleanliness
99
+ exception is untracked `.project/STATE.md`: validated v2 state in active
100
+ inspect or define, with null milestone, branch, and archive, in a real
101
+ directory containing only that regular file with no hard links. The helper
102
+ checks its identity and bytes across binding. Do not commit initialization
103
+ before binding. The router persists its
104
+ typed result in the new state. Build has no branch-creation authority.
105
+ - After `validate-integrated` passes and before any next-milestone file
106
+ changes, the router calls the bundled `scripts/pipeline_git.py bind-next`
107
+ helper with the previous bound branch, exact ship SHA, and exact current
108
+ `origin/main` SHA. The helper moves the clean primary worktree to the new
109
+ unused `gsd-path/M00N` branch at that SHA without moving the previous
110
+ branch or entering the default checkout, then retires the integrated
111
+ previous branch — deleted locally and on origin; the ship commit stays
112
+ reachable from the integration merge and its annotated tag. The router
113
+ persists the new branch in STATE; a wrong-SHA or colliding branch blocks.
114
+ After validated PR integration, `bind-next --allow-missing-previous` may
115
+ retire only the local previous branch when GitHub already auto-deleted its
116
+ remote branch.
117
+ `bind-initial`, this handoff, and the approved new-repository bootstrap are
118
+ the only bound-branch creation authorities, and the handoff's retirement
119
+ push is the router's only bound-branch deletion authority. When a lookahead
120
+ track exists, the router then calls `scripts/pipeline_state.py promote-next`;
121
+ only that journaled helper moves the track, updates state and roadmap,
122
+ classifies plan drift, and writes the router promotion commit.
123
+ - Build adopts the branch recorded in STATE.branch, never whatever is current
124
+ when a recorded branch exists. A new-GitHub REPOSITORY.md proves the
125
+ default checkout and first bound branch; later milestones may rebind
126
+ `gsd-path/M00N` without rewriting that artifact. Build ignores older
127
+ milestone ship and integrate commits inherited through main. A ship commit
128
+ for the current STATE.branch milestone must be an ancestor of origin/main;
129
+ if it is not, that milestone's integration is incomplete and control routes
130
+ to ship, not build. Direct mode requires the matching canonical `integrate:`
131
+ commit; PR mode requires tag metadata and a two-parent merge whose second
132
+ parent is the ship commit. A null branch returns
133
+ to the router; build never creates, selects, switches, or rebinds it.
134
+ - The ship phase makes exactly one commit on the bound branch — the
135
+ `.project/`-only ship commit recording
136
+ STATE.md, the final-review artifacts, and the archive — and additionally
137
+ owns the integration leg. Direct mode creates and pushes one `--no-ff` merge
138
+ onto `main` with subject
139
+ `integrate: M00N — merge gsd-path/M00N into main`. Pull-request mode creates
140
+ or reuses one GitHub.com PR and waits for the user to merge it with a merge
141
+ commit; it never auto-merges. Both modes create one annotated
142
+ `milestone/<NNN>-<slug>` tag after merge validation.
143
+ The roadmap and
144
+ plan phases each make exactly one approval checkpoint commit
145
+ (`.project/`-only, deferred to the build transition commit during a
146
+ new-repository transaction or before Git exists). Their bundled
147
+ `pipeline_state.py approve` command journals before changing STATE or
148
+ ROADMAP.md and owns that canonical checkpoint; a routed
149
+ `resume-checkpoint` must finish before phase work. The router makes one
150
+ bookkeeping commit through `pipeline_state.py promote-next` when promoting a
151
+ lookahead track at a milestone boundary. Every other commit belongs to the
152
+ orchestrator.
153
+ - Reviewers verify and block; they never fix. A block names the criterion,
154
+ observed result, evidence location, and concrete fix direction. An optional
155
+ review panel is advisory: the canonical reviewer remains the only wave
156
+ pass/fail, and panel findings never average or auto-replan. Same-model
157
+ agreement is not independent verification: matching verdicts from one
158
+ model family count as a single evidence path. Independence comes from
159
+ re-run commands, reconstructed patches, different sources, or a
160
+ different model family. Resolve panel
161
+ membership with the bundled `scripts/review_panel.py` helper; do not invent
162
+ model families or slugs. Create task isolation and verify sidecars with the
163
+ bundled `scripts/isolation.py` helper; do not invent `git worktree add` or
164
+ `--detach`. Undo unpublished pipeline work with `scripts/pipeline_undo.py`;
165
+ do not invent `git reset`. Diagnose a stuck pipeline with
166
+ `scripts/pipeline_diagnose.py`.
167
+ - A bundled helper that exits non-zero stops the current step. Print its
168
+ stderr verbatim, run `scripts/pipeline_diagnose.py diagnose --repo
169
+ <absolute-root>` (bundled with `$gsd-path-forensics`), and report both.
170
+ Do not rerun the same command unchanged unless the helper's own contract
171
+ names that exact rerun as its interruption recovery. Never repair state or
172
+ Git by hand instead.
173
+ - The discussion sidecar may run during any non-shipped phase. It grounds
174
+ answers in code and phase artifacts, may perform focused research when
175
+ needed, and writes only its discussion artifacts; it never changes phase
176
+ state or bypasses a phase gate.
177
+ - During an uncommitted archive transaction, discussion writes a complete
178
+ active copy that extends the archived pair. The ship phase reruns `prepare`;
179
+ the helper validates the prefix and atomically reconciles both files.
180
+ Discussion never edits an archive directly or writes after shipment.
181
+ - The loop runner wraps explicit skills in a bounded check → verify → fix →
182
+ verify pass driven by a LOOP.md spec. It never advances a phase gate
183
+ itself and never commits or pushes.
184
+ - Fix tasks use the complete task template, not an abbreviated finding.
185
+
186
+ ## New GitHub repositories
187
+
188
+ - Create a GitHub repository only from an explicit user request followed by an
189
+ approval of the exact owner/name, visibility, default-checkout path,
190
+ `gsd-path/M001` branch, and linked primary-worktree path. Before the
191
+ external action produces an artifact, present those proposed targets as the
192
+ inline **Review** surface using the active router's preview contract.
193
+ Do not write a
194
+ preview file into the invocation directory or another repository. Run the
195
+ bundled bootstrap helper's read-only `preview` command for this evidence.
196
+ - After approval, the bootstrap helper persists the exact targets under the
197
+ approved workspace before the first external mutation. Its `create` command
198
+ creates or verifies the remote, checkout, branch, and linked worktree one
199
+ stage at a time. A matching journal permits explicit resume and adoption; a
200
+ collision without that journal blocks. The helper removes the journal only
201
+ after writing owned STATE.md and fixed-format `.project/REPOSITORY.md` in the
202
+ linked worktree.
203
+ - During an approved new-repository transaction, the router may create the
204
+ first GSD Path branch and linked primary worktree at the verified
205
+ remote-default SHA and persist that branch in STATE.md and REPOSITORY.md.
206
+ Build must verify and adopt that exact binding from REPOSITORY.md, never a
207
+ free-form log. Task branches and task worktrees remain exclusively
208
+ build-orchestrator owned.
209
+ - Keep the cloned default checkout clean on the remote default branch. Run the
210
+ pipeline from the linked GSD Path worktree; never initialize `.project/` in
211
+ the default checkout, reuse an existing branch or path (except an explicitly
212
+ approved empty linked-worktree folder via `--reuse-empty-worktree`), move an existing
213
+ repository, or recover a partial GitHub creation without the exact approved
214
+ journal and re-verification.