okstra 0.186.7 → 0.187.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (541) hide show
  1. package/README.md +1 -1
  2. package/dist/cli-registry.d.mts +88 -1
  3. package/dist/cli-registry.mjs +68 -111
  4. package/dist/cli-registry.mjs.map +1 -1
  5. package/dist/commands/execute/render-bundle.mjs +0 -1
  6. package/dist/commands/execute/render-bundle.mjs.map +1 -1
  7. package/dist/commands/execute/run.mjs +8 -3
  8. package/dist/commands/execute/run.mjs.map +1 -1
  9. package/dist/commands/lifecycle/check-project.mjs +1 -14
  10. package/dist/commands/lifecycle/check-project.mjs.map +1 -1
  11. package/dist/commands/lifecycle/config.mjs +38 -40
  12. package/dist/commands/lifecycle/config.mjs.map +1 -1
  13. package/dist/commands/lifecycle/doctor.d.mts +22 -7
  14. package/dist/commands/lifecycle/doctor.mjs +77 -49
  15. package/dist/commands/lifecycle/doctor.mjs.map +1 -1
  16. package/dist/commands/lifecycle/install.d.mts +12 -10
  17. package/dist/commands/lifecycle/install.mjs +104 -39
  18. package/dist/commands/lifecycle/install.mjs.map +1 -1
  19. package/dist/commands/lifecycle/paths.mjs +8 -3
  20. package/dist/commands/lifecycle/paths.mjs.map +1 -1
  21. package/dist/commands/lifecycle/preflight.mjs +2 -1
  22. package/dist/commands/lifecycle/preflight.mjs.map +1 -1
  23. package/dist/commands/lifecycle/setup.mjs +22 -36
  24. package/dist/commands/lifecycle/setup.mjs.map +1 -1
  25. package/dist/commands/lifecycle/uninstall.d.mts +4 -2
  26. package/dist/commands/lifecycle/uninstall.mjs +59 -15
  27. package/dist/commands/lifecycle/uninstall.mjs.map +1 -1
  28. package/dist/commands/memory/memory.mjs +7 -1
  29. package/dist/commands/memory/memory.mjs.map +1 -1
  30. package/dist/lib/helper-scripts.d.mts +1 -1
  31. package/dist/lib/helper-scripts.mjs +10 -18
  32. package/dist/lib/helper-scripts.mjs.map +1 -1
  33. package/dist/lib/host-config.d.mts +72 -0
  34. package/dist/lib/host-config.mjs +404 -0
  35. package/dist/lib/host-config.mjs.map +1 -0
  36. package/dist/lib/host-registry-client.d.mts +2 -2
  37. package/dist/lib/host-registry-client.mjs +0 -3
  38. package/dist/lib/host-registry-client.mjs.map +1 -1
  39. package/dist/lib/install-assets.d.mts +1 -0
  40. package/dist/lib/install-assets.mjs +4 -0
  41. package/dist/lib/install-assets.mjs.map +1 -1
  42. package/dist/lib/proc.d.mts +2 -0
  43. package/dist/lib/proc.mjs +12 -0
  44. package/dist/lib/proc.mjs.map +1 -1
  45. package/dist/lib/python-command.d.mts +2 -0
  46. package/dist/lib/python-command.mjs +52 -0
  47. package/dist/lib/python-command.mjs.map +1 -0
  48. package/dist/lib/python-helper.d.mts +2 -5
  49. package/dist/lib/python-helper.mjs +3 -52
  50. package/dist/lib/python-helper.mjs.map +1 -1
  51. package/dist/lib/runtime-payload.d.mts +23 -0
  52. package/dist/lib/runtime-payload.mjs +57 -0
  53. package/dist/lib/runtime-payload.mjs.map +1 -0
  54. package/dist/lib/types.d.mts +24 -13
  55. package/docs/architecture/storage-model.md +21 -5
  56. package/docs/architecture.md +37 -36
  57. package/docs/cli.md +55 -76
  58. package/docs/coding-rules.md +295 -0
  59. package/docs/container.md +10 -36
  60. package/docs/contributor-change-matrix.md +1 -1
  61. package/docs/for-ai/skills/okstra-code-review.md +0 -1
  62. package/docs/for-ai/skills/okstra-container-build.md +8 -41
  63. package/docs/for-ai/skills/okstra-inspect.md +4 -4
  64. package/docs/for-ai/skills/okstra-manager.md +2 -2
  65. package/docs/for-ai/skills/okstra-rollup.md +0 -1
  66. package/docs/for-ai/skills/okstra-run.md +3 -3
  67. package/docs/for-ai/skills/okstra-user-response.md +0 -1
  68. package/docs/performance-improvement-plan-v2.md +1 -1
  69. package/docs/project-structure-overview.md +62 -62
  70. package/docs/task-process/README.md +3 -3
  71. package/docs/task-process/common-flow.md +1 -1
  72. package/docs/task-process/error-analysis.md +3 -3
  73. package/docs/task-process/implementation-planning.md +3 -1
  74. package/docs/task-process/release-handoff.md +1 -1
  75. package/package.json +3 -2
  76. package/runtime/BUILD.json +2 -2
  77. package/runtime/agents/workers/claude-worker.md +6 -11
  78. package/runtime/agents/workers/report-writer-worker.md +1 -1
  79. package/runtime/bin/lib/okstra/cli.sh +4 -0
  80. package/runtime/bin/lib/okstra/globals.sh +2 -0
  81. package/runtime/bin/lib/okstra/interactive.sh +26 -173
  82. package/runtime/bin/lib/okstra/project-resolver.sh +23 -61
  83. package/runtime/bin/lib/okstra/usage.sh +3 -3
  84. package/runtime/bin/okstra-compact-reminder.sh +1 -5
  85. package/runtime/bin/okstra-error-log.py +19 -2
  86. package/runtime/bin/okstra-import-check.py +26 -0
  87. package/runtime/bin/okstra-inject-report-index.py +5 -4
  88. package/runtime/bin/okstra-provider-exec.py +22 -17
  89. package/runtime/bin/okstra-render-final-report.py +16 -6
  90. package/runtime/bin/okstra-render-report-views.py +25 -18
  91. package/runtime/bin/okstra-report-translate.py +30 -18
  92. package/runtime/bin/okstra-spawn-followups.py +4 -0
  93. package/runtime/bin/okstra-token-usage.py +3 -0
  94. package/runtime/bin/okstra.sh +4 -2
  95. package/runtime/bin/okstra_bootstrap.py +58 -0
  96. package/runtime/prompts/coding-preflight/overview.md +1 -1
  97. package/runtime/prompts/duties/planning-worker.md +1 -1
  98. package/runtime/prompts/launch.template.md +35 -9
  99. package/runtime/prompts/lead/convergence.md +96 -87
  100. package/runtime/prompts/lead/okstra-lead-contract.md +63 -12
  101. package/runtime/prompts/lead/plan-body-verification.md +65 -46
  102. package/runtime/prompts/lead/report-writer.md +34 -4
  103. package/runtime/prompts/lead/team-contract.md +4 -1
  104. package/runtime/prompts/profiles/_clarification-recommendation.md +2 -1
  105. package/runtime/prompts/profiles/_coding-conventions-preflight.md +1 -1
  106. package/runtime/prompts/profiles/_common-contract.md +3 -3
  107. package/runtime/prompts/profiles/_coverage-critic.md +1 -1
  108. package/runtime/prompts/profiles/_implementation-deliverable.md +2 -2
  109. package/runtime/prompts/profiles/_implementation-executor.md +3 -1
  110. package/runtime/prompts/profiles/_implementation-verifier.md +16 -2
  111. package/runtime/prompts/profiles/error-analysis.md +4 -3
  112. package/runtime/prompts/profiles/final-verification.md +2 -2
  113. package/runtime/prompts/profiles/implementation-planning.md +22 -17
  114. package/runtime/prompts/profiles/implementation.md +3 -2
  115. package/runtime/prompts/profiles/requirements-discovery.md +2 -1
  116. package/runtime/prompts/wizard/prompts.ko.json +29 -8
  117. package/runtime/python/okstra_ctl/__init__.py +6 -27
  118. package/runtime/python/okstra_ctl/adapters/hosts/claude-code/relay.md +4 -5
  119. package/runtime/python/okstra_ctl/adapters/hosts/codex/adapter.py +21 -2
  120. package/runtime/python/okstra_ctl/adapters/hosts/external/adapter.py +3 -12
  121. package/runtime/python/okstra_ctl/adapters/providers/antigravity/adapter.py +40 -22
  122. package/runtime/python/okstra_ctl/adapters/providers/claude/adapter.py +14 -21
  123. package/runtime/python/okstra_ctl/adapters/providers/codex/adapter.py +37 -20
  124. package/runtime/python/okstra_ctl/adapters/providers/grok/adapter.py +86 -14
  125. package/runtime/python/okstra_ctl/adapters/providers/kimi/adapter.py +12 -12
  126. package/runtime/python/okstra_ctl/adapters/runtime/cmux.py +4 -7
  127. package/runtime/python/okstra_ctl/agent/__init__.py +1 -0
  128. package/runtime/python/okstra_ctl/{agent_activity.py → agent/activity.py} +12 -1
  129. package/runtime/python/okstra_ctl/{agent_invocation.py → agent/invocation.py} +34 -5
  130. package/runtime/python/okstra_ctl/agent/prompt_cli/__init__.py +19 -0
  131. package/runtime/python/okstra_ctl/agent/prompt_cli/__main__.py +11 -0
  132. package/runtime/python/okstra_ctl/agent/prompt_cli/cli.py +215 -0
  133. package/runtime/python/okstra_ctl/agent/prompt_cli/dynamic_verifier.py +155 -0
  134. package/runtime/python/okstra_ctl/agent/prompt_cli/emit.py +66 -0
  135. package/runtime/python/okstra_ctl/agent/prompt_cli/inputs.py +138 -0
  136. package/runtime/python/okstra_ctl/agent/prompt_cli/materialize.py +408 -0
  137. package/runtime/python/okstra_ctl/agent/prompt_cli/results.py +197 -0
  138. package/runtime/python/okstra_ctl/agent/prompt_cli/run_identity.py +107 -0
  139. package/runtime/python/okstra_ctl/analysis_packet.py +47 -4
  140. package/runtime/python/okstra_ctl/approval_decisions.py +260 -8
  141. package/runtime/python/okstra_ctl/assignment_resolver.py +0 -12
  142. package/runtime/python/okstra_ctl/attempt_evidence.py +12 -24
  143. package/runtime/python/okstra_ctl/blocking_checks.py +251 -0
  144. package/runtime/python/okstra_ctl/brief_frontmatter.py +0 -7
  145. package/runtime/python/okstra_ctl/clarification_items/__init__.py +102 -0
  146. package/runtime/python/okstra_ctl/clarification_items/carry.py +224 -0
  147. package/runtime/python/okstra_ctl/clarification_items/dispositions.py +135 -0
  148. package/runtime/python/okstra_ctl/clarification_items/parsing.py +253 -0
  149. package/runtime/python/okstra_ctl/clarification_items/rows.py +115 -0
  150. package/runtime/python/okstra_ctl/clarification_items/scan.py +215 -0
  151. package/runtime/python/okstra_ctl/clarification_items/sidecars.py +211 -0
  152. package/runtime/python/okstra_ctl/cmux.py +38 -31
  153. package/runtime/python/okstra_ctl/code_review_target.py +163 -1
  154. package/runtime/python/okstra_ctl/conformance.py +23 -0
  155. package/runtime/python/okstra_ctl/container.py +38 -421
  156. package/runtime/python/okstra_ctl/context_cost.py +16 -2
  157. package/runtime/python/okstra_ctl/contract_graph_cli.py +7 -0
  158. package/runtime/python/okstra_ctl/convergence.py +101 -15
  159. package/runtime/python/okstra_ctl/convergence_critic_prompt.py +345 -0
  160. package/runtime/python/okstra_ctl/convergence_engine.py +382 -70
  161. package/runtime/python/okstra_ctl/convergence_store.py +5 -29
  162. package/runtime/python/okstra_ctl/design_prep.py +108 -12
  163. package/runtime/python/okstra_ctl/design_snapshot.py +11 -1
  164. package/runtime/python/okstra_ctl/design_surfaces.py +29 -2
  165. package/runtime/python/okstra_ctl/dispatch_core.py +102 -25
  166. package/runtime/python/okstra_ctl/dispatch_state.py +268 -39
  167. package/runtime/python/okstra_ctl/doctor_cli.py +48 -0
  168. package/runtime/python/okstra_ctl/domain/worker_exec.py +10 -5
  169. package/runtime/python/okstra_ctl/domain/worker_presentation.py +21 -1
  170. package/runtime/python/okstra_ctl/domain/worker_stream.py +52 -21
  171. package/runtime/python/okstra_ctl/domain/write_policy.py +219 -0
  172. package/runtime/python/okstra_ctl/entrypoints/hosts.py +9 -2
  173. package/runtime/python/okstra_ctl/error_log_core.py +1 -1
  174. package/runtime/python/okstra_ctl/error_report.py +14 -0
  175. package/runtime/python/okstra_ctl/error_zip.py +18 -2
  176. package/runtime/python/okstra_ctl/execution_identity.py +100 -7
  177. package/runtime/python/okstra_ctl/execution_manifest.py +67 -20
  178. package/runtime/python/okstra_ctl/execution_mutation_audit.py +90 -8
  179. package/runtime/python/okstra_ctl/final_report_paths.py +17 -0
  180. package/runtime/python/okstra_ctl/final_report_schema.py +90 -16
  181. package/runtime/python/okstra_ctl/git_reconcile.py +22 -2
  182. package/runtime/python/okstra_ctl/handoff.py +24 -1
  183. package/runtime/python/okstra_ctl/ids.py +6 -16
  184. package/runtime/python/okstra_ctl/implementation_direction.py +142 -33
  185. package/runtime/python/okstra_ctl/implementation_options.py +25 -11
  186. package/runtime/python/okstra_ctl/implementation_outcome.py +5 -2
  187. package/runtime/python/okstra_ctl/improvement_lenses.py +0 -14
  188. package/runtime/python/okstra_ctl/incremental_carry.py +69 -8
  189. package/runtime/python/okstra_ctl/incremental_scope.py +173 -12
  190. package/runtime/python/okstra_ctl/index.py +2 -2
  191. package/runtime/python/okstra_ctl/initial_prompt_materialization.py +48 -8
  192. package/runtime/python/okstra_ctl/interactive_cli.py +223 -0
  193. package/runtime/python/okstra_ctl/json_boundary.py +10 -0
  194. package/runtime/python/okstra_ctl/listing.py +0 -91
  195. package/runtime/python/okstra_ctl/locks.py +5 -19
  196. package/runtime/python/okstra_ctl/log_report.py +14 -0
  197. package/runtime/python/okstra_ctl/manager_cli.py +22 -3
  198. package/runtime/python/okstra_ctl/manager_launch.py +4 -8
  199. package/runtime/python/okstra_ctl/material.py +2 -2
  200. package/runtime/python/okstra_ctl/migrate.py +23 -1
  201. package/runtime/python/okstra_ctl/model_cli.py +19 -5
  202. package/runtime/python/okstra_ctl/model_discovery.py +46 -47
  203. package/runtime/python/okstra_ctl/model_io/__init__.py +1 -0
  204. package/runtime/python/okstra_ctl/model_io/lines.py +163 -0
  205. package/runtime/python/okstra_ctl/model_io/references.py +370 -0
  206. package/runtime/python/okstra_ctl/model_io/renderers.py +498 -0
  207. package/runtime/python/okstra_ctl/model_io_cli.py +30 -945
  208. package/runtime/python/okstra_ctl/model_pool.py +10 -6
  209. package/runtime/python/okstra_ctl/models.py +8 -8
  210. package/runtime/python/okstra_ctl/mutation_recovery.py +5 -63
  211. package/runtime/python/okstra_ctl/next_phase.py +121 -69
  212. package/runtime/python/okstra_ctl/pane_reclaim.py +23 -0
  213. package/runtime/python/okstra_ctl/pane_title.py +11 -8
  214. package/runtime/python/okstra_ctl/path_hints.py +36 -11
  215. package/runtime/python/okstra_ctl/paths.py +76 -8
  216. package/runtime/python/okstra_ctl/plan_items.py +132 -16
  217. package/runtime/python/okstra_ctl/plan_items_cli.py +486 -36
  218. package/runtime/python/okstra_ctl/plan_run_root.py +1 -1
  219. package/runtime/python/okstra_ctl/plan_validate_cli.py +51 -0
  220. package/runtime/python/okstra_ctl/plan_verify_cli.py +80 -0
  221. package/runtime/python/okstra_ctl/prepare_error.py +20 -0
  222. package/runtime/python/okstra_ctl/prior_planning.py +157 -0
  223. package/runtime/python/okstra_ctl/profile_show.py +18 -1
  224. package/runtime/python/okstra_ctl/project_setup_cli.py +140 -0
  225. package/runtime/python/okstra_ctl/recap.py +22 -1
  226. package/runtime/python/okstra_ctl/reconcile.py +84 -0
  227. package/runtime/python/okstra_ctl/registry/host_registry.py +18 -1
  228. package/runtime/python/okstra_ctl/render.py +98 -32
  229. package/runtime/python/okstra_ctl/render_final_report.py +3 -7
  230. package/runtime/python/okstra_ctl/report_assembly.py +297 -7
  231. package/runtime/python/okstra_ctl/report_contract.py +30 -7
  232. package/runtime/python/okstra_ctl/report_finalize.py +206 -15
  233. package/runtime/python/okstra_ctl/report_html/common.py +2 -2
  234. package/runtime/python/okstra_ctl/report_html/render.py +8 -12
  235. package/runtime/python/okstra_ctl/report_language.py +8 -4
  236. package/runtime/python/okstra_ctl/report_narrative.py +90 -3
  237. package/runtime/python/okstra_ctl/report_projections.py +8 -2
  238. package/runtime/python/okstra_ctl/report_synthesis_packet.py +258 -1
  239. package/runtime/python/okstra_ctl/report_translation.py +2 -35
  240. package/runtime/python/okstra_ctl/report_views.py +4 -22
  241. package/runtime/python/okstra_ctl/resolve_task_key.py +13 -0
  242. package/runtime/python/okstra_ctl/rollup.py +13 -0
  243. package/runtime/python/okstra_ctl/run.py +639 -138
  244. package/runtime/python/okstra_ctl/run_audit.py +13 -0
  245. package/runtime/python/okstra_ctl/run_index_row.py +0 -12
  246. package/runtime/python/okstra_ctl/seeding.py +21 -11
  247. package/runtime/python/okstra_ctl/sequence.py +1 -1
  248. package/runtime/python/okstra_ctl/session.py +64 -14
  249. package/runtime/python/okstra_ctl/set_work_status.py +18 -0
  250. package/runtime/python/okstra_ctl/stage_integrate.py +15 -1
  251. package/runtime/python/okstra_ctl/stage_ledger.py +1 -1
  252. package/runtime/python/okstra_ctl/stage_map.py +57 -11
  253. package/runtime/python/okstra_ctl/stage_map_cli.py +83 -0
  254. package/runtime/python/okstra_ctl/stage_map_view.py +65 -0
  255. package/runtime/python/okstra_ctl/stage_targets.py +3 -12
  256. package/runtime/python/okstra_ctl/task_list_cli.py +138 -0
  257. package/runtime/python/okstra_ctl/task_show_cli.py +66 -0
  258. package/runtime/python/okstra_ctl/task_target.py +4 -16
  259. package/runtime/python/okstra_ctl/team.py +49 -2
  260. package/runtime/python/okstra_ctl/time_report.py +17 -2
  261. package/runtime/python/okstra_ctl/usage_report.py +11 -0
  262. package/runtime/python/okstra_ctl/user_response.py +55 -218
  263. package/runtime/python/okstra_ctl/user_response_values.py +242 -0
  264. package/runtime/python/okstra_ctl/validation_contract.py +3 -0
  265. package/runtime/python/okstra_ctl/verification_target.py +68 -0
  266. package/runtime/python/okstra_ctl/wizard.py +457 -92
  267. package/runtime/python/okstra_ctl/worker_artifacts.py +75 -16
  268. package/runtime/python/okstra_ctl/worker_audit_check.py +22 -0
  269. package/runtime/python/okstra_ctl/worker_dispatch.py +21 -0
  270. package/runtime/python/okstra_ctl/worker_liveness.py +33 -0
  271. package/runtime/python/okstra_ctl/worker_prompt_body.py +15 -2
  272. package/runtime/python/okstra_ctl/worker_prompt_contract.py +98 -7
  273. package/runtime/python/okstra_ctl/worker_prompt_headers.py +24 -2
  274. package/runtime/python/okstra_ctl/worker_prompt_policy.py +18 -3
  275. package/runtime/python/okstra_ctl/worker_request.py +2 -1
  276. package/runtime/python/okstra_ctl/worker_runner.py +16 -9
  277. package/runtime/python/okstra_ctl/worker_state.py +16 -1
  278. package/runtime/python/okstra_ctl/workflow.py +18 -1
  279. package/runtime/python/okstra_ctl/worktree/__init__.py +92 -0
  280. package/runtime/python/okstra_ctl/worktree/cleanliness.py +89 -0
  281. package/runtime/python/okstra_ctl/worktree/decisions.py +127 -0
  282. package/runtime/python/okstra_ctl/worktree/git_ops.py +165 -0
  283. package/runtime/python/okstra_ctl/worktree/linking.py +249 -0
  284. package/runtime/python/okstra_ctl/worktree/naming.py +91 -0
  285. package/runtime/python/okstra_ctl/worktree/provision.py +385 -0
  286. package/runtime/python/okstra_ctl/worktree/sync_config.py +181 -0
  287. package/runtime/python/okstra_ctl/worktree_cli.py +75 -0
  288. package/runtime/python/okstra_ctl/worktree_lookup_cli.py +39 -0
  289. package/runtime/python/okstra_ctl/worktree_registry.py +7 -0
  290. package/runtime/python/okstra_ctl/worktree_status_cli.py +53 -0
  291. package/runtime/python/okstra_ctl/write_policy.py +90 -213
  292. package/runtime/python/okstra_project/__init__.py +0 -4
  293. package/runtime/python/okstra_project/dirs.py +2 -2
  294. package/runtime/python/okstra_project/phase_pointer.py +84 -0
  295. package/runtime/python/okstra_project/slug.py +24 -0
  296. package/runtime/python/okstra_project/state.py +22 -230
  297. package/runtime/python/okstra_token_usage/claude.py +9 -1
  298. package/runtime/python/okstra_token_usage/cli.py +3 -1
  299. package/runtime/python/okstra_token_usage/collect.py +71 -10
  300. package/runtime/python/okstra_token_usage/cursor.py +2 -0
  301. package/runtime/python/okstra_token_usage/grok.py +1 -5
  302. package/runtime/python/okstra_token_usage/paths.py +26 -0
  303. package/runtime/python/okstra_token_usage/pricing.py +19 -7
  304. package/runtime/schemas/convergence-critic-results-v1.0.schema.json +5 -0
  305. package/runtime/schemas/execution-manifest-v2.schema.json +10 -10
  306. package/runtime/schemas/final-report-v2.0.schema.json +9 -26
  307. package/runtime/schemas/final-report-v3.0.schema.json +173 -41
  308. package/runtime/schemas/report-narrative-v3.0.schema.json +3 -2
  309. package/runtime/skills/okstra-brief-gen/SKILL.md +35 -2
  310. package/runtime/skills/okstra-container-build/SKILL.md +16 -47
  311. package/runtime/skills/okstra-inspect/facets/history.md +1 -1
  312. package/runtime/skills/okstra-inspect/facets/status.md +7 -6
  313. package/runtime/skills/okstra-pr-gen/SKILL.md +1 -1
  314. package/runtime/skills/okstra-run/SKILL.md +7 -5
  315. package/runtime/templates/report-writer-prompt-preamble.md +1 -1
  316. package/runtime/templates/reports/brief.template.md +6 -2
  317. package/runtime/templates/reports/error-analysis-input.template.md +2 -0
  318. package/runtime/templates/reports/final-verification-input.template.md +2 -0
  319. package/runtime/templates/reports/implementation-input.template.md +7 -1
  320. package/runtime/templates/reports/implementation-planning-input.template.md +4 -0
  321. package/runtime/templates/reports/quick-input.template.md +2 -0
  322. package/runtime/templates/reports/release-handoff-input.template.md +6 -1
  323. package/runtime/templates/reports/report.js +20 -3
  324. package/runtime/templates/reports/schedule.template.md +2 -0
  325. package/runtime/templates/reports/settings.template.json +0 -10
  326. package/runtime/templates/reports/task-brief.template.md +3 -0
  327. package/runtime/templates/reports/user-response.template.md +7 -3
  328. package/runtime/validators/checks/fixtures-01.py +57 -0
  329. package/runtime/validators/checks/fixtures-02.py +565 -0
  330. package/runtime/validators/checks/runners-01.py +108 -0
  331. package/runtime/validators/checks/validate-assets-01.py +60 -0
  332. package/runtime/validators/checks/validate-prompt-metadata-01.py +261 -0
  333. package/runtime/validators/checks/validate-tasks-01.py +46 -0
  334. package/runtime/validators/checks/validate-tasks-02.py +85 -0
  335. package/runtime/validators/checks/validate-tasks-03.py +61 -0
  336. package/runtime/validators/checks/validate-tasks-04.py +118 -0
  337. package/runtime/validators/forbidden_actions.py +73 -3
  338. package/runtime/validators/lib/common.sh +5 -0
  339. package/runtime/validators/lib/fixtures.sh +7 -591
  340. package/runtime/validators/lib/paths.sh +13 -0
  341. package/runtime/validators/lib/runners.sh +6 -104
  342. package/runtime/validators/lib/summary.sh +1 -1
  343. package/runtime/validators/lib/validate-assets.sh +6 -56
  344. package/runtime/validators/lib/validate-prompt-metadata.sh +6 -257
  345. package/runtime/validators/lib/validate-tasks.sh +9 -294
  346. package/runtime/validators/validate-implementation-plan-stages.py +4 -4
  347. package/runtime/validators/validate-run.py +1369 -2654
  348. package/runtime/validators/validate-workflow.sh +56 -16
  349. package/runtime/validators/validate_improvement_report.py +2 -1
  350. package/runtime/validators/validate_session_conformance.py +295 -49
  351. package/dist/commands/execute/agent-prompt.d.mts +0 -1
  352. package/dist/commands/execute/agent-prompt.mjs +0 -24
  353. package/dist/commands/execute/agent-prompt.mjs.map +0 -1
  354. package/dist/commands/execute/codex-dispatch.d.mts +0 -3
  355. package/dist/commands/execute/codex-dispatch.mjs +0 -6
  356. package/dist/commands/execute/codex-dispatch.mjs.map +0 -1
  357. package/dist/commands/execute/codex-run.d.mts +0 -3
  358. package/dist/commands/execute/codex-run.mjs +0 -62
  359. package/dist/commands/execute/codex-run.mjs.map +0 -1
  360. package/dist/commands/execute/convergence.d.mts +0 -1
  361. package/dist/commands/execute/convergence.mjs +0 -38
  362. package/dist/commands/execute/convergence.mjs.map +0 -1
  363. package/dist/commands/execute/error-log.d.mts +0 -1
  364. package/dist/commands/execute/error-log.mjs +0 -18
  365. package/dist/commands/execute/error-log.mjs.map +0 -1
  366. package/dist/commands/execute/git-reconcile.d.mts +0 -1
  367. package/dist/commands/execute/git-reconcile.mjs +0 -30
  368. package/dist/commands/execute/git-reconcile.mjs.map +0 -1
  369. package/dist/commands/execute/handoff.d.mts +0 -1
  370. package/dist/commands/execute/handoff.mjs +0 -31
  371. package/dist/commands/execute/handoff.mjs.map +0 -1
  372. package/dist/commands/execute/incremental-carry.d.mts +0 -1
  373. package/dist/commands/execute/incremental-carry.mjs +0 -20
  374. package/dist/commands/execute/incremental-carry.mjs.map +0 -1
  375. package/dist/commands/execute/incremental-scope.d.mts +0 -1
  376. package/dist/commands/execute/incremental-scope.mjs +0 -29
  377. package/dist/commands/execute/incremental-scope.mjs.map +0 -1
  378. package/dist/commands/execute/integrate-stages.d.mts +0 -1
  379. package/dist/commands/execute/integrate-stages.mjs +0 -24
  380. package/dist/commands/execute/integrate-stages.mjs.map +0 -1
  381. package/dist/commands/execute/pane-title.d.mts +0 -1
  382. package/dist/commands/execute/pane-title.mjs +0 -20
  383. package/dist/commands/execute/pane-title.mjs.map +0 -1
  384. package/dist/commands/execute/plan-items.d.mts +0 -1
  385. package/dist/commands/execute/plan-items.mjs +0 -9
  386. package/dist/commands/execute/plan-items.mjs.map +0 -1
  387. package/dist/commands/execute/plan-validate.d.mts +0 -1
  388. package/dist/commands/execute/plan-validate.mjs +0 -68
  389. package/dist/commands/execute/plan-validate.mjs.map +0 -1
  390. package/dist/commands/execute/plan-verify.d.mts +0 -1
  391. package/dist/commands/execute/plan-verify.mjs +0 -43
  392. package/dist/commands/execute/plan-verify.mjs.map +0 -1
  393. package/dist/commands/execute/spawn-followups.d.mts +0 -1
  394. package/dist/commands/execute/spawn-followups.mjs +0 -22
  395. package/dist/commands/execute/spawn-followups.mjs.map +0 -1
  396. package/dist/commands/execute/team.d.mts +0 -3
  397. package/dist/commands/execute/team.mjs +0 -66
  398. package/dist/commands/execute/team.mjs.map +0 -1
  399. package/dist/commands/execute/token-usage.d.mts +0 -1
  400. package/dist/commands/execute/token-usage.mjs +0 -19
  401. package/dist/commands/execute/token-usage.mjs.map +0 -1
  402. package/dist/commands/execute/worker-audit-check.d.mts +0 -1
  403. package/dist/commands/execute/worker-audit-check.mjs +0 -34
  404. package/dist/commands/execute/worker-audit-check.mjs.map +0 -1
  405. package/dist/commands/execute/worker-dispatch.d.mts +0 -7
  406. package/dist/commands/execute/worker-dispatch.mjs +0 -64
  407. package/dist/commands/execute/worker-dispatch.mjs.map +0 -1
  408. package/dist/commands/execute/worker-state.d.mts +0 -1
  409. package/dist/commands/execute/worker-state.mjs +0 -28
  410. package/dist/commands/execute/worker-state.mjs.map +0 -1
  411. package/dist/commands/execute/worktree-lookup.d.mts +0 -1
  412. package/dist/commands/execute/worktree-lookup.mjs +0 -92
  413. package/dist/commands/execute/worktree-lookup.mjs.map +0 -1
  414. package/dist/commands/execute/worktree-status.d.mts +0 -1
  415. package/dist/commands/execute/worktree-status.mjs +0 -121
  416. package/dist/commands/execute/worktree-status.mjs.map +0 -1
  417. package/dist/commands/inspect/code-review.d.mts +0 -1
  418. package/dist/commands/inspect/code-review.mjs +0 -32
  419. package/dist/commands/inspect/code-review.mjs.map +0 -1
  420. package/dist/commands/inspect/container.d.mts +0 -1
  421. package/dist/commands/inspect/container.mjs +0 -25
  422. package/dist/commands/inspect/container.mjs.map +0 -1
  423. package/dist/commands/inspect/context-cost.d.mts +0 -1
  424. package/dist/commands/inspect/context-cost.mjs +0 -25
  425. package/dist/commands/inspect/context-cost.mjs.map +0 -1
  426. package/dist/commands/inspect/design-prep.d.mts +0 -1
  427. package/dist/commands/inspect/design-prep.mjs +0 -22
  428. package/dist/commands/inspect/design-prep.mjs.map +0 -1
  429. package/dist/commands/inspect/error-report.d.mts +0 -1
  430. package/dist/commands/inspect/error-report.mjs +0 -25
  431. package/dist/commands/inspect/error-report.mjs.map +0 -1
  432. package/dist/commands/inspect/error-zip.d.mts +0 -1
  433. package/dist/commands/inspect/error-zip.mjs +0 -24
  434. package/dist/commands/inspect/error-zip.mjs.map +0 -1
  435. package/dist/commands/inspect/log-report.d.mts +0 -1
  436. package/dist/commands/inspect/log-report.mjs +0 -26
  437. package/dist/commands/inspect/log-report.mjs.map +0 -1
  438. package/dist/commands/inspect/model-io.d.mts +0 -1
  439. package/dist/commands/inspect/model-io.mjs +0 -25
  440. package/dist/commands/inspect/model-io.mjs.map +0 -1
  441. package/dist/commands/inspect/profile-show.d.mts +0 -1
  442. package/dist/commands/inspect/profile-show.mjs +0 -28
  443. package/dist/commands/inspect/profile-show.mjs.map +0 -1
  444. package/dist/commands/inspect/recap.d.mts +0 -1
  445. package/dist/commands/inspect/recap.mjs +0 -30
  446. package/dist/commands/inspect/recap.mjs.map +0 -1
  447. package/dist/commands/inspect/resolve-task-key.d.mts +0 -1
  448. package/dist/commands/inspect/resolve-task-key.mjs +0 -24
  449. package/dist/commands/inspect/resolve-task-key.mjs.map +0 -1
  450. package/dist/commands/inspect/rollup.d.mts +0 -1
  451. package/dist/commands/inspect/rollup.mjs +0 -25
  452. package/dist/commands/inspect/rollup.mjs.map +0 -1
  453. package/dist/commands/inspect/run-audit.d.mts +0 -1
  454. package/dist/commands/inspect/run-audit.mjs +0 -25
  455. package/dist/commands/inspect/run-audit.mjs.map +0 -1
  456. package/dist/commands/inspect/set-work-status.d.mts +0 -1
  457. package/dist/commands/inspect/set-work-status.mjs +0 -29
  458. package/dist/commands/inspect/set-work-status.mjs.map +0 -1
  459. package/dist/commands/inspect/stage-map.d.mts +0 -1
  460. package/dist/commands/inspect/stage-map.mjs +0 -131
  461. package/dist/commands/inspect/stage-map.mjs.map +0 -1
  462. package/dist/commands/inspect/task-list.d.mts +0 -1
  463. package/dist/commands/inspect/task-list.mjs +0 -149
  464. package/dist/commands/inspect/task-list.mjs.map +0 -1
  465. package/dist/commands/inspect/task-show.d.mts +0 -1
  466. package/dist/commands/inspect/task-show.mjs +0 -108
  467. package/dist/commands/inspect/task-show.mjs.map +0 -1
  468. package/dist/commands/inspect/time-report.d.mts +0 -1
  469. package/dist/commands/inspect/time-report.mjs +0 -24
  470. package/dist/commands/inspect/time-report.mjs.map +0 -1
  471. package/dist/commands/inspect/usage-report.d.mts +0 -1
  472. package/dist/commands/inspect/usage-report.mjs +0 -23
  473. package/dist/commands/inspect/usage-report.mjs.map +0 -1
  474. package/dist/commands/inspect/user-response.d.mts +0 -1
  475. package/dist/commands/inspect/user-response.mjs +0 -35
  476. package/dist/commands/inspect/user-response.mjs.map +0 -1
  477. package/dist/commands/inspect/worker-liveness.d.mts +0 -1
  478. package/dist/commands/inspect/worker-liveness.mjs +0 -45
  479. package/dist/commands/inspect/worker-liveness.mjs.map +0 -1
  480. package/dist/commands/lifecycle/contract-check.d.mts +0 -1
  481. package/dist/commands/lifecycle/contract-check.mjs +0 -18
  482. package/dist/commands/lifecycle/contract-check.mjs.map +0 -1
  483. package/dist/commands/lifecycle/migrate.d.mts +0 -1
  484. package/dist/commands/lifecycle/migrate.mjs +0 -30
  485. package/dist/commands/lifecycle/migrate.mjs.map +0 -1
  486. package/dist/commands/lifecycle/model.d.mts +0 -1
  487. package/dist/commands/lifecycle/model.mjs +0 -22
  488. package/dist/commands/lifecycle/model.mjs.map +0 -1
  489. package/dist/commands/manager.d.mts +0 -3
  490. package/dist/commands/manager.mjs +0 -50
  491. package/dist/commands/manager.mjs.map +0 -1
  492. package/dist/commands/report/agent-activity.d.mts +0 -1
  493. package/dist/commands/report/agent-activity.mjs +0 -20
  494. package/dist/commands/report/agent-activity.mjs.map +0 -1
  495. package/dist/commands/report/approval-decision.d.mts +0 -1
  496. package/dist/commands/report/approval-decision.mjs +0 -21
  497. package/dist/commands/report/approval-decision.mjs.map +0 -1
  498. package/dist/commands/report/design-snapshot.d.mts +0 -1
  499. package/dist/commands/report/design-snapshot.mjs +0 -19
  500. package/dist/commands/report/design-snapshot.mjs.map +0 -1
  501. package/dist/commands/report/finalize.d.mts +0 -4
  502. package/dist/commands/report/finalize.mjs +0 -64
  503. package/dist/commands/report/finalize.mjs.map +0 -1
  504. package/dist/commands/report/inject-report-index.d.mts +0 -1
  505. package/dist/commands/report/inject-report-index.mjs +0 -21
  506. package/dist/commands/report/inject-report-index.mjs.map +0 -1
  507. package/dist/commands/report/render-final-report.d.mts +0 -1
  508. package/dist/commands/report/render-final-report.mjs +0 -23
  509. package/dist/commands/report/render-final-report.mjs.map +0 -1
  510. package/dist/commands/report/render-views.d.mts +0 -1
  511. package/dist/commands/report/render-views.mjs +0 -27
  512. package/dist/commands/report/render-views.mjs.map +0 -1
  513. package/dist/commands/report/translate.d.mts +0 -1
  514. package/dist/commands/report/translate.mjs +0 -33
  515. package/dist/commands/report/translate.mjs.map +0 -1
  516. package/runtime/bin/lib/okstra/tmux-pane.sh +0 -40
  517. package/runtime/bin/lib/okstra-ctl/cmd-batch.sh +0 -59
  518. package/runtime/bin/lib/okstra-ctl/cmd-list.sh +0 -35
  519. package/runtime/bin/lib/okstra-ctl/cmd-open.sh +0 -36
  520. package/runtime/bin/lib/okstra-ctl/cmd-projects.sh +0 -26
  521. package/runtime/bin/lib/okstra-ctl/cmd-reconcile.sh +0 -29
  522. package/runtime/bin/lib/okstra-ctl/cmd-reindex.sh +0 -38
  523. package/runtime/bin/lib/okstra-ctl/cmd-rerun.sh +0 -345
  524. package/runtime/bin/lib/okstra-ctl/cmd-show.sh +0 -27
  525. package/runtime/bin/lib/okstra-ctl/cmd-tail.sh +0 -92
  526. package/runtime/bin/lib/okstra-ctl/main.sh +0 -41
  527. package/runtime/bin/lib/okstra-ctl/prepare.sh +0 -31
  528. package/runtime/bin/lib/okstra-ctl/usage.sh +0 -23
  529. package/runtime/bin/okstra-central.sh +0 -152
  530. package/runtime/bin/okstra-incremental-carry.py +0 -10
  531. package/runtime/bin/okstra-incremental-scope.py +0 -10
  532. package/runtime/bin/okstra-team-reconcile.sh +0 -36
  533. package/runtime/python/okstra_ctl/agent_prompt_cli.py +0 -1156
  534. package/runtime/python/okstra_ctl/batch.py +0 -60
  535. package/runtime/python/okstra_ctl/clarification_items.py +0 -1050
  536. package/runtime/python/okstra_ctl/container_registry.py +0 -72
  537. package/runtime/python/okstra_ctl/improvement_assignment.py +0 -61
  538. package/runtime/python/okstra_ctl/resolver.py +0 -54
  539. package/runtime/python/okstra_ctl/team_reconcile.py +0 -275
  540. package/runtime/python/okstra_ctl/tmux.py +0 -134
  541. package/runtime/python/okstra_ctl/worktree.py +0 -1099
