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
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# release-handoff process
|
|
2
|
+
|
|
3
|
+
## Index
|
|
4
|
+
|
|
5
|
+
- [1. 목적](#1-목적)
|
|
6
|
+
- [2. okstra-run wizard 흐름](#2-okstra-run-wizard-흐름)
|
|
7
|
+
- [3. prepare 단계](#3-prepare-단계)
|
|
8
|
+
- [4. entry gate](#4-entry-gate)
|
|
9
|
+
- [5. lead-only 실행 흐름](#5-lead-only-실행-흐름)
|
|
10
|
+
- [6. PR template 결정](#6-pr-template-결정)
|
|
11
|
+
- [7. 산출물](#7-산출물)
|
|
12
|
+
- [8. 금지선](#8-금지선)
|
|
13
|
+
- [9. 확인한 코드](#9-확인한-코드)
|
|
14
|
+
|
|
15
|
+
## 1. 목적
|
|
16
|
+
|
|
17
|
+
`release-handoff`는 `accepted` verdict가 나온 already-committed implementation branch를 push하거나 PR로 넘기는 terminal phase다. 새 commit을 만들지 않고, 검증된 diff를 그대로 포장한다.
|
|
18
|
+
|
|
19
|
+
이 phase는 worker dispatch가 없다. `claude`, `codex`, `report-writer` roster를 쓰지 않으며 Claude lead가 inline으로 git/gh inspection, 사용자 질문, PR draft, final report 작성을 모두 수행한다.
|
|
20
|
+
|
|
21
|
+
## 2. okstra-run wizard 흐름
|
|
22
|
+
|
|
23
|
+
```mermaid
|
|
24
|
+
flowchart TD
|
|
25
|
+
Start[/okstra-run/] --> Common[공통 task identity flow]
|
|
26
|
+
Common --> Type[task-type = release-handoff]
|
|
27
|
+
Type --> Worktree{active task worktree?}
|
|
28
|
+
Worktree -->|yes| Defaults[Use defaults / Customize]
|
|
29
|
+
Worktree -->|no| BaseRef[base-ref pick/text]
|
|
30
|
+
BaseRef --> Defaults
|
|
31
|
+
Defaults -->|defaults| Confirm[confirmation]
|
|
32
|
+
Defaults -->|customize| Models[lead model prompt]
|
|
33
|
+
Models --> Extras[directive, related tasks, clarification]
|
|
34
|
+
Extras --> Template[PR template override?]
|
|
35
|
+
Template --> Scope[save template to project/global?]
|
|
36
|
+
Scope --> Confirm
|
|
37
|
+
Confirm --> Render[render-bundle]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`release-handoff`는 worker roster prompt가 없다. wizard의 `render_args()`는 `pr-template-path`를 release-handoff일 때만 포함하고, runtime은 worker list를 강제로 empty로 만든다.
|
|
41
|
+
|
|
42
|
+
주의할 점은 이 phase도 task worktree provisioning 대상이라는 것이다. 정상 흐름은 같은 task-key의 implementation/final-verification worktree를 재사용한다. 새 task로 시작하면 새 branch가 만들어질 수 있고, entry gate의 "implementation commit exists" 조건에서 막힐 가능성이 높다.
|
|
43
|
+
|
|
44
|
+
## 3. prepare 단계
|
|
45
|
+
|
|
46
|
+
```mermaid
|
|
47
|
+
sequenceDiagram
|
|
48
|
+
participant W as okstra-run
|
|
49
|
+
participant P as prepare_task_bundle
|
|
50
|
+
participant T as PR template resolver
|
|
51
|
+
participant WT as worktree registry
|
|
52
|
+
participant FS as task artifacts
|
|
53
|
+
|
|
54
|
+
W->>P: task-type=release-handoff, brief, optional pr-template-path
|
|
55
|
+
P->>P: validate profile and brief
|
|
56
|
+
P->>P: force workers=[]
|
|
57
|
+
P->>T: resolve PR template
|
|
58
|
+
P->>WT: reuse or provision task worktree
|
|
59
|
+
P->>FS: write manifests with empty roster
|
|
60
|
+
P->>FS: expose PR_TEMPLATE_PATH and PR_TEMPLATE_SOURCE
|
|
61
|
+
P-->>W: lead prompt for current session
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
profile에 `Required workers:` block이 없고 `run.py`도 `release-handoff`에서는 worker override를 비운다. 따라서 `agents/SKILL.md`의 일반 TeamCreate / convergence / report-writer 흐름을 타지 않는 것이 의도된 동작이다.
|
|
65
|
+
|
|
66
|
+
## 4. entry gate
|
|
67
|
+
|
|
68
|
+
```mermaid
|
|
69
|
+
flowchart TD
|
|
70
|
+
Brief[task brief] --> Source{Source Verification Report present?}
|
|
71
|
+
Source -->|no| Block[blocked<br/>route final-verification]
|
|
72
|
+
Source -->|yes| Verdict{Verdict Token == accepted?}
|
|
73
|
+
Verdict -->|no| Block
|
|
74
|
+
Verdict -->|yes| Status{git status --short clean?}
|
|
75
|
+
Status -->|no| Dirty[blocked<br/>dirty tree]
|
|
76
|
+
Status -->|yes| Branch{current branch is base branch?}
|
|
77
|
+
Branch -->|yes| BaseBlock[blocked<br/>never operate on base branch]
|
|
78
|
+
Branch -->|no| Commits{git log base..HEAD non-empty?}
|
|
79
|
+
Commits -->|no| ImplBlock[blocked<br/>route implementation]
|
|
80
|
+
Commits -->|yes| Ready[handoff questions may begin]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
lead는 사용자에게 push/PR 여부를 묻기 전에 다음을 확인한다.
|
|
84
|
+
|
|
85
|
+
- task brief가 `## Source Verification Report`를 가리킨다.
|
|
86
|
+
- 그 report의 `## 2. Final Verdict`에 `Verdict Token = accepted`가 정확히 있다.
|
|
87
|
+
- working tree가 clean이다.
|
|
88
|
+
- 현재 branch가 `main`, `master`, `prod`, `preprod`, `staging`, `dev` 같은 base branch가 아니다.
|
|
89
|
+
- `<base>..HEAD` commit range가 비어 있지 않다.
|
|
90
|
+
|
|
91
|
+
`conditional-accept`, `blocked`, 애매한 문장 verdict는 모두 즉시 종료 대상이다.
|
|
92
|
+
|
|
93
|
+
## 5. lead-only 실행 흐름
|
|
94
|
+
|
|
95
|
+
```mermaid
|
|
96
|
+
stateDiagram-v2
|
|
97
|
+
[*] --> Gate: entry gate
|
|
98
|
+
Gate --> Q1: action selection
|
|
99
|
+
Q1 --> ReportOnly: local only
|
|
100
|
+
Q1 --> Skip: skip
|
|
101
|
+
Q1 --> Q2: push + PR
|
|
102
|
+
Q2 --> Probe: choose PR base
|
|
103
|
+
Probe --> Q3: no conflict
|
|
104
|
+
Probe --> Conflict: conflict detected
|
|
105
|
+
Conflict --> Q2: change base branch
|
|
106
|
+
Conflict --> Q3: proceed anyway
|
|
107
|
+
Conflict --> Cancel: cancel
|
|
108
|
+
Q3 --> Push: use as-is or edit then proceed
|
|
109
|
+
Q3 --> Cancel: cancel
|
|
110
|
+
Push --> ReuseOrCreate: git push feature branch
|
|
111
|
+
ReuseOrCreate --> FinalReport: gh pr list / gh pr create
|
|
112
|
+
ReportOnly --> FinalReport
|
|
113
|
+
Skip --> FinalReport
|
|
114
|
+
Cancel --> FinalReport
|
|
115
|
+
FinalReport --> [*]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
사용자 interaction은 정확히 세 단계다.
|
|
119
|
+
|
|
120
|
+
1. Q1 action: `local only`, `push + PR`, `skip`
|
|
121
|
+
2. Q2 PR base: `staging`, `preprod`, `main`, 직접 입력 등 profile menu의 branch
|
|
122
|
+
3. Q3 PR title/body: `use as-is`, `edit then proceed`, `cancel`
|
|
123
|
+
|
|
124
|
+
`push + PR`에서만 merge-conflict probe를 한다.
|
|
125
|
+
|
|
126
|
+
```mermaid
|
|
127
|
+
flowchart TD
|
|
128
|
+
PushPR[push + PR selected] --> Fetch[git fetch origin chosen-base]
|
|
129
|
+
Fetch --> MergeTree[git merge-tree --write-tree --merge-base<br/>origin/base HEAD origin/base]
|
|
130
|
+
MergeTree --> Conflict{conflict?}
|
|
131
|
+
Conflict -->|no| Draft[show PR draft]
|
|
132
|
+
Conflict -->|yes| Ask[ask proceed/change base/cancel]
|
|
133
|
+
Ask -->|proceed anyway| Draft
|
|
134
|
+
Ask -->|change base branch| Base[return to Q2]
|
|
135
|
+
Ask -->|cancel| Report[final report without push/PR]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
probe는 working tree를 바꾸지 않아야 한다. `git merge`, `git rebase`, `git pull`은 이 probe에 포함되지 않는다.
|
|
139
|
+
|
|
140
|
+
## 6. PR template 결정
|
|
141
|
+
|
|
142
|
+
```mermaid
|
|
143
|
+
flowchart TD
|
|
144
|
+
Override[--pr-template-path from wizard] --> Chosen{exists?}
|
|
145
|
+
Chosen -->|yes| UseOverride[use override]
|
|
146
|
+
Chosen -->|no| Project[project config template]
|
|
147
|
+
Project -->|exists| UseProject[use project template]
|
|
148
|
+
Project -->|missing| Global[global config template]
|
|
149
|
+
Global -->|exists| UseGlobal[use global template]
|
|
150
|
+
Global -->|missing| Default[okstra skill default template]
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
customize path에서 사용자가 template을 고르면 okstra-run skill이 render-bundle 전에 project/global scope 저장을 수행한다. runtime은 resolved `PR_TEMPLATE_PATH`와 `PR_TEMPLATE_SOURCE`를 run context에 넣고, lead는 이 파일을 그대로 읽어 HTML comment를 제거한 뒤 placeholder를 채운다. section 구조를 hard-code하면 안 된다.
|
|
154
|
+
|
|
155
|
+
## 7. 산출물
|
|
156
|
+
|
|
157
|
+
```mermaid
|
|
158
|
+
flowchart TD
|
|
159
|
+
Verdict[Source Verification Report<br/>accepted token] --> Report[release-handoff final report]
|
|
160
|
+
State[feature branch + clean status] --> Report
|
|
161
|
+
User[Q1/Q2/Q2b/Q3 user selections] --> Report
|
|
162
|
+
Commands[git/gh commands + exit codes] --> Report
|
|
163
|
+
Commits[git log base..HEAD commit list] --> Report
|
|
164
|
+
Probe[Merge Conflict Probe] --> Report
|
|
165
|
+
PR[PR created / reused / skipped] --> Report
|
|
166
|
+
Report --> Done[routing recommendation: done]
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
final report에는 최소 다음이 필요하다.
|
|
170
|
+
|
|
171
|
+
- originating final-verification report path와 quoted `accepted` verdict row
|
|
172
|
+
- feature branch와 run start `git status --short`
|
|
173
|
+
- 사용자 선택 기록
|
|
174
|
+
- 실행한 모든 git/gh command와 exit code
|
|
175
|
+
- implementation commit list
|
|
176
|
+
- merge-conflict probe 결과
|
|
177
|
+
- PR 생성, 재사용, 생략 결과
|
|
178
|
+
- routing recommendation `done`
|
|
179
|
+
|
|
180
|
+
## 8. 금지선
|
|
181
|
+
|
|
182
|
+
```mermaid
|
|
183
|
+
flowchart TD
|
|
184
|
+
RH[release-handoff] --> Allowed[read git/gh, fetch base, merge-tree probe,<br/>push feature branch, create/reuse PR]
|
|
185
|
+
RH -. forbidden .-> Commit[git add / commit / stash]
|
|
186
|
+
RH -. forbidden .-> Force[force push or +refspec]
|
|
187
|
+
RH -. forbidden .-> BasePush[push directly to base branch]
|
|
188
|
+
RH -. forbidden .-> NoVerify[--no-verify / -n]
|
|
189
|
+
RH -. forbidden .-> Publish[release publish / deploy]
|
|
190
|
+
RH -. forbidden .-> Edit[source edit]
|
|
191
|
+
RH -. forbidden .-> Team[TeamCreate or Agent dispatch]
|
|
192
|
+
RH -. forbidden .-> Merge[gh pr merge]
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
실패한 `git push`를 더 약한 안전장치로 재시도하면 안 된다. non-fast-forward 같은 실패가 나면 멈추고 사용자 지시를 받아야 하며, `--force` 계열 flag는 사용자 요청이 있어도 금지다.
|
|
196
|
+
|
|
197
|
+
## 9. 확인한 코드
|
|
198
|
+
|
|
199
|
+
- [`prompts/profiles/release-handoff.md`](../../prompts/profiles/release-handoff.md)
|
|
200
|
+
- [`templates/reports/release-handoff-input.template.md`](../../templates/reports/release-handoff-input.template.md)
|
|
201
|
+
- [`skills/okstra-run/SKILL.md`](../../skills/okstra-run/SKILL.md)
|
|
202
|
+
- [`scripts/okstra_ctl/wizard.py`](../../scripts/okstra_ctl/wizard.py)
|
|
203
|
+
- [`scripts/okstra_ctl/run.py`](../../scripts/okstra_ctl/run.py)
|
|
204
|
+
- [`scripts/okstra_ctl/pr_template.py`](../../scripts/okstra_ctl/pr_template.py)
|
|
205
|
+
- [`src/config.mjs`](../../src/config.mjs)
|
|
206
|
+
- [`scripts/okstra_ctl/worktree.py`](../../scripts/okstra_ctl/worktree.py)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# requirements-discovery process
|
|
2
|
+
|
|
3
|
+
## Index
|
|
4
|
+
|
|
5
|
+
- [1. 목적](#1-목적)
|
|
6
|
+
- [2. okstra-run wizard 흐름](#2-okstra-run-wizard-흐름)
|
|
7
|
+
- [3. prepare_task_bundle 처리](#3-prepare_task_bundle-처리)
|
|
8
|
+
- [4. lead 실행 흐름](#4-lead-실행-흐름)
|
|
9
|
+
- [5. 산출물과 routing](#5-산출물과-routing)
|
|
10
|
+
- [6. 확인한 코드](#6-확인한-코드)
|
|
11
|
+
|
|
12
|
+
## 1. 목적
|
|
13
|
+
|
|
14
|
+
`requirements-discovery`는 구현 전에 요청을 분류한다. bugfix, feature, improvement, refactor, ops-change 중 무엇인지 판단하고, 다음 안전 phase가 `error-analysis`인지 `implementation-planning`인지 고른다. 직접 `implementation`으로 넘기는 것은 profile상 유효하지 않다. implementation은 승인된 `implementation-planning` report가 있어야 시작할 수 있다.
|
|
15
|
+
|
|
16
|
+
## 2. okstra-run wizard 흐름
|
|
17
|
+
|
|
18
|
+
```mermaid
|
|
19
|
+
flowchart TD
|
|
20
|
+
Start[/okstra-run/] --> Check[ensure-installed / paths / check-project]
|
|
21
|
+
Check --> Pick{new task or existing task?}
|
|
22
|
+
Pick -->|new| Brief[brief path]
|
|
23
|
+
Brief --> Suggest{brief frontmatter suggestions?}
|
|
24
|
+
Suggest -->|yes| GroupPick[task-group pick]
|
|
25
|
+
Suggest -->|no| GroupText[task-group text]
|
|
26
|
+
GroupPick --> Id
|
|
27
|
+
GroupText --> Id
|
|
28
|
+
Id[task-id pick/text] --> Type[task-type = requirements-discovery]
|
|
29
|
+
Pick -->|existing| Type
|
|
30
|
+
Type --> Keep{existing brief?}
|
|
31
|
+
Keep -->|keep| Base
|
|
32
|
+
Keep -->|change/no brief| Brief
|
|
33
|
+
Type --> Base{active task worktree?}
|
|
34
|
+
Base -->|yes| Defaults[Use defaults / Customize]
|
|
35
|
+
Base -->|no| BaseRef[base-ref pick/text]
|
|
36
|
+
BaseRef --> Defaults
|
|
37
|
+
Defaults --> Workers[worker multi-pick<br/>still asked even on defaults]
|
|
38
|
+
Workers --> Custom{customize?}
|
|
39
|
+
Custom -->|yes| ModelsAndExtras[models, directive, related tasks, clarification]
|
|
40
|
+
Custom -->|no| Confirm
|
|
41
|
+
ModelsAndExtras --> Confirm
|
|
42
|
+
Confirm --> Render[render-bundle]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
worker multi-pick에서 picker는 `report-writer`를 옵션으로 보여주지 않는다. 사용자가 `claude`만 골라도 wizard가 `report-writer`를 강제 append한다. optional `gemini`는 사용자가 골랐을 때만 포함된다.
|
|
46
|
+
|
|
47
|
+
## 3. prepare_task_bundle 처리
|
|
48
|
+
|
|
49
|
+
```mermaid
|
|
50
|
+
sequenceDiagram
|
|
51
|
+
participant W as wizard/render-bundle
|
|
52
|
+
participant P as prepare_task_bundle
|
|
53
|
+
participant Prof as requirements-discovery.md
|
|
54
|
+
participant Git as worktree registry
|
|
55
|
+
participant FS as task artifacts
|
|
56
|
+
|
|
57
|
+
W->>P: task-type=requirements-discovery, brief, base-ref, workers
|
|
58
|
+
P->>Prof: profile exists, Required workers parsed
|
|
59
|
+
P->>P: verify installation, upsert project.json
|
|
60
|
+
P->>P: resolve workers from profile + override
|
|
61
|
+
P->>Git: create or reuse task worktree
|
|
62
|
+
P->>P: expand _common-contract include
|
|
63
|
+
P->>FS: write instruction-set and manifests
|
|
64
|
+
P->>FS: render workflow currentPhase=requirements-discovery
|
|
65
|
+
P-->>W: prepared lead prompt
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
runtime에서 이 phase만을 위한 추가 hard gate는 없다. 중요한 gate는 profile file 존재, brief file 존재, base-ref가 first phase에서 resolvable해야 한다는 worktree gate, worker override가 profile roster 범위를 벗어나지 않아야 한다는 gate다.
|
|
69
|
+
|
|
70
|
+
## 4. lead 실행 흐름
|
|
71
|
+
|
|
72
|
+
```mermaid
|
|
73
|
+
flowchart TD
|
|
74
|
+
P1[Phase 1 intake<br/>manifest, brief, profile, run manifest, team-state] --> P2[Phase 2 prompts]
|
|
75
|
+
P2 --> P3[Phase 3 TeamCreate]
|
|
76
|
+
P3 --> P4[Phase 4/5 dispatch analysers<br/>claude/codex + optional gemini]
|
|
77
|
+
P4 --> C[Phase 5.5 convergence<br/>default maxRounds = 1]
|
|
78
|
+
C --> R[Phase 6 report-writer authors final report]
|
|
79
|
+
R --> P7[Phase 7 token usage, validate, persist]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`requirements-discovery`는 convergence default가 1 round다. 이 예외는 `render._build_convergence_block()`와 `agents/SKILL.md` 모두에서 명시된다.
|
|
83
|
+
|
|
84
|
+
## 5. 산출물과 routing
|
|
85
|
+
|
|
86
|
+
```mermaid
|
|
87
|
+
flowchart LR
|
|
88
|
+
RD[requirements-discovery final report] --> Class[work-category classification]
|
|
89
|
+
RD --> Missing[missing materials / clarification items]
|
|
90
|
+
RD --> Domain[Domain Alignment<br/>terminology resolution]
|
|
91
|
+
RD --> Route{next safe phase}
|
|
92
|
+
Route --> EA[error-analysis]
|
|
93
|
+
Route --> IP[implementation-planning]
|
|
94
|
+
Route -. invalid .-> Impl[implementation<br/>not allowed directly]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
final report는 다음을 특히 강조한다.
|
|
98
|
+
|
|
99
|
+
- evidence-backed routing decision
|
|
100
|
+
- missing input과 uncertainty boundary
|
|
101
|
+
- 다음 phase 및 safe resume guidance
|
|
102
|
+
- `terminology:*` brief item에 대한 canonical term resolution
|
|
103
|
+
- blocking input이 있으면 `## 5. Clarification Items` unified table에 `Blocks=next-phase`
|
|
104
|
+
|
|
105
|
+
Non-goal은 source edit, plan authoring, build, deployment다.
|
|
106
|
+
|
|
107
|
+
## 6. 확인한 코드
|
|
108
|
+
|
|
109
|
+
- [`skills/okstra-run/SKILL.md`](../../skills/okstra-run/SKILL.md)
|
|
110
|
+
- [`scripts/okstra_ctl/wizard.py`](../../scripts/okstra_ctl/wizard.py)
|
|
111
|
+
- [`scripts/okstra_ctl/run.py`](../../scripts/okstra_ctl/run.py)
|
|
112
|
+
- [`scripts/okstra_ctl/workflow.py`](../../scripts/okstra_ctl/workflow.py)
|
|
113
|
+
- [`prompts/profiles/requirements-discovery.md`](../../prompts/profiles/requirements-discovery.md)
|
|
114
|
+
- [`agents/SKILL.md`](../../agents/SKILL.md)
|
|
115
|
+
|
package/package.json
CHANGED
package/runtime/BUILD.json
CHANGED
package/runtime/agents/SKILL.md
CHANGED
|
@@ -27,11 +27,8 @@ This SKILL.md is the operating contract and phase index. Detailed procedures liv
|
|
|
27
27
|
| [okstra-team-contract](./skills/okstra-team-contract/SKILL.md) | Phase 2–5 worker roster, model assignment rules, prompt composition (anchor headers, `[Required reading]`, `[Error reporting]`), worker output contract, terminal statuses, usage tracking |
|
|
28
28
|
| [okstra-convergence](./skills/okstra-convergence/SKILL.md) | Phase 5.5 finding convergence loop, finding categories, reverify dispatch (anchor headers, required-reading suppression), convergence state schema, **plus Phase 6 plan-body verification mode (implementation-planning only)** |
|
|
29
29
|
| [okstra-report-writer](./skills/okstra-report-writer/SKILL.md) | Phase 6 final-report authorship, dispatch template, resume-safe dispatch, shared-graph integrity check, Phase 7 token-usage collector |
|
|
30
|
-
| [okstra-
|
|
31
|
-
| [okstra-history](./skills/okstra-history/SKILL.md) | Past-run history, re-run command assembly, resume helper |
|
|
32
|
-
| [okstra-report-finder](./skills/okstra-report-finder/SKILL.md) | Locate the final report for a given task key |
|
|
30
|
+
| [okstra-inspect](./skills/okstra-inspect/SKILL.md) | Unified read-side skill — sub-commands `status` (workStatus updates), `history` (past runs, re-run, resume), `report` (find/read final-report), `time` (per-task/per-worker elapsed-time breakdown), `logs` (wrapper log sidecar inventory + cleanup suggestions) |
|
|
33
31
|
| [okstra-schedule](./skills/okstra-schedule/SKILL.md) | Generate a consolidated work schedule for a task-group |
|
|
34
|
-
| [okstra-time-summary](./skills/okstra-time-summary/SKILL.md) | Per-task / per-worker elapsed-time breakdown |
|
|
35
32
|
|
|
36
33
|
## Quick Reference
|
|
37
34
|
|
|
@@ -136,7 +133,7 @@ Executor is chosen at run-prep time via `--executor <claude|codex|gemini>` (or `
|
|
|
136
133
|
- Location: `~/.okstra/worktrees/<project-id>/<task-group-segment>/<task-id-segment>/` (override `OKSTRA_HOME` only for tests). All segments are sanitised — `/`, `:`, and other special chars collapse to `-`.
|
|
137
134
|
- Branch: `<work-category-prefix>-<task-id-segment>` (e.g. `feat-dev-9436`, `fix-dev-7311`). Branched from `HEAD` of the repo's **main** worktree at the first phase's prep time; base SHA is recorded in `EXECUTOR_WORKTREE_BASE_REF`.
|
|
138
135
|
- A global registry at `~/.okstra/worktrees/registry.json` (flock-guarded) maps each task-key to its path + branch and prevents concurrent runs from colliding. Branch names are globally unique across task-keys on this machine.
|
|
139
|
-
-
|
|
136
|
+
- Worktree sync mirrors the configured project-relative directories from the **main worktree** so task checkouts see the same filesystem state. This is filesystem continuity only: okstra-owned context and writes still stay inside `<PROJECT_ROOT>/.project-docs/okstra/**` unless the brief explicitly authorizes a non-okstra path.
|
|
140
137
|
- The path, branch, base ref, and provisioning status (`created` | `reused` | `skipped-in-worktree` | `skipped-not-git`) are exposed through the launch prompt's `## Executor Worktree` section and the implementation profile's worktree block.
|
|
141
138
|
- **Skip conditions** (worktree provisioning is a no-op; task uses `project_root` directly):
|
|
142
139
|
- `project_root` is already inside a non-main worktree (the run reuses the caller's worktree to avoid nesting).
|
|
@@ -168,6 +165,22 @@ After context-loader completes, read **only the five mandatory files below** in
|
|
|
168
165
|
- `instruction-set/final-report-template.md` — never read by Lead. The Report writer worker reads it as part of its own [Required reading]; Lead only references its path when dispatching.
|
|
169
166
|
- `history/timeline.json` — read only on user request or when carry-in resolution requires it.
|
|
170
167
|
|
|
168
|
+
**Implementation profile lazy reading discipline (BLOCKING — applies only when `task_type == "implementation"`):**
|
|
169
|
+
|
|
170
|
+
The `implementation` profile's thin core (`prompts/profiles/implementation.md`) is intentionally minimal so the Phase 1 baseline stays small. Three sidecar files carry the bulk of the rules and MUST be read at the listed phase — do NOT pre-load them at Phase 1.
|
|
171
|
+
|
|
172
|
+
| Sidecar | Read at | Owned by |
|
|
173
|
+
|---------|---------|----------|
|
|
174
|
+
| `prompts/profiles/_implementation-executor.md` | **Phase 5**, after Stage Map parse, BEFORE issuing the Executor's first `Edit` / `Write` | Executor role binding, Pre-implementation context exploration, TDD loop, Stage execution contract, allowed actions, commit-message format |
|
|
175
|
+
| `prompts/profiles/_implementation-verifier.md` | **Phase 5**, between Executor stage completion and the first verifier dispatch | Verifier roles, Two-tier command lookup, deny-list, discrepancy rule, Read-only command log, verifier-specific forbidden actions |
|
|
176
|
+
| `prompts/profiles/_implementation-deliverable.md` | **Phase 6**, after Phase 5.5 convergence completes, BEFORE constructing the report-writer dispatch prompt | Required deliverable shape, Validation / TDD evidence rules, Verifier results structure, Self-review pass, Lead post-stage persistence |
|
|
177
|
+
|
|
178
|
+
**Entry guard (BLOCKING).** Before transitioning into Phase 5 or Phase 6 for an `implementation` run, lead MUST emit a single Read tool call for the sidecar(s) above whose `Read at` matches the entering phase. If lead enters the phase without that Read on record (visible in the lead session jsonl), phase 진입 거부 — lead writes a `contract-violation` to the run-level errors log with `--message "implementation-sidecar-not-loaded"` and stops. Re-entry requires the sidecar Read first.
|
|
179
|
+
|
|
180
|
+
The guard is not satisfied by remembering content from a prior run — each implementation run reads the sidecar fresh, because the sidecars are part of the runtime shipped via `okstra install` and may have been updated between runs.
|
|
181
|
+
|
|
182
|
+
This pattern is implementation-only. Other profiles (`requirements-discovery`, `error-analysis`, `implementation-planning`, `final-verification`, `release-handoff`) load their whole profile body at Phase 1 as before — they are short enough not to benefit from a split.
|
|
183
|
+
|
|
171
184
|
Extract from the five mandatory files: task key, task type, work category, workflow lifecycle snapshot, selected worker roster, assigned models, worker result paths, worker prompt history paths, current run prompt directory, final report path, final status path, validator path, resume helper path, config-file references, deployment-manifest references, and their expected values or invariants.
|
|
172
185
|
|
|
173
186
|
If previous run reports exist, use as historical context only. If discovery metadata or current artifacts conflict with a newer user instruction, prefer the user instruction. If `reference-expectations.md` explicitly says expectations were not provided (you can confirm this without reading the file if the brief's "Expected state" section is empty), treat that as missing information and say `I don't know` rather than inventing expected states.
|
|
@@ -252,6 +265,16 @@ If convergence is disabled, proceed directly to Phase 6 with the raw worker resu
|
|
|
252
265
|
|
|
253
266
|
If `Report writer worker` is in the selected roster (`recommendedWorkers` / `resultContract.requiredWorkerRoles`), **Lead MUST dispatch it to write `runs/<task-type>/reports/final-report-<task-type>-<seq>.md`**. Lead does NOT write that file. Lead's role in this phase is: prepare the report-writer prompt (carrying convergence output, all worker results, and reference expectations), dispatch, then review the produced file.
|
|
254
267
|
|
|
268
|
+
Before constructing the dispatch prompt, the lead MUST:
|
|
269
|
+
|
|
270
|
+
- Resolve report language: read `project.json.reportLanguage` (fallback
|
|
271
|
+
`~/.okstra/config.json.reportLanguage`, then literal `auto`). If the
|
|
272
|
+
resolved value is `auto`, inspect the task brief and pick `en` or `ko`
|
|
273
|
+
based on its main prose language (default `en` when the brief is
|
|
274
|
+
mostly code/identifiers). Pass the final `en` or `ko` value as
|
|
275
|
+
`**Report Language:**` in the report-writer dispatch prompt, and ensure
|
|
276
|
+
the worker writes the same value into `data.json.meta.reportLanguage`.
|
|
277
|
+
|
|
255
278
|
Do not write the final verdict until every analysis worker role has either a saved result or a terminal status entry. The convergence output provides four finding categories:
|
|
256
279
|
|
|
257
280
|
1. Full Consensus
|
|
@@ -289,7 +312,7 @@ Lead's responsibilities in this sub-step (in order):
|
|
|
289
312
|
|
|
290
313
|
If `convergence.planBodyVerification.enabled == false` (set by `--no-plan-verification` or by `okstra config set plan-verification off`), the entire sub-step is skipped and the top-of-report Approval marker is rendered unconditionally (legacy behaviour). This opt-out is intended for fast iteration only and is not recommended for handoff-ready plans.
|
|
291
314
|
|
|
292
|
-
|
|
315
|
+
The `okstra-inspect status` sub-command exposes the sub-step's state as a `planVerification` sub-field of the implementation-planning phase, not as a separate lifecycle phase identifier.
|
|
293
316
|
|
|
294
317
|
## Phase 7: Artifact persistence and validator handoff
|
|
295
318
|
|
|
@@ -319,7 +342,7 @@ jq -s 'group_by(.errorType) | map({type: .[0].errorType, count: length})' <runDi
|
|
|
319
342
|
|
|
320
343
|
The errors log is informational. Its presence/absence does not affect the final verdict. Do not block report writing on it.
|
|
321
344
|
|
|
322
|
-
After persistence, reply briefly in
|
|
345
|
+
After persistence, reply briefly in the resolved Report Language with: completion status, final report path, team-state path, validator result, resume command path, any remaining blocker.
|
|
323
346
|
|
|
324
347
|
## Common Mistakes
|
|
325
348
|
|
|
@@ -52,15 +52,16 @@ Unlike the Codex / Gemini workers, you are an in-process Claude subagent — you
|
|
|
52
52
|
|
|
53
53
|
6. If the task brief includes an `## Available MCP Servers` section in the lead prompt, treat that as the canonical list of MCP tools you may invoke for this run. If a needed server is not listed, record `MCP not available for this run` rather than calling it.
|
|
54
54
|
|
|
55
|
+
7. When `Task Type` is `improvement-discovery`, the lead's Phase 1.5 reflect-back log at `<RUN_DIR>/state/phase-1.5-grilling.md` is the authoritative scope and lens definition. Read its `Resolved scope` and `Resolved lenses` blocks and do NOT re-interpret the brief's raw `scan-scope` / `priority-lenses` fields. Findings that violate the resolved lens whitelist or scope are rejected by `validators/validate-improvement-report.py`.
|
|
56
|
+
|
|
55
57
|
## Required Reading Before Any Analysis
|
|
56
58
|
|
|
57
|
-
Before producing any output, you MUST
|
|
59
|
+
Before producing any output, you MUST:
|
|
60
|
+
|
|
61
|
+
1. Extract the absolute path from the lead's `**Worker Preamble Path:**` anchor header and Read that file end-to-end with a single `Read` call (no `offset`, no `limit`). This is the canonical SSOT for the Required Reading + Error Reporting + Output sections contract.
|
|
62
|
+
2. Read every input file the lead enumerated under `## Inputs` (or equivalent heading) in the dispatch prompt body, end-to-end, following the rules stated in the preamble. For analysis workers this is task-brief + analysis-profile + analysis-material (if present) + reference-expectations + clarification-response (if carry-in). Analysis workers do NOT read `final-report-template.md` — that file is for the report writer only.
|
|
58
63
|
|
|
59
|
-
-
|
|
60
|
-
- For the carry-in clarification response, walk every row of `## 5. Clarification Items` (`C-001`, `C-002`, ...) in full, including rows whose `User input` cell is blank — a blank `User input` with `Status=open` is itself a signal you must surface, not skip. Skimming these rows is the most common failure mode here; the fact that the file you will eventually contribute to has a structurally similar section 5 is NOT a license to skim.
|
|
61
|
-
- Before listing any Findings, write a Reading Confirmation block to your **audit sidecar** at `runs/<task-type>/worker-results/claude-worker-audit-<task-type>-<seq>.md` (sibling to your main worker-results file — substitute `claude-worker-<task-type>-<seq>.md` → `claude-worker-audit-<task-type>-<seq>.md`). The sidecar's body begins with `# Claude Worker Audit — <task-key>` followed by one short line per input file confirming end-to-end reading (e.g. `- Read task-brief.md end-to-end (147 lines).`). Do NOT include a `## 0. Reading Confirmation` heading in the main worker-results file — the validator now fails worker-results that contain one. If you cannot truthfully confirm a file end-to-end, record a `tool-failure` in the errors sidecar instead of fabricating Findings.
|
|
62
|
-
- **Heartbeat — write the audit sidecar EARLY and APPEND per stage (BLOCKING).** Because this worker runs as an in-process Agent or a fresh-session tmux pane, the lead has no `BashOutput`-style liveness signal while waiting for your return. The audit sidecar is the only signal that survives a silent hang. Write the sidecar immediately after extracting `Project Root` and the assigned paths — BEFORE the per-file end-to-end reads — with just the heading line (`# Claude Worker Audit — <task-key>`) and one `- PROGRESS: started <ISO-8601-UTC>` line. Then APPEND one short progress line per stage as you advance: `read-<filename>`, `analysis-start`, `findings-draft-start`, `findings-draft-complete`, `write-result-start`. Each line: `- PROGRESS: <stage> <ISO-8601-UTC>`. The append cadence MUST NOT exceed 5 minutes — if a single analysis stage is taking longer, emit a `- PROGRESS: in-stage:<stage> <ISO-8601-UTC>` heartbeat. A 5-minute stale sidecar mtime is the canonical "this worker has hung" signal for the operator (the lead is blocked on the Agent call and cannot detect this itself, but a human watching via `tail -F <audit-sidecar>` from another terminal can). Sidecar write/append uses `Write` (for the initial creation) and `Edit` / heredoc `>>` for the per-stage append — heredoc append is the lighter option once the file exists.
|
|
63
|
-
- Do not skip a file because its name suggests its content is already familiar from a prior run. Each file is canonical for the current run only.
|
|
64
|
+
**Heartbeat — write the audit sidecar EARLY and APPEND per stage (BLOCKING).** Because this worker runs as an in-process Agent or a fresh-session tmux pane, the lead has no `BashOutput`-style liveness signal while waiting for your return. The audit sidecar is the only signal that survives a silent hang. Write the sidecar at `runs/<task-type>/worker-results/claude-worker-audit-<task-type>-<seq>.md` immediately after extracting `Project Root` and the assigned paths — BEFORE the per-file end-to-end reads — with just the heading line (`# Claude Worker Audit — <task-key>`) and one `- PROGRESS: started <ISO-8601-UTC>` line. Then APPEND one short progress line per stage as you advance: `read-<filename>`, `analysis-start`, `findings-draft-start`, `findings-draft-complete`, `write-result-start`. The append cadence MUST NOT exceed 5 minutes — if a single analysis stage is taking longer, emit a `- PROGRESS: in-stage:<stage> <ISO-8601-UTC>` heartbeat. A 5-minute stale sidecar mtime is the canonical "this worker has hung" signal for the operator. Sidecar write/append uses `Write` (initial) and `Edit` / heredoc `>>` (per-stage append).
|
|
64
65
|
|
|
65
66
|
## Worker Output Structure
|
|
66
67
|
|
|
@@ -117,3 +118,27 @@ There is NO `cli-failure` category for this worker — Claude worker has no exte
|
|
|
117
118
|
- Return error messages as-is on failure.
|
|
118
119
|
- Do not summarize or modify your own analysis output beyond the structured sections above.
|
|
119
120
|
- Sections 1–5 are the common core — same dimensions for every analysis worker. Your specialization (broad reasoning depth, hidden-assumption surfacing, execution-risk decomposition) only enters Section 6 if you have additive content beyond the core. See `skills/okstra-team-contract/SKILL.md` "Worker Output Contract" for the authoritative split.
|
|
121
|
+
|
|
122
|
+
## Stage evidence emission (BLOCKING, implementation task only)
|
|
123
|
+
|
|
124
|
+
When this run's `task_type` is `implementation` and you are acting as the **Executor**, after the Stage Validation `post` commands all return exit code 0 you MUST emit a single JSON document matching `docs/superpowers/specs/2026-05-20-implementation-planning-multi-stage-design.md` §3.2:
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"schemaVersion": 1,
|
|
129
|
+
"sourcePlanPath": "<approved-plan path>",
|
|
130
|
+
"stageNumber": <int>,
|
|
131
|
+
"stageTitle": "<from Stage Map>",
|
|
132
|
+
"completedAt": "<ISO-8601 with tz>",
|
|
133
|
+
"stageCommitRange": { "base": "<sha>", "head": "<sha>" },
|
|
134
|
+
"filesChanged": ["<rel/path>", "..."],
|
|
135
|
+
"newIdentifiers": ["<name>", "..."],
|
|
136
|
+
"stepResults": [{"step": <int>, "status": "done", "commit": "<sha>"}],
|
|
137
|
+
"validationsPassed": ["<label>", "..."],
|
|
138
|
+
"notes": []
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Emit this as a fenced ```json``` block in your worker result under the heading `### Stage Carry Evidence`. The lead (`Claude lead`) is responsible for persisting the block as `runs/<impl-task-key>/carry/stage-<N>.json` — you do not write the file yourself.
|
|
143
|
+
|
|
144
|
+
This applies only when `task_type` is `implementation`. For other task types, skip this block entirely.
|
|
@@ -39,7 +39,7 @@ The wrapper internally runs:
|
|
|
39
39
|
codex exec -C "<project-root>" [--add-dir "<worktree-path>"] --model "<model>" --sandbox workspace-write - < "<prompt-path>" 2>/dev/null
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
The wrapper exists because Claude Code's Bash permission matcher rejects simple-prefix matches when the command contains stdin/stderr redirects. Calling `codex exec ...
|
|
42
|
+
The wrapper exists because Claude Code's Bash permission matcher rejects simple-prefix matches when the command contains stdin/stderr redirects. Calling `codex exec ... < <path> 2>/dev/null` directly triggers a permission prompt every dispatch even when `Bash(codex exec:*)` is allowlisted. The wrapper folds the redirects inside, so the harness sees a single non-redirect command that matches `Bash($HOME/.okstra/bin/okstra-codex-exec.sh:*)`.
|
|
43
43
|
|
|
44
44
|
**Do NOT use** non-existent flags like `-q` or `-a never`. **Do NOT** invoke `codex exec ... < ... 2>/dev/null` directly — always go through the wrapper.
|
|
45
45
|
|
|
@@ -68,7 +68,7 @@ The wrapper exists because Claude Code's Bash permission matcher rejects simple-
|
|
|
68
68
|
6. Extract the assigned model execution value for `Codex worker`.
|
|
69
69
|
- First, look for a `**Model:** Codex worker, <execution-value>` line in the lead prompt and use `<execution-value>`.
|
|
70
70
|
- If only a display model is listed, look up the canonical execution value from the referenced task bundle metadata (`task-manifest.json` → `resultContract.requiredWorkerRoles[]` for the codex role).
|
|
71
|
-
- If
|
|
71
|
+
- If no assigned model execution value can be determined, immediately return `CODEX_MODEL_MISSING: assigned Codex model execution value was not provided`. Do NOT fall back to training-data defaults — historical Codex defaults like `o4-mini` are NOT acceptable substitutes for the assigned model. Returning the sentinel is the correct behavior; the lead is responsible for fixing its prompt and redispatching.
|
|
72
72
|
- This rule applies equally to convergence reverify rounds. The reverify prompt MUST carry the same `**Model:**` line as the initial run (see `okstra-convergence` skill, "Required reverify-prompt anchor headers"). If the line is absent in a reverify prompt, return `CODEX_MODEL_MISSING` rather than guessing.
|
|
73
73
|
|
|
74
74
|
7. If installed, dispatch the wrapper as a **background** Bash command and poll for completion. The two-minute foreground Bash timeout is insufficient for implementation-phase Codex runs and forced workers into ad-hoc background dispatch with lost output. The polling contract below is the formal replacement.
|
|
@@ -77,9 +77,9 @@ The wrapper exists because Claude Code's Bash permission matcher rejects simple-
|
|
|
77
77
|
```bash
|
|
78
78
|
$HOME/.okstra/bin/okstra-codex-exec.sh "<absolute-project-root>" "<assigned-model-execution-value>" "<absolute-prompt-history-path>" "<absolute-worktree-path>" "worker"
|
|
79
79
|
```
|
|
80
|
-
Call `Bash` with `run_in_background: true`. Capture the returned `bash_id` (a.k.a. `shell_id`). Pass the positional arguments verbatim — do NOT use environment variables, `cd`, `&&` chains, or pipes from `cat`. Substitute the literal extracted Project Root, model execution value, prompt-history path, and worktree path. The fourth argument is **mandatory for implementation phase** (extract from `EXECUTOR_WORKTREE_PATH` in the lead prompt's run context or the `**Worktree:**` / `cwd for every mutating command:` line) and **may be omitted only for non-implementation analysis phases** that do not mutate the worktree.
|
|
80
|
+
Call `Bash` with `run_in_background: true`. Capture the returned `bash_id` (a.k.a. `shell_id`). Pass the positional arguments verbatim — do NOT use environment variables, `cd`, `&&` chains, or pipes from `cat`. Substitute the literal extracted Project Root, model execution value, prompt-history path, and worktree path. The fourth argument is **mandatory for implementation phase** (extract from `EXECUTOR_WORKTREE_PATH` in the lead prompt's run context or the `**Worktree:**` / `cwd for every mutating command:` line) and **may be omitted only for non-implementation analysis phases** that do not mutate the worktree. The wrapper handles `-C`, `--add-dir`, `--model`, `--sandbox workspace-write`, the stdin redirect from the prompt file, and stderr suppression internally. Calling `codex exec` directly (without the wrapper) is an error in this skill: the redirect tokens disqualify the prefix match against `Bash(codex exec:*)` and produce a permission prompt every dispatch.
|
|
81
81
|
|
|
82
|
-
**Poll loop (BashOutput-only, 30-minute
|
|
82
|
+
**Poll loop (BashOutput-only, 30-minute cap):**
|
|
83
83
|
- Record `start_ts` at dispatch time via a single `Bash` call: `date +%s` (output captured).
|
|
84
84
|
- Repeat:
|
|
85
85
|
1. Call `BashOutput(bash_id: <shell_id>)`. Inspect `status`. The harness's `BashOutput` primitive already waits internally for new output before returning; back-to-back calls are the canonical wait mechanism for a background shell.
|
|
@@ -108,6 +108,8 @@ The wrapper exists because Claude Code's Bash permission matcher rejects simple-
|
|
|
108
108
|
|
|
109
109
|
d. **Normal return.** Otherwise (`exit_code == 0` AND result file exists), concatenate the wrapper's accumulated stdout from `BashOutput` and return it as-is without modification.
|
|
110
110
|
|
|
111
|
+
9. When `Task Type` is `improvement-discovery`, the lead's Phase 1.5 reflect-back log at `<RUN_DIR>/state/phase-1.5-grilling.md` is the authoritative scope and lens definition. Read its `Resolved scope` and `Resolved lenses` blocks and do NOT re-interpret the brief's raw `scan-scope` / `priority-lenses` fields. Findings that violate the resolved lens whitelist or scope are rejected by `validators/validate-improvement-report.py`.
|
|
112
|
+
|
|
111
113
|
## Stop Condition
|
|
112
114
|
|
|
113
115
|
This wrapper is a thin Bash-execution shell over the Codex CLI (via `okstra-codex-exec.sh`). The CLI process itself is the analysis engine; this subagent's only job is to dispatch it and forward output. Therefore:
|
|
@@ -130,7 +132,7 @@ This wrapper does NOT invoke MCP tools directly. MCP availability inside the Cod
|
|
|
130
132
|
- The assigned model execution value is canonical for CLI execution. Do not substitute a different Codex model unless the task bundle explicitly changes it.
|
|
131
133
|
- Pass the prompt received from Lead directly to codex after persisting the exact prompt to the assigned path.
|
|
132
134
|
- Include context (code, diff, file paths) if provided.
|
|
133
|
-
- For long prompts,
|
|
135
|
+
- For long prompts, dispatch through the wrapper with literal absolute paths (plus the worktree path for implementation phase):
|
|
134
136
|
```bash
|
|
135
137
|
$HOME/.okstra/bin/okstra-codex-exec.sh "<literal-project-root>" "<assigned-model-execution-value>" "<literal-prompt-history-path>" "<literal-worktree-path>" "worker"
|
|
136
138
|
```
|
|
@@ -138,11 +140,12 @@ This wrapper does NOT invoke MCP tools directly. MCP availability inside the Cod
|
|
|
138
140
|
|
|
139
141
|
## Required Reading Before Any Analysis
|
|
140
142
|
|
|
141
|
-
Before
|
|
143
|
+
Before invoking the Codex CLI, you MUST:
|
|
144
|
+
|
|
145
|
+
1. Extract the absolute path from the lead's `**Worker Preamble Path:**` anchor header and verify the CLI run will Read that file end-to-end (canonical SSOT for the Required Reading + Error Reporting + Output sections contract). The lead's prompt body — which you persist verbatim and feed into Codex via stdin — already contains this anchor; do not strip it.
|
|
146
|
+
2. Verify the lead's prompt body lists the per-run input files under `## Inputs` (task-brief, analysis-profile, analysis-material if present, reference-expectations, clarification-response if carry-in). Analysis workers do NOT read `final-report-template.md` — that file is for the report writer only.
|
|
142
147
|
|
|
143
|
-
- The
|
|
144
|
-
- For the carry-in clarification response, the CLI must walk every row of `## 5. Clarification Items` (`C-001`, `C-002`, ...) in full, including rows whose `User input` cell is blank — a blank `User input` with `Status=open` is itself a signal you must surface. The fact that the prior run's final report and the upcoming output share section 5 structure is NOT a license to skim.
|
|
145
|
-
- The wrapper writes a Reading Confirmation block to the **audit sidecar** at `runs/<task-type>/worker-results/codex-worker-audit-<task-type>-<seq>.md` (sibling to the main worker-results file). The sidecar's body begins with `# Codex Worker Audit — <task-key>` followed by one short line per input file confirming end-to-end reading (e.g. `- Read task-brief.md end-to-end (147 lines).`). The main Codex output MUST NOT contain a `## 0. Reading Confirmation` heading — the validator now fails worker-results that contain one. If any file was skipped, record a `tool-failure` in the errors sidecar instead of fabricating Findings.
|
|
148
|
+
The CLI writes a Reading Confirmation block to the **audit sidecar** at `runs/<task-type>/worker-results/codex-worker-audit-<task-type>-<seq>.md`. The sidecar's body begins with `# Codex Worker Audit — <task-key>` followed by one short line per input file confirming end-to-end reading. The main Codex output MUST NOT contain a `## 0. Reading Confirmation` heading — the validator fails worker-results that contain one. If any file was skipped, record a `tool-failure` in the errors sidecar instead of fabricating Findings.
|
|
146
149
|
|
|
147
150
|
## Worker Output Structure
|
|
148
151
|
|
|
@@ -226,4 +229,28 @@ pre-flight terminal status, not a runtime CLI error.
|
|
|
226
229
|
- Ignore stderr warnings from MCP integration.
|
|
227
230
|
- Return error messages as-is on failure.
|
|
228
231
|
- Do not summarize or modify Codex results.
|
|
229
|
-
- Sections 1–5 of the worker output are the common core shared with the Claude and Gemini workers — the dispatched prompt asks identical questions for all three roles, and the Codex CLI must answer all of them, not only implementation-
|
|
232
|
+
- Sections 1–5 of the worker output are the common core shared with the Claude and Gemini workers — the dispatched prompt asks identical questions for all three roles, and the Codex CLI must answer all of them, not only implementation-feasibility findings. Your specialization (implementation realism, code-path implications, edge cases, technical trade-offs) belongs only in optional Section 6 as additive depth. A Codex result whose Findings section is populated solely with implementation-feasibility items is in breach of contract; see `skills/okstra-team-contract/SKILL.md` "Worker Output Contract".
|
|
233
|
+
|
|
234
|
+
## Stage evidence emission (BLOCKING, implementation task only)
|
|
235
|
+
|
|
236
|
+
When this run's `task_type` is `implementation` and you are acting as the **Executor**, after the Stage Validation `post` commands all return exit code 0 you MUST emit a single JSON document matching `docs/superpowers/specs/2026-05-20-implementation-planning-multi-stage-design.md` §3.2:
|
|
237
|
+
|
|
238
|
+
```json
|
|
239
|
+
{
|
|
240
|
+
"schemaVersion": 1,
|
|
241
|
+
"sourcePlanPath": "<approved-plan path>",
|
|
242
|
+
"stageNumber": <int>,
|
|
243
|
+
"stageTitle": "<from Stage Map>",
|
|
244
|
+
"completedAt": "<ISO-8601 with tz>",
|
|
245
|
+
"stageCommitRange": { "base": "<sha>", "head": "<sha>" },
|
|
246
|
+
"filesChanged": ["<rel/path>", "..."],
|
|
247
|
+
"newIdentifiers": ["<name>", "..."],
|
|
248
|
+
"stepResults": [{"step": <int>, "status": "done", "commit": "<sha>"}],
|
|
249
|
+
"validationsPassed": ["<label>", "..."],
|
|
250
|
+
"notes": []
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Emit this as a fenced ```json``` block in your worker result under the heading `### Stage Carry Evidence`. The lead (`Claude lead`) is responsible for persisting the block as `runs/<impl-task-key>/carry/stage-<N>.json` — you do not write the file yourself.
|
|
255
|
+
|
|
256
|
+
This applies only when `task_type` is `implementation`. For other task types, skip this block entirely.
|