phase-loop-runtime 0.2.0__py3-none-any.whl

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 (370) hide show
  1. phase_loop_runtime/__init__.py +20 -0
  2. phase_loop_runtime/_contract_docs/phase-loop/extraction-readiness.md +90 -0
  3. phase_loop_runtime/_contract_docs/phase-loop/granular-execution-policy.md +137 -0
  4. phase_loop_runtime/_contract_docs/phase-loop/harness-capability-matrix.md +510 -0
  5. phase_loop_runtime/_contract_docs/phase-loop/harness-skill-matrix.md +125 -0
  6. phase_loop_runtime/_contract_docs/phase-loop/harness-substrate-manifest.md +232 -0
  7. phase_loop_runtime/_contract_docs/phase-loop/pi-loop-control.md +247 -0
  8. phase_loop_runtime/_contract_docs/phase-loop/protocol.md +2759 -0
  9. phase_loop_runtime/_contract_docs/phase-loop/runtime-boundary.md +289 -0
  10. phase_loop_runtime/_contract_docs/phase-loop/spec-discovery-roots.md +47 -0
  11. phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-governed-pipeline.md +42 -0
  12. phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-portal-projection.md +34 -0
  13. phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-regenesis.md +29 -0
  14. phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-report.md +32 -0
  15. phase_loop_runtime/_contract_docs/runtime/verification-evidence-contract.md +52 -0
  16. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-mixed-signals/commands.txt +2 -0
  17. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-mixed-signals/manifest.json +16 -0
  18. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-mixed-signals/mixed.json +5 -0
  19. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-provider-timeout/manifest.json +16 -0
  20. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-provider-timeout/timeout-note.txt +2 -0
  21. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-redacted-summary/manifest.json +16 -0
  22. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-redacted-summary/redacted-summary.json +6 -0
  23. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-small-sample/manifest.json +16 -0
  24. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-small-sample/sample.json +7 -0
  25. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-threshold-edge/edge.txt +2 -0
  26. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-threshold-edge/manifest.json +16 -0
  27. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/manifest.json +16 -0
  28. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/shot-a.txt +1 -0
  29. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/shot-b.txt +1 -0
  30. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/shot-c.txt +1 -0
  31. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-missing-references/claimed-results.json +5 -0
  32. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-missing-references/manifest.json +16 -0
  33. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-subtle-low-variance/manifest.json +16 -0
  34. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-subtle-low-variance/metrics.json +9 -0
  35. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-templated-prose/findings.md +10 -0
  36. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-templated-prose/manifest.json +16 -0
  37. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-uniform-scores/manifest.json +16 -0
  38. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-uniform-scores/scores.json +4 -0
  39. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-uniform-scores/summary.txt +1 -0
  40. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-adoption-bundle/bundle-check.json +8 -0
  41. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-adoption-bundle/manifest.json +16 -0
  42. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-adoption-bundle/operator-note.txt +2 -0
  43. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-handoff-ledger/events-sample.jsonl +3 -0
  44. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-handoff-ledger/manifest.json +16 -0
  45. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-handoff-ledger/receipt.txt +1 -0
  46. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-runner-diff/evidence.json +13 -0
  47. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-runner-diff/manifest.json +16 -0
  48. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-runner-diff/summary.txt +2 -0
  49. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-test-matrix/manifest.json +16 -0
  50. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-test-matrix/matrix.json +9 -0
  51. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-test-matrix/notes.md +4 -0
  52. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-ui-screenshot-standin/console-summary.txt +2 -0
  53. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-ui-screenshot-standin/manifest.json +16 -0
  54. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-ui-screenshot-standin/screenshot-standin.ppm +5 -0
  55. phase_loop_runtime/adoption_bundle.py +273 -0
  56. phase_loop_runtime/advisor_board/CONTRACTS.md +257 -0
  57. phase_loop_runtime/advisor_board/__init__.py +288 -0
  58. phase_loop_runtime/advisor_board/backing.py +137 -0
  59. phase_loop_runtime/advisor_board/backing_omnigent.py +498 -0
  60. phase_loop_runtime/advisor_board/config.py +225 -0
  61. phase_loop_runtime/advisor_board/events.py +115 -0
  62. phase_loop_runtime/advisor_board/fixtures/advisor-boards.example.toml +59 -0
  63. phase_loop_runtime/advisor_board/fixtures.py +91 -0
  64. phase_loop_runtime/advisor_board/harness_mapping.py +125 -0
  65. phase_loop_runtime/advisor_board/matrix.py +146 -0
  66. phase_loop_runtime/advisor_board/observability.py +481 -0
  67. phase_loop_runtime/advisor_board/presets.py +188 -0
  68. phase_loop_runtime/advisor_board/registries.py +309 -0
  69. phase_loop_runtime/advisor_board/resolver.py +253 -0
  70. phase_loop_runtime/advisor_board/schema.py +269 -0
  71. phase_loop_runtime/advisor_board/standin.py +166 -0
  72. phase_loop_runtime/advisor_board/validation.py +159 -0
  73. phase_loop_runtime/agent_runtime_provider.py +676 -0
  74. phase_loop_runtime/baml_modular.py +656 -0
  75. phase_loop_runtime/baml_src/dotfiles_adoption_manifest.baml +37 -0
  76. phase_loop_runtime/baml_src/dotfiles_c4_document.baml +14 -0
  77. phase_loop_runtime/baml_src/dotfiles_plan_manifest.baml +50 -0
  78. phase_loop_runtime/baml_src/dotfiles_runtime_projection.baml +16 -0
  79. phase_loop_runtime/baml_src/dotfiles_task_catalog.baml +20 -0
  80. phase_loop_runtime/baml_src/emit_phase_closeout.baml +86 -0
  81. phase_loop_runtime/baml_src/evaluate_suspected_fake_evidence.baml +36 -0
  82. phase_loop_runtime/baml_src/verification_evidence.baml +40 -0
  83. phase_loop_runtime/broker.py +181 -0
  84. phase_loop_runtime/build_bundle.py +294 -0
  85. phase_loop_runtime/capability_registry.py +835 -0
  86. phase_loop_runtime/classifier.py +87 -0
  87. phase_loop_runtime/claude_agent_view.py +625 -0
  88. phase_loop_runtime/claude_channel_sidecar.py +1086 -0
  89. phase_loop_runtime/cli.py +2599 -0
  90. phase_loop_runtime/closeout.py +865 -0
  91. phase_loop_runtime/closeout_classifier.py +120 -0
  92. phase_loop_runtime/closeout_evidence_audit.py +112 -0
  93. phase_loop_runtime/closeout_validation.py +144 -0
  94. phase_loop_runtime/closeout_validators.py +203 -0
  95. phase_loop_runtime/consiliency_gates.py +374 -0
  96. phase_loop_runtime/consiliency_ingest.py +399 -0
  97. phase_loop_runtime/consiliency_layout.py +176 -0
  98. phase_loop_runtime/consiliency_scaffold.py +305 -0
  99. phase_loop_runtime/cross_repo_channel.py +331 -0
  100. phase_loop_runtime/discovery.py +2368 -0
  101. phase_loop_runtime/dispatch_lock.py +167 -0
  102. phase_loop_runtime/doc_delta_validator.py +98 -0
  103. phase_loop_runtime/docs_audit.py +285 -0
  104. phase_loop_runtime/docs_freshness.py +468 -0
  105. phase_loop_runtime/docs_surfaces.py +150 -0
  106. phase_loop_runtime/dotfiles_profile_plugin.py +96 -0
  107. phase_loop_runtime/events.py +154 -0
  108. phase_loop_runtime/events_migration.py +96 -0
  109. phase_loop_runtime/evidence_audit.py +1082 -0
  110. phase_loop_runtime/evidence_audit_config.py +172 -0
  111. phase_loop_runtime/fleet_map.py +426 -0
  112. phase_loop_runtime/fleet_metrics.py +298 -0
  113. phase_loop_runtime/fleet_metrics_export.py +196 -0
  114. phase_loop_runtime/git_discipline.py +479 -0
  115. phase_loop_runtime/git_ops.py +122 -0
  116. phase_loop_runtime/git_topology.py +252 -0
  117. phase_loop_runtime/governed_bundle.py +137 -0
  118. phase_loop_runtime/governed_premerge.py +219 -0
  119. phase_loop_runtime/governed_review.py +264 -0
  120. phase_loop_runtime/handoff.py +932 -0
  121. phase_loop_runtime/handoff_path.py +14 -0
  122. phase_loop_runtime/injection.py +740 -0
  123. phase_loop_runtime/install_status.py +88 -0
  124. phase_loop_runtime/lane_scheduler.py +317 -0
  125. phase_loop_runtime/launcher.py +2760 -0
  126. phase_loop_runtime/lease_store.py +553 -0
  127. phase_loop_runtime/maintenance.py +401 -0
  128. phase_loop_runtime/migrate_handoffs.py +201 -0
  129. phase_loop_runtime/models.py +2144 -0
  130. phase_loop_runtime/observability.py +1290 -0
  131. phase_loop_runtime/panel_invoker.py +1638 -0
  132. phase_loop_runtime/phase_loop_drift_audit.py +388 -0
  133. phase_loop_runtime/phase_worktree_executor.py +433 -0
  134. phase_loop_runtime/pipeline_adapter/__init__.py +12 -0
  135. phase_loop_runtime/pipeline_adapter/branch_ops.py +274 -0
  136. phase_loop_runtime/pipeline_adapter/flag.py +55 -0
  137. phase_loop_runtime/pipeline_adapter/markers.py +13 -0
  138. phase_loop_runtime/pipeline_adapter/merge_policy.py +72 -0
  139. phase_loop_runtime/pipeline_adapter/ratification.py +100 -0
  140. phase_loop_runtime/pipeline_adapter/sibling_matcher.py +123 -0
  141. phase_loop_runtime/plan_ir.py +523 -0
  142. phase_loop_runtime/plan_manifest.py +415 -0
  143. phase_loop_runtime/planner_validation.py +176 -0
  144. phase_loop_runtime/profiles.py +462 -0
  145. phase_loop_runtime/prompts.py +365 -0
  146. phase_loop_runtime/provenance.py +165 -0
  147. phase_loop_runtime/publishing.py +339 -0
  148. phase_loop_runtime/py.typed +1 -0
  149. phase_loop_runtime/reconcile.py +1550 -0
  150. phase_loop_runtime/redaction.py +184 -0
  151. phase_loop_runtime/reflection_sync.py +293 -0
  152. phase_loop_runtime/release_guard.py +186 -0
  153. phase_loop_runtime/render.py +432 -0
  154. phase_loop_runtime/repo_validation.py +427 -0
  155. phase_loop_runtime/review_summary.py +150 -0
  156. phase_loop_runtime/roadmap_lint.py +425 -0
  157. phase_loop_runtime/route_log.py +59 -0
  158. phase_loop_runtime/route_policy/__init__.py +11 -0
  159. phase_loop_runtime/route_policy/fixtures/route_selection.golden.json +263 -0
  160. phase_loop_runtime/runner.py +8400 -0
  161. phase_loop_runtime/runtime_paths.py +225 -0
  162. phase_loop_runtime/runtime_projection.py +113 -0
  163. phase_loop_runtime/runtime_resources.py +36 -0
  164. phase_loop_runtime/schema_export.py +292 -0
  165. phase_loop_runtime/schemas/phase_loop_closeout.schema.json +366 -0
  166. phase_loop_runtime/skill_install.py +176 -0
  167. phase_loop_runtime/skill_inventory.py +662 -0
  168. phase_loop_runtime/skill_paths.py +42 -0
  169. phase_loop_runtime/skill_sources_plugin.py +37 -0
  170. phase_loop_runtime/skills_bundle/claude-advisor-board/README.md +1 -0
  171. phase_loop_runtime/skills_bundle/claude-advisor-board/SKILL.md +38 -0
  172. phase_loop_runtime/skills_bundle/claude-advisor-panel/README.md +1 -0
  173. phase_loop_runtime/skills_bundle/claude-advisor-panel/SKILL.md +38 -0
  174. phase_loop_runtime/skills_bundle/claude-execute-detailed/README.md +1 -0
  175. phase_loop_runtime/skills_bundle/claude-execute-detailed/SKILL.md +152 -0
  176. phase_loop_runtime/skills_bundle/claude-execute-phase/README.md +1 -0
  177. phase_loop_runtime/skills_bundle/claude-execute-phase/SKILL.md +745 -0
  178. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/allocate_worktree_name.sh +33 -0
  179. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/audit_lane_file_touches.py +197 -0
  180. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
  181. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
  182. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
  183. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
  184. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
  185. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/state.py +274 -0
  186. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
  187. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/team_teardown.sh +32 -0
  188. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/validate_plan_doc.py +642 -0
  189. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/verify_harness.sh +96 -0
  190. phase_loop_runtime/skills_bundle/claude-phase-loop/README.md +1 -0
  191. phase_loop_runtime/skills_bundle/claude-phase-loop/SKILL.md +115 -0
  192. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/README.md +1 -0
  193. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/SKILL.md +439 -0
  194. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/assets/review_prompt.md +19 -0
  195. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
  196. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/references/roadmap-template.md +193 -0
  197. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
  198. phase_loop_runtime/skills_bundle/claude-plan-detailed/README.md +1 -0
  199. phase_loop_runtime/skills_bundle/claude-plan-detailed/SKILL.md +334 -0
  200. phase_loop_runtime/skills_bundle/claude-plan-detailed/assets/review_prompt.md +25 -0
  201. phase_loop_runtime/skills_bundle/claude-plan-phase/README.md +1 -0
  202. phase_loop_runtime/skills_bundle/claude-plan-phase/SKILL.md +776 -0
  203. phase_loop_runtime/skills_bundle/claude-plan-phase/assets/review_prompt.md +17 -0
  204. phase_loop_runtime/skills_bundle/claude-plan-phase/scripts/validate_plan_doc.py +1092 -0
  205. phase_loop_runtime/skills_bundle/claude-run-train/README.md +1 -0
  206. phase_loop_runtime/skills_bundle/claude-run-train/SKILL.md +75 -0
  207. phase_loop_runtime/skills_bundle/claude-skill-editor/README.md +1 -0
  208. phase_loop_runtime/skills_bundle/claude-skill-editor/SKILL.md +243 -0
  209. phase_loop_runtime/skills_bundle/claude-skill-editor/assets/editor_prompt.md +72 -0
  210. phase_loop_runtime/skills_bundle/claude-skill-improvement-planner/README.md +1 -0
  211. phase_loop_runtime/skills_bundle/claude-skill-improvement-planner/SKILL.md +249 -0
  212. phase_loop_runtime/skills_bundle/claude-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
  213. phase_loop_runtime/skills_bundle/claude-task-contextualizer/README.md +1 -0
  214. phase_loop_runtime/skills_bundle/claude-task-contextualizer/SKILL.md +74 -0
  215. phase_loop_runtime/skills_bundle/claude-task-contextualizer/references/task-templates.md +103 -0
  216. phase_loop_runtime/skills_bundle/codex-advisor-board/README.md +1 -0
  217. phase_loop_runtime/skills_bundle/codex-advisor-board/SKILL.md +38 -0
  218. phase_loop_runtime/skills_bundle/codex-advisor-panel/README.md +1 -0
  219. phase_loop_runtime/skills_bundle/codex-advisor-panel/SKILL.md +38 -0
  220. phase_loop_runtime/skills_bundle/codex-execute-detailed/README.md +1 -0
  221. phase_loop_runtime/skills_bundle/codex-execute-detailed/SKILL.md +154 -0
  222. phase_loop_runtime/skills_bundle/codex-execute-phase/README.md +1 -0
  223. phase_loop_runtime/skills_bundle/codex-execute-phase/SKILL.md +231 -0
  224. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/allocate_worktree_name.sh +33 -0
  225. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/audit_lane_file_touches.py +197 -0
  226. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
  227. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
  228. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
  229. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
  230. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
  231. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/state.py +274 -0
  232. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
  233. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/team_teardown.sh +32 -0
  234. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/validate_plan_doc.py +642 -0
  235. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/verify_harness.sh +96 -0
  236. phase_loop_runtime/skills_bundle/codex-phase-loop/README.md +1 -0
  237. phase_loop_runtime/skills_bundle/codex-phase-loop/SKILL.md +248 -0
  238. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/README.md +1 -0
  239. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/SKILL.md +150 -0
  240. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/assets/review_prompt.md +19 -0
  241. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
  242. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/references/roadmap-template.md +193 -0
  243. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
  244. phase_loop_runtime/skills_bundle/codex-plan-detailed/README.md +1 -0
  245. phase_loop_runtime/skills_bundle/codex-plan-detailed/SKILL.md +119 -0
  246. phase_loop_runtime/skills_bundle/codex-plan-detailed/assets/review_prompt.md +25 -0
  247. phase_loop_runtime/skills_bundle/codex-plan-phase/README.md +1 -0
  248. phase_loop_runtime/skills_bundle/codex-plan-phase/SKILL.md +307 -0
  249. phase_loop_runtime/skills_bundle/codex-plan-phase/assets/review_prompt.md +17 -0
  250. phase_loop_runtime/skills_bundle/codex-plan-phase/scripts/validate_plan_doc.py +1092 -0
  251. phase_loop_runtime/skills_bundle/codex-run-train/README.md +1 -0
  252. phase_loop_runtime/skills_bundle/codex-run-train/SKILL.md +75 -0
  253. phase_loop_runtime/skills_bundle/codex-skill-editor/README.md +1 -0
  254. phase_loop_runtime/skills_bundle/codex-skill-editor/SKILL.md +94 -0
  255. phase_loop_runtime/skills_bundle/codex-skill-editor/assets/editor_prompt.md +72 -0
  256. phase_loop_runtime/skills_bundle/codex-skill-improvement-planner/README.md +1 -0
  257. phase_loop_runtime/skills_bundle/codex-skill-improvement-planner/SKILL.md +114 -0
  258. phase_loop_runtime/skills_bundle/codex-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
  259. phase_loop_runtime/skills_bundle/codex-task-contextualizer/README.md +1 -0
  260. phase_loop_runtime/skills_bundle/codex-task-contextualizer/SKILL.md +102 -0
  261. phase_loop_runtime/skills_bundle/codex-task-contextualizer/references/task-templates.md +103 -0
  262. phase_loop_runtime/skills_bundle/gemini-advisor-board/README.md +1 -0
  263. phase_loop_runtime/skills_bundle/gemini-advisor-board/SKILL.md +38 -0
  264. phase_loop_runtime/skills_bundle/gemini-advisor-panel/README.md +1 -0
  265. phase_loop_runtime/skills_bundle/gemini-advisor-panel/SKILL.md +38 -0
  266. phase_loop_runtime/skills_bundle/gemini-execute-detailed/README.md +1 -0
  267. phase_loop_runtime/skills_bundle/gemini-execute-detailed/SKILL.md +144 -0
  268. phase_loop_runtime/skills_bundle/gemini-execute-phase/README.md +1 -0
  269. phase_loop_runtime/skills_bundle/gemini-execute-phase/SKILL.md +198 -0
  270. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/allocate_worktree_name.sh +33 -0
  271. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/audit_lane_file_touches.py +197 -0
  272. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
  273. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
  274. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
  275. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
  276. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
  277. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/state.py +274 -0
  278. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
  279. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/team_teardown.sh +32 -0
  280. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/validate_plan_doc.py +642 -0
  281. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/verify_harness.sh +96 -0
  282. phase_loop_runtime/skills_bundle/gemini-phase-loop/README.md +1 -0
  283. phase_loop_runtime/skills_bundle/gemini-phase-loop/SKILL.md +111 -0
  284. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/README.md +1 -0
  285. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/SKILL.md +147 -0
  286. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/assets/review_prompt.md +19 -0
  287. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
  288. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/references/roadmap-template.md +193 -0
  289. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
  290. phase_loop_runtime/skills_bundle/gemini-plan-detailed/README.md +1 -0
  291. phase_loop_runtime/skills_bundle/gemini-plan-detailed/SKILL.md +119 -0
  292. phase_loop_runtime/skills_bundle/gemini-plan-detailed/assets/review_prompt.md +25 -0
  293. phase_loop_runtime/skills_bundle/gemini-plan-phase/README.md +1 -0
  294. phase_loop_runtime/skills_bundle/gemini-plan-phase/SKILL.md +217 -0
  295. phase_loop_runtime/skills_bundle/gemini-plan-phase/assets/review_prompt.md +17 -0
  296. phase_loop_runtime/skills_bundle/gemini-plan-phase/scripts/validate_plan_doc.py +1092 -0
  297. phase_loop_runtime/skills_bundle/gemini-run-train/README.md +1 -0
  298. phase_loop_runtime/skills_bundle/gemini-run-train/SKILL.md +75 -0
  299. phase_loop_runtime/skills_bundle/gemini-skill-editor/README.md +1 -0
  300. phase_loop_runtime/skills_bundle/gemini-skill-editor/SKILL.md +87 -0
  301. phase_loop_runtime/skills_bundle/gemini-skill-editor/assets/editor_prompt.md +72 -0
  302. phase_loop_runtime/skills_bundle/gemini-skill-improvement-planner/README.md +1 -0
  303. phase_loop_runtime/skills_bundle/gemini-skill-improvement-planner/SKILL.md +109 -0
  304. phase_loop_runtime/skills_bundle/gemini-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
  305. phase_loop_runtime/skills_bundle/gemini-task-contextualizer/README.md +1 -0
  306. phase_loop_runtime/skills_bundle/gemini-task-contextualizer/SKILL.md +98 -0
  307. phase_loop_runtime/skills_bundle/gemini-task-contextualizer/references/task-templates.md +103 -0
  308. phase_loop_runtime/skills_bundle/opencode-advisor-board/README.md +1 -0
  309. phase_loop_runtime/skills_bundle/opencode-advisor-board/SKILL.md +38 -0
  310. phase_loop_runtime/skills_bundle/opencode-advisor-panel/README.md +1 -0
  311. phase_loop_runtime/skills_bundle/opencode-advisor-panel/SKILL.md +38 -0
  312. phase_loop_runtime/skills_bundle/opencode-execute-detailed/README.md +1 -0
  313. phase_loop_runtime/skills_bundle/opencode-execute-detailed/SKILL.md +144 -0
  314. phase_loop_runtime/skills_bundle/opencode-execute-phase/README.md +1 -0
  315. phase_loop_runtime/skills_bundle/opencode-execute-phase/SKILL.md +196 -0
  316. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/allocate_worktree_name.sh +33 -0
  317. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/audit_lane_file_touches.py +197 -0
  318. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
  319. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
  320. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
  321. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
  322. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
  323. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/state.py +274 -0
  324. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
  325. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/team_teardown.sh +32 -0
  326. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/validate_plan_doc.py +642 -0
  327. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/verify_harness.sh +96 -0
  328. phase_loop_runtime/skills_bundle/opencode-phase-loop/README.md +1 -0
  329. phase_loop_runtime/skills_bundle/opencode-phase-loop/SKILL.md +113 -0
  330. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/README.md +1 -0
  331. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/SKILL.md +147 -0
  332. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/assets/review_prompt.md +19 -0
  333. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
  334. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/references/roadmap-template.md +193 -0
  335. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
  336. phase_loop_runtime/skills_bundle/opencode-plan-detailed/README.md +1 -0
  337. phase_loop_runtime/skills_bundle/opencode-plan-detailed/SKILL.md +119 -0
  338. phase_loop_runtime/skills_bundle/opencode-plan-detailed/assets/review_prompt.md +25 -0
  339. phase_loop_runtime/skills_bundle/opencode-plan-phase/README.md +1 -0
  340. phase_loop_runtime/skills_bundle/opencode-plan-phase/SKILL.md +211 -0
  341. phase_loop_runtime/skills_bundle/opencode-plan-phase/assets/review_prompt.md +17 -0
  342. phase_loop_runtime/skills_bundle/opencode-plan-phase/scripts/validate_plan_doc.py +1092 -0
  343. phase_loop_runtime/skills_bundle/opencode-run-train/README.md +1 -0
  344. phase_loop_runtime/skills_bundle/opencode-run-train/SKILL.md +75 -0
  345. phase_loop_runtime/skills_bundle/opencode-skill-editor/README.md +1 -0
  346. phase_loop_runtime/skills_bundle/opencode-skill-editor/SKILL.md +87 -0
  347. phase_loop_runtime/skills_bundle/opencode-skill-editor/assets/editor_prompt.md +72 -0
  348. phase_loop_runtime/skills_bundle/opencode-skill-improvement-planner/README.md +1 -0
  349. phase_loop_runtime/skills_bundle/opencode-skill-improvement-planner/SKILL.md +109 -0
  350. phase_loop_runtime/skills_bundle/opencode-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
  351. phase_loop_runtime/skills_bundle/opencode-task-contextualizer/README.md +1 -0
  352. phase_loop_runtime/skills_bundle/opencode-task-contextualizer/SKILL.md +98 -0
  353. phase_loop_runtime/skills_bundle/opencode-task-contextualizer/references/task-templates.md +103 -0
  354. phase_loop_runtime/state.py +156 -0
  355. phase_loop_runtime/state_degradation.py +136 -0
  356. phase_loop_runtime/state_ops.py +676 -0
  357. phase_loop_runtime/train_ledger.py +215 -0
  358. phase_loop_runtime/train_roadmap.py +339 -0
  359. phase_loop_runtime/train_runner.py +1197 -0
  360. phase_loop_runtime/verification_evidence.py +650 -0
  361. phase_loop_runtime/verification_evidence_validator.py +75 -0
  362. phase_loop_runtime/visual_evidence_validator.py +36 -0
  363. phase_loop_runtime/worker_pool.py +123 -0
  364. phase_loop_runtime/worktree_index.py +270 -0
  365. phase_loop_runtime-0.2.0.data/data/share/phase-loop-runtime/protocol/protocol.md +2475 -0
  366. phase_loop_runtime-0.2.0.dist-info/METADATA +106 -0
  367. phase_loop_runtime-0.2.0.dist-info/RECORD +370 -0
  368. phase_loop_runtime-0.2.0.dist-info/WHEEL +5 -0
  369. phase_loop_runtime-0.2.0.dist-info/entry_points.txt +9 -0
  370. phase_loop_runtime-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env bash
