okstra 0.205.1 → 0.206.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/README.md +2 -2
  2. package/dist/commands/lifecycle/install.mjs +2 -1
  3. package/dist/commands/lifecycle/install.mjs.map +1 -1
  4. package/docs/architecture.md +16 -16
  5. package/docs/cli.md +4 -4
  6. package/docs/contributor-change-matrix.md +3 -2
  7. package/docs/performance-improvement-plan-v2.md +1 -1
  8. package/docs/project-structure-overview.md +45 -21
  9. package/package.json +2 -3
  10. package/runtime/BUILD.json +2 -2
  11. package/runtime/bin/okstra-spawn-followups.py +2 -2
  12. package/runtime/prompts/launch.template.md +1 -1
  13. package/runtime/prompts/lead/context-loader.md +1 -1
  14. package/runtime/prompts/lead/convergence.md +3 -3
  15. package/runtime/prompts/lead/okstra-lead-contract.md +14 -55
  16. package/runtime/prompts/lead/phase-routing.md +82 -0
  17. package/runtime/prompts/lead/report-writer.md +2 -2
  18. package/runtime/prompts/lead/team-contract.md +1 -1
  19. package/runtime/prompts/profiles/_coding-conventions-preflight.md +1 -1
  20. package/runtime/prompts/profiles/_common-contract.md +1 -1
  21. package/runtime/prompts/profiles/_coverage-critic.md +1 -1
  22. package/runtime/prompts/profiles/forbidden-actions.json +0 -94
  23. package/runtime/python/okstra_ctl/agent/prompt_cli/corrections.py +1 -1
  24. package/runtime/python/okstra_ctl/agent/prompt_cli/materialize.py +10 -1
  25. package/runtime/python/okstra_ctl/analysis_inputs.py +0 -39
  26. package/runtime/python/okstra_ctl/analysis_scope.py +31 -0
  27. package/runtime/python/okstra_ctl/asset_roots.py +19 -0
  28. package/runtime/python/okstra_ctl/consumers.py +12 -0
  29. package/runtime/python/okstra_ctl/contract_graph.py +75 -10
  30. package/runtime/python/okstra_ctl/dispatch_state.py +22 -0
  31. package/runtime/python/okstra_ctl/doctor.py +15 -4
  32. package/runtime/python/okstra_ctl/execution_mutation_audit.py +27 -1
  33. package/runtime/python/okstra_ctl/handoff.py +11 -466
  34. package/runtime/python/okstra_ctl/handoff_error.py +5 -0
  35. package/runtime/python/okstra_ctl/implementation_direction.py +9 -485
  36. package/runtime/python/okstra_ctl/initial_prompt_materialization.py +8 -1
  37. package/runtime/python/okstra_ctl/next_phase.py +2 -2
  38. package/runtime/python/okstra_ctl/option_comparison.py +3 -165
  39. package/runtime/python/okstra_ctl/option_votes.py +3 -191
  40. package/runtime/python/okstra_ctl/paths.py +22 -6
  41. package/runtime/python/okstra_ctl/phases/__init__.py +4 -0
  42. package/runtime/python/okstra_ctl/phases/catalog.py +260 -0
  43. package/runtime/python/okstra_ctl/phases/change_impact_analysis/boundary.json +11 -0
  44. package/runtime/python/okstra_ctl/phases/change_impact_analysis/entry.py +39 -0
  45. package/runtime/python/okstra_ctl/{report_html/view_models/change_impact_analysis.py → phases/change_impact_analysis/report.py} +3 -3
  46. package/runtime/python/okstra_ctl/phases/change_impact_analysis/spec.md +26 -0
  47. package/runtime/python/okstra_ctl/phases/change_impact_analysis/validation.py +23 -0
  48. package/runtime/python/okstra_ctl/phases/error_analysis/__init__.py +1 -0
  49. package/runtime/python/okstra_ctl/phases/error_analysis/boundary.json +9 -0
  50. package/runtime/{prompts/profiles/error-analysis.md → python/okstra_ctl/phases/error_analysis/profile.md} +2 -2
  51. package/runtime/python/okstra_ctl/{report_html/view_models/error_analysis.py → phases/error_analysis/report.py} +9 -8
  52. package/runtime/{templates/reports → python/okstra_ctl/phases/error_analysis/report_assets}/error-analysis-input.template.md +1 -1
  53. package/{docs/task-process/error-analysis.md → runtime/python/okstra_ctl/phases/error_analysis/spec.md} +22 -7
  54. package/runtime/python/okstra_ctl/phases/error_analysis/validation.py +241 -0
  55. package/runtime/python/okstra_ctl/phases/feature_analysis/__init__.py +1 -0
  56. package/runtime/python/okstra_ctl/phases/feature_analysis/boundary.json +8 -0
  57. package/runtime/python/okstra_ctl/phases/feature_analysis/entry.py +63 -0
  58. package/runtime/python/okstra_ctl/{report_html/view_models/feature_analysis.py → phases/feature_analysis/report.py} +12 -5
  59. package/runtime/python/okstra_ctl/phases/feature_analysis/spec.md +22 -0
  60. package/runtime/python/okstra_ctl/phases/feature_analysis/validation.py +27 -0
  61. package/runtime/python/okstra_ctl/phases/feature_analysis/wizard.py +95 -0
  62. package/runtime/python/okstra_ctl/phases/final_verification/__init__.py +4 -0
  63. package/runtime/python/okstra_ctl/phases/final_verification/boundary.json +8 -0
  64. package/runtime/python/okstra_ctl/phases/final_verification/entry.py +166 -0
  65. package/runtime/{prompts/profiles/final-verification.md → python/okstra_ctl/phases/final_verification/profile.md} +5 -5
  66. package/runtime/python/okstra_ctl/{report_html/view_models/final_verification.py → phases/final_verification/report.py} +12 -3
  67. package/runtime/{templates/reports → python/okstra_ctl/phases/final_verification/report_assets}/final-verification-input.template.md +1 -1
  68. package/{docs/task-process/final-verification.md → runtime/python/okstra_ctl/phases/final_verification/spec.md} +42 -25
  69. package/runtime/python/okstra_ctl/phases/final_verification/target.py +296 -0
  70. package/runtime/python/okstra_ctl/phases/final_verification/validation.py +190 -0
  71. package/runtime/python/okstra_ctl/phases/final_verification/wizard.py +38 -0
  72. package/runtime/python/okstra_ctl/phases/implementation/__init__.py +1 -0
  73. package/runtime/python/okstra_ctl/phases/implementation/boundary.json +17 -0
  74. package/runtime/python/okstra_ctl/{implementation_stage.py → phases/implementation/entry.py} +22 -10
  75. package/runtime/{prompts/host-orchestration/implementation.md → python/okstra_ctl/phases/implementation/host-rules.md} +1 -1
  76. package/runtime/{prompts/profiles → python/okstra_ctl/phases/implementation/instructions}/_implementation-deliverable.md +1 -1
  77. package/runtime/{prompts/profiles → python/okstra_ctl/phases/implementation/instructions}/_implementation-executor.md +4 -3
  78. package/runtime/{prompts/profiles → python/okstra_ctl/phases/implementation/instructions}/_implementation-verifier.md +4 -4
  79. package/runtime/{prompts/profiles/implementation.md → python/okstra_ctl/phases/implementation/profile.md} +5 -5
  80. package/runtime/python/okstra_ctl/{report_html/view_models/implementation.py → phases/implementation/report.py} +3 -3
  81. package/runtime/{templates/reports → python/okstra_ctl/phases/implementation/report_assets}/implementation-input.template.md +1 -1
  82. package/{docs/task-process/implementation.md → runtime/python/okstra_ctl/phases/implementation/spec.md} +20 -8
  83. package/runtime/python/okstra_ctl/phases/implementation/validation.py +205 -0
  84. package/runtime/python/okstra_ctl/phases/implementation/wizard.py +39 -0
  85. package/runtime/python/okstra_ctl/phases/implementation_option_selection/__init__.py +1 -0
  86. package/runtime/python/okstra_ctl/phases/implementation_option_selection/authoring.py +80 -0
  87. package/runtime/python/okstra_ctl/phases/implementation_option_selection/boundary.json +10 -0
  88. package/runtime/python/okstra_ctl/phases/implementation_option_selection/comparison.py +168 -0
  89. package/runtime/python/okstra_ctl/phases/implementation_option_selection/entry.py +27 -0
  90. package/runtime/{prompts/profiles/implementation-option-selection.md → python/okstra_ctl/phases/implementation_option_selection/profile.md} +2 -2
  91. package/runtime/python/okstra_ctl/{report_html/view_models/implementation_option_selection.py → phases/implementation_option_selection/report.py} +2 -2
  92. package/{docs/task-process/implementation-option-selection.md → runtime/python/okstra_ctl/phases/implementation_option_selection/spec.md} +20 -7
  93. package/runtime/python/okstra_ctl/{implementation_options.py → phases/implementation_option_selection/validation.py} +3 -3
  94. package/runtime/python/okstra_ctl/phases/implementation_option_selection/votes.py +194 -0
  95. package/runtime/python/okstra_ctl/phases/implementation_planning/__init__.py +1 -0
  96. package/runtime/python/okstra_ctl/phases/implementation_planning/authoring.py +2345 -0
  97. package/runtime/python/okstra_ctl/phases/implementation_planning/boundary.json +12 -0
  98. package/runtime/python/okstra_ctl/phases/implementation_planning/entry.py +161 -0
  99. package/runtime/python/okstra_ctl/phases/implementation_planning/guidance.py +178 -0
  100. package/runtime/{prompts/lead → python/okstra_ctl/phases/implementation_planning/instructions}/plan-body-verification.md +61 -51
  101. package/runtime/python/okstra_ctl/phases/implementation_planning/plan_body.py +3295 -0
  102. package/runtime/{prompts/profiles/implementation-planning.md → python/okstra_ctl/phases/implementation_planning/profile.md} +74 -25
  103. package/runtime/python/okstra_ctl/phases/implementation_planning/report.py +237 -0
  104. package/runtime/{templates/reports → python/okstra_ctl/phases/implementation_planning/report_assets}/implementation-planning-input.template.md +2 -2
  105. package/{docs/task-process/implementation-planning.md → runtime/python/okstra_ctl/phases/implementation_planning/spec.md} +30 -6
  106. package/runtime/python/okstra_ctl/phases/implementation_planning/validation.py +597 -0
  107. package/runtime/python/okstra_ctl/phases/implementation_planning/wizard.py +166 -0
  108. package/runtime/python/okstra_ctl/phases/improvement_discovery/boundary.json +12 -0
  109. package/runtime/python/okstra_ctl/{improvement_lenses.py → phases/improvement_discovery/lenses.py} +1 -6
  110. package/runtime/{prompts/profiles/improvement-discovery.md → python/okstra_ctl/phases/improvement_discovery/profile.md} +5 -5
  111. package/runtime/python/okstra_ctl/{report_html/view_models/improvement_discovery.py → phases/improvement_discovery/report.py} +3 -3
  112. package/runtime/{templates/reports → python/okstra_ctl/phases/improvement_discovery/report_assets}/improvement-discovery-input.template.md +1 -2
  113. package/runtime/python/okstra_ctl/phases/improvement_discovery/spec.md +29 -0
  114. package/runtime/{validators/validate_improvement_report.py → python/okstra_ctl/phases/improvement_discovery/validation.py} +5 -14
  115. package/runtime/python/okstra_ctl/phases/project_analysis/__init__.py +1 -0
  116. package/runtime/python/okstra_ctl/phases/project_analysis/boundary.json +8 -0
  117. package/runtime/python/okstra_ctl/phases/project_analysis/entry.py +11 -0
  118. package/runtime/python/okstra_ctl/{report_html/view_models/project_analysis.py → phases/project_analysis/report.py} +3 -3
  119. package/runtime/python/okstra_ctl/phases/project_analysis/spec.md +33 -0
  120. package/runtime/python/okstra_ctl/phases/project_analysis/validation.py +55 -0
  121. package/runtime/python/okstra_ctl/phases/release_handoff/__init__.py +1 -0
  122. package/runtime/python/okstra_ctl/phases/release_handoff/boundary.json +17 -0
  123. package/runtime/python/okstra_ctl/phases/release_handoff/entry.py +147 -0
  124. package/runtime/python/okstra_ctl/phases/release_handoff/operations.py +446 -0
  125. package/runtime/{prompts/profiles/release-handoff.md → python/okstra_ctl/phases/release_handoff/profile.md} +3 -3
  126. package/runtime/python/okstra_ctl/{report_html/view_models/release_handoff.py → phases/release_handoff/report.py} +3 -3
  127. package/runtime/{templates/reports → python/okstra_ctl/phases/release_handoff/report_assets}/release-handoff-input.template.md +1 -1
  128. package/{docs/task-process/release-handoff.md → runtime/python/okstra_ctl/phases/release_handoff/spec.md} +22 -9
  129. package/runtime/python/okstra_ctl/phases/release_handoff/wizard.py +84 -0
  130. package/runtime/python/okstra_ctl/phases/requirements_discovery/__init__.py +1 -0
  131. package/runtime/python/okstra_ctl/phases/requirements_discovery/boundary.json +9 -0
  132. package/runtime/{prompts/profiles/requirements-discovery.md → python/okstra_ctl/phases/requirements_discovery/profile.md} +2 -3
  133. package/runtime/python/okstra_ctl/{report_html/view_models/requirements_discovery.py → phases/requirements_discovery/report.py} +3 -3
  134. package/{docs/task-process/requirements-discovery.md → runtime/python/okstra_ctl/phases/requirements_discovery/spec.md} +25 -6
  135. package/runtime/{validators/validate_fanout.py → python/okstra_ctl/phases/requirements_discovery/validation.py} +11 -12
  136. package/runtime/python/okstra_ctl/phases/technical_verification/__init__.py +1 -0
  137. package/runtime/python/okstra_ctl/phases/technical_verification/boundary.json +9 -0
  138. package/runtime/python/okstra_ctl/phases/technical_verification/entry.py +100 -0
  139. package/runtime/{prompts/profiles/technical-verification.md → python/okstra_ctl/phases/technical_verification/profile.md} +1 -1
  140. package/runtime/python/okstra_ctl/{report_html/view_models/technical_verification.py → phases/technical_verification/report.py} +2 -2
  141. package/runtime/python/okstra_ctl/phases/technical_verification/spec.md +37 -0
  142. package/runtime/python/okstra_ctl/phases/technical_verification/validation.py +90 -0
  143. package/runtime/python/okstra_ctl/plan_approval.py +70 -0
  144. package/runtime/python/okstra_ctl/plan_items_cli.py +2 -2130
  145. package/runtime/python/okstra_ctl/profile_show.py +9 -3
  146. package/runtime/python/okstra_ctl/render.py +9 -2
  147. package/runtime/python/okstra_ctl/render_final_report.py +3 -2
  148. package/runtime/python/okstra_ctl/report_assembly.py +14 -93
  149. package/runtime/python/okstra_ctl/report_html/context_links.py +1 -1
  150. package/runtime/python/okstra_ctl/report_html/render.py +3 -2
  151. package/runtime/python/okstra_ctl/report_html/router.py +9 -33
  152. package/runtime/python/okstra_ctl/report_projections.py +1 -36
  153. package/runtime/python/okstra_ctl/report_routing.py +23 -0
  154. package/runtime/python/okstra_ctl/report_synthesis_packet.py +4 -73
  155. package/runtime/python/okstra_ctl/report_template_loader.py +35 -0
  156. package/runtime/python/okstra_ctl/report_validation_identity.py +38 -0
  157. package/runtime/python/okstra_ctl/report_views.py +18 -2
  158. package/runtime/python/okstra_ctl/run.py +113 -503
  159. package/runtime/python/okstra_ctl/stage_map.py +13 -0
  160. package/runtime/python/okstra_ctl/stage_targets.py +9 -286
  161. package/runtime/python/okstra_ctl/technical_verification_facts.py +52 -0
  162. package/runtime/python/okstra_ctl/user_response.py +199 -4
  163. package/runtime/python/okstra_ctl/verification_target.py +1 -1
  164. package/runtime/python/okstra_ctl/wizard/__init__.py +31 -31
  165. package/runtime/python/okstra_ctl/wizard/api.py +18 -0
  166. package/runtime/python/okstra_ctl/wizard/outcome.py +3 -12
  167. package/runtime/python/okstra_ctl/wizard/registry.py +20 -12
  168. package/runtime/python/okstra_ctl/wizard/state.py +6 -2
  169. package/runtime/python/okstra_ctl/wizard/steps_analysis.py +0 -97
  170. package/runtime/python/okstra_ctl/wizard/steps_plan.py +27 -278
  171. package/runtime/python/okstra_ctl/wizard/steps_roles.py +2 -1
  172. package/runtime/python/okstra_ctl/work_categories.py +1 -1
  173. package/runtime/python/okstra_ctl/worker_prompt_contract.py +36 -0
  174. package/runtime/python/okstra_ctl/workflow.py +26 -143
  175. package/runtime/skills/okstra-brief-gen/SKILL.md +3 -3
  176. package/runtime/skills/okstra-run/SKILL.md +1 -1
  177. package/runtime/skills/okstra-user-response/SKILL.md +23 -4
  178. package/runtime/templates/reports/quick-input.template.md +1 -1
  179. package/runtime/templates/reports/task-brief.template.md +1 -1
  180. package/runtime/validators/validate-brief.py +2 -2
  181. package/runtime/validators/validate-run.py +287 -4091
  182. package/runtime/validators/validate_analysis_report.py +14 -126
  183. package/docs/task-process/README.md +0 -82
  184. package/docs/task-process/common-flow.md +0 -173
  185. package/runtime/python/okstra_ctl/report_html/view_models/implementation_planning.py +0 -147
  186. package/runtime/python/okstra_ctl/technical_verification.py +0 -195
  187. /package/runtime/{prompts/profiles/change-impact-analysis.json → python/okstra_ctl/phases/change_impact_analysis/profile.json} +0 -0
  188. /package/runtime/{prompts/profiles/change-impact-analysis.md → python/okstra_ctl/phases/change_impact_analysis/profile.md} +0 -0
  189. /package/runtime/{templates/reports → python/okstra_ctl/phases/change_impact_analysis/report_assets}/change-impact-analysis-input.template.md +0 -0
  190. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/change_impact_analysis/report_assets}/change-impact-analysis.template.html +0 -0
  191. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/change_impact_analysis/report_assets}/change-impact-analysis.template.md +0 -0
  192. /package/runtime/{prompts/profiles/error-analysis.json → python/okstra_ctl/phases/error_analysis/profile.json} +0 -0
  193. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/error_analysis/report_assets}/error-analysis.template.html +0 -0
  194. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/error_analysis/report_assets}/error-analysis.template.md +0 -0
  195. /package/runtime/{prompts/profiles/feature-analysis.json → python/okstra_ctl/phases/feature_analysis/profile.json} +0 -0
  196. /package/runtime/{prompts/profiles/feature-analysis.md → python/okstra_ctl/phases/feature_analysis/profile.md} +0 -0
  197. /package/runtime/{templates/reports → python/okstra_ctl/phases/feature_analysis/report_assets}/feature-analysis-input.template.md +0 -0
  198. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/feature_analysis/report_assets}/feature-analysis.template.html +0 -0
  199. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/feature_analysis/report_assets}/feature-analysis.template.md +0 -0
  200. /package/runtime/{prompts/profiles/final-verification.json → python/okstra_ctl/phases/final_verification/profile.json} +0 -0
  201. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/final_verification/report_assets}/final-verification.template.html +0 -0
  202. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/final_verification/report_assets}/final-verification.template.md +0 -0
  203. /package/runtime/{prompts/profiles → python/okstra_ctl/phases/implementation/instructions}/_implementation-diff-review.md +0 -0
  204. /package/runtime/{prompts/profiles → python/okstra_ctl/phases/implementation/instructions}/_implementation-self-check.md +0 -0
  205. /package/runtime/{prompts/profiles/implementation.json → python/okstra_ctl/phases/implementation/profile.json} +0 -0
  206. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/implementation/report_assets}/implementation.template.html +0 -0
  207. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/implementation/report_assets}/implementation.template.md +0 -0
  208. /package/runtime/{prompts/profiles/implementation-option-selection.json → python/okstra_ctl/phases/implementation_option_selection/profile.json} +0 -0
  209. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/implementation_option_selection/report_assets}/implementation-option-selection.template.html +0 -0
  210. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/implementation_option_selection/report_assets}/implementation-option-selection.template.md +0 -0
  211. /package/runtime/{prompts/host-orchestration/implementation-planning.md → python/okstra_ctl/phases/implementation_planning/host-rules.md} +0 -0
  212. /package/runtime/{prompts/profiles/implementation-planning.json → python/okstra_ctl/phases/implementation_planning/profile.json} +0 -0
  213. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/implementation_planning/report_assets}/implementation-planning.template.html +0 -0
  214. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/implementation_planning/report_assets}/implementation-planning.template.md +0 -0
  215. /package/runtime/{prompts/profiles/improvement-discovery.json → python/okstra_ctl/phases/improvement_discovery/profile.json} +0 -0
  216. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/improvement_discovery/report_assets}/improvement-discovery.template.html +0 -0
  217. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/improvement_discovery/report_assets}/improvement-discovery.template.md +0 -0
  218. /package/runtime/{prompts/profiles/project-analysis.json → python/okstra_ctl/phases/project_analysis/profile.json} +0 -0
  219. /package/runtime/{prompts/profiles/project-analysis.md → python/okstra_ctl/phases/project_analysis/profile.md} +0 -0
  220. /package/runtime/{templates/reports → python/okstra_ctl/phases/project_analysis/report_assets}/project-analysis-input.template.md +0 -0
  221. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/project_analysis/report_assets}/project-analysis.template.html +0 -0
  222. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/project_analysis/report_assets}/project-analysis.template.md +0 -0
  223. /package/runtime/{prompts/profiles/release-handoff.json → python/okstra_ctl/phases/release_handoff/profile.json} +0 -0
  224. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/release_handoff/report_assets}/release-handoff.template.html +0 -0
  225. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/release_handoff/report_assets}/release-handoff.template.md +0 -0
  226. /package/runtime/python/okstra_ctl/{fanout.py → phases/requirements_discovery/fanout.py} +0 -0
  227. /package/runtime/{prompts/profiles/requirements-discovery.json → python/okstra_ctl/phases/requirements_discovery/profile.json} +0 -0
  228. /package/runtime/{templates/reports → python/okstra_ctl/phases/requirements_discovery/report_assets}/fan-out-unit.template.md +0 -0
  229. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/requirements_discovery/report_assets}/requirements-discovery.template.html +0 -0
  230. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/requirements_discovery/report_assets}/requirements-discovery.template.md +0 -0
  231. /package/runtime/{prompts/profiles/technical-verification.json → python/okstra_ctl/phases/technical_verification/profile.json} +0 -0
  232. /package/runtime/{templates/reports/html/tasks → python/okstra_ctl/phases/technical_verification/report_assets}/technical-verification.template.html +0 -0
  233. /package/runtime/{templates/reports/md/tasks → python/okstra_ctl/phases/technical_verification/report_assets}/technical-verification.template.md +0 -0
