okstra 0.180.0 → 0.184.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 (233) hide show
  1. package/README.md +1 -1
  2. package/dist/cli-registry.mjs +16 -2
  3. package/dist/cli-registry.mjs.map +1 -1
  4. package/dist/commands/execute/render-bundle.d.mts +4 -2
  5. package/dist/commands/execute/render-bundle.mjs +46 -5
  6. package/dist/commands/execute/render-bundle.mjs.map +1 -1
  7. package/dist/commands/execute/run.mjs +11 -3
  8. package/dist/commands/execute/run.mjs.map +1 -1
  9. package/dist/commands/inspect/model-io.d.mts +1 -0
  10. package/dist/commands/inspect/model-io.mjs +25 -0
  11. package/dist/commands/inspect/model-io.mjs.map +1 -0
  12. package/dist/commands/inspect/stage-map.mjs +29 -8
  13. package/dist/commands/inspect/stage-map.mjs.map +1 -1
  14. package/dist/commands/inspect/task-list.mjs +52 -6
  15. package/dist/commands/inspect/task-list.mjs.map +1 -1
  16. package/dist/commands/inspect/user-response.mjs +14 -4
  17. package/dist/commands/inspect/user-response.mjs.map +1 -1
  18. package/dist/commands/lifecycle/check-project.d.mts +1 -0
  19. package/dist/commands/lifecycle/check-project.mjs +69 -50
  20. package/dist/commands/lifecycle/check-project.mjs.map +1 -1
  21. package/dist/commands/lifecycle/contract-check.d.mts +1 -0
  22. package/dist/commands/lifecycle/contract-check.mjs +18 -0
  23. package/dist/commands/lifecycle/contract-check.mjs.map +1 -0
  24. package/dist/commands/lifecycle/preflight.mjs +154 -51
  25. package/dist/commands/lifecycle/preflight.mjs.map +1 -1
  26. package/dist/commands/pr/pr.d.mts +1 -0
  27. package/dist/commands/pr/pr.mjs +19 -1
  28. package/dist/commands/pr/pr.mjs.map +1 -1
  29. package/dist/commands/report/agent-activity.mjs +2 -2
  30. package/dist/commands/report/translate.mjs +3 -0
  31. package/dist/commands/report/translate.mjs.map +1 -1
  32. package/dist/lib/host-registry-client.mjs +13 -9
  33. package/dist/lib/host-registry-client.mjs.map +1 -1
  34. package/docs/architecture.md +13 -2
  35. package/docs/cli.md +31 -15
  36. package/docs/container.md +6 -4
  37. package/docs/contributor-change-matrix.md +1 -1
  38. package/docs/for-ai/README.md +2 -2
  39. package/docs/for-ai/skills/okstra-brief-gen.md +5 -3
  40. package/docs/for-ai/skills/okstra-code-review.md +4 -4
  41. package/docs/for-ai/skills/okstra-container-build.md +20 -17
  42. package/docs/for-ai/skills/okstra-inspect.md +20 -23
  43. package/docs/for-ai/skills/okstra-manager.md +19 -18
  44. package/docs/for-ai/skills/okstra-memory.md +2 -2
  45. package/docs/for-ai/skills/okstra-pr-gen.md +3 -3
  46. package/docs/for-ai/skills/okstra-rollup.md +14 -13
  47. package/docs/for-ai/skills/okstra-run.md +7 -3
  48. package/docs/for-ai/skills/okstra-schedule-gen.md +15 -18
  49. package/docs/for-ai/skills/okstra-setup.md +7 -7
  50. package/docs/for-ai/skills/okstra-usage.md +5 -4
  51. package/docs/for-ai/skills/okstra-user-response.md +50 -32
  52. package/docs/project-structure-overview.md +30 -27
  53. package/docs/task-process/README.md +1 -1
  54. package/docs/task-process/common-flow.md +2 -3
  55. package/docs/task-process/error-analysis.md +3 -4
  56. package/docs/task-process/final-verification.md +2 -3
  57. package/docs/task-process/implementation-planning.md +2 -3
  58. package/docs/task-process/implementation.md +9 -7
  59. package/docs/task-process/release-handoff.md +3 -4
  60. package/docs/task-process/requirements-discovery.md +3 -4
  61. package/package.json +1 -1
  62. package/runtime/BUILD.json +2 -2
  63. package/runtime/agents/workers/claude-worker.md +4 -4
  64. package/runtime/agents/workers/report-writer-worker.md +3 -3
  65. package/runtime/agents/workers/translator-worker.md +5 -13
  66. package/runtime/bin/okstra-error-log.py +51 -11
  67. package/runtime/bin/okstra-report-translate.py +210 -23
  68. package/runtime/prompts/host-orchestration/implementation.md +1 -1
  69. package/runtime/prompts/launch.template.md +11 -14
  70. package/runtime/prompts/lead/context-loader.md +41 -141
  71. package/runtime/prompts/lead/convergence.md +8 -6
  72. package/runtime/prompts/lead/okstra-lead-contract.md +26 -36
  73. package/runtime/prompts/lead/plan-body-verification.md +211 -30
  74. package/runtime/prompts/lead/report-writer.md +23 -4
  75. package/runtime/prompts/lead/team-contract.md +8 -53
  76. package/runtime/prompts/profiles/_coding-conventions-preflight.md +3 -2
  77. package/runtime/prompts/profiles/_common-contract.md +1 -1
  78. package/runtime/prompts/profiles/_implementation-diff-review.md +1 -1
  79. package/runtime/prompts/profiles/_implementation-executor.md +1 -0
  80. package/runtime/prompts/profiles/_implementation-verifier.md +4 -4
  81. package/runtime/prompts/profiles/final-verification.md +1 -1
  82. package/runtime/prompts/profiles/implementation-planning.md +17 -13
  83. package/runtime/prompts/profiles/release-handoff.md +0 -1
  84. package/runtime/prompts/wizard/prompts.ko.json +7 -11
  85. package/runtime/python/okstra_ctl/adapters/hosts/capability_adapter.py +69 -17
  86. package/runtime/python/okstra_ctl/adapters/hosts/claude-code/adapter.py +13 -4
  87. package/runtime/python/okstra_ctl/adapters/hosts/claude-code/relay.md +6 -1
  88. package/runtime/python/okstra_ctl/adapters/hosts/codex/adapter.py +2 -2
  89. package/runtime/python/okstra_ctl/adapters/hosts/codex/relay.md +50 -5
  90. package/runtime/python/okstra_ctl/adapters/hosts/grok/adapter.py +2 -2
  91. package/runtime/python/okstra_ctl/adapters/hosts/grok/relay.md +66 -5
  92. package/runtime/python/okstra_ctl/adapters/providers/grok/adapter.py +70 -2
  93. package/runtime/python/okstra_ctl/agent_activity.py +118 -35
  94. package/runtime/python/okstra_ctl/agent_invocation.py +19 -6
  95. package/runtime/python/okstra_ctl/agent_prompt_cli.py +65 -18
  96. package/runtime/python/okstra_ctl/analysis_inputs.py +5 -4
  97. package/runtime/python/okstra_ctl/analysis_packet.py +81 -1
  98. package/runtime/python/okstra_ctl/approval_decisions.py +3 -2
  99. package/runtime/python/okstra_ctl/attempt_evidence.py +2 -2
  100. package/runtime/python/okstra_ctl/backfill.py +13 -10
  101. package/runtime/python/okstra_ctl/batch.py +2 -4
  102. package/runtime/python/okstra_ctl/build_tools.py +6 -3
  103. package/runtime/python/okstra_ctl/claim_reproduction.py +101 -0
  104. package/runtime/python/okstra_ctl/clarification_items.py +27 -13
  105. package/runtime/python/okstra_ctl/cmux.py +130 -52
  106. package/runtime/python/okstra_ctl/code_review_target.py +34 -8
  107. package/runtime/python/okstra_ctl/conformance.py +37 -1
  108. package/runtime/python/okstra_ctl/consumers.py +5 -4
  109. package/runtime/python/okstra_ctl/container.py +103 -8
  110. package/runtime/python/okstra_ctl/context_cost.py +2 -1
  111. package/runtime/python/okstra_ctl/contract_graph.py +497 -0
  112. package/runtime/python/okstra_ctl/contract_graph_cli.py +62 -0
  113. package/runtime/python/okstra_ctl/convergence.py +338 -17
  114. package/runtime/python/okstra_ctl/convergence_engine.py +10 -18
  115. package/runtime/python/okstra_ctl/convergence_provenance.py +58 -8
  116. package/runtime/python/okstra_ctl/convergence_store.py +55 -34
  117. package/runtime/python/okstra_ctl/design_prep.py +7 -4
  118. package/runtime/python/okstra_ctl/dispatch_core.py +35 -65
  119. package/runtime/python/okstra_ctl/dispatch_state.py +134 -59
  120. package/runtime/python/okstra_ctl/doctor.py +6 -3
  121. package/runtime/python/okstra_ctl/domain/worker_presentation.py +70 -9
  122. package/runtime/python/okstra_ctl/entrypoints/hosts.py +16 -30
  123. package/runtime/python/okstra_ctl/error_log_write.py +35 -30
  124. package/runtime/python/okstra_ctl/error_report.py +26 -1
  125. package/runtime/python/okstra_ctl/error_zip.py +27 -5
  126. package/runtime/python/okstra_ctl/execution_identity.py +3 -2
  127. package/runtime/python/okstra_ctl/execution_manifest.py +7 -4
  128. package/runtime/python/okstra_ctl/final_report_schema.py +2 -2
  129. package/runtime/python/okstra_ctl/fix_cycles.py +2 -2
  130. package/runtime/python/okstra_ctl/fixed_text.py +39 -0
  131. package/runtime/python/okstra_ctl/git_reconcile.py +41 -9
  132. package/runtime/python/okstra_ctl/handoff.py +5 -4
  133. package/runtime/python/okstra_ctl/i18n.py +4 -2
  134. package/runtime/python/okstra_ctl/implementation_direction.py +22 -14
  135. package/runtime/python/okstra_ctl/implementation_outcome.py +4 -7
  136. package/runtime/python/okstra_ctl/incremental_carry.py +2 -1
  137. package/runtime/python/okstra_ctl/incremental_scope.py +89 -39
  138. package/runtime/python/okstra_ctl/index.py +8 -11
  139. package/runtime/python/okstra_ctl/initial_prompt_materialization.py +79 -7
  140. package/runtime/python/okstra_ctl/invocation.py +3 -6
  141. package/runtime/python/okstra_ctl/json_boundary.py +366 -0
  142. package/runtime/python/okstra_ctl/json_registry.py +10 -12
  143. package/runtime/python/okstra_ctl/jsonl.py +19 -2
  144. package/runtime/python/okstra_ctl/lead_events.py +33 -1
  145. package/runtime/python/okstra_ctl/listing.py +3 -3
  146. package/runtime/python/okstra_ctl/log_report.py +24 -2
  147. package/runtime/python/okstra_ctl/manager_cli.py +92 -7
  148. package/runtime/python/okstra_ctl/manager_store.py +12 -10
  149. package/runtime/python/okstra_ctl/material.py +5 -1
  150. package/runtime/python/okstra_ctl/migrate.py +29 -25
  151. package/runtime/python/okstra_ctl/model_cli.py +3 -15
  152. package/runtime/python/okstra_ctl/model_io_cli.py +1051 -0
  153. package/runtime/python/okstra_ctl/mutation_probe.py +13 -4
  154. package/runtime/python/okstra_ctl/pane_reclaim.py +3 -2
  155. package/runtime/python/okstra_ctl/paths.py +9 -0
  156. package/runtime/python/okstra_ctl/plan_items.py +525 -5
  157. package/runtime/python/okstra_ctl/plan_items_cli.py +842 -32
  158. package/runtime/python/okstra_ctl/pr_template.py +3 -2
  159. package/runtime/python/okstra_ctl/project_meta.py +5 -7
  160. package/runtime/python/okstra_ctl/recap.py +5 -4
  161. package/runtime/python/okstra_ctl/reconcile.py +21 -27
  162. package/runtime/python/okstra_ctl/registry/host_discovery.py +3 -2
  163. package/runtime/python/okstra_ctl/registry/provider_registry.py +3 -2
  164. package/runtime/python/okstra_ctl/render.py +30 -15
  165. package/runtime/python/okstra_ctl/render_final_report.py +3 -2
  166. package/runtime/python/okstra_ctl/report_assembly.py +172 -17
  167. package/runtime/python/okstra_ctl/report_finalize.py +7 -10
  168. package/runtime/python/okstra_ctl/report_html/render.py +3 -2
  169. package/runtime/python/okstra_ctl/report_language.py +3 -2
  170. package/runtime/python/okstra_ctl/report_markdown.py +13 -1
  171. package/runtime/python/okstra_ctl/report_narrative.py +40 -8
  172. package/runtime/python/okstra_ctl/report_synthesis_packet.py +518 -0
  173. package/runtime/python/okstra_ctl/report_views.py +3 -2
  174. package/runtime/python/okstra_ctl/rollup.py +65 -4
  175. package/runtime/python/okstra_ctl/run.py +159 -56
  176. package/runtime/python/okstra_ctl/run_audit.py +3 -2
  177. package/runtime/python/okstra_ctl/run_context.py +6 -9
  178. package/runtime/python/okstra_ctl/run_index_row.py +2 -8
  179. package/runtime/python/okstra_ctl/schedule_semantics.py +5 -2
  180. package/runtime/python/okstra_ctl/schema_excerpt.py +4 -2
  181. package/runtime/python/okstra_ctl/session_transcript.py +27 -1
  182. package/runtime/python/okstra_ctl/set_work_status.py +64 -38
  183. package/runtime/python/okstra_ctl/stage_fix_carry.py +4 -2
  184. package/runtime/python/okstra_ctl/stage_map.py +26 -6
  185. package/runtime/python/okstra_ctl/stage_targets.py +3 -4
  186. package/runtime/python/okstra_ctl/team.py +2 -1
  187. package/runtime/python/okstra_ctl/team_reconcile.py +11 -2
  188. package/runtime/python/okstra_ctl/time_report.py +51 -4
  189. package/runtime/python/okstra_ctl/usage_identity.py +2 -1
  190. package/runtime/python/okstra_ctl/usage_report.py +58 -4
  191. package/runtime/python/okstra_ctl/user_response.py +1431 -66
  192. package/runtime/python/okstra_ctl/wizard.py +50 -117
  193. package/runtime/python/okstra_ctl/work_categories.py +3 -2
  194. package/runtime/python/okstra_ctl/worker_prompt_body.py +18 -7
  195. package/runtime/python/okstra_ctl/worker_prompt_contract.py +3 -2
  196. package/runtime/python/okstra_ctl/worker_runner.py +14 -12
  197. package/runtime/python/okstra_ctl/workflow.py +2 -1
  198. package/runtime/python/okstra_ctl/worktree.py +3 -2
  199. package/runtime/python/okstra_ctl/wrapper_status.py +4 -2
  200. package/runtime/python/okstra_ctl/write_policy.py +4 -2
  201. package/runtime/python/okstra_token_usage/antigravity.py +39 -12
  202. package/runtime/python/okstra_token_usage/collect.py +90 -38
  203. package/runtime/python/okstra_token_usage/grok.py +127 -0
  204. package/runtime/schemas/final-report-v2.0.schema.json +21 -0
  205. package/runtime/schemas/final-report-v3.0.schema.json +21 -0
  206. package/runtime/schemas/report-synthesis-packet-v1.0.schema.json +140 -0
  207. package/runtime/skills/okstra-brief-gen/SKILL.md +9 -7
  208. package/runtime/skills/okstra-code-review/SKILL.md +21 -11
  209. package/runtime/skills/okstra-container-build/SKILL.md +18 -18
  210. package/runtime/skills/okstra-inspect/SKILL.md +12 -11
  211. package/runtime/skills/okstra-inspect/facets/error-zip.md +8 -8
  212. package/runtime/skills/okstra-inspect/facets/errors.md +2 -2
  213. package/runtime/skills/okstra-inspect/facets/history.md +9 -14
  214. package/runtime/skills/okstra-inspect/facets/logs.md +2 -2
  215. package/runtime/skills/okstra-inspect/facets/recap.md +5 -5
  216. package/runtime/skills/okstra-inspect/facets/report.md +6 -10
  217. package/runtime/skills/okstra-inspect/facets/status.md +9 -8
  218. package/runtime/skills/okstra-inspect/facets/time.md +3 -3
  219. package/runtime/skills/okstra-manager/SKILL.md +16 -14
  220. package/runtime/skills/okstra-memory/SKILL.md +3 -3
  221. package/runtime/skills/okstra-pr-gen/SKILL.md +5 -4
  222. package/runtime/skills/okstra-rollup/SKILL.md +6 -16
  223. package/runtime/skills/okstra-run/SKILL.md +9 -9
  224. package/runtime/skills/okstra-schedule-gen/SKILL.md +21 -17
  225. package/runtime/skills/okstra-setup/SKILL.md +21 -13
  226. package/runtime/skills/okstra-setup/references/project-config.md +2 -2
  227. package/runtime/skills/okstra-usage/SKILL.md +10 -10
  228. package/runtime/skills/okstra-user-response/SKILL.md +78 -107
  229. package/runtime/templates/report-writer-prompt-preamble.md +17 -1
  230. package/runtime/templates/reports/schedule.template.md +4 -4
  231. package/runtime/templates/worker-error-contract.md +17 -29
  232. package/runtime/validators/validate-run.py +527 -113
  233. package/runtime/validators/validate_session_conformance.py +65 -10
