okstra 0.117.0 → 0.119.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 (34) hide show
  1. package/README.md +115 -104
  2. package/docs/architecture/storage-model.md +300 -0
  3. package/docs/architecture.md +802 -0
  4. package/docs/cli.md +658 -0
  5. package/docs/container.md +124 -0
  6. package/docs/contributor-change-matrix.md +5 -4
  7. package/docs/follow-ups/2026-07-10-final-report-option-3.md +51 -0
  8. package/docs/performance-improvement-plan-v2.md +374 -0
  9. package/docs/project-structure-overview.md +21 -10
  10. package/package.json +10 -5
  11. package/runtime/BUILD.json +2 -2
  12. package/runtime/bin/okstra-render-report-views.py +5 -35
  13. package/runtime/prompts/launch.template.md +1 -0
  14. package/runtime/python/okstra_ctl/clarification_items.py +48 -0
  15. package/runtime/python/okstra_ctl/recap.py +80 -3
  16. package/runtime/python/okstra_ctl/report_views.py +46 -6
  17. package/runtime/python/okstra_ctl/user_response.py +190 -0
  18. package/runtime/skills/okstra-inspect/SKILL.md +37 -2
  19. package/runtime/skills/okstra-pr-gen/SKILL.md +9 -8
  20. package/runtime/skills/okstra-user-response/SKILL.md +121 -0
  21. package/runtime/templates/reports/report.js +6 -3
  22. package/runtime/templates/reports/user-response.template.md +1 -0
  23. package/src/cli-registry.mjs +7 -0
  24. package/src/commands/inspect/recap.mjs +6 -1
  25. package/src/commands/inspect/user-response.mjs +26 -0
  26. package/src/lib/skill-catalog.mjs +1 -0
  27. package/README.kr.md +0 -231
  28. package/docs/kr/architecture/storage-model.md +0 -297
  29. package/docs/kr/architecture.md +0 -815
  30. package/docs/kr/cli.md +0 -657
  31. package/docs/kr/container.md +0 -122
  32. package/docs/kr/follow-ups/2026-07-10-final-report-option-3.md +0 -51
  33. package/docs/kr/performance-improvement-plan-v2.md +0 -374
  34. package/docs/kr/performance-improvement-plan.md +0 -147
