okstra 0.34.1 → 0.36.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.kr.md +26 -16
- package/README.md +26 -16
- package/docs/kr/architecture.md +59 -45
- package/docs/kr/cli.md +61 -18
- package/docs/pr-template-usage.md +65 -0
- package/docs/project-structure-overview.md +358 -354
- package/docs/superpowers/plans/2026-05-12-ticket-id-in-reports.md +1 -1
- package/docs/superpowers/plans/2026-05-14-convergence-queue-pruning.md +1 -1
- package/docs/superpowers/plans/2026-05-17-dual-format-final-report.md +1 -1
- package/docs/superpowers/plans/2026-05-20-final-report-language.md +1501 -0
- package/docs/superpowers/plans/2026-05-20-implementation-planning-multi-stage.md +1267 -0
- package/docs/superpowers/plans/2026-05-20-okstra-run-prompt-sot-b1.md +1007 -0
- package/docs/superpowers/plans/2026-05-20-wizard-messages-json-sot.md +720 -0
- package/docs/superpowers/plans/2026-05-20-wizard-prompt-json-sot-a1.md +681 -0
- package/docs/superpowers/plans/2026-05-21-improvement-discovery-task-type.md +1691 -0
- package/docs/superpowers/specs/2026-05-20-final-report-language-design.md +383 -0
- package/docs/superpowers/specs/2026-05-20-implementation-planning-multi-stage-design.md +320 -0
- package/docs/superpowers/specs/2026-05-20-okstra-run-prompt-sot-design.md +299 -0
- package/docs/superpowers/specs/2026-05-21-improvement-discovery-task-type-design.md +335 -0
- package/docs/task-process/README.md +74 -0
- package/docs/task-process/common-flow.md +166 -0
- package/docs/task-process/error-analysis.md +101 -0
- package/docs/task-process/final-verification.md +167 -0
- package/docs/task-process/implementation-planning.md +128 -0
- package/docs/task-process/implementation.md +149 -0
- package/docs/task-process/release-handoff.md +206 -0
- package/docs/task-process/requirements-discovery.md +115 -0
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/SKILL.md +12 -2
- package/runtime/agents/workers/claude-worker.md +26 -0
- package/runtime/agents/workers/codex-worker.md +27 -1
- package/runtime/agents/workers/gemini-worker.md +27 -1
- package/runtime/agents/workers/report-writer-worker.md +8 -1
- package/runtime/bin/okstra-central.sh +6 -6
- package/runtime/bin/okstra-codex-exec.sh +49 -28
- package/runtime/bin/okstra-gemini-exec.sh +39 -21
- package/runtime/bin/okstra-render-final-report.py +13 -2
- package/runtime/bin/okstra-wrapper-status.py +155 -0
- package/runtime/bin/okstra.sh +2 -2
- package/runtime/prompts/profiles/_common-contract.md +11 -6
- package/runtime/prompts/profiles/error-analysis.md +3 -7
- package/runtime/prompts/profiles/implementation-planning.md +22 -21
- package/runtime/prompts/profiles/implementation.md +28 -11
- package/runtime/prompts/profiles/improvement-discovery.md +42 -0
- package/runtime/prompts/profiles/kr/_common-contract.md +92 -0
- package/runtime/prompts/profiles/kr/error-analysis.md +36 -0
- package/runtime/prompts/profiles/kr/final-verification.md +48 -0
- package/runtime/prompts/profiles/kr/implementation-planning.md +90 -0
- package/runtime/prompts/profiles/kr/implementation.md +144 -0
- package/runtime/prompts/profiles/kr/improvement-discovery.md +42 -0
- package/runtime/prompts/profiles/kr/release-handoff.md +104 -0
- package/runtime/prompts/profiles/kr/requirements-discovery.md +42 -0
- package/runtime/prompts/profiles/release-handoff.md +1 -1
- package/runtime/prompts/profiles/requirements-discovery.md +8 -12
- package/runtime/prompts/wizard/prompts.ko.json +230 -0
- package/runtime/python/lib/okstra/cli.sh +2 -49
- package/runtime/python/lib/okstra/globals.sh +21 -21
- package/runtime/python/lib/okstra/interactive.sh +7 -7
- package/runtime/python/okstra_ctl/clarification_items.py +3 -9
- package/runtime/python/okstra_ctl/consumers.py +53 -0
- package/runtime/python/okstra_ctl/final_report_schema.py +0 -7
- package/runtime/python/okstra_ctl/i18n.py +73 -0
- package/runtime/python/okstra_ctl/improvement_lenses.py +44 -0
- package/runtime/python/okstra_ctl/index.py +1 -1
- package/runtime/python/okstra_ctl/paths.py +23 -20
- package/runtime/python/okstra_ctl/render.py +147 -202
- package/runtime/python/okstra_ctl/render_final_report.py +53 -10
- package/runtime/python/okstra_ctl/run.py +292 -107
- package/runtime/python/okstra_ctl/run_context.py +22 -0
- package/runtime/python/okstra_ctl/seeding.py +186 -0
- package/runtime/python/okstra_ctl/wizard.py +348 -127
- package/runtime/python/okstra_ctl/workflow.py +21 -2
- package/runtime/python/okstra_ctl/worktree.py +54 -1
- package/runtime/python/okstra_project/resolver.py +4 -3
- package/runtime/python/okstra_token_usage/report.py +2 -2
- package/runtime/schemas/final-report-v1.0.schema.json +22 -16
- package/runtime/skills/okstra-brief/SKILL.md +124 -31
- package/runtime/skills/okstra-convergence/SKILL.md +2 -3
- package/runtime/skills/okstra-report-writer/SKILL.md +35 -15
- package/runtime/skills/okstra-run/SKILL.md +5 -4
- package/runtime/skills/okstra-schedule/SKILL.md +4 -4
- package/runtime/skills/okstra-setup/SKILL.md +27 -0
- package/runtime/skills/okstra-team-contract/SKILL.md +1 -1
- package/runtime/templates/okstra.CLAUDE.md +104 -0
- package/runtime/templates/reports/final-report.template.md +93 -98
- package/runtime/templates/reports/i18n/en.json +135 -0
- package/runtime/templates/reports/i18n/ko.json +135 -0
- package/runtime/templates/reports/implementation-planning-input.template.md +18 -0
- package/runtime/templates/reports/improvement-discovery-input.template.md +78 -0
- package/runtime/templates/reports/task-brief.template.md +2 -2
- package/runtime/validators/lib/fixtures.sh +30 -0
- package/runtime/validators/lib/runners.sh +1 -1
- package/runtime/validators/validate-implementation-plan-stages.py +211 -0
- package/runtime/validators/validate-run.py +121 -26
- package/runtime/validators/validate-workflow.sh +2 -2
- package/runtime/validators/validate_improvement_report.py +275 -0
- package/src/config.mjs +18 -0
- package/src/install.mjs +41 -14
- package/src/setup.mjs +133 -1
- package/src/uninstall.mjs +21 -1
|
@@ -49,8 +49,12 @@ The prompt MUST include, in this order at the top:
|
|
|
49
49
|
7. The full `[Required reading]` clause (see [okstra-team-contract](../okstra-team-contract/SKILL.md)) including `schemas/final-report-v1.0.schema.json` and `templates/reports/final-report.template.md` (template is read-only — the worker writes the data.json that drives it).
|
|
50
50
|
8. The verbatim `## Available MCP Servers` block from the task brief, if present.
|
|
51
51
|
9. The convergence classifications (Full/Partial/Contested/Worker-Unique), the round history table (`roundHistory[]`), the `round2SkippedReason` value, and pointers to all worker result files under `worker-results/`. The report-writer worker must reproduce a Round History sub-table in Section 1 of the final report so the reader can see which rounds executed, queue sizes, and why Round 2 was (or was not) skipped.
|
|
52
|
-
10.
|
|
53
|
-
|
|
52
|
+
10. `**Report Language:** <en|ko>` — must be either `en` or `ko`; `auto`
|
|
53
|
+
has been resolved by the lead from project.json / global config
|
|
54
|
+
before the dispatch is constructed. The worker copies this verbatim
|
|
55
|
+
into `data.json.meta.reportLanguage`.
|
|
56
|
+
11. For implementation-planning runs: a literal block listing the 8 required English section headings the validator scans for (`Option Candidates`, `Trade-off`, `Recommended Option`, `Stepwise Execution Order`, `Dependency`, `Validation Checklist`, `Rollback`, `User Approval Request`). The writer must use these exact substrings as section headings (Korean translation in parentheses is allowed).
|
|
57
|
+
12. An explicit instruction: `You are the author of TWO files: (a) the final-report data.json at <Result Path>, (b) the worker-results audit file at <Worker Result Path>. After writing the data.json, invoke "python3 scripts/okstra-render-final-report.py <Result Path>" via Bash so the markdown sibling is rendered before you return. Do not return the report inline. The validator fails the run when (a)'s schema validation fails, when the rendered markdown is absent, or when (b) is missing.`
|
|
54
58
|
|
|
55
59
|
### Resume-safe dispatch
|
|
56
60
|
|
|
@@ -163,26 +167,32 @@ Table Generation Rules:
|
|
|
163
167
|
|
|
164
168
|
Place this section immediately after the execution status table.
|
|
165
169
|
|
|
170
|
+
Example (English mode shown — the renderer substitutes Korean when `meta.reportLanguage = "ko"`):
|
|
171
|
+
|
|
166
172
|
```markdown
|
|
167
|
-
###
|
|
173
|
+
### Token Usage Summary
|
|
168
174
|
|
|
169
|
-
|
|
|
170
|
-
|
|
175
|
+
| Item | Raw tokens | Billable tokens (input-equiv.) | Cost (USD) |
|
|
176
|
+
|------|------------|--------------------------------|------------|
|
|
171
177
|
| Lead | 10,479,327 | 1,769,798 | $26.55 |
|
|
172
|
-
| Worker
|
|
173
|
-
|
|
|
174
|
-
| Codex/Gemini CLI
|
|
178
|
+
| Worker subtotal | 7,988,699 | 2,075,192 | $25.43 |
|
|
179
|
+
| **Grand total** | **18,468,026** | **3,844,990** | **$51.97** |
|
|
180
|
+
| Codex/Gemini CLI add-on | | | $0.00 |
|
|
175
181
|
|
|
176
|
-
>
|
|
182
|
+
> **How to read**: "Raw tokens" is the total tokens the model actually processed (input + output + cache_creation + cache_read). In long sessions cache_read can account for 95%+ making the number look large. "Billable tokens" weights cache_read at 0.1×, cache_creation at 1.25×, and output at 5× to give an input-equivalent figure closer to actual cost. Costs are estimates based on published Anthropic/OpenAI/Google pricing.
|
|
177
183
|
```
|
|
178
184
|
|
|
179
185
|
Token Summary Generation Rules:
|
|
180
186
|
- **You populate the data.json in Phase 6, BEFORE Phase 7 runs the collector.** Set `tokenUsage.lead.totalTokens` / `.billableTokens` / `.costUsd`, the `worker` and `grand` rows, `tokenUsage.cli.costUsd`, and each `executionStatus[].{totalTokens,billableTokens,costUsd,durationMs,cliTotalTokens,cliCostUsd}` to JSON `null`. The renderer emits `--` for nulls; `okstra-token-usage.py --substitute-data` populates them in Phase 7 and re-renders the markdown. Never set these cells to `0`, `"not-collected"`, `"--"`, `"N/A"`, or any other sentinel: nulls are the only valid placeholder, and the substitution step depends on them being null when it runs.
|
|
187
|
+
- Set `meta.reportLanguage` to the resolved `en` or `ko` value passed in
|
|
188
|
+
**Report Language**. `auto` is forbidden in this field — the lead has
|
|
189
|
+
already resolved it. The renderer reads this field as SSOT when no
|
|
190
|
+
CLI `--report-language` flag is given.
|
|
181
191
|
- All values come from `usageSummary` (populated by `scripts/okstra-token-usage.py` at the start of Phase 7). Do not estimate or invent.
|
|
182
192
|
- **Lead** row: `usageSummary.leadTotalTokens` / `usageSummary.leadBillableEquivalentTokens` / `usageSummary.estimatedCostUsd.lead`.
|
|
183
|
-
- **Worker
|
|
184
|
-
-
|
|
185
|
-
- **Codex/Gemini CLI 추가
|
|
193
|
+
- **Worker subtotal** (ko: `Worker 합계`) row: `usageSummary.workerTotalTokens` / `usageSummary.workerBillableEquivalentTokens` / `usageSummary.estimatedCostUsd.claudeWorkers`.
|
|
194
|
+
- **Grand total** (ko: `전체 합계`) row: `usageSummary.grandTotalTokens` / `usageSummary.grandBillableEquivalentTokens` / sum of `lead + claudeWorkers`.
|
|
195
|
+
- **Codex/Gemini CLI add-on** (ko: `Codex/Gemini CLI 추가 비용`) row: `usageSummary.estimatedCostUsd.cliWorkers`. If 0, still show the row so the reader sees that no CLI work was billed under those providers (or that CLI fallback occurred).
|
|
186
196
|
- Format tokens with comma separators (e.g., `32,500`); format USD with two decimals (e.g., `$1.43`).
|
|
187
197
|
- If `lead` or any `worker.usage` has `source: "unavailable"`, show `--` for that row and append a one-line note (`reason: <note>`).
|
|
188
198
|
- If pricing for a model is unknown, the script omits `estimatedCostUsd` for that block — show `N/A` in that column and add a note like `pricing missing for model <model>`.
|
|
@@ -203,7 +213,7 @@ When the run's `task-type` is `implementation-planning`, the final report MUST c
|
|
|
203
213
|
| 8 | `User Approval Request` | Satisfied by the top-of-report `## User Approval Request (사용자 승인 게이트)` block. Do NOT recreate a `### 4.5.8 User Approval Request` body stub — the validator now fails reports that contain one. |
|
|
204
214
|
| 9 | `Plan Body Verification` + `Gate result:` | `### Plan Body Verification (계획 본문 검증)` containing a `Gate result:` line — copy `templates/reports/final-report.template.md §4.5.9` verbatim. Validator checks both substrings. |
|
|
205
215
|
|
|
206
|
-
The Korean translation in parentheses is optional but the English keyword is mandatory. The body of each section is written in
|
|
216
|
+
The Korean translation in parentheses is optional but the English keyword is mandatory. The body of each section is written in the Report Language per the writing rules below. For non-`implementation-planning` runs, omit this entire block — these headings are NOT validator-checked for other task-types.
|
|
207
217
|
|
|
208
218
|
The final-report template `templates/reports/final-report.template.md` Section 4.5 already encodes this contract — copy that block verbatim and fill in.
|
|
209
219
|
|
|
@@ -261,7 +271,17 @@ Section numbering follows `templates/reports/final-report.template.md` exactly
|
|
|
261
271
|
### Writing Guidelines
|
|
262
272
|
|
|
263
273
|
- Write in Markdown. **Prefer tables over prose bullet lists** for any section that enumerates multiple items with the same shape (evidence rows, risks, options, dependencies, rollback steps, follow-ups, open questions). Bullets are reserved for short, single-line standalone statements (e.g., "- 추가 정보 요청 없음."). When the template provides a table form, do NOT degrade it back to bullets in the rendered report.
|
|
264
|
-
- Write the final report body in
|
|
274
|
+
- Write the final report body in the language passed in **Report Language**
|
|
275
|
+
above (`en` or `ko`). The template's fixed labels (section asides,
|
|
276
|
+
empty-states, token summary, column headers, release-handoff labels)
|
|
277
|
+
are i18n-rendered by `okstra-render-final-report.py` from
|
|
278
|
+
`templates/reports/i18n/<lang>.json`; do not translate those — focus
|
|
279
|
+
on the prose you author (Section 1 categories, Section 3 evidence
|
|
280
|
+
narratives, Section 4 risks, Section 6 recommendations, etc.).
|
|
281
|
+
Code identifiers, file paths, model names, status tokens, and the
|
|
282
|
+
validator-checked English substrings (`Option Candidates`,
|
|
283
|
+
`Verdict Token`, `accepted`/`conditional-accept`/`blocked`, etc.)
|
|
284
|
+
stay in English regardless of Report Language.
|
|
265
285
|
- Keep technical identifiers such as file paths, code symbols, model names, and status values in their original form when needed.
|
|
266
286
|
- If only one worker is usable, perform a reduced-confidence synthesis
|
|
267
287
|
- If evidence is insufficient, explicitly state "I don't know"
|
|
@@ -297,7 +317,7 @@ Persistence steps that must be performed in Phase 7:
|
|
|
297
317
|
|
|
298
318
|
### Response after Persistence
|
|
299
319
|
|
|
300
|
-
Provide a concise report in
|
|
320
|
+
Provide a concise report in the Report Language covering the following:
|
|
301
321
|
- Completion status
|
|
302
322
|
- Final report path
|
|
303
323
|
- Team-state path
|
|
@@ -118,7 +118,7 @@ That is the entire interactive flow. The wizard handles:
|
|
|
118
118
|
- task-type pick (with `nextRecommendedPhase` surfaced as recommended for existing tasks),
|
|
119
119
|
- brief path (with `유지 / 변경` for existing tasks),
|
|
120
120
|
- base-ref pick + git rev-parse validation (skipped when reusing an active worktree),
|
|
121
|
-
- `implementation`-only sub-flow: approved-plan path (
|
|
121
|
+
- `implementation`-only sub-flow: approved-plan path (frontmatter `approved: true` check) + executor pick,
|
|
122
122
|
- `Use defaults / Customize` branch with profile-aware worker/model questions,
|
|
123
123
|
- `release-handoff` PR template override + persist scope,
|
|
124
124
|
- final `Proceed / Edit` confirmation; on `Edit` the wizard asks which step to rewind to and clears every later answer.
|
|
@@ -159,6 +159,7 @@ okstra render-bundle \
|
|
|
159
159
|
--task-brief "<args.task-brief>" \
|
|
160
160
|
--executor "<args.executor>" \
|
|
161
161
|
--approved-plan "<args.approved-plan>" \
|
|
162
|
+
--stage "<args.stage>" \
|
|
162
163
|
--base-ref "<args.base-ref>" \
|
|
163
164
|
--workers "<args.workers>" \
|
|
164
165
|
--directive "<args.directive>" \
|
|
@@ -172,7 +173,7 @@ okstra render-bundle \
|
|
|
172
173
|
--pr-template-path "<args.pr-template-path>"
|
|
173
174
|
```
|
|
174
175
|
|
|
175
|
-
`render-bundle` auto-supplies `--workspace-root` and forces `--render-only`. Stdout prints `okstra task root:`, `okstra instruction-set:`, and the full rendered lead prompt. Parse the labelled lines for `TASK_ROOT` and `
|
|
176
|
+
`render-bundle` auto-supplies `--workspace-root` and forces `--render-only`. Stdout prints `okstra task root:`, `okstra instruction-set:`, and the full rendered lead prompt. Parse the labelled lines for `TASK_ROOT` and `INSTRUCTION_SET_PATH`.
|
|
176
177
|
|
|
177
178
|
The python function underneath is mutex-protected (`~/.okstra/.locks/<task-key>.lock`), writes `run-context-*.json` + `run-inputs-*.json` + all manifests + discovery files, and registers the run in `~/.okstra/recent.jsonl` with status `prepared`.
|
|
178
179
|
|
|
@@ -180,7 +181,7 @@ You can delete the literal state-file path after this point — its job is done.
|
|
|
180
181
|
|
|
181
182
|
## Step 6: Take over as Claude lead
|
|
182
183
|
|
|
183
|
-
Read `<
|
|
184
|
+
Read `<INSTRUCTION_SET_PATH>/claude-execution-prompt.md` verbatim and enter `Claude lead` mode. The lead prompt itself enumerates every other instruction-set file to load (`analysis-profile.md`, `analysis-material.md`, `reference-expectations.md`, `final-report-template.md`, the run manifest, the team-state artifact, etc.) — follow its order, do not preempt it.
|
|
184
185
|
|
|
185
186
|
Then proceed through the phases exactly as the lead prompt directs (Phase 1 context → Phase 2+ worker dispatch → final synthesis → final report).
|
|
186
187
|
|
|
@@ -218,7 +219,7 @@ The scope is held in the wizard state but is not yet exposed by any `okstra wiza
|
|
|
218
219
|
| `No module named okstra_ctl.wizard` | Install predates wizard module | `npx okstra@latest install` to refresh. |
|
|
219
220
|
| `wizard step` returns `ok: false` repeatedly | User keeps giving invalid answers | Echo the error verbatim and re-prompt the same step — do not advance. |
|
|
220
221
|
| `task root not found for <key>` | catalog entry stale or task-key typo | Restart the wizard (`okstra wizard init`) to refresh the pick list. |
|
|
221
|
-
| `approved plan
|
|
222
|
+
| `approved plan is not yet approved (frontmatter ...)` | `implementation` without proper approval | Ask the user to flip the plan's frontmatter `approved` field to `true` (manual edit or `--approve`), or pick a different task-type. |
|
|
222
223
|
|
|
223
224
|
## Output Rules
|
|
224
225
|
|
|
@@ -180,7 +180,7 @@ After writing the file, reply briefly:
|
|
|
180
180
|
|
|
181
181
|
**The schedule is a client-facing work plan.** It assumes the team has all permissions and can proceed without further approval. Even when the underlying per-task reports flag blocking items, missing approvals, or "사용자 확인 필요 항목", **the schedule MUST NOT surface them**. Those concerns belong in the internal report, not the deliverable.
|
|
182
182
|
|
|
183
|
-
### Authority & permissions assumption (
|
|
183
|
+
### Authority & permissions assumption (schedule sizing)
|
|
184
184
|
|
|
185
185
|
**Assume the user (and their team) holds full authority and every permission required for every included task.** External approvals, third-party access grants, role/IAM permissions, organisational sign-off, legal/compliance review, vendor coordination, and "verify access exists" steps are treated as already satisfied unless the source per-task report explicitly identifies a concrete external dependency outside the user's control.
|
|
186
186
|
|
|
@@ -232,9 +232,9 @@ Rules for Form B:
|
|
|
232
232
|
|
|
233
233
|
The only cross-reference that needs neither inlining nor a glossary entry is a TASK-ID that itself appears in the `## At a Glance` table.
|
|
234
234
|
|
|
235
|
-
The validator
|
|
235
|
+
The validator rejects any of these patterns.
|
|
236
236
|
|
|
237
|
-
## Section Contract (
|
|
237
|
+
## Section Contract (required)
|
|
238
238
|
|
|
239
239
|
The canonical template lives at `templates/reports/schedule.template.md`. **Read it before writing the schedule** and follow it byte-for-byte for headings.
|
|
240
240
|
|
|
@@ -376,7 +376,7 @@ After the `Item / Detail` table, every per-task block MUST emit these sub-sectio
|
|
|
376
376
|
4. `**Verification Commands**:` (followed by a fenced ` ```bash ` block)
|
|
377
377
|
5. `**Rollback**:`
|
|
378
378
|
|
|
379
|
-
The validator enforces order by scanning each `### N-i.` block. A missing section or an out-of-order section is a
|
|
379
|
+
The validator enforces order by scanning each `### N-i.` block. A missing section or an out-of-order section is a contract violation. **Never emit `#### 사용자 확인 필요 항목`** — this is a client-facing schedule (see "Audience" above).
|
|
380
380
|
|
|
381
381
|
### MUST — controlled vocabulary (enums)
|
|
382
382
|
|
|
@@ -111,6 +111,9 @@ Each okstra run provisions a task-scoped git worktree under
|
|
|
111
111
|
directories is symlinked from the main checkout into that worktree so
|
|
112
112
|
every task sees the shared state. The built-in default is
|
|
113
113
|
`.project-docs`, `.scratch`, `graphify-out`, `.claude`.
|
|
114
|
+
Syncing a directory does not make it okstra memory; okstra-owned context
|
|
115
|
+
and writes still stay under `<PROJECT_ROOT>/.project-docs/okstra/**`
|
|
116
|
+
unless the task brief explicitly authorizes a non-okstra path.
|
|
114
117
|
|
|
115
118
|
To override per-project, add a `worktreeSyncDirs` array to
|
|
116
119
|
`project.json`. Empty array disables the feature; the field is
|
|
@@ -251,6 +254,30 @@ If the user chose `나중에`, tell them they can register later with one of:
|
|
|
251
254
|
(the run can also persist that override to project/global scope on the
|
|
252
255
|
spot — see the okstra-run skill).
|
|
253
256
|
|
|
257
|
+
## Step 4.9 (optional): choose final report language
|
|
258
|
+
|
|
259
|
+
기본은 영어. 이 step 을 skip 하면 `reportLanguage` 필드를 두지 않고
|
|
260
|
+
runtime 이 `auto` 로 처리한다 — 즉 task brief 의 주 서술 언어를 따라
|
|
261
|
+
간다 (한국어 brief → 한국어 report, 영어 brief → 영어 report).
|
|
262
|
+
|
|
263
|
+
사용자가 명시적으로 선택하면 `okstra config set` 으로 `project.json`
|
|
264
|
+
에 기록한다.
|
|
265
|
+
|
|
266
|
+
AskUserQuestion (fixed options):
|
|
267
|
+
- Question: `"Final report 를 어느 언어로 작성할까요?"`
|
|
268
|
+
- Options:
|
|
269
|
+
1. `English (recommended)` → reportLanguage: "en"
|
|
270
|
+
2. `한국어` → reportLanguage: "ko"
|
|
271
|
+
3. `Auto (task brief 언어로 추론, 불분명하면 영어)` → reportLanguage: "auto"
|
|
272
|
+
4. `나중에` → skip (필드 미설정 → runtime 이 auto 로 처리)
|
|
273
|
+
|
|
274
|
+
If the user picks 1/2/3, run:
|
|
275
|
+
|
|
276
|
+
`okstra config set report-language <en|ko|auto> --scope project`
|
|
277
|
+
|
|
278
|
+
전역 기본값을 두고 싶다면 README 의 "global config" 안내를 따라
|
|
279
|
+
`--scope global` 로 수동 설정한다. 이 step 에서는 project 스코프만 제공한다.
|
|
280
|
+
|
|
254
281
|
## Step 5: Verify
|
|
255
282
|
|
|
256
283
|
```bash
|
|
@@ -374,7 +374,7 @@ without proceeding — this is the contractual replacement for the previous
|
|
|
374
374
|
empty run-level error logs in production.
|
|
375
375
|
|
|
376
376
|
- `cli-failure` events are recorded by the wrapper subagent itself (Codex / Gemini), but **directly to the run-level error log** via `okstra-error-log.py append-observed --error-type cli-failure ...` — NOT via the sidecar. The sidecar is an in-process tool-failure channel only.
|
|
377
|
-
- **Wrapper invocation arity.** Both `okstra-codex-exec.sh` and `okstra-gemini-exec.sh` accept four required positional arguments plus an optional fifth `<role>`: `<project-root> <model> <prompt-path> <worktree-path> [<role>]`. The fourth (worktree) argument is **mandatory for implementation phase** and optional otherwise. For codex it becomes `--add-dir <worktree>` (sandbox write access); for gemini it is appended to `--include-directories`. Omitting it during implementation causes the codex sandbox to reject every Edit/Write targeting the worktree with EPERM. Workers extract the path from the `**Worktree:**` / `EXECUTOR_WORKTREE_PATH` / `cwd for every mutating command:` line in the lead prompt. The optional fifth `<role>` is folded into both the caller (worker) pane title `<cli>-<role>-<pid>` and the sibling trace-pane title `<cli>-<role>-<pid>-trace` (e.g. `codex-worker-93421` ↔ `codex-worker-93421-trace`). `<pid>` is the wrapper's own PID and disambiguates concurrent dispatches of the same role. Always pass the literal string `worker` so the dispatch is self-describing (the wrapper defaults to `worker` if omitted).
|
|
377
|
+
- **Wrapper invocation arity.** Both `okstra-codex-exec.sh` and `okstra-gemini-exec.sh` accept four required positional arguments plus an optional fifth `<role>`: `<project-root> <model> <prompt-path> <worktree-path> [<role>]`. The fourth (worktree) argument is **mandatory for implementation phase** and optional otherwise. For codex it becomes `--add-dir <worktree>` (sandbox write access); for gemini it is appended to `--include-directories`. Omitting it during implementation causes the codex sandbox to reject every Edit/Write targeting the worktree with EPERM. Workers extract the path from the `**Worktree:**` / `EXECUTOR_WORKTREE_PATH` / `cwd for every mutating command:` line in the lead prompt. The optional fifth `<role>` is folded into both the caller (worker) pane title `<cli>-<role>-<pid>` and the sibling trace-pane title `<cli>-<role>-<pid>-trace[from=<caller-pane-id>]` (e.g. `codex-worker-93421` ↔ `codex-worker-93421-trace[from=%5]`). `<pid>` is the wrapper's own PID and disambiguates concurrent dispatches of the same role; the embedded caller pane id keeps the trace ↔ worker correlation visible even when the worker pane's title is overwritten by the parent process (Claude Code's TUI emits OSC 2 title escape sequences on its own pane). Always pass the literal string `worker` so the dispatch is self-describing (the wrapper defaults to `worker` if omitted).
|
|
378
378
|
- **Background dispatch + polling contract (Codex / Gemini wrappers).** Both wrapper subagents MUST dispatch `okstra-codex-exec.sh` / `okstra-gemini-exec.sh` via `Bash(run_in_background: true)` and poll with `BashOutput(bash_id)` until the shell reports `status == "completed"`, capped at 30 minutes (1800s) of wall-clock elapsed time. `BashOutput` itself is the wait primitive — call it back-to-back; do NOT insert a standalone `sleep` between polls. The Claude Code harness blocks `sleep` calls of 5 seconds or longer as a circumvention vector and explicitly forbids chaining shorter sleeps inside until-loops to work around the block. Workers that hit the contract bug must NOT self-recover with `until ...; do sleep 2; done` wrappers — that path violates the harness anti-circumvention rule, even though it superficially "works". The legacy "single foreground `Bash` with 120000ms timeout" rule, and the subsequent "60-second cadence with `sleep 60` between polls" rule, are both retired. The current rule applies in **every phase** (analysis runs typically complete in 1–2 `BashOutput` calls, so there is no regression for short jobs). Recording responsibilities:
|
|
379
379
|
- Successful completion: return the wrapper's accumulated stdout from the final `BashOutput`. No log entry.
|
|
380
380
|
- Non-zero `exit_code` reported by `BashOutput`: record a `cli-failure` to the run-level error log with the real `exit_code` and observed `duration-ms`.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# okstra — agent guidance (managed)
|
|
2
|
+
|
|
3
|
+
This file is shipped by `okstra install` and surfaced into the active project
|
|
4
|
+
through two channels by `okstra setup`:
|
|
5
|
+
|
|
6
|
+
- **Claude Code**: `<PROJECT>/CLAUDE.md` gets an `@.project-docs/okstra/CLAUDE.md`
|
|
7
|
+
import block (per-project symlink to this template). Existing user content
|
|
8
|
+
in `CLAUDE.md` is preserved — the block lives between
|
|
9
|
+
`<!-- okstra:claude-md:begin ... -->` markers.
|
|
10
|
+
- **Codex / Aider / other AGENTS.md-aware agents**: `<PROJECT>/AGENTS.md` is
|
|
11
|
+
created as a direct symlink to this template — but **only if AGENTS.md does
|
|
12
|
+
not already exist**. okstra never overwrites a hand-written AGENTS.md.
|
|
13
|
+
|
|
14
|
+
It is **owned by the okstra package**: every `okstra install` overwrites
|
|
15
|
+
`~/.okstra/templates/okstra.CLAUDE.md` from the version currently on disk in
|
|
16
|
+
the npm package. Edits made directly to this file (or to the per-project
|
|
17
|
+
`<PROJECT>/.project-docs/okstra/CLAUDE.md` / `<PROJECT>/AGENTS.md` symlinks)
|
|
18
|
+
will be lost on the next install. Put project-specific overrides outside the
|
|
19
|
+
managed block in `<PROJECT>/CLAUDE.md` instead (or replace `AGENTS.md` with
|
|
20
|
+
your own file — okstra will respect it).
|
|
21
|
+
|
|
22
|
+
## What okstra is
|
|
23
|
+
|
|
24
|
+
okstra is a multi-agent cross-verification orchestrator. A Claude lead drives
|
|
25
|
+
the run; codex / gemini / claude workers produce independent analyses; a
|
|
26
|
+
report writer worker synthesises the final report. Day-to-day usage happens
|
|
27
|
+
through slash commands inside a Claude Code session.
|
|
28
|
+
|
|
29
|
+
## Slash commands
|
|
30
|
+
|
|
31
|
+
| Command | When to use |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `/okstra-setup` | First-time bootstrap in a new project — writes `.project-docs/okstra/project.json`, provisions `.claude/settings.local.json` and `.project-docs/okstra/CLAUDE.md`. |
|
|
34
|
+
| `/okstra-brief` | Turn a requirements doc / ticket / link / conversation into the markdown task brief consumed by `okstra-run`. |
|
|
35
|
+
| `/okstra-run` | Start a cross-verification task in the current session. Drives the interactive wizard. |
|
|
36
|
+
| `/okstra-status` | Inspect overall okstra task status, current phase, blockers, next recommended phase. Also flips a task's workStatus (todo / in-progress / blocked / done). |
|
|
37
|
+
| `/okstra-history` | List past runs, review previous results, queue a re-run. |
|
|
38
|
+
| `/okstra-schedule` | Generate a consolidated work plan across multiple tasks in a task-group. |
|
|
39
|
+
| `/okstra-convergence` | Iterative cross-verification between workers in Phase 5.5; classify findings by consensus level. |
|
|
40
|
+
| `/okstra-report-finder` | Locate the final-report path for a given task key, or read a past report to continue work. |
|
|
41
|
+
| `/okstra-report-writer` | Author / persist the final synthesis report (Phase 6–7). |
|
|
42
|
+
| `/okstra-time-summary` | Per-task / per-worker elapsed time breakdown for a task-id. |
|
|
43
|
+
| `/okstra-logs` | List, size, and clean up `*.log` sidecars from past worker dispatches. |
|
|
44
|
+
|
|
45
|
+
Type the slash command — do not paraphrase the trigger words into prose.
|
|
46
|
+
|
|
47
|
+
## Workflow boundaries
|
|
48
|
+
|
|
49
|
+
- The Claude lead **does not** produce independent worker findings. It
|
|
50
|
+
dispatches workers, monitors them, and drives convergence. Analysis is the
|
|
51
|
+
workers' job.
|
|
52
|
+
- Worker wrappers (`okstra-codex-exec.sh`, `okstra-gemini-exec.sh`) run from
|
|
53
|
+
`~/.okstra/bin/` and are pre-authorised via `<PROJECT>/.claude/settings.local.json`
|
|
54
|
+
(a symlink to `~/.okstra/templates/settings.local.json`). Do **not**
|
|
55
|
+
duplicate those permissions in the user's global `~/.claude/settings.json`.
|
|
56
|
+
- Each okstra run provisions a task-scoped git worktree under
|
|
57
|
+
`~/.okstra/worktrees/`. Files synced from the main checkout are governed by
|
|
58
|
+
`worktreeSyncDirs` in `.project-docs/okstra/project.json` (default:
|
|
59
|
+
`.project-docs`, `.scratch`, `graphify-out`, `.claude`).
|
|
60
|
+
- QA gating is configured via `qaCommands` in the same `project.json`.
|
|
61
|
+
Verifiers reject mutation-style commands (`--fix`, `--write`, `cargo update`,
|
|
62
|
+
`npm install`, etc.); declare check-only variants only.
|
|
63
|
+
|
|
64
|
+
## Coding Principles (BLOCKING — agent self-checks before declaring work complete)
|
|
65
|
+
|
|
66
|
+
These apply to every worker writing or editing project code (executor and verifiers alike). Enforcement is self-check: the agent runs each rule's check immediately before reporting "done"; skipping a check is itself a contract violation.
|
|
67
|
+
|
|
68
|
+
1. **DRY — single reference point** — One implementation per capability. A second caller signals "extract shared logic", not "duplicate path".
|
|
69
|
+
2. **KISS — simplest sufficient design** — Add abstraction layers (helper modules, strategy/factory, configuration flags, indirection) only when an existing concrete call site requires them. *Self-check: name the second caller now; if you cannot, inline.* *Example violation: extracting `formatUserName()` helper used by exactly one call site, "in case we need it elsewhere".*
|
|
70
|
+
3. **YAGNI — build only for current requirements** — No speculative parameters, optional configs, "future-proof" hooks, or pre-1.0 backwards-compat shims. *Self-check: every newly introduced identifier has ≥1 current internal caller, or was explicitly user-requested.* *Example violation: adding `options?: { retries?, timeout? }` parameter when the current call passes nothing.*
|
|
71
|
+
4. **Clean Code — names carry WHAT, comments explain WHY** — Identifiers must make intent obvious; if a comment would describe WHAT the code does, rename instead. Reserve comments for non-obvious WHY (hidden constraint, workaround, surprising invariant). Delete dead/commented-out code immediately — git history is the archive. *Example — WHAT (rename instead): `// increment counter` above `i++`. WHY (keep): `// retry up to 3x: upstream returns 502 during deploys`.*
|
|
72
|
+
5. **Function length cap — 50 lines** — A single function/method body must stay within 50 lines, counting only effective code (exclude blank lines, comments, and pure data declarations such as large enums, lookup tables, or constant maps). Crossing the cap is an extraction signal, not a style nit. *Self-check: for any function newly added or substantially edited, count effective body lines; if over 50, split before declaring complete, or surface the violation and confirm with the user.*
|
|
73
|
+
|
|
74
|
+
## Phase model (high level)
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
Phase 1 context-loader → load brief + project context
|
|
78
|
+
Phase 2 team-contract → confirm lead + worker roster
|
|
79
|
+
Phase 3 worker dispatch → workers run independently in parallel
|
|
80
|
+
Phase 4 result collection → gather worker outputs
|
|
81
|
+
Phase 5 cross-review → workers critique each other's findings
|
|
82
|
+
Phase 5.5 convergence → classify findings, iterate until stable
|
|
83
|
+
Phase 6 report-writer dispatch → synthesise final report
|
|
84
|
+
Phase 7 artifact persistence → manifests, central index update
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The lead skill (`okstra-run`) advances phases automatically. Use
|
|
88
|
+
`/okstra-status` to inspect the current phase and `next-recommended-phase`
|
|
89
|
+
hint when resuming.
|
|
90
|
+
|
|
91
|
+
## Troubleshooting hints
|
|
92
|
+
|
|
93
|
+
- "okstra runtime missing" / `InstallationError` — run
|
|
94
|
+
`npx okstra@latest install` (or `okstra ensure-installed`).
|
|
95
|
+
- Worker dispatch refused by Claude Code permissions — verify
|
|
96
|
+
`<PROJECT>/.claude/settings.local.json` is a symlink to
|
|
97
|
+
`~/.okstra/templates/settings.local.json`; re-run `/okstra-setup` to
|
|
98
|
+
re-provision.
|
|
99
|
+
- `qa-command not configured: <category>` warnings — add the missing
|
|
100
|
+
`lint` / `format` / `typecheck` / `test` entries to `qaCommands` in
|
|
101
|
+
`project.json`.
|
|
102
|
+
|
|
103
|
+
For deeper documentation see the package README and `docs/` in the okstra
|
|
104
|
+
source tree.
|