@@ -0,0 +1,295 @@
1
+ # Coding Rules
2
+
3
+ Rules that hold for every file this repository authors. They exist because both failure modes below
4
+ have already shipped here, and both were invisible to the test suite at the time.
5
+
6
+ Two of these are enforced mechanically. The rest are review criteria and say so. A rule with no named
7
+ enforcement point is a wish, not a rule.
8
+
9
+ | Rule | Enforcement |
10
+ |---|---|
11
+ | R1 — No foreign source inside a string literal | `tests-js/coding-rules.test.mjs` (runs in `npm run check`) |
12
+ | R2 — No exception swallowed without a signal | `tests-js/coding-rules.test.mjs` |
13
+ | R3 — No untracked `TODO` / `FIXME` / `HACK` / `XXX` | `tests-js/coding-rules.test.mjs` |
14
+ | G1–G4 — Comment honesty | Code review. Not mechanical |
15
+
16
+ Scanner: [`tools/coding-rules.mjs`](../tools/coding-rules.mjs). Allowance ledger:
17
+ [`config/coding-rules-baseline.json`](../config/coding-rules-baseline.json).
18
+
19
+ ---
20
+
21
+ ## How the enforcement works: a ratchet, not a wall
22
+
23
+ At the time these rules landed the repository already violated R1 in 138 places and R2 in 21. R3 stood at zero.
24
+ All three are at zero today, but the ratchet stays — it is what holds them there.
25
+ A rule that turns the whole repository red on day one never gets switched on. So the check is a ratchet.
26
+
27
+ - `config/coding-rules-baseline.json` records the per-file violation count at landing time.
28
+ - The test fails when a file's count **exceeds** its baseline entry, or when a file with no entry
29
+ gains a violation. New code is held to zero.
30
+ - The test also fails when a file's count **drops below** its baseline entry and the baseline was not
31
+ updated. Fixing a violation must tighten the ledger in the same commit. Without this half the
32
+ ratchet does not ratchet.
33
+
34
+ After removing violations:
35
+
36
+ ```bash
37
+ node tools/coding-rules.mjs --write-baseline
38
+ ```
39
+
40
+ Commit the regenerated baseline together with the fix. Never regenerate it to make a new violation pass —
41
+ that is the one use of the flag that defeats the rule.
42
+
43
+ ---
44
+
45
+ ## R1 — No foreign source inside a string literal
46
+
47
+ **A program written in language A must not carry the source of a program in language B inside a string
48
+ literal, heredoc, or template.**
49
+
50
+ ### What it looks like
51
+
52
+ ```js
53
+ // forbidden
54
+ const SCRIPT = `
55
+ import json, sys
56
+ from okstra_project import list_project_tasks
57
+ print(json.dumps(list_project_tasks(sys.argv[1])))
58
+ `;
59
+ await runPythonSnippet({ script: SCRIPT, args: [root] });
60
+ ```
61
+
62
+ ```bash
63
+ # forbidden
64
+ python3 - "$PYTHONPATH" "$explicit" <<'PY'
65
+ from okstra_project import resolve_project_root
66
+ print(resolve_project_root(explicit_root=sys.argv[2]))
67
+ PY
68
+ ```
69
+
70
+ ### Why it is banned
71
+
72
+ Embedded source is invisible to every tool that would otherwise catch a defect in it. `tsc` sees a
73
+ string. `ruff` and `mypy` never open it. `pytest` cannot import it. Coverage reports it as one line.
74
+ The defect is not that the code is ugly — it is that **the code is unreachable by the checks the rest
75
+ of the repository relies on**, so a bug there survives a green `npm run check`.
76
+
77
+ Escapes are the second cost: `\\n` inside a template that becomes `\n` in the emitted program is a
78
+ class of bug that exists only because of the embedding.
79
+
80
+ ### What to do instead
81
+
82
+ Put the code in a real file with the right extension, so its toolchain sees it, and call it by path or
83
+ module name.
84
+
85
+ ```js
86
+ // allowed — the python lives in scripts/okstra_ctl/task_list_cli.py and is importable, testable, lintable
87
+ await runPythonModule({ module: "okstra_ctl.task_list_cli", args: [root] });
88
+ ```
89
+
90
+ ### Detected forms
91
+
92
+ | Pattern | Example |
93
+ |---|---|
94
+ | `py-heredoc` | `python3 - <<'PY'` |
95
+ | `py-dash-c` | `python3 -c "..."` |
96
+ | `py-arg-c` | `spawn("python3", ["-c", ...])` |
97
+ | `run-py-snippet` | `runPythonSnippet({ script: ... })` |
98
+ | `node-dash-e` | `node -e "..."` |
99
+
100
+ ### Not covered by this rule
101
+
102
+ - Invoking a real command with arguments — `git rev-parse HEAD`, `python3 -m okstra_ctl.run --flag v`.
103
+ A module or file reference is not embedded source.
104
+ - Prompt and report templates under `prompts/` and `templates/`. They are read by humans and models,
105
+ never executed, and are not scanned.
106
+ - A fixture file whose *content* is foreign source, when the fixture is a real file on disk. Inline
107
+ fixture strings are still violations — write the fixture to a file.
108
+
109
+ ---
110
+
111
+ ## R2 — No exception swallowed without a signal
112
+
113
+ **A handler whose body neither re-raises, nor records the failure, nor returns a value the caller can
114
+ distinguish from success, must declare itself with an `expected-miss:` tag.**
115
+
116
+ ### What it looks like
117
+
118
+ ```python
119
+ # forbidden — the row vanishes and nothing anywhere knows
120
+ try:
121
+ entry = json.loads(line)
122
+ except Exception:
123
+ pass
124
+ ```
125
+
126
+ ```js
127
+ // forbidden — same shape, and the comment makes it look considered
128
+ try {
129
+ entries.push(JSON.parse(line));
130
+ } catch {
131
+ // Drop the unparseable row.
132
+ }
133
+ ```
134
+
135
+ ### Why it is banned
136
+
137
+ A swallowed exception converts a defect into missing data. The program keeps running, the output is
138
+ wrong, and there is no line anywhere that says so. This is the most direct form of hiding a bug: the
139
+ evidence is destroyed at the moment it is produced.
140
+
141
+ The comment does not help. A comment is read by whoever opens the file; it is not read by the person
142
+ staring at output that is short by three rows.
143
+
144
+ ### What to do instead
145
+
146
+ Pick one, in order of preference:
147
+
148
+ 1. Let it propagate. If the caller cannot continue without the value, that is the correct behaviour.
149
+ 2. Record it — a counter in the return value, a `stderr` line, an entry in the run error log
150
+ ([`okstra error-log`](cli.md)). The caller can then report "3 rows skipped".
151
+ 3. If the exception genuinely marks a non-error branch, say so with the tag:
152
+
153
+ ```python
154
+ try:
155
+ (src_root / rel).stat()
156
+ except FileNotFoundError:
157
+ # expected-miss: 페이로드에 없는 파일 = orphan. 존재하지 않는 것이 정상 분기다.
158
+ orphans.append(rel)
159
+ ```
160
+
161
+ The tag is what makes the check pass. Its purpose is to force the author to answer one question in
162
+ writing: *is this an error I am ignoring, or a branch that is not an error?* Those are different, and
163
+ a bare comment does not distinguish them.
164
+
165
+ An `expected-miss:` tag whose text does not name why the absence is normal is an R2 violation that
166
+ happened to get past the scanner. Reviewers reject it under G1.
167
+
168
+ ---
169
+
170
+ ## R3 — No untracked marker
171
+
172
+ **`TODO`, `FIXME`, `HACK`, `XXX` must carry a task reference or a URL on the same line, or be removed.**
173
+
174
+ ```js
175
+ // forbidden
176
+ // TODO: handle the multi-stage case
177
+
178
+ // allowed
179
+ // TODO(dev-10174): handle the multi-stage case
180
+ ```
181
+
182
+ A marker without a reference is a defect that has been noticed, recorded where no tracker will find it,
183
+ and left. Either it is worth tracking — then track it — or it is not, and the line should go.
184
+
185
+ ---
186
+
187
+ ## G1–G4 — Comment honesty (review criteria)
188
+
189
+ These are not mechanically checkable. They are rejection criteria in code review.
190
+
191
+ ### G1 — A comment must not assert a property the code does not enforce
192
+
193
+ ```python
194
+ # forbidden — nothing in this function makes that true
195
+ def load(path: str):
196
+ # path 는 항상 절대경로다
197
+ return json.loads(open(path).read())
198
+ ```
199
+
200
+ If the property matters, enforce it (assert, validate, or type it). If it does not matter, delete the
201
+ sentence. A comment that states an unenforced invariant is worse than no comment: the next reader
202
+ writes code that depends on it.
203
+
204
+ ### G2 — A comment must not justify a duplicate instead of removing it
205
+
206
+ A real example from this repository, since removed. `src/commands/lifecycle/config.mts` carried:
207
+
208
+ > "Mirror the python resolver order without depending on it … Python remains the source of truth at run
209
+ > time; this is informational."
210
+
211
+ The comment was accurate and the code was still wrong. Two implementations of one resolution order
212
+ existed, one of them declared non-authoritative, and nothing detected the day they disagreed. The
213
+ correct change is to call the authority, not to annotate the copy — which is what
214
+ [`project_setup_cli.py`](../scripts/okstra_ctl/project_setup_cli.py) now is: one resolution, called
215
+ from every entry point that used to keep its own copy.
216
+
217
+ If a duplicate is genuinely unavoidable, the comment must name the drift detector — the test that fails
218
+ when the two diverge. No detector, no duplicate.
219
+
220
+ ### G3 — A comment must not stand in for a missing test
221
+
222
+ "이 경로는 테스트하기 어려워서 수동 확인함" records that a gap exists and closes the discussion. Write the
223
+ test, or record the gap where it will be triaged (R3 applies), but do not settle it in a comment.
224
+
225
+ ### G4 — A comment must not argue that a known defect is acceptable
226
+
227
+ The pattern: a comment explains why the wrong behaviour is fine here. It is a review conversation
228
+ compressed into a line no reviewer will see again, and it converts a bug into a documented feature
229
+ without anyone deciding to.
230
+
231
+ Say what the code does and why it is built that way. Do not argue for it. If the defect is acceptable,
232
+ that is a decision, and decisions belong in
233
+ [`<PROJECT_ROOT>/.okstra/decisions/`](architecture/storage-model.md) or an ADR — somewhere with a date
234
+ and an owner.
235
+
236
+ ---
237
+
238
+ ## What a good comment does
239
+
240
+ The rules above are all prohibitions, so state the positive form once. A comment earns its line when it
241
+ carries something the code cannot:
242
+
243
+ - **Why this and not the obvious alternative.** [`src/lib/python-helper.mts:99`](../src/lib/python-helper.mts:99)
244
+ explains that chunks are joined once because `s += chunk` is quadratic for large rendered prompts.
245
+ The code shows the how; only the comment shows the why.
246
+ - **A constraint that lives outside this file** — an upstream bug with a link, a host contract, a
247
+ protocol requirement.
248
+ - **A non-obvious consequence of an ordering.** Why this call must precede that one.
249
+
250
+ Repeating what the next line already says is filler. Delete it.
251
+
252
+ ---
253
+
254
+ ## Applying these to existing code
255
+
256
+ The baseline is not a target to preserve. Its entries are the work list.
257
+
258
+ **All three rules are at zero.** R1 started at 138, R2 at 21, R3 at zero and stayed there. The baseline
259
+ file holds no entries; the ratchet now holds every file to zero.
260
+
261
+ R1 was cleared by moving the code into files, not by loosening the rule. 44 assertion blocks came out of
262
+ `tests-e2e/*.sh` and `validators/lib/*.sh` heredocs into `tests-e2e/checks/` and `validators/checks/`,
263
+ byte-for-byte — each carries a header naming the shell line that calls it. The recurring one-liners
264
+ collapsed into `tests-e2e/lib/jsonq.py`, which replaced the same three lines of JSON-field extraction in
265
+ eight places and, unlike the inline form, exits non-zero on a missing key instead of handing the shell an
266
+ empty string. The rest were one-offs given their own file: a branch name computed through
267
+ `compute_branch_name` rather than assembled by hand, an N+1 fixture, a provider stub's recorder.
268
+
269
+ Four sites were not embedded code at all — a docstring in `forbidden_actions.py` describing the very
270
+ forms the rule bans, a markdown census fixture, and this file's own examples. Those were reworded or
271
+ split so the source no longer carries the literal token while the runtime value stays the same. The
272
+ scanner reads source text and has no waiver syntax, so quoting a banned form costs a rewording. That is
273
+ the price of a rule with no exceptions, and it is cheap.
274
+
275
+ Two extractions surfaced a fragility the heredocs had been hiding: `tests-e2e/scenario-13` and `-14` name
276
+ the repo root rather than their own directory, and `validators/lib/*.sh` took its path from whichever
277
+ caller had sourced it. Both produced an unbound variable the moment the code moved out of the string.
278
+ The e2e completion marker caught the first pair; `validators/lib` now resolves `checks/` from its own
279
+ `BASH_SOURCE` so a lib file works whether the whole validator or one contract test sourced it.
280
+
281
+ **R2 was cleared the same week.** Every handler was one of two things, and the split is the point of the
282
+ rule:
283
+
284
+ - A real swallow, fixed by recording it. The malformed `LEAD_ASSIGNMENT_JSON` / `WORKER_ASSIGNMENTS_JSON`
285
+ fallbacks in `render.py` produced a *different* roster with no way for the caller to tell; `memory.mts`
286
+ dropped truncated index rows so a Memory Book came back short and looked complete; `report.js` swallowed
287
+ a refused clipboard copy, so the button read as broken. Each now names what it lost.
288
+ - A branch that is not an error, declared with `expected-miss:`. `worker_runner`'s `ProcessLookupError`
289
+ means the group it was about to kill already exited — that is success. `install.mts` uses `fs.access`
290
+ as an existence probe, so the throw *is* the answer.
291
+
292
+ Two handlers turned out to be both, and were split: reading a previous run's team-state
293
+ (`okstra_token_usage/collect.py`) treats a missing file as normal and a corrupt one as worth saying, and
294
+ the session-jsonl reader in `claude.py` does the same with `FileNotFoundError` against every other
295
+ `OSError`. Writing the tag forces that question, which is what the rule is for.
package/docs/container.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # okstra container — CLI Reference
2
2
 
