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 @@
1
+ Harness-specific overlay files for this workflow skill.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: claude-run-train
3
+ description: "Harness Code entry point for the cross-repo release-train coordinator. Use when the user wants to run, resume, or inspect a multi-repo train roadmap: draft PRs across all nodes in topo order, gather train-level review, then merge sequentially with downstream re-verification."
4
+ ---
5
+
6
+ # Harness Run Train
7
+
8
+ Thin bridge for the `phase-loop run-train` coordinator. All preflight,
9
+ draft-PR sequencing, train-level review, sequential merge, and downstream
10
+ re-verify logic lives in the runtime; this skill is the human entry point only.
11
+ Do NOT re-implement or contradict runtime guarantees here.
12
+
13
+ ## Core Rules
14
+
15
+ Use `phase_loop_runtime.skill_paths` resolver helpers for harness skill roots, handoff roots, helper roots, and reflection roots.
16
+
17
+ - Use the repo-local CLI: `phase-loop run-train --train <train-roadmap-file>`.
18
+ - Pass `--governed` to enable the merge phase (train-level review + sequential
19
+ merge + downstream re-verify). Omitting `--governed` stops at `drafts_open`.
20
+ - Do NOT invoke `phase-loop run` on the train roadmap file — that is the
21
+ per-repo loop and will not orchestrate a multi-repo train.
22
+ - Do NOT merge, force-push, or close PRs outside the coordinator; the runtime
23
+ enforces the partial-merge and false-green guards.
24
+ - Inspect `phase-loop train-status --train <file>` to check the ledger without
25
+ modifying state.
26
+
27
+ ## Inputs
28
+
29
+ - Train roadmap path: a Markdown file with `## Nodes` listing
30
+ `### Node: <repo> / <plan>` entries with `**Depends on:**` and
31
+ `**Channel:**` fields.
32
+ - Optional `--governed` flag: activates train-level review → sequential merge →
33
+ downstream re-verify.
34
+ - Optional `--ledger <path>`: explicit ledger path for crash-resume.
35
+
36
+ ## Workflow
37
+
38
+ 1. Resolve the train roadmap path (explicit arg or the user-supplied path).
39
+ 2. Run preflight:
40
+ `phase-loop run-train --train <file> --dry-run` (or inspect logs for
41
+ preflight errors before the first real run).
42
+ 3. Open draft PRs across all nodes in topo order:
43
+ `phase-loop run-train --train <file>`
44
+ The coordinator runs each repo's `run_loop` in series; a preflight failure
45
+ stops before any PR is opened.
46
+ 4. After all draft PRs are open (`status=drafts_open`), gather review:
47
+ `phase-loop run-train --train <file> --governed`
48
+ The train-level panel reviews the full set of draft changes.
49
+ 5. On approval, the coordinator merges upstream nodes first, then re-verifies
50
+ each downstream node against the upstream MERGED SHA before merging it.
51
+ A re-verify failure halts the merge at that node; upstream merges are
52
+ forward-only (never reverted).
53
+ 6. Inspect the outcome: `phase-loop train-status --train <file>`.
54
+
55
+ ## Failure Diagnostics
56
+
57
+ - `preflight_failed`: one or more nodes failed preflight checks; zero PRs were
58
+ opened. Fix the reported issues and re-run.
59
+ - `drafts_open`: draft PRs opened; merge phase not yet run. Pass `--governed`
60
+ to continue to review and merge.
61
+ - `review_halted`: the train-level panel did not approve; `terminal_blocker`
62
+ carries `human_required=False` (the block is a non-human review terminal).
63
+ No nodes were merged. Re-run after addressing review findings.
64
+ - `merge_halted`: upstream node(s) merged but a downstream re-verify failed;
65
+ the failed node and all its dependents are blocked. The forward-only guard
66
+ means already-merged nodes stay merged. Fix the integration issue and resume.
67
+ - `merge_failed`: a merge call returned an error (e.g. conflict, branch
68
+ protection). The ledger records the failed node as `blocked`. Fix and resume.
69
+
70
+ ## Resume
71
+
72
+ The coordinator is crash-resumable. If a run is interrupted, re-invoke the
73
+ same command with `--governed`; the ledger state drives which nodes are skipped
74
+ (already merged), re-verified (upstream merged but downstream not yet merged),
75
+ or retried (blocked).
@@ -0,0 +1 @@
1
+ Harness-specific overlay files for this workflow skill.
@@ -0,0 +1,243 @@
1
+ ---
2
+ name: claude-skill-editor
3
+ description: "Harness Code skill editor. Applies plans from <harness>-skill-improvement-planner, updates targeted skills, and archives consumed reflections after successful edits."
4
+ ---
5
+
6
+ # <harness>-skill-editor
7
+
8
+ ## Runtime State
9
+
10
+ For reflections, handoffs, and latest handoff pointers, follow `<harness>-config/shared/runtime-state.md`. This repo/branch/run-isolated contract supersedes any older flat closeout examples retained for historical context in this skill.
11
+
12
+ Applies the plan produced by `<harness>-skill-improvement-planner` to the target SKILL.md files. Interprets each recommendation, edits the file, mirrors across repos if the skill is dual-homed, and archives the reflections the plan consumed so they won't drive another pass.
13
+
14
+ ## Pipeline
15
+
16
+ Harness meta-skill source changes move through three tiers:
17
+
18
+ 1. Canonical source: `<harness>-config/<harness>-skills/<harness>-<skill>/SKILL.md`.
19
+ 2. Harness-neutral bundle: `vendor/phase-loop-skills/<bare-skill>/SKILL.md`, currently bundle-derived-from-codex.
20
+ 3. Installed runtime roots: `~/.claude/skills/`, `~/.codex/skills/`, `~/.gemini/skills/`, and `~/.opencode/skills/`.
21
+
22
+ Edit only the canonical source tier during skill-editor runs. Leave the neutral bundle and installed runtime roots stale until the end-of-v36 cutover. After successful edits, report that the required follow-up is bundle regeneration from the codex-derived source path plus `./bootstrap.sh`, which installs the bundle with `python3 -m phase_loop_runtime.cli install --source vendor/phase-loop-skills --symlink --apply`.
23
+
24
+ ## When to use
25
+
26
+ - Right after a `<harness>-skill-improvement-planner` run. Its handoff points here.
27
+ - The user names a plan file explicitly and wants it applied.
28
+
29
+ ## When NOT to use
30
+
31
+ - No plan file exists → run `/<harness>-skill-improvement-planner` first.
32
+ - User wants to edit a skill's instructions by hand → this skill is for applying a structured plan, not arbitrary edits.
33
+
34
+ ## Inputs
35
+
36
+ | Arg | Required | Meaning |
37
+ |---|---|---|
38
+ | `<plan-path>` | no | Absolute path to a plan produced by `<harness>-skill-improvement-planner`. Default: read `resolve_skill_bundle_root("claude")/<harness>-skill-improvement-planner/latest.md`'s `artifact:` field. |
39
+ | `--dry-run` | no | Parse the plan and print what WOULD change without editing any files. |
40
+ | `--no-push` | no | Commit but skip `git push`. Default: push. |
41
+ | `--no-mirror` | no | Edit dotfiles only; skip team-repo mirror. |
42
+
43
+ ## Workflow
44
+
45
+ ### Step 0 — Resolve plan path
46
+
47
+ If `<plan-path>` passed, use it verbatim.
48
+
49
+ Else read `resolve_skill_bundle_root("claude")/<harness>-skill-improvement-planner/latest.md`:
50
+
51
+ - Validate YAML frontmatter `from: <harness>-skill-improvement-planner`. On mismatch → flag via `AskUserQuestion` with `[use anyway, provide plan path, abort]`.
52
+ - Validate timestamp < 7 days old. On staleness → same AskUserQuestion.
53
+ - Extract `artifact:` → this is the plan path.
54
+
55
+ If neither source yields a path, stop and ask the user to provide one via `AskUserQuestion`.
56
+
57
+ ### Step 1 — Parse the plan
58
+
59
+ Read the plan file. Extract:
60
+
61
+ - **Frontmatter** — YAML block at top. Fields:
62
+ - `from: <harness>-skill-improvement-planner` (validate)
63
+ - `timestamp:`
64
+ - `min_reflections:`
65
+ - `reflections_consumed:` — list of absolute paths (this is the archival worklist)
66
+ - **Recommendations per skill** — `### <skill-name>` subheadings under `## Recommendations by skill`. For each subheading, collect every `**Change**:` bullet with its `**Rationale**:` and `**Supporting reflections**:` lines.
67
+ - **Cross-cutting recommendations** — same structure under `## Cross-cutting recommendations`; these name multiple skills each.
68
+ - **Speculative / low-confidence notes** — record but do not act on.
69
+ - **Contradictions surfaced** — record and print to user; do not auto-resolve. If contradictions exist, surface before applying and offer to skip affected recommendations.
70
+
71
+ Build a per-skill work list. Each entry: `(skill_name, change_text, rationale, supporting_reflection_versions)`.
72
+
73
+ ### Step 2 — Validate
74
+
75
+ - Every `reflections_consumed` path exists on disk. If any are missing → warn the user; skip them for archival but continue with edits.
76
+ - Every target skill named in recommendations has a canonical SKILL.md at `<harness>-config/<harness>-skills/<harness>-<skill>/SKILL.md` when working in this dotfiles repo; use `resolve_skill_bundle_root("claude")/<skill>/SKILL.md` only as a runtime fallback when no canonical source path exists. If missing → fail that recommendation, note in the outcome report.
77
+ - Detect double-application: if the plan's timestamp is already recorded in `resolve_skill_bundle_root("claude")/<harness>-skill-editor/applied-plans.log`, ask via `AskUserQuestion` with `[apply again, abort]` — applying twice is usually wrong.
78
+
79
+ On `--dry-run`, skip to Step 7 (print the worklist and exit).
80
+
81
+ ### Step 3 — Apply recommendations (per-recommendation frontier-tier Agent)
82
+
83
+ For each recommendation, spawn an Agent to apply it. Resolve `<frontier>` from the `<harness>-execute-phase` Model tiers table.
84
+
85
+ ```
86
+ Agent(
87
+ subagent_type: "general-purpose",
88
+ model: "<frontier-model-id>",
89
+ name: "<harness>-skill-editor-<skill>-<seq>",
90
+ prompt: <contents of assets/editor_prompt.md>
91
+ + "\n\n# Target skill\n<skill-name>"
92
+ + "\n\n# Target SKILL.md path\n<absolute path>"
93
+ + "\n\n# Change to apply\n<change text>"
94
+ + "\n\n# Rationale\n<rationale text>"
95
+ )
96
+ ```
97
+
98
+ The Agent has Read/Edit/Write tools. It reads the target SKILL.md, applies the specified change in directive-only style (preserving house style), and reports outcome JSON: `{applied: bool, files_modified: [path], diff_summary: "...", error: "..."}`.
99
+
100
+ Track per-recommendation outcomes. Don't stop on individual failures — collect them all for the final report.
101
+
102
+ Dispatch in parallel where safe: multiple recommendations targeting different skills can run concurrently. Multiple recommendations targeting the **same** skill must serialize (sequential Edit calls to the same file can conflict).
103
+
104
+ ### Step 4 — Mirror to team repo (if `--no-mirror` not set)
105
+
106
+ For each successfully edited dotfiles SKILL.md at `~/code/dotfiles/<harness>-config/skills/<skill>/`, check whether a counterpart exists in `~/code/<harness>-code-skills/` (under `planning-chain/`, `efficiency-kit/`, or `meta/`).
107
+
108
+ - If counterpart exists → `cp` the edited SKILL.md over.
109
+ - If absent → note in the outcome report; the skill either isn't shipped to the team repo, or is at a non-standard path the mirror didn't find.
110
+
111
+ Skip mirror for scripts in `_shared/` (they map to `tools/` in the team repo); mirror those only if explicitly edited — same pattern via cp.
112
+
113
+ ### Step 5 — Archive consumed reflections
114
+
115
+ Per the plan's archival directive. For each reflection in `reflections_consumed`:
116
+
117
+ 1. Collect every recommendation that cited this reflection (via `**Supporting reflections**`).
118
+ 2. If ALL citing recommendations succeeded → archive the reflection:
119
+ ```bash
120
+ mkdir -p <reflection-parent>/archive
121
+ mv <reflection> <reflection-parent>/archive/<basename>
122
+ ```
123
+ 3. If ANY citing recommendation failed → leave the reflection in place so next cycle can reconsider.
124
+
125
+ A reflection cited by zero surviving recommendations (e.g., its theme was rejected as repo-specific) is still archived — it's been considered.
126
+
127
+ ### Step 6 — Commit + push
128
+
129
+ Dotfiles:
130
+
131
+ ```bash
132
+ cd ~/code/dotfiles
133
+ git add -A <harness>-config/skills/
134
+ git commit -m "chore(skills): apply improvement plan <plan-timestamp>
135
+
136
+ Applied N of M recommendations from <plan-path>. See the plan file for
137
+ per-skill details. Reflections consumed this run moved to each skill's
138
+ reflections/<repo_hash>/<branch_slug>/archive/ subdirectory.
139
+
140
+ Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>"
141
+ ```
142
+
143
+ Team repo (if edits landed there):
144
+
145
+ ```bash
146
+ cd ~/code/<harness>-code-skills
147
+ git add -A
148
+ git commit -m "chore: mirror skill edits from dotfiles improvement plan <plan-timestamp>"
149
+ ```
150
+
151
+ `git push` in both unless `--no-push`.
152
+
153
+ Append the plan's timestamp + path to `resolve_skill_bundle_root("claude")/<harness>-skill-editor/applied-plans.log` so Step 2's double-apply check has state to read.
154
+
155
+ ### Step 7 — Close-out (standard pattern)
156
+
157
+ Resolve paths:
158
+
159
+ ```bash
160
+ REFLECTION_PATH=$(python3 resolve_skill_bundle_root("claude")/_shared/next_reflection_path.py <harness>-skill-editor)
161
+ REPO_LOCAL_HANDOFF=<repo>/.dev-skills/handoffs/<harness>-skill-editor/latest.md
162
+ SKILL_MD=resolve_skill_bundle_root("claude")/<harness>-skill-editor/SKILL.md
163
+ ```
164
+
165
+ Spawn ONE close-out agent on the `frontier` tier. It writes both files via the Write tool:
166
+
167
+ ```
168
+ Agent(
169
+ subagent_type: "general-purpose",
170
+ model: "<frontier-model-id>",
171
+ name: "<harness>-skill-editor-closeout",
172
+ prompt: """
173
+ Review the skill at <SKILL_MD> and the current execution transcript.
174
+ Produce TWO files via the Write tool.
175
+
176
+ FILE 1 — REPO-AGNOSTIC reflection → write to <REFLECTION_PATH>
177
+
178
+ # <harness>-skill-editor reflection — <ISO>
179
+
180
+ ## What worked
181
+ - <bullet about the SKILL's instructions>
182
+
183
+ ## Improvements to SKILL.md
184
+ - <specific, actionable change>
185
+
186
+ Do NOT reference this project or the specific plan applied.
187
+
188
+ FILE 2 — REPO-SPECIFIC handoff → write to <REPO_LOCAL_HANDOFF>
189
+
190
+ ---
191
+ from: <harness>-skill-editor
192
+ timestamp: <ISO>
193
+ artifact: <plan path that was applied>
194
+ ---
195
+
196
+ # Handoff
197
+
198
+ ## Summary
199
+ <applied N of M recommendations from the plan; archived K reflections.>
200
+
201
+ ## Key decisions made this run
202
+ - <which recommendations were skipped and why, e.g., contradictions
203
+ surfaced, target skill missing, agent error>
204
+
205
+ ## Files changed this run
206
+ - <SKILL.md paths + commit SHAs>
207
+
208
+ ## Next skill
209
+ - Usually no immediate next skill — the pipeline has closed the loop.
210
+ A new `/<harness>-phase-roadmap-builder` run will pick up the improved
211
+ instructions naturally.
212
+ """
213
+ )
214
+ ```
215
+
216
+ Exit message to user:
217
+
218
+ > Applied `<N>` of `<M>` recommendations from `<plan-path>`.
219
+ > `<K>` reflections archived.
220
+ > Reflection saved to `<REFLECTION_PATH>`.
221
+ > Handoff written to `<REPO_LOCAL_HANDOFF>`.
222
+ > Required cutover follow-up: regenerate the bundle from the codex-derived source path and run `./bootstrap.sh`.
223
+ >
224
+ > Recommended next step: run `/clear`. The improved skill instructions take effect on the next pipeline invocation.
225
+
226
+ ## Failure policy
227
+
228
+ - **Agent can't apply an edit** → mark recommendation failed, preserve its supporting reflections, continue with others.
229
+ - **Target skill missing** → mark failed, preserve its reflections, continue.
230
+ - **Plan file malformed** → surface to user via `AskUserQuestion`, offer abort.
231
+ - **Contradictions in plan** → print both sides, ask user which (or neither) to apply, continue with the rest.
232
+ - **Commit or push fails** → report to user; leave the working tree as-is for inspection.
233
+
234
+ ## Reference files
235
+
236
+ - `assets/editor_prompt.md` — the full prompt given to each edit Agent.
237
+
238
+
239
+ Use `phase_loop_runtime.skill_paths` resolver helpers for harness skill roots, handoff roots, helper roots, and reflection roots.
240
+
241
+ ## Closeout
242
+
243
+ 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.
@@ -0,0 +1,72 @@
1
+ # Editor prompt
2
+
3
+ You are applying **one** recommendation from a skill improvement plan to **one** target SKILL.md. The recommendation was produced by an aggregator that distilled multiple reflection files; you're the last link in the chain.
4
+
5
+ ## Your inputs
6
+
7
+ - **Target skill** — the skill's name (e.g., `claude-plan-phase`).
8
+ - **Target SKILL.md path** — absolute path.
9
+ - **Change to apply** — a natural-language instruction in directive-only imperative form.
10
+ - **Rationale** — why this change was proposed (one clause).
11
+
12
+ (These are appended to the end of this prompt by the caller.)
13
+
14
+ ## Your task
15
+
16
+ 1. `Read` the target SKILL.md in full.
17
+ 2. Interpret the change. Find the specific location in the file where it applies. If the change names a step, heading, or section (e.g., "In Step 5 of claude-plan-phase/SKILL.md, add a bullet after 'Apply the claude-task-contextualizer checklist' stating: …"), locate that anchor.
18
+ 3. Apply the change with `Edit`. Preserve:
19
+ - **Directive-only house style.** Imperative form. No war stories, no stats, no narrative justification. Reasons stated in one clause.
20
+ - **Existing structure.** Headings, tables, lists stay where they are unless the change explicitly moves them.
21
+ - **Exact whitespace.** Match indentation (tabs vs spaces) from the surrounding lines.
22
+ - **Existing cross-references.** If the change adds a new rule, don't accidentally break a pointer from another section.
23
+ 4. Verify: `Read` the modified region after editing. Confirm the change landed in the right place and the surrounding text still makes sense.
24
+
25
+ ## Refusing to apply
26
+
27
+ You **must** refuse (and report `applied: false`) if any of:
28
+
29
+ - The change names a specific project, codebase, domain, filename outside this skill, or company — the plan should have rejected these, but a slipped one surfaces here. Say so in `error`.
30
+ - The change is too vague to pin to a specific location ("improve Step 5 somehow"). Say so in `error` and quote the vague phrasing.
31
+ - The target file doesn't have the anchor the change references (e.g., "after 'Apply the claude-task-contextualizer checklist'" but no such line exists). Say so in `error` and list what you searched for.
32
+ - Applying would contradict an instruction already present (without the change text acknowledging the contradiction). Say so in `error`.
33
+
34
+ Do not attempt partial or creative application in any of these cases — better to fail cleanly and let the planner's next cycle reconsider.
35
+
36
+ ## House style reference
37
+
38
+ Before editing, skim the skill's existing prose to match tone. The pattern across this repo:
39
+
40
+ - Every rule uses imperative form ("Do X.", "Run Y."). Not "You should do X" or "X is recommended."
41
+ - Rationale is a single clause ("because downstream lanes depend on it") rather than a paragraph.
42
+ - No self-referential filler ("The skill is designed to…"). Just the directive.
43
+ - Tables over prose where a table fits.
44
+ - References to other skills use `/<skill-name>` (the invocation form) not `<skill-name>/SKILL.md` (the filesystem form), unless specifically naming a file.
45
+
46
+ ## Your response
47
+
48
+ After editing (or deciding not to), return a single JSON object on stdout:
49
+
50
+ ```json
51
+ {
52
+ "applied": true,
53
+ "files_modified": ["/abs/path/to/SKILL.md"],
54
+ "diff_summary": "Added bullet to Step 5 brief-construction list specifying that phase Exit criteria must be copied verbatim, not paraphrased.",
55
+ "error": null
56
+ }
57
+ ```
58
+
59
+ Or on failure:
60
+
61
+ ```json
62
+ {
63
+ "applied": false,
64
+ "files_modified": [],
65
+ "diff_summary": null,
66
+ "error": "Change references 'after \"Apply the claude-task-contextualizer checklist\"' but no such line exists in the target file. Closest match: 'Apply the `/claude-task-contextualizer` checklist to every brief.' — unclear if these are the same anchor."
67
+ }
68
+ ```
69
+
70
+ Keep `diff_summary` to one sentence. Keep `error` specific enough that the planner's next run can address it.
71
+
72
+ Do not output anything before the JSON object.
@@ -0,0 +1 @@
1
+ Harness-specific overlay files for this workflow skill.
@@ -0,0 +1,249 @@
1
+ ---
2
+ name: claude-skill-improvement-planner
3
+ description: "Harness Code skill feedback aggregator. Reads workflow skill reflections, groups recurring recommendations, and writes an improvement plan for <harness>-skill-editor."
4
+ ---
5
+
6
+ # <harness>-skill-improvement-planner
7
+
8
+ ## Runtime State
9
+
10
+ For reflections, handoffs, and latest handoff pointers, follow `<harness>-config/shared/runtime-state.md`. This repo/branch/run-isolated contract supersedes any older flat closeout examples retained for historical context in this skill.
11
+
12
+ Reads reflection files produced by the planning-chain skills' close-out steps — plus reflections emitted by the meta-skills (`<harness>-skill-improvement-planner`, `<harness>-skill-editor`) themselves — aggregates recurring themes across runs, and writes an improvement plan. Does not edit skills. A separate `<harness>-skill-editor` skill ingests the plan and performs the edits. Including the meta-skills' own reflections closes the self-improvement loop so this planner and the editor can be iterated on with the same pipeline they drive.
13
+
14
+ ## Pipeline
15
+
16
+ Harness meta-skill source changes move through three tiers:
17
+
18
+ 1. Canonical source: `<harness>-config/<harness>-skills/<harness>-<skill>/SKILL.md`.
19
+ 2. Harness-neutral bundle: `vendor/phase-loop-skills/<bare-skill>/SKILL.md`, currently bundle-derived-from-codex.
20
+ 3. Installed runtime roots: `~/.claude/skills/`, `~/.codex/skills/`, `~/.gemini/skills/`, and `~/.opencode/skills/`.
21
+
22
+ SP-DOC edits only the canonical source tier. Leave the neutral bundle and installed runtime roots stale until the end-of-v36 cutover. The cutover regenerates the bundle from the codex-derived source path and runs `./bootstrap.sh`, which installs the bundle with `python3 -m phase_loop_runtime.cli install --source vendor/phase-loop-skills --symlink --apply`.
23
+
24
+ ## When to use
25
+
26
+ - The user wants to audit accumulated reflections and decide what to change.
27
+ - Several phases have executed; reflections have built up at `resolve_skill_bundle_root("claude")/<skill>/reflections/`.
28
+ - The user asks about updating skills based on past runs.
29
+
30
+ ## When NOT to use
31
+
32
+ - User wants to edit a skill directly — they want `/<harness>-skill-editor` (once it exists) or manual edits.
33
+ - No reflections exist yet — the skill will exit with a user-facing message.
34
+
35
+ ## Inputs
36
+
37
+ | Arg | Required | Meaning |
38
+ |---|---|---|
39
+ | `--target <skill-name>` | no | Plan only for one skill; skip the rest. Default: all five skills (the three pipeline skills plus the two meta-skills). |
40
+ | `--min-reflections <N>` | no | Default 2. Skip skills with fewer new (un-archived) reflections to avoid acting on noise. |
41
+ | `--output <path>` | no | Override the generated plan path. |
42
+
43
+ ## Workflow
44
+
45
+ ### Step 1 — Enumerate reflections
46
+
47
+ Glob these paths, excluding any `archive/` subdirectory. For each skill, scan both the Harness runtime reflection root and the codex-derived source-controlled reflection root:
48
+
49
+ - `resolve_skill_bundle_root("claude")/<harness>-phase-roadmap-builder/reflections/**`
50
+ - `resolve_skill_bundle_root("codex")/<harness>-phase-roadmap-builder/reflections/**`
51
+ - `resolve_skill_bundle_root("claude")/<harness>-plan-phase/reflections/**`
52
+ - `resolve_skill_bundle_root("codex")/<harness>-plan-phase/reflections/**`
53
+ - `resolve_skill_bundle_root("claude")/<harness>-execute-phase/reflections/**`
54
+ - `resolve_skill_bundle_root("codex")/<harness>-execute-phase/reflections/**`
55
+ - `resolve_skill_bundle_root("claude")/<harness>-skill-improvement-planner/reflections/**`
56
+ - `resolve_skill_bundle_root("codex")/<harness>-skill-improvement-planner/reflections/**`
57
+ - `resolve_skill_bundle_root("claude")/<harness>-skill-editor/reflections/**`
58
+ - `resolve_skill_bundle_root("codex")/<harness>-skill-editor/reflections/**`
59
+
60
+ The last two close the self-improvement loop: this planner and the editor write reflections on their own runs, and those reflections must be aggregated here or the meta-skills can never be improved by their own pipeline. A missing `reflections/` directory for either meta-skill is not an error — they materialize lazily on first close-out.
61
+
62
+ If `--target <skill>` is set, limit to that one skill.
63
+
64
+ ### Step 2 — Parse each reflection
65
+
66
+ For each file:
67
+
68
+ - **Skill name**: parent directory's parent name.
69
+ - **Version**: extract from filename (`<skill>-reflection-v(\d+)\.md`); fall back to mtime for non-standard filenames.
70
+ - **Body**: read; extract the `## What worked` and `## Improvements to SKILL.md` sections. If those headings are absent (older or hand-named reflection), keep the raw body and tag as `unstructured`.
71
+
72
+ ### Step 3 — Gate on minimum
73
+
74
+ - Total reflections = 0 → print "No reflections to aggregate. Reflections not yet written at `resolve_skill_bundle_root("claude")/<skill>/reflections/`, or all are archived." Exit 0.
75
+ - Per skill: new reflections < `--min-reflections` → skip that skill; note in the plan summary.
76
+
77
+ ### Step 4 — Aggregate via frontier-tier Agent
78
+
79
+ Resolve the `frontier` tier from `<harness>-execute-phase`'s Model tiers table. Spawn one Agent:
80
+
81
+ ```
82
+ Agent(
83
+ subagent_type: "general-purpose",
84
+ model: "<frontier-model-id>",
85
+ name: "skill-improvement-aggregator",
86
+ prompt: <contents of assets/aggregator_prompt.md>
87
+ + "\n\n# Reflections to aggregate\n\n" + <concatenated reflection bodies, grouped by skill, with version tags>
88
+ )
89
+ ```
90
+
91
+ The aggregator prompt (in `assets/aggregator_prompt.md`) instructs the Agent to:
92
+
93
+ - Identify recurring themes (≥ `--min-reflections` distinct reflections per skill, or ≥ 2 across skills for cross-cutting).
94
+ - Separate high-confidence actionable from speculative one-offs.
95
+ - Flag contradictions.
96
+ - Propose concrete SKILL.md edits in directive-only style.
97
+ - Enforce repo-agnostic output — reject or rewrite any recommendation that names a specific project, codebase, domain, or filename.
98
+ - Cite supporting reflection versions per theme.
99
+
100
+ ### Step 5 — Write the plan file
101
+
102
+ Resolve the next plan path:
103
+
104
+ ```bash
105
+ N=$(ls resolve_skill_bundle_root("claude")/<harness>-skill-improvement-planner/plans/ 2>/dev/null | grep -c '^plan-v')
106
+ PLAN_PATH=resolve_skill_bundle_root("claude")/<harness>-skill-improvement-planner/plans/plan-v$((N+1))-$(date -u +%Y%m%dT%H%M%SZ).md
107
+ ```
108
+
109
+ Write the plan using the template in `## Plan file format` below. The frontmatter's `reflections_consumed` field must list absolute paths to every reflection that was read — this is how the downstream <harness>-skill-editor knows what to archive.
110
+
111
+ ### Step 6 — Close-out (standard artifact-producing pattern)
112
+
113
+ No cleanup commit needed (plans/ is gitignored; no other files changed). Verify `git status` clean with the allowlist `plans/` and exit.
114
+
115
+ Resolve close-out paths:
116
+
117
+ ```bash
118
+ REFLECTION_PATH=$(python3 resolve_skill_bundle_root("claude")/_shared/next_reflection_path.py <harness>-skill-improvement-planner)
119
+ REPO_LOCAL_HANDOFF=<repo>/.dev-skills/handoffs/<harness>-skill-improvement-planner/latest.md
120
+ SKILL_MD=resolve_skill_bundle_root("claude")/<harness>-skill-improvement-planner/SKILL.md
121
+ ```
122
+
123
+ Spawn ONE close-out agent on the `frontier` tier. It writes both files directly via the Write tool:
124
+
125
+ ```
126
+ Agent(
127
+ subagent_type: "general-purpose",
128
+ model: "<frontier-model-id>",
129
+ name: "<harness>-skill-improvement-planner-closeout",
130
+ prompt: """
131
+ Review the skill at <SKILL_MD> and the current execution transcript.
132
+ Produce TWO files via the Write tool.
133
+
134
+ FILE 1 — REPO-AGNOSTIC reflection → write to <REFLECTION_PATH>
135
+
136
+ # <harness>-skill-improvement-planner reflection — <ISO>
137
+
138
+ ## What worked
139
+ - <bullet about the SKILL's instructions>
140
+
141
+ ## Improvements to SKILL.md
142
+ - <specific, actionable change>
143
+
144
+ Do NOT reference this project or the specific reflections aggregated
145
+ this run.
146
+
147
+ FILE 2 — REPO-SPECIFIC handoff → write to <REPO_LOCAL_HANDOFF>
148
+
149
+ ---
150
+ from: <harness>-skill-improvement-planner
151
+ timestamp: <ISO>
152
+ artifact: <absolute path to plan file>
153
+ ---
154
+
155
+ # Handoff for <harness>-skill-editor
156
+
157
+ ## Summary
158
+ <1–2 sentences: plan path, how many reflections aggregated,
159
+ how many recommendations produced>
160
+
161
+ ## Key decisions made this run
162
+ - <what themes were promoted vs deferred>
163
+
164
+ ## Open items for <harness>-skill-editor
165
+ - <read the plan at <path>; apply recommendations in order;
166
+ archive consumed reflections per the plan's directive>
167
+
168
+ ## Files to watch for <harness>-skill-editor
169
+ - <target SKILL.md files named in the plan>
170
+ """
171
+ )
172
+ ```
173
+
174
+ Exit message to user:
175
+
176
+ > Plan written to `<PLAN_PATH>`.
177
+ > Reflection saved to `<REFLECTION_PATH>`.
178
+ > Handoff written to `<REPO_LOCAL_HANDOFF>`.
179
+ >
180
+ > Recommended next step: run `/clear`, then invoke `/<harness>-skill-editor <PLAN_PATH>`. The editor will apply the recommendations and archive the reflections this plan consumed. If `/<harness>-skill-editor` isn't installed yet, the plan is still readable and actionable by hand.
181
+
182
+ ## Plan file format
183
+
184
+ ```markdown
185
+ ---
186
+ from: <harness>-skill-improvement-planner
187
+ timestamp: <ISO>
188
+ min_reflections: <N>
189
+ reflections_consumed:
190
+ - /absolute/path/to/reflection1.md
191
+ - /absolute/path/to/reflection2.md
192
+ - …
193
+ ---
194
+
195
+ # Skill improvement plan — <ISO>
196
+
197
+ ## Summary
198
+ <1–2 paragraphs: reflections read, skills covered, headline themes, contradictions surfaced.>
199
+
200
+ ## Recommendations by skill
201
+
202
+ ### <skill-name>
203
+ - **Change**: <specific SKILL.md edit, directive-only imperative form>
204
+ - **Rationale**: <recurring theme this addresses>
205
+ - **Supporting reflections**: v3, v5, v7
206
+ - …
207
+
208
+ (Repeat per skill. If a skill had no actionable themes, write: "No recurring themes above the `--min-reflections` threshold.")
209
+
210
+ ## Cross-cutting recommendations
211
+ <themes that affect multiple skills at once>
212
+
213
+ ## Speculative / low-confidence notes
214
+ <one-off feedback worth recording but not acting on yet>
215
+
216
+ ## Contradictions surfaced
217
+ <reflections that disagreed; surface for user judgment>
218
+
219
+ ## Archival directive for <harness>-skill-editor
220
+
221
+ After successfully applying each recommendation above, move every file listed under `reflections_consumed` (frontmatter) to `<reflections-dir>/archive/<original-filename>`. Create the `archive/` subdirectory if absent. This prevents re-aggregating the same feedback next cycle. If a specific recommendation fails to apply, leave its supporting reflections in place so the next planning pass can reconsider them.
222
+ ```
223
+
224
+ ## Archive convention
225
+
226
+ New convention introduced by this skill (the downstream editor performs the move):
227
+
228
+ - Path: `resolve_skill_bundle_root("claude")/<skill>/reflections/<repo_hash>/<branch_slug>/archive/<original-filename>`
229
+ - Directory created lazily on first archive.
230
+ - This planner excludes `archive/` when globbing.
231
+ - Already gitignored — `<harness>-config/skills/*/reflections/` in dotfiles covers `archive/` as a subpath.
232
+
233
+ ## Best practices followed
234
+
235
+ - Directive-only: imperative form, no narratives, no stats.
236
+ - Progressive disclosure: the long aggregator prompt lives in `assets/aggregator_prompt.md`, not inline.
237
+ - Close-out pattern matches the pipeline skills so this skill's own corpus feeds future self-improvement passes.
238
+ - Repo-agnostic enforcement is load-bearing — aggregated reflections drive changes to SKILL.md files that ship to every repo, so any repo-specific leakage would propagate.
239
+
240
+ ## Reference files
241
+
242
+ - `assets/aggregator_prompt.md` — the full prompt given to the aggregation Agent.
243
+
244
+
245
+ Use `phase_loop_runtime.skill_paths` resolver helpers for harness skill roots, handoff roots, helper roots, and reflection roots.
246
+
247
+ ## Closeout
248
+
249
+ 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.