@@ -1,168 +1,6 @@
1
- """구현 방향 비교 자료 — 선택 리포트 기록 하나를 채팅용 사실 묶음으로 투영한다.
2
-
3
- 사용자가 방향을 고르기 전에 비교 자료를 청하면 리드는 점수표·투표표·충족
4
- 요약을 보여 준다. 그 숫자는 전부 `implementationOptionSelection` 기록에 있고
5
- `weightedScore` 는 발행 시점에 재계산 값과 대조된다
6
- (`implementation_options.py` `_validate_option_scores`). 리드가 JSON 을 손으로
7
- 읽고 가중 점수를 다시 계산하던 자리를 이 명령이 대신한다. 서술(도입 문장,
8
- 방향별 요지)은 리드가 `narrative` 와 각 방향의 근거 필드로 쓴다.
9
-
10
- 읽기 전용이다. 어떤 파일도 쓰지 않는다.
11
- """
12
- from __future__ import annotations
13
-
14
- import argparse
15
- import json
16
- import sys
17
- from collections.abc import Mapping, Sequence
18
- from pathlib import Path
19
- from typing import Any
20
-
21
- from okstra_ctl import next_phase
22
- from okstra_ctl.final_report_paths import final_report_data_path
23
- from okstra_ctl.json_boundary import JsonBoundaryError, load_owned_object
24
-
25
-
26
- class OptionComparisonError(ValueError):
27
- """비교 자료를 만들 수 없는 기록."""
28
-
29
-
30
- def _rows(value: object) -> list[Mapping[str, Any]]:
31
- if not isinstance(value, Sequence) or isinstance(value, (str, bytes)):
32
- return []
33
- return [row for row in value if isinstance(row, Mapping)]
34
-
35
-
36
- def _text(value: object) -> str:
37
- return value.strip() if isinstance(value, str) else ""
38
-
39
-
40
- def _count(value: object) -> int:
41
- return len(value) if isinstance(value, Sequence) and not isinstance(value, str) else 0
42
-
43
-
44
- def _option(
45
- option: Mapping[str, Any], recommended_id: str
46
- ) -> dict[str, Any]:
47
- coverage = option.get("coverageSummary")
48
- coverage = coverage if isinstance(coverage, Mapping) else {}
49
- scores = _rows(option.get("criterionScores"))
50
- return {
51
- "id": _text(option.get("id")),
52
- "name": _text(option.get("name")),
53
- "recommended": _text(option.get("id")) == recommended_id,
54
- "goal": _text(option.get("goal")),
55
- "coreMechanism": _text(option.get("coreMechanism")),
56
- # 발행 검증이 재계산 값과 같음을 보장한 기록값이다. 다시 계산하지 않는다.
57
- "weightedScore": option.get("weightedScore"),
58
- "scores": {_text(row.get("criterion")): row.get("score") for row in scores},
59
- "scoreRationales": {
60
- _text(row.get("criterion")): _text(row.get("rationale")) for row in scores
61
- },
62
- "coverage": {
63
- "verdict": _text(coverage.get("coverageVerdict")),
64
- "coveredCount": coverage.get("coveredCount"),
65
- "totalCount": coverage.get("totalCount"),
66
- "requirementIds": [
67
- _text(row.get("requirementId"))
68
- for row in _rows(option.get("requirementCoverage"))
69
- if _text(row.get("requirementId"))
70
- ],
71
- },
72
- "safetyBlockers": _count(option.get("safetyBlockers")),
73
- "unresolvedFeasibilityFacts": _count(option.get("unresolvedFeasibilityFacts")),
74
- "votes": {
75
- _text(vote.get("worker")): {
76
- "verdict": _text(vote.get("verdict")),
77
- "rationale": _text(vote.get("rationale")),
78
- "counterevidence": _text(vote.get("counterevidence")),
79
- }
80
- for vote in _rows(option.get("feasibilityVotes"))
81
- if _text(vote.get("worker"))
82
- },
83
- }
84
-
85
-
86
- def build_comparison(report_data: Mapping[str, Any]) -> dict[str, Any]:
87
- """선택 리포트 기록 → 비교 자료 사실 묶음."""
88
- selection = report_data.get("implementationOptionSelection")
89
- if not isinstance(selection, Mapping):
90
- raise OptionComparisonError(
91
- "report has no implementationOptionSelection block; "
92
- "pass an implementation-option-selection report record"
93
- )
94
- recommended_id = _text(selection.get("recommendedOptionId"))
95
- options = [
96
- _option(row, recommended_id) for row in _rows(selection.get("rankedOptions"))
97
- ]
98
- if not options:
99
- raise OptionComparisonError("report ranks no direction; there is nothing to compare")
100
- # 투표 열 순서는 처음 등장한 순서다 — 방향마다 같은 분석자 집합이 투표한다.
101
- workers: list[str] = []
102
- for option in options:
103
- for worker in option["votes"]:
104
- if worker not in workers:
105
- workers.append(worker)
106
- narrative = selection.get("userNarrative")
107
- narrative = narrative if isinstance(narrative, Mapping) else {}
108
- return {
109
- "mode": _text(selection.get("mode")),
110
- "routing": _text(selection.get("routing")),
111
- "recommendedOptionId": recommended_id,
112
- "criteria": [
113
- {"criterion": _text(row.get("criterion")), "weight": row.get("weight")}
114
- for row in _rows(selection.get("evaluationCriteria"))
115
- ],
116
- "workers": workers,
117
- "options": options,
118
- "narrative": {
119
- key: _text(block.get("text"))
120
- for key, block in narrative.items()
121
- if isinstance(block, Mapping) and _text(block.get("text"))
122
- },
123
- # "남은 절차" 문단의 근거. 다음 phase 포인터와 같은 문장이다.
124
- "nextStep": next_phase.project(report_data)["rationale"],
125
- }
126
-
127
-
128
- def _load(report: Path) -> Mapping[str, Any]:
129
- data_path = final_report_data_path(report)
130
- try:
131
- data = load_owned_object(data_path, artifact="implementation option data")
132
- except (OSError, JsonBoundaryError) as exc:
133
- raise OptionComparisonError(f"cannot read report record {data_path}: {exc}") from exc
134
- return data
135
-
136
-
137
- def build_parser() -> argparse.ArgumentParser:
138
- parser = argparse.ArgumentParser(
139
- prog="okstra option-comparison",
140
- description=(
141
- "Print the comparison facts of an implementation-option-selection "
142
- "report as JSON: criteria and weights, per-direction scores and "
143
- "recorded weighted score, requirement coverage, blocker counts, "
144
- "per-worker feasibility votes, the report narrative, and the next step."
145
- ),
146
- )
147
- parser.add_argument(
148
- "--report",
149
- required=True,
150
- help="final-report-implementation-option-selection-<seq>.data.json (a .md sibling is accepted)",
151
- )
152
- return parser
153
-
154
-
155
- def main(argv: list[str] | None = None) -> int:
156
- args = build_parser().parse_args(argv)
157
- try:
158
- payload = build_comparison(_load(Path(args.report)))
159
- except OptionComparisonError as exc:
160
- print(f"option-comparison: {exc}", file=sys.stderr)
161
- return 2
162
- json.dump(payload, sys.stdout, ensure_ascii=False, indent=2)
163
- sys.stdout.write("\n")
164
- return 0
1
+ """기존 명령 이름을 단계의 실행 진입점으로 연결한다."""
2
+ from okstra_ctl.phases.implementation_option_selection.comparison import main
165
3
 