3
- > `okstra container` is a nonlinear tool that launches code from a verified task as a local docker compose group and monitors each container. Because it is a separate entry point from the phase flags in `okstra.sh`, it is documented here rather than in [cli.md](cli.md). See [project-structure-overview](project-structure-overview.md) §4.3 for the module location.
3
+ > `okstra container` is a nonlinear tool that launches code from a verified task as a local docker compose group. Because it is a separate entry point from the phase flags in `okstra.sh`, it is documented here rather than in [cli.md](cli.md). See [project-structure-overview](project-structure-overview.md) §4.3 for the module location.
4
4
 
5
5
  ---
6
6
 
7
7
  ## Overview
8
8
 
9
- - **What it is:** Deploys (`up`) the integrated code for a specific task to a task-specific docker compose container group, continuously monitors logs with a watcher for each container, and manages the lifecycle through `status`/`logs`/`stop-watcher`/`down`.
9
+ - **What it is:** Deploys (`up`) the integrated code for a specific task to a task-specific docker compose container group and manages the lifecycle through `status`/`down`.
10
10
  - **Orchestration only (does not generate files):** **Reuses** the target project's existing `docker-compose.yml`. It does not generate configuration files; if `docker-compose.yml` is missing, it reports what is missing and stops (the same applies if only a `Dockerfile` exists).
