okstra 0.34.1 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.kr.md +26 -16
  2. package/README.md +26 -16
  3. package/docs/kr/architecture.md +59 -45
  4. package/docs/kr/cli.md +61 -18
  5. package/docs/pr-template-usage.md +65 -0
  6. package/docs/project-structure-overview.md +358 -354
  7. package/docs/superpowers/plans/2026-05-12-ticket-id-in-reports.md +1 -1
  8. package/docs/superpowers/plans/2026-05-14-convergence-queue-pruning.md +1 -1
  9. package/docs/superpowers/plans/2026-05-17-dual-format-final-report.md +1 -1
  10. package/docs/superpowers/plans/2026-05-20-final-report-language.md +1501 -0
  11. package/docs/superpowers/plans/2026-05-20-implementation-planning-multi-stage.md +1267 -0
  12. package/docs/superpowers/plans/2026-05-20-okstra-run-prompt-sot-b1.md +1007 -0
  13. package/docs/superpowers/plans/2026-05-20-wizard-messages-json-sot.md +720 -0
  14. package/docs/superpowers/plans/2026-05-20-wizard-prompt-json-sot-a1.md +681 -0
  15. package/docs/superpowers/plans/2026-05-21-improvement-discovery-task-type.md +1691 -0
  16. package/docs/superpowers/specs/2026-05-20-final-report-language-design.md +383 -0
  17. package/docs/superpowers/specs/2026-05-20-implementation-planning-multi-stage-design.md +320 -0
  18. package/docs/superpowers/specs/2026-05-20-okstra-run-prompt-sot-design.md +299 -0
  19. package/docs/superpowers/specs/2026-05-21-improvement-discovery-task-type-design.md +335 -0
  20. package/docs/task-process/README.md +74 -0
  21. package/docs/task-process/common-flow.md +166 -0
  22. package/docs/task-process/error-analysis.md +101 -0
  23. package/docs/task-process/final-verification.md +167 -0
  24. package/docs/task-process/implementation-planning.md +128 -0
  25. package/docs/task-process/implementation.md +149 -0
  26. package/docs/task-process/release-handoff.md +206 -0
  27. package/docs/task-process/requirements-discovery.md +115 -0
  28. package/package.json +1 -1
  29. package/runtime/BUILD.json +2 -2
  30. package/runtime/agents/SKILL.md +12 -2
  31. package/runtime/agents/workers/claude-worker.md +26 -0
  32. package/runtime/agents/workers/codex-worker.md +27 -1
  33. package/runtime/agents/workers/gemini-worker.md +27 -1
  34. package/runtime/agents/workers/report-writer-worker.md +8 -1
  35. package/runtime/bin/okstra-central.sh +6 -6
  36. package/runtime/bin/okstra-codex-exec.sh +49 -28
  37. package/runtime/bin/okstra-gemini-exec.sh +39 -21
  38. package/runtime/bin/okstra-render-final-report.py +13 -2
  39. package/runtime/bin/okstra-wrapper-status.py +155 -0
  40. package/runtime/bin/okstra.sh +2 -2
  41. package/runtime/prompts/profiles/_common-contract.md +11 -6
  42. package/runtime/prompts/profiles/error-analysis.md +3 -7
  43. package/runtime/prompts/profiles/implementation-planning.md +22 -21
  44. package/runtime/prompts/profiles/implementation.md +28 -11
  45. package/runtime/prompts/profiles/improvement-discovery.md +42 -0
  46. package/runtime/prompts/profiles/kr/_common-contract.md +92 -0
  47. package/runtime/prompts/profiles/kr/error-analysis.md +36 -0
  48. package/runtime/prompts/profiles/kr/final-verification.md +48 -0
  49. package/runtime/prompts/profiles/kr/implementation-planning.md +90 -0
  50. package/runtime/prompts/profiles/kr/implementation.md +144 -0
  51. package/runtime/prompts/profiles/kr/improvement-discovery.md +42 -0
  52. package/runtime/prompts/profiles/kr/release-handoff.md +104 -0
  53. package/runtime/prompts/profiles/kr/requirements-discovery.md +42 -0
  54. package/runtime/prompts/profiles/release-handoff.md +1 -1
  55. package/runtime/prompts/profiles/requirements-discovery.md +8 -12
  56. package/runtime/prompts/wizard/prompts.ko.json +230 -0
  57. package/runtime/python/lib/okstra/cli.sh +2 -49
  58. package/runtime/python/lib/okstra/globals.sh +21 -21
  59. package/runtime/python/lib/okstra/interactive.sh +7 -7
  60. package/runtime/python/okstra_ctl/clarification_items.py +3 -9
  61. package/runtime/python/okstra_ctl/consumers.py +53 -0
  62. package/runtime/python/okstra_ctl/final_report_schema.py +0 -7
  63. package/runtime/python/okstra_ctl/i18n.py +73 -0
  64. package/runtime/python/okstra_ctl/improvement_lenses.py +44 -0
  65. package/runtime/python/okstra_ctl/index.py +1 -1
  66. package/runtime/python/okstra_ctl/paths.py +23 -20
  67. package/runtime/python/okstra_ctl/render.py +147 -202
  68. package/runtime/python/okstra_ctl/render_final_report.py +53 -10
  69. package/runtime/python/okstra_ctl/run.py +292 -107
  70. package/runtime/python/okstra_ctl/run_context.py +22 -0
  71. package/runtime/python/okstra_ctl/seeding.py +186 -0
  72. package/runtime/python/okstra_ctl/wizard.py +348 -127
  73. package/runtime/python/okstra_ctl/workflow.py +21 -2
  74. package/runtime/python/okstra_ctl/worktree.py +54 -1
  75. package/runtime/python/okstra_project/resolver.py +4 -3
  76. package/runtime/python/okstra_token_usage/report.py +2 -2
  77. package/runtime/schemas/final-report-v1.0.schema.json +22 -16
  78. package/runtime/skills/okstra-brief/SKILL.md +124 -31
  79. package/runtime/skills/okstra-convergence/SKILL.md +2 -3
  80. package/runtime/skills/okstra-report-writer/SKILL.md +35 -15
  81. package/runtime/skills/okstra-run/SKILL.md +5 -4
  82. package/runtime/skills/okstra-schedule/SKILL.md +4 -4
  83. package/runtime/skills/okstra-setup/SKILL.md +27 -0
  84. package/runtime/skills/okstra-team-contract/SKILL.md +1 -1
  85. package/runtime/templates/okstra.CLAUDE.md +104 -0
  86. package/runtime/templates/reports/final-report.template.md +93 -98
  87. package/runtime/templates/reports/i18n/en.json +135 -0
  88. package/runtime/templates/reports/i18n/ko.json +135 -0
  89. package/runtime/templates/reports/implementation-planning-input.template.md +18 -0
  90. package/runtime/templates/reports/improvement-discovery-input.template.md +78 -0
  91. package/runtime/templates/reports/task-brief.template.md +2 -2
  92. package/runtime/validators/lib/fixtures.sh +30 -0
  93. package/runtime/validators/lib/runners.sh +1 -1
  94. package/runtime/validators/validate-implementation-plan-stages.py +211 -0
  95. package/runtime/validators/validate-run.py +121 -26
  96. package/runtime/validators/validate-workflow.sh +2 -2
  97. package/runtime/validators/validate_improvement_report.py +275 -0
  98. package/src/config.mjs +18 -0
  99. package/src/install.mjs +41 -14
  100. package/src/setup.mjs +133 -1
  101. package/src/uninstall.mjs +21 -1