package/docs/cli.md ADDED
@@ -0,0 +1,658 @@
1
+ # okstra — CLI Argument and Option Manual
2
+
3
+ > This document supplements [README.md](../README.md). For internal architecture and storage/workflow contracts, see [architecture.md](architecture.md).
4
+ >
5
+ > This manual covers the phase-execution flags of `okstra.sh`. For the subcommand reference of the separate `okstra container` entry point, see [container.md](container.md).
6
+
7
+ ---
8
+
9
+ ## Index
10
+
11
+ - [Command forms](#command-forms)
12
+ - [Required arguments](#required-arguments)
13
+ - [`--project-id`](#--project-id)
14
+ - [`--task-group`](#--task-group)
15
+ - [`--task-id`](#--task-id)
16
+ - [`--task-type`](#--task-type)
17
+ - [`--task-brief`](#--task-brief)
18
+ - [`--yes`](#--yes)
19
+ - [Optional arguments and options](#optional-arguments-and-options)
20
+ - [`--task-key`](#--task-key)
21
+ - [`--clarification-response`](#--clarification-response)
22
+ - [`--resume-clarification`](#--resume-clarification)
23
+ - [`--project-root`](#--project-root)
24
+ - [`--directive`](#--directive)
25
+ - [`--fix-cycle`](#--fix-cycle)
26
+ - [`--workers`](#--workers)
27
+ - [`--lead-runtime`](#--lead-runtime)
28
+ - [`--claude-model`](#--claude-model)
29
+ - [`--lead-model`](#--lead-model)
30
+ - [`--codex-model`](#--codex-model)
31
+ - [`--antigravity-model`](#--antigravity-model)
32
+ - [`--report-writer-model`](#--report-writer-model)
33
+ - [`--executor`](#--executor)
34
+ - [`--critic`](#--critic)
35
+ - [`--approved-plan`](#--approved-plan)
36
+ - [`--approve`](#--approve)
37
+ - [`--work-category`](#--work-category)
38
+ - [`--base-ref`](#--base-ref)
39
+ - [`--related-tasks`](#--related-tasks)
40
+ - [`--render-only`](#--render-only)
41
+ - [`--no-plan-verification`](#--no-plan-verification)
42
+ - [Interactive input flow](#interactive-input-flow)
43
+ - [Confirmation flow](#confirmation-flow)
44
+ - [okstra Control Center — installation and common commands](#control-center-install-and-common-commands)
45
+ - [okstra Control Center](#okstra-control-center)
46
+ - [Installation (global wrapper)](#install-global-wrapper)
47
+ - [Common commands](#common-commands)
48
+ - [`okstra` Node CLI — introspection subcommands](#okstra-node-cli--introspection-subcommands)
49
+ - [Live-log sidecar](#live-log-sidecar)
50
+
51
+ ---
52
+
53
+ ## Command forms
54
+
55
+ Base command for initial entry with full arguments:
56
+
57
+ ```bash
58
+ scripts/okstra.sh [--render-only] [--yes] [--no-plan-verification] --task-type <task-type> [--workers worker1,worker2] [--lead-runtime claude-code|codex] [--lead-model <model>] [--claude-model <model>] [--codex-model <model>] [--antigravity-model <model>] [--report-writer-model <model>] [--executor claude|codex|antigravity] [--critic off|claude|codex|antigravity] [--related-tasks taskA,taskB] [--work-category bugfix|feature|refactor|ops|improvement|unknown] [--base-ref <branch|tag|sha>] [--clarification-response <previous-final-report>] [--approved-plan <plan-path>] [--approve] --project-id <project-id> --task-group <task-group> --task-id <task-id> --task-brief <brief-path> [--directive <directive>] [--fix-cycle <yes|no>]
59
+ ```
60
+
61
+ Short form for a later phase when an existing task-manifest.json is available:
62
+
63
+ ```bash
64
+ scripts/okstra.sh --task-key <project-id>:<task-group>:<task-id> [--task-type <task-type>]
65
+ ```
66
+
67
+ Immediately resume after answering clarification items:
68
+
69
+ ```bash
70
+ scripts/okstra.sh --resume-clarification --task-key <project-id>:<task-group>:<task-id>
71
+ ```
72
+
73
+ The following additional rules apply in an interactive terminal:
74
+
75
+ - Missing required arguments are read directly from stdin.
76
+ - Once all inputs are available, a summary is shown before execution.
77
+ - Creation or execution proceeds only when you enter `y` or `yes`.
78
+ - Non-interactive runs do not prompt for missing arguments and exit with an error instead.
79
+ - `--yes` skips both prompts and confirmation, but all required arguments must already be present.
80
+ - Precedence is `explicit CLI argument > interactive prompt or non-interactive error`.
81
+
82
+ ## Required arguments
83
+
84
+ ### `--project-id`
85
+
86
+ A globally unique project ID. On the first run, it self-registers in `<PROJECT_ROOT>/.okstra/project.json`. On later runs from the same PROJECT_ROOT, okstra exits immediately if the argument differs from the stored `projectId`.
87
+
88
+ Examples:
89
+
90
+ - `sample-project-v2-api`
91
+ - `jobs`
92
+
93
+ ### `--task-group`
94
+
95
+ A logical group for related tasks.
96
+
97
+ Examples:
98
+
99
+ - `feature-8858`
100
+ - `bugfix-auth`
101
+ - `tasks`
102
+
103
+ ### `--task-id`
104
+
105
+ A stable task identifier that can be reused within the same group.
106
+
107
+ Examples:
108
+
109
+ - `email-recipient-loss`
110
+ - `8852`
111
+
112
+ ### `--task-type`
113
+
114
+ The single input that determines the purpose of this run, profile selection, run-directory segment, and lifecycle phase routing.
115
+ For standard values and phase-specific responsibilities, see [Task type](#--task-type) above.
116
+
117
+ #### `--task-type improvement-discovery`
118
+
119
+ `improvement-discovery` is a sidetrack entry point outside `PHASE_SEQUENCE`. It uses multi-worker consensus to find improvement candidates within the codebase scope and lens allowlist.
120
+
121
+ - Input: a brief with the frontmatter marker `scope: codebase`.
122
+ - `priority-lenses`: one to four values. The lens allowlist is the `LENSES` constant in `scripts/okstra_ctl/improvement_lenses.py`.
123
+ - `scan-scope`: one or more paths.
124
+ - `out-of-scope`: optional.
125
+ - `candidate-cap`: 1–12; default 8.
126
+ - Output: the `## 5.9 Improvement Candidates` table with 10 columns: Cand ID / Lens / Title / Scope / Severity / Effort / Consensus / Source workers / Recommended next-phase / Evidence.
127
+ - Verdict Token: `candidates-ready` / `no-candidates` / `blocked`.
128
+ - Routing: there is no automatic spin-off. The user selects candidates and starts each under a new task ID with `requirements-discovery`, `implementation-planning`, or `error-analysis`.
129
+ - Workers: claude + codex + antigravity + report-writer are all required.
130
+ - Two bidirectional grilling points: an enhanced Step 4 in `okstra-brief-gen` with a budget of 8, and the lead's Phase 1.5 reflect-back with a budget of 12.
131
+ - Validator: `validators/validate_improvement_report.py` enforces the 11-part contract for an `improvement-discovery` final report.
132
+ - Because an `improvement-discovery` run is not in `PHASE_SEQUENCE`, the `--task-key` short form does not automatically populate `nextRecommendedPhase` for it.
133
+
134
+ ### `--task-brief`
135
+
136
+ The path to the task brief that serves as the basis for analysis.
137
+ Relative paths are resolved from the target project root.
138
+
139
+ This argument does not apply to `release-handoff`: a brief is input to an entry phase
140
+ (requirements-discovery / error-analysis / improvement-discovery), while
141
+ release-handoff preparation automatically creates an input document that cites the verification report
142
+ at `<task_root>/release-handoff-input.md` and uses it in place of a brief.
143
+ A non-empty `--task-brief` is rejected immediately for release-handoff.
144
+
145
+ Examples:
146
+
147
+ - `.project-docs/linear/feature/8858/okstra-task-brief.md`
148
+ - `.project-docs/tasks/8852/BUG_REPORT.md`
149
+
150
+ ### `--yes`
151
+
152
+ Skips interactive prompts and confirmation.
153
+
154
+ The following values are required instead:
155
+
156
+ - `project-id`
157
+ - `task-group`
158
+ - `task-id`
159
+ - `task-type`
160
+ - `brief-path`
161
+
162
+ If any required argument is missing, the command exits immediately without prompting.
163
+
164
+ Example:
165
+
166
+ ```bash
167
+ scripts/okstra.sh --yes --render-only --task-type error-analysis --project-id jobs --task-group tasks --task-id 8852 --task-brief .project-docs/tasks/8852/BUG_REPORT.md
168
+ ```
169
+
170
+ ## Optional arguments and options
171
+
172
+ ### `--task-key`
173
+
174
+ A short form that supplies `--project-id`, `--task-group`, and `--task-id` together when starting a later phase for an existing task.
175
+
176
+ - Input format: `<project-id>:<task-group>:<task-id>`
177
+ - Behavior:
178
+ - Splits the value into the three IDs and populates `PROJECT_ID`, `TASK_GROUP`, and `TASK_ID`.
179
+ - If the same values are also provided explicitly, they are accepted only when they match; a conflict exits immediately with an error.
180
+ - If the task has a `task-manifest.json`, a missing `--task-brief` is filled from the manifest's `taskBriefPath`, and a missing `--task-type` is filled from `workflow.nextRecommendedPhase`.
181
+ - Without a manifest, as on initial entry, the normal missing-argument validation remains in effect and full arguments are required.
182
+ - Explicit arguments always take precedence over manifest values.
183
+ - When `nextRecommendedPhase` is `pending-routing-decision` or `done-or-follow-up`, it is not filled automatically. Supply `--task-type` explicitly or supplement the brief, then rerun the command.
184
+
185
+ Examples:
186
+
187
+ ```bash
188
+ scripts/okstra.sh --task-key jobs:tasks:8852
189
+ ```
190
+
191
+ ```bash
192
+ scripts/okstra.sh --task-key jobs:tasks:8852 --task-type final-verification
193
+ ```
194
+
195
+ ### `--clarification-response`
196
+
197
+ Carries a previous run's final report—with user answers filled inline in `## 1. Clarification Items`—into the next run.
198
+
199
+ - Input: a path matching `<previous-run>/reports/final-report-<task-type>-<seq>.md`.
200
+ - Behavior: copies the file to the current run's `instruction-set/clarification-response.md`. In Section 0, the lead updates the `Status` of previous `Q*` rows to `resolved` or `obsolete`, then continues.
201
+ - Use it after a phase such as `requirements-discovery`, `error-analysis`, or `implementation-planning` leaves unresolved questions or approval-blocking clarification. Fill in the answers, then carry the report into the next phase or a resume of the same phase.
202
+
203
+ Example:
204
+
205
+ ```bash
206
+ scripts/okstra.sh \
207
+ --task-type implementation-planning \
208
+ --project-id jobs --task-group tasks --task-id 8852 \
209
+ --task-brief .project-docs/tasks/8852/BUG_REPORT.md \
210
+ --clarification-response .okstra/tasks/tasks/8852/runs/2026-04-29/error-analysis/reports/final-report-2026-04-29_10-15-30.md
211
+ ```
212
+
213
+ ### `--resume-clarification`
214
+
215
+ Immediately edits the final report from the previous `requirements-discovery` or `error-analysis` run and automatically reruns the same phase. You do not need to manage the `--clarification-response` path manually.
216
+
217
+ - Input: task identity supplied as `--project-id` + `--task-group` + `--task-id`, or as `--task-key <p>:<g>:<i>`.
218
+ - Sequence:
219
+ 1. Automatically selects the latest timestamped file under the task's `runs/{requirements-discovery,error-analysis}/reports/final-report-*.md` paths.
220
+ 2. Opens the file with `$EDITOR`, or `vi` when unset. Fill answers inline in the Section 5 `Q*` rows, save, and exit.
221
+ 3. okstra invokes itself again with `exec` for the same task type and carries the edited file in through `--clarification-response`.
222
+ 4. Confirmation, rendering, and Claude handoff then proceed as in a normal run.
223
+ - When an explicit `--task-type` is supplied, only that task type's reports are searched. Otherwise, okstra searches `error-analysis` and then `requirements-discovery` and uses the report with the later timestamp.
224
+ - It cannot be combined with `--render-only`, `--clarification-response`, or `--approved-plan`.
225
+ - Setting `EDITOR` to a non-interactive tool such as `true` skips answer editing and immediately reruns the task. This is recommended only for debugging.
226
+
227
+ Examples:
228
+
229
+ ```bash
230
+ scripts/okstra.sh --resume-clarification --task-key jobs:tasks:8852
231
+ ```
232
+
233
+ ```bash
234
+ EDITOR=code\ -w scripts/okstra.sh --resume-clarification --project-id jobs --task-group tasks --task-id 8852
235
+ ```
236
+
237
+ Internally, this is equivalent to:
238
+
239
+ ```bash
240
+ $EDITOR <project-root>/.okstra/tasks/<group>/<id>/runs/<task-type>/reports/final-report-<latest>.md
241
+ scripts/okstra.sh --task-type <same-type> \
242
+ --project-id <p> --task-group <g> --task-id <i> \
243
+ --task-brief <from manifest> \
244
+ --clarification-response <edited final-report-<latest>.md>
245
+ ```
246
+
247
+ ### `--project-root`
248
+
249
+ The absolute path to the target project. When omitted, `okstra.sh` resolves it in this order:
250
+
251
+ 1. Find the current directory or nearest ancestor containing `.okstra/project.json` and use it as PROJECT_ROOT.
252
+ 2. If that fails, use the result of `git rev-parse --show-toplevel`.
253
+ 3. If both fail, exit immediately with an error.
254
+
255
+ On the first run from the resolved PROJECT_ROOT, `<PROJECT_ROOT>/.okstra/project.json` is created automatically with this schema:
256
+
257
+ ```json
258
+ {
259
+ "projectId": "<--project-id argument value>",
260
+ "projectRoot": "<resolved absolute path>",
261
+ "createdAt": "<ISO8601 UTC>",
262
+ "updatedAt": "<ISO8601 UTC>"
263
+ }
264
+ ```
265
+
266
+ If the file already exists, okstra checks that `projectId` matches and updates only `projectRoot` and `updatedAt`. A mismatched `projectId` exits immediately, preventing two IDs from being used in the same directory.
267
+
268
+ Example:
269
+
270
+ ```bash
271
+ scripts/okstra.sh --task-type error-analysis --project-id jobs --project-root /Volumes/Workspaces/workspace/projects/jobs ...
272
+ ```
273
+
274
+ ### `--directive`
275
+
276
+ A free-text channel for passing user intent to the lead, workers, and downstream skills. The value is embedded in a `## Directive` section at the end of `instruction-set/analysis-material.md` and in `instruction-set/analysis-packet.md`, the analysis workers' primary input. It is also backed up to `instruction-set/directive.txt`.
277
+
278
+ Use it to:
279
+
280
+ - Override a default heuristic—for example, request a Gantt chart even for one XL task with two phases totaling about 10 days, or request an explicit reason for omitting one. `## Cumulative Timeline` has been removed from the schedule contract and is no longer a toggle.
281
+ - Direct the emphasis of analysis or planning—for example, prioritize rollout risks or report missing test coverage as a separate finding.
282
+ - Suggest Phase/Step divisions or day estimates in advance—for example, Part 1: 4d, measurement: 0.5d, Part 2: 4d, operations: 1d.
283
+
284
+ Interpretation rules:
285
+
286
+ - The lead and analysis workers read the compact intake (`active-run-context`, `analysis-packet.md`) first, so the directive propagates without separate work. `analysis-material.md` is a fallback when the packet is insufficient or source citations must be verified.
287
+ - A skill must give the user prompt **precedence** over its own contract—for example, the "Directive override (highest priority)" section of the `okstra-schedule` skill. When a heuristic is overridden, the result document states that fact in one line.
288
+
289
+ Example:
290
+
291
+ ```bash
292
+ scripts/okstra.sh --task-type implementation-planning ... \
293
+ --directive "Use two sequential phases (Part 1 ~4d, Part 2 ~5d) for ~10d total. Include a Gantt chart with the critical path."
294
+ ```
295
+
296
+ ### `--fix-cycle`
297
+
298
+ - `--fix-cycle <yes|no>` records whether re-entry into an entry phase (`requirements-discovery` / `error-analysis` / `implementation-planning`) after completion through release-handoff is a bug-fix cycle. When omitted, no cycle is recorded. The `fix_cycle_confirm` step in the okstra-run wizard accepts the same input.
299
+ - `yes` opens a new cycle only when both conditions hold: the task type is an entry phase, and the manifest's `workflow.lastCompletedPhase` is `release-handoff`. Preparation rejects the request if either condition is false. Once a cycle is open, later runs for the same task attach to it automatically without this flag.
300
+
301
+ ### `--workers`
302
+
303
+ Directly specifies the workers used in this run.
304
+ The default is `claude,codex,report-writer`. Antigravity is optional; add it explicitly when needed, as in `--workers claude,codex,antigravity,report-writer`.
305
+ When supplied, only the deduplicated worker subset is recorded.
306
+
307
+ Example:
308
+
309
+ ```bash
310
+ scripts/okstra.sh --task-type implementation-planning --workers claude,codex --project-id jobs --task-group tasks --task-id 8852 --task-brief .project-docs/tasks/8852/BUG_REPORT.md
311
+ ```
312
+
313
+ ### `--lead-runtime`
314
+
315
+ Selects the lead execution adapter. The default is `claude-code`.
316
+
317
+ Lead runtime independence boundary:
318
+
319
+ - `claude-code`: the current default execution path. Claude Code v2.1.178 removed `TeamCreate`, and the session owns an implicit team. Workers are dispatched with `Agent(name: ..., run_in_background: true)` without `team_name`. `teamName` is audit/display metadata; Claude session JSONL is used for usage accounting.
320
+ - `codex`: the runtime marker for the Codex lead adapter. `okstra codex-run` owns `--render-only --lead-runtime codex` to prepare a task bundle, and the prepared run manifest can be passed to `okstra codex-dispatch` for CLI-backed worker execution.
321
+ - `external`: without Claude Code Teams, `--render-only --lead-runtime external` prepares the task bundle and external lead prompt. The lead manages the tmux-pane worker lifecycle with `okstra team dispatch`, `okstra team await`, and `okstra team teardown`. This path does not use `TeamCreate` / `Agent(...)` and uses artifact-only accounting.
322
+
323
+ The current Claude Code independence boundary covers the external lead prompt and `okstra team *` worker dispatch. non-render `okstra_ctl.run --lead-runtime external` remains blocked; a complete external lead driver remains separate future work. `--runtime external` only selects the runtime adapter. `okstra install` creates `~/.agents/skills/` by default and also installs Claude skills and agents when `~/.claude` exists. Selecting the `claude` worker still requires the local Claude CLI wrapper.
324
+
325
+ ### Runtime auto-detection (`auto`)
326
+
327
+ `okstra run` defaults to `auto`. `auto` resolves to one of `claude-code`, `codex`, or `external` based on the host through `src/lib/runtime-resolver.mjs`. Precedence: explicit runtime > the `OKSTRA_RUNTIME_HOST` environment variable > Claude Code skill handoff > external when tmux is available > fail fast otherwise. The safe fallback never silently selects a runtime different from the user's intent.
328
+
329
+ - Inside Claude Code, `/okstra-run` is the front door. bare `okstra run` cannot invoke Claude Code `TeamCreate` / `Agent(...)`.
330
+ - On a Codex host, `okstra run` orchestrates `codex-run` -> `codex-dispatch`.
331
+ - In a generic terminal with tmux, `okstra run` orchestrates `render-bundle --lead-runtime external` -> `okstra team dispatch` -> `okstra team await`.
332
+
333
+ `doctor` and `render-bundle` also default to `auto`, but a plain terminal without a host signal must specify a host. `okstra install` and `ensure-installed` are exceptions. Installation places the shared runtime and skill targets based on agent homes rather than the runtime host, so it records the `auto` request and unresolved state in the manifest and continues even without a host signal. Skill copy targets depend on the presence of agent homes and the default Agent target policy, not runtime resolution. `~/.agents/skills/` is always created, and Claude skills/agents are installed when `~/.claude` exists. Claude Code skills explicitly specify `--runtime claude-code` / `--lead-runtime claude-code`, so execution does not depend on host auto-detection.
334
+
335
+ `installed-runtimes.json` uses schemaVersion 2 and separates `installRequest`, `runtimeResolution`, `installedRuntimes`, and `installedAssets`. `installed-skills.json` uses a schemaVersion 2 target list with `provider`, `root`, and `skills` to record Claude and Agent skill targets; uninstall removes files according to this list. `codexAdapter` / `externalAdapter` retain read compatibility with v1 manifests only.
336
+
337
+ For a Codex lead dry run, use `okstra codex-run <args...>`. It adds `--render-only --lead-runtime codex` itself and prints the prepared task bundle and lead prompt without dispatching workers.
338
+ The generated team-state, run manifest, and task manifest point `leadEventsPath` to `runs/<task-type>/state/lead-events-<task-type>-<seq>.jsonl`; rendering records a `bundle-prepared` event.
339
+ Then `okstra codex-dispatch --project-root <dir> --run-manifest <run-manifest> --workers codex[,antigravity[,report-writer]]` executes workers through the existing CLI wrappers. Without `--workers`, it automatically selects the Codex-side supported workers from the run roster: `codex`, `antigravity`, and an opted-in `report-writer`. Explicitly requesting an unsupported worker fails. `report-writer` requires explicit opt-in with `--enable-codex-report-writer --report-writer-codex-model <model>`; on success, postprocessing runs token-usage substitution → render-views → spawn-followups → validate-run in order.
340
+
341
+ The Codex worker (`--workers codex`, `--codex-model`) and Codex lead runtime are separate. The former selects a worker provider dispatched by a Claude Code lead; the latter is the upper runtime boundary for running the lead itself through the Codex adapter.
342
+
343
+ > Every `--*-model` flag accepts only aliases registered in the provider mappings in `scripts/okstra_ctl/models.py`. An unregistered value is immediately rejected with `UnknownModelError`, preventing a contract violation where the manifest's `modelExecutionValue` differs from the actual execution value. Allowed values:
344
+ > - Claude (`--lead-model` / `--claude-model` / `--report-writer-model`): `fable`, `fable-5`, `claude-fable-5`, `opus`, `opus-4-8`, `claude-opus-4-8`, `opus-4-7`, `claude-opus-4-7`, `opus-4-6`, `claude-opus-4-6`, `sonnet`, `sonnet-4-6`, `claude-sonnet-4-6`, `haiku`, `haiku-4-5`, `claude-haiku-4-5`, `claude-haiku-4-5-20251001`
345
+ > - Codex (`--codex-model`): `gpt-5.5`, `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.3-codex`, `gpt-5.2`, `codex-auto-review`
346
+ > - Antigravity (`--antigravity-model`): `gemini-3.1-pro` (default), `gemini-3.5-flash`, and the space-separated aliases `gemini 3.1 pro` / `gemini 3.5 flash`. The antigravity worker uses the `agy` CLI to run Gemini-family models, so model IDs retain the `gemini-*` form.
347
+
348
+ ### `--claude-model`
349
+
350
+ Selects the model used by the `Claude worker`.
351
+ When omitted, it uses the central default `OKSTRA_DEFAULT_CLAUDE_MODEL`, falling back to `opus`.
352
+
353
+ ### `--lead-model`
354
+
355
+ Selects the model used by the `Claude lead`.
356
+ When omitted, it uses the central default `OKSTRA_DEFAULT_LEAD_MODEL`, falling back to `opus`.
357
+
358
+ ### `--codex-model`
359
+
360
+ Selects the model used by the `Codex worker`.
361
+ When omitted, it uses the central default `OKSTRA_DEFAULT_CODEX_MODEL`, falling back to `gpt-5.5`.
362
+
363
+ ### `--antigravity-model`
364
+
365
+ Selects the model used by the `Antigravity worker`.
366
+ When omitted, it uses the central default `OKSTRA_DEFAULT_ANTIGRAVITY_MODEL`, falling back to `auto`.
367
+
368
+ ### `--report-writer-model`
369
+
370
+ Selects the model used by the `Report writer worker`.
371
+ When omitted, it uses the central default `OKSTRA_DEFAULT_REPORT_WRITER_MODEL`, falling back to the lead default.
372
+
373
+ The central-default environment variables are:
374
+
375
+ - `OKSTRA_DEFAULT_LEAD_MODEL`
376
+ - `OKSTRA_DEFAULT_CLAUDE_MODEL`
377
+ - `OKSTRA_DEFAULT_CODEX_MODEL`
378
+ - `OKSTRA_DEFAULT_ANTIGRAVITY_MODEL`
379
+ - `OKSTRA_DEFAULT_REPORT_WRITER_MODEL`
380
+ - `OKSTRA_DEFAULT_EXECUTOR` (`claude` | `codex` | `antigravity`, fallback `claude`)
381
+
382
+ Fallback defaults are:
383
+
384
+ - `Claude lead`: `opus`
385
+ - `Report writer worker`: `opus`
386
+ - `Claude worker`: `opus`
387
+ - `Codex worker`: `gpt-5.5`
388
+ - `Antigravity worker`: `auto`
389
+ - Implementation executor: `claude`, so the default is `Claude executor`.
390
+
391
+ ### `--executor`
392
+
393
+ Selects the provider that performs the Executor role for `--task-type implementation`. The value is `claude`, `codex`, or `antigravity`; it is ignored for other task types.
394
+
395
+ - Default: `OKSTRA_DEFAULT_EXECUTOR` → fallback `claude`.
396
+ - The Executor is the **only worker allowed to mutate project files** in this run. The other two providers are dispatched as strict read-only verifiers in the same run.
397
+ - The Executor reuses the provider's worker model flag. With `--executor codex`, its model comes from `--codex-model`, default `gpt-5.5`; with `--executor antigravity`, it comes from `--antigravity-model`, default `auto`.
398
+ - All three Claude, Codex, and Antigravity verifiers are always dispatched regardless of the Executor provider. Even the verifier using the same provider runs in a separate CLI session with isolated context, preserving the self-review safeguard.
399
+ - Codex and Antigravity mutate files through each CLI's auto-edit mode, for example `codex exec --sandbox workspace-write`, without passing through Claude-side Edit/Write tools. Mutations occur in the task worktree described below. Both wrappers—`scripts/okstra-codex-exec.sh` and `scripts/okstra-antigravity-exec.sh`—receive the worktree path as their fourth positional argument and forward it through `--add-dir` for Codex or `--include-directories` for Antigravity. Without it, the Codex `workspace-write` sandbox rejects worktree writes with EPERM.
400
+ - **Claude Executor cwd handling**: Claude's Bash tool has no per-call cwd argument and inherits the lead session cwd. To run cwd-sensitive toolchains such as `cargo`, `npm`, `pnpm`, `bun`, `pytest`, `make`, or `go` inside the worktree, prefix the invocation with `cd {{EXECUTOR_WORKTREE_PATH}} && <cmd>`. Keep `cd` as the leading token in a single Bash call so Claude Code permission auto-allow works; do not wrap it in `bash -lc "..."` or `bash -c "..."`, which hides `cd` and causes a permission prompt on every call. Prefer a tool's working-directory option—such as `git -C <path>`, `cargo --manifest-path`, or `pytest --rootdir`—over a `cd && ` chain. Edit/Write/Read tools already use absolute paths and need no cwd handling. This rule applies only to the Claude Executor; the Codex and Antigravity wrappers inject cwd.
401
+ - **Task worktree (automatic isolation for every task type)**: During the first phase's preparation for any task type, `okstra-ctl` creates a `git worktree` at `~/.okstra/worktrees/<project-id>/<task-group-segment>/<task-id-segment>/` and branches `<work-category-namespace>/<task-id-segment>` from the resolved commit of the user-selected `--base-ref`, for example `feature/dev-9436` or `fix/dev-7311`. Later phases for the same task key reuse the path and branch and record status `reused`; no new `git worktree add` occurs during run preparation. Special characters such as `/` and `:` in every segment are normalized to `-`, and `~/.okstra/worktrees/registry.json` globally manages task-key-to-path/branch mappings under flock. Executor edits, writes, builds, tests, and commits—and verifier reads—run in this worktree. If the caller is already in another worktree or project_root is not a Git repository, provisioning is skipped and records `skipped-in-worktree` or `skipped-not-git`. Path or branch collisions fail immediately with `PrepareError`. Worktrees are not deleted after a run; remove one manually with `git worktree remove`, then `git branch -D`, then delete the registry entry. **The implementation stage isolation below is the exception.**
402
+ - **`implementation` stage isolation (concurrent parallelism)**: The task-key worktree above applies only from `requirements-discovery` through `implementation-planning`. Each `implementation` run executes in a **stage-specific isolated worktree** at `~/.okstra/worktrees/<project-id>/<task-group-segment>/<task-id-segment>/stage-<N>/`, on branch `<work-category-namespace>/<task-id-segment>-s<N>`. The registry atomically reserves a stage key, `<task-key>#stage-<N>`, under flock. `_resolve_effective_stages` excludes `started` rows in `consumers.jsonl` and reserved stages. Stage selection, worktree creation, and registry reservation all happen in one critical section protected by the task-key provisioning mutex at `~/.okstra/.locks/worktree-provision/`, so concurrent `implementation` runs safely select different ready stages: **one run = one stage**. A stage worktree's base depends on its dependency shape: independent (`depends-on (none)`) uses the common anchor fixed once at first stage entry; a single dependency (`depends-on X`) uses the predecessor stage's completed `head_commit`; multiple dependencies (`depends-on X,Y…`) use task-worktree HEAD after all predecessors have been merged, verified with `git merge-base --is-ancestor`, and otherwise fail with `PrepareError` and merge guidance. Select the stage with `--stage <auto|N>` for `okstra.sh`/`render-bundle`, or with the okstra-run wizard's `stage_pick` step. If `project_root` is not a Git repository or is a nested worktree, stage isolation also degrades to flat operation.
403
+ - **Single-stage `final-verification` artifact isolation**: `--task-type final-verification --stage <N>` reuses the implementation stage worktree read-only from the registry. Run artifacts are isolated per stage under `runs/final-verification/stage-<N>/`, and the team name receives a `-fv-s<N>` suffix. Concurrent final-verification runs for different stages do not collide in state, worker results, or team names. For concurrent verification of the same stage, `teamName` is only an audit label and each session has its own implicit team, so the sessions can coexist without a TeamCreate/name collision. This statement is limited to per-session team identity and does not claim safety for shared mutable state. Whole-task verification with an empty stage keeps the flat `runs/final-verification/` layout.
404
+
405
+ Example:
406
+
407
+ ```bash
408
+ scripts/okstra.sh --task-type implementation \
409
+ --executor codex \
410
+ --codex-model gpt-5.5 \
411
+ --approved-plan .project-docs/.../runs/implementation-planning/.../reports/final-report-implementation-planning-001.md \
412
+ --project-id jobs --task-group tasks --task-id 8852 \
413
+ --task-brief .project-docs/tasks/8852/BUG_REPORT.md
414
+ ```
415
+
416
+ ### `--critic`
417
+
418
+ Selects the provider for the opt-in Phase 5.6 critic pass. The value is `off`, `claude`, `codex`, or `antigravity`; the default is `off`.
419
+
420
+ - Critic dispatch runs concurrently with the first convergence reverify round in Phase 5.5, with critic input fixed to the integrated Round 0 result. One gap/blocker verification round runs in Phase 5.6 after convergence finishes. It detects coverage gaps in discovery, error-analysis, and implementation-planning, and acts as an acceptance devil's advocate in final-verification. Follow the "Coverage critic pass" and "Acceptance critic pass" sections of `prompts/lead/convergence.md` for the detailed contract.
421
+ - It shares the same value space as the critic-selection step in the in-session `okstra-run` wizard. `_resolve_model_bindings` in `prepare_task_bundle` validates the value; anything else is rejected immediately with `PrepareError`.
422
+
423
+ ### `--approved-plan`
424
+
425
+ Accepts the path to a previous `implementation-planning` final report as input to `--task-type implementation`. The file's YAML frontmatter must contain an `approved` field whose value is `true`.
426
+
427
+ Approval format:
428
+
429
+ - Exactly one line inside the final report's leading `---` YAML fence: `approved: true` or `approved: false`.
430
+ - Case-insensitive; `True` and `TRUE` are also accepted.
431
+ - The report writer always publishes `approved: false`. Implementation becomes available after the user toggles it to `true`.
432
+
433
+ When frontmatter is not `approved: true`, the run is rejected as `contract-violated`. Instead of editing the file directly, use `--approve` to treat the CLI invocation itself as the approval action.
434
+
435
+ ### `--approve`
436
+
437
+ Used with `--approved-plan` and `--task-type implementation`, this flag **treats the CLI invocation itself as plan approval**:
438
+
439
+ - Toggles `approved: false` to `approved: true` in the specified `--approved-plan` file's YAML frontmatter.
440
+ - Appends the audit line (`- Approval time (CLI ack): <ISO8601> — recorded by \`okstra --approve\``) to the end of the file.
441
+ - If the file is already `approved: true`, leaves frontmatter unchanged and adds the audit line only if it has never been recorded.
442
+ - If the file has no YAML frontmatter or no `approved:` line, exits immediately with an error because the path may refer to the wrong plan file.
443
+
444
+ Using `--approve` outside `--task-type implementation` is meaningless and exits with an error. Use it in CI or scripts, or when approval and the next phase must happen in a single command. The former `--ack-approved` alias was removed in 0.8.0.
445
+
446
+ Example:
447
+
448
+ ```bash
449
+ scripts/okstra.sh --task-type implementation \
450
+ --approve \
451
+ --approved-plan .project-docs/.../runs/implementation-planning/.../reports/final-report.md \
452
+ --project-id jobs --task-group tasks --task-id 8852 \
453
+ --task-brief .project-docs/tasks/8852/BUG_REPORT.md
454
+ ```
455
+
456
+ ### `--work-category`
457
+
458
+ Classifies the work in this task. Allowed values:
459
+
460
+ - `bugfix`
461
+ - `feature`
462
+ - `refactor`
463
+ - `ops`
464
+ - `improvement`
465
+ - `unknown` (default)
466
+
467
+ Normally, the `requirements-discovery` phase infers work-category automatically. In a lifecycle that skips that phase—for example, one starting directly at `implementation-planning`—use this flag to classify the work explicitly. The value is preserved in `task-manifest.json` and used for grouping by the schedule and status skills.
468
+
469
+ Example:
470
+
471
+ ```bash
472
+ scripts/okstra.sh --task-type implementation-planning \
473
+ --work-category refactor \
474
+ --project-id jobs --task-group tasks --task-id 8852 \
475
+ --task-brief .project-docs/tasks/8852/PLAN.md
476
+ ```
477
+
478
+ ### `--base-ref`
479
+
480
+ The Git ref used as the base when the isolated worktree for a task key is first created. It may be a branch name, tag, or commit SHA.
481
+
482
+ - Required during first-phase preparation. The `okstra-run` skill collects it through the same menu as the PR base picker: `main`, `dev`, `staging`, `preprod`, `prod`, or custom input.
483
+ - Later phases for the same task key reuse the worktree path, branch, and base ref stored in the registry, so a new value is ignored.
484
+ - If `project_root` is not a Git repository or is already inside a non-main worktree, provisioning is skipped and this value is unused.
485
+
486
+ Example:
487
+
488
+ ```bash
489
+ scripts/okstra.sh --task-type requirements-discovery \
490
+ --base-ref main \
491
+ --project-id jobs --task-group tasks --task-id 8852 \
492
+ --task-brief .project-docs/tasks/8852/BRIEF.md
493
+ ```
494
+
495
+ ### `--related-tasks`
496
+
497
+ Accepts a comma-separated list of related task identifiers.
498
+
499
+ Example:
500
+
501
+ ```bash
502
+ scripts/okstra.sh --task-type error-analysis --related-tasks scanner-regression,reply-ui --project-id jobs --task-group tasks --task-id 8852 --task-brief .project-docs/tasks/8852/BUG_REPORT.md
503
+ ```
504
+
505
+ Related tasks are reference metadata and do not replace the current task key.
506
+
507
+ ### `--render-only`
508
+
509
+ Creates the prompt and task bundle without executing Claude.
510
+
511
+ This mode does not:
512
+
513
+ - Execute Claude.
514
+ - Create `final-report-<task-type>-<seq>.md`.
515
+ - Create `final-<task-type>-<seq>.status`.
516
+
517
+ It does:
518
+
519
+ - Create or update the stable task root.
520
+ - Create or update `task-manifest.json`.
521
+ - Create or update `task-index.md`.
522
+ - Create or update `instruction-set/`.
523
+ - Create or update `instruction-set/reference-expectations.md`.
524
+ - Create or update `instruction-set/final-report-template.md`.
525
+ - Record the current `manifests/run-manifest-<task-type>-<seq>.json`.
526
+ - Update `history/timeline.json`.
527
+ - Create or update the project-level discovery pointer.
528
+
529
+ ### `--no-plan-verification`
530
+
531
+ Disables the Phase 6 plan-body verification round for the `implementation-planning` task type. It is enabled by default and ignored for other task types.
532
+
533
+ - **Enabled (default)**: Immediately after the report-writer worker drafts the final report in Phase 6, the lead divides the synthesized plan's §5.5 implementation plan deliverables—Option Candidates / Stepwise Execution Order / Dependency / Validation Checklist / Rollback—into `P-*` plan items and dispatches them for reverification to every analyzer worker: `claude`, `codex`, and opted-in `antigravity`. Worker verdicts (`AGREE` / `DISAGREE(a-e)` / `SUPPLEMENT`) are aggregated into one of four gate results: `passed`, `passed-with-dissent`, `blocked-by-disagreement`, or `aborted-non-result`. The `- [ ] Approved` marker is rendered at the top of the final report only for `passed` or `passed-with-dissent`. Items with majority DISAGREE become rows with `Blocks=approval` in `## 1. Clarification Items`. There is no automatic revision; the user answers and resumes the same phase.
534
+ - **Disabled (with `--no-plan-verification`)**: The entire Phase 6 substep is skipped and the Approval marker is always rendered at the top of the final report, matching legacy behavior. This is a fast-iteration opt-out and is not recommended for a handoff-ready plan.
535
+ - The flag records `false` in the manifest at `convergence.planBodyVerification.enabled`. The resume command must include the same flag to preserve behavior; `_canonical_argv` guarantees faithful emission on resume.
536
+ - For the detailed round protocol, verdict semantics, and state-file schema, see the "Plan-body verification mode (implementation-planning only)" section of `prompts/lead/convergence.md`.
537
+
538
+ ## Interactive input flow
539
+
540
+ When required arguments are omitted in an interactive terminal, `okstra` may ask for these values in order:
541
+
542
+ - `Project ID`
543
+ - `Task Group`
544
+ - `Task ID`
545
+ - `Task Type`
546
+ - `Task Brief Path`
547
+
548
+ For example:
549
+
550
+ ```bash
551
+ scripts/okstra.sh --render-only --task-type error-analysis
552
+ ```
553
+
554
+ The command reads missing required values from stdin, then proceeds through the final summary and confirmation.
555
+
556
+ ## Confirmation flow
557
+
558
+ Before creating files in an interactive run, okstra shows a summary containing:
559
+
560
+ - Whether the run is render-only.
561
+ - Task type.
562
+ - Project ID.
563
+ - Task group.
564
+ - Task ID.
565
+ - Task brief path.
566
+ - Analysis target.
567
+ - Related tasks.
568
+ - Selected workers.
569
+ - Lead model.
570
+ - Configured worker models.
571
+ - Task key.
572
+ - Task root.
573
+ - Current run directory.
574
+
575
+ It then displays `Continue? [y/yes]:`. Any response other than `y` or `yes` exits without executing.
576
+
577
+ `--yes` skips this confirmation flow entirely.
578
+
579
+ ---
580
+
581
+ <a id="control-center-install-and-common-commands"></a>
582
+ ## okstra Control Center — installation and common commands
583
+
584
+ ## okstra Control Center
585
+
586
+ `okstra-ctl` is a CLI for querying, monitoring, and rerunning okstra runs across all target projects through the indexes under the user's `~/.okstra/` home.
587
+
588
+ <a id="install-global-wrapper"></a>
589
+ ### Installation (global wrapper)
590
+
591
+ As with `okstra`, placing a wrapper under `~/.local/bin/` makes it available from any directory.
592
+
593
+ ```bash
594
+ cat > ~/.local/bin/okstra-ctl <<'WRAPPER'
595
+ #!/usr/bin/env bash
596
+ exec /Volumes/Workspaces/workspace/projects/Okstra/scripts/okstra-ctl.sh "$@"
597
+ WRAPPER
598
+ chmod +x ~/.local/bin/okstra-ctl
599
+ ```
600
+
601
+ `~/.local/bin` must be included in `PATH`.
602
+
603
+ <a id="common-commands"></a>
604
+ ### Common commands
605
+
606
+ | Purpose | Command |
607
+ |---|---|
608
+ | List projects with recorded work | `okstra-ctl projects` |
609
+ | Find recent runs | `okstra-ctl list --since 7d` |
610
+ | Restrict results to one project | `okstra-ctl list --project sample-project` |
611
+ | View in-progress runs | `okstra-ctl tail active` |
612
+ | Show metadata for one run | `okstra-ctl show <runId-or-prefix>` |
613
+ | Print the result-report path | `okstra-ctl open <runId-or-prefix>` |
614
+ | Regenerate a final-report HTML view | `okstra render-views <final-report.md>` |
615
+ | Rerun one run | `okstra-ctl rerun <runId-or-prefix> --yes` |
616
+ | Rerun multiple filtered runs | `okstra-ctl rerun --filter --project X --status failed --yes` |
617
+ | Rerun the latest matching run | `okstra-ctl rerun last --project X --task-group Y --yes` |
618
+ | Backfill or rescan indexes | `okstra-ctl reindex` |
619
+ | Reconcile active runs | `okstra-ctl reconcile [--project <id|all>]` |
620
+ | Show batch progress | `okstra-ctl batch status <batch-id>` |
621
+
622
+ ### `okstra` Node CLI — introspection subcommands
623
+
624
+ The `okstra` Node CLI (`bin/okstra`) provides both installer/admin commands and introspection commands used by skills and agents. It goes through the Node wrapper instead of invoking the Python runtime directly, so `src/lib/python-helper.mjs` wires `PYTHONPATH`.
625
+
626
+ | Command | Purpose |
627
+ |---|---|
628
+ | `okstra paths [--field <name>\|--shell]` | Print package, runtime, home, bin, Python path, and version locations |
629
+ | `okstra install [--runtime claude-code\|codex\|external\|all] [--refresh\|--dry-run\|--link <repo>]` | Install or update the runtime, templates, skills, and agents. The default runtime is `auto`; skill targets are not runtimes. `~/.agents/skills/` is always created, and Claude skills and agents are also installed when `~/.claude` exists |
630
+ | `okstra ensure-installed [--runtime claude-code\|codex\|external\|all] [-q]` | Check installation state and reinstall stale assets for the same runtime. Default `auto` continues without a host signal and checks drift in the Agent skill target and any existing Claude target |
631
+ | `okstra uninstall [--purge -y]` | Remove installed assets. By default, removes files listed by the `installed-skills.json` targets and `installed-agents.json` while preserving user data |
632
+ | `okstra doctor [--runtime claude-code\|codex\|external\|all] [--phase <phase>] [--json]` | Diagnose the runtime, Python imports, and skill/agent installation. The `codex` and `external` runtimes omit Claude skill checks. `--phase` adds readiness checks for `implementation`, `final-verification`, `release-handoff`, or `improvement-discovery` |
633
+ | `okstra setup --project-id <id>` | Create or update `.okstra/project.json` in the current project |
634
+ | `okstra check-project [--json]` | Verify that the current project is registered |
635
+ | `okstra preflight [--runtime <name>] [--cwd <dir>] [--json]` | Single skill-preflight call combining `ensure-installed`, with silent reinstall when stale, and `check-project` into one JSON response. Step 0 of every project-scoped skill converges on this command |
636
+ | `okstra config <get\|set\|unset\|show> [key] [value] [--scope project\|global\|all]` | Manage persistent settings such as `pr-template-path` with atomic JSON writes |
637
+ | `okstra memory <add\|list\|search\|show\|archive>` | Manage global conversation memory in `~/.okstra/memory-book`, a user-home store separate from project `.okstra/` and the CLI basis of the `save this in okstra` natural-language skill |
638
+ | `okstra manager <init\|discover-projects\|new\|task>` | Public CLI for grouping cross-project okstra tasks into manager-owned context. `new project`, `new task-group`, and `new task` create manager plans; `task assign`, `task note`, `task sync`, `task status`, and `task run` manage per-project assignments and snapshots. `new project --project-root` accepts only existing directories and performs setup-equivalent registration only if `.okstra/project.json` is absent. Public documentation uses the full `project-id:task-group:task-id` child task key; when child task IDs differ within the same manager task, select the exact child with `--child-task-id`. `task run` does not execute the child lead directly; it returns `prepared` launch metadata/event and a child launch-context packet as JSON |
639
+ | `okstra rollup [--task-group <group>] [--project-root <dir>] [--cwd <dir>]` | Read-only backend for the okstra-rollup skill. For every catalog task, or one task group, it emits JSON with per-task run counts, raw duration in ms, error counts, latest report paths, group totals, and status/category/phase distributions. Omitting `--task-group` targets the whole project catalog. The caller skill formats raw ms as HH:MM:SS and synthesizes report prose. Use the `okstra inspect` family for a single-task drill-down |
640
+ | `okstra migrate [--apply] [--cwd <dir>] [--quiet]` | One-time migration of the project artifact root from `.project-docs/okstra/` to `.okstra/`. It is a dry run by default; `--apply` performs the move with `git mv` in a Git worktree, removes an empty `.project-docs/`, and synchronizes the `<PROJECT>/CLAUDE.md` import line, `.gitignore`, the project's rows in `~/.okstra/{recent,active}.jsonl`, and `~/.okstra/worktrees/registry.json`. It exits 1 if `.okstra/` already exists or the legacy directory is absent. Scheduled for removal by the end of v0.x |
641
+ | `okstra task-list [--project-root <path>]` | Combine `list_project_tasks` and `read_latest_task` into JSON containing the task catalog and latest task |
642
+ | `okstra task-show <task-key> [--project-root <path>]` | Summarize workflow, phase, status, and artifacts from the Task Read-Side Snapshot |
643
+ | `okstra set-work-status <token> <todo\|in-progress\|blocked\|done> [--note <text>] [--task-group <g>] [--project-root <dir>]` | Update user-managed `workStatus` in task-manifest.json, along with `workStatusUpdatedAt` and, when `--note` is supplied, `workStatusNote`. `<token>` is a full task key or bare task ID. It uses the manifest renderer's serialization rules and returns `stage:"ambiguous"` plus `matches[]` when ambiguous |
644
+ | `okstra worktree-lookup <task-key>` | Return the `worktree_registry.lookup` result: reserved path, branch, base ref, and current status |
645
+ | `okstra plan-validate <plan-path>` | Run `_validate_approved_plan` and report frontmatter `approved` recognition plus unresolved Blocks=approval rows |
646
+ | `okstra render-bundle <args…> [--stage <auto\|N>] [--stages <csv>]` | Thin shim over `prepare_task_bundle(render_only=True)` with the same signature as `python3 -m okstra_ctl.run --render-only`. `--stage` is for `implementation` and `final-verification`: for implementation, `auto` (default) selects the earliest incomplete stage with satisfied dependencies, while `<N>` forces a stage; for final-verification, `<N>` verifies one stage with artifacts under `runs/final-verification/stage-<N>/` and a `-fv-s<N>` team suffix, while an empty value performs whole-task verification with the flat layout. The separate `--stages <csv>` channel is for `release-handoff`: stage-group mode bundles the listed stage numbers into one PR, while an empty value selects whole-task mode. Preparation enforces eligibility—`done` + accepted `verified` + not yet `pr`—and automatically creates an input document that cites verification reports |
647
+ | `okstra codex-run <args…>` | Codex lead-adapter dry-run entry point. Accepts the same arguments as `render-bundle` but owns `--render-only --lead-runtime codex`. It prepares the task bundle and prints the prompt for the Codex lead without dispatching workers |
648
+ | `okstra codex-dispatch --project-root <dir> --run-manifest <path> [--workers codex,antigravity,report-writer]` | Read a run manifest prepared by `codex-run` and execute the Codex-side supported worker subset. Without `--workers`, unsupported roster members such as `claude` are skipped; explicitly requesting one fails. The report writer requires opt-in with `--enable-codex-report-writer --report-writer-codex-model <model>`. On success, it automatically performs token-usage substitution, HTML view rendering, follow-up task-stub generation, and run validation |
649
+ | `okstra team dispatch --project-root <dir> --run-manifest <path> [--workers <csv>] [--jobs-file <path>] [--dry-run]` / `okstra team await --project-root <dir> --run-manifest <path> [--json]` / `okstra team teardown --project-root <dir> --run-manifest <path> [--dry-run] [--json]` | Read a `leadRuntime=external` run manifest and dispatch, await, or tear down tmux-pane workers. If a tmux pane cannot be created, gracefully degrade to the CLI wrapper and record the fallback in `workerDispatches[].degradedFrom` |
650
+ | `okstra render-views <final-report.md>` | Phase 7 step 1.5: deterministically create a human-facing self-contained sibling `*.html` view from one final-report Markdown file after token substitution. The source Markdown is unchanged. The Node delegation wrapper calls `scripts/okstra-render-report-views.py`; `validators/validate-report-views.py` verifies form-control placement, absence of external URLs, stale source digests, and Response ID parity |
651
+ | `okstra wizard <init\|step\|render-args\|confirmation\|outcome> --state-file <path>` | Interactive input state machine for okstra-run, implemented by `okstra_ctl.wizard`. Seed a state file with `init`, then repeatedly call `step --answer <val>` to receive the next `Prompt` JSON. `--answer` is **required**; use `--no-submit` to peek at the next prompt without submitting a response. `render-args` returns the final `render-bundle` argument map, and `confirmation` returns the user echo block. On a completed wizard, `outcome` returns `renderArgs`, `persistActions`, and `confirmationText` together; project/global release-handoff PR-template persistence appears as `persistActions[].command == "config.set"`. For an `implementation` task type, `stage_pick` follows `approved_plan_pick` and selects the stage before `executor_pick`. The brief step appears only for entry task types—requirements-discovery, error-analysis, and improvement-discovery. Downstream phases automatically carry the manifest brief, with a three-option `brief_carry` fallback when none is registered; `release-handoff` has no brief and enters multi-select `handoff_stage_pick` for eligible stage groups or the whole task |
652
+ | `okstra token-usage ...` | Wrap the installed `okstra-token-usage.py` to collect and substitute run token usage. Session JSONL is incrementally scanned by default through a byte-cursor cache at `$OKSTRA_HOME/cache/token-usage/`; `--no-cache` bypasses the cache and forces a full rescan as an accuracy fallback |
653
+
654
+ > Every subcommand is wired to `PYTHONPATH` and `~/.okstra/lib/python` by the Python helper (`src/lib/python-helper.mjs`) spawned by `bin/okstra`. When invoking `python3 -m okstra_ctl.*` directly, you must configure `PYTHONPATH` yourself.
655
+
656
+ ### Live-log sidecar
657
+
658
+ For every dispatch, the Codex and Antigravity wrappers create a `runs/<task-type>/prompts/<worker>-prompt-<phase>-<seq>.log` sidecar and mirror stdout and stderr into it. When the lead runs inside tmux, the wrapper automatically splits a `tail -F` pane. The trace pane title is `<cli>-<role>-<pid>-tail`, and the caller/worker pane title is `<cli>-<role>-<pid>`; the wrapper PID distinguishes concurrent dispatches with the same role. Split trace panes are tagged with the `@okstra_trace_run=<RUN_DIR>` pane user option, and tmux-pane backend worker-compute panes with `@okstra_worker_run=<RUN_DIR>`. When Claude receives `/exit`, the `SessionEnd` hook automatically cleans them up within `$CLAUDE_PROJECT_DIR/.okstra/` scope by running `okstra-trace-cleanup.sh --reap`. When the lead calls the same script with `--run-dir <RUN_DIR>`, it removes the run's trace panes, worker-compute panes, and dispatched worker-agent panes within the lead-session scope, while excluding the lead's own pane. Worker-agent titles include `claude-worker`, `codex-worker`, `antigravity-worker`, `report-writer-worker`, implementation role titles, and FleetView teammate prefixes `✳ ` / `⠂ `. Before entering a new phase, the lead runs `okstra-trace-cleanup.sh --run-dir <RUN_DIR>` once to clear stale panes.