11
11
  - **Nonlinear:** This is not a phase in `PHASE_SEQUENCE`. Any task key can be launched regardless of whether it has passed verification.
12
12
  - **Single entry point:** The `/okstra-container-build` skill, `bin okstra container`, and Python `okstra_ctl.container` all converge on [`scripts/okstra_ctl/container.py`](../scripts/okstra_ctl/container.py) and its `provision_container_group`.
13
- - **Source of truth (SSOT) for container existence:** Docker labels. `registry.json` is a secondary index containing only tmux sessions/panes/findings.
13
+ - **Source of truth (SSOT) for container existence:** Docker labels.
14
14
 
15
15
  ## Prerequisites
16
16
 
@@ -21,16 +21,14 @@
21
21
  ## Command format
22
22
 
23
23
  ```
24
- okstra container <up|status|logs|stop-watcher|down> --project-root <PATH> --task-key <KEY> [--text] [options]
24
+ okstra container <up|status|down> --project-root <PATH> --task-key <KEY> [--text] [options]
25
25
  ```
26
26
 
27
27
  | sub-command | Behavior | Additional options |
28
28
  |---|---|---|
29
- | `up` | Verify stage integration → validate `docker-compose.yml` → compose env override → `docker compose -p <project> up -d` → poll health checks → start a tail/watcher pane for each container | — |
29
+ | `up` | Verify stage integration → validate `docker-compose.yml` → compose env override → `docker compose -p <project> up -d` → poll health checks | — |
30
30
  | `status` | Show the live container group status by querying Docker labels | — |