166
4
 
167
5
  if __name__ == "__main__":
168
- sys.exit(main())
6
+ raise SystemExit(main())
@@ -1,194 +1,6 @@
1
- """전원 투표만 모자란 구현 후보와, 그 표를 받아야 할 분석자를 낸다.
2
-
3
- `implementation-option-selection` 의 1라운드는 설계자들이 병렬로 돌아 서로의
4
- 후보를 보지 못한다. 그래서 자기가 낸 후보에만 실현 가능성 표를 남기고, 병합된
5
- 집합에는 분석자마다 다른 구멍이 생긴다. 유효성 규칙은 전원 투표를 요구하므로
6
- (`implementation_options._validate_option_feasibility`) 그런 후보는 순위표에
7
- 오르지 못하고, 남는 후보가 하나도 없으면 run 이 `routing: blocked` 로 끝난다 —
8
- 실측(2026-09-10, dev-10629-4): 설계자 3명 로스터에서 IO-001·IO-002·IO-003 이
9
- 각각 `feasible` 2표를 받고도 빠진 분석자가 하나씩 달라 전부 탈락했다.
10
-
11
- 거절은 그 상태를 알려 줄 뿐 메우지 못한다. 이 명령이 앞으로 가는 길이다:
12
- 표만 모자란 후보를 세고, 어느 분석자에게 어떤 후보를 부쳐야 하는지 말한다.
13
- 재검증(reverify) 라운드는 주장을 반박하는 라운드이지 후보에 표를 남기는
14
- 라운드가 아니므로, 그 구멍을 메우는 디스패치는 리드가 이 목록을 보고 연다.
15
-
16
- 읽는 자리는 두 가지다. 조립 전이면 작성자 서사(`--narrative`), 이미 발행된
17
- run 이면 리포트 레코드(`--report`). 로스터는 task-manifest 의
18
- `recommendedWorkers` 에서 `report-writer` 를 뺀 것이고, 그것이 검증기가
19
- `participating analysers` 로 쓰는 값과 같은 정의다(`validators/validate-run.py`).
20
- """
21
- from __future__ import annotations
22
-
23
- import argparse
24
- import json
25
- import sys
26
- from collections.abc import Mapping
27
- from pathlib import Path
28
- from typing import Any
29
-
30
- from okstra_ctl.final_report_schema import load_schema_version
31
- from okstra_ctl.implementation_options import VoteGap, vote_gaps
32
- from okstra_ctl.json_boundary import JsonBoundaryError, load_owned_object
33
- from okstra_ctl.report_contract import CURRENT_REPORT_SCHEMA_VERSION
34
- from okstra_ctl.report_narrative import parse_narrative_structure
35
-
36
-
37
- class OptionVotesError(ValueError):
38
- """투표 구멍을 셀 입력이 없거나 읽히지 않는다."""
39
-
40
-
41
- def _record_from_report(path: Path) -> dict[str, Any]:
42
- try:
43
- return load_owned_object(path, artifact="final-report data.json")
44
- except (JsonBoundaryError, OSError) as exc:
45
- raise OptionVotesError(f"report record is unreadable: {exc}") from exc
46
-
47
-
48
- def _record_from_narrative(path: Path) -> dict[str, Any]:
49
- """작성자 서사를 레코드 모양으로 읽는다.
50
-
51
- 값 결함은 무시한다 — 교정 원장이 고칠 자리이고, 표 구멍을 세는 데에는
52
- 후보 id 와 `feasibilityVotes` 만 있으면 된다. 여기서 서사 전체를 거절하면
53
- 아직 교정 중인 run 은 이 명령을 쓸 수 없다.
54
- """
55
- try:
56
- markdown = path.read_text(encoding="utf-8")
57
- except OSError as exc:
58
- raise OptionVotesError(f"narrative is unreadable: {exc}") from exc
59
- schema = load_schema_version(CURRENT_REPORT_SCHEMA_VERSION)
60
- record, _defects = parse_narrative_structure(markdown, schema)
61
- return record
62
-
63
-
64
- def participating_analysers(manifest_path: Path) -> tuple[str, ...]:
65
- try:
66
- manifest = load_owned_object(manifest_path, artifact="task-manifest")
67
- except (JsonBoundaryError, OSError) as exc:
68
- raise OptionVotesError(f"task manifest is unreadable: {exc}") from exc
69
- roster = manifest.get("recommendedWorkers")
70
- if not isinstance(roster, list):
71
- raise OptionVotesError("task manifest has no recommendedWorkers roster")
72
- return tuple(
73
- str(worker) for worker in roster if str(worker) != "report-writer"
74
- )
75
-
76
-
77
- def _selection(record: Mapping[str, Any]) -> Mapping[str, Any]:
78
- selection = record.get("implementationOptionSelection")
79
- if not isinstance(selection, Mapping):
80
- raise OptionVotesError(
81
- "the source has no implementationOptionSelection block — "
82
- "this command reads an implementation-option-selection run"
83
- )
84
- return selection
85
-
86
-
87
- def _dispatch_lines(gaps: list[VoteGap]) -> list[str]:
88
- """분석자별로 부칠 후보 목록. 디스패치 단위가 분석자이기 때문이다."""
89
- by_analyser: dict[str, list[str]] = {}
90
- for gap in gaps:
91
- for analyser in gap.missing:
92
- by_analyser.setdefault(analyser, []).append(gap.option_id)
93
- return [
94
- f" {analyser}: {', '.join(options)}"
95
- for analyser, options in sorted(by_analyser.items())
96
- ]
97
-
98
-
99
- def _render(gaps: list[VoteGap]) -> str:
100
- if not gaps:
101
- return (
102
- "No candidate is short of votes alone. A blocked run here is "
103
- "blocked by something a vote cannot settle — safety blockers, "
104
- "unresolved feasibility facts, or too few feasible verdicts."
105
- )
106
- lines = [
107
- f"{len(gaps)} candidate(s) need only the missing feasibility votes:",
108
- "",
109
- ]
110
- lines += [
111
- f" {gap.option_id}: {gap.feasible_votes} feasible so far, "
112
- f"missing {', '.join(gap.missing)}"
113
- for gap in gaps
114
- ]
115
- lines += ["", "Dispatch one vote-completion assignment per analyser:"]
116
- lines += _dispatch_lines(gaps)
117
- lines += [
118
- "",
119
- "Each assignment asks that analyser for its own feasibility verdict, "
120
- "rationale, and counterevidence on the named candidate — nothing else. "
121
- "It generates no candidate, so the run stays in `candidate-comparison` "
122
- "mode; `preselected-validation` is a whole-run mode that would collapse "
123
- "the comparison to one direction.",
124
- ]
125
- return "\n".join(lines)
126
-
127
-
128
- def _gaps(args: argparse.Namespace) -> int:
129
- if bool(args.report) == bool(args.narrative):
130
- raise OptionVotesError("pass exactly one of --report or --narrative")
131
- record = (
132
- _record_from_report(args.report)
133
- if args.report
134
- else _record_from_narrative(args.narrative)
135
- )
136
- gaps = vote_gaps(
137
- _selection(record), participating_analysers(args.task_manifest)
138
- )
139
- if args.json:
140
- print(json.dumps(
141
- {
142
- "gaps": [
143
- {
144
- "optionId": gap.option_id,
145
- "missing": list(gap.missing),
146
- "feasibleVotes": gap.feasible_votes,
147
- }
148
- for gap in gaps
149
- ]
150
- },
151
- ensure_ascii=False,
152
- indent=2,
153
- ))
154
- else:
155
- print(_render(gaps))
156
- return 0
157
-
158
-
159
- _CLI_DESCRIPTION = (
160
- "Report the implementation candidates that only lack feasibility votes, "
161
- "and which analyser owes each one."
162
- )
163
-
164
-
165
- def _parser() -> argparse.ArgumentParser:
166
- parser = argparse.ArgumentParser(
167
- description=_CLI_DESCRIPTION, prog="okstra option-votes"
168
- )
169
- subparsers = parser.add_subparsers(dest="command", required=True)
170
- gaps_parser = subparsers.add_parser("gaps")
171
- gaps_parser.add_argument(
172
- "--task-manifest", type=Path, required=True,
173
- help="the task's task-manifest.json — its roster names the analysers")
174
- gaps_parser.add_argument(
175
- "--report", type=Path,
176
- help="a published final-report `.data.json`")
177
- gaps_parser.add_argument(
178
- "--narrative", type=Path,
179
- help="the report writer's narrative markdown, before assembly")
180
- gaps_parser.add_argument("--json", action="store_true")
181
- return parser
182
-
183
-
184
- def main(argv: list[str] | None = None) -> int:
185
- args = _parser().parse_args(argv)
186
- try:
187
- return _gaps(args)
188
- except OptionVotesError as exc:
189
- print(f"okstra option-votes: {exc}", file=sys.stderr)
190
- return 1
1
+ """기존 명령 이름을 단계의 실행 진입점으로 연결한다."""
2
+ from okstra_ctl.phases.implementation_option_selection.votes import main
191
3
 