@@ -84,7 +84,9 @@ Read the worker result files generated in Phase 4/5 and extract individual findi
84
84
  - Same semantics but disjoint ticket sets → separate groups (do NOT over-merge across tickets).
85
85
  - Only one worker confirms a finding → one single-source group.
86
86
  4. When grouping is ambiguous, prefer splitting over merging (avoid over-merging). Semantic matching, ticket-set equality, and evidence interpretation remain lead judgments; the engine does not perform fuzzy matching or decide whether evidence is credible.
87
- 5. Write `runs/<task-type>/state/convergence-groups-<task-type>-<seq>.json`. Each group carries its `ticketIds`, `originWorker`, `originEvidence`, `discoveredBy`, and every `<worker>:<item-id>` source in `sourceItems`. For analysis sidetracks where ticket tagging is not required, `ticketIds: []` is the canonical value; never synthesize `"unknown"` or another placeholder. `scripts/okstra_ctl/convergence_engine.py` and the version-selected convergence-groups schema enforce the required array field and reject non-string or blank entries while allowing the empty array. When a live command or external read produced reproducible evidence, also include `evidenceArtifacts[]` with its `.okstra/` path, SHA-256 digest, command, and environment. The field is optional because historical or inaccessible evidence may not have a captured artifact. The lead and verifier MUST NOT infer live or external evidence from wording or keyword matching; they use the finding's explicit claim, provenance, and supplied artifacts. Include the resolved worker roster in order with functional `audience` values; do not derive scope from provider or model identity. In a v2 run, set top-level `schemaVersion: "2.0"`, `executionIdentityVersion: 2`, and `runManifestPath` to the current run manifest's exact canonical project-relative path. Write the groups artifact under that same resolved run directory's `state/` directory. Every v2 worker row also carries the paired `participantRef` and `sourceRoleExecutionRef` from that run manifest's canonical role state. Set `sourceRoleExecutionRef` to the selected source `RoleExecution` row's `roleExecutionRef`, not that row's `sourceRoleExecutionRef` field; a static source row has null in the latter field. Copy `participantRef` from that same selected row. Never derive those references from the worker name, provider, model, or execution label. A legacy v1 document keeps `schemaVersion: "1.0"` and omits `executionIdentityVersion`, `runManifestPath`, and both worker reference fields. The `audience` enum is a convergence role, not a phase label: every finding-producing worker uses `analysis` and selects an `analyser`, `designer`, `planner`, or `verifier` source role. Only the report author uses `report-writer`, paired with a `report-writer` source role. There is no `implementation-verifier` audience here; map an implementation verifier to `analysis`. **Your own review findings use `audience: "lead"`.** The phases that ask you to review the deliverable yourself produce findings that belong in this state — it is what the report author reads — and declaring yourself an analysis worker to get them in is forbidden. A `lead` row is a source, never a vote: `originWorker`, `discoveredBy` and `sourceItems` accept it, and the consensus count ignores it, so a finding only you saw stays queued for verification instead of resolving itself.
87
+ 5. Author the fixed grouping Markdown accepted by `okstra convergence prepare-groups --run-manifest <run-manifest> --input <grouping.md>`, then run that command. Python owns the artifact identifier, target path, schema version, task identity, run-manifest reference, and every participant reference. Each Markdown group records ticket IDs, origin worker and evidence, discovering workers, source worker item IDs, and optional captured evidence. An analysis sidetrack with no ticket uses an empty `Tickets:` value, never a placeholder. Use the ordered functional roster: finding workers have the `analysis` audience, the report author has `report-writer`, and the lead uses `lead`. A lead source never votes. Never infer live evidence or functional scope from wording, provider, model, or execution label.
88
+
89
+ The command sets each worker's paired `participantRef` and `sourceRoleExecutionRef` from the run manifest's canonical role state. It sets `sourceRoleExecutionRef` to the selected source `RoleExecution` row's `roleExecutionRef`, not that row's `sourceRoleExecutionRef` field.
88
90
  6. Do not write a queue or classification in this grouped-input artifact. `okstra convergence seed` classifies Round 0 by mode:
89
91
  - Collaborative mode: multi-source groups become `full-consensus` immediately; only single-source groups enter the working queue.
90
92
  - Adversarial mode: every finding enters the working queue regardless of source count. Semantic grouping merges provenance only; it does not decide a finding is reliable.
@@ -254,7 +256,7 @@ row names the invocation, replacement is rejected even for v1 and the prompt is
254
256
  history. Do not delete prompt, metadata, or reservation files by hand.
255
257
 
256
258
  Run `okstra agent-prompt verify --run-manifest <path> --metadata
257
- <metadataPath> --json` immediately before dispatch. A failed verification is a
259
+ <metadataPath> --text` immediately before dispatch. A failed verification is a
258
260
  pre-dispatch contract failure. For `runner=native-session`, pass only the
259
261
  returned `hostModelValue` to the host model argument. For
260
262
  `runner=cli-wrapper`, follow the planned execution surface after
@@ -298,9 +300,9 @@ Assigned worker prompt history path: <Project Root>/<Prompt History Path>
298
300
 
299
301
  Before dispatch, materialize `**Audit sidecar path:**` by passing the exact reverify `**Result Path:**` through `okstra_ctl.worker_artifact_paths.audit_sidecar_rel()` and resolving that project-relative result against `**Project Root:**`. Write the resulting absolute path into the header. The lead MUST NOT construct the audit filename from a role, task type, round, or sequence independently.
300
302
 
301
- The two errors paths carry the same absolute values the lead forwarded in the initial Phase 4 dispatch for that role (source: the launch prompt's `## Run Logs (error-log wiring)` section). Omitting either one makes `worker-dispatch` reject the CLI invocation before it starts the provider process — the path-delivery contract in [team-contract](./team-contract.md) "Error reporting" is not relaxed for reverify.
303
+ The two error-path anchors carry the same absolute values the lead forwarded in the initial Phase 4 dispatch for that role (source: the launch prompt's `## Run Logs (error-log wiring)` section). Workers use the errors log path with the typed error-log command from [team-contract](./team-contract.md) "Error reporting". The errors sidecar path only reserves the runtime-owned write-artifact path used by dispatch validation; no model-authored error JSON file is part of reverify.
302
304
 
303
- Relative to the Phase 4 anchor set rendered by `okstra_ctl.worker_prompt_headers.worker_prompt_headers()`, a reverify prompt drops two anchors whose targets lightweight mode never reads: `**Worker Preamble Path:**` and `**Coding preflight pack:**`.
305
+ Relative to the Phase 4 anchor set rendered by `okstra_ctl.worker_prompt_headers.worker_prompt_headers()`, a reverify prompt drops two anchors whose targets lightweight mode never reads: `**Worker Preamble Path:**` and `**Worker Error Contract Path:**`.
304
306
 
305
307
  **Where the composer's sections go.** `okstra agent-prompt materialize` (§"Invocation materialization gate") writes the dispatched body itself, as: these anchors, then the model-assignment block it appends (`**Provider:**`, `**Model:**`, `**Model execution value:**`, `**Runner:**`, `**Host runtime:**`, and `**Host model value:**` for a native host), then `## Duty Contract`, then `## Task Instructions` followed verbatim by the task-instructions file the lead wrote. So the lead authors only the last part, and every rule below about ordering — the phase boundary before the instruction headings, the `**Model:** <role>, <modelExecutionValue>` line — is about the lead's own file, not about the composed document. The composer's `**Model:** <modelExecutionValue>` anchor is a different line with a different shape; do not try to reshape it, and do not count it among the 8.
306
308
 
@@ -687,7 +689,7 @@ say so explicitly for that half; silence on one half is an incomplete result.
687
689
  ```
688
690
 
689
691
  ### Gap verification (1 adversarial reverify round)
690
- Each critic gap enters the verification queue as a finding with `originWorker = "<provider>-critic"` and `source = "critic"`. The lead runs ONE adversarial reverify round (§"Adversarial Verification Mode" classifier) with the Phase 4 analysers as voters, **excluding every analyser whose provider is the critic's provider** — the exclusion matches on the provider name (`codex`, `codex-worker`), not on the critic's worker id, so picking a critic provider that is already in the analyser roster removes that analyser from the vote and shrinks the quorum by one. `okstra apply-critic-gaps` refuses a vote from an excluded worker (`critic voter must be a non-critic analyser`), so dispatching one spends a worker whose verdict cannot be counted. Only gaps classified `full-consensus` / `partial-consensus` merge into the final report findings; `contested` / `worker-unique` gaps are treated as hallucinations and dropped (recorded in the convergence state, not promoted).
692
+ Each critic gap enters the verification queue as a finding with `originWorker = "<provider>-critic"` and `source = "critic"`. The lead runs ONE adversarial reverify round (§"Adversarial Verification Mode" classifier) with **every Phase 4 analyser as a voter**. Choosing a critic provider that is already in the analyser roster costs nothing: the critic is a different role contract, a different duty and a different session, so an analyser is not disqualified by sharing its provider name (ADR-0017 — provider and model are not role identity, and the same model assigned to two roles gets two independent workers). The critic cannot judge its own gaps because it is not an analyser: the voter roster is `workers[]` filtered to `audience == "analysis"`, and a critic is not even representable there (the allowed values are `analysis` / `lead` / `report-writer`). `okstra apply-critic-gaps` refuses a vote from anyone outside that roster (`critic voter must be a non-critic analyser`). Only gaps classified `full-consensus` / `partial-consensus` merge into the final report findings; `contested` / `worker-unique` gaps are treated as hallucinations and dropped (recorded in the convergence state, not promoted).
691
693
 
692
694
  **A gap that received no verdict is NOT a rejected gap (BLOCKING).** Dropping applies only to gaps the voters actually judged. A gap can also end the round *unjudged* — the verification dispatch returned a terminal non-result (`timeout`, `error`, no result file), the returned result covered only some of the gaps, or no non-critic analyser was available to vote at all. Nobody inspected those, so classifying them as hallucinations is a fabricated verdict. Each one MUST be recorded as a `## 5. Missing Information and Risks` row (`missingInformation`, `source: "critic-unverified"`) whose `risk` names the gap and the reason verification did not complete, and counted in `config.critic.gapsUnverified`. They are **not** promoted to findings (unverified) and **not** raised as `clarification` items — an unverified gap needs an analyser to verify it on the next run, not a decision from the user. Silently losing them is a contract violation: the batch that times out is exactly the batch of gaps too expensive to check, so the highest-risk items are the ones that vanish.
693
695
 
@@ -738,7 +740,7 @@ so explicitly.
738
740
 
739
741
  ### Verification — confirm-or-downgrade (BLOCKING)
740
742
 
741
- Each candidate blocker is verified by the Phase 4 analysers, excluding every analyser whose provider is the critic's provider (same rule as §"critic gaps" above). Do NOT use the adversarial finding classifier's "uncertain → reject" rule here.
743
+ Each candidate blocker is verified by the Phase 4 analysers — all of them, on the same roster rule as §"critic gaps" above; sharing the critic's provider name does not disqualify an analyser. Do NOT use the adversarial finding classifier's "uncertain → reject" rule here.
742
744
  - Do NOT run `apply-critic-gaps` for this mode. That reducer implements coverage merge/drop semantics and rejects `acceptance-devils-advocate` input.
743
745
  - **Confirmed** (an analyser reproduces it or cites supporting evidence) → promote to a `## 5.8 Acceptance Blockers` row (keep severity + recommended follow-up phase).
744
746
  - **Not confirmed** (cannot reproduce, or evidence is weak) → **downgrade to a Residual Risk row — never drop it.** Record the escalation trigger so the user can re-judge a high-severity-but-unconfirmed candidate.
@@ -87,7 +87,7 @@ User-utterance interpretation rule:
87
87
 
88
88
  A single okstra run frequently spans 30–120 minutes with multi-minute silent windows while workers run; without progress signals the user cannot distinguish "still working" from "hung". Lead MUST emit a single short progress line at each checkpoint below — plain user-facing text in a separate brief message (not buried inside a tool call), one line per checkpoint, format: `PROGRESS: <phase-id> <verb-phrase>`. Emit the line raw — the literal `PROGRESS:` token must begin the line. Do NOT wrap it in inline-code backticks (`` `PROGRESS: ...` ``) or a ```` ``` ```` code fence; markdown wrapping is what the post-hoc conformance validator scrapes around, and raw emit keeps the signal unambiguous.
89
89
 
90
- For an `implementation-planning` run whose run manifest declares `activityContractVersion: 1`, record every required activity boundary with `okstra agent-activity append` against the manifest-provided `leadEventsPath`. The ordering is fixed: the structured append succeeds first, the matching `PROGRESS:` line is emitted second, and the immediately following `ACTIVITY:` line projects the same structured fields into the conversation language. Do not reconstruct structured activity from conversation text. If the append fails, do not present that activity boundary as completed.
90
+ For an `implementation-planning` run whose run manifest declares `activityContractVersion: 1`, record every required activity boundary with `okstra agent-activity append` against the manifest-provided `leadEventsPath`. Model-facing calls pass prose through `--summary-file <md>` and a command through `--command`, `--command-cwd`, `--command-exit-code`, and `--command-output-file <md>`; do not construct `--command-record` JSON. The ordering is fixed: the structured append succeeds first, the matching `PROGRESS:` line is emitted second, and the immediately following `ACTIVITY:` line projects the same structured fields into the conversation language. Do not reconstruct structured activity from conversation text. If the append fails, do not present that activity boundary as completed.
91
91
 
92
92
  The live projection follows this shape:
93
93
 
@@ -161,7 +161,7 @@ When a terminal row preserves a pre-correction dissent classification, keep supe
161
161
 
162
162
  ## Model assignments
163
163
 
164
- **The lead never invents a model.** Every role's model is read from `task-manifest.json` → `resultContract.requiredWorkerRoles[*].modelExecutionValue` (and the lead model metadata). A missing assignment is a manifest defect, not a license to fall back — see [team-contract](./team-contract.md) "Model Assignment Rules". The manifest is always populated at run-prep time by the CLI, which seeds these values from `OKSTRA_DEFAULT_*_MODEL` (`scripts/okstra_ctl/run.py`).
164
+ **The lead never invents a model.** Every role's model comes from the `Worker Roster` section of `okstra model-io run-input`. A missing assignment is a run-input defect, not a license to fall back — see [team-contract](./team-contract.md) "Model Assignment Rules". Run preparation seeds the assignment values from `OKSTRA_DEFAULT_*_MODEL` (`scripts/okstra_ctl/run.py`).
165
165
 
166
166
  **Reading an assignment is not enough — the selected adapter must apply it at dispatch.** `dispatch_worker` receives the complete manifest assignment. The selected runtime adapter passes `hostModelValue` to a `runner=native-session` host primitive or `modelExecutionValue` to a `runner=cli-wrapper` provider process without changing provider, role, or model. A missing or unsupported runner-specific mapping is a pre-dispatch contract failure, never a silent fallback.
167
167
 
@@ -208,16 +208,15 @@ Executor is chosen at run-prep time via `--executor <claude|codex|antigravity>`
208
208
 
209
209
  **REQUIRED RESOURCE:** Read [context-loader](./context-loader.md) first to discover task bundle paths.
210
210
 
211
- Treat cross verify input as a task bundle, not as a single file. If the user did not specify an explicit task key or task path, use `.okstra/discovery/latest-task.json` as the current-task convenience pointer. If task browsing, task-id disambiguation, or project-level task inventory is needed, inspect `.okstra/discovery/task-catalog.json` first.
211
+ Treat cross verify input as a task bundle, not as a single file. If the user did not specify an explicit task key or task path, use context-loader's current-task pointer. For task browsing, task-id disambiguation, or project-level task inventory, use context-loader's rendered discovery result rather than reading discovery JSON directly.
212
212
 
213
213
  After context-loader completes, read **only the compact intake files below** in a single parallel-Read message at the start of Phase 1. The other instruction-set files are loaded lazily at the phase that actually needs them — see "Lazy reading discipline" below. This split exists because re-absorbing the full instruction-set baseline at every phase entry is the dominant source of lead-token bloat — most of it is files only one downstream phase uses.
214
214
 
215
215
  **Mandatory at Phase 1 start (parallel Read, one message):**
216
216
 
217
- 1. `task-manifest.json` (found by context-loader)
218
- 2. `runs/<task-type>/state/active-run-context-<task-type>-<seq>.json` — compact current-run intake; if absent, fall back to the current run manifest + team-state artifact
219
- 3. `instruction-set/analysis-profile.md` — needed to pick the right `Required workers:` block and phase rules
220
- 4. `instruction-set/analysis-packet.md` — primary compact input for analysis worker dispatch
217
+ 1. `okstra model-io run-input --run-manifest <run-manifest-path found by context-loader>` — fixed Markdown run identity and scope input
218
+ 2. `instruction-set/analysis-profile.md` — needed to pick the right `Required workers:` block and phase rules
219
+ 3. `instruction-set/analysis-packet.md` — primary compact input for analysis worker dispatch
221
220
 
222
221
  **Lazy reading discipline (do NOT read at Phase 1):**
223
222
 
@@ -226,7 +225,8 @@ After context-loader completes, read **only the compact intake files below** in
226
225
  - `instruction-set/analysis-material.md` — read only if the packet is insufficient or a source citation needs verification. Many task bundles have no meaningful material file beyond a duplicate brief wrapper.
227
226
  - `instruction-set/reference-expectations.md` — read at Phase 6 synthesis (or whenever the report-writer worker is dispatched) — it informs the match/gap assessment. Analysis workers use the packet excerpt unless they need source verification.
228
227
  - `instruction-set/final-report-template.md` — never read by Lead. The Report writer worker reads it as part of its own [Required reading]; Lead only references its path when dispatching.
229
- - `history/timeline.json` — read only on user request or when carry-in resolution requires it.
228
+ - Run history timeline JSON — do not read or parse it. For carry-in or resume resolution, use the workflow snapshot, artifact paths, final status path, and resume command in `okstra model-io run-input`; report insufficient information instead of opening timeline JSON.
229
+ - Owned lifecycle artifacts are projected only through the purpose-specific `okstra model-io run-input` and `active-context-input` views.
230
230
 
231
231
  **Implementation profile lazy reading discipline (BLOCKING — applies only when `task_type == "implementation"`):**
232
232
 
@@ -272,32 +272,22 @@ For `improvement-discovery`, Lead records `## Primary Pass Assignments` in the P
272
272
  4. Persist the setup outcome in team-state using the existing fields required by that backend.
273
273
  5. Emit the canonical `PROGRESS: phase-3-team-create <adapter-specific-status>` checkpoint. The phase id remains stable for artifact compatibility; only the adapter-owned verb phrase varies.
274
274
 
275
- ### Phase 4 / Phase 5 — Dispatch, await, and error-log dump
275
+ ### Phase 4 / Phase 5 — Dispatch, await, and error-log recording
276
276
 
277
- For each selected worker assignment, persist the exact prompt history, emit the per-worker Phase 4 checkpoint, and call `dispatch_worker(assignment, prompt)` through the selected adapter. Then call `await_workers(handles)`. A dispatch acknowledgement or process/pane creation is never completion: verify the terminal status, Result Path, worker-results audit path, and error sidecar required by `team-contract` before emitting the Phase 5 collection checkpoint.
277
+ For each selected worker assignment, persist the exact prompt history, emit the per-worker Phase 4 checkpoint, and call `dispatch_worker(assignment, prompt)` through the selected adapter. Then call `await_workers(handles)`. A dispatch acknowledgement or process/pane creation is never completion: verify the terminal status, Result Path, and worker-results audit path required by `team-contract` before emitting the Phase 5 collection checkpoint.
278
278
 
279
279
  Retries and convergence re-verification always call `redispatch_worker` to create a fresh one-shot session. Never reuse a worker conversation or switch adapters/providers to hide a failed assignment.
280
280
 
281
281
  ### Errors log path wiring (BLOCKING)
282
282
 
283
- The launch prompt's `## Run Logs (error-log wiring)` section gives Lead the resolved absolute paths for the run-level errors log and every per-worker sidecar. When Lead constructs each worker's dispatch prompt body, Lead MUST inject the matching two header lines verbatim:
283
+ The launch prompt's `## Run Logs (error-log wiring)` section gives Lead the resolved absolute path for the run-level errors log. When Lead constructs each worker's dispatch prompt body, Lead MUST inject this header line verbatim:
284
284
 
285
285
  - `**Errors log path:** <absolute run-level errors log path from launch prompt>`
286
- - `**Errors sidecar path:** <absolute per-worker sidecar path matching the dispatched worker>`
287
286
 
288
- Workers are contractually required to extract these two lines and abort with `<WORKER>_ERRORS_PATH_MISSING` if either is absent (see each worker definition's "Path extraction (BLOCKING)" block). Omitting these headers reproduces the historical bug where every run's `errors-<task-type>-<seq>.jsonl` stayed empty (workers had only template placeholders).
287
+ Workers are contractually required to extract this line and abort with `<WORKER>_ERRORS_PATH_MISSING` if it is absent (see each worker definition's "Path extraction (BLOCKING)" block). A worker records its tool failure through the typed `okstra error-log append-observed` form in that contract; it does not write an intermediate JSON file.
289
288
 
290
289
  After each worker terminates, BEFORE classifying its terminal status, verify the canonical result file exists at the absolute path resolved from the `**Result Path:**` header. If it is absent — or the deterministic provider process returned `CODEX_RESULT_MISSING` / `ANTIGRAVITY_RESULT_MISSING` — re-dispatch the SAME worker once with the byte-identical prompt. Only after the second attempt also misses may the role be classified `error` with `--message "result-missing after 1 retry"`. Full rules: [team-contract](./team-contract.md) "Lead Redispatch Policy on Result-Missing".
291
290
 
292
- After each worker terminates (any terminal status), if its errors sidecar exists, dump it to the run error log using the same resolved paths from the launch prompt:
293
-
294
- ```bash
295
- okstra error-log append-from-worker \
296
- --sidecar <absolute-sidecar-path-from-launch-prompt> \
297
- --out <absolute-errors-log-path-from-launch-prompt> \
298
- --task-key <taskKey> --agent <agent> --agent-role <role> --model <model>
299
- ```
300
-
301
291
  `--agent`, `--agent-role`, and `--error-type` are **closed enums**, not free-form labels — the role names used elsewhere in these contracts (`Codex worker`, `Claude worker`) are rejected. Use exactly:
302
292
 
303
293
  - `--agent` — `claude-worker` | `codex-worker` | `antigravity-worker` | `grok-worker` | `kimi-worker` | `report-writer`
@@ -318,10 +308,13 @@ okstra error-log append-observed \
318
308
  --command-kind wrapper \
319
309
  --exit-code 124 --duration-ms 1800000 \
320
310
  --message "reverify-r1 wrapper never launched" \
321
- --stderr-excerpt "<last stderr lines, or use --stderr-excerpt-file>"
311
+ --stderr-excerpt "<last stderr lines, or use --stderr-excerpt-file>" \
312
+ --cause sandbox-denied \
313
+ --evidence targetProbe=wrapper-write-.okstra-state-denied \
314
+ --evidence controlProbe=wrapper-write-tmp-succeeds
322
315
  ```
323
316
 
324
- Keep `--message` to the error actually observed — asserting that a sandbox or permission boundary blocked the call requires `--context-json` carrying `cause` plus both `causeEvidence` probes, and an unevidenced block claim in `--message` is rejected. If an `append-from-worker` dump is rejected for that reason, correct the offending sidecar entry and re-run the dump instead of skipping it: the dump aborts at the rejected entry, so every later entry in that sidecar never reaches the run log.
317
+ Keep `--message` to the error actually observed — asserting that a sandbox or permission boundary blocked the call requires `--cause sandbox-denied` plus both `--evidence targetProbe=<value>` and `--evidence controlProbe=<value>` probes, and an unevidenced block claim in `--message` is rejected.
325
318
 
326
319
  The deterministic dispatcher records this through its selected adapter — Lead does NOT need to re-record. Token usage is not inferred from dispatch return values; call `collect_usage` at the start of Phase 7.
327
320
 
@@ -356,14 +349,11 @@ If `Report writer worker` is in the selected roster (`recommendedWorkers` / `res
356
349
 
357
350
  Before constructing the dispatch prompt, the lead MUST:
358
351
 
359
- - Resolve report language: read `project.json.reportLanguage` (fallback
360
- `~/.okstra/config.json.reportLanguage`, then literal `auto`). If the
361
- resolved value is `auto`, inspect the task brief and pick `en` or `ko`
362
- based on its main prose language (default `en` when the brief is
363
- mostly code/identifiers). Pass the final `en` or `ko` value as
364
- `**Report Language:**` in the report-writer dispatch prompt, and ensure
365
- report assembly writes the same value into `data.json.meta.reportLanguage`
366
- from the immutable run manifest.
352
+ - Preserve the `**Report Language:**` value already materialized in the
353
+ report-writer dispatch prompt. The dispatcher resolves project/global
354
+ configuration and brief-language inference before the model receives the
355
+ prompt; report assembly copies the immutable run-manifest value into the
356
+ final record.
367
357
 
368
358
  The convergence output provides four finding categories:
369
359
 
@@ -392,9 +382,9 @@ Distinct from Phase 5.5 finding convergence:
392
382
 
393
383
  Lead's responsibilities in this sub-step (in order):
394
384
 
395
- For a new `implementation-planning` run, the fixed order is initial verification → one planner self-fix → targeted re-verification → user gate. The initial verification is round 1 and the targeted re-verification is round 2. A second automatic self-fix is a contract violation.
385
+ For a new `implementation-planning` run, the fixed order is initial verification → one planner self-fix → targeted re-verification → user gate. The initial verification is round 1 and the targeted re-verification is round 2. A second automatic self-fix is a contract violation. When `okstra plan-items prepare` reports `"gating": false` (one-stage `no-design-inputs` plan), skip the self-fix loop and the sweep batch: extraction and round 1 still run, then go to the user gate. Two-or-more stages, a PREP item, or non-empty `designPreparation.items` keep `gating: true` and the full order.
396
386
 
397
- 1. Build the queue with `okstra plan-items extract --narrative <report-writer-narrative.md> --output <state>/plan-items-....json`, place the persisted `items[]` verbatim in every verifier prompt, then run `okstra plan-items validate --narrative <report-writer-narrative.md> --items <state>/plan-items-....json`. The lead MUST NOT summarise, select, omit, reorder, or renumber the queue. Each prompt uses the compact `subject` plus the lossless `payload`, and asks every item:
387
+ 1. Build the queue with `okstra plan-items prepare --narrative <report-writer-narrative.md> --run-manifest <run-manifest>`, place the output of `okstra plan-items prompt --run-manifest <run-manifest>` verbatim in every verifier prompt, then run `okstra plan-items validate-prepared --narrative <report-writer-narrative.md> --run-manifest <run-manifest>`. Python resolves the one convergence-owned state path from that run identity. The lead MUST NOT summarise, select, omit, reorder, or renumber the queue. Each prompt uses the compact subject plus the lossless payload, and asks every item:
398
388
 
399
389
  ```text
400
390
  What concrete false-positive input, failure ordering, or omitted dependency
@@ -403,8 +393,8 @@ For a new `implementation-planning` run, the fixed order is initial verification
403
393
 
404
394
  An `AGREE` response records the considered counterexample and exclusion reason in its note; unverified external material is `verification-error`, not `DISAGREE`.
405
395
  2. Dispatch a single plan-body reverify round to every analyser worker in the roster (`claude`, `codex`, and `antigravity` when opted in). `Report writer worker` is NOT a participant in this round.
406
- 3. Aggregate verdicts and resolve the gate result to one of `passed` / `passed-with-dissent` / `blocked-by-disagreement` / `aborted-non-result`.
407
- 4. Write `runs/<task-type>/state/plan-body-verification-<task-type>-<seq>.json`, appending each round to `roundHistory[]` and updating its nested `planBodyVerification` final projection. This state belongs to convergence and is the only plan-verification input report assembly reads.
396
+ 3. Record each verifier Markdown result through `okstra plan-items apply-verdicts --state <plan-body-verification.json> --result <worker-id>=<result.md> --round <N>`. Python validates every submitted `P-*` identifier against the current convergence state and overwrites only that round's verdicts. Then resolve the gate result to one of `passed` / `passed-with-dissent` / `blocked-by-disagreement` / `aborted-non-result`.
397
+ 4. After `okstra plan-verify` succeeds, run `okstra plan-items complete-round --state <plan-body-verification.json> --run-manifest <current-run-manifest.json> --round <N>`. Python reads the current worker assignments, atomically appends the convergence-owned history, and updates its nested final projection. This state is the only plan-verification input report assembly reads.
408
398
  5. Record every surviving `majority-disagree` decision through `okstra approval-decision`; record its plan and clarification links only on activities. Do not append `clarificationItems[]` directly.
409
399
  6. Run report assembly after the final plan-body state, approval ledger, design snapshot, activity ledger, and team state are complete. Assembly writes `implementationPlanning.planBodyVerification` and derived clarification rows while publishing `data.json` once.
410
400
  7. Publish the report record `frontmatter.approved` field as `false`. There is no in-body `- [ ] Approved` marker line — approval lives only in the record (see [plan-body-verification](./plan-body-verification.md) §"Round protocol" step 9). The user may set it to `true` (via `--approve` or the in-session wizard) only when the gate is `passed` or `passed-with-dissent`. **Enforced:** `validators/validate-run.py` `validate_phase_boundary` fails a report shipping `approved: true` under `blocked-by-disagreement` / `aborted-non-result`, and run-prep (`scripts/okstra_ctl/run.py` `_validate_approved_plan`) fail-closes the same case. Manually flipping a blocked gate to passing is a contract violation.