31
- | `logs` | Report the watcher directory and registered watcher entries; it does not stream Docker container logs | `--service <NAME>` (filters watcher metadata; all registered watchers when omitted) |
32
- | `stop-watcher` | Stop the watcher panes for the task (containers remain running) | — |
33
- | `down` | Tear down the container group and stop attached watchers | `--all` |
31
+ | `down` | Tear down the container group | `--all` |
34
32
 
35
33
  ## Arguments
36
34
 
@@ -40,15 +38,10 @@ Absolute path to the target project root. Required for every sub-command.
40
38
  ### `--task-key` (effectively required)
41
39
  Identifier of the task to deploy, in the form `<project-id>:<task-group>:<task-id>`. The default is an empty string, but actual operations require a valid task key.
42
40
 
43
- ### `--service` (`logs` only)
44
- `--service <NAME>` filters the returned watcher metadata by compose service name. When omitted, all registered watcher entries are returned; an unknown name produces an empty `watchers` object.
45
-
46
- The actual `logs` output from `logs_container_group()` contains `watchersDir` and registered watcher entries in `watchers`. It does not run `docker compose logs` and does not stream Docker container logs. Inspect each watcher's `findings_path` and the files beneath `watchersDir` for monitoring results.
47
-
48
41
  `--text` emits command-specific fixed labels for model-facing skills. Without it, the command preserves the full machine JSON bytes and exit codes.