192
4
 
193
5
  if __name__ == "__main__":
194
- raise SystemExit(main(sys.argv[1:]))
6
+ raise SystemExit(main())
@@ -29,6 +29,8 @@ from okstra_project.dirs import (
29
29
  )
30
30
  from okstra_project.slug import slugify
31
31
 
32
+ from .asset_roots import walk_to_asset_root as _walk_to_asset_root
33
+
32
34
  __all__ = [
33
35
  "OKSTRA_RELATIVE",
34
36
  "TASKS_RELATIVE",
@@ -88,12 +90,24 @@ def find_asset_root(
88
90
  root = Path(override)
89
91
  if is_present(root.joinpath(*relative)):
90
92
  return root
93
+ return walk_to_asset_root(relative, start=start, is_present=is_present)
91
94
 
92
- here = Path(start or __file__).resolve()
93
- for parent in [here, *here.parents]:
94
- if is_present(parent.joinpath(*relative)):
95
- return parent
96
- return None
95
+
96
+ def walk_to_asset_root(
97
+ relative: Sequence[str],
98
+ *,
99
+ start: Optional[Path] = None,
100
+ is_present: Callable[[Path], bool] = Path.is_file,
101
+ ) -> Optional[Path]:
102
+ """The nearest ancestor of ``start`` that carries ``relative``, or None.
103
+
104
+ This is the layout walk of `find_asset_root` without the `OKSTRA_HOME`
105
+ override. A caller that must stay inside the tree it started from (a phase
106
+ profile resolving its includes) calls this directly.
107
+ """
108
+ return _walk_to_asset_root(
109
+ relative, start=Path(start or __file__), is_present=is_present,
110
+ )
97
111
 
98
112
 
99
113
  _STAGED_TASK_TYPES = ("implementation", "final-verification")
@@ -609,6 +623,8 @@ def compute_run_paths(
609
623
  incremental_decision = run_state / f"incremental-decision-{task_type_segment}-{seqs['state']}.json"
610
624
 
611
625
  run_errors_log = run_logs / f"errors-{task_type_segment}-{seqs['state']}.jsonl"
626
+ from .phases.catalog import profile_sidecar
627
+
612
628
  runtime_home = okstra_home()
613
629
 
614
630
  claude_worker_errors_sidecar = worker_results / f"claude-worker-errors{suffixes['worker_results']}.json"
@@ -666,7 +682,7 @@ def compute_run_paths(
666
682
  runtime_home / "prompts" / "lead" / "convergence.md"
667
683
  ),
668
684
  "OKSTRA_PLAN_BODY_VERIFICATION_PATH": str(
669
- runtime_home / "prompts" / "lead" / "plan-body-verification.md"
685
+ profile_sidecar(runtime_home, "prompts/lead/plan-body-verification.md")
670
686
  ),
671
687
  "OKSTRA_REPORT_WRITER_PATH": str(
672
688
  runtime_home / "prompts" / "lead" / "report-writer.md"
@@ -0,0 +1,4 @@
1
+ """단계 패키지.
2
+
3
+ 등록표는 ``catalog`` 다. 이 패키지를 import 해도 단계 실행 모듈은 적재되지 않는다.
4
+ """