okstra 0.123.0 → 0.125.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.
- package/README.md +1 -0
- package/docs/architecture/storage-model.md +3 -1
- package/docs/architecture.md +16 -2
- package/docs/cli.md +3 -1
- package/docs/for-ai/README.md +41 -35
- package/docs/for-ai/skills/okstra-brief-gen.md +105 -105
- package/docs/for-ai/skills/okstra-container-build.md +61 -61
- package/docs/for-ai/skills/okstra-graphify.md +64 -0
- package/docs/for-ai/skills/okstra-inspect.md +87 -86
- package/docs/for-ai/skills/okstra-manager.md +32 -32
- package/docs/for-ai/skills/okstra-memory.md +49 -50
- package/docs/for-ai/skills/okstra-pr-gen.md +48 -0
- package/docs/for-ai/skills/okstra-rollup.md +58 -58
- package/docs/for-ai/skills/okstra-run.md +95 -95
- package/docs/for-ai/skills/okstra-schedule-gen.md +106 -106
- package/docs/for-ai/skills/okstra-setup.md +63 -64
- package/docs/for-ai/skills/okstra-user-response.md +48 -0
- package/docs/performance-improvement-plan-v2.md +6 -6
- package/docs/pr-template-usage.md +34 -34
- package/docs/project-structure-overview.md +91 -70
- package/docs/task-process/README.md +33 -33
- package/docs/task-process/common-flow.md +26 -26
- package/docs/task-process/error-analysis.md +20 -21
- package/docs/task-process/final-verification.md +41 -41
- package/docs/task-process/implementation-planning.md +33 -33
- package/docs/task-process/implementation.md +38 -38
- package/docs/task-process/release-handoff.md +46 -46
- package/docs/task-process/requirements-discovery.md +22 -23
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/workers/antigravity-worker.md +4 -4
- package/runtime/agents/workers/claude-worker.md +2 -2
- package/runtime/agents/workers/codex-worker.md +4 -4
- package/runtime/agents/workers/report-writer-worker.md +4 -4
- package/runtime/bin/lib/okstra/usage.sh +1 -1
- package/runtime/prompts/coding-preflight/frameworks/node-server.md +1 -1
- package/runtime/prompts/launch.template.md +1 -1
- package/runtime/prompts/lead/convergence.md +10 -20
- package/runtime/prompts/lead/okstra-lead-contract.md +15 -17
- package/runtime/prompts/lead/plan-body-verification.md +18 -18
- package/runtime/prompts/lead/report-writer.md +46 -44
- package/runtime/prompts/lead/team-contract.md +11 -122
- package/runtime/prompts/profiles/_common-contract.md +15 -22
- package/runtime/prompts/profiles/_implementation-deliverable.md +1 -1
- package/runtime/prompts/profiles/_implementation-executor.md +1 -1
- package/runtime/prompts/profiles/_implementation-verifier.md +28 -2
- package/runtime/prompts/profiles/error-analysis.md +2 -2
- package/runtime/prompts/profiles/final-verification.md +1 -1
- package/runtime/prompts/profiles/implementation-planning.md +13 -13
- package/runtime/prompts/profiles/implementation.md +2 -1
- package/runtime/prompts/profiles/improvement-discovery.md +1 -1
- package/runtime/prompts/profiles/release-handoff.md +3 -3
- package/runtime/prompts/profiles/requirements-discovery.md +17 -18
- package/runtime/python/okstra_ctl/models.py +4 -2
- package/runtime/python/okstra_ctl/run.py +8 -2
- package/runtime/python/okstra_ctl/stage_fix_carry.py +112 -0
- package/runtime/schemas/final-report-v1.0.schema.json +6 -6
- package/runtime/skills/_fragments/bash-invocation-rule.md +1 -0
- package/runtime/skills/_fragments/preflight-outdated-cli.md +1 -0
- package/runtime/skills/_fragments/python-bootstrap-note.md +1 -0
- package/runtime/skills/okstra-brief-gen/SKILL.md +117 -122
- package/runtime/skills/okstra-container-build/SKILL.md +24 -14
- package/runtime/skills/okstra-graphify/SKILL.md +12 -4
- package/runtime/skills/okstra-inspect/SKILL.md +39 -747
- package/runtime/skills/okstra-inspect/facets/cost.md +84 -0
- package/runtime/skills/okstra-inspect/facets/error-zip.md +41 -0
- package/runtime/skills/okstra-inspect/facets/errors.md +69 -0
- package/runtime/skills/okstra-inspect/facets/history.md +90 -0
- package/runtime/skills/okstra-inspect/facets/logs.md +89 -0
- package/runtime/skills/okstra-inspect/facets/recap.md +96 -0
- package/runtime/skills/okstra-inspect/facets/report.md +61 -0
- package/runtime/skills/okstra-inspect/facets/status.md +145 -0
- package/runtime/skills/okstra-inspect/facets/time.md +56 -0
- package/runtime/skills/okstra-manager/SKILL.md +1 -1
- package/runtime/skills/okstra-memory/SKILL.md +3 -3
- package/runtime/skills/okstra-pr-gen/SKILL.md +3 -3
- package/runtime/skills/okstra-rollup/SKILL.md +12 -6
- package/runtime/skills/okstra-run/SKILL.md +49 -88
- package/runtime/skills/okstra-schedule-gen/SKILL.md +36 -30
- package/runtime/skills/okstra-setup/SKILL.md +1 -1
- package/runtime/skills/okstra-setup/references/project-config.md +17 -16
- package/runtime/skills/okstra-usage/SKILL.md +5 -2
- package/runtime/skills/okstra-user-response/SKILL.md +15 -3
- package/runtime/templates/prd/brief.template.md +92 -92
- package/runtime/templates/project-docs/task-index.template.md +1 -1
- package/runtime/templates/reports/error-analysis-input.template.md +1 -1
- package/runtime/templates/reports/fan-out-unit.template.md +6 -6
- package/runtime/templates/reports/final-verification-input.template.md +6 -6
- package/runtime/templates/reports/implementation-input.template.md +1 -1
- package/runtime/templates/reports/implementation-planning-input.template.md +1 -1
- package/runtime/templates/reports/improvement-discovery-input.template.md +1 -1
- package/runtime/templates/reports/quick-input.template.md +1 -1
- package/runtime/templates/reports/release-handoff-input.template.md +1 -1
- package/runtime/templates/reports/schedule.template.md +22 -22
- package/runtime/templates/reports/task-brief.template.md +3 -3
- package/runtime/templates/reports/user-response.template.md +20 -20
- package/runtime/templates/worker-prompt-preamble.md +111 -13
- package/runtime/validators/validate-schedule.py +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# okstra-user-response AI Manual
|
|
2
|
+
|
|
3
|
+
## Sources
|
|
4
|
+
|
|
5
|
+
- Skill source: [`skills/okstra-user-response/SKILL.md`](../../../skills/okstra-user-response/SKILL.md)
|
|
6
|
+
- Response core (CLI): [`scripts/okstra_ctl/user_response.py`](../../../scripts/okstra_ctl/user_response.py)
|
|
7
|
+
- Node wrapper: [`src/commands/inspect/user-response.mjs`](../../../src/commands/inspect/user-response.mjs)
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
`okstra-user-response` answers the **unresolved clarification questions** an okstra run left behind (the open `C-*` rows under the final report's `## 1. Clarification Items`) **in-session**, and records those answers as a `runs/<type>/user-responses/` sidecar. The next `/okstra-run` auto-attaches this sidecar via `--clarification-response`.
|
|
12
|
+
|
|
13
|
+
**Core principle — the skill never picks an answer for the user.** It only *presents* recommendations and alternatives; every `value` is the user's verbatim input. It does not call `write` until the user has explicitly confirmed (`confirmed`).
|
|
14
|
+
|
|
15
|
+
Distinguish it from starting a run (`okstra-run`), inspecting a finished task (`okstra-inspect`), and generating a brief (`okstra-brief-gen`).
|
|
16
|
+
|
|
17
|
+
## Sub-commands
|
|
18
|
+
|
|
19
|
+
| Sub-command | What it does |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `list` | List tasks that still have approval-open clarification (newest report first) |
|
|
22
|
+
| `show` | Expand one report's open `C-*` rows (statement + recommended + alternatives + contextRefs) |
|
|
23
|
+
| `write` | Record the collected answers (+ optional approval) as a `user-responses/` sidecar |
|
|
24
|
+
|
|
25
|
+
## Preflight
|
|
26
|
+
|
|
27
|
+
A single Bash call with the literal `okstra` token (not wrapped):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
okstra preflight --runtime claude-code --json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`ok:true` → carry `projectRoot` and `projectId` as literals. `ok:false` → point to `/okstra-setup` and stop (retry a specific directory with `--cwd <dir>` — a leading `cd` breaks the permission match). Then resolve home once: `okstra paths --field home` → paste it literally into `--home`.
|
|
34
|
+
|
|
35
|
+
## Flow
|
|
36
|
+
|
|
37
|
+
1. **list**: `okstra user-response list --home <home> --project <projectId> --limit 3` → an array of `{taskKey, taskType, seq, reportPath, reportMtime, openApprovalCount, unreadable}`. If the array is empty, stop with "no open clarification". A 3-option picker (top recommendations + the final option always "Enter directly" for pasting a `reportPath`/`task-key` directly). `unreadable:true` is a §1 format drift — flag it with `⚠` and do not proceed (do not fabricate rows).
|
|
38
|
+
2. **show**: `okstra user-response show --report <reportPath>` → `rows[]` with `resolvedRefs` (the `definition` of internal tokens such as `RB-002`/`§4.7`). **Do not paste the raw `statement` as the question.** For each open row present: (a) a **self-contained question** with internal tokens expanded inline first, (b) `recommended` (only a recommendation) in plain language, (c) `alternatives[]`, (d) the raw `id`+`statement` as a secondary traceability aid. If `definition` is `null`, resolve the report `§`/`path:line` yourself **using Read**.
|
|
39
|
+
3. **decision (4 branches)**: the user picks one per item — Answer (accept the recommendation / own answer, verbatim), Ask-to-explain (explain only and hand the decision back to the user), Free-form (narrative verbatim), Hold+reframe (`disposition:"reframe"`, does not satisfy the approval gate). Each item's JSON: `{id, kind, value, rationale?, disposition}`.
|
|
40
|
+
4. **echo → confirmed gate**: before `write`, echo the whole collection (each `id`·`disposition`·`value`·`rationale`·approval) as-is and get explicit confirmation. Never `write` before `confirmed`. On any change, re-echo and re-confirm.
|
|
41
|
+
5. **approval (optional)**: only when the approval-blocking items are **all filled with an answer** and the user explicitly approved, `--approval '{"approved":true,"implementationOption":"<selected option>"}'`. If any item is unfilled/reframe, do not approve and say the gate is still open.
|
|
42
|
+
6. **write**: `okstra user-response write --report <reportPath> --answers '<json>' [--approval '<json>'] --task-key <taskKey>` → report the returned `{sidecar:<path>}`. (When a same-named sidecar exists, the same `id` is overwritten with the new value and merged.)
|
|
43
|
+
|
|
44
|
+
## Output Rules
|
|
45
|
+
|
|
46
|
+
- Concise, in the language the user is using.
|
|
47
|
+
- Give path guidance host-relative (`~/.okstra/...` or relative to `projectRoot`). Use repo paths only when pointing at a code source.
|
|
48
|
+
- **Never hand-edit a rendered report** (`runs/*/reports/*.md` / `*.data.json`). Sidecar recording goes only through the `okstra user-response write` CLI.
|
|
@@ -105,7 +105,7 @@ The four default worker definitions are under `agents/workers/`.
|
|
|
105
105
|
| B4 | Multiple renders/writes run serially during prepare | Low–medium | `scripts/okstra_ctl/run.py` render block | Lower priority |
|
|
106
106
|
| B5 | The token usage collector scans session JSONL linearly | Low–medium | `scripts/okstra_token_usage/` | **Resolved** — P6 incremental cache implemented |
|
|
107
107
|
| B6 | Simple work uses the same full workflow | Medium | task-type lifecycle / requirements routing | Fast-track design needed — largest remaining lever |
|
|
108
|
-
| B7 | The report writer's final-report/data.json **output volume itself** is large (90–140 KB) | High | Measurements in §4.1 item 3 — 8–19 minutes of generation per run |
|
|
108
|
+
| B7 | The report writer's final-report/data.json **output volume itself** is large (90–140 KB) | High | Measurements in §4.1 item 3 — 8–19 minutes of generation per run | **Resolved** — default report-writer model lowered to `sonnet` (catalog `ROLE_DEFAULTS`) and a prose-budget dedup contract landed on the narrative blocks (`tests/contract/test_report_prose_budget.py`); fix runs additionally author reports incrementally (see the fix-run incremental reverification section in `docs/architecture.md`) |
|
|
109
109
|
|
|
110
110
|
Established assumptions:
|
|
111
111
|
|
|
@@ -226,13 +226,13 @@ Goals:
|
|
|
226
226
|
|
|
227
227
|
Cautions:
|
|
228
228
|
|
|
229
|
-
- Before extracting `agents/workers/
|
|
229
|
+
- Before extracting shared worker text into `agents/workers/_cli-wrapper-template.md`, confirm that install/packaging paths and skill/agent loaders support includes.
|
|
230
230
|
- Merely moving text into a separate file can increase cost if the runtime does not inline it and the worker must read another file.
|
|
231
231
|
|
|
232
232
|
Change targets:
|
|
233
233
|
|
|
234
|
-
- `agents/workers/codex-worker.
|
|
235
|
-
- `agents/workers/antigravity-worker.
|
|
234
|
+
- `agents/workers/codex-worker.params.json`
|
|
235
|
+
- `agents/workers/antigravity-worker.params.json`
|
|
236
236
|
- `prompts/lead/team-contract.md`
|
|
237
237
|
- Install/build packaging
|
|
238
238
|
|
|
@@ -253,7 +253,7 @@ Change targets:
|
|
|
253
253
|
- `prompts/profiles/requirements-discovery.md`
|
|
254
254
|
- `scripts/okstra_ctl/workflow.py`
|
|
255
255
|
- Next-phase selection UI in `skills/okstra-run/SKILL.md`
|
|
256
|
-
- `skills/okstra-
|
|
256
|
+
- `skills/okstra-inspect/SKILL.md` (the former `okstra-status` skill folded into `okstra-inspect`)
|
|
257
257
|
- Validator expectations
|
|
258
258
|
|
|
259
259
|
Caution:
|
|
@@ -363,7 +363,7 @@ The current plan correctly makes P1 the top priority, but the earlier phrases "7
|
|
|
363
363
|
|
|
364
364
|
**2026-06-11 update** — Measurements in §4.1 confirm that P0/P1/P6, critic parallelization, and phaseTimeline instrumentation are complete, while B3 (report-writer input compression) was rejected. Only two priorities remain, and both require a user decision first:
|
|
365
365
|
|
|
366
|
-
1. **B7 — reduce report-writer output-side cost**:
|
|
366
|
+
1. **B7 — reduce report-writer output-side cost**: **done** — the default report-writer model is now `sonnet`, and the prose-budget contract deduplicates the narrative blocks. Remaining follow-up if further reduction is needed: evidence pointer-ization (option B of the slimming decision).
|
|
367
367
|
2. **B6/P3 — fast-track routing**: shorten the lifecycle for simple work. Requires an approval-gate policy decision.
|
|
368
368
|
|
|
369
369
|
### Implementation Plan Links
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
# PR template
|
|
1
|
+
# PR template usage guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Summarizes the resolution rules, storage locations, and configuration methods for the Markdown template that `Claude lead` uses to write the PR body during the `release-handoff` phase.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Authoritative source of the resolution logic: [`scripts/okstra_ctl/pr_template.py`](../scripts/okstra_ctl/pr_template.py).
|
|
6
6
|
|
|
7
|
-
## 1. 4
|
|
7
|
+
## 1. The 4-step lookup priority
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Higher priority matches first. Once an upper step matches, the lower steps are not consulted.
|
|
10
10
|
|
|
11
|
-
| # | source |
|
|
11
|
+
| # | source | Location | Notes |
|
|
12
12
|
|---|--------|------|------|
|
|
13
|
-
| 1 | **per-run override** | `okstra render-bundle --pr-template-path <path>`
|
|
14
|
-
| 2 | **project scope** | `<project_root>/.okstra/project.json`
|
|
15
|
-
| 3 | **global scope** | `~/.okstra/config.json`
|
|
16
|
-
| 4 | **default (skill bundle)** |
|
|
13
|
+
| 1 | **per-run override** | `okstra render-bundle --pr-template-path <path>` or the wizard's one-time input | A relative path is resolved against the caller cwd (override) or against `project_root` (using the same function as project scope). |
|
|
14
|
+
| 2 | **project scope** | the `prTemplatePath` field in `<project_root>/.okstra/project.json` | A relative path is resolved against `project_root`. |
|
|
15
|
+
| 3 | **global scope** | the `prTemplatePath` field in `~/.okstra/config.json` | **Only an absolute path or a `~/`-prefixed path** is allowed. A relative path is ambiguous and rejected. |
|
|
16
|
+
| 4 | **default (skill bundle)** | the first existing file among the candidate paths (§2 below) | The fallback path right after `npx okstra install`. |
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
If the file named in any of the 4 steps does not exist, it fails immediately with `PrTemplateError` (no silent fallback).
|
|
19
19
|
|
|
20
|
-
## 2.
|
|
20
|
+
## 2. Default candidate paths
|
|
21
21
|
|
|
22
|
-
1. `$OKSTRA_SKILLS_DIR/templates/prd/pr-body.template.md` —
|
|
23
|
-
2. `~/.claude/skills/templates/prd/pr-body.template.md` — `npx okstra install`
|
|
22
|
+
1. `$OKSTRA_SKILLS_DIR/templates/prd/pr-body.template.md` — only when the `OKSTRA_SKILLS_DIR` environment variable is set.
|
|
23
|
+
2. `~/.claude/skills/templates/prd/pr-body.template.md` — the standard location `npx okstra install` installs to.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
The candidates are tried in priority order, and if all are absent it ends with an explicit error as follows.
|
|
26
26
|
|
|
27
27
|
> `no PR template available: default skill template not found. Reinstall okstra (npx okstra install) or set prTemplatePath in project.json / ~/.okstra/config.json.`
|
|
28
28
|
|
|
29
|
-
## 3.
|
|
29
|
+
## 3. The original inside the source repository
|
|
30
30
|
|
|
31
|
-
- [`templates/prd/pr-body.template.md`](../templates/prd/pr-body.template.md) — `npx okstra install`
|
|
31
|
+
- [`templates/prd/pr-body.template.md`](../templates/prd/pr-body.template.md) — the original that `npx okstra install` copies to the §2 default location. To change the copy, edit this file and install again.
|
|
32
32
|
|
|
33
|
-
## 4.
|
|
33
|
+
## 4. Configuration commands — persistence
|
|
34
34
|
|
|
35
|
-
per-run override
|
|
35
|
+
To keep it longer than a per-run override, either the wizard invokes it automatically or you record it directly with the following commands.
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
# project scope: <project_root>/.okstra/project.json
|
|
38
|
+
# project scope: update prTemplatePath in <project_root>/.okstra/project.json
|
|
39
39
|
okstra config set pr-template-path "<path>" --scope project
|
|
40
40
|
|
|
41
|
-
# global scope: ~/.okstra/config.json
|
|
41
|
+
# global scope: update prTemplatePath in ~/.okstra/config.json (absolute path required)
|
|
42
42
|
okstra config set pr-template-path "<absolute-path>" --scope global
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
wizard
|
|
45
|
+
In the wizard flow, the `pr_template_pick` step lets you choose among `Once / Save to project / Save globally`. Choosing `project` or `global` persists `prTemplatePath` with the same effect as the commands above.
|
|
46
46
|
|
|
47
|
-
## 5.
|
|
47
|
+
## 5. Source tracking
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Each run's prepare step records the step actually adopted into ctx, so it can be traced from the final report and elsewhere.
|
|
50
50
|
|
|
51
|
-
| ctx key |
|
|
51
|
+
| ctx key | Value |
|
|
52
52
|
|---------|-----|
|
|
53
|
-
| `PR_TEMPLATE_PATH` |
|
|
54
|
-
| `PR_TEMPLATE_SOURCE` | `"override" \| "project" \| "global" \| "default"`
|
|
53
|
+
| `PR_TEMPLATE_PATH` | the actually resolved absolute path |
|
|
54
|
+
| `PR_TEMPLATE_SOURCE` | one of `"override" \| "project" \| "global" \| "default"` |
|
|
55
55
|
|
|
56
|
-
`PR_TEMPLATE_SOURCE`
|
|
56
|
+
If `PR_TEMPLATE_SOURCE` is `default` but the project convention requires a distinct PR body, register `prTemplatePath` with the §4 persistence command.
|
|
57
57
|
|
|
58
|
-
## 6.
|
|
58
|
+
## 6. Troubleshooting
|
|
59
59
|
|
|
60
|
-
|
|
|
60
|
+
| Symptom | Cause | Action |
|
|
61
61
|
|------|------|------|
|
|
62
|
-
| `override PR template not found: <path>` | per-run override
|
|
63
|
-
| `project.json prTemplatePath points to missing file: <path>` | `project.json`
|
|
64
|
-
| `global config prTemplatePath must be absolute or start with '~/'` | `~/.okstra/config.json`
|
|
65
|
-
| `no PR template available` | install
|
|
62
|
+
| `override PR template not found: <path>` | the path given as a per-run override does not exist | Check for a path typo or use a persisted configuration. |
|
|
63
|
+
| `project.json prTemplatePath points to missing file: <path>` | the file pointed at by `prTemplatePath` in `project.json` is absent | Restore that file or reconfigure with `okstra config set pr-template-path <path> --scope project`. |
|
|
64
|
+
| `global config prTemplatePath must be absolute or start with '~/'` | a relative path was put in `~/.okstra/config.json` | Update to an absolute path or a `~/`-prefixed path. |
|
|
65
|
+
| `no PR template available` | install is missing or even the default file is absent | Re-run `npx okstra install` or set it explicitly with the §4 command. |
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
# Okstra —
|
|
1
|
+
# Okstra — Folder structure and feature summary
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> A living map based on the current repository. For quick usage see [`README.md`](../README.md), for the internal execution contract see [`docs/architecture.md`](architecture.md), for the storage model see [`docs/architecture/storage-model.md`](architecture/storage-model.md), and for detailed CLI options see [`docs/cli.md`](cli.md).
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Table of contents
|
|
8
8
|
|
|
9
|
-
- [1.
|
|
10
|
-
- [2.
|
|
11
|
-
- [3. Build / install
|
|
12
|
-
- [4.
|
|
13
|
-
- [5.
|
|
14
|
-
- [6.
|
|
15
|
-
- [7.
|
|
16
|
-
- [8.
|
|
17
|
-
- [
|
|
9
|
+
- [1. Project identity](#1-project-identity)
|
|
10
|
+
- [2. Top-level structure](#2-top-level-structure)
|
|
11
|
+
- [3. Build / install boundary](#3-build--install-boundary)
|
|
12
|
+
- [4. Folder responsibilities](#4-folder-responsibilities)
|
|
13
|
+
- [5. Key runtime modules](#5-key-runtime-modules)
|
|
14
|
+
- [6. Post-install layout](#6-post-install-layout)
|
|
15
|
+
- [7. Core workflows](#7-core-workflows)
|
|
16
|
+
- [8. Doc maintenance checklist](#8-doc-maintenance-checklist)
|
|
17
|
+
- [Appendix A. Report / row ID glossary](#appendix-a-report--row-id-glossary)
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
## 1.
|
|
21
|
+
## 1. Project identity
|
|
22
22
|
|
|
23
|
-
`okstra
|
|
23
|
+
`okstra` is a multi-agent cross-verification runtime for Claude Code, distributed as the npm package `okstra`. It is not a one-shot reviewer; it runs a lead + worker model across multiple lifecycle phases around a stable task key.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Current baseline:
|
|
26
26
|
|
|
27
27
|
- package version: see `package.json`
|
|
28
28
|
- Node CLI entrypoint: `bin/okstra`
|
|
29
29
|
- Python orchestration authority: `scripts/okstra_ctl/run.py::prepare_task_bundle`
|
|
30
30
|
- lifecycle: `requirements-discovery → error-analysis → implementation-planning → implementation → final-verification → release-handoff`
|
|
31
|
-
- installed skills: 8
|
|
31
|
+
- installed skills: 8
|
|
32
32
|
- worker agents: `claude`, `codex`, `antigravity`, `report-writer`
|
|
33
33
|
- final report SSOT: `schemas/final-report-v1.0.schema.json` + `*.data.json`
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Design principles:
|
|
36
36
|
|
|
37
|
-
1. **Single prepare authority**: slash skill, Bash CLI, Node preview
|
|
38
|
-
2. **Stable task identity**: `<project-id>/<task-group>/<task-id
|
|
39
|
-
3. **Artifact-home rule**: okstra-owned project artifact root
|
|
40
|
-
4. **Template/schema/validator lockstep**: `templates/`, `schemas/`, `validators/`, worker/report-writer
|
|
37
|
+
1. **Single prepare authority**: the slash skill, the Bash CLI, and the Node preview all converge on `prepare_task_bundle()`.
|
|
38
|
+
2. **Stable task identity**: `<project-id>/<task-group>/<task-id>` runs through phase, run, worktree, and report.
|
|
39
|
+
3. **Artifact-home rule**: the okstra-owned project artifact root is the single `<PROJECT_ROOT>/.okstra/**`.
|
|
40
|
+
4. **Template/schema/validator lockstep**: `templates/`, `schemas/`, `validators/`, and the worker/report-writer contract enforce the same report shape.
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
## 2.
|
|
44
|
+
## 2. Top-level structure
|
|
45
45
|
|
|
46
46
|
```text
|
|
47
47
|
okstra/
|
|
@@ -77,7 +77,7 @@ okstra/
|
|
|
77
77
|
|
|
78
78
|
---
|
|
79
79
|
|
|
80
|
-
## 3. Build / install
|
|
80
|
+
## 3. Build / install boundary
|
|
81
81
|
|
|
82
82
|
### 3.1 npm package
|
|
83
83
|
|
|
@@ -142,7 +142,7 @@ Runtime/install asset changes follow this checklist:
|
|
|
142
142
|
|
|
143
143
|
---
|
|
144
144
|
|
|
145
|
-
## 4.
|
|
145
|
+
## 4. Folder responsibilities
|
|
146
146
|
|
|
147
147
|
### 4.1 `bin/` and `src/` — Node CLI
|
|
148
148
|
|
|
@@ -182,8 +182,9 @@ Runtime/install asset changes follow this checklist:
|
|
|
182
182
|
| `spawn-followups`, `error-log` | `src/commands/execute/*.mjs` | Follow-up task bundle creation and run error-log append helpers |
|
|
183
183
|
| `memory` | `src/commands/memory/memory.mjs` | Store/find global conversation memory under `~/.okstra/memory-book` |
|
|
184
184
|
| `pr` | `src/commands/pr/pr.mjs` | `okstra pr <template\|branches\|gen>` — PR body template store under `~/.okstra/template/pr/` (bundled fallback `src/commands/pr/default.md`), base-branch recommendation, and the `gen` JSON bundle (template + `<base>..HEAD` commits + `<base>...HEAD` diffstat) backing the okstra-pr-gen skill. Git-only; no project registration required |
|
|
185
|
-
| `recap` | `src/commands/inspect/recap.mjs` | `okstra recap <assemble\|record\|note>` Node wrapper backing the okstra-inspect `recap` facet — `assemble`
|
|
186
|
-
| `stage-map` | `src/commands/inspect/stage-map.mjs` | `okstra stage-map <task-key>` — task
|
|
185
|
+
| `recap` | `src/commands/inspect/recap.mjs` | `okstra recap <assemble\|record\|note>` Node wrapper backing the okstra-inspect `recap` facet — `assemble` is a read-only phase-transition summary, `record` appends one line to `recap/recap-log.jsonl`, and `note` writes an agent-authored note under `notes/` and prints the `--clarification-response` argument for a follow-up run |
|
|
186
|
+
| `stage-map` | `src/commands/inspect/stage-map.mjs` | `okstra stage-map <task-key>` — exposes a task's implementation-planning Stage Map as JSON (`stages[].{stage_number,title,depends_on,step_count}` + consumer-state-based `doneStages[]`). If there is no Stage Map, `stages: []`. The read-side basis from which `okstra-schedule-gen` derives stage units and dependency closure |
|
|
187
|
+
| `design-prep` | `src/commands/inspect/design-prep.mjs` | `okstra design-prep <list\|show\|write>` thin shim into `scripts/okstra_ctl/design_prep.py` — queries (`list`/`show`) the design items that implementation-planning pre-authored with AI, and records the user-confirmed responses as an append-only sidecar under `design-prep-inputs/` (`write`, `--confirmed` required). It never modifies the report snapshot |
|
|
187
188
|
| `rollup` | `src/commands/inspect/rollup.mjs` | `okstra rollup` thin shim into `scripts/okstra_ctl/rollup.py` — read-only cross-task roll-up backing the okstra-rollup skill |
|
|
188
189
|
| `usage-report` | `src/commands/inspect/usage-report.mjs` | `okstra usage-report` thin shim into `scripts/okstra_ctl/usage_report.py` — read-only project usage snapshot backing the okstra-usage skill |
|
|
189
190
|
| `container` | `src/commands/inspect/container.mjs` | `bin okstra container` thin shim into `scripts/okstra_ctl/container.py` for the okstra-container-build skill |
|
|
@@ -207,8 +208,8 @@ Top-level scripts:
|
|
|
207
208
|
| `okstra-render-report-views.py` | Render self-contained HTML views from final-report Markdown |
|
|
208
209
|
| `okstra-error-log.py` | Normalize worker/lead error sidecars |
|
|
209
210
|
| `okstra-spawn-followups.py` | Follow-up spawning helper |
|
|
210
|
-
| `okstra-trace-cleanup.sh` | tmux okstra pane cleanup (worker-agent + trace, lead pane
|
|
211
|
-
| `okstra-subagent-reclaim.sh` |
|
|
211
|
+
| `okstra-trace-cleanup.sh` | tmux okstra pane cleanup (worker-agent + trace, excluding the lead pane); the `--reclaim-completed` mode reclaims only trace panes whose `@okstra_status` is terminated (stage=exited) and preserves in-progress panes |
|
|
212
|
+
| `okstra-subagent-reclaim.sh` | entry that walks active runs and reclaims only completed trace panes (wired to the `SubagentStop`/`TaskCompleted` hooks) |
|
|
212
213
|
|
|
213
214
|
### 4.3 `scripts/okstra_ctl/` — Python orchestration core
|
|
214
215
|
|
|
@@ -217,50 +218,68 @@ Important modules:
|
|
|
217
218
|
| Module | Role |
|
|
218
219
|
|---|---|
|
|
219
220
|
| `run.py` | `prepare_task_bundle()` single authority and CLI parser |
|
|
220
|
-
| `implementation_stage.py` | `implementation`
|
|
221
|
-
| `stage_targets.py` | Stage readiness/verification
|
|
222
|
-
| `stage_reconcile.py` |
|
|
223
|
-
| `
|
|
224
|
-
| `
|
|
221
|
+
| `implementation_stage.py` | `implementation` single-stage run orchestration — read the Stage Lifecycle Snapshot → pick an available Stage Map entry → provision an isolated stage worktree → publish the selected stage as run context (extracted from `run.py`) |
|
|
222
|
+
| `stage_targets.py` | Stage readiness/verification policy SSOT — from the Stage Lifecycle Snapshot (`consumers.jsonl` ledger + carry sidecar backfill + active registry reservation) it decides which stage is runnable, which commit it branches from, and what final-verification checks. `order_stage_closure` topologically sorts (Kahn) the dependency closure of the wizard's multi-selected stage set to produce the unattended `chain-stages` chaining order |
|
|
223
|
+
| `stage_reconcile.py` | best-effort git reconciliation shared by the stage prepare flow (delegates to `git_reconcile.auto_reconcile`; advisory — failures are only reported to stderr, the dependency gate stays authoritative) |
|
|
224
|
+
| `design_surfaces.py` | deterministic detection of an `implementation-planning` stage's design surface — matches the stage's file-path tokens/suffixes/patterns and action wording via `SurfaceRule` to derive which design input the stage needs among domain contract, DB/table schema, external interface, transaction/consistency, transformation mapping, lifecycle, rollout/observability, and manual user test, plus its evidence (`TriggerEvidence`). An unmappable structure raises `DesignSurfaceError` |
|
|
225
|
+
| `design_prep.py` | fingerprint / materialize / resolve backend for design-preparation requests (CLI: `okstra design-prep <list\|show\|write>`) — computes an assessment fingerprint from the approved planning snapshot's `ASSESSMENT_FIELDS`, idempotently writes an Okstra-owned request under `design-prep-requests/`, and resolves the highest-revision append-only user response under `design-prep-inputs/` whose fingerprint matches as the effective response. Keeps the three authorities (report snapshot / Okstra request / user input) separate and never modifies the report or existing revisions. Sidecar I/O is protected by a directory-fd anchor + flock |
|
|
226
|
+
| `incremental_scope.py` | incremental re-verification decision for an `implementation-planning` clarification re-run (deterministic pure function) — reads the dependency graph from the previous run data.json's `implementationPlanning.stageMap` and returns `mode="incremental"` only when the base-ref SHA is unchanged and the affected stages' `downstream_stage_closure` is at most half of all stages. CLI: `okstra incremental-scope` |
|
|
227
|
+
| `incremental_carry.py` | carry merge for an incremental re-run — merges the previous run's plan-item verdicts that this run does not re-verify into the current data.json with a `carriedForwardFromSeq` tag. On `schemaVersion` drift it exits non-zero with `CarryError` to force a full fallback. CLI: `okstra incremental-carry` |
|
|
225
228
|
| `run_context.py` | Per-task mutex, run context and run-input persistence; `consumers_mutex` helper for atomic `consumers.jsonl` writes |
|
|
226
|
-
| `path_hints.py` | Compact path-hint persistence + legacy context hydration — `run-context` / `active-run-context`
|
|
229
|
+
| `path_hints.py` | Compact path-hint persistence + legacy context hydration — stores `run-context` / `active-run-context` in the schemaVersion `2.0` `identity` + `pathHints` compact schema, and hydrates the legacy flat path keys (`RUN_MANIFEST_RELATIVE_PATH`, `TEAM_STATE_PATH`, etc.) in memory the moment the host-side reader reads them |
|
|
227
230
|
| `consumers.py` | Append-only `consumers.jsonl` writer + reader — records which `implementation` runs consumed which `implementation-planning` stage |
|
|
228
|
-
| `implementation_outcome.py` | Artifact-derived implementation phase outcome
|
|
229
|
-
| `paths.py` | Path/sequence computation for task/run artifacts (recap
|
|
230
|
-
| `recap.py` | okstra-inspect `recap` facet
|
|
231
|
+
| `implementation_outcome.py` | Artifact-derived reconstruction of the implementation phase outcome — reads `runs/implementation/carry/stage-<N>.json` + `consumers.jsonl` + the approved Stage Map to derive `phaseOutcome.implementation`, and when every stage has pass-grade carry evidence it corrects `workflow.nextRecommendedPhase` to `final-verification` (keeping the `contract-violated` audit information) |
|
|
232
|
+
| `paths.py` | Path/sequence computation for task/run artifacts (including recap directory/log paths) |
|
|
233
|
+
| `recap.py` | deterministic backend for the okstra-inspect `recap` facet — `assemble` builds the cross-run phase transitions from the timeline, `record` append-only writes a summary/Q&A to `<task-root>/recap/recap-log.jsonl` (other task artifacts unchanged) |
|
|
231
234
|
| `render.py` | task manifest, run manifest, timeline, task index, discovery, team-state, prompt/template render |
|
|
232
235
|
| `workflow.py` | Phase sequence, allowed outputs, forbidden actions, next phase |
|
|
233
236
|
| `workers.py`, `models.py` | Worker roster; `models.py` is the model catalog SSOT (`ModelSpec` per alias + `ROLE_DEFAULTS`) — add-a-model single reference point from which picker options, codex pricing, and role defaults all derive |
|
|
234
237
|
| `worktree.py`, `worktree_registry.py` | One worktree per task-key, branch registry, sync dirs/files/snapshots |
|
|
235
238
|
| `project_meta.py`, `resolver.py`, `path_resolve.py` | Project/task/run resolution |
|
|
236
239
|
| `clarification_items.py` | Unified §5 clarification table parser and approval blockers |
|
|
237
|
-
| `md_table.py` | Markdown pipe-table escape/split SSOT — `mdcell`
|
|
240
|
+
| `md_table.py` | Markdown pipe-table escape/split SSOT — the `mdcell` filter (`escape_pipes`) and the `\|`-aware `split_pipe_row`; shared by the renderer, HTML view, and validators |
|
|
238
241
|
| `qa_commands.py` | QA command deny-list validation for plans |
|
|
239
242
|
| `pr_template.py` | PR body template resolution for release-handoff |
|
|
240
243
|
| `report_views.py`, `render_final_report.py`, `final_report_schema.py` | Final-report data.json → Markdown → Report View Model → self-contained HTML pipeline |
|
|
241
|
-
| `final_report_paths.py`, `report_view_artifacts.py` |
|
|
244
|
+
| `final_report_paths.py`, `report_view_artifacts.py` | Path-helper SSOT for the final-report markdown/data.json pair and the generated view artifacts (HTML view, user-responses directory) |
|
|
242
245
|
| `wizard.py` | `okstra-run` prompt state machine; user-facing Korean strings live in `prompts/wizard/prompts.ko.json` |
|
|
243
|
-
| `wizard_stage_intent.py` | `okstra-run` wizard
|
|
246
|
+
| `wizard_stage_intent.py` | stage-related intent projection of the `okstra-run` wizard output — normalizes whole-task (`__whole_task__`) vs single/multi stage selection into render-args (`resolve_wizard_stage_intent`) |
|
|
244
247
|
| `index.py`, `jsonl.py`, `reconcile.py`, `listing.py`, `batch.py`, `backfill.py` | `~/.okstra` run index and history operations |
|
|
245
|
-
| `run_index_row.py` | `~/.okstra` run-index row
|
|
246
|
-
| `error_report.py`, `error_log_core.py`, `error_zip.py` | okstra-inspect errors/error-zip
|
|
247
|
-
| `log_report.py`, `time_report.py` | okstra-inspect logs/time
|
|
248
|
-
| `rollup.py` |
|
|
248
|
+
| `run_index_row.py` | single reference point for creating / slimming / hydrating a `~/.okstra` run-index row — runId SSOT, preserves projectId raw |
|
|
249
|
+
| `error_report.py`, `error_log_core.py`, `error_zip.py` | backend for the okstra-inspect errors/error-zip facets — `error_log_core` is the read-only core that globs/parses/aggregates `errors-*.jsonl`, `error_report` renders the errors facet, and `error_zip` collects cross-project run directories, allowlist-anonymizes, aggregates clusters, and produces a zip |
|
|
250
|
+
| `log_report.py`, `time_report.py` | read-side backend for the okstra-inspect logs/time facets (`okstra log-report` is the wrapper sidecar log inventory, `okstra time-report` is per-task time aggregation) |
|
|
251
|
+
| `rollup.py` | read-side backend for the okstra-rollup skill — fans the catalog out per task-group (or the whole project) and deterministically aggregates each task's run count, elapsed time (raw ms), error count, and latest report path, plus group-level totals/status, category, and phase distribution. Reuses the `time_report`/`error_log_core` functions and delegates report-body synthesis to the skill |
|
|
249
252
|
| `usage_report.py` | Read-only okstra-usage backend — scans the whole current project's recent run timelines, defaults to 30 days, and returns task-type coverage, raw/billable tokens, known USD cost, CPU-sum and wall-clock milliseconds, unavailable reason counts, and unmatched pricing models |
|
|
250
|
-
| `json_registry.py` |
|
|
251
|
-
| `stage_integrate.py` | whole-task stage
|
|
252
|
-
| `resolve_task_key.py` | bare task-id → `task-catalog.json`
|
|
253
|
+
| `json_registry.py` | shared flock + atomic JSON persistence for small okstra registries (`registry_lock`/`load_registry_json`/`save_registry_json`) — shared by `container_registry` and `worktree_registry` |
|
|
254
|
+
| `stage_integrate.py` | whole-task stage integration (merge) + worktree teardown core (`integrate_stages`) — shared by whole-task final-verification entry, `okstra integrate-stages`, and container up |
|
|
255
|
+
| `resolve_task_key.py` | shared skill helper resolving a bare task-id → `task-catalog.json` candidate entries (`okstra resolve-task-key`) |
|
|
253
256
|
| `session.py`, `tmux.py`, `seeding.py`, `locks.py`, `invocation.py`, `sequence.py`, `ids.py`, `material.py` | Supporting lifecycle helpers |
|
|
254
|
-
| `pane_reclaim.py` |
|
|
255
|
-
| `improvement_lenses.py` |
|
|
256
|
-
| `container.py` |
|
|
257
|
-
| `container_registry.py` | flock-guarded
|
|
258
|
-
| `plan_run_root.py` | `approved_plan_path` → `plan_run_root`
|
|
257
|
+
| `pane_reclaim.py` | decides which completed trace panes are reclaim targets; imports the in-progress status set from the `reconcile.NON_TERMINAL_RECENT_STATUSES` SSOT |
|
|
258
|
+
| `improvement_lenses.py` | lens enum SSOT + cap constants for the improvement-discovery phase (DEFAULT 8, ABSOLUTE 12, MIN/MAX PRIORITY 1/4, SOURCE_WORKERS) |
|
|
259
|
+
| `container.py` | the `okstra container` convergence entrypoint of the okstra-container-build public skill — `provision_container_group` + `up`/`status`/`logs`/`stop-watcher`/`down` dispatch, env-override synthesis, compose argv assembly, and per-container watcher startup |
|
|
260
|
+
| `container_registry.py` | flock-guarded auxiliary index — tracks per-container-group tmux session/pane and watcher findings |
|
|
261
|
+
| `plan_run_root.py` | shared helper deriving `approved_plan_path` → `plan_run_root` and back-tracing the task-key |
|
|
259
262
|
| `manager_cli.py` | `okstra manager` Python entrypoint — manager init/discover/new/task subcommands and JSON output |
|
|
260
263
|
| `manager_paths.py` | Manager state path SSOT under `~/.okstra/managers/<manager-id>/`; slug fallback uses `u-<sha1-prefix>` when a safe segment would be empty |
|
|
261
264
|
| `manager_store.py` | Manager-owned state mutation — project membership, task planning, assignment, directives, event append |
|
|
262
265
|
| `manager_sync.py` | One-way child project `.okstra` snapshot reader; corrupt child state becomes row-level `error` so other children continue |
|
|
263
266
|
| `manager_launch.py` | Child launch packet and manager child context renderer; records `prepared` launch metadata/events without changing project-local task state |
|
|
267
|
+
| `dispatch_core.py` | Backend-neutral worker dispatch core — worker execution/collection logic shared by any lead runtime (Claude/Codex/external) |
|
|
268
|
+
| `codex_dispatch.py` | Codex lead CLI-worker dispatcher — the `okstra codex-dispatch` backend. Reads the run manifest to run the Codex-side supported worker subset and performs token-usage substitution, view render, follow-up, and validation |
|
|
269
|
+
| `analysis_packet.py` | assembles the compact analysis-worker input packet for a task run (error-analysis phase worker input) |
|
|
270
|
+
| `context_cost.py` | read-side context-cost estimator for a prepared okstra task bundle (the `okstra context-cost` backend) |
|
|
271
|
+
| `schema_excerpt.py` | generates a task-type-scoped excerpt of the final-report schema — a schema reduction to inject into the worker/lead prompt |
|
|
272
|
+
| `work_categories.py` | requirements-discovery work-category (domain) **SSOT** (`is_valid_category`) — the work-category allowlist is defined only here |
|
|
273
|
+
| `model_discovery.py` | pre-dispatch model-identity normalization for CLI workers — roster-gated label correction + a per-role reasoning-effort policy (deterministic, no per-run improvisation) for CLIs (agy) that bake effort into the model name |
|
|
274
|
+
| `lead_runtime.py` | lead runtime metadata shared by the render and prepare paths (`LeadRuntimeInfo`) |
|
|
275
|
+
| `lead_events.py` | structured JSONL events emitted by non-Claude lead runtimes |
|
|
276
|
+
| `team_reconcile.py` | stale team-member reconciliation at run-end teardown |
|
|
277
|
+
| `worker_prompt_headers.py` | shared rendering of the worker prompt anchor header (`worker_prompt_headers`) |
|
|
278
|
+
| `wrapper_status.py` | worker wrapper status sidecar reader — the host-side reader of the sidecar written by `okstra-wrapper-status.py` (the heartbeat writer) |
|
|
279
|
+
| `task_target.py` | shared helper resolving `task-key → (task_root, project_root)` (`resolve_task_root`) |
|
|
280
|
+
| `graphify_cmd.py` | scope wrapper for the okstra-graphify skill — `resolve_scope` + `assemble` + `okstra graphify` subcommand dispatch. Forces the corpus to `.okstra` and outputs to `.okstra/graph/` |
|
|
281
|
+
|
|
282
|
+
> `i18n.py` (the final-report i18n dictionary loader + Jinja2 lookup) is an intentionally undocumented internal helper — it is a render helper that users and contributors do not need to know about in the canonical docs, so it is excluded from the module map.
|
|
264
283
|
|
|
265
284
|
### 4.4 `scripts/okstra_project/`
|
|
266
285
|
|
|
@@ -303,10 +322,10 @@ Token/cost accounting:
|
|
|
303
322
|
|
|
304
323
|
`schemas/final-report-v1.0.schema.json` is the final-report data.json contract. The report-writer worker writes `final-report-<task-type>-<seq>.data.json`; the renderer produces Markdown from that JSON.
|
|
305
324
|
|
|
306
|
-
Optional (v1.0
|
|
325
|
+
Optional (v1.0 backward-compatible) top-level keys:
|
|
307
326
|
|
|
308
|
-
- `readerSummary` —
|
|
309
|
-
- `implementationPlanning.incrementalDecision` —
|
|
327
|
+
- `readerSummary` — the summary block a human reads first. When present, all five fields (`decision`, `humanActionRequired`, `blockingItems`, `safeToSkip`, `recommendedCommand`) are required. Existing data.json without it still renders as-is (the HTML dashboard falls back to `verdictCard`).
|
|
328
|
+
- `implementationPlanning.incrementalDecision` — the incremental re-verification decision (`mode`, `reverifyStages`, `carryStages`, `reason`). When `mode == "incremental"`, the renderer emits the `### 0.1 Incremental Re-Verification Scope` audit block and `validators/validate-run.py` blocks its absence.
|
|
310
329
|
|
|
311
330
|
### 4.9 `validators/`
|
|
312
331
|
|
|
@@ -314,10 +333,10 @@ Optional (v1.0 하위호환) 최상위 키:
|
|
|
314
333
|
|---|---|
|
|
315
334
|
| `validate-run.py` | Run/final-report contract validation |
|
|
316
335
|
| `validate-brief.py`, `validate-brief.sh` | Brief frontmatter/body contract validation |
|
|
317
|
-
| `validate-report-views.py` | HTML view validation (form-control
|
|
336
|
+
| `validate-report-views.py` | HTML view validation (form-control placement / no external URLs / stale source digest / Response ID parity) |
|
|
318
337
|
| `validate-schedule.py` | Schedule section/order/code validation |
|
|
319
|
-
| `validate-implementation-plan-stages.py` | Stage Map
|
|
320
|
-
| `validate_improvement_report.py` | improvement-discovery final-report
|
|
338
|
+
| `validate-implementation-plan-stages.py` | enforces the Stage Map structure — checks the S1–S8 rules (`## 5.5 Stage Map` + `## 5.5.<i> Stage <i>` sections, ≤ 8 steps per stage, etc.) |
|
|
339
|
+
| `validate_improvement_report.py` | enforces the 11-item contract of the improvement-discovery final-report. Automatically invoked by `validate-run.py` when `task_type == "improvement-discovery"` |
|
|
321
340
|
| `validate-workflow.sh` | End-to-end fixture workflow validation |
|
|
322
341
|
| `lib/*.sh` | Shared shell validator helpers and fixtures |
|
|
323
342
|
|
|
@@ -348,20 +367,20 @@ Optional (v1.0 하위호환) 최상위 키:
|
|
|
348
367
|
| File | Role |
|
|
349
368
|
|---|---|
|
|
350
369
|
| `agents/workers/claude-worker.md` | Claude analyzer/verifier/executor spec |
|
|
351
|
-
| `agents/workers/codex-worker.params.json` | Codex analyzer/verifier/executor wrapper params (build
|
|
352
|
-
| `agents/workers/antigravity-worker.params.json` | Antigravity analyzer/verifier/executor wrapper params (build
|
|
370
|
+
| `agents/workers/codex-worker.params.json` | Codex analyzer/verifier/executor wrapper params (build renders `.md` via `_cli-wrapper-template.md`) |
|
|
371
|
+
| `agents/workers/antigravity-worker.params.json` | Antigravity analyzer/verifier/executor wrapper params (build renders `.md` via `_cli-wrapper-template.md`) |
|
|
353
372
|
| `agents/workers/report-writer-worker.md` | data.json SSOT author and audit sidecar writer |
|
|
354
373
|
|
|
355
374
|
The neutral lead lifecycle contract lives at `prompts/lead/okstra-lead-contract.md`. Host mappings live under `prompts/lead/adapters/`: `claude-code.md`, `codex.md`, and `external.md`. All are runtime resources installed under `~/.okstra/prompts/lead/`, not agent skills.
|
|
356
375
|
|
|
357
376
|
### 4.12 `tests/` and `tests-e2e/`
|
|
358
377
|
|
|
359
|
-
- `tests/`: pytest modules,
|
|
360
|
-
- `tests-e2e/`: `scenario-<id>-<name>.sh`
|
|
378
|
+
- `tests/`: pytest modules, layered into per-domain subfolders — `run/` (prepare/dispatch/run-index core), `contract/` (validator, repo/docs contract, phase rules, profile), `report/` (render, convergence, language, template), `inspect/` (recap, error, context-cost, token-usage), `worktree/` (worktree, stage isolation, reconcile, reclaim), `wizard/`, `handoff/`. The shared path SSOT is `tests/_paths.py` (`REPO_ROOT`/`TESTS_DIR`/`FIXTURES`), and the setting that puts `tests/` on the import path is the repo-root `pytest.ini` (`pythonpath = tests`). Fixtures live in `tests/fixtures/`.
|
|
379
|
+
- `tests-e2e/`: `scenario-<id>-<name>.sh` shell scenarios (record-start/reconcile, rerun, task lock, agent install, report view, etc.).
|
|
361
380
|
|
|
362
381
|
---
|
|
363
382
|
|
|
364
|
-
## 5.
|
|
383
|
+
## 5. Key runtime modules
|
|
365
384
|
|
|
366
385
|
### 5.1 Prepare flow
|
|
367
386
|
|
|
@@ -415,7 +434,7 @@ The Markdown is derived, not the authoring source. The schema is the contract.
|
|
|
415
434
|
|
|
416
435
|
---
|
|
417
436
|
|
|
418
|
-
## 6.
|
|
437
|
+
## 6. Post-install layout
|
|
419
438
|
|
|
420
439
|
```text
|
|
421
440
|
~/.okstra/
|
|
@@ -456,16 +475,18 @@ The Markdown is derived, not the authoring source. The schema is the contract.
|
|
|
456
475
|
├── sessions/
|
|
457
476
|
├── worker-results/
|
|
458
477
|
├── user-responses/
|
|
459
|
-
├──
|
|
478
|
+
├── design-prep-requests/ # implementation-planning only: Okstra-owned AI draft request (deterministic, idempotent)
|
|
479
|
+
├── design-prep-inputs/ # implementation-planning only: user/wizard confirmation responses (append-only revision)
|
|
480
|
+
├── carry/ # implementation only: stage-<N>.json evidence sidecar
|
|
460
481
|
├── logs/
|
|
461
|
-
└── (consumers.jsonl) # implementation-planning
|
|
482
|
+
└── (consumers.jsonl) # implementation-planning only: impl-run backlink accumulation file
|
|
462
483
|
```
|
|
463
484
|
|
|
464
485
|
Project-local `<PROJECT_ROOT>/.claude/settings.local.json` is provisioned as a symlink so spawned agents can load okstra worker-wrapper permissions.
|
|
465
486
|
|
|
466
487
|
---
|
|
467
488
|
|
|
468
|
-
## 7.
|
|
489
|
+
## 7. Core workflows
|
|
469
490
|
|
|
470
491
|
### 7.1 First setup
|
|
471
492
|
|
|
@@ -487,7 +508,7 @@ Project-local `<PROJECT_ROOT>/.claude/settings.local.json` is provisioned as a s
|
|
|
487
508
|
|---|---|---|
|
|
488
509
|
| `requirements-discovery` | Classify and route work | `error-analysis` or `implementation-planning` |
|
|
489
510
|
| `error-analysis` | Reproduce and explain failure | `implementation-planning` |
|
|
490
|
-
| `implementation-planning` | Compare options, produce approval-ready plan;
|
|
511
|
+
| `implementation-planning` | Compare options, produce approval-ready plan; the output is always the `## 5.5 Stage Map` + N `## 5.5.<i> Stage <i>` section structure. `implementation` can be split and run per stage | `implementation` after approval |
|
|
491
512
|
| `implementation` | Executor changes code, verifiers check independently | `final-verification` |
|
|
492
513
|
| `final-verification` | Read-only acceptance verification | `release-handoff` if accepted |
|
|
493
514
|
| `release-handoff` | User-selected commit/PR handoff | done or follow-up |
|
|
@@ -498,7 +519,7 @@ Final report artifacts live under `runs/<task-type>/reports/`. Human responses f
|
|
|
498
519
|
|
|
499
520
|
---
|
|
500
521
|
|
|
501
|
-
## 8.
|
|
522
|
+
## 8. Doc maintenance checklist
|
|
502
523
|
|
|
503
524
|
When changing code, keep these docs in sync:
|
|
504
525
|
|
|
@@ -512,7 +533,7 @@ When changing code, keep these docs in sync:
|
|
|
512
533
|
|
|
513
534
|
---
|
|
514
535
|
|
|
515
|
-
##
|
|
536
|
+
## Appendix A. Report / row ID glossary
|
|
516
537
|
|
|
517
538
|
| Prefix / token | Meaning |
|
|
518
539
|
|---|---|
|