49
42
 
50
43
  ### `--all` (`down` only)
51
- Clean up **all** task container groups and watchers within the current project root's `.okstra/` scope. The boundary is limited to the `<project-root>/.okstra/` prefix, so panes belonging to **other projects** in concurrent sessions are never touched. Without `--all`, a single `down` cleans up exactly the panes for the specified task.
44
+ Tear down **all** task container groups discovered under the current project root's `.okstra/` scope. Without `--all`, `down` tears down exactly the group named by `--task-key`.
52
45
 
53
46
  ## How `up` works
54
47
 
@@ -58,7 +51,6 @@ Clean up **all** task container groups and watchers within the current project r
58
51
  4. **Compose env override** — In the okstra-owned worktree, layer task overrides over `.env`, write the result to `env.override`, and pass the files in the order `--env-file <worktree .env> --env-file <env.override>` (the latter takes precedence).
59
52
  5. **Deploy** — Run `docker compose -p <project-name> ... up -d`. Obtain the service list from `docker compose config --services` (the canonical source).
60
53
  6. **Poll health checks** — Use `docker compose ps` to verify that each service has started. Success means reaching healthy for services with a health check, or `running` for services without one.
61
- 7. **Start monitoring** — If `tmux` is available, start a tail pane and watcher agent for each container in the detached session `okstra-container-<slug>`. If it is unavailable, launch only the containers and state "monitoring disabled (tmux unavailable)" in the result.
62
54
 
63
55
  ### Fixed defaults (not currently exposed as CLI flags)
64
56
 
@@ -66,19 +58,9 @@ Clean up **all** task container groups and watchers within the current project r
66
58
  |---|---|---|
67
59
  | healthcheck timeout | 120 seconds | Stop and report services that failed to start after this limit |
68
60
  | healthcheck interval | 3 seconds | Polling interval for `docker compose ps` |
69
- | watcher scan interval | 5 seconds | Interval for scanning incremental watcher logs |
70
61
 
71
62
  > These values exist as named arguments to `provision_container_group`, but because they are not exposed as CLI flags, they currently operate as fixed values.
72
63
 
73
- ## watcher (two-stage error trigger)
74
-
75
- One watcher per container runs in the detached session.
76
-
77
- 1. **Lightweight scan** — Fetch incremental logs with `docker compose logs --since` and match only regular expressions (`ERROR`/`FATAL`/`Exception`/`Traceback`/abnormal exit codes, and so on). If there are no matches, proceed to the next interval without an LLM call → zero token cost during healthy periods.
78
- 2. **Deep analysis** — Only when a pattern is detected, the watcher AI analyzes the relevant log window and appends its findings to `findings.md`. Identical error signatures are debounced (meaningful numbers such as HTTP statuses and exit codes are preserved, while only noise such as timestamps and pids is normalized). The watcher **only detects and reports**; it does not modify code or configuration.
79
-
80
- Watcher/tail panes carry only the dedicated `@okstra_container_run` tag and survive a Claude session ending — no session-end hook reclaims panes any more. Stop them with `stop-watcher` or `down`.
81
-
82
64
  ## Labels and artifacts
83
65
 
84
66
  Three labels are attached to deployed containers. The label queries used by `status`/`down` use them to locate the group.
