okstra 0.34.1 → 0.36.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.kr.md +27 -19
- package/README.md +27 -19
- 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 +353 -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/plans/2026-05-24-implementation-lead-context-slimming.md +1700 -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 +30 -7
- package/runtime/agents/workers/claude-worker.md +31 -6
- package/runtime/agents/workers/codex-worker.md +37 -10
- package/runtime/agents/workers/gemini-worker.md +34 -7
- package/runtime/agents/workers/report-writer-worker.md +19 -10
- 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/launch.template.md +1 -0
- package/runtime/prompts/profiles/_common-contract.md +11 -6
- package/runtime/prompts/profiles/_implementation-deliverable.md +53 -0
- package/runtime/prompts/profiles/_implementation-executor.md +60 -0
- package/runtime/prompts/profiles/_implementation-verifier.md +76 -0
- 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 -118
- package/runtime/prompts/profiles/improvement-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 +26 -20
- package/runtime/python/okstra_ctl/render.py +166 -207
- package/runtime/python/okstra_ctl/render_final_report.py +53 -10
- package/runtime/python/okstra_ctl/run.py +299 -108
- package/runtime/python/okstra_ctl/run_context.py +22 -0
- package/runtime/python/okstra_ctl/seeding.py +186 -0
- package/runtime/python/okstra_ctl/session.py +65 -7
- 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 +102 -218
- package/runtime/skills/okstra-convergence/SKILL.md +2 -3
- package/runtime/skills/okstra-inspect/SKILL.md +581 -0
- package/runtime/skills/okstra-report-writer/SKILL.md +35 -15
- package/runtime/skills/okstra-run/SKILL.md +8 -7
- package/runtime/skills/okstra-schedule/SKILL.md +14 -157
- package/runtime/skills/okstra-setup/SKILL.md +28 -1
- package/runtime/skills/okstra-team-contract/SKILL.md +16 -107
- package/runtime/templates/okstra.CLAUDE.md +104 -0
- package/runtime/templates/reports/brief.template.md +204 -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/schedule.template.md +12 -3
- package/runtime/templates/reports/task-brief.template.md +2 -2
- package/runtime/templates/worker-prompt-preamble.md +108 -0
- 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 +27 -3
- package/runtime/skills/okstra-history/SKILL.md +0 -165
- package/runtime/skills/okstra-logs/SKILL.md +0 -173
- package/runtime/skills/okstra-report-finder/SKILL.md +0 -111
- package/runtime/skills/okstra-status/SKILL.md +0 -246
- package/runtime/skills/okstra-time-summary/SKILL.md +0 -172
|
@@ -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
|
|
@@ -18,9 +18,9 @@ Launch an okstra task — gather inputs interactively via the **wizard state mac
|
|
|
18
18
|
|
|
19
19
|
## When NOT to Use
|
|
20
20
|
|
|
21
|
-
- User explicitly asks to spawn a new terminal / new claude — use `okstra-history`
|
|
22
|
-
- User wants status only — use `okstra-status`.
|
|
23
|
-
- User wants past runs — use `okstra-history`.
|
|
21
|
+
- User explicitly asks to spawn a new terminal / new claude — use `okstra-inspect history.4` (resume command) or instruct them to run `okstra` in another terminal.
|
|
22
|
+
- User wants status only — use `okstra-inspect status`.
|
|
23
|
+
- User wants past runs — use `okstra-inspect history`.
|
|
24
24
|
|
|
25
25
|
## How the wizard talks to you
|
|
26
26
|
|
|
@@ -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
|
|
|
@@ -18,7 +18,7 @@ The skill runs as a single Claude lead synthesis (lightweight mode). A `--cross-
|
|
|
18
18
|
- User wants a single document that summarizes all non-done tasks with effort, risk, and dependencies
|
|
19
19
|
- A `task-group` exists in `.project-docs/okstra/discovery/task-catalog.json` with at least one task whose `workStatus` is not `done`
|
|
20
20
|
|
|
21
|
-
**Do NOT use** for single-task analysis (use `okstra-status` instead) or when the user wants to actually execute one task (use the parent `okstra` skill).
|
|
21
|
+
**Do NOT use** for single-task analysis (use `okstra-inspect status` instead) or when the user wants to actually execute one task (use the parent `okstra` skill).
|
|
22
22
|
|
|
23
23
|
## Trigger Patterns (recognize both)
|
|
24
24
|
|
|
@@ -78,7 +78,7 @@ This skill performs cross-task synthesis (multi-task classification, dependency
|
|
|
78
78
|
|
|
79
79
|
Since the `feat(scripts/render): project workStatus fields into task-catalog entries` change (commit `c44c36b`), `workStatus` is also surfaced directly inside each catalog entry — Step 1 still re-reads each `task-manifest.json` because the manifest is authoritative, but no extra fetch is needed beyond that.
|
|
80
80
|
|
|
81
|
-
For inference rules when `workStatus` is missing or empty, **defer to the inference table in `skills/okstra-
|
|
81
|
+
For inference rules when `workStatus` is missing or empty, **defer to the inference table in `skills/okstra-inspect/SKILL.md` (`status.4` → "Default value convention")** instead of duplicating it here. Apply that table to derive a working value, then filter:
|
|
82
82
|
|
|
83
83
|
- If the resolved value is `done` (set by the user OR inferred via `currentStatus == "completed"` + terminal next-phase) → exclude.
|
|
84
84
|
- Otherwise (`todo` / `in-progress` / `blocked` / `phase-done` / explicit user value / inferred non-done) → include.
|
|
@@ -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
|
|
|
@@ -444,45 +444,15 @@ After writing the file and before printing the completion message in Step 7, you
|
|
|
444
444
|
python3 validators/validate-schedule.py <output-path>
|
|
445
445
|
```
|
|
446
446
|
3. If the validator exits non-zero, **fix the file and re-validate**. Do not print the completion message until the validator passes.
|
|
447
|
-
4. If `validators/validate-schedule.py` is not present in the repo, fall back to a manual checklist: confirm each of the 11 mandatory headings appears in the file with
|
|
447
|
+
4. If `validators/validate-schedule.py` is not present in the repo, fall back to a manual checklist: confirm each of the 11 mandatory headings from `### MUST — exact ordered heading list` (above) appears in the file with that exact spelling, the title ends with `— Work Schedule`, and the metadata `> Generated:` block is present.
|
|
448
448
|
|
|
449
449
|
## Schedule Document Template
|
|
450
450
|
|
|
451
|
-
|
|
451
|
+
[`templates/reports/schedule.template.md`](../../templates/reports/schedule.template.md) is the byte-for-byte SSOT for section ordering, heading spelling, table columns, and per-section HTML-comment guidance (Dependency Graph Shape A/B, Gantt rules, optional Glossary gate). Do not omit sections; if data is unavailable, render the section with `_없음_` rather than skipping it.
|
|
452
452
|
|
|
453
|
-
|
|
453
|
+
The two rules below complement the template — they encode COMPUTATION that the template scaffold cannot carry inline.
|
|
454
454
|
|
|
455
|
-
|
|
456
|
-
# <Title> — Work Schedule
|
|
457
|
-
|
|
458
|
-
> Generated: <YYYY-MM-DD HH:MM> | Project: <project-id> | Task Group: <task-group>
|
|
459
|
-
> Source: okstra <mode> (<N> tasks included, <M> done excluded)
|
|
460
|
-
|
|
461
|
-
---
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
### Section: At a Glance (FIRST content section after header)
|
|
465
|
-
|
|
466
|
-
This section gives the reader the entire schedule scope at a single screen.
|
|
467
|
-
|
|
468
|
-
```markdown
|
|
469
|
-
## At a Glance
|
|
470
|
-
|
|
471
|
-
**총 <N>개 task / 예상 소요: <X.X> ~ <Y.Y> days (Effort 합산)**
|
|
472
|
-
|
|
473
|
-
| # | Task ID | Title | Category | Priority | Effort | Days | taskType | Risk | Phase |
|
|
474
|
-
|---|---------|-------|----------|----------|--------|------|----------|------|-------|
|
|
475
|
-
| 1 | <TASK-ID> | <Title> | <category> | <P0~P3> | <S/M/L/XL> | <range> | <taskType> | <risk> | <1/2/3> |
|
|
476
|
-
| ... |
|
|
477
|
-
|
|
478
|
-
**Effort 분포**: S × <n> / M × <n> / L × <n> / XL × <n>
|
|
479
|
-
**Risk 분포**: Very Low × <n> / Low × <n> / Medium × <n> / Med-High × <n> / High × <n>
|
|
480
|
-
**Repo별 영향**: <repo1> (<n>) / <repo2> (<n>) / ...
|
|
481
|
-
|
|
482
|
-
---
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
Effort-to-Day mapping (used to compute the total day range):
|
|
455
|
+
### Effort-to-Day mapping (At a Glance total)
|
|
486
456
|
|
|
487
457
|
| Size | Day(s) |
|
|
488
458
|
|------|----------|
|
|
@@ -491,131 +461,18 @@ Effort-to-Day mapping (used to compute the total day range):
|
|
|
491
461
|
| L | 3 - 5 |
|
|
492
462
|
| XL | 5 - 10 |
|
|
493
463
|
| XXL | 10 - |
|
|
494
|
-
Sum the lower bounds for the lower total and the upper bounds for the upper total.
|
|
495
|
-
|
|
496
|
-
### Section: Executive Summary
|
|
497
|
-
|
|
498
|
-
```markdown
|
|
499
|
-
## Executive Summary
|
|
500
|
-
|
|
501
|
-
<Phase 분류 요약 + 진행 전략 — 2~4문장>
|
|
502
|
-
|
|
503
|
-
- **Phase 1 (Critical Fixes)**: <n>개 task — <summary>
|
|
504
|
-
- **Phase 2 (Enhancements)**: <n>개 task — <summary>
|
|
505
|
-
- **Phase 3 (Architecture)**: <n>개 task — <summary>
|
|
506
|
-
|
|
507
|
-
### Effort Sizing 기준
|
|
508
|
-
|
|
509
|
-
| Size | 기준 | Day(s) |
|
|
510
|
-
|------|------|--------|
|
|
511
|
-
| **S** | 1-2 files, 1 repo, 테스트 수정만, DB 변경 없음 | 0.5 - 1 |
|
|
512
|
-
| **M** | 3-5 files, 1 repo, 신규 테스트 포함, DB 변경 없음 | 2 - 3 |
|
|
513
|
-
| **L** | 5-15 files, 2-3 repos, 순차 배포, 패키지 릴리스 포함 가능 | 3 - 5 |
|
|
514
|
-
| **XL** | 15+ files, 3+ repos + infra, frontend 동시 변경, 아키텍처 전환 | 5 - 10 |
|
|
515
|
-
| **XXL** | 작업 더 세분화 필요 | 10 - |
|
|
516
|
-
|
|
517
|
-
---
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
### Section: Task Dependency Graph
|
|
521
|
-
|
|
522
|
-
This section MUST follow ONE of two exact shapes — free-form ASCII art, mermaid, PlantUML, or Graphviz are all forbidden.
|
|
523
|
-
|
|
524
|
-
**Shape A — no dependency data.** Single italicized blockquote-line under the heading, literal Korean:
|
|
525
|
-
|
|
526
|
-
```
|
|
527
|
-
_의존 정보 없음_
|
|
528
|
-
```
|
|
529
|
-
|
|
530
|
-
**Shape B — adjacency-list inside a plain fence.** When dependency edges are extracted from per-task reports, emit them as a fenced block with NO language tag. Each non-empty line is one of:
|
|
531
|
-
|
|
532
|
-
- An adjacency line: `<TASK-ID> -> <TASK-ID>[, <TASK-ID>]*`
|
|
533
|
-
- A comment line starting with `#` (free prose, max one per group)
|
|
534
|
-
- A blank line (group separator)
|
|
535
|
-
|
|
536
|
-
```
|
|
537
|
-
DEV-1 -> DEV-2, DEV-3
|
|
538
|
-
DEV-2 -> DEV-4
|
|
539
|
-
# Phase 3 fan-out
|
|
540
|
-
DEV-5 -> DEV-6
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
Rules:
|
|
544
|
-
- Use ASCII arrow `->` only. Unicode `→` is rejected so downstream tooling does not have to handle both.
|
|
545
|
-
- Both endpoints MUST be `TASK-ID` literals (the same identifiers used in the At a Glance table). Free text is forbidden.
|
|
546
|
-
- Fence MUST be plain ` ``` ` with no language tag. ` ```mermaid `, ` ```plantuml `, ` ```graphviz `, ` ```dot ` are all rejected.
|
|
547
|
-
- If only one task is in scope (no dependencies), use Shape A — do NOT emit an empty fence.
|
|
548
|
-
|
|
549
|
-
### Section: Phase 1 / Phase 2 / Phase 3
|
|
550
|
-
|
|
551
|
-
For each phase, repeat the per-task block:
|
|
552
|
-
|
|
553
|
-
````markdown
|
|
554
|
-
## Phase <N>: <Name>
|
|
555
|
-
|
|
556
|
-
### <N>-<i>. <TASK-ID> — <Title>
|
|
557
|
-
|
|
558
|
-
| Item | Detail |
|
|
559
|
-
|------|--------|
|
|
560
|
-
| **Category** | <category> |
|
|
561
|
-
| **Priority** | <P0~P3> |
|
|
562
|
-
| **Effort** | **<S/M/L/XL>** (<scope summary>) |
|
|
563
|
-
| **Status** | <workStatus + currentPhase summary> |
|
|
564
|
-
| **Risk** | <risk> |
|
|
565
|
-
| **Scope** | <files / repos summary> |
|
|
566
|
-
| **Repo** | <repos> |
|
|
567
|
-
|
|
568
|
-
**Problem**: <…>
|
|
569
|
-
|
|
570
|
-
**Solution**: <…>
|
|
571
|
-
|
|
572
|
-
**Work Breakdown**:
|
|
573
|
-
|
|
574
|
-
| Step | File | Action | Detail |
|
|
575
|
-
|------|------|--------|--------|
|
|
576
|
-
| 1 | <path> | CREATE/MODIFY/VERIFY | <detail> |
|
|
577
|
-
| ... |
|
|
578
|
-
|
|
579
|
-
**Verification Commands**:
|
|
580
|
-
```bash
|
|
581
|
-
<commands>
|
|
582
|
-
```
|
|
583
|
-
|
|
584
|
-
**Rollback**: <…>
|
|
585
|
-
|
|
586
|
-
---
|
|
587
|
-
````
|
|
588
|
-
|
|
589
|
-
If a task entry is `[NEEDS-OKSTRA-RUN]` or `[PARSE-ERROR: <section>]`, place the marker immediately under the task heading and fill only the available fields.
|
|
590
|
-
|
|
591
|
-
### Section: Execution Priority Matrix
|
|
592
|
-
|
|
593
|
-
```markdown
|
|
594
|
-
## Execution Priority Matrix
|
|
595
|
-
|
|
596
|
-
| Priority | Task | Effort | Risk | Next Action |
|
|
597
|
-
|----------|------|--------|------|-------------|
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
Each row summarizes the next concrete engineering action per task in priority order. No `Done` / `Ready?` / `Blocking Decisions` columns — schedule is a client-facing plan, not an internal todo board.
|
|
601
|
-
|
|
602
|
-
### Section: Cross-Task Dependencies & Shared Concerns
|
|
603
|
-
|
|
604
|
-
Free-form prose listing inter-task overlaps, shared packages, release order, etc.
|
|
605
|
-
|
|
606
|
-
### Section: Risk Mitigation Strategy
|
|
607
464
|
|
|
608
|
-
|
|
465
|
+
Sum the lower bounds across all in-scope tasks for the lower total, and the upper bounds for the upper total. The same table is rendered as descriptive reference under `### Effort Sizing 기준`; this copy is the source-of-truth for the At a Glance computation.
|
|
609
466
|
|
|
610
|
-
###
|
|
467
|
+
### `[NEEDS-OKSTRA-RUN]` / `[PARSE-ERROR: <section>]` placement
|
|
611
468
|
|
|
612
|
-
|
|
469
|
+
When a task entry is tagged with one of these markers, place the marker immediately under the per-task heading inside the corresponding Phase section and fill only the available fields. Do NOT relocate it to a sibling section.
|
|
613
470
|
|
|
614
471
|
## Edge Cases
|
|
615
472
|
|
|
616
473
|
| Case | Handling |
|
|
617
474
|
|------|----------|
|
|
618
|
-
| `workStatus` field absent or empty | Resolve via the okstra-status inference table; include unless the resolved value is `done` |
|
|
475
|
+
| `workStatus` field absent or empty | Resolve via the `okstra-inspect status.4` inference table; include unless the resolved value is `done` |
|
|
619
476
|
| Filtered task count is 0 | Emit "모든 task가 done" message; do NOT create a file |
|
|
620
477
|
| `latestReportPath` missing or unreadable | Tag entry with `[NEEDS-OKSTRA-RUN]`; include manifest metadata only |
|
|
621
478
|
| Report parsing fails for a specific section | Tag with `[PARSE-ERROR: <section>]`; continue with the rest |
|
|
@@ -17,7 +17,7 @@ machine, or when adopting okstra in a new project.
|
|
|
17
17
|
## When NOT to use
|
|
18
18
|
|
|
19
19
|
- A task is already in flight → use [`okstra-run`](../okstra-run/SKILL.md) or
|
|
20
|
-
[`okstra-status`](../okstra-
|
|
20
|
+
[`okstra-inspect status`](../okstra-inspect/SKILL.md).
|
|
21
21
|
- Day-to-day usage in a project that already has `project.json` — skip this skill.
|
|
22
22
|
|
|
23
23
|
## Prerequisites
|
|
@@ -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
|
|
@@ -70,8 +70,11 @@ Every worker prompt MUST start with the following anchor headers, in this exact
|
|
|
70
70
|
|
|
71
71
|
1. `**Project Root:** <absolute-path>` — absolute target project root (from `{{PROJECT_ROOT}}` in the lead's prompt). Required so the worker can self-anchor without relying on inherited cwd.
|
|
72
72
|
2. `**Prompt History Path:** <project-relative-path>`
|
|
73
|
-
3. `**Result Path:** <project-relative-path>` — canonical destination for the worker's result file. Workers resolve it to absolute against `**Project Root:**` and use it for the post-completion existence check (see
|
|
73
|
+
3. `**Result Path:** <project-relative-path>` — canonical destination for the worker's result file. Workers resolve it to absolute against `**Project Root:**` and use it for the post-completion existence check (see CLI wrapper agents' step 8c, and Lead's redispatch policy below). The path identifies a single file; do NOT deliver a directory.
|
|
74
74
|
4. `Assigned worker prompt history path: <absolute-path>` — same as the prompt-history path but resolved against `Project Root`. Codex/Gemini wrapper subagents extract this exact line.
|
|
75
|
+
5. `**Worker Preamble Path:** <absolute-path>` — points to `~/.okstra/templates/worker-prompt-preamble.md` (canonical SSOT for Required Reading + Error Reporting + Anchor / Output sections). Workers Read this file end-to-end before producing any output. This anchor replaces the ~80 lines of inlined `[Required reading]` / `[Error reporting]` boilerplate that earlier versions injected into every dispatch.
|
|
76
|
+
6. `**Errors log path:** <absolute-path>` — run-level errors JSONL.
|
|
77
|
+
7. `**Errors sidecar path:** <absolute-path>` — this worker's per-run sidecar JSON.
|
|
75
78
|
|
|
76
79
|
The body must include: role name, task type, task key, required bundle paths, assigned model, output contract, evidence handling rules, and any relevant config/deployment expectations from `reference-expectations.md`.
|
|
77
80
|
|
|
@@ -83,120 +86,26 @@ Before dispatching any required worker, lead persists the exact worker prompt to
|
|
|
83
86
|
|
|
84
87
|
Send byte-identical dispatch prompts to every analysis worker (Claude / Codex / Gemini), modulo the role label and the wrapper-specific path headers enumerated in the "Dispatch-prompt invariant" rule of the Role Definitions section. The prior "role-specific emphasis" guidance is retired — emphasis in the body biases each worker toward its lens and silently kills convergence (see Role Definitions for the failure mode). Specialization lives in Section 6 of the worker output, not in the dispatch prompt body.
|
|
85
88
|
|
|
86
|
-
### Required
|
|
89
|
+
### Required Reading + Error Reporting via Worker Preamble (SSOT)
|
|
87
90
|
|
|
88
|
-
|
|
91
|
+
The lead does NOT inline `[Required reading]` or `[Error reporting]` blocks into worker prompts. Both contracts live in a single canonical file at `~/.okstra/templates/worker-prompt-preamble.md` (source: `templates/worker-prompt-preamble.md`). The lead injects the path via the `**Worker Preamble Path:**` anchor header (header #5 above) and each worker Reads that file end-to-end before producing output.
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
What the lead MUST still do per dispatch:
|
|
94
|
+
- Inject the input file enumeration into the dispatch prompt body via an `## Inputs` section (or any heading the recipient agent expects), listing the actual project-relative paths derived from the run's `instruction-set/` and the carry-in clarification response if any. The preamble describes the rules; the lead provides the specific paths for THIS run.
|
|
95
|
+
- Inject the absolute `**Errors log path:**` and `**Errors sidecar path:**` headers (#6 and #7 above) — workers cannot synthesize these paths.
|
|
96
|
+
- Omit the preamble pointer for reverify dispatches (Phase 5.5 lightweight mode) — see [okstra-convergence](../okstra-convergence/SKILL.md) "Reverify prompt: required-reading suppression".
|
|
91
97
|
|
|
92
|
-
|
|
98
|
+
Audience-scoped file enumeration (BLOCKING — performance optimization):
|
|
93
99
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
| Recipient | Files included in `[Required reading]` |
|
|
100
|
+
| Recipient | Files the lead lists under `## Inputs` |
|
|
97
101
|
|---|---|
|
|
98
102
|
| Claude / Codex / Gemini analysis workers | task-brief, analysis-profile, analysis-material (if present), reference-expectations, clarification-response (if carry-in) |
|
|
99
103
|
| Report writer worker (Phase 6) | all of the above **plus** `final-report-template.md` |
|
|
100
|
-
| Reverify dispatches
|
|
101
|
-
|
|
102
|
-
**Asymmetry between claude-worker and codex/gemini-worker prompts (NOT a bug):**
|
|
103
|
-
|
|
104
|
-
The dispatch prompt the lead constructs for `claude-worker` is intentionally shorter than for `codex-worker` / `gemini-worker`. Do NOT "fix" this by re-injecting `[Required reading]` / `[Error reporting]` / `[Output Contract]` blocks into the claude-worker prompt:
|
|
105
|
-
|
|
106
|
-
- `claude-worker` is an in-process Claude subagent. The Agent SDK auto-loads `agents/claude-worker.md`, which already contains `## Required Reading Before Any Analysis`, `## Worker Output Structure`, and `## Error reporting`. Re-injecting them is redundant and wastes tokens.
|
|
107
|
-
- `codex-worker` / `gemini-worker` shell out to a CLI. The CLI never sees the agent definition file — it only sees the prompt body passed via stdin. Therefore the lead MUST inject those three blocks into the dispatch prompt for those two workers.
|
|
108
|
-
|
|
109
|
-
Worker definition file size (claude-worker ~106 lines vs codex/gemini ~175–179 lines) is NOT evidence of incompleteness — it reflects the in-process vs CLI-wrapper distinction.
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
[Required reading]
|
|
113
|
-
You are required to read every input file listed below from the very first
|
|
114
|
-
character to the very last character before you produce any analysis output.
|
|
115
|
-
Skimming, partial reads, jumping to a single section, or relying on prior
|
|
116
|
-
knowledge of a similar file's structure is not acceptable. Each file may
|
|
117
|
-
contain decisive context that is not surfaced in its summary or first page.
|
|
118
|
-
|
|
119
|
-
Required files for this run (read in this order, end-to-end, no exceptions):
|
|
120
|
-
|
|
121
|
-
1. <Project Root>/<instruction-set>/task-brief.md
|
|
122
|
-
2. <Project Root>/<instruction-set>/analysis-profile.md
|
|
123
|
-
3. <Project Root>/<instruction-set>/analysis-material.md (only if present)
|
|
124
|
-
4. <Project Root>/<instruction-set>/reference-expectations.md
|
|
125
|
-
5. <Project Root>/<instruction-set>/clarification-response.md (only if a carry-in was provided for this run)
|
|
126
|
-
6. <Project Root>/<instruction-set>/final-report-template.md (REPORT WRITER ONLY — omit for analysis workers and reverify dispatches)
|
|
127
|
-
|
|
128
|
-
Reading rules:
|
|
129
|
-
|
|
130
|
-
- Use a single Read tool call per file with no offset and no limit. Do not
|
|
131
|
-
page through the file with offset/limit unless the file is genuinely too
|
|
132
|
-
large for one read; if you must page, you MUST cover the entire file
|
|
133
|
-
before moving on, and you MUST state the page boundaries you used in your
|
|
134
|
-
Findings section.
|
|
135
|
-
- For the carry-in clarification response, read the conditional
|
|
136
|
-
`## 0. Clarification Response Carried In From Previous Run` section
|
|
137
|
-
(rendered only when carry-in is non-empty) and every row of
|
|
138
|
-
`## 5. Clarification Items` (`C-001`, `C-002`, ...) in full,
|
|
139
|
-
including rows whose `User input` cell is blank. The fact that you
|
|
140
|
-
will write your output into a file with a structurally similar
|
|
141
|
-
section 5 is NOT an excuse to skim — the prior `C-*` rows carry
|
|
142
|
-
context you cannot reconstruct from the new run alone.
|
|
143
|
-
- Write the Reading Confirmation block to your **audit sidecar** at
|
|
144
|
-
`runs/<task-type>/worker-results/<worker>-audit-<task-type>-<seq>.md`
|
|
145
|
-
(sibling to the main worker-results file). One short line per input
|
|
146
|
-
file confirming end-to-end reading, e.g. "Read task-brief.md
|
|
147
|
-
end-to-end (147 lines)." Do NOT include a `## 0. Reading Confirmation`
|
|
148
|
-
heading in the main worker-results file — the validator now fails
|
|
149
|
-
worker-results that contain one. If you cannot truthfully confirm a
|
|
150
|
-
file end-to-end, record a `tool-failure` in the errors sidecar
|
|
151
|
-
instead of fabricating Findings.
|
|
152
|
-
- Do not collapse multiple input files into a single mental summary before
|
|
153
|
-
reading them all individually. Each file has its own canonical role
|
|
154
|
-
(brief = the user's request, profile = the lead's rules for this phase,
|
|
155
|
-
reference-expectations = ground-truth config/deployment values,
|
|
156
|
-
clarification-response = prior run's open questions and the user's
|
|
157
|
-
answers, final-report-template = the structure your eventual writeup
|
|
158
|
-
must conform to). Conflating them loses signal.
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Error reporting clause (analysis workers)
|
|
104
|
+
| Reverify dispatches | none — the lead provides only the items to reverify |
|
|
162
105
|
|
|
163
|
-
|
|
164
|
-
(Claude / Codex / Gemini). All three workers' subagent definitions already
|
|
165
|
-
include the same contract — the prompt clause exists as a redundant safety
|
|
166
|
-
net so any worker dispatched without its custom definition still receives
|
|
167
|
-
identical instructions.
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
[Error reporting]
|
|
171
|
-
If any tool call you make (Bash, Read, Edit, MCP, etc.) returns a non-zero
|
|
172
|
-
exit code, raises an exception, or otherwise fails its intended effect,
|
|
173
|
-
append a single entry to your worker errors sidecar at:
|
|
174
|
-
|
|
175
|
-
runs/<task-type>/worker-results/<role-slug>-errors-<task-type>-<seq>.json
|
|
176
|
-
|
|
177
|
-
Schema (create the file with {"schemaVersion": 1, "errors": []} if absent):
|
|
178
|
-
|
|
179
|
-
{
|
|
180
|
-
"ts": "<ISO 8601 UTC>",
|
|
181
|
-
"phase": "<current okstra phase>",
|
|
182
|
-
"errorType": "tool-failure",
|
|
183
|
-
"command": "<failed command/tool signature>",
|
|
184
|
-
"commandKind": "bash | tool:Read | tool:Edit | mcp | ...",
|
|
185
|
-
"exitCode": <int or null>,
|
|
186
|
-
"durationMs": <int or null>,
|
|
187
|
-
"message": "<one-line human summary>",
|
|
188
|
-
"stderrExcerpt": "<first ~2KB of stderr, or null>",
|
|
189
|
-
"context": { ... or null }
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
Do NOT include source / recordedAt / agent / agentRole / model / taskKey —
|
|
193
|
-
Lead will fill those in. Do NOT use errorType values other than
|
|
194
|
-
"tool-failure" in the sidecar. Continue your task after recording; do not
|
|
195
|
-
abort unless the failure makes the task impossible.
|
|
196
|
-
```
|
|
106
|
+
Asymmetry note: `claude-worker` runs in-process and the Agent SDK auto-loads its agent definition; lead's dispatch prompt body for claude-worker can therefore be shorter than for codex/gemini. The Worker Preamble pointer is still emitted for all three so the contract source is identical regardless of dispatch path.
|
|
197
107
|
|
|
198
|
-
The
|
|
199
|
-
`gemini-worker` matching the receiving role.
|
|
108
|
+
Send byte-identical dispatch prompts to every analysis worker (Claude / Codex / Gemini), modulo the role label and the wrapper-specific path headers. The prior "role-specific emphasis" guidance is retired — specialization lives in Section 6 of the worker output, not in the dispatch prompt body.
|
|
200
109
|
|
|
201
110
|
## Terminal Statuses
|
|
202
111
|
|
|
@@ -374,7 +283,7 @@ without proceeding — this is the contractual replacement for the previous
|
|
|
374
283
|
empty run-level error logs in production.
|
|
375
284
|
|
|
376
285
|
- `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).
|
|
286
|
+
- **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
287
|
- **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
288
|
- Successful completion: return the wrapper's accumulated stdout from the final `BashOutput`. No log entry.
|
|
380
289
|
- 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`.
|