2
+ # verify_harness.sh — pre-flight capability check for claude-execute-phase.
3
+ #
4
+ # Usage:
5
+ # verify_harness.sh [merge-target]
6
+ #
7
+ # merge-target Defaults to 'main'.
8
+ #
9
+ # Checks (all run; exit code reflects aggregate — non-zero if any FAIL):
10
+ # (1) `git` + `git worktree` available
11
+ # (2) Running inside a git work tree (`rev-parse --show-toplevel` succeeds)
12
+ # (3) Merge target branch exists locally
13
+ # (4) Working tree is clean (no uncommitted changes)
14
+ # (5) `.gitignore` mentions worktree paths — WARN only
15
+ #
16
+ # Does NOT exercise EnterWorktree itself — that's a Claude tool, not a CLI.
17
+ # The SKILL's Step 2 tells the LLM to follow this script with a throwaway-
18
+ # teammate probe that calls EnterWorktree and reports whether the tool is
19
+ # available in the teammate's registry.
20
+
21
+ set -uo pipefail
22
+
23
+ target="${1:-main}"
24
+
25
+ errors=0
26
+ warnings=0
27
+
28
+ pass() { echo "verify_harness: PASS — $*"; }
29
+ warn() { echo "verify_harness: WARN — $*" >&2; warnings=$((warnings + 1)); }
30
+ fail() { echo "verify_harness: FAIL — $*" >&2; errors=$((errors + 1)); }
31
+
32
+ # (1) git + worktree subcommand
33
+ if ! command -v git >/dev/null 2>&1; then
34
+ fail "(1) git not found on PATH"
35
+ elif ! git worktree list >/dev/null 2>&1; then
36
+ fail "(1) 'git worktree' subcommand unavailable"
37
+ else
38
+ pass "(1) git + git-worktree available"
39
+ fi
40
+
41
+ # (2) inside a git work tree
42
+ toplevel=""
43
+ if toplevel="$(git rev-parse --show-toplevel 2>/dev/null)"; then
44
+ pass "(2) inside git work tree: $toplevel"
45
+ else
46
+ fail "(2) not inside a git work tree"
47
+ fi
48
+
49
+ # (3) merge target branch exists locally
50
+ if git show-ref --verify --quiet "refs/heads/$target"; then
51
+ pass "(3) merge target '$target' exists locally"
52
+ else
53
+ fail "(3) merge target '$target' does not exist locally (try: git fetch origin $target:$target)"
54
+ fi
55
+
56
+ # (4) working tree clean (allowlist excludes orchestrator-owned paths)
57
+ #
58
+ # Allowlist: paths that may appear in `git status --porcelain` during normal
59
+ # phase execution without blocking dispatch:
60
+ # `?? .claude/worktrees/` — untracked dir holding live lane worktrees
61
+ # `?? .claude/claude-execute-phase-state.json` — orchestrator state file
62
+ #
63
+ # Everything else (including gitignore-exempted `.index_metadata.json`, any
64
+ # tracked-file modification, any other untracked file) must be committed,
65
+ # stashed, or explicitly resolved via AskUserQuestion BEFORE dispatch —
66
+ # no orchestrator-side rationalization.
67
+ dirty_lines="$(git status --porcelain 2>/dev/null | \
68
+ grep -vE '^\?\? \.claude/worktrees/?$|^\?\? \.claude/claude-execute-phase-state\.json$' || true)"
69
+ dirty_count=0
70
+ if [[ -n "$dirty_lines" ]]; then
71
+ dirty_count=$(echo "$dirty_lines" | wc -l)
72
+ fi
73
+ if [[ "$dirty_count" -eq 0 ]]; then
74
+ pass "(4) working tree clean (or only allowlisted orchestrator paths dirty)"
75
+ else
76
+ fail "(4) working tree has $dirty_count non-allowlisted uncommitted change(s); commit, stash, or abort before /claude-execute-phase. Offending paths:"
77
+ echo "$dirty_lines" | sed 's/^/verify_harness: /' >&2
78
+ fi
79
+
80
+ # (5) .gitignore covers worktree paths — WARN only, not a hard-fail.
81
+ gitignore="$toplevel/.gitignore"
82
+ if [[ -f "$gitignore" ]]; then
83
+ if grep -qE '^(\.worktrees/?|\.claude/worktrees/?)' "$gitignore"; then
84
+ pass "(5) .gitignore covers worktree paths"
85
+ else
86
+ warn "(5) .gitignore does not list '.worktrees/' or '.claude/worktrees/'; claude-execute-phase will append on first run"
87
+ fi
88
+ else
89
+ warn "(5) no .gitignore at $gitignore"
90
+ fi
91
+
92
+ echo "verify_harness: summary — $errors error(s), $warnings warning(s)"
93
+ if [[ "$errors" -gt 0 ]]; then
94
+ exit 1
95
+ fi
96
+ exit 0
@@ -0,0 +1 @@
1
+ Harness-specific overlay files for this workflow skill.
@@ -0,0 +1,248 @@
1
+ ---
2
+ name: codex-phase-loop
3
+ description: "Harness TUI bridge for the repo-local <harness>-phase-loop runner. Use when the user wants phase-loop status, resume, bounded run, dry-run, or skill-maintenance from inside Harness."
4
+ ---
5
+
6
+ # Harness Phase Loop
7
+
8
+ Thin TUI bridge for the `<harness>-phase-loop` alias of the neutral `phase-loop`
9
+ runner. This skill delegates to the stable `phase-loop` runtime boundary and
10
+ follows the public contract defined in `docs/phase-loop/runtime-boundary.md`.
11
+ This skill does not reimplement phase selection, reconciliation, handoff
12
+ parsing, model policy, event writing, or execution logic.
13
+
14
+ ## Core Rules
15
+
16
+ Use `phase_loop_runtime.skill_paths` resolver helpers for harness skill roots, handoff roots, helper roots, and reflection roots.
17
+
18
+ - Use the installed repo command: `<harness>-phase-loop`. Non-Harness
19
+ control planes should use the neutral `<harness>-config/bin/phase-loop` command.
20
+ - Prefer the outside-TUI runner for full-roadmap execution; this TUI bridge keeps interactive `run` calls bounded and operator-driven.
21
+ - Preserve manual TUI use of `<harness>-phase-roadmap-builder`, `<harness>-plan-phase`, and `<harness>-execute-phase`; this bridge is optional operator convenience.
22
+ - Do not edit OpenCode skills, broaden operator docs, create cloud resources, retrieve secrets, commit, push, merge, or discard unrelated work.
23
+ - Before reporting a human-required access blocker, inspect repo-local docs/config and safe metadata from available CLIs named in `<harness>-config/shared/runtime-state.md`. Never print secret values.
24
+ - If the CLI is missing or its commands differ from this skill, stop and return to the RUNNER phase instead of guessing behavior.
25
+
26
+ ## Inputs
27
+
28
+ - `handoff`: print the canonical TUI recovery handoff.
29
+ - `status`: report reconciled or current loop state.
30
+ - `monitor`: observe state/heartbeat/terminal summaries without launching phases.
31
+ - `resume`: reconcile durable state and write the current snapshot.
32
+ - `run`: execute a bounded loop run. Always pass `--max-phases <N>`; default to `1` when the user does not specify a bound.
33
+ - `dry-run`: show the commands the runner would launch without executing them.
34
+ - `maintain-skills`: delegate skill-maintenance workflow selection to the runner. Planner-only is the default.
35
+ - `sync-skills`: audit or repair the installed `*-phase-loop` bridge skills used for manual TUI reentry.
36
+
37
+ Optional flags may be passed through when requested: `--repo`, `--roadmap`, `--phase`, `--model-profile`, `--model`, `--effort`, `--json`, `--observe`, `--no-observe`, `--stream-output`, `--heartbeat-interval-seconds`, `--quiet-warning-seconds`, `--quiet-blocker-seconds`, `--no-heartbeat`, `--closeout-mode`, `--bypass-approvals`, `--poll-seconds`, `--timeout-seconds`, `--notify-command`, `--notify-on`, `--once`, `--min-reflections`, `--apply-skill-edits`, `--allow-skill`, and `--improvement-plan`.
38
+
39
+ ## Preflight
40
+
41
+ 1. Resolve the repo root and run `git status --short`.
42
+ 2. Confirm `<harness>-phase-loop --help` lists `status`, `resume`, `run`, `dry-run`, and `maintain-skills`.
43
+ 3. For commands that need a roadmap, let the CLI discover it unless the user supplied `--roadmap`; do not reimplement roadmap or phase selection in the skill text.
44
+ 4. If unrelated dirty work overlaps files the runner would modify, report `human_required=true` with `blocker_class=dirty_worktree_conflict` instead of continuing.
45
+ 5. **Branch-governance preflight (issue #83).** In pipeline-mode with branchgov on (the default), a dispatch switches to `consiliency/pipeline/<v>` cut from `origin/main`. If the roadmap is committed only on the operator's own branch (unpushed / ahead of `origin/main`), the runtime guard refuses cleanly with a `branch_sync_conflict` blocker (`human_required=true`) rather than crashing — push the roadmap to the base, or pass `--allow-branchgov` to switch anyway (it then still fails cleanly if the roadmap isn't on the base). The runtime guard is the authoritative fail-safe; see `docs/phase-loop/branchgov-preflight.md`.
46
+
47
+
48
+ ## Runner Evidence Contract
49
+
50
+ Use artifact-backed re-verdicting for blocked gates: a gate changes verdict only by rerunning the originally specified runner check and reading the runner-owned artifact. proxy evidence requires a roadmap amendment before the bridge reports the gate as passed. When both canonical `.phase-loop/` state and legacy `.codex/phase-loop/` compatibility files exist, canonical `.phase-loop/` state takes precedence for status, monitor, resume, reconcile, and repair decisions.
51
+
52
+
53
+ ## Spec Delta Closeout
54
+
55
+ Phase-loop handoffs and terminal closeouts must preserve one `spec_delta_closeout.v1` decision from the executor: `no_spec_delta`, `roadmap_amendment`, `canonical_spec_update`, `governed_pipeline_refresh`, `mirror_cutover_required`, `dotfiles_skill_source_update`, or `human_source_judgment_required`. Treat missing or malformed spec-closeout evidence as a repairable automation blocker with `blocker_class=contract_bug`, unless the decision is `human_source_judgment_required`. The record is metadata-only with `redaction_posture=metadata_only`: keep target surfaces, evidence paths, decision literals, IF gates, and artifact names, but never raw specification bodies, raw patch bodies, credentials, provider-supplied payloads, local environment values, or ignored/private evidence-source contents.
56
+
57
+ ## Command Mapping
58
+
59
+ - `<harness>-phase-loop handoff`: run `<harness>-phase-loop handoff`.
60
+ - `<harness>-phase-loop status`: run `<harness>-phase-loop status`.
61
+ - `<harness>-phase-loop resume`: run `<harness>-phase-loop resume`.
62
+ - `<harness>-phase-loop state`: run `<harness>-phase-loop state --json` when exact machine state is needed.
63
+ - `<harness>-phase-loop monitor`: run `<harness>-phase-loop monitor --once --json` for a single machine-readable observation.
64
+ - `<harness>-phase-loop monitor --notify-command <cmd>`: run monitor with callback-by-exception; the command receives redacted JSON on stdin.
65
+ - `<harness>-phase-loop run`: run `<harness>-phase-loop run --max-phases <N>`.
66
+ - `<harness>-phase-loop dry-run`: run `<harness>-phase-loop dry-run --max-phases <N>`.
67
+ - `<harness>-phase-loop run --observe`: run `<harness>-phase-loop run --max-phases <N> --observe`; launch artifacts are written by default, so this flag is compatibility-only.
68
+ - `<harness>-phase-loop dry-run --observe`: run `<harness>-phase-loop dry-run --max-phases <N> --observe`; launch artifacts are written by default, so this flag is compatibility-only.
69
+ - `<harness>-phase-loop maintain-skills`: run `<harness>-phase-loop maintain-skills`.
70
+ - `<harness>-phase-loop maintain-skills --observe`: run `<harness>-phase-loop maintain-skills --observe`; launch artifacts are written by default, so this flag is compatibility-only.
71
+ - `<harness>-phase-loop maintain-skills --apply-skill-edits --improvement-plan <path> --allow-skill <<harness>-* skill>`: run apply-enabled maintenance only when the user explicitly requests skill edits and names the allowed Harness skill targets.
72
+ - `<harness>-phase-loop sync-skills`: run `<harness>-phase-loop sync-skills --check` unless the user explicitly asks to repair drift.
73
+ - `<harness>-phase-loop sync-skills --apply`: run apply mode only when the user explicitly wants local bridge-skill repair for manual reentry.
74
+
75
+ Keep `run` bounded. If the user requests an unbounded run, choose `--max-phases 1` and say that the bridge keeps TUI-initiated runs bounded.
76
+
77
+ Use the shared loop state to inspect injected-skill metadata and
78
+ installed-skill drift before blaming a missing capability on the runner
79
+ contract. Repo-sourced injected workflow bundles remain authoritative for
80
+ autonomous child launches; installed workflow skills under `resolve_skill_bundle_root("codex")/`
81
+ are the recommended manual reentry surface but are not a runtime prerequisite.
82
+ If the advisory bridge record reports `missing_root`, `missing_skill`, or
83
+ `drifted`, repair the local `<harness>-phase-loop` bridge with
84
+ `<harness>-phase-loop sync-skills --apply` before relying on
85
+ manual reentry.
86
+
87
+ Harness is live-supported, but nested Harness-on-Harness disposable proof remains a
88
+ known operator caveat. If the requested action is a full Harness live smoke, run
89
+ it from a normal shell session rather than an active Harness thread. Active
90
+ Harness-thread runs may still observe or exercise the non-Harness live matrix.
91
+
92
+ When supervising a loop from a TUI, launch artifacts are written by default. If
93
+ the TUI session has been idle while another control plane ran the loop, first run
94
+ `<harness>-phase-loop handoff` or read
95
+ `.phase-loop/tui-handoff.md`. That file is the canonical human-readable
96
+ entrypoint and links to `.phase-loop/state.json`,
97
+ `.phase-loop/events.jsonl`, `.phase-loop/runs/`, and the latest run
98
+ log when known. Use `<harness>-phase-loop state --json` when exact
99
+ machine state is needed. Creating `.phase-loop/stop` pauses the loop
100
+ before the next phase launch; remove it before continuing.
101
+
102
+ Use `<harness>-phase-loop run --max-phases <N> --observe
103
+ --closeout-mode <manual|commit|push>` for execution. Use
104
+ `<harness>-phase-loop monitor` for observation only. Monitor mode
105
+ can be polled by a human, TUI, or external supervisor and can notify on
106
+ `blocked`, `stale`, `complete`, `awaiting_phase_closeout`, `operator_halt`, or
107
+ `terminal_exit` transitions through `--notify-command`. The notification
108
+ payload is redacted JSON and points back to the same canonical state, ledger,
109
+ handoff, heartbeat, terminal summary, and log files.
110
+
111
+ Observed runs write `.phase-loop/runs/<run-id>/heartbeat.json` and
112
+ `.phase-loop/runs/<run-id>/terminal-summary.json`. The handoff,
113
+ `state --json`, and `monitor --once --json` surface elapsed time, child process
114
+ liveness, seconds since the log changed, quiet level, heartbeat status,
115
+ terminal status, recommended action, and a paste-ready nudge prompt. Use the
116
+ nudge prompt only as an operator action in the owning TUI/session; the runner
117
+ does not automatically kill, retry, duplicate, or inject prompts into child
118
+ harnesses.
119
+
120
+ Pipeline-aware dotfiles runs may also emit adjacent Pipeline closeout export
121
+ metadata as `phase_loop_closeout.v1` in terminal summaries and event metadata.
122
+ This is not a second shared closeout: preserve exactly one shared
123
+ `automation:` block, treat `.phase-loop/` as authoritative state, and keep
124
+ Governed Pipeline ingest outside dotfiles. Human-required Pipeline closeout
125
+ metadata must include only redacted access attempts: source, probe, result,
126
+ details, and timestamp, never secret values.
127
+
128
+ Manual standalone bridge use remains valid without governed-pipeline, Portal,
129
+ Greenfield, `.pipeline/**`, or a source bundle. In pipeline_required runs,
130
+ Portal lifecycle state, Greenfield reduction, and Greenfield metadata-only authority refs are mediated through governed-pipeline closeout ingest and
131
+ projection; protected-source freshness stays governed-pipeline-owned, and they are not dotfiles write targets. Do not infer reads or writes
132
+ to `.pipeline/**`, governed-pipeline specs, Portal contracts, Greenfield
133
+ authority files, raw evidence, provider-supplied payloads, credentials, or legacy
134
+ `.codex/phase-loop/` state unless the active plan and source bundle explicitly
135
+ own the exact path or glob. Legacy `.codex/phase-loop/` compatibility-only
136
+ artifacts must not supersede canonical `.phase-loop/` state.
137
+ The active plan and source bundle explicitly own the exact path or glob before
138
+ protected bridge inputs or outputs may be used.
139
+ Greenfield authority files remain outside dotfiles write ownership.
140
+ Legacy `.codex/phase-loop/` state is compatibility-only and never authority.
141
+
142
+ If execution discovers steering that changes downstream work, amend the nearest
143
+ downstream roadmap phase that is not already executing. After that amendment,
144
+ older downstream phase plans or handoffs whose roadmap metadata no longer
145
+ matches are stale and must route back through `<harness>-plan-phase` before any
146
+ further execution.
147
+
148
+ When a phase is `awaiting_phase_closeout`, `manual` remains the default policy.
149
+ Operators may opt into `--closeout-mode commit` to preserve trusted
150
+ phase-owned dirty output locally, or `--closeout-mode push` to attempt the same
151
+ local preservation and then push only when topology is clean and the push
152
+ target is explicit or unambiguous. The handoff and `state --json` should be the
153
+ source of truth for the latest closeout mode, commit SHA, push target, refusal
154
+ reason, and verification status.
155
+
156
+ When a phase is `blocked` with `human_required=false`, the runner may launch one
157
+ bounded repair turn for that phase instead of treating the blocker as an
158
+ operator stop. Repair launch is fail-closed: it requires trusted machine
159
+ context for the current phase, including the current terminal summary and the
160
+ active phase plan artifact. The repair turn must inspect
161
+ `.phase-loop/state.json`, `.phase-loop/events.jsonl`,
162
+ `.phase-loop/tui-handoff.md` or `<harness>-phase-loop handoff`, and verify
163
+ `<harness>-phase-loop status --json` before and after edits. It should fix local
164
+ roadmap/plan drift, apply closeout only when the recorded policy allows it,
165
+ append a `manual_repair` event only when it clears the blocker, or convert the
166
+ blocker to a frozen human-required taxonomy entry if investigation shows real
167
+ operator input is needed.
168
+
169
+ If an execute child returns without completion evidence and leaves the target
170
+ repo dirty, including cases where the plan artifact still classifies the phase
171
+ as `planned`, the runner treats that as a non-human repair blocker unless the
172
+ dirty paths were already present outside the selected roadmap/plan artifacts.
173
+ Rerunning the loop should launch a bounded repair turn only when that trusted
174
+ context exists; otherwise it should fail closed and point the operator back to
175
+ `.phase-loop/tui-handoff.md`, `<harness>-phase-loop handoff`, and
176
+ `<harness>-phase-loop status --json`.
177
+
178
+ If a planning child exits successfully but does not create the expected current
179
+ phase-plan artifact, the runner must classify the phase as `blocked` with
180
+ `human_required=false` and `blocker_class=repeated_verification_failure`. This
181
+ usually means the child returned a proposed plan in prose instead of writing the
182
+ artifact. The TUI handoff and terminal summary are the source of truth for the
183
+ recovery command.
184
+
185
+ Blocker meanings:
186
+
187
+ - `awaiting_phase_closeout`: verified phase-owned dirty output needs explicit `manual`, `commit`, or `push` closeout.
188
+ - `dirty_worktree_conflict`: dirty paths are unowned, pre-existing, or otherwise unsafe for automatic closeout.
189
+ - `repeated_verification_failure`: a deterministic artifact or verification contract failed after a bounded attempt.
190
+ - `admin_approval`: the loop found a real admin action, branch protection, or policy prerequisite.
191
+ - `operator_halt`: `.phase-loop/stop` paused the loop before the next launch.
192
+
193
+ The runner also records `git_topology` in `state.json`, `events.jsonl`, and the
194
+ TUI handoff. Use it to detect whether the loop is operating from a PR branch,
195
+ an alternate push ref, or a local branch ahead of its base. If the surrounding
196
+ pipeline knows the intended target, it may set `PHASE_LOOP_BASE_REF`,
197
+ `PHASE_LOOP_TARGET_PUSH_REF`, `PHASE_LOOP_PR_HEAD_REF`,
198
+ `PHASE_LOOP_PR_BASE_REF`, or `PHASE_LOOP_PR_URL` before invoking the CLI.
199
+
200
+ Release-dispatch phases are guarded by the CLI before child launch. If a plan is
201
+ marked `phase_loop_mutation: release_dispatch`, dirty release-affecting paths or
202
+ a branch/base-ref mismatch produce a blocked handoff instead of dispatching the
203
+ external workflow. A roadmap-level complete handoff means all phases are
204
+ complete and the target repo worktree is clean; it should not include a resume
205
+ command.
206
+
207
+ Child Harness launches default to `--sandbox danger-full-access`. Pass `--bypass-approvals` only when the user explicitly wants fully non-interactive child execution in an externally trusted sandbox.
208
+
209
+ Write-capable parallel execution requires machine-verified disjoint lanes and
210
+ scheduler-owned worktree assignments before fanout. Do not treat a prompt,
211
+ plan note, or native harness team capability as enough to bypass runner-owned
212
+ lane safety. Claude Code CLI exception wording means local Claude Code CLI
213
+ execution through the phase-loop launcher, not Anthropic API-key execution or
214
+ PI provider fallback. Harness and Gemini fallback wording remains CLI-based and
215
+ reason-coded.
216
+
217
+ ## Human-Required Blockers
218
+
219
+ When the CLI reports or implies `human_required=true`, preserve its `blocker_class`, `blocker_summary`, `required_human_inputs`, `access_attempts`, and `automation.status` in the final response. If the blocker is access-related and the CLI did not already record safe probes, perform metadata-only probes from `<harness>-config/shared/runtime-state.md` before asking the user to act.
220
+
221
+ If `.phase-loop/tui-handoff.md` exists, use its plain-language blocker
222
+ summary and required action as the user-facing explanation, then verify exact
223
+ state from `state.json` or `<harness>-phase-loop state --json` before resuming.
224
+
225
+ Use only the frozen blocker taxonomy: `missing_secret`, `account_or_billing_setup`, `admin_approval`, `destructive_operation`, `ambiguous_roadmap_selection`, `product_decision_missing`, `dirty_worktree_conflict`, `branch_sync_conflict`, `stalled_child_observation`, `repeated_verification_failure`, or `unretryable_external_outage`.
226
+
227
+ ## Manual Fallback
228
+
229
+ If the runner cannot be used but a manual phase command is clear from durable state or CLI output, report that command instead of reconstructing runner behavior. Valid manual fallbacks are:
230
+
231
+ - `<harness>-phase-roadmap-builder <roadmap_or_spec>`
232
+ - `<harness>-plan-phase <roadmap_path> <phase_alias>`
233
+ - `<harness>-execute-phase <plan_path>`
234
+ - `<harness>-skill-improvement-planner`
235
+ - `<harness>-skill-editor --improvement-plan <path> --allow-skill <<harness>-* skill>`
236
+
237
+ ## Verification
238
+
239
+ Use the narrowest command that proves the requested bridge action:
240
+
241
+ - `<harness>-phase-loop --help`
242
+ - `<harness>-phase-loop handoff`
243
+ - `<harness>-phase-loop status`
244
+ - `<harness>-phase-loop dry-run --max-phases 1 --observe`
245
+
246
+ For roadmap-level closeout, also inspect `.phase-loop/state.json`,
247
+ `.phase-loop/events.jsonl`, relevant handoffs, and path-scoped `git status`
248
+ instead of trusting a running transcript alone.
@@ -0,0 +1 @@
1
+ Harness-specific overlay files for this workflow skill.
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: codex-phase-roadmap-builder
3
+ description: "Harness-optimized roadmap planner. Use when the user wants to turn a conversation, architecture discussion, or markdown spec into a multi-phase roadmap for later Harness planning and execution. Creates or extends versioned phase roadmap specs in execution mode, but in Plan Mode returns a proposed plan only. Do not use for single bounded changes; use <harness>-plan-detailed instead."
4
+ ---
5
+
6
+ # Harness Phase Roadmap Builder
7
+
8
+ Builds a multi-phase roadmap that downstream `<harness>-plan-phase` can turn into implementation lanes. This is the Harness port of the Claude-oriented roadmap builder; do not edit or depend on the original skill at runtime.
9
+
10
+ `shared/phase-loop/protocol.md` is the canonical shared contract for roadmap
11
+ closeout `automation:` metadata, including `next_skill`, `next_command`, and
12
+ `verification_status`.
13
+
14
+ ## Core Rules
15
+
16
+ Use `phase_loop_runtime.skill_paths` resolver helpers for harness skill roots, handoff roots, helper roots, and reflection roots.
17
+
18
+ - Preserve Plan Mode boundaries. In Plan Mode, inspect files and produce a `<proposed_plan>` roadmap only; do not create or edit repo-tracked files.
19
+ - In Default mode, write the roadmap artifact only after enough context is available.
20
+ - During planning-only roadmap creation, do not execute test suites, builds, formatters, generators, or migrations. Capture end-to-end verification commands in the roadmap without running them.
21
+ - Use local truth first: read named specs, `AGENTS.md`, and repo docs the user explicitly points at. Do not invent phases from vague context.
22
+ - Use PMCP for external capability research when current docs or third-party tooling facts affect the roadmap. Prefer `gateway_catalog_search`, then `gateway_describe`, then `gateway_invoke`; use Context7 for library/product docs. Use Bright Data only if PMCP exposes it in the current environment.
23
+ - Before asking the user for credentials, account setup, infrastructure state, admin action, or another access blocker, inspect repo-local docs/config and safe read-only or metadata-only state from available CLIs: `op`, `gh`, `vercel`/`npx vercel`, `supabase`/`npx supabase`, `gcloud`, `wrangler`, `cloudflared`, and `gam`. Never record secret values.
24
+ - Use `request_user_input` only when available; in Default mode ask one concise plain-text question only if a missing decision would make the roadmap wrong.
25
+ - Prefer fewer serial phases and more parallel work inside each phase. A phase boundary exists only when a contract must freeze before downstream work starts.
26
+ - Keep release preparation and release dispatch in separate phases when a workflow needs both. The prepare phase owns version, changelog, release-doc, workflow-input, and evidence edits; the dispatch phase owns clean-tree preflight and external release triggering, and downstream plans should mark it with `phase_loop_mutation: release_dispatch`.
27
+ - Do not spawn subagents unless the user explicitly asks for agents, subagents, delegation, or parallel agent work.
28
+
29
+ ## Inputs
30
+
31
+ - Optional spec path: markdown file to fold into the roadmap.
32
+ - Optional output path: default `specs/phase-plans-v<N>.md`, choosing the highest existing version or `v1` if none exists.
33
+ - Append mode: if the output roadmap exists, add phases without rewriting prior phases unless the user explicitly requests a replacement.
34
+
35
+ ## Workflow
36
+
37
+ 1. Resolve repo root with `git rev-parse --show-toplevel`, then inspect:
38
+ - the named spec, if any;
39
+ - `AGENTS.md` and `CLAUDE.md`, if present;
40
+ - existing `specs/phase-plans-v*.md`;
41
+ - markdown files the user named.
42
+ 2. Choose create or append mode:
43
+ - Create mode writes a full roadmap.
44
+ - Append mode reads existing aliases, phase numbers, dependencies, and interface gates, then appends only new phases.
45
+ 3. Write top-level context:
46
+ - `Context`
47
+ - `Architecture North Star` when structural
48
+ - `Assumptions`
49
+ - `Non-Goals`
50
+ - `Cross-Cutting Principles`
51
+ 4. Decompose into phases:
52
+ - serial phases only at interface-freeze boundaries;
53
+ - sibling phases for independent subtrees;
54
+ - at least two likely lanes per implementation phase unless it is a preamble or interface-only phase;
55
+ - explicit `Depends on` and `Produces` entries.
56
+ 5. Add:
57
+ - `Top Interface-Freeze Gates`;
58
+ - `Phase Dependency DAG`;
59
+ - `Execution Notes` that name which phases can be planned or executed concurrently;
60
+ - end-to-end `Verification` commands.
61
+ 6. Validate mechanically, then by eye:
62
+ - run `phase-loop validate-roadmap <output-path>` (or `python3 -m phase_loop_runtime.roadmap_lint <output-path>`) — always available wherever the phase-loop runtime is installed; it mechanically checks stable headings, unique aliases, acyclic DAG, IF-gate reconciliation, and the lane-count hint. Fix every reported issue, then confirm by eye:
63
+ - stable headings are present;
64
+ - implementation units use `## Phases` and `### Phase N — <Name> (<ALIAS>)` consistently;
65
+ - implementation-unit headings and suggested next commands do not use `Step`, `Slice`, `Stage`, `Phase Flow`, or other non-phase synonyms unless the user explicitly requested a different taxonomy;
66
+ - aliases are unique;
67
+ - dependency graph is acyclic;
68
+ - every produced gate has a producing phase;
69
+ - append mode did not silently rewrite old phases.
70
+
71
+ ## Artifact Contract
72
+
73
+ Use this shape so `<harness>-plan-phase` can parse it:
74
+
75
+ ```markdown
76
+ # Phase roadmap v<N>
77
+
78
+ ## Context
79
+
80
+ ## Architecture North Star
81
+
82
+ ## Assumptions
83
+
84
+ ## Non-Goals
85
+
86
+ ## Cross-Cutting Principles
87
+
88
+ ## Top Interface-Freeze Gates
89
+ - IF-0-<ALIAS>-<N> — <frozen contract>
90
+
91
+ ## Phases
92
+
93
+ ### Phase N — <Name> (<ALIAS>)
94
+ **Objective**
95
+
96
+ **Exit criteria**
97
+ - [ ] <testable criterion>
98
+
99
+ **Scope notes**
100
+
101
+ **Non-goals**
102
+
103
+ **Key files**
104
+
105
+ **Depends on**
106
+ - (none)
107
+
108
+ **Produces**
109
+ - IF-0-<ALIAS>-<N> — <contract>
110
+
111
+ ## Phase Dependency DAG
112
+
113
+ ## Execution Notes
114
+
115
+ ## Verification
116
+ ```
117
+
118
+
119
+
120
+ ## Spec Delta Policy
121
+
122
+ Every roadmap phase must declare its expected `spec_delta_closeout.v1` policy. Add a phase-local `**Spec closeout policy**` block that names `schema: spec_delta_closeout.v1`, the expected decision (`no_spec_delta`, `roadmap_amendment`, `canonical_spec_update`, `governed_pipeline_refresh`, `mirror_cutover_required`, `dotfiles_skill_source_update`, or `human_source_judgment_required`), target surfaces, evidence paths, `redaction_posture: metadata_only`, and any non-human `blocker_class=contract_bug` routing for missing or malformed evidence. Use `no_spec_delta` for phases that do not change reusable specs, `dotfiles_skill_source_update` for dotfiles-owned skill/source updates, and downstream routing decisions such as `governed_pipeline_refresh` or `mirror_cutover_required` only as metadata-only deferrals, not as write authorization.
123
+
124
+ ## Verification Contract
125
+
126
+ Roadmap phases must set the expectation that downstream plans include machine-checkable verification commands and an effective `automation.suite_command`. If a phase depends on operational evidence that cannot be machine-checked directly, name the operational evidence artifact and the runner-stamped amendment mechanism that records it. proxy evidence requires a roadmap amendment before any downstream plan treats it as a gate verdict.
127
+
128
+ ## Closeout
129
+
130
+ In Default mode, write the roadmap with `apply_patch`, then run `git status --short -- <artifact>`. If the artifact is untracked or modified and the user did not explicitly forbid staging, run `git add <artifact>` and include the `_reviews.md` sibling if one was produced. Rerun `git status --short -- <artifact>` and report `Artifact state: staged|tracked|modified|unstaged|blocked`. Do not commit unless the user asked for a commit.
131
+
132
+ Before final response and handoff, choose the next phase to plan from the roadmap DAG. If at least one phase is ready, report `Next phase: <alias> - <phase name>` and `Next command: <harness>-plan-phase <artifact> <alias>`. If no phase should be planned next, report `Next phase: none - <reason>` and `Next command: none - <reason>`.
133
+
134
+ Add a machine-readable automation handoff that agrees with the human-readable next step fields. Closeout payload shape is defined by `EmitPhaseCloseout` in `phase_loop_runtime/baml_src/emit_phase_closeout.baml` (if that path is absent in the checkout, use the operator/prompt-supplied field contract or the installed `phase_loop_runtime` package — the missing vendored BAML source is not a blocker); keep skill text focused on value selection and handoff routing, not duplicated field ceremony.
135
+
136
+ Before final response, write a reflection for every non-trivial run. Write it to `resolve_skill_bundle_root("codex")/<harness>-phase-roadmap-builder/reflections/<repo_hash>/<branch_slug>/<run_id>.md`. The reflection must include `## Run context` with skill name, ISO timestamp, repo, branch, commit, and artifact path if any, followed by `## What worked`, `## What didn't`, and `## Improvements to SKILL.md`. skip only when no artifact was produced AND no decision was made AND the run was pure inspection.
137
+
138
+ If no phase should be planned next, set `next_skill: none`, `next_command: none`, `next_model_hint: none`, and keep `automation.status=complete` when the roadmap is complete or `automation.status=blocked` when progress needs a human decision. Blocked access or decision cases must use the frozen blocker taxonomy from `<harness>-config/shared/runtime-state.md`, include redacted `access_attempts` when relevant, and set `required_human_inputs` to non-secret requested inputs only.
139
+
140
+ Manual TUI runs remain valid without the outer phase loop. When `.phase-loop/` exists, treat it as the authoritative runner state; legacy `.codex/phase-loop/` files are compatibility artifacts only and must not block or supersede canonical `.phase-loop/` state. When canonical `.phase-loop/state.json` or `tui-handoff.md` lags behind the newer `.phase-loop/events.jsonl` plus live git topology, reconcile current phase state from the ledger and `git status --short`/HEAD and cite that reconciliation; stale handoff text is not blocking. Only append a legacy `manual` source event to `.codex/phase-loop/events.jsonl` for standalone manual compatibility when no canonical `.phase-loop/` runtime exists, using the same `automation.status`, `next_skill`, `next_command`, `next_model_hint`, `next_effort_hint`, `human_required`, `blocker_class`, `blocker_summary`, `required_human_inputs`, `verification_status`, `artifact`, and `artifact_state` values.
141
+
142
+ Resolve closeout writes through `shared/phase-loop/handoff_path.py` and the repo-local handoff resolver; legacy harness handoff roots are read only for migration. Follow `<harness>-config/shared/runtime-state.md` and use Harness paths only:
143
+
144
+ - Reflection: `resolve_skill_bundle_root("codex")/<harness>-phase-roadmap-builder/reflections/<repo_hash>/<branch_slug>/<run_id>.md`
145
+ - Handoff: `<repo>/.dev-skills/handoffs/<harness>-phase-roadmap-builder/<run_id>.md`
146
+ - Latest handoff pointer: `<repo>/.dev-skills/handoffs/<harness>-phase-roadmap-builder/latest.md`
147
+
148
+ Handoff frontmatter must include `from: <harness>-phase-roadmap-builder`, `timestamp:`, `repo:`, `repo_root:`, `branch:`, `branch_slug:`, `commit:`, `run_id:`, `artifact:`, `artifact_state:`, `next_skill:`, `next_command:`, and `next_phase:`. Update `latest.md` with the same handoff content.
149
+
150
+ If roadmap creation is blocked by credentials, account setup, infrastructure state, admin action, or other access prerequisites, write a handoff with `human_required=true` and redacted `access_attempts` entries before asking the user to act. Each `access_attempts` entry must include `source`, `probe`, `result`, `details`, and `timestamp`, and `details` may report only metadata such as command availability, account or project identity, vault/item/field names, environment variable names, presence, and validation status.
@@ -0,0 +1,19 @@
1
+ Review the following multi-phase roadmap document produced by `/claude-phase-roadmap-builder`. The roadmap describes a sequence of phases that `/claude-plan-phase` will decompose into swim lanes; the goal of the roadmap format is to maximize end-to-end parallel execution time.
2
+
3
+ Assess, concretely:
4
+
5
+ 1. **Phase-count justification** — is any phase actually two or more independent bodies of work that could have been sibling lanes within a single phase? A new phase is only justified when downstream work genuinely cannot proceed until an upstream contract is finalized. Flag phases whose `**Depends on**` is vacuous or whose subtrees are independent.
6
+
7
+ 2. **Cross-phase parallelism in the DAG** — does the `## Phase Dependency DAG` call out every sibling-pair opportunity (the `P6A || P6B parallel after P1` pattern)? Any two phases with no shared ancestor in the DAG should be labeled parallel. Flag missed opportunities.
8
+
9
+ 3. **Freeze narrowness** — each `**Produces**` entry should name a concrete, narrow symbol / endpoint / schema / migration, not a broad surface. Flag any produces line that reads "the full X module" or "the API of Y" instead of a specific symbol.
10
+
11
+ 4. **Non-Goals completeness** — list three things likely to scope-creep during execution (common scope-creep drifts in a project of this type). For each, confirm whether `## Non-Goals` explicitly defers it. Flag silent scope creep vectors.
12
+
13
+ 5. **Assumptions fail-loud check** — are there silent assumptions embedded in `## Context` or `## Cross-Cutting Principles` that should have been listed as numbered assumptions in `## Assumptions`? Flag any that, if wrong, would invalidate the plan.
14
+
15
+ Additionally: if any `**Produces**` IF-gate (`IF-0-<ALIAS>-<N>`) is referenced in `## Top Interface-Freeze Gates` but not listed in its owning phase's `**Produces**` block, or vice versa, flag the mismatch.
16
+
17
+ Be specific. Cite phase aliases (P1, P2A, P2B, …), line numbers, and the exact assertion at issue. Prefer "Phase P3's `Produces: IF-0-P3-1` is 'the plugin API' — not narrow; should name the specific `plugins_for(repo_id)` function signature" over general critique.
18
+
19
+ ARTIFACT:
@@ -0,0 +1,111 @@
1
+ # Parallelization Heuristics
2
+
3
+ Extended rules for phase/lane decomposition. The goal is to minimize wall-clock time to deliver the full roadmap. The main SKILL.md carries the seven core rules; this doc expands them for edge cases.
4
+
5
+ ## Core model
6
+
7
+ - **Phases are serial checkpoints.** Each phase closes an interface freeze that the next phase consumes. Wall-clock cost of a phase = wall-clock cost of its slowest lane.
8
+ - **Lanes within a phase are parallel.** Multiple teammates, disjoint files, same wave.
9
+ - **Total wall time ≈ sum over critical path of (slowest lane per phase).** Minimize this sum.
10
+
11
+ ## Rule 1 — Fewer phases, more lanes
12
+
13
+ If two bodies of work can both start from today's codebase and don't depend on each other's output, they go in the same phase as sibling lanes. Do not split them into sequential phases just because they touch different modules.
14
+
15
+ **Counter-example (don't do this):**
16
+
17
+ ```
18
+ Phase 1 — Auth module
19
+ Phase 2 — Billing module ← billing doesn't depend on auth; why is it a separate phase?
20
+ ```
21
+
22
+ **Correct:**
23
+
24
+ ```
25
+ Phase 1
26
+ Lane 1 — Auth module
27
+ Lane 2 — Billing module
28
+ ```
29
+
30
+ ## Rule 2 — A phase boundary exists only at a necessary interface freeze
31
+
32
+ Ask: "Can any work in the next phase start before this phase's output is final?" If yes, the phase boundary is arbitrary — collapse it.
33
+
34
+ The only legitimate reason to introduce a phase boundary:
35
+
36
+ - Downstream lanes need an interface (signature, schema, enum, migration number) that must be fixed before they can write code against it.
37
+ - That interface is not yet fixed (either doesn't exist or is subject to change).
38
+
39
+ If the interface is already stable (in the existing codebase, in a vendored library, in a finalized spec), no phase boundary is needed — parallelize now.
40
+
41
+ ## Rule 3 — Prefer narrow, early freezes
42
+
43
+ A freeze on "the authentication module" blocks a lot. A freeze on "`login(email, password) -> Session`" blocks almost nothing. Write the tightest possible contract in the `**Produces**` block.
44
+
45
+ Narrow freezes let you push more lanes into earlier phases. Phase 1 can freeze the minimum surface; Phase 2 starts on the wider surface while Phase 1's lanes fill in the implementation.
46
+
47
+ **Anti-pattern**: `**Produces**: full implementation of X`. That's not a freeze, that's just done work. A freeze is a contract about shape, not content.
48
+
49
+ ## Rule 4 — Split fat phases into parallel sibling phases
50
+
51
+ When a phase has two or more subtrees that don't share an interface dependency on each other, split them into parallel-safe sibling phases. Use the aliased-branch pattern:
52
+
53
+ ```
54
+ P6A — Dep hygiene parallel after P1
55
+ P6B — Docs alignment parallel after P4
56
+ ```
57
+
58
+ Sibling phases with distinct aliases let `/claude-execute-phase` schedule them concurrently instead of serially.
59
+
60
+ **Test**: if `Phase N` lists `Depends on: P3` and `Phase N+1` also lists `Depends on: P3`, and neither lists the other, they are siblings. Mark them as `NA` / `NB` aliases, not `N` / `N+1`.
61
+
62
+ ## Rule 5 — ≥2 lanes per phase (with exceptions)
63
+
64
+ A single-lane phase is a code smell. Investigate:
65
+
66
+ - Is the work actually a single atomic unit? → Likely belongs as one lane inside an adjacent phase, not its own phase.
67
+ - Is the work too coarse? → Split the file-ownership further until ≥2 disjoint lanes emerge.
68
+ - Is it a pure interface-freeze phase (Phase 0 / Phase 1 preamble)? → This is the exception. Mark `Scope notes` with "preamble / interface-only phase — single lane justified".
69
+
70
+ The validator enforces this rule but allows the preamble escape hatch via explicit `Scope notes` marking.
71
+
72
+ ## Rule 6 — Parallelism hints in Scope notes
73
+
74
+ Every phase's `Scope notes` must make the parallelization plan machine-readable to `/claude-plan-phase`:
75
+
76
+ - Suggested lane count (e.g., "decompose into 3 lanes").
77
+ - Disjoint-file partitions per lane (e.g., "lane A owns `auth/**`, lane B owns `billing/**`, lane C owns `shared/types.ts`").
78
+ - Single-writer files (e.g., "`routes/index.ts` is single-writer; lane A owns it, others append via imports").
79
+ - Test-file placement (e.g., "tests go in each lane's directory; no shared test fixture file").
80
+
81
+ Without these hints, `/claude-plan-phase` has to re-derive the partition from scratch, which it may do incorrectly.
82
+
83
+ ## Rule 7 — Cross-phase parallelism in the DAG
84
+
85
+ Two phases can execute concurrently when the DAG shows no path between them. Identify these explicitly:
86
+
87
+ - Annotate the DAG with `parallel after <X>` on branch phases.
88
+ - List cross-phase parallelism in `## Execution Notes` so `/claude-execute-phase` doesn't serialize by default.
89
+
90
+ Critical path = longest path from root phases to the terminal phase. If you can split a node on the critical path into a sibling pair (Rule 4), the critical path shrinks.
91
+
92
+ ## Anti-patterns
93
+
94
+ - **Waterfall in disguise**: `Phase 1 — Design; Phase 2 — Implement; Phase 3 — Test.` This is one phase with three task types, not three phases. Tests are written before impl (TDD) within each real phase.
95
+ - **Phase-per-module**: "Phase 1 = auth, Phase 2 = billing, Phase 3 = notifications." Almost always wrong — these should be sibling lanes in one phase unless they genuinely depend on each other's interfaces.
96
+ - **Vague freezes**: `**Produces**: improved database layer`. Not a freeze. Specify the symbols, types, or migration numbers that will be stable.
97
+ - **Too-wide freezes**: `**Produces**: full public API of module X`. Downstream lanes will need to wait for every function in X to be final, not just the ones they call. Freeze only what's consumed.
98
+ - **Phantom phase dependencies**: listing `Depends on: P2` in `P3` when P3 only needs one symbol from P2 that P2 freezes on day one. Either narrow the freeze so P3 can start immediately, or promote the freeze to P1 where it belongs.
99
+
100
+ ## Diagnostic questions
101
+
102
+ When sizing phases, ask:
103
+
104
+ 1. What's the minimum interface `Phase N+1` needs from `Phase N`?
105
+ 2. Can that interface be frozen on `Phase N`'s first day instead of its last?
106
+ 3. If yes — move the freeze earlier and parallelize. If no — you've found the real phase boundary.
107
+ 4. Inside `Phase N`, what are the natural file-ownership partitions?
108
+ 5. Are any of those partitions independent enough to be lanes that won't block each other?
109
+ 6. Is there any file multiple lanes want to write? If yes, assign a single owner and have others append via imports or extension points.
110
+
111
+ Answering these yields a roadmap where the critical path is the actual minimum serialization inherent in the work — not arbitrary process overhead.