@@ -87,16 +69,14 @@ Three labels are attached to deployed containers. The label queries used by `sta
87
69
  |---|---|
88
70
  | `okstra.task-key` | `<project-id>:<task-group>:<task-id>` |
89
71
  | `okstra.project-name` | compose project name `okstra-<proj>-<group>-<task>` |
90
- | `okstra.run-trace` | container session name (`okstra-container-<slug>`) |
72
+ | `okstra.run-trace` | run-trace slug (`okstra-container-<slug>`) |
91
73
 
92
74
  All okstra artifacts are stored under `<project-root>/.okstra/tasks/<group>/<task-id>/container/` (the original project files remain unchanged):
93
75
 
94
76
  ```
95
77
  container/
96
78
  ├── env.override # per-task variables layered over the project .env
97
- ├── registry.json # tmux sessions/panes/findings (flock-guarded secondary index)
98
- ├── deploy-state.json # compose project name, running containers, labels
99
- └── watchers/<service>-findings.md # per-watcher error analysis log
79
+ └── deploy-state.json # compose project name, running containers, labels
100
80
  ```
101
81
 
102
82
  ## Exit behavior/output
@@ -106,18 +86,12 @@ Each sub-command returns exit code 0 on success. `--text` writes its command-spe
106
86
  ## Usage examples
107
87
 
108
88
  ```bash
109
- # Deploy and start monitoring
89
+ # Deploy
110
90
  okstra container up --project-root /path/to/proj --task-key proj:auth:login-fix --text
111
91
 
112
92
  # Status
113
93
  okstra container status --project-root /path/to/proj --task-key proj:auth:login-fix
114
94
 
115
- # Filter watcher metadata for one service
116
- okstra container logs --project-root /path/to/proj --task-key proj:auth:login-fix --service api
117
-
118
- # Stop only the watcher (keep containers running)
119
- okstra container stop-watcher --project-root /path/to/proj --task-key proj:auth:login-fix
120
-
121
95
  # Tear down the group
122
96
  okstra container down --project-root /path/to/proj --task-key proj:auth:login-fix
123
97
 
@@ -7,7 +7,7 @@ Use this matrix before changing high-risk repo contracts. Update the source file
7
7
  | Add CLI flag | `src/`, `scripts/okstra_ctl/run.py`, `docs/cli.md`, `prompts/wizard/` | JS CLI tests and pytest CLI contracts |
8
8
  | Add Node subcommand | `src/cli-registry.mts`, `src/commands/`, `docs/cli.md`, `docs/project-structure-overview.md` | `tests-js/cli-registry.test.mjs` plus command-specific JS/Python tests |
9
9
  | Add public skill | `src/lib/skill-catalog.mts`, `.claude-plugin/plugin.json`, `skills/<name>/SKILL.md`, `docs/for-ai/README.md`, `docs/project-structure-overview.md`, `README.md` | `tests-js/skill-catalog.test.mjs`, `tests/contract/test_docs_runtime_contract.py` |
10
- | Change manager contract | `scripts/okstra_ctl/manager_*.py`, `src/commands/manager.mjs`, `skills/okstra-manager/SKILL.md`, `docs/for-ai/skills/okstra-manager.md`, `docs/cli.md`, `docs/architecture/storage-model.md` | `tests-js/manager.test.mjs`, `tests/test_okstra_manager_*.py` |
10
+ | Change manager contract | `scripts/okstra_ctl/manager_*.py`, `skills/okstra-manager/SKILL.md`, `docs/for-ai/skills/okstra-manager.md`, `docs/cli.md`, `docs/architecture/storage-model.md` | `tests-js/cli-wrapper-contract.test.mjs`, `tests/test_okstra_manager_*.py` |
11
11
  | Add phase | `scripts/okstra_ctl/workflow.py`, `prompts/profiles/`, `validators/`, `tests/` | workflow and validation contract tests |
12
12
  | Change worker roster | `prompts/profiles/*.md`, `scripts/okstra_ctl/workers.py`, `tests/contract/test_repo_contracts.py` | worker roster contract tests |
13
13
  | Change report section | `schemas/final-report-v2.0.schema.json`, `templates/reports/final-report-v2.template.md`, `scripts/okstra_ctl/render_final_report.py`, `validators/validate-run.py` | final-report schema, renderer, and validator tests |
@@ -7,7 +7,6 @@
7
7
  - Review calibration: [`skills/okstra-code-review/references/review-calibration.md`](../../../skills/okstra-code-review/references/review-calibration.md)
8
8
  - Target core (CLI): [`scripts/okstra_ctl/code_review_target.py`](../../../scripts/okstra_ctl/code_review_target.py)
9
9
  - Review path core: [`scripts/okstra_ctl/code_review_paths.py`](../../../scripts/okstra_ctl/code_review_paths.py)
10
- - Node wrapper: [`src/commands/inspect/code-review.mjs`](../../../src/commands/inspect/code-review.mjs)
11
10
  - Rules the review applies: [`prompts/coding-preflight/`](../../../prompts/coding-preflight/)
12
11
 
13
12
  ## Purpose
@@ -3,24 +3,21 @@
3
3
  ## Source
4
4
 
5
5
  - Skill source: [`skills/okstra-container-build/SKILL.md`](../../../skills/okstra-container-build/SKILL.md)
6
- - container CLI wrapper: [`src/commands/inspect/container.mjs`](../../../src/commands/inspect/container.mjs)
6
+ - container CLI: [`scripts/okstra_ctl/container.py`](../../../scripts/okstra_ctl/container.py)
7
7
  - container runtime: [`scripts/okstra_ctl/container.py`](../../../scripts/okstra_ctl/container.py)
8
- - container registry: [`scripts/okstra_ctl/container_registry.py`](../../../scripts/okstra_ctl/container_registry.py)
9
8
  - stage integration gate: [`scripts/okstra_ctl/stage_targets.py`](../../../scripts/okstra_ctl/stage_targets.py)
10
9
 
11
10
  ## Purpose
12
11
 
13
- `okstra-container-build` manages a user-test container group using the `docker-compose.yml` in an implementation task worktree. okstra labels the compose group with the task/run trace and observes logs/status through a tmux watcher pane.
12
+ `okstra-container-build` manages a user-test container group using the `docker-compose.yml` in an implementation task worktree. okstra labels the compose group with the task/run trace so later sub-commands can find it.
14
13
 
15
14
  ## sub-command
16
15
 
17
16
  | Sub-command | Role | side effect |
18
17
  |---|---|---|
19
- | `up` | Integrate the implementation stages into the task worktree, then `docker compose up -d`, poll healthchecks, attach the watcher pane | create/start containers, create watcher pane |
20
- | `status` | Check running containers (by label query) plus watcher metadata | read |
21
- | `logs` | Point at the watcher findings dir and watcher entries | read |
22
- | `stop-watcher` | Reap the watcher/tail tmux panes only | keep containers, remove panes |
23
- | `down` | Remove the container group by label query, reap orphan watcher panes | stop/remove containers |
18
+ | `up` | Integrate the implementation stages into the task worktree, then `docker compose up -d`, poll healthchecks | create/start containers |
19
+ | `status` | Check running containers (by label query) | read |
20
+ | `down` | Remove the container group by label query | stop/remove containers |
24
21
 
25
22
  ## Preflight
26
23
 
@@ -55,8 +52,6 @@ Clear verbs:
55
52
 
56
53
  - "bring up/deploy", "up": `up`
57
54
  - "status": `status`
58
- - "logs": `logs`
59
- - "stop watcher", "stop-watcher": `stop-watcher`
60
55
  - "tear down", "down": `down`
61
56
 
62
57
  If ambiguous, show the full facet list and offer an Enter directly option. When multiple facets are in one message, run Step 0 once and execute the sub-commands sequentially.
@@ -82,7 +77,7 @@ Handling failure messages:
82
77
  - `final-verification(whole-task): stage N not done`: tell the user to finish that stage via implementation.
83
78
  - healthcheck failure: relay the failing service and the `docker compose ... logs` line the CLI provides, verbatim.
84
79
 
85
- On success, read the fixed `Service` and `Watcher` rows, then run the `status --text` command below and read its numbered container `ports` fields. Tell the user that management from here is via `okstra container status <task-key>` and `down <task-key>`. For *what to verify* once it is up, point to the implementation report's §5.7.9 Manual User Test (Draft) — those steps and expected results are the manual test script for this build.
80
+ On success, read the fixed `Service` rows, then run the `status --text` command below and read its numbered container `ports` fields. Tell the user that management from here is via `okstra container status <task-key>` and `down <task-key>`. For *what to verify* once it is up, point to the implementation report's §5.7.9 Manual User Test (Draft) — those steps and expected results are the manual test script for this build.
86
81
 
87
82
  ## status
88
83
 
@@ -96,35 +91,8 @@ Fixed fields:
96
91
 
97
92
  - `projectName`: compose project name
98
93
  - `containers`: running containers found by run-trace label
99
- - `watchers`: watcher metadata from the registry
100
94
 
101
- The `containers` label query is authoritative for whether it is alive. The watcher registry can lag. If `containers` is empty, say the group is not running and offer `up`.
102
-
103
- ## logs
104
-
105
- Run:
106
-
107
- ```bash
108
- okstra container logs --project-root <projectRoot> --task-key <task-key> --text
109
- ```
110
-
111
- service scope:
112
-
113
- ```bash
114
- okstra container logs --project-root <projectRoot> --task-key <task-key> --service <service> --text
115
- ```
116
-
117
- Show the fixed `Watchers dir` and numbered `Watchers` rows. The live stream is in the tmux watcher pane, not a file. If raw compose logs are needed, get `Project name` from `status`, then tell the user they can run `docker compose -p <projectName> logs -f <service>`.
118
-
119
- ## stop-watcher
120
-
121
- Run:
122
-
123
- ```bash
124
- okstra container stop-watcher --project-root <projectRoot> --task-key <task-key> --text
125
- ```
126
-
127
- Remove only the watcher/tail panes and keep the containers. Summarize the fixed `Reaped panes` and `Note` rows. If the user actually intends to bring the containers down, route to `down`.
95
+ The label query is authoritative for whether it is alive. If `containers` is empty, say the group is not running and offer `up`. To follow a service's live logs, get `Project name` from `status`, then tell the user they can run `docker compose -p <projectName> logs -f <service>`.
128
96
 
129
97
  ## down
130
98
 
@@ -142,7 +110,7 @@ okstra container down --project-root <projectRoot> --all --text
142
110
 