@@ -0,0 +1,101 @@
1
+ # error-analysis 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. 산출물과 금지선](#5-산출물과-금지선)
10
+ - [6. 확인한 코드](#6-확인한-코드)
11
+
12
+ ## 1. 목적
13
+
14
+ `error-analysis`는 보고된 error 또는 incident를 분석해 symptom, trigger, root-cause candidate, reproduction gap, validation path를 정리한다. fix 자체나 implementation design을 만드는 phase가 아니다.
15
+
16
+ ## 2. okstra-run wizard 흐름
17
+
18
+ ```mermaid
19
+ flowchart TD
20
+ Start[/okstra-run/] --> Common[공통 task identity flow]
21
+ Common --> Type[task-type = error-analysis]
22
+ Type --> Worktree{active worktree exists?}
23
+ Worktree -->|yes| Defaults[Use defaults / Customize]
24
+ Worktree -->|no| BaseRef[base-ref pick/text<br/>main recommended]
25
+ BaseRef --> Defaults
26
+ Defaults --> Workers[analysis worker multi-pick]
27
+ Workers --> D{Use defaults?}
28
+ D -->|yes| Confirm
29
+ D -->|customize| M[lead/worker model prompts]
30
+ M --> X[directive, related tasks, clarification]
31
+ X --> Confirm
32
+ Confirm --> Render[render-bundle --render-only]
33
+ ```
34
+
35
+ 기본 required roster는 `claude`, `codex`, `report-writer`다. `gemini`는 optional worker이고, 선택하면 analyser set에 들어간다.
36
+
37
+ ## 3. prepare_task_bundle 처리
38
+
39
+ ```mermaid
40
+ sequenceDiagram
41
+ participant Skill as okstra-run
42
+ participant Wizard as wizard.py
43
+ participant Run as prepare_task_bundle
44
+ participant WT as worktree.py
45
+ participant Art as artifacts
46
+
47
+ Skill->>Wizard: task-type error-analysis selected
48
+ Wizard-->>Skill: workers/base-ref/model args
49
+ Skill->>Run: render-bundle --render-only
50
+ Run->>Run: validate brief/profile
51
+ Run->>Run: resolve worker roster
52
+ Run->>WT: provision/reuse worktree
53
+ Run->>Art: analysis-profile.md includes common contract
54
+ Run->>Art: task-manifest workflow next=implementation-planning
55
+ ```
56
+
57
+ `workflow.py`의 static next phase는 `implementation-planning`이다. 실제 final report는 더 조사해야 한다고 할 수 있지만, lifecycle상 fix는 바로 가지 않고 planning으로 넘어간다.
58
+
59
+ ## 4. lead 실행 흐름
60
+
61
+ ```mermaid
62
+ flowchart TD
63
+ Intake[Phase 1 intake] --> Prompts[Phase 2 worker prompts]
64
+ Prompts --> Team[Phase 3 TeamCreate]
65
+ Team --> Dispatch[Phase 4/5 dispatch analysers]
66
+ Dispatch --> Evidence[worker outputs<br/>root-cause hypotheses]
67
+ Evidence --> Conv[Phase 5.5 convergence<br/>default maxRounds = 2]
68
+ Conv --> Report[Phase 6 report-writer final report]
69
+ Report --> Persist[Phase 7 persist + validate]
70
+ ```
71
+
72
+ worker들은 symptom과 evidence를 독립적으로 분석한다. report-writer는 Phase 4/5에 분석하지 않고 Phase 6에서 final report를 작성한다.
73
+
74
+ ## 5. 산출물과 금지선
75
+
76
+ ```mermaid
77
+ flowchart LR
78
+ Symptom[Symptom] --> Hyp[Root-cause candidates]
79
+ Hyp --> Gap[Reproduction gaps]
80
+ Gap --> Validate[Validation path]
81
+ Validate --> Next[Recommended next diagnostic/planning step]
82
+ Hyp -. forbidden .-> Fix[Code fix in this run]
83
+ ```
84
+
85
+ final report는 다음을 담아야 한다.
86
+
87
+ - evidence-backed cause analysis
88
+ - uncertainty boundary
89
+ - practical next diagnostic steps
90
+ - blocking uncertainty가 있으면 `## 5. Clarification Items`, 보통 `Blocks=next-phase`
91
+
92
+ 금지되는 것은 source edit, refactor, fix attempt, implementation design artifact, build/migration/deploy 실행이다. code나 log로 답할 수 있는 ambiguity를 사용자 질문으로 넘기는 것도 profile상 defect다.
93
+
94
+ ## 6. 확인한 코드
95
+
96
+ - [`prompts/profiles/error-analysis.md`](../../prompts/profiles/error-analysis.md)
97
+ - [`templates/reports/error-analysis-input.template.md`](../../templates/reports/error-analysis-input.template.md)
98
+ - [`scripts/okstra_ctl/workflow.py`](../../scripts/okstra_ctl/workflow.py)
99
+ - [`scripts/okstra_ctl/wizard.py`](../../scripts/okstra_ctl/wizard.py)
100
+ - [`agents/SKILL.md`](../../agents/SKILL.md)
101
+
@@ -0,0 +1,167 @@
1
+ # final-verification process
2
+
3
+ ## Index
4
+
5
+ - [1. 목적](#1-목적)
6
+ - [2. okstra-run wizard 흐름](#2-okstra-run-wizard-흐름)
7
+ - [3. entry gate](#3-entry-gate)
8
+ - [4. 검증 실행 흐름](#4-검증-실행-흐름)
9
+ - [5. verdict와 routing](#5-verdict와-routing)
10
+ - [6. 산출물](#6-산출물)
11
+ - [7. 금지선](#7-금지선)
12
+ - [8. 확인한 코드](#8-확인한-코드)
13
+
14
+ ## 1. 목적
15
+
16
+ `final-verification`은 `implementation`이 만든 committed diff를 최종 수락할 수 있는지 판정한다. source edit나 follow-up fix를 수행하지 않고, 구현 report와 실제 checkout이 일치하는지 확인한 뒤 acceptance blocker, residual risk, release recommendation을 남긴다.
17
+
18
+ ## 2. okstra-run wizard 흐름
19
+
20
+ ```mermaid
21
+ flowchart TD
22
+ Start[/okstra-run/] --> Common[공통 task identity flow]
23
+ Common --> Type[task-type = final-verification]
24
+ Type --> Worktree{active task worktree?}
25
+ Worktree -->|yes| Defaults[Use defaults / Customize]
26
+ Worktree -->|no| BaseRef[base-ref pick/text]
27
+ BaseRef --> Defaults
28
+ Defaults -->|defaults| Workers[worker roster pick<br/>claude/codex/report-writer default]
29
+ Defaults -->|customize| Models[lead + worker model prompts]
30
+ Models --> Extras[directive, related tasks, clarification]
31
+ Extras --> Workers
32
+ Workers --> Confirm[confirmation]
33
+ Confirm --> Render[render-bundle]
34
+ ```
35
+
36
+ `final-verification`은 analyser roster가 있는 non-implementation phase다. 따라서 `Use defaults`를 골라도 worker roster prompt는 계속 나온다. 기본 required workers는 `claude`, `codex`, `report-writer`이고, `gemini`는 opt-in이다.
37
+
38
+ ## 3. entry gate
39
+
40
+ ```mermaid
41
+ sequenceDiagram
42
+ participant Lead as Claude lead
43
+ participant Brief as task brief
44
+ participant Impl as implementation final-report
45
+ participant Git as verification worktree
46
+
47
+ Lead->>Brief: Source Implementation Report section read
48
+ Lead->>Impl: required sections present?
49
+ Lead->>Git: inspect same worktree named by report
50
+ Lead->>Git: git rev-parse HEAD
51
+ Lead->>Git: git status --short
52
+ Lead->>Git: git diff --stat <implementation-base>..HEAD
53
+ Git-->>Lead: verification target snapshot
54
+ Lead->>Lead: commit list and diff summary match?
55
+ ```
56
+
57
+ lead는 worker dispatch 전에 verification target을 고정한다. 다음 중 하나라도 실패하면 검증하지 않고 `blocked`로 끝내며 `implementation` 또는 `implementation-planning`으로 되돌린다.
58
+
59
+ - task brief에 `## Source Implementation Report`가 없다.
60
+ - 인용된 implementation final report가 없거나 필수 section이 빠져 있다.
61
+ - report가 named worktree를 가리키는데 lead가 다른 checkout을 보고 있다.
62
+ - implementation report의 commit list / diff summary와 현재 checkout이 맞지 않는다.
63
+ - delivered code change commit이 없다.
64
+
65
+ ## 4. 검증 실행 흐름
66
+
67
+ ```mermaid
68
+ flowchart TD
69
+ Gate[entry gate passed] --> Lead[Claude lead fixes target snapshot]
70
+ Lead --> CW[Claude verifier<br/>read-only]
71
+ Lead --> XW[Codex verifier<br/>read-only]
72
+ Lead --> GW{Gemini opt-in?}
73
+ GW -->|yes| Gemini[Gemini verifier<br/>read-only]
74
+ GW -->|no| Collect
75
+ CW --> Collect[collect independent findings]
76
+ XW --> Collect
77
+ Gemini --> Collect
78
+ Collect --> Conv[convergence<br/>default max rounds = 2]
79
+ Conv --> Writer[report-writer final synthesis]
80
+ Writer --> SelfReview[lead self-review<br/>verdict, blockers, coverage, no-mutation]
81
+ SelfReview --> Persist[final report + manifests]
82
+ ```
83
+
84
+ 검증 command는 자동 추측하지 않는다. 독립 재검증이 필요하면 command source는 두 tier뿐이다.
85
+
86
+ ```mermaid
87
+ flowchart LR
88
+ Need[needs validation command] --> Tier1{task brief / approved plan<br/>validation set?}
89
+ Tier1 -->|yes| Deny[Deny-list self-check]
90
+ Tier1 -->|no| Tier2{project.json<br/>qaCommands?}
91
+ Tier2 -->|yes| Deny
92
+ Tier2 -->|no| Missing[record<br/>qa-command not configured]
93
+ Deny -->|clean| Run[execute read-only command]
94
+ Deny -->|denied token| Reject[record rejected command<br/>do not execute]
95
+ ```
96
+
97
+ `implementation` runtime은 `qaCommands` deny-list를 prepare 단계에서 검증하지만, `final-verification`은 그 fail-fast gate가 없다. profile contract상 lead가 실행 직전에 직접 deny-list를 self-check해야 한다.
98
+
99
+ ## 5. verdict와 routing
100
+
101
+ ```mermaid
102
+ flowchart TD
103
+ Verdict{Verdict Token}
104
+ Verdict -->|accepted| Release[route to release-handoff or done]
105
+ Verdict -->|conditional-accept| Conditions[conditions listed exhaustively]
106
+ Conditions --> Followup[route to error-analysis or implementation-planning]
107
+ Verdict -->|blocked| Blockers[acceptance blockers with evidence]
108
+ Blockers --> Followup
109
+ ```
110
+
111
+ `## 2. Final Verdict`에는 `Verdict Token` field가 정확히 하나 들어가야 하며 값은 다음 셋 중 하나다.
112
+
113
+ - `accepted`: release-handoff로 넘겨도 되는 상태
114
+ - `conditional-accept`: 조건을 모두 명시해야 하며, 조건이 gate면 다음 phase를 막는다
115
+ - `blocked`: acceptance blocker가 있어 release-handoff로 갈 수 없는 상태
116
+
117
+ 애매한 표현인 "looks good", "mostly ready"는 허용되지 않는다.
118
+
119
+ ## 6. 산출물
120
+
121
+ ```mermaid
122
+ flowchart TD
123
+ Snapshot[base/head SHA<br/>status + diff stat] --> Report[final-verification final report]
124
+ Source[Source Implementation Report<br/>path + quoted commit/diff] --> Report
125
+ Coverage[requirement coverage<br/>artifact per requirement] --> Report
126
+ Blockers[acceptance blockers] --> Report
127
+ Risks[residual risks] --> Report
128
+ Commands[read-only command log] --> Report
129
+ Report --> Route[routing recommendation]
130
+ ```
131
+
132
+ final report에는 최소 다음이 필요하다.
133
+
134
+ - originating implementation final-report path
135
+ - inspected worktree path
136
+ - implementation base ref와 run start head SHA
137
+ - quoted commit list / diff summary
138
+ - `Verdict Token`
139
+ - blocker table 또는 `No acceptance blockers found.`
140
+ - residual risk와 escalation trigger
141
+ - requirement별 coverage artifact
142
+ - read-only command log와 exit code
143
+ - 다음 safe phase recommendation
144
+
145
+ ## 7. 금지선
146
+
147
+ ```mermaid
148
+ flowchart TD
149
+ FV[final-verification] --> Allowed[read-only inspect/test/validate]
150
+ FV -. forbidden .-> Edit[source edit or config edit]
151
+ FV -. forbidden .-> Fix[in-run bug fix]
152
+ FV -. forbidden .-> Mutate[mutating command]
153
+ FV -. forbidden .-> Expand[scope expansion]
154
+ FV -. forbidden .-> Hide[hide verifier dissent]
155
+ ```
156
+
157
+ source edit, follow-up fix, scope expansion은 전부 금지다. 결함을 발견하면 현재 run 안에서 고치지 않고 final report에 blocker로 기록한 뒤 새 `error-analysis` 또는 `implementation-planning` 입력으로 넘긴다.
158
+
159
+ ## 8. 확인한 코드
160
+
161
+ - [`prompts/profiles/final-verification.md`](../../prompts/profiles/final-verification.md)
162
+ - [`templates/reports/final-verification-input.template.md`](../../templates/reports/final-verification-input.template.md)
163
+ - [`scripts/okstra_ctl/wizard.py`](../../scripts/okstra_ctl/wizard.py)
164
+ - [`scripts/okstra_ctl/run.py`](../../scripts/okstra_ctl/run.py)
165
+ - [`scripts/okstra_ctl/workflow.py`](../../scripts/okstra_ctl/workflow.py)
166
+ - [`scripts/okstra_ctl/render.py`](../../scripts/okstra_ctl/render.py)
167
+ - [`agents/SKILL.md`](../../agents/SKILL.md)
@@ -0,0 +1,128 @@
1
+ # implementation-planning 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. final report gate](#5-final-report-gate)
10
+ - [6. 금지선](#6-금지선)
11
+ - [7. 확인한 코드](#7-확인한-코드)
12
+
13
+ ## 1. 목적
14
+
15
+ `implementation-planning`은 coding 전에 구현 방향을 정하는 phase다. 최소 두 개의 implementation option, trade-off, recommended option, stepwise execution order, validation checklist, rollback strategy를 만들고 사용자 approval gate를 둔다.
16
+
17
+ ## 2. okstra-run wizard 흐름
18
+
19
+ ```mermaid
20
+ flowchart TD
21
+ Start[/okstra-run/] --> Common[공통 task identity flow]
22
+ Common --> Type[task-type = implementation-planning]
23
+ Type --> Worktree{active task worktree?}
24
+ Worktree -->|yes| Defaults[Use defaults / Customize]
25
+ Worktree -->|no| BaseRef[base-ref pick/text]
26
+ BaseRef --> Defaults
27
+ Defaults --> Workers[worker multi-pick<br/>claude/codex + optional gemini]
28
+ Workers --> Branch{customize?}
29
+ Branch -->|no| Confirm
30
+ Branch -->|yes| Models[lead, claude, codex, gemini if selected, report-writer models]
31
+ Models --> Extras[directive, related tasks, clarification]
32
+ Extras --> Confirm
33
+ Confirm --> Render[render-bundle]
34
+ ```
35
+
36
+ wizard는 현재 `--no-plan-verification`을 묻지 않는다. okstra-run 경로에서는 plan-body verification이 기본 enabled로 준비된다. shell/CLI 경로에는 `--no-plan-verification` flag가 있다.
37
+
38
+ ## 3. prepare_task_bundle 처리
39
+
40
+ ```mermaid
41
+ sequenceDiagram
42
+ participant W as wizard/render-bundle
43
+ participant P as prepare_task_bundle
44
+ participant R as render.py
45
+ participant M as manifests
46
+
47
+ W->>P: task-type=implementation-planning
48
+ P->>P: validate profile/brief/base-ref
49
+ P->>P: resolve profile workers + optional override
50
+ P->>P: resolve model metadata
51
+ P->>P: provision/reuse task worktree
52
+ P->>R: _build_convergence_block()
53
+ R-->>M: convergence.planBodyVerification.enabled=true
54
+ P->>M: workflow nextRecommendedPhase=implementation
55
+ P-->>W: prepared lead prompt
56
+ ```
57
+
58
+ runtime prepare 단계는 source edit를 막는 것이 아니라 "현재 phase boundary를 lead prompt와 manifest에 박아 넣는" 방식이다. 실제 no-edit/no-build 규칙은 lead와 worker가 profile을 읽고 지켜야 한다.
59
+
60
+ ## 4. lead 실행 흐름
61
+
62
+ ```mermaid
63
+ flowchart TD
64
+ P1[Phase 1 intake] --> P2[Phase 2 prompts]
65
+ P2 --> P3[Phase 3 TeamCreate]
66
+ P3 --> P4[Phase 4/5 analyser dispatch]
67
+ P4 --> C[Phase 5.5 finding convergence]
68
+ C --> RW[Phase 6 report-writer writes draft]
69
+ RW --> PBV[Phase 6 sub-step<br/>Plan Body Verification]
70
+ PBV --> Gate{gate result}
71
+ Gate -->|passed / passed-with-dissent| Approval[render top Approval checkbox]
72
+ Gate -->|blocked-by-disagreement / aborted-non-result| NoApproval[render block without checkbox]
73
+ Approval --> P7[Phase 7 persist]
74
+ NoApproval --> P7
75
+ ```
76
+
77
+ Plan-body verification은 Phase 5.5와 다른 queue를 쓴다. Phase 5.5는 worker finding을 검증하고, Phase 6 sub-step은 report-writer가 만든 consolidated plan body를 `P-*` plan item 단위로 다시 검증한다.
78
+
79
+ ## 5. final report gate
80
+
81
+ ```mermaid
82
+ flowchart LR
83
+ Options[Option Candidates] --> Matrix[Trade-off Matrix]
84
+ Matrix --> Rec[Recommended Option]
85
+ Rec --> Steps[Stepwise Execution Order]
86
+ Steps --> Dep[Dependency / Migration Risk]
87
+ Dep --> Val[Validation Checklist]
88
+ Val --> Rb[Rollback Strategy]
89
+ Rb --> Verify[Plan Body Verification]
90
+ Verify --> Approval[User Approval Request]
91
+ Approval --> Impl[Next run: implementation]
92
+ ```
93
+
94
+ validator가 section heading의 영문 substring을 찾기 때문에 다음 문자열은 heading line에 그대로 남아야 한다.
95
+
96
+ - `Option Candidates`
97
+ - `Trade-off`
98
+ - `Recommended Option`
99
+ - `Stepwise Execution Order`
100
+ - `Dependency`
101
+ - `Validation Checklist`
102
+ - `Rollback`
103
+ - `User Approval Request`
104
+
105
+ approval marker는 top-of-report `User Approval Request` block의 `- [ ] Approved` line이다. 사용자가 `- [x] Approved`로 바꿔야 implementation run이 시작된다. `Blocks=approval` clarification row가 unresolved이면 approved marker가 있어도 implementation prepare에서 거부된다.
106
+
107
+ ## 6. 금지선
108
+
109
+ ```mermaid
110
+ flowchart TD
111
+ Plan[planning output] --> OK[reports/prompts/state/manifests only]
112
+ Plan -. forbidden .-> Code[source code edit]
113
+ Plan -. forbidden .-> Build[build/test/migration/deploy execution]
114
+ Plan -. forbidden .-> ExternalDocs[docs/superpowers plans/specs write]
115
+ Plan -. forbidden .-> NextPhase[start implementation in same run]
116
+ ```
117
+
118
+ 이 phase는 plan document만 만든다. code-level micro-optimization, source edit, build, migration, deployment, run artifact directory 밖 write는 금지된다.
119
+
120
+ ## 7. 확인한 코드
121
+
122
+ - [`prompts/profiles/implementation-planning.md`](../../prompts/profiles/implementation-planning.md)
123
+ - [`templates/reports/implementation-planning-input.template.md`](../../templates/reports/implementation-planning-input.template.md)
124
+ - [`templates/reports/final-report.template.md`](../../templates/reports/final-report.template.md)
125
+ - [`scripts/okstra_ctl/render.py`](../../scripts/okstra_ctl/render.py)
126
+ - [`validators/validate-run.py`](../../validators/validate-run.py)
127
+ - [`agents/SKILL.md`](../../agents/SKILL.md)
128
+
@@ -0,0 +1,149 @@
1
+ # implementation process
2
+
3
+ ## Index
4
+
5
+ - [1. 목적](#1-목적)
6
+ - [2. okstra-run wizard 흐름](#2-okstra-run-wizard-흐름)
7
+ - [3. runtime gate](#3-runtime-gate)
8
+ - [4. executor와 verifier](#4-executor와-verifier)
9
+ - [5. stage와 consumers](#5-stage와-consumers)
10
+ - [6. 산출물](#6-산출물)
11
+ - [7. 금지선](#7-금지선)
12
+ - [8. 확인한 코드](#8-확인한-코드)
13
+
14
+ ## 1. 목적
15
+
16
+ `implementation`은 승인된 `implementation-planning` final report를 실제 code change와 local commit으로 실행한다. 이 phase에서만 source edit가 허용되지만, scope는 approved plan과 recorded out-of-plan justification으로 제한된다.
17
+
18
+ ## 2. okstra-run wizard 흐름
19
+
20
+ ```mermaid
21
+ flowchart TD
22
+ Start[/okstra-run/] --> Common[공통 task identity flow]
23
+ Common --> Type[task-type = implementation]
24
+ Type --> Worktree{active task worktree?}
25
+ Worktree -->|yes| PlanPick[approved plan pick/text]
26
+ Worktree -->|no| BaseRef[base-ref pick/text]
27
+ BaseRef --> PlanPick
28
+ PlanPick --> Approved{APPROVED marker present?}
29
+ Approved -->|no| Retry[re-prompt same step]
30
+ Approved -->|yes| Stage[stage pick<br/>auto or number]
31
+ Stage --> Executor[executor pick<br/>claude/codex/gemini]
32
+ Executor --> Defaults[Use defaults / Customize]
33
+ Defaults -->|defaults| Confirm
34
+ Defaults -->|customize| Models[lead + executor model + report-writer model]
35
+ Models --> Extras[directive, related tasks, clarification]
36
+ Extras --> Confirm
37
+ Confirm --> Render[render-bundle]
38
+ ```
39
+
40
+ `implementation`은 worker override 질문이 없다. wizard `render_args()`가 `workers`를 빈 문자열로 내보내고, runtime이 profile default roster를 사용한다. 현재 okstra-run wizard 경로는 승인 checkbox를 직접 flip하는 `--approve`를 노출하지 않는다. plan file에는 이미 recognized approval marker가 있어야 한다.
41
+
42
+ ## 3. runtime gate
43
+
44
+ ```mermaid
45
+ sequenceDiagram
46
+ participant W as okstra-run
47
+ participant P as prepare_task_bundle
48
+ participant Plan as approved final-report
49
+ participant QA as project.json qaCommands
50
+ participant Stage as stage validator
51
+
52
+ W->>P: task-type=implementation, approved-plan, stage, executor
53
+ P->>Plan: file exists?
54
+ P->>Plan: approval marker regex matches?
55
+ P->>Plan: unresolved Blocks=approval rows?
56
+ P->>Stage: validate stage structure
57
+ P->>QA: validate qaCommands deny-list
58
+ P->>P: executor provider in resolved roster?
59
+ P->>P: provision/reuse worktree
60
+ P-->>W: prepared implementation prompt or PrepareError
61
+ ```
62
+
63
+ `--approve`는 Python runtime에 존재하지만 okstra-run wizard가 args로 내보내지 않는다. shell path에서는 `--approve`가 unchecked approval line을 flip하고 audit line을 붙인 뒤 같은 validation path를 탄다.
64
+
65
+ ## 4. executor와 verifier
66
+
67
+ ```mermaid
68
+ flowchart TD
69
+ Lead[Claude lead] --> Exec[Executor<br/>selected provider]
70
+ Lead --> CV[Claude verifier<br/>read-only]
71
+ Lead --> XV[Codex verifier<br/>read-only]
72
+ Lead --> GV{Gemini in roster?}
73
+ GV -->|yes| Gem[Gemini verifier<br/>read-only]
74
+ Exec --> Diff[Source edits + local commits]
75
+ CV --> QA[Independent QA rerun]
76
+ XV --> QA
77
+ Gem --> QA
78
+ QA --> Verdict[PASS / CONCERNS / FAIL]
79
+ Verdict --> Report[Final report preserves dissent]
80
+ ```
81
+
82
+ Executor만 project file을 mutate할 수 있다. verifier는 같은 worktree에서 read-only로 diff와 validation command를 독립 재실행한다. executor와 같은 provider도 verifier로 별도 fresh CLI session에서 다시 실행된다. 같은 session이 쓴 diff를 같은 session이 승인하는 구조를 막기 위함이다.
83
+
84
+ ## 5. stage와 consumers
85
+
86
+ ```mermaid
87
+ flowchart LR
88
+ Plan[approved plan<br/>Stage Map] --> Parse[parse stage map]
89
+ Parse --> Done[read consumers.jsonl<br/>done stages]
90
+ Done --> Resolve{stage arg}
91
+ Resolve -->|auto| Next[lowest unblocked unfinished stage]
92
+ Resolve -->|number| Forced[selected stage]
93
+ Next --> Started[append consumer status=started]
94
+ Forced --> Started
95
+ Started --> Run[implementation executes selected stage]
96
+ ```
97
+
98
+ stage 선택은 `auto` 또는 숫자다. 다른 task-type에서 `--stage`가 오면 `PrepareError`다. wizard는 approved plan에서 Stage Map을 parse해 stage picker에 `auto`와 각 stage를 보여준다.
99
+
100
+ ## 6. 산출물
101
+
102
+ ```mermaid
103
+ flowchart TD
104
+ Code[Commits] --> Report[implementation final report]
105
+ Diff[git diff --stat base..HEAD] --> Report
106
+ TDD[TDD evidence] --> Report
107
+ Validation[Validation evidence<br/>actual output + exit code] --> Report
108
+ Verifiers[Verifier results<br/>command logs + verdicts] --> Report
109
+ Rollback[Rollback verification] --> Report
110
+ Report --> Next[Routing recommendation<br/>final-verification or loop back]
111
+ ```
112
+
113
+ final report에는 최소 다음이 필요하다.
114
+
115
+ - approved plan path와 quoted approval marker
116
+ - commit SHA, message, plan step mapping
117
+ - diff summary와 per-file summary
118
+ - out-of-plan edits block
119
+ - plan validation command의 실제 stdout/stderr와 exit code
120
+ - TDD failing-then-passing evidence
121
+ - verifier별 independent validation rerun result
122
+ - rollback verification
123
+ - follow-up tasks table
124
+
125
+ ## 7. 금지선
126
+
127
+ ```mermaid
128
+ flowchart TD
129
+ Impl[implementation] --> Allowed[local edit/write/build/test/git add/git commit]
130
+ Impl -. forbidden .-> Push[git push]
131
+ Impl -. forbidden .-> Publish[publish/release/deploy]
132
+ Impl -. forbidden .-> RealDB[real DB migration or non-local datastore write]
133
+ Impl -. forbidden .-> VerifierWrite[verifier edit/write]
134
+ Impl -. forbidden .-> Scope[silent scope expansion]
135
+ Impl -. forbidden .-> Acceptance[declaring final acceptance]
136
+ ```
137
+
138
+ 이 phase는 final acceptance를 선언하지 않는다. ready for final-verification 또는 needs new loop만 말한다.
139
+
140
+ ## 8. 확인한 코드
141
+
142
+ - [`prompts/profiles/implementation.md`](../../prompts/profiles/implementation.md)
143
+ - [`templates/reports/implementation-input.template.md`](../../templates/reports/implementation-input.template.md)
144
+ - [`scripts/okstra_ctl/run.py`](../../scripts/okstra_ctl/run.py)
145
+ - [`scripts/okstra_ctl/wizard.py`](../../scripts/okstra_ctl/wizard.py)
146
+ - [`validators/validate-implementation-plan-stages.py`](../../validators/validate-implementation-plan-stages.py)
147
+ - [`scripts/okstra_ctl/qa_commands.py`](../../scripts/okstra_ctl/qa_commands.py)
148
+ - [`agents/SKILL.md`](../../agents/SKILL.md)
149
+