okstra 0.147.0 → 0.148.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -7
- package/docs/architecture/storage-model.md +34 -61
- package/docs/architecture.md +51 -49
- package/docs/cli.md +38 -21
- package/docs/for-ai/skills/okstra-run.md +13 -34
- package/docs/performance-improvement-plan-v2.md +2 -2
- package/docs/pr-template-usage.md +1 -1
- package/docs/project-structure-overview.md +10 -8
- package/docs/task-process/README.md +4 -4
- package/docs/task-process/common-flow.md +12 -12
- package/docs/task-process/final-verification.md +2 -2
- package/docs/task-process/implementation.md +1 -1
- package/docs/task-process/release-handoff.md +1 -1
- package/package.json +2 -2
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/workers/antigravity-worker.md +2 -2
- package/runtime/agents/workers/claude-worker.md +1 -1
- package/runtime/agents/workers/codex-worker.md +2 -2
- package/runtime/agents/workers/grok-worker.md +256 -0
- package/runtime/agents/workers/kimi-worker.md +256 -0
- package/runtime/agents/workers/report-writer-worker.md +2 -2
- package/runtime/bin/lib/okstra/cli.sh +13 -1
- package/runtime/bin/lib/okstra/globals.sh +3 -0
- package/runtime/bin/lib/okstra/usage.sh +17 -12
- package/runtime/bin/okstra-grok-exec.sh +5 -0
- package/runtime/bin/okstra-kimi-exec.sh +5 -0
- package/runtime/bin/okstra-provider-exec.py +235 -0
- package/runtime/bin/okstra.sh +3 -0
- package/runtime/prompts/lead/adapters/antigravity.md +48 -0
- package/runtime/prompts/lead/adapters/claude-code.md +13 -11
- package/runtime/prompts/lead/adapters/codex.md +7 -7
- package/runtime/prompts/lead/okstra-lead-contract.md +1 -1
- package/runtime/prompts/lead/report-writer.md +1 -1
- package/runtime/prompts/profiles/_coding-conventions-preflight.md +1 -1
- package/runtime/prompts/profiles/_common-contract.md +4 -4
- package/runtime/prompts/profiles/_implementation-deliverable.md +2 -2
- package/runtime/prompts/profiles/_implementation-diff-review.md +1 -1
- package/runtime/prompts/profiles/_implementation-executor.md +12 -12
- package/runtime/prompts/profiles/_implementation-self-check.md +4 -4
- package/runtime/prompts/profiles/_implementation-verifier.md +3 -3
- package/runtime/prompts/profiles/change-impact-analysis.md +2 -0
- package/runtime/prompts/profiles/error-analysis.md +2 -0
- package/runtime/prompts/profiles/feature-analysis.md +2 -0
- package/runtime/prompts/profiles/final-verification.md +3 -1
- package/runtime/prompts/profiles/forbidden-actions.json +4 -4
- package/runtime/prompts/profiles/implementation-planning.md +3 -1
- package/runtime/prompts/profiles/implementation.md +2 -2
- package/runtime/prompts/profiles/improvement-discovery.md +3 -1
- package/runtime/prompts/profiles/project-analysis.md +2 -0
- package/runtime/prompts/profiles/release-handoff.md +7 -7
- package/runtime/prompts/profiles/requirements-discovery.md +2 -0
- package/runtime/prompts/wizard/prompts.ko.json +9 -1
- package/runtime/python/okstra_ctl/codex_dispatch.py +68 -87
- package/runtime/python/okstra_ctl/dispatch_core.py +4 -22
- package/runtime/python/okstra_ctl/lead_events.py +1 -1
- package/runtime/python/okstra_ctl/lead_runtime.py +13 -2
- package/runtime/python/okstra_ctl/models.py +156 -8
- package/runtime/python/okstra_ctl/path_hints.py +9 -25
- package/runtime/python/okstra_ctl/paths.py +1 -1
- package/runtime/python/okstra_ctl/render.py +172 -74
- package/runtime/python/okstra_ctl/report_html/common.py +38 -2
- package/runtime/python/okstra_ctl/report_html/filters.py +104 -0
- package/runtime/python/okstra_ctl/report_html/render.py +12 -0
- package/runtime/python/okstra_ctl/report_html/view_models/change_impact_analysis.py +2 -1
- package/runtime/python/okstra_ctl/report_html/view_models/error_analysis.py +2 -1
- package/runtime/python/okstra_ctl/report_html/view_models/feature_analysis.py +2 -1
- package/runtime/python/okstra_ctl/report_html/view_models/final_verification.py +2 -1
- package/runtime/python/okstra_ctl/report_html/view_models/implementation.py +2 -1
- package/runtime/python/okstra_ctl/report_html/view_models/implementation_planning.py +2 -1
- package/runtime/python/okstra_ctl/report_html/view_models/improvement_discovery.py +2 -1
- package/runtime/python/okstra_ctl/report_html/view_models/release_handoff.py +2 -1
- package/runtime/python/okstra_ctl/report_html/view_models/requirements_discovery.py +2 -1
- package/runtime/python/okstra_ctl/report_html/visualizations.py +32 -6
- package/runtime/python/okstra_ctl/run.py +264 -45
- package/runtime/python/okstra_ctl/runner_resolution.py +103 -0
- package/runtime/python/okstra_ctl/team.py +2 -7
- package/runtime/python/okstra_ctl/wizard.py +194 -21
- package/runtime/python/okstra_ctl/worker_artifacts.py +46 -0
- package/runtime/python/okstra_ctl/workers.py +3 -1
- package/runtime/python/okstra_ctl/workflow.py +4 -2
- package/runtime/python/okstra_token_usage/__init__.py +1 -0
- package/runtime/python/okstra_token_usage/collect.py +32 -23
- package/runtime/python/okstra_token_usage/pricing.py +35 -3
- package/runtime/schemas/final-report-v2.0.schema.json +2 -2
- package/runtime/skills/okstra-run/SKILL.md +31 -42
- package/runtime/templates/prd/pr-body.template.md +1 -1
- package/runtime/templates/reports/html/assets/base.css +12 -3
- package/runtime/templates/reports/html/base.template.html +23 -8
- package/runtime/templates/reports/html/macros/forms.html +11 -9
- package/runtime/templates/reports/html/macros/layout.html +5 -5
- package/runtime/templates/reports/html/macros/visualizations.html +11 -1
- package/runtime/templates/reports/html/tasks/change-impact-analysis.template.html +11 -11
- package/runtime/templates/reports/html/tasks/error-analysis.template.html +12 -12
- package/runtime/templates/reports/html/tasks/feature-analysis.template.html +9 -9
- package/runtime/templates/reports/html/tasks/final-verification.template.html +7 -7
- package/runtime/templates/reports/html/tasks/implementation-planning.template.html +12 -12
- package/runtime/templates/reports/html/tasks/implementation.template.html +7 -7
- package/runtime/templates/reports/html/tasks/improvement-discovery.template.html +6 -6
- package/runtime/templates/reports/html/tasks/project-analysis.template.html +11 -11
- package/runtime/templates/reports/html/tasks/release-handoff.template.html +5 -5
- package/runtime/templates/reports/html/tasks/requirements-discovery.template.html +8 -8
- package/runtime/templates/reports/report.js +28 -5
- package/runtime/templates/reports/settings.template.json +4 -0
- package/runtime/templates/reports/task-brief.template.md +7 -7
- package/runtime/validators/validate-run.py +11 -6
- package/runtime/validators/validate_session_conformance.py +2 -1
- package/src/cli-registry.mjs +4 -4
- package/src/commands/execute/codex-dispatch.mjs +7 -10
- package/src/commands/execute/render-bundle.mjs +3 -3
- package/src/commands/execute/run.mjs +17 -52
- package/src/commands/execute/wizard.mjs +4 -1
- package/src/commands/lifecycle/doctor.mjs +6 -3
- package/src/commands/lifecycle/install.mjs +31 -8
- package/src/lib/runtime-manifest.mjs +1 -1
- package/src/lib/runtime-resolver.mjs +2 -2
- package/src/lib/worker-agent-render.mjs +50 -0
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<a id="purpose"></a>
|
|
21
21
|
## 1. Purpose
|
|
22
22
|
|
|
23
|
-
`okstra` is a **
|
|
23
|
+
`okstra` is a **host-aware, multi-provider task runner that cross-verifies work with a lead + worker model**. The current Claude Code, Codex, or Antigravity host supplies the native lead session; every other selected provider runs through its registered CLI wrapper. Claude remains the compatibility default policy, not the owner of the lifecycle.
|
|
24
24
|
|
|
25
25
|
The design rests on three principles:
|
|
26
26
|
|
|
@@ -28,6 +28,20 @@ The design rests on three principles:
|
|
|
28
28
|
- **Persistent task identity**: a stable `<project-id>/<task-group>/<task-id>` task key carries context across phases, sessions, and model upgrades.
|
|
29
29
|
- **Enforced lead/worker contract**: output schemas and validation procedures are bound to `templates/` + `validators/`, and the worker roster is fixed per phase.
|
|
30
30
|
|
|
31
|
+
Role assignments are persisted separately from the host runtime, but the lead provider is always derived from that runtime:
|
|
32
|
+
|
|
33
|
+
| Provider | Native host | CLI wrapper | Public roles |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| Claude | Claude Code | `okstra-claude-exec.sh` | lead, analysis, implementation, report writer |
|
|
36
|
+
| Codex | Codex | `okstra-codex-exec.sh` | lead, analysis, implementation, report writer |
|
|
37
|
+
| Antigravity | Antigravity CLI | `okstra-antigravity-exec.sh` | lead, analysis, and implementation |
|
|
38
|
+
| Grok | none | `okstra-grok-exec.sh` | read-only analyser and critic |
|
|
39
|
+
| Kimi | none | `okstra-kimi-exec.sh` | read-only analyser and critic |
|
|
40
|
+
|
|
41
|
+
Grok and Kimi are intentionally read-only in this release. Their wrappers, model aliases, installation, diagnostics, and usage-pricing paths are integrated, but a real authenticated local invocation still depends on the corresponding CLI being installed and configured.
|
|
42
|
+
|
|
43
|
+
The next direct-CLI candidates are Mistral Vibe and Qwen Code. DeepSeek V4, GLM-5.2, and MiniMax M2.7 remain API-adapter candidates because their current official coding-agent execution surfaces do not fit Okstra's wrapper contract as directly. Newly published provider models are exposed only after the corresponding local CLI reports them; this keeps model discovery separate from marketing availability.
|
|
44
|
+
|
|
31
45
|
okstra is **not** a one-shot code review tool. It is for work that **spans multiple phases, needs input from multiple agents, and feeds each phase's output into the next phase**.
|
|
32
46
|
|
|
33
47
|
<a id="structure"></a>
|
|
@@ -63,7 +77,7 @@ During `prepack`, `tools/build.mjs` rebuilds `runtime/` from `scripts/`, `skills
|
|
|
63
77
|
~/.okstra/ runtime home, created by `okstra install`
|
|
64
78
|
├── version package version stamp
|
|
65
79
|
├── lib/python/ okstra_project/, okstra_ctl/, okstra_token_usage/, lib/
|
|
66
|
-
├── bin/ okstra.sh
|
|
80
|
+
├── bin/ okstra.sh and Claude/Codex/Antigravity/Grok/Kimi wrappers
|
|
67
81
|
├── templates/ report assets and settings templates
|
|
68
82
|
├── prompts/ lead operating contracts (prompts/lead/*) + coding-preflight resource pack
|
|
69
83
|
├── installed-runtimes.json installed runtime adapter manifest
|
|
@@ -82,7 +96,7 @@ During `prepack`, `tools/build.mjs` rebuilds `runtime/` from `scripts/`, `skills
|
|
|
82
96
|
└── okstra-*/SKILL.md 8 user-facing skills only (setup/brief/run/memory/inspect/schedule/container/manager)
|
|
83
97
|
|
|
84
98
|
~/.claude/agents/ automatically discovered by Claude Code (when `~/.claude` exists)
|
|
85
|
-
└── {claude,codex,antigravity,report-writer}-worker.md worker
|
|
99
|
+
└── {claude,codex,antigravity,grok,kimi,report-writer}-worker.md worker definitions
|
|
86
100
|
(required for Claude Code multi-agent dispatch)
|
|
87
101
|
|
|
88
102
|
<project-root>/.okstra/
|
|
@@ -195,7 +209,7 @@ To start a task outside a Claude Code session:
|
|
|
195
209
|
--task-brief ./brief.md
|
|
196
210
|
```
|
|
197
211
|
|
|
198
|
-
`feature-analysis` is intentionally omitted from the standalone shell example. Start it with
|
|
212
|
+
`feature-analysis` is intentionally omitted from the standalone shell example. Start it with the in-host `okstra-run` skill: the wizard collects its required feature target and passes that value through the internal Node render boundary. Standalone `okstra.sh` accepts neither `--analysis-target` nor `--evidence-inputs`.
|
|
199
213
|
|
|
200
214
|
This starts a new `claude` process in the lead role. For the complete argument list, see `okstra.sh --help` or [`docs/cli.md`](docs/cli.md).
|
|
201
215
|
|
|
@@ -208,10 +222,10 @@ Notable flags added in 0.7.0 / 0.8.0:
|
|
|
208
222
|
Major workflow changes added to `main` after 0.8.0:
|
|
209
223
|
|
|
210
224
|
- **Automatic isolated worktrees for every task type** — During preparation, `okstra-ctl` runs `git worktree add ~/.okstra/worktrees/<project-id>/<task-group-segment>/<task-id-segment>` once per task key to create an isolated working tree and a `<work-category-namespace>/<task-id-segment>` branch (for example, `feature/dev-9436` or `fix/dev-7311`). The user chooses the base ref with `--base-ref`, using the same choices as the release-handoff PR base picker: `main`, `dev`, `staging`, `preprod`, `prod`, or a custom value. It is required in the first phase; the okstra-run skill collects it through `AskUserQuestion`, while non-interactive callers must pass `--base-ref` explicitly. Later **non-`implementation`** phases for the same task key (`requirements-discovery` → `error-analysis` → `implementation-planning` → `final-verification` → `release-handoff`) reuse the same path and branch. `implementation` runs are **stage-isolated**: each run executes one stage in its own `.../<task>/stage-<N>/` worktree on a `<work-category-namespace>/<task>-s<N>` branch, so independent stages with `depends-on (none)` can run concurrently without sharing a tree. The registry reserves both task keys and **stage keys** with flock. Provisioning is skipped when the caller is already in another worktree or project_root is not a Git repository; stage isolation degrades to a flat path in those cases. Manual cleanup: `git worktree remove <path>` → `git branch -D <branch>` plus release/removal of the registry entry. Details: [`docs/architecture.md`](docs/architecture.md), in the *Task type* section, and [`docs/cli.md#--executor`](docs/cli.md#--executor).
|
|
211
|
-
- **`release-handoff` lifecycle phase** — runs immediately after `final-verification` returns `verdict=accepted`.
|
|
225
|
+
- **`release-handoff` lifecycle phase** — runs immediately after `final-verification` returns `verdict=accepted`. The current Okstra lead drafts the candidate messages and PR body inline, then uses the selected host adapter's user-prompt operation for the delivery choices. Only the Git/GitHub CLI commands selected through those menus are run. Force pushes, direct pushes to the base branch, hook bypasses (`--no-verify`), and release publication (`gh release`, `npm publish`, and similar commands) are prohibited. This phase does not edit source code. Profile: [`prompts/profiles/release-handoff.md`](prompts/profiles/release-handoff.md).
|
|
212
226
|
- **Configurable PR body template** (release-handoff) — PR bodies are populated from a Markdown template selected in this order: one-time override (`--pr-template-path` or the okstra-run Step 6 prompt) → `prTemplatePath` in `<project_root>/.okstra/project.json` → `prTemplatePath` in `~/.okstra/config.json` → the skill default at `~/.claude/skills/templates/prd/pr-body.template.md`. Register a template with `okstra config set pr-template-path <path> [--scope project|global]`; project scope accepts a path relative to the project root, while global scope requires an absolute path or a path beginning with `~/`. `okstra config get pr-template-path --scope all` prints every scoped value and the effective winner. The default template contains `## Summary`, `## Changes`, `## Test plan`, and `## Linked issues`, plus HTML comment guidance that the lead removes immediately before PR creation.
|
|
213
227
|
- **Profile worker-roster validation** — `--workers <csv>` and the okstra-run Step 6 worker prompt accept only the worker IDs declared in the selected profile's `Required workers:` block. Requesting a worker absent from the profile—for example, `codex` or `antigravity` for `release-handoff`—fails with a clear error, and the interactive prompt shows only workers accepted by that profile.
|
|
214
|
-
- **
|
|
228
|
+
- **Host-aware lead adapters** — the same `okstra-run` skill resolves Claude Code to `leadRuntime=claude-code`, Codex to `leadRuntime=codex`, Antigravity CLI to `leadRuntime=antigravity`, and another explicit host to `external`. Claude Code keeps Claude assignments native, Codex keeps Codex assignments native, and Antigravity keeps Antigravity assignments native; every other selected provider runs through its registered CLI wrapper. The lead provider is derived from the host and cannot be replaced independently. `leadAssignment` and every `workerAssignments[]` row record provider, model, and `runner`. `okstra codex-run` and `okstra codex-dispatch` remain low-level artifact/dispatch commands.
|
|
215
229
|
- **Multi-stage `implementation-planning` / `implementation`** — `implementation-planning` always produces a Stage Map and N stage sections. Each stage has no more than six steps, and stages with `depends-on (none)` can be implemented concurrently in separate `implementation` runs. Each `implementation` invocation runs a single stage, selected with `--stage <auto|N>`, and creates an evidence sidecar at `carry/stage-<N>.json` for automatic carry-in to the next stage. The `implementation-planning` run directory accumulates `consumers.jsonl` reverse links that record which run consumed each stage.
|
|
216
230
|
- **AI-prepared design preparation (implementation-planning → implementation)** — `implementation-planning` detects which stages need design input (domain contract, DB/table schema, external interface, transaction/consistency, transformation mapping, lifecycle, rollout/observability, manual user test) and has the AI draft a concrete proposal first, instead of handing the user an empty design document. Each item is assessed as `ready`, `provisional`, `blocked`, or `not-applicable`; a simple task may declare `no-design-inputs`. Phase 7 materializes an Okstra-owned request under `design-prep-requests/`, and `okstra design-prep <list|show|write>` or the okstra-run wizard records the confirmed answer as an **append-only** revision under `design-prep-inputs/`—neither path ever edits the approved planning snapshot. Before creating its worktree, `implementation` resolves only the items its selected stage cites in `stageRefs`: safe `provisional` assumptions are injected into the executor prompt so work proceeds, while an unsafe open decision makes only that stage wait or replan. A markerless legacy plan continues with a `legacy-unassessed` warning. Storage authorities: [`docs/architecture/storage-model.md`](docs/architecture/storage-model.md). CLI: [`docs/cli.md#okstra-design-prep`](docs/cli.md#okstra-design-prep).
|
|
217
231
|
- **Phase 6 plan-body verification (implementation-planning only)** — Immediately after the report-writer worker drafts the final report and before the user approval gate, the lead performs one post-verification round. It extracts `P-Opt-*`, `P-Step-*`, `P-Dep-*`, `P-Val-*`, and `P-Rb-*` plan items from the synthesized `## 5.5` implementation plan deliverables and asks every analyzer worker for an `AGREE`, `DISAGREE(a-e)`, or `SUPPLEMENT` verdict. The aggregate result is `passed`, `passed-with-dissent`, `blocked-by-disagreement`, or `aborted-non-result`. The frontmatter `approved` field is always published as `false`; a blocking result keeps it false and becomes a row in `## 1. Clarification Items`. For fast iteration, opt out with `--no-plan-verification`. Contract details: the "Plan-body verification mode" section of [`prompts/lead/convergence.md`](prompts/lead/convergence.md) and [`docs/cli.md#--no-plan-verification`](docs/cli.md#--no-plan-verification).
|
|
@@ -227,7 +241,7 @@ Major workflow changes added to `main` after 0.8.0:
|
|
|
227
241
|
| Command | Purpose |
|
|
228
242
|
|---|---|
|
|
229
243
|
| `npx -y okstra@latest paths` | Print runtime paths (`--field <name>` or `--shell`) |
|
|
230
|
-
| `npx -y okstra@latest doctor [--runtime claude-code\|codex\|all] [--phase <phase>]` | Diagnose runtime, skills, and Python imports. `codex`
|
|
244
|
+
| `npx -y okstra@latest doctor [--runtime claude-code\|codex\|antigravity\|external\|all] [--phase <phase>]` | Diagnose runtime, skills, and Python imports. `codex`, `antigravity`, and `external` exclude Claude skill checks; `--phase` adds readiness checks for implementation, final-verification, release-handoff, and improvement-discovery |
|
|
231
245
|
| `npx -y okstra@latest ensure-installed` | Run an idempotent check and automatically reinstall stale assets (skills call this internally) |
|
|
232
246
|
| `npx -y okstra@latest setup --project-id <id>` | Register the current project in `.okstra/project.json` |
|
|
233
247
|
| `npx -y okstra@latest check-project` | Verify that the current project was registered with `setup` |
|
|
@@ -11,54 +11,27 @@ Files created by `okstra` are stored in the following three areas according to t
|
|
|
11
11
|
This is the task's primary directory.
|
|
12
12
|
The task manifest, task index, instruction set, runs, and history are collected under this root.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
│ ├── prompts/
|
|
36
|
-
│ │ ├── claude-execution-prompt-<task-type>-<seq>.md
|
|
37
|
-
│ │ ├── claude-worker-prompt-<task-type>-<seq>.md
|
|
38
|
-
│ │ ├── codex-worker-prompt-<task-type>-<seq>.md
|
|
39
|
-
│ │ ├── antigravity-worker-prompt-<task-type>-<seq>.md
|
|
40
|
-
│ │ └── report-writer-worker-prompt-<task-type>-<seq>.md
|
|
41
|
-
│ ├── reports/
|
|
42
|
-
│ │ ├── final-report-<task-type>-<seq>.data.json
|
|
43
|
-
│ │ ├── final-report-<task-type>-<seq>.md
|
|
44
|
-
│ │ └── final-report-<task-type>-<seq>.html
|
|
45
|
-
│ ├── design-prep-requests/ # implementation-planning only; deterministic Okstra-owned drafts
|
|
46
|
-
│ ├── design-prep-inputs/ # implementation-planning only; append-only user/wizard responses
|
|
47
|
-
│ ├── status/
|
|
48
|
-
│ │ └── final-<task-type>-<seq>.status
|
|
49
|
-
│ ├── sessions/
|
|
50
|
-
│ │ └── claude-resume-<task-type>-<seq>.sh
|
|
51
|
-
│ ├── logs/
|
|
52
|
-
│ │ └── errors-<task-type>-<seq>.jsonl # optional, lead-only writer
|
|
53
|
-
│ └── worker-results/
|
|
54
|
-
├── history/
|
|
55
|
-
│ ├── timeline.json
|
|
56
|
-
│ └── fix-cycles.jsonl # optional, created only when entering a fix cycle (append-only)
|
|
57
|
-
├── recap/
|
|
58
|
-
│ └── recap-log.jsonl # optional, append-only before/after summaries and Q&A for recap (other artifacts unchanged)
|
|
59
|
-
└── notes/
|
|
60
|
-
└── <slug>-<YYYY-MM-DD>.md # optional, agent-authored notes written by `okstra recap note` (evidence/decision-draft/analysis); inert — never auto-read by a run, fed forward only via --clarification-response
|
|
61
|
-
```
|
|
14
|
+
- `<target-project>/.okstra/tasks/<task-group>/<task-id>/`
|
|
15
|
+
- `task-manifest.json`
|
|
16
|
+
- `task-index.md`
|
|
17
|
+
- `instruction-set/`
|
|
18
|
+
- `analysis-profile.md`, `analysis-packet.md`, `analysis-material.md`, `reference-expectations.md`, `task-brief.md`
|
|
19
|
+
- `verification-target.md` for final verification and optional `directive.txt`
|
|
20
|
+
- `final-report-schema.json`, `final-report-template.md`
|
|
21
|
+
- canonical `lead-execution-prompt.md` plus the `claude-execution-prompt.md` compatibility alias
|
|
22
|
+
- `runs/<task-type>/`
|
|
23
|
+
- `manifests/run-manifest-<task-type>-<seq>.json`
|
|
24
|
+
- `state/team-state-<task-type>-<seq>.json`
|
|
25
|
+
- `prompts/lead-execution-prompt-<task-type>-<seq>.md` and selected `<worker>-worker-prompt-<task-type>-<seq>.md` files
|
|
26
|
+
- `reports/final-report-<task-type>-<seq>.{data.json,md,html}`
|
|
27
|
+
- implementation-planning-only `design-prep-requests/` and `design-prep-inputs/`
|
|
28
|
+
- `status/final-<task-type>-<seq>.status`
|
|
29
|
+
- Claude compatibility launcher sessions under `sessions/claude-resume-<task-type>-<seq>.sh`
|
|
30
|
+
- optional lead-written `logs/errors-<task-type>-<seq>.jsonl`
|
|
31
|
+
- `worker-results/`
|
|
32
|
+
- `history/timeline.json` and optional append-only `history/fix-cycles.jsonl`
|
|
33
|
+
- optional append-only `recap/recap-log.jsonl`
|
|
34
|
+
- optional inert agent notes under `notes/<slug>-<YYYY-MM-DD>.md`; a run reads them only when explicitly carried through `--clarification-response`
|
|
62
35
|
|
|
63
36
|
Actual directory segments may be normalized into slugs to create safe paths.
|
|
64
37
|
However, the logical task key always retains the original input values in the form `project-id:task-group:task-id`.
|
|
@@ -76,10 +49,10 @@ The representative files below are all relative to the resolved run directory (`
|
|
|
76
49
|
|
|
77
50
|
- `manifests/run-manifest-<task-type>-<seq>.json`
|
|
78
51
|
- `state/team-state-<task-type>-<seq>.json`
|
|
79
|
-
- `prompts/
|
|
52
|
+
- `prompts/lead-execution-prompt-<task-type>-<seq>.md` *(canonical; the Claude-named snapshot remains a compatibility alias)*
|
|
80
53
|
- `prompts/<worker>-worker-prompt-<task-type>-<seq>.md`
|
|
81
54
|
|
|
82
|
-
|
|
55
|
+
After the host-native lead takes over, the lead and its assigned workers add the following result files to the current run.
|
|
83
56
|
- `sessions/claude-resume-<task-type>-<seq>.sh`
|
|
84
57
|
- `reports/final-report-<task-type>-<seq>.data.json` *(schema v2 source of truth for both audiences; schema v1 remains readable for compatibility)*
|
|
85
58
|
- `reports/final-report-<task-type>-<seq>.md`
|
|
@@ -102,7 +75,7 @@ Design-preparation storage has three separate authorities:
|
|
|
102
75
|
|
|
103
76
|
The resolver selects the highest unique revision whose assessment fingerprint still matches the approved snapshot. Duplicate revision numbers and stale fingerprints are skipped with warnings rather than granted authority. A markerless legacy plan has no sidecars to migrate: it proceeds with the `legacy-unassessed` warning. This compatibility path does not rewrite its report.
|
|
104
77
|
The final result files are not created by saving worker stdout. The report writer writes `final-report-<task-type>-<seq>.data.json`; Phase 7 derives the Markdown and HTML siblings deterministically. New bundles use `schemas/final-report-v2.0.schema.json` and `templates/reports/final-report-v2.template.md`: AI handoff Markdown and task-specific human HTML are rendered independently from the same v2 data.json. Existing schema v1 data uses `schemas/final-report-v1.0.schema.json` and the legacy `templates/reports/final-report.template.md` compatibility path. Rendering never modifies the source data or a pre-existing Markdown input.
|
|
105
|
-
|
|
78
|
+
For the standalone Claude launcher, `sessions/claude-resume-<task-type>-<seq>.sh` remains an interruption-recovery compatibility helper. In-host Codex runs use host task continuity plus the generic `leadSession` manifest identity.
|
|
106
79
|
|
|
107
80
|
The resolved run directory collects execution history. It divides its contents into type-specific subdirectories such as `manifests/`, `state/`, `prompts/`, `reports/`, `status/`, `sessions/`, and `worker-results/`, then distinguishes each run-level artifact and result file with a `-<task-type>-<seq>` suffix (a three-digit, zero-padded per-category counter, such as `001` or `002`).
|
|
108
81
|
Worker prompt history is retained not under `/tmp`, but always as a canonical artifact under `prompts/` for the current run.
|
|
@@ -168,7 +141,7 @@ Path segments are normalized into slugs. If a slug would be empty, as can happen
|
|
|
168
141
|
|
|
169
142
|
## Task manifest contract
|
|
170
143
|
|
|
171
|
-
`task-manifest.json` is the canonical metadata file
|
|
144
|
+
`task-manifest.json` is the canonical metadata file the active Okstra lead uses to understand task continuity.
|
|
172
145
|
As a general rule, this manifest records the absolute `projectRoot` path only once and expresses the remaining generated paths as project-relative fields whenever possible.
|
|
173
146
|
|
|
174
147
|
Examples of key fields:
|
|
@@ -205,12 +178,13 @@ Examples of key fields:
|
|
|
205
178
|
- `inputs`
|
|
206
179
|
- `artifacts`
|
|
207
180
|
- `resultContract`
|
|
208
|
-
- `
|
|
181
|
+
- `leadSession`
|
|
182
|
+
- `claudeSession` *(Claude-host compatibility only)*
|
|
209
183
|
- `fixCycles` *(derived summary — `{count, openCycleId, latest:{cycle, symptom, targetReport, closedAt}}`; recalculated on every prepare)*
|
|
210
184
|
|
|
211
185
|
This manifest serves the following purposes.
|
|
212
186
|
|
|
213
|
-
- Let
|
|
187
|
+
- Let the active lead understand task continuity before reading the brief
|
|
214
188
|
- Establish which files should be read first
|
|
215
189
|
- Establish how config files and deployment manifests should be interpreted against expected values
|
|
216
190
|
- Establish the task key under which results accumulate
|
|
@@ -248,9 +222,7 @@ Each execution records the current run contract in the resolved `<run-dir>/manif
|
|
|
248
222
|
`state/active-run-context-<task-type>-<seq>.json` is also the compact intake for lead Phase 1 starting with schemaVersion `2.0`. It stores only `identity` + `pathHints` and worker identities instead of repeated path strings, and the deterministic dispatcher hydrates it into the legacy active context shape when reading it.
|
|
249
223
|
|
|
250
224
|
The path fields in `manifests/run-manifest-<task-type>-<seq>.json` are still stored as paths relative to the target project root for validator, team dispatch, and inspect compatibility.
|
|
251
|
-
|
|
252
|
-
Claude then continues with saving the final results and updating status.
|
|
253
|
-
Before launch, `okstra` also preallocates a session ID and creates, under the same run's `sessions/` directory, `claude-resume-<task-type>-<seq>.sh`.
|
|
225
|
+
An in-host prepare records the run as `prepared` and the task as `ready-for-lead`; the current native host session then owns execution. The standalone Claude launcher records `in-progress` after preparing its compatibility resume script.
|
|
254
226
|
|
|
255
227
|
Main contents:
|
|
256
228
|
|
|
@@ -263,7 +235,8 @@ Main contents:
|
|
|
263
235
|
- related tasks
|
|
264
236
|
- selected workers
|
|
265
237
|
- worker model assignments
|
|
266
|
-
-
|
|
238
|
+
- lead session id and accounting mode
|
|
239
|
+
- Claude session id only on the Claude compatibility path
|
|
267
240
|
- resume command relative path
|
|
268
241
|
- expected report relative path
|
|
269
242
|
- expected status relative path
|
|
@@ -297,9 +270,9 @@ The history generally includes the following.
|
|
|
297
270
|
- `fixCycleId` *(only when attached to a fix cycle; field omitted otherwise)*
|
|
298
271
|
Reruns of the same task type reuse the same resolved run directory family. Non-stage runs use `runs/<task-type>/`, while `implementation` and single-stage `final-verification` runs use `runs/<task-type>/stage-<N>/`. Sequence-specific artifacts live beneath that resolved run directory, and each execution accumulates as a separate history entry because `run-manifest-<task-type>-<seq>.json` and related artifact paths are separated by per-category sequence suffixes (`<task-type>-<seq>`). The cross-category identifier is the manifest's `runDateTimeSegment` ISO timestamp field.
|
|
299
272
|
|
|
300
|
-
##
|
|
273
|
+
## Lead operating contract
|
|
301
274
|
|
|
302
|
-
After `okstra`
|
|
275
|
+
After `okstra` prepares a run, the host-native Okstra lead follows this default sequence when reading the current task.
|
|
303
276
|
|
|
304
277
|
1. If task browsing or task-id disambiguation is required, first read `.okstra/discovery/task-catalog.json`.
|
|
305
278
|
2. If the current task key or task path is not specified, read `.okstra/discovery/latest-task.json` as the current-task pointer.
|
|
@@ -310,7 +283,7 @@ After `okstra` runs, Claude should follow this default sequence when reading the
|
|
|
310
283
|
6. Read `task-index.md` only when a quick summary is needed.
|
|
311
284
|
7. Lazily read `analysis-material.md`, `reference-expectations.md`, `task-brief.md`, and `final-report-template.md` when the packet is insufficient or when source citations/report writing require them.
|
|
312
285
|
8. Consult `history/timeline.json` and previous run results if necessary.
|
|
313
|
-
9. As `
|
|
286
|
+
9. As `Okstra lead`, organize roles from `workerAssignments[]`. The host provider stays native; Claude, Codex, Antigravity, Grok, and Kimi assignments use their persisted `native-session` or `cli-wrapper` runner.
|
|
314
287
|
10. Save each selected worker prompt under the current run's `prompts/` directory at the assigned worker prompt history path before dispatching the worker.
|
|
315
288
|
Every selected initial analyser receives the same full-core semantic body for its task, including final-verification. Dispatch and Phase 7 validate the same normalized equality policy; implementation executor, report-writer, and `-reverify-r<N>-` prompts are separate audiences.
|
|
316
289
|
11. In convergence Round 0, the lead groups findings by semantic meaning and ticket set, then writes `state/convergence-groups-<task-type>-<seq>.json`. The deterministic engine seeds the working queue and generates each roster-aware reverify plan; lightweight reverify reads only that persisted batch and its embedded evidence.
|
package/docs/architecture.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## At a glance
|
|
10
10
|
|
|
11
|
-
`okstra` is a **task bundle preparation tool** for
|
|
11
|
+
`okstra` is a **host-aware task bundle preparation tool** for multi-provider cross-verification. It is not a single-file review tool. Instead, it organizes task briefs, profiles, prompts, run history, and project-level discovery metadata around a stable task key so the current host-native lead can orchestrate provider workers consistently.
|
|
12
12
|
|
|
13
13
|
Its core capabilities at a glance are:
|
|
14
14
|
|
|
@@ -16,13 +16,13 @@ Its core capabilities at a glance are:
|
|
|
16
16
|
- **Profiles by task type**: Loads standard task-type profiles such as `requirements-discovery`, `error-analysis`, `implementation-planning`, `implementation`, `final-verification`, and `release-handoff` to render the instruction set.
|
|
17
17
|
- **Run lifecycle**: Non-stage runs use `runs/<task-type>/` as the run directory, while `implementation` and single-stage `final-verification` use `runs/<task-type>/stage-<N>/`. Manifests, prompts, state, reports, sessions, worker results, and logs accumulate beneath the resolved run directory, and the filename suffix `-<task-type>-<seq>` separates reruns of the same phase.
|
|
18
18
|
- **Single python authority**: All prepare wiring—resolving profiles/workers/models, computing paths, rendering, and central record_start—is concentrated in a single function, [`okstra_ctl.run.prepare_task_bundle()`](../scripts/okstra_ctl/run.py). `okstra.sh` and the `okstra-run` skill are thin callers of that same function and do not pass state through environment variables. Task identity, paths, and workflow state are recalculated from authoritative on-disk files every time.
|
|
19
|
-
- **
|
|
20
|
-
- **Required team contract**: The `Required workers:` block in each phase profile is authoritative for the roster. General analysis phases use Claude/Codex
|
|
21
|
-
- **User-home install + project-local task bundles**: One `npx okstra@latest install` command installs the runtime (`~/.okstra/{lib/python, bin, templates, prompts}`) and installs public skills to `~/.agents/skills/` by default. If `~/.claude` exists, it also installs Claude skills and
|
|
19
|
+
- **Host-aware handoff**: Claude Code, Codex, and Antigravity keep their current native session as the lead. The standalone compatibility launcher still starts a new `claude` process by default, while the external adapter uses registered CLI wrappers. Every path consumes the same `prepare_task_bundle` outputs.
|
|
20
|
+
- **Required team contract**: The `Required workers:` block in each phase profile is authoritative for the roster. General analysis phases use Claude/Codex analysers plus a report writer by default, while Antigravity, Grok, and Kimi are included only when allowed by both the profile and `--workers`. Lead-oriented phases such as `release-handoff` have separate rosters.
|
|
21
|
+
- **User-home install + project-local task bundles**: One `npx okstra@latest install` command installs the runtime (`~/.okstra/{lib/python, bin, templates, prompts}`) and installs public skills to `~/.agents/skills/` by default. If `~/.claude` exists, it also installs Claude skills and six worker agent definitions (`~/.claude/agents/*-worker.md`). Only user entry-point skills are exposed in the skill list; lead/support operating contracts are installed as runtime resources under `~/.okstra/prompts/` and are not discoverable as skills. Global conversation memory is stored separately from projects under `~/.okstra/memory-book/`. Task bundles and discovery metadata are stored under `.okstra/` in the target project. **In addition, `<PROJECT_ROOT>/.claude/settings.local.json` is provisioned as a symlink to `~/.okstra/templates/settings.local.json`** (`okstra setup` or `okstra-ctl` prepare manages it idempotently; if a regular file already existed, it is preserved as `.bak.<timestamp>` before replacement).
|
|
22
22
|
- **Resume and clarification**: Supports resuming the same task and responding to follow-up questions from the lead through `--task-key`, `--resume-clarification`, and `--clarification-response`.
|
|
23
23
|
- **Dual-audience derived views and telemetry**: For schema v2, derives AI handoff Markdown and task-specific human-facing HTML independently from the same v2 data.json. Schema v1 and quick Markdown reports keep their compatibility renderer. Worker error sidecars, wrapper log sidecars, and token-usage/cost accounting remain separate audit inputs.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
The host-native Okstra lead owns judgment policy and worker orchestration. `okstra` prepares one runtime-neutral task bundle and resolves every provider assignment to either the current native session or a registered CLI wrapper.
|
|
26
26
|
|
|
27
27
|
## Table of contents
|
|
28
28
|
|
|
@@ -30,8 +30,8 @@ Claude lead owns judgment policy and worker orchestration. `okstra` focuses on p
|
|
|
30
30
|
- [What okstra does](#what-okstra-does)
|
|
31
31
|
- [Runtime assets vs support assets](#runtime-assets-vs-support-assets)
|
|
32
32
|
- [Architecture: python authority + thin callers](#architecture-python-authority--thin-callers)
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
33
|
+
- [Host runtime execution behavior](#host-runtime-execution-behavior)
|
|
34
|
+
- [Lead prompt contract](#lead-prompt-contract)
|
|
35
35
|
- [Required team contract](#required-team-contract)
|
|
36
36
|
- [Stable task identity](#stable-task-identity)
|
|
37
37
|
- [Project self-registration](#project-self-registration)
|
|
@@ -42,7 +42,7 @@ Claude lead owns judgment policy and worker orchestration. `okstra` focuses on p
|
|
|
42
42
|
- (See [cli.md](cli.md) for CLI arguments, options, and interactive input)
|
|
43
43
|
- [Storage model & contracts](#storage-model--contracts) → [`architecture/storage-model.md`](architecture/storage-model.md)
|
|
44
44
|
- Stable task root / per-run artifacts / `~/.okstra` indexes
|
|
45
|
-
- Task manifest · task index · run manifest · timeline ·
|
|
45
|
+
- Task manifest · task index · run manifest · timeline · runtime-neutral operating contract
|
|
46
46
|
- [Task brief usage](#task-brief-usage)
|
|
47
47
|
- [Recommended workflow](#recommended-workflow)
|
|
48
48
|
- [1. Write a draft](#1-write-a-draft)
|
|
@@ -68,10 +68,10 @@ Claude lead owns judgment policy and worker orchestration. `okstra` focuses on p
|
|
|
68
68
|
## Purpose
|
|
69
69
|
|
|
70
70
|
This document is a task-key-oriented operations guide to using `okstra` in `Okstra`.
|
|
71
|
-
Where `README.md` is the quick entry point, this document is the detailed reference for `okstra`'s execution contract, storage model, lifecycle, and
|
|
71
|
+
Where `README.md` is the quick entry point, this document is the detailed reference for `okstra`'s execution contract, storage model, lifecycle, and host handoff rules.
|
|
72
72
|
|
|
73
73
|
`okstra` is not a single-file review tool.
|
|
74
|
-
`okstra` is a supporting tool that prepares stable task bundles, run history, and project-level discovery metadata so
|
|
74
|
+
`okstra` is a supporting tool that prepares stable task bundles, run history, and project-level discovery metadata so a supported host can perform cross-verification.
|
|
75
75
|
|
|
76
76
|
## What okstra does
|
|
77
77
|
|
|
@@ -80,11 +80,11 @@ okstra's prepare responsibilities are consolidated in a single Python entry poin
|
|
|
80
80
|
- Verifies that okstra installation assets exist (`~/.agents/skills/okstra-*`, optional `~/.claude/skills/okstra-*` / `~/.claude/agents/*-worker.md`, `~/.okstra/bin/...`)
|
|
81
81
|
- Self-registers `<PROJECT_ROOT>/.okstra/project.json` (or verifies that the projectId matches)
|
|
82
82
|
- Loads task type → `prompts/profiles/<task-type>.md` and extracts recommended workers
|
|
83
|
-
- Normalizes user worker/model overrides
|
|
83
|
+
- Normalizes user worker/model overrides through the provider registry (Claude, Codex, Antigravity, Grok, Kimi, and report-writer-capable providers)
|
|
84
84
|
- Resolves task-brief / clarification-response paths (cwd first → PROJECT_ROOT fallback)
|
|
85
85
|
- Computes the stable task root and all paths/sequences inside a per-task mutex (`~/.okstra/.locks/<task-key>.lock`), then persists them to `<run-dir>/manifests/run-context-<seq>.json`
|
|
86
86
|
- Persists user input to `<run-dir>/manifests/run-inputs-<seq>.json`
|
|
87
|
-
- Renders the instruction set (`analysis-profile.md`, `analysis-packet.md`, `analysis-material.md`, `task-brief.md`, `reference-expectations.md`, `final-report-template.md`, `final-report-schema.json`, optional `clarification-response.md`, optional `directive.txt`, final-verification-only `verification-target.md`, `
|
|
87
|
+
- Renders the instruction set (`analysis-profile.md`, `analysis-packet.md`, `analysis-material.md`, `task-brief.md`, `reference-expectations.md`, `final-report-template.md`, `final-report-schema.json`, optional `clarification-response.md`, optional `directive.txt`, final-verification-only `verification-target.md`, canonical `lead-execution-prompt.md`, and its Claude-named compatibility alias) and writes a run prompt snapshot
|
|
88
88
|
- Updates `task-manifest.json`, `task-index.md`, `run-manifest-*.json`, `history/timeline.json`, and `discovery/{latest-task,task-catalog}.json`
|
|
89
89
|
- Writes a preassigned Claude session ID and `sessions/claude-resume-*.sh` (unless `--render-only` is used)
|
|
90
90
|
- Records record_start in the central indexes (`~/.okstra/{active,recent}.jsonl`, `projects/<id>/{index.jsonl, meta.json}`)
|
|
@@ -92,9 +92,9 @@ okstra's prepare responsibilities are consolidated in a single Python entry poin
|
|
|
92
92
|
The two callers of `prepare_task_bundle` are:
|
|
93
93
|
|
|
94
94
|
1. **`scripts/okstra.sh`**: Parses and confirms CLI arguments → calls `prepare_task_bundle` → unless `--render-only` is used, launches `claude --model ... --session-id ... "$PROMPT"` via `exec`. It is a thin wrapper of about 160 lines.
|
|
95
|
-
2. **`okstra-run` skill**: Runs the [`okstra_ctl.wizard`](../scripts/okstra_ctl/wizard.py) state machine (`okstra wizard init|step|...` CLI) in the
|
|
95
|
+
2. **`okstra-run` skill**: Runs the [`okstra_ctl.wizard`](../scripts/okstra_ctl/wizard.py) state machine (`okstra wizard init|step|...` CLI) in the current supported host to collect user input → calls `okstra render-bundle` (that is, `prepare_task_bundle(render_only=True)`) → the current session reads the rendered lead prompt and assumes the lead role. It does not launch a new provider process for the native lead. The wizard decides all branching, validation, and ordering, so the skill body displays either the host's picker (`pick`) or a plain-text message (`text`) according to `Prompt.kind`.
|
|
96
96
|
|
|
97
|
-
The lead
|
|
97
|
+
The host-native Okstra lead owns judgment policy and worker orchestration. okstra's prepare stage only creates structured assets so that the lead starts with the correct input bundle and output skeleton.
|
|
98
98
|
|
|
99
99
|
## Runtime assets vs support assets
|
|
100
100
|
|
|
@@ -127,7 +127,7 @@ Runtime entry points are consolidated in Python packages. Bash and skills only c
|
|
|
127
127
|
|
|
128
128
|
### Bash entry points (thin)
|
|
129
129
|
|
|
130
|
-
- [`scripts/okstra.sh`](../scripts/okstra.sh) — CLI parsing / interactive prompt /
|
|
130
|
+
- [`scripts/okstra.sh`](../scripts/okstra.sh) — standalone compatibility launcher: CLI parsing / interactive prompt / `prepare_task_bundle` invocation / default `exec claude`. In-host Claude Code, Codex, and Antigravity runs use `okstra-run` and keep their current native session.
|
|
131
131
|
- [`scripts/lib/okstra/{cli,globals,interactive,project-resolver,usage}.sh`](../scripts/lib/okstra/) — CLI/interactive support only; contains no artifact-generation logic.
|
|
132
132
|
- [`scripts/okstra-ctl.sh`](../scripts/okstra-ctl.sh) + [`scripts/lib/okstra-ctl/`](../scripts/lib/okstra-ctl/) — central control-center CLI (list / show / open / rerun / reconcile / etc.).
|
|
133
133
|
|
|
@@ -146,10 +146,11 @@ Runtime entry points are consolidated in Python packages. Bash and skills only c
|
|
|
146
146
|
### Skills (`skills/`) and lead resources (`prompts/`)
|
|
147
147
|
|
|
148
148
|
- [`prompts/lead/okstra-lead-contract.md`](../prompts/lead/okstra-lead-contract.md) is the runtime-neutral lifecycle core: phase boundaries, artifacts, convergence, report ownership, and persistence semantics.
|
|
149
|
-
- `prompts/lead/adapters/claude-code.md`, `prompts/lead/adapters/codex.md`, and `prompts/lead/adapters/external.md` map the same semantic operations to one selected host runtime. The generated launch prompt exposes the core path plus exactly one adapter path.
|
|
150
|
-
- Runtime
|
|
149
|
+
- `prompts/lead/adapters/claude-code.md`, `prompts/lead/adapters/codex.md`, `prompts/lead/adapters/antigravity.md`, and `prompts/lead/adapters/external.md` map the same semantic operations to one selected host runtime. The generated launch prompt exposes the core path plus exactly one adapter path.
|
|
150
|
+
- Runtime metadata and role assignments are persisted separately, but the lead provider is derived from the host: Claude Code maps to Claude, Codex maps to Codex, and Antigravity CLI maps to Antigravity. New runs persist `hostRuntime`, `leadAssignment`, and `workerAssignments[]`; each assignment records its provider, model, execution value, and resolved `native-session` or `cli-wrapper` runner. `lead-execution-prompt.md` is canonical, while `claude-execution-prompt.md` is a byte-identical compatibility alias for historical consumers.
|
|
151
|
+
- Provider registry and front-door separation are implemented: the active Claude Code, Codex, or Antigravity host owns the native lead session, while non-host providers run through their registered CLI wrappers.
|
|
151
152
|
- [`skills/okstra-setup/SKILL.md`](../skills/okstra-setup/SKILL.md) — **first-run bootstrap**. Runs `okstra install` and creates `project.json`.
|
|
152
|
-
- [`skills/okstra-run/SKILL.md`](../skills/okstra-run/SKILL.md) — in-session entry point that
|
|
153
|
+
- [`skills/okstra-run/SKILL.md`](../skills/okstra-run/SKILL.md) — host-aware in-session entry point that starts an okstra task in the current Claude Code, Codex, or Antigravity session and calls `prepare_task_bundle` directly.
|
|
153
154
|
- Thirteen skills are user-invocable: `skills/okstra-setup/SKILL.md`, `skills/okstra-brief-gen/SKILL.md`, `skills/okstra-run/SKILL.md`, `skills/okstra-manager/SKILL.md`, `skills/okstra-memory/SKILL.md`, `skills/okstra-inspect/SKILL.md`, `skills/okstra-rollup/SKILL.md`, `skills/okstra-usage/SKILL.md`, `skills/okstra-schedule-gen/SKILL.md`, `skills/okstra-container-build/SKILL.md`, `skills/okstra-pr-gen/SKILL.md`, `skills/okstra-user-response/SKILL.md`, and `skills/okstra-code-review/SKILL.md`. Only these are copied into the agent skill home. They cover brief authoring, phase execution, cross-project manager task coordination, global Memory Book storage/search, read-side status/history/report/time/logs/cost/errors/recap, task-group-level aggregation of run results (rollup), project-wide historical resource usage, schedule support, local container deployment, PR description generation, clarification-response submission, and census-based code review of a stage or branch diff. `okstra-manager` uses `okstra manager` CLI JSON/launch packets as the source of truth, and stores manager-owned plans, assignments, directives, snapshots, and events under `~/.okstra/managers/<manager-id>/`. `okstra-rollup` is a read-side layer that fans the single-task aggregators from `okstra-inspect` (time/errors/recap) out to a task group or the whole project catalog. The `okstra rollup` CLI owns deterministic aggregation, while the skill (LLM) writes only the synthesized report summary. `okstra-usage` is a separate read-only resource snapshot grouped by lifecycle task type; it does not replace single-task `okstra-inspect` detail or the status/report digest from `okstra-rollup`. The canonical definition of `okstra-inspect` read-side facets is the subcommand table in `skills/okstra-inspect/SKILL.md`. `okstra-inspect logs` provides a read-only inventory and cleanup guidance for the live-log sidecars that the Codex/Antigravity wrappers write on every dispatch at the resolved `<run-dir>/prompts/<worker>-prompt-<phase>-<seq>.log`; for stage executions, the stage-qualified `run_dir` includes `stage-<N>/`. `okstra-inspect cost` summarizes `okstra context-cost`; `okstra-inspect errors` collects a task's okstra-run error logs into a timestamped Markdown error report and prints a summary; and `okstra-inspect recap` answers free-form questions about `.okstra` artifacts in addition to summarizing phases before and after each task run.
|
|
154
155
|
- Internal operating contracts—`context-loader` / `team-contract` / `convergence` / `report-writer` and the lead contract—have moved to `prompts/lead/*.md`. Language-specific coding preflight for implementation/verification workers has moved to `prompts/coding-preflight/*` (overview router + clean-code + three-stage language/framework/architecture selection). All are runtime resources installed under `~/.okstra/prompts/` and are not discoverable as skills. The generated launch prompt provides the lead with absolute paths, and reinstalling prunes the legacy exact-name skill directories `okstra-context-loader` / `okstra-team-contract` / `okstra-convergence` / `okstra-report-writer` / `okstra-coding-preflight` / `okstra`.
|
|
155
156
|
- Plugin manifest: [`../../.claude-plugin/plugin.json`](../.claude-plugin/plugin.json) — referenced by the supplementary `npx skills@latest add Devonshin/okstra` channel. Use `npx okstra@latest install` for normal setup. The plugin manifest exposes only the thirteen user entry points (`okstra-setup`, `okstra-brief-gen`, `okstra-run`, `okstra-manager`, `okstra-memory`, `okstra-inspect`, `okstra-rollup`, `okstra-usage`, `okstra-schedule-gen`, `okstra-container-build`, `okstra-pr-gen`, `okstra-user-response`, `okstra-code-review`).
|
|
@@ -259,47 +260,48 @@ The following environment variables are read only as user settings, not for stat
|
|
|
259
260
|
|
|
260
261
|
Other variables such as `PROJECT_ID`, `TASK_GROUP`, `RUN_*`, `FINAL_*`, and `CLAUDE_*` are not exported and do not leak into child processes.
|
|
261
262
|
|
|
262
|
-
##
|
|
263
|
+
## Host runtime execution behavior
|
|
263
264
|
|
|
264
|
-
|
|
265
|
+
The front door declares its host from harness context, never by looking for installed provider binaries. Claude Code selects the Claude native session; Codex selects the Codex native session. Other selected providers resolve to CLI wrappers. A lead provider that disagrees with an in-session host is rejected before dispatch so the manifest cannot claim a model that never ran.
|
|
266
|
+
|
|
267
|
+
The legacy standalone shell path remains Claude-specific:
|
|
265
268
|
|
|
266
269
|
**Mode A — `okstra.sh` launches a new Claude process**
|
|
267
270
|
- With `--render-only`, it exits after creating the instruction set without running Claude.
|
|
268
271
|
- Without `--render-only`, the prepare stage preassigns a Claude session ID and creates `claude-resume-<task-type>-<seq>.sh` under the current run's `sessions/` directory.
|
|
269
|
-
- It then runs `claude --model <lead> --session-id "$CLAUDE_SESSION_ID" "$PROMPT"` via `exec` from the target project root using the resolved
|
|
270
|
-
- `okstra.sh` performs only
|
|
272
|
+
- It then runs `claude --model <lead> --session-id "$CLAUDE_SESSION_ID" "$PROMPT"` via `exec` from the target project root using the standalone launcher's resolved Claude lead model. (The former `--settings <runtime-settings>` argument was removed in 0.14.0; permissions are now provided by the `<PROJECT_ROOT>/.claude/settings.local.json` symlink.)
|
|
273
|
+
- `okstra.sh` performs only this compatibility handoff; the launched session continues under the same Okstra lead contract. Codex-hosted runs do not pass through this shell path.
|
|
271
274
|
|
|
272
|
-
**Mode B — the `okstra-run` skill hands off within the current
|
|
273
|
-
- Use this when the user is already in
|
|
274
|
-
- The skill
|
|
275
|
-
- It does not launch
|
|
275
|
+
**Mode B — the `okstra-run` skill hands off within the current host session**
|
|
276
|
+
- Use this when the user is already in Claude Code, Codex, or Antigravity and wants to start a new okstra task there.
|
|
277
|
+
- The skill relays the wizard through the host question/text interface and calls `prepare_task_bundle(render_only=True)` with the explicit host runtime.
|
|
278
|
+
- It does not launch another lead process. The current host-native session reads `lead-execution-prompt.md` and assumes the Okstra lead role.
|
|
276
279
|
|
|
277
280
|
Both modes create identical artifacts (task-manifest, run-manifest, timeline, instruction set, and central-index registration), so subsequent `okstra-ctl` commands (list / show / rerun / reconcile) operate consistently without distinguishing between them.
|
|
278
|
-
- The handed-off
|
|
279
|
-
- The default worker
|
|
280
|
-
-
|
|
281
|
+
- The handed-off native host acts as the Okstra lead, responsible for orchestration and final synthesis.
|
|
282
|
+
- The default worker policy remains Claude + Codex analysis and a Claude report writer. Antigravity, Grok, and Kimi are profile-gated optional assignments; Grok and Kimi are read-only analyser/critic providers.
|
|
283
|
+
- The lead assigns worker responsibilities and makes the final judgment after reading the task bundle.
|
|
281
284
|
- okstra Claude assets installed in the user home (`~/.claude/skills`, `~/.claude/agents`) instruct Claude to dispatch workers through `Agent(name: ...)`; workers automatically join the session's implicit team.
|
|
282
285
|
- **Team lifecycle (Claude Code v2.1.178+)**: v2.1.178 removed the `TeamCreate` / `TeamDelete` tools and the `team_name` parameter from `Agent(...)`. When `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` (seeded into `settings.json` by `okstra install`), one implicit team per session is created automatically at startup. In Phase 3, the lead does not call a team-creation tool. It records only the `teamName` audit label and `teamCreate: { attempted: false, status: "implicit", splitPane: <true-if-TMUX-is-set> }`, then dispatches workers through `Agent(name: "<role>-worker", run_in_background: true)` (without team_name). Split-pane teammates appear when `$TMUX` is set and `teammateMode: auto`; outside tmux they run in-process, and both modes are valid. At run end, after Phase 7 token accounting, the lead checks for remaining tmux panes and asks whether to clean up worker teammates only for split-pane runs. If approved, `okstra-team-reconcile.sh` marks dead-pane stale-active members inactive and sends each completed teammate a `SendMessage` shutdown_request. There is no tool for deleting the implicit team; it disappears when the session ends. If the user keeps the teammates, they remain in the FleetView roster and the lead tells the user to remove them through Teams/FleetView (see *Run-end teammate teardown* in `prompts/profiles/_common-contract.md`). Phase 7 token accounting locates worker sessions by top-level `agentName` or nested `subagents/agent-a<name>-<hash>.jsonl` filenames when `teamCreate.status` is `implicit`/`skipped`/`error`.
|
|
283
286
|
|
|
284
|
-
##
|
|
287
|
+
## Lead prompt contract
|
|
285
288
|
|
|
286
|
-
The
|
|
289
|
+
The canonical lead prompt body is rendered from `prompts/launch.template.md` to `lead-execution-prompt.md`. A selected runtime adapter maps its neutral operations to host primitives.
|
|
287
290
|
|
|
288
291
|
- Prompt substitution is limited to scalar placeholder values such as the task key, session ID, and absolute/relative paths.
|
|
289
292
|
- The selected profile body is rendered to `instruction-set/analysis-profile.md`.
|
|
290
293
|
- The analysis material body is rendered to `instruction-set/analysis-material.md`.
|
|
291
294
|
- The expected state for config/deployment is rendered to `instruction-set/reference-expectations.md`.
|
|
292
|
-
-
|
|
295
|
+
- The lead must read these artifact files directly; long task-specific bodies must not be duplicated inline in the launch prompt.
|
|
293
296
|
|
|
294
297
|
## Required team contract
|
|
295
298
|
|
|
296
299
|
The standard `okstra` workflow applies the following team contract consistently across runtime prompts, profiles, manifests, and skill documentation.
|
|
297
300
|
|
|
298
|
-
- The
|
|
299
|
-
-
|
|
300
|
-
- `Report writer worker` focuses on report structure and evidence organization,
|
|
301
|
-
-
|
|
302
|
-
- Because `Antigravity worker` is optional, it is attempted only in runs where it is explicitly included.
|
|
301
|
+
- The current host-native provider owns the synthesis-only lead session: Claude on Claude Code, Codex on Codex.
|
|
302
|
+
- Every selected worker comes from the profile roster and provider capability registry. The default analysis policy remains Claude + Codex + a report writer; Antigravity, Grok, and Kimi are attempted only when the profile and resolved roster include them.
|
|
303
|
+
- `Report writer worker` focuses on report structure and evidence organization, while the host-native lead remains the final synthesis owner. Claude is the default report-writer provider; Codex may be selected explicitly.
|
|
304
|
+
- Model defaults are provider and functional-role policy. Fallbacks include Claude lead/analyser=`opus`, Codex lead/analyser=`gpt-5.6-sol`, Claude report writer=`sonnet`, Antigravity=`gemini-3.1-pro`, Grok analyser=`grok-build-0.1`, and Kimi analyser=`kimi-k2.7-code`.
|
|
303
305
|
- Before the final judgment, each required role in the current run's worker roster must have either a result or an explicit terminal status (`completed`, `timeout`, `error`, `not-run`).
|
|
304
306
|
- Every attempted worker (`completed`, `timeout`, `error`) must have an assigned worker prompt history file under the current run's `prompts/` directory.
|
|
305
307
|
- Worker timing begins at the atomic transition to `in-progress`, which records `workers[].startedAt` in `team-state.json`; prompt creation time is not a dispatch proxy. `okstra worker-state transition` and both dispatch adapters share `dispatch_state.transition_worker_status`, while `okstra worker-liveness --team-state ... --worker ...` reads that timestamp as the launch-grace authority.
|
|
@@ -595,17 +597,17 @@ There are two entry methods, and they produce identical artifacts.
|
|
|
595
597
|
scripts/okstra.sh --task-type error-analysis --project-id <project-id> --task-group <task-group> --task-id <task-id> --task-brief <brief-path>
|
|
596
598
|
```
|
|
597
599
|
|
|
598
|
-
On this path, `okstra.sh` finishes the prepare stage and then runs a new interactive Claude session via `exec` from the target project root. It performs only the handoff; the
|
|
600
|
+
On this standalone compatibility path, `okstra.sh` finishes the prepare stage and then runs a new interactive Claude session via `exec` from the target project root. It performs only the handoff; the session continues under the Okstra lead contract. Because `sessions/claude-resume-<task-type>-<seq>.sh` is written immediately before execution, the same run can be resumed if interrupted. In-host Claude Code, Codex, and Antigravity paths retain the current native session instead.
|
|
599
601
|
|
|
600
|
-
**Option B — hand off within the current
|
|
602
|
+
**Option B — hand off within the current host session (`okstra-run` skill)**
|
|
601
603
|
|
|
602
|
-
If you are
|
|
604
|
+
If you are using Claude Code, Codex, or Antigravity, the current native session assumes the Okstra lead role without launching a replacement lead process. Example triggers: `"run okstra here"`, `"start error-analysis on this project"`.
|
|
603
605
|
|
|
604
606
|
Skill flow:
|
|
605
607
|
|
|
606
|
-
1. The `okstra-run` skill activates and
|
|
608
|
+
1. The `okstra-run` skill activates and relays task candidates, task type, and brief path through the current host's question or text interface.
|
|
607
609
|
2. It calls `okstra_ctl.run.prepare_task_bundle(render_only=True)` with the user's input—directly invoking the same Python function without passing through `okstra.sh`.
|
|
608
|
-
3. After the same instruction-set artifacts are written to disk, the current
|
|
610
|
+
3. After the same instruction-set artifacts are written to disk, the current host reads the canonical lead prompt and assumes the lead role.
|
|
609
611
|
|
|
610
612
|
See [`skills/okstra-run/SKILL.md`](../skills/okstra-run/SKILL.md) for the detailed procedure.
|
|
611
613
|
|
|
@@ -779,11 +781,11 @@ Generating a view never modifies the original final-report MD.
|
|
|
779
781
|
|
|
780
782
|
## Worker error collection (optional sidecar)
|
|
781
783
|
|
|
782
|
-
Errors that occur while workers
|
|
784
|
+
Errors that occur while provider workers, the report writer, or the Okstra lead run can be collected into a single chronological log for later retrospectives.
|
|
783
785
|
|
|
784
786
|
- Storage location: resolved `<run-dir>/logs/errors-<task-type>-<seq>.jsonl` (`<run-dir>` includes `stage-<N>/` for a stage-isolated run)
|
|
785
787
|
- Append-only JSON Lines, isolated per run, so there is no separate rotation policy.
|
|
786
|
-
- **Single writer**: To avoid concurrent-append collisions, only the
|
|
788
|
+
- **Single writer**: To avoid concurrent-append collisions, only the active Okstra lead writes this file directly. `<seq>` is an independent three-digit zero-padded counter (`001`, `002`, …) scanned per category directory (`logs/`, `manifests/`, `state/`, and so on), so category values may differ within one run when a prior run recorded only some categories. The cross-category identifier for one run is the manifest's `runDateTimeSegment` ISO timestamp field.
|
|
787
789
|
- Internal worker tool failures are reported in the worker-result manifest's `errors[]`, then dumped by the lead immediately after merge
|
|
788
790
|
- Codex/Antigravity CLI failures, timeouts, and rate limits are observed directly by the lead through the wrapper
|
|
789
791
|
- resultContract violations, schema mismatches, and missing required fields are observed directly during lead validation
|
|
@@ -852,16 +854,16 @@ Each validator blocks the phase with a `contract-violated` exit code when a cont
|
|
|
852
854
|
- The task bundle's `instruction-set/reference-expectations.md` is generated alongside it as the config/deployment expected-state reference.
|
|
853
855
|
- The current run session's resume helper is created at the resolved `<run-dir>/sessions/claude-resume-<task-type>-<seq>.sh`.
|
|
854
856
|
- The run directory is organized into typed subdirectories such as `manifests/`, `state/`, `prompts/`, `reports/`, `status/`, `sessions/`, and `worker-results/`; prompt snapshots are prepared under `prompts/` first.
|
|
855
|
-
-
|
|
856
|
-
- The standard
|
|
857
|
-
- Worker models can be overridden
|
|
857
|
+
- The host adapter creates workers and collects results according to persisted runner assignments.
|
|
858
|
+
- The standard policy uses Claude and Codex analysers plus a report writer. Antigravity, Grok, and Kimi are optional and included only when the selected profile allows them.
|
|
859
|
+
- Worker models can be overridden through the legacy provider flags or generic `--worker-model provider=model`; lead and report-writer provider choices are explicit. Defaults are centrally managed through the provider registry and `OKSTRA_DEFAULT_*` environment variables.
|
|
858
860
|
- For `--task-type implementation`, select the provider that takes the Executor role with `--executor <claude|codex|antigravity>` (or `OKSTRA_DEFAULT_EXECUTOR`, fallback `claude`). Only the Executor may mutate project files. The other two providers and the Executor's own provider are each dispatched as verifiers in separate CLI sessions (session isolation preserves the self-review safeguard). The Executor's model reuses the selected provider's worker-model flag (`--claude-model` / `--codex-model` / `--antigravity-model`). Provider / displayName / workerAgent / model are recorded in the run-manifest `teamContract.executor` block.
|
|
859
|
-
- Worktree
|
|
861
|
+
- Worktree targeting is runner-based. A native-session executor uses its host adapter's edit and command primitives against `EXECUTOR_WORKTREE_PATH`; a CLI-wrapper executor receives the worktree through its provider wrapper. Prefer explicit working-directory flags such as `git -C` or `cargo --manifest-path` when available.
|
|
860
862
|
- The project-level current-task convenience pointer is `.okstra/discovery/latest-task.json`.
|
|
861
863
|
- The project-level canonical task inventory is `.okstra/discovery/task-catalog.json`.
|
|
862
864
|
- At `okstra install` time, okstra skill assets are seeded to `~/.agents/skills/` by default. If `~/.claude` exists, `~/.claude/skills/` + `~/.claude/agents/` are seeded as well (per-project seeding is no longer performed).
|
|
863
865
|
- Seeded okstra Claude assets instruct Claude to dispatch workers into the session's implicit team with `Agent(name: ...)` (v2.1.178 removed `TeamCreate`/`TeamDelete`). Agent targets receive only skill Markdown.
|
|
864
|
-
-
|
|
866
|
+
- The host-native Okstra lead, not preparation scripts or a report writer, makes the final judgment.
|
|
865
867
|
- A stable task key must be maintained to enable later bug tracking, corrections, and reverification.
|
|
866
868
|
- Worker errors are collected in the optional sidecar at the resolved `<run-dir>/logs/errors-<task-type>-<seq>.jsonl`, with the lead as the sole writer. For a stage-isolated run, `<run-dir>` includes `stage-<N>/`. The entry-point helper is `scripts/okstra-error-log.py`.
|
|
867
869
|
- Token-usage and cost accounting are handled by `scripts/okstra-token-usage.py` and the Node wrapper `okstra token-usage`.
|