143
111
  A single-task down is fine to run after resolving the task-key. `--all` takes down every okstra container group in the project, so confirm with the user before running it.
144
112
 
145
- Report the fixed `Downed` and `Orphan panes reaped` rows. Show each project name and the reaped panes.
113
+ Report the fixed `Downed` rows. Show each torn-down project name.
146
114
 
147
115
  ## Output rules
148
116
 
@@ -157,6 +125,5 @@ Report the fixed `Downed` and `Orphan panes reaped` rows. Show each project name
157
125
  - Trying to start the Docker daemon yourself.
158
126
  - Guessing the cause of an `up` failure and editing the compose file.
159
127
  - Dressing up a partial-stage task as deployable.
160
- - Judging a container as alive from the watcher registry alone.
161
128
  - Running `down --all` without user confirmation.
162
129
  - Overriding the CLI result arbitrarily with a raw docker query.
@@ -5,10 +5,10 @@
5
5
  - Skill source: [`skills/okstra-inspect/SKILL.md`](../../../skills/okstra-inspect/SKILL.md)
6
6
  - Facet bodies: `skills/okstra-inspect/facets/<sub-command>.md` — the skill is a thin core (preflight + dispatch + shared rules); each sub-command's full procedure is a lazily loaded facet file, guarded by `tests/contract/test_okstra_inspect_facets.py`
7
7
  - CLI registry: [`src/cli-registry.mjs`](../../../src/cli-registry.mjs)
8
- - context-cost CLI: `src/commands/inspect/context-cost.mjs`
9
- - time-report CLI: `src/commands/inspect/time-report.mjs`
10
- - log-report CLI: `src/commands/inspect/log-report.mjs`
11
- - error-report CLI: `src/commands/inspect/error-report.mjs`
8
+ - context-cost CLI: `scripts/okstra_ctl/context_cost.py`
9
+ - time-report CLI: `scripts/okstra_ctl/time_report.py`
10
+ - log-report CLI: `scripts/okstra_ctl/log_report.py`
11
+ - error-report CLI: `scripts/okstra_ctl/error_report.py`
12
12
  - container is a separate skill: [`okstra-container-build.md`](okstra-container-build.md)
13
13
 
14
14
  ## Purpose
@@ -1,6 +1,6 @@
1
1
  # okstra-manager
2
2
 
3
- Use this to bundle okstra tasks across multiple projects into a single manager-owned context. The authoritative contract is [`skills/okstra-manager/SKILL.md`](../../../skills/okstra-manager/SKILL.md); the CLI implementation is [`src/commands/manager.mjs`](../../../src/commands/manager.mjs) and [`scripts/okstra_ctl/manager_cli.py`](../../../scripts/okstra_ctl/manager_cli.py).
3
+ Use this to bundle okstra tasks across multiple projects into a single manager-owned context. The authoritative contract is [`skills/okstra-manager/SKILL.md`](../../../skills/okstra-manager/SKILL.md); the CLI implementation is [`scripts/okstra_ctl/manager_cli.py`](../../../scripts/okstra_ctl/manager_cli.py).
4
4
 
5
5
  ## When to Use
6
6
 
@@ -60,7 +60,7 @@ A segment whose slug is empty (e.g. a non-ASCII task-group/task-id) uses a `u-<s
60
60
  `task run` does not run the child work directly; it prepares a launch packet. The key fixed fields of the returned packet:
61
61
 
62
62
  - `Task key`: the child's `project-id:task-group:task-id` (the public child-identity key — also recorded on the `child-launch-prepared` event)
63
- - `Backend`: `tmux-child-lead` if `$TMUX` is present, otherwise `subagent-child-lead`
63
+ - `Backend`: always `subagent-child-lead`
64
64
  - `Worker dispatch backend`: always `subagent` in v1
65
65
  - `Project root`: the child project root
66
66
  - `Context path`: the manager child context markdown
@@ -4,7 +4,6 @@
4
4
 
5
5
  - Skill source: [`skills/okstra-rollup/SKILL.md`](../../../skills/okstra-rollup/SKILL.md)
6
6
  - aggregation core (CLI): [`scripts/okstra_ctl/rollup.py`](../../../scripts/okstra_ctl/rollup.py)
7
- - Node wrapper: [`src/commands/inspect/rollup.mjs`](../../../src/commands/inspect/rollup.mjs)
8
7
  - reused single-task aggregators: [`scripts/okstra_ctl/time_report.py`](../../../scripts/okstra_ctl/time_report.py), [`scripts/okstra_ctl/error_log_core.py`](../../../scripts/okstra_ctl/error_log_core.py)
9
8
  - catalog enumeration helper: [`scripts/okstra_project/state.py`](../../../scripts/okstra_project/state.py) (`list_project_tasks`)
10
9
  - unit tests: [`tests/inspect/test_okstra_rollup.py`](../../../tests/inspect/test_okstra_rollup.py)
@@ -213,7 +213,7 @@ Read the scope and path from the persist action of `okstra wizard outcome`, not
213
213
 
214
214
  ## Okstra lead takeover
215
215
 
216
- After render-bundle, read `<INSTRUCTION_SET_PATH>/lead-execution-prompt.md` verbatim and proceed from Phase 1 in that prompt's order. Before any in-run approval or clarification question, follow the lead contract "User confirmation before an approval blocker": read cited plan items, worker findings, and files, then ask in the user's language with each option's outcome.
216
+ After render-bundle, read the run manifest's `resources.leadExecutionPromptPath` (project-relative, under `runs/<task-type>/prompts/`), read that file verbatim, and proceed from Phase 1 in that prompt's order. Before any in-run approval or clarification question, follow the lead contract "User confirmation before an approval blocker": read cited plan items, worker findings, and files, then ask in the user's language with each option's outcome.
217
217
 
218
218
  Inform the user on one line.
219
219
 
@@ -221,7 +221,7 @@ Inform the user on one line.
221
221
  Took over as Okstra lead (`<host-runtime>`) for `<taskKey>` (`<task-type>`). Run dir: `<RUN_DIR_RELATIVE_PATH>`. Beginning Phase 1 (context loading).
222
222
  ```
223
223
 
224
- For a single-element chain, the end of Step 6 is the end of the run. Step 7 below applies only when the `chain-stages` CSV has 2 or more elements. When the run is over, close with the user's next action — one command they can run now. A prohibition is not a next action. After `implementation-planning`: open approval blockers → `/okstra-user-response`; a recorded `accept-risk` / `select` / `answer` is not an open blocker; awaiting approval → `/okstra-run` → `implementation` or `--approve` (do not start another planning run); `validate-run` failed → one-line cause then `/okstra-run` or `/okstra-inspect recap`; pointer `ready` → `/okstra-run` for that phase.
224
+ For a single-element chain, the end of Step 6 is the end of the run. Step 7 below applies only when the `chain-stages` CSV has 2 or more elements. When the run is over, close with the user's next action — one command they can run now. A prohibition is not a next action. Take it from the `report-finalize` result: `nextCommand` (`{command, note}`) is the table below already applied, and `nextRecommendedPhase` (`phase`, `status`, `rationale`) is what it was applied to — do not re-derive either from the report, and treat `nextRecommendedPhaseError` as "pointer unreadable", said in one line before the `validate-run` branch. After `implementation-planning`: open approval blockers → `/okstra-user-response`; a recorded `accept-risk` / `select` / `answer` is not an open blocker; no open approval blocker → `/okstra-run` → `implementation` or `--approve` (do not start another planning run; do not say `/okstra-inspect`). For every other task type: pointer `ready` → `/okstra-run` for that phase; `validate-run` failed → one-line cause then `/okstra-run`; otherwise `/okstra-inspect status`.
225
225
 
226
226
  ## implementation unattended chaining (chain-stages)
227
227
 
@@ -230,7 +230,7 @@ When `task-type == implementation` and the render-args `chain-stages` CSV has 2
230
230
  1. Re-call render-bundle with the same arguments but `--stage N` (the base commit is auto-computed by prepare from the predecessor's done `head_commit` — do not pass it by hand). The `io`-only conformance waiver·concurrent-run·git-reconcile gates apply identically to each stage's render-bundle.
231
231
  2. As in Step 6, become the host-native Okstra lead and run that stage's Phase 1–7 inline. Phase 6's lead persistence appends that stage's `status:"done"` row to `runs/<plan-task-key>/consumers.jsonl`.
232
232
  3. After confirming the `done` row was written, move to the next stage. Clean up context (leftover panes·finished teammates) at each stage boundary. A `status:"failed"` row in place of `done` means the stage ended `FAIL` — stop the queue per the FAIL branch below.
233
- 4. One-line report at each stage start/finish: `stage N/<total> start` / `stage N done → next K`.
233
+ 4. One-line report at each stage start/finish: `stage N start` / `stage N done → next K`.
234
234
 
235
235
  Once the whole queue is consumed, end the chain and report completion.
236
236
 
@@ -4,7 +4,6 @@
4
4
 
5
5
  - Skill source: [`skills/okstra-user-response/SKILL.md`](../../../skills/okstra-user-response/SKILL.md)
6
6
  - Response core: [`scripts/okstra_ctl/user_response.py`](../../../scripts/okstra_ctl/user_response.py)
7
- - Node wrapper: [`src/commands/inspect/user-response.mts`](../../../src/commands/inspect/user-response.mts)
8
7
 
9
8
  ## Purpose
10
9
 
@@ -82,7 +82,7 @@ Therefore, "P1 convergence improvement" in this document does not change the tas
82
82
 
83
83
  `prepare_task_bundle()` writes the instruction set and manifest-related files sequentially.
84
84
 
85
- - Instruction set: `analysis-profile.md`, `analysis-material.md`, `task-brief.md`, optional carry-in/directive, `reference-expectations.md`, `final-report-template.md`, canonical `lead-execution-prompt.md`, and the prompt snapshot.
85
+ - Instruction set: `analysis-profile.md`, `analysis-material.md`, `task-brief.md`, optional carry-in/directive, `reference-expectations.md`, `final-report-template.md`. The lead prompt is written separately, to `runs/<task-type>/prompts/lead-execution-prompt-<task-type>-<seq>.md`.
86
86
  - Manifest/discovery: `team-state`, `task-manifest`, `task-index`, `run-manifest`, `timeline`, task catalog, and latest task.
87
87
 
88
88
  This serial rendering has room for improvement, but it is generally cheaper than external worker dispatch. Render parallelization is therefore not the first priority.