okstra 0.122.0 → 0.124.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 (108) hide show
  1. package/README.md +5 -2
  2. package/docs/architecture/storage-model.md +15 -1
  3. package/docs/architecture.md +45 -7
  4. package/docs/cli.md +47 -5
  5. package/docs/for-ai/README.md +42 -36
  6. package/docs/for-ai/skills/okstra-brief-gen.md +105 -105
  7. package/docs/for-ai/skills/okstra-container-build.md +61 -61
  8. package/docs/for-ai/skills/okstra-graphify.md +64 -0
  9. package/docs/for-ai/skills/okstra-inspect.md +86 -86
  10. package/docs/for-ai/skills/okstra-manager.md +32 -32
  11. package/docs/for-ai/skills/okstra-memory.md +49 -50
  12. package/docs/for-ai/skills/okstra-pr-gen.md +48 -0
  13. package/docs/for-ai/skills/okstra-rollup.md +58 -58
  14. package/docs/for-ai/skills/okstra-run.md +95 -95
  15. package/docs/for-ai/skills/okstra-schedule-gen.md +320 -0
  16. package/docs/for-ai/skills/okstra-setup.md +63 -64
  17. package/docs/for-ai/skills/okstra-user-response.md +48 -0
  18. package/docs/performance-improvement-plan-v2.md +4 -4
  19. package/docs/pr-template-usage.md +34 -34
  20. package/docs/project-structure-overview.md +92 -70
  21. package/docs/task-process/README.md +33 -33
  22. package/docs/task-process/common-flow.md +26 -26
  23. package/docs/task-process/error-analysis.md +20 -21
  24. package/docs/task-process/final-verification.md +41 -41
  25. package/docs/task-process/implementation-planning.md +52 -28
  26. package/docs/task-process/implementation.md +51 -32
  27. package/docs/task-process/release-handoff.md +46 -46
  28. package/docs/task-process/requirements-discovery.md +22 -23
  29. package/package.json +1 -1
  30. package/runtime/BUILD.json +2 -2
  31. package/runtime/agents/workers/antigravity-worker.md +4 -4
  32. package/runtime/agents/workers/claude-worker.md +2 -2
  33. package/runtime/agents/workers/codex-worker.md +4 -4
  34. package/runtime/agents/workers/report-writer-worker.md +4 -4
  35. package/runtime/bin/lib/okstra/usage.sh +3 -3
  36. package/runtime/prompts/coding-preflight/frameworks/node-server.md +1 -1
  37. package/runtime/prompts/launch.template.md +6 -3
  38. package/runtime/prompts/lead/convergence.md +11 -21
  39. package/runtime/prompts/lead/okstra-lead-contract.md +16 -18
  40. package/runtime/prompts/lead/plan-body-verification.md +47 -18
  41. package/runtime/prompts/lead/report-writer.md +50 -45
  42. package/runtime/prompts/lead/team-contract.md +11 -122
  43. package/runtime/prompts/profiles/_common-contract.md +15 -22
  44. package/runtime/prompts/profiles/_implementation-deliverable.md +4 -2
  45. package/runtime/prompts/profiles/_implementation-executor.md +6 -1
  46. package/runtime/prompts/profiles/_implementation-verifier.md +3 -3
  47. package/runtime/prompts/profiles/error-analysis.md +2 -2
  48. package/runtime/prompts/profiles/final-verification.md +3 -1
  49. package/runtime/prompts/profiles/implementation-planning.md +24 -14
  50. package/runtime/prompts/profiles/implementation.md +1 -1
  51. package/runtime/prompts/profiles/improvement-discovery.md +1 -1
  52. package/runtime/prompts/profiles/release-handoff.md +3 -3
  53. package/runtime/prompts/profiles/requirements-discovery.md +18 -18
  54. package/runtime/prompts/wizard/prompts.ko.json +44 -0
  55. package/runtime/python/okstra_ctl/codex_dispatch.py +23 -1
  56. package/runtime/python/okstra_ctl/design_prep.py +1462 -0
  57. package/runtime/python/okstra_ctl/design_surfaces.py +243 -0
  58. package/runtime/python/okstra_ctl/final_report_schema.py +33 -1
  59. package/runtime/python/okstra_ctl/implementation_stage.py +35 -0
  60. package/runtime/python/okstra_ctl/incremental_carry.py +294 -21
  61. package/runtime/python/okstra_ctl/incremental_scope.py +51 -5
  62. package/runtime/python/okstra_ctl/material.py +1 -1
  63. package/runtime/python/okstra_ctl/model_discovery.py +98 -0
  64. package/runtime/python/okstra_ctl/models.py +8 -3
  65. package/runtime/python/okstra_ctl/render.py +5 -0
  66. package/runtime/python/okstra_ctl/run.py +53 -5
  67. package/runtime/python/okstra_ctl/user_response.py +67 -2
  68. package/runtime/python/okstra_ctl/wizard.py +283 -3
  69. package/runtime/python/okstra_token_usage/report.py +11 -0
  70. package/runtime/schemas/final-report-v1.0.schema.json +336 -0
  71. package/runtime/skills/_fragments/bash-invocation-rule.md +1 -0
  72. package/runtime/skills/_fragments/preflight-outdated-cli.md +1 -0
  73. package/runtime/skills/_fragments/python-bootstrap-note.md +1 -0
  74. package/runtime/skills/okstra-brief-gen/SKILL.md +117 -122
  75. package/runtime/skills/okstra-container-build/SKILL.md +24 -14
  76. package/runtime/skills/okstra-graphify/SKILL.md +12 -4
  77. package/runtime/skills/okstra-inspect/SKILL.md +105 -99
  78. package/runtime/skills/okstra-manager/SKILL.md +1 -1
  79. package/runtime/skills/okstra-memory/SKILL.md +3 -3
  80. package/runtime/skills/okstra-rollup/SKILL.md +12 -6
  81. package/runtime/skills/okstra-run/SKILL.md +49 -88
  82. package/runtime/skills/{okstra-schedule → okstra-schedule-gen}/SKILL.md +38 -32
  83. package/runtime/skills/okstra-setup/SKILL.md +1 -1
  84. package/runtime/skills/okstra-setup/references/project-config.md +17 -16
  85. package/runtime/skills/okstra-usage/SKILL.md +5 -2
  86. package/runtime/skills/okstra-user-response/SKILL.md +23 -9
  87. package/runtime/templates/prd/brief.template.md +92 -92
  88. package/runtime/templates/reports/error-analysis-input.template.md +1 -1
  89. package/runtime/templates/reports/fan-out-unit.template.md +6 -6
  90. package/runtime/templates/reports/final-report.template.md +67 -0
  91. package/runtime/templates/reports/final-verification-input.template.md +6 -6
  92. package/runtime/templates/reports/i18n/en.json +31 -0
  93. package/runtime/templates/reports/i18n/ko.json +31 -0
  94. package/runtime/templates/reports/implementation-input.template.md +1 -1
  95. package/runtime/templates/reports/implementation-planning-input.template.md +1 -1
  96. package/runtime/templates/reports/improvement-discovery-input.template.md +1 -1
  97. package/runtime/templates/reports/quick-input.template.md +1 -1
  98. package/runtime/templates/reports/release-handoff-input.template.md +1 -1
  99. package/runtime/templates/reports/schedule.template.md +22 -22
  100. package/runtime/templates/reports/task-brief.template.md +3 -3
  101. package/runtime/templates/reports/user-response.template.md +20 -20
  102. package/runtime/templates/worker-prompt-preamble.md +111 -13
  103. package/runtime/validators/validate-run.py +426 -5
  104. package/runtime/validators/validate-schedule.py +5 -5
  105. package/src/cli-registry.mjs +7 -0
  106. package/src/commands/inspect/design-prep.mjs +23 -0
  107. package/src/lib/skill-catalog.mjs +2 -1
  108. package/docs/for-ai/skills/okstra-schedule.md +0 -320
@@ -2,20 +2,20 @@
2
2
 
3
3
  ## Index
4
4
 
5
- - [1. 한 줄 요약](#1-한-줄-요약)
6
- - [2. 두 entrypoint가 만나는 지점](#2-두-entrypoint가-만나는-지점)
7
- - [3. wizard 입력 수집 흐름](#3-wizard-입력-수집-흐름)
8
- - [4. render-bundle과 prepare_task_bundle](#4-render-bundle과-prepare_task_bundle)
5
+ - [1. One-line summary](#1-one-line-summary)
6
+ - [2. Where the two entrypoints meet](#2-where-the-two-entrypoints-meet)
7
+ - [3. wizard input collection flow](#3-wizard-input-collection-flow)
8
+ - [4. render-bundle and prepare_task_bundle](#4-render-bundle-and-prepare_task_bundle)
9
9
  - [5. Claude lead phase 1-7](#5-claude-lead-phase-1-7)
10
10
  - [6. artifact layout](#6-artifact-layout)
11
- - [7. 공통 분기 규칙](#7-공통-분기-규칙)
12
- - [8. 주의할 불일치 지점](#8-주의할-불일치-지점)
11
+ - [7. Common branching rules](#7-common-branching-rules)
12
+ - [8. Inconsistencies to watch for](#8-inconsistencies-to-watch-for)
13
13
 
14
- ## 1. 한 줄 요약
14
+ ## 1. One-line summary
15
15
 
16
- `okstra-run`은 "질문을 직접 판단하는 skill"이 아니라 `okstra wizard` JSON state machine을 사용자에게 relay하는 얇은 loop다. 입력 수집이 끝나면 `okstra render-bundle`을 호출하고, 이 명령이 `python3 -m okstra_ctl.run --render-only`를 통해 task bundle을 만든다. 그 뒤 현재 Claude Code 세션이 `Claude lead`로 전환된다.
16
+ `okstra-run` is not a "skill that decides questions on its own" but a thin loop that relays the `okstra wizard` JSON state machine to the user. Once input collection finishes, it calls `okstra render-bundle`, and that command builds the task bundle through `python3 -m okstra_ctl.run --render-only`. After that, the current Claude Code session switches over to `Claude lead`.
17
17
 
18
- ## 2. 두 entrypoint가 만나는 지점
18
+ ## 2. Where the two entrypoints meet
19
19
 
20
20
  ```mermaid
21
21
  flowchart LR
@@ -36,9 +36,9 @@ flowchart LR
36
36
  H -->|non-render-only| J[exec claude --session-id ...]
37
37
  ```
38
38
 
39
- 공통 원칙은 `prepare_task_bundle()`가 task bundle 생성의 단일 권위라는 점이다. wizard나 shell wrapper가 path 계산, manifest 생성, worktree 생성 로직을 복제하지 않는다.
39
+ The common principle is that `prepare_task_bundle()` is the single authority for task bundle creation. Neither the wizard nor the shell wrapper duplicates the path computation, manifest creation, or worktree creation logic.
40
40
 
41
- ## 3. wizard 입력 수집 흐름
41
+ ## 3. wizard input collection flow
42
42
 
43
43
  ```mermaid
44
44
  stateDiagram-v2
@@ -67,9 +67,9 @@ stateDiagram-v2
67
67
  Confirm --> Done: Proceed
68
68
  ```
69
69
 
70
- 새 task는 brief를 먼저 받는다. brief frontmatter에 `task-group:`과 `brief-id:`가 있으면 wizard가 task group/id를 추천값 pick으로 보여준다. 기존 task는 manifest의 `workflow.nextRecommendedPhase`를 task-type 추천값으로 보여주고, 기존 brief path가 있으면 유지/변경을 묻는다.
70
+ A new task receives its brief first. If the brief frontmatter has `task-group:` and `brief-id:`, the wizard shows the task group/id as recommended picks. An existing task shows the manifest's `workflow.nextRecommendedPhase` as the recommended task-type, and if an existing brief path exists it asks whether to keep or change it.
71
71
 
72
- ## 4. render-bundle과 prepare_task_bundle
72
+ ## 4. render-bundle and prepare_task_bundle
73
73
 
74
74
  ```mermaid
75
75
  sequenceDiagram
@@ -96,7 +96,7 @@ sequenceDiagram
96
96
  Skill->>FS: read claude-execution-prompt.md
97
97
  ```
98
98
 
99
- `render-bundle`의 Node shim은 [`src/commands/execute/render-bundle.mjs`](../../src/commands/execute/render-bundle.mjs)다. 이 shim이 `--workspace-root`, `--render-only`, runtime resolution 인자를 직접 붙인다. 따라서 okstra-run 경로의 initial run status는 `prepared`, task status는 `instruction-set-generated`로 시작한다.
99
+ The Node shim for `render-bundle` is [`src/commands/execute/render-bundle.mjs`](../../src/commands/execute/render-bundle.mjs). This shim attaches the `--workspace-root`, `--render-only`, and runtime resolution arguments directly. As a result, on the okstra-run path the initial run status starts at `prepared` and the task status starts at `instruction-set-generated`.
100
100
 
101
101
  ## 5. Claude lead phase 1-7
102
102
 
@@ -116,7 +116,7 @@ flowchart TD
116
116
  P7 --> Done[final report + manifests updated]
117
117
  ```
118
118
 
119
- 분석 worker와 report-writer의 역할은 분리된다. `report-writer`는 Phase 4/5 분석 worker가 아니라 Phase 6 final report author다. 단, `release-handoff`는 single-lead phase이므로 이 phase graph를 일부러 타지 않는다.
119
+ The roles of the analysis workers and the report-writer are separated. `report-writer` is not a Phase 4/5 analysis worker but the Phase 6 final report author. Note, however, that `release-handoff` is a single-lead phase, so it deliberately does not follow this phase graph.
120
120
 
121
121
  ## 6. artifact layout
122
122
 
@@ -141,11 +141,11 @@ flowchart TD
141
141
  Root --> Handoff[release-handoff-input.md]
142
142
  ```
143
143
 
144
- `implementation`과 단일-stage `final-verification`은 run 산출물을 `stage-<N>/` 아래에 격리한다. `implementation`의 carry sidecar와 `consumers.jsonl`은 stage 간 조율 ledger라 phase root에 남는다. runtime은 이 ledger와 registry 예약을 Stage Lifecycle Snapshot으로 읽어 stage 선택과 handoff eligibility를 계산한다. `release-handoff`는 brief를 받지 않고 prepare가 `release-handoff-input.md`를 생성한다.
144
+ `implementation` and single-stage `final-verification` isolate their run deliverables under `stage-<N>/`. The `implementation` carry sidecar and `consumers.jsonl` are cross-stage coordination ledgers, so they remain at the phase root. The runtime reads this ledger and the registry reservations as a Stage Lifecycle Snapshot to compute stage selection and handoff eligibility. `release-handoff` does not receive a brief; prepare generates `release-handoff-input.md`.
145
145
 
146
- `runtime/`은 build output이므로 이 흐름을 고칠 때는 source인 `scripts/`, `skills/`, `agents/`, `prompts/`, `templates/`, `validators/`를 수정하고 `npm run build`로 갱신한다.
146
+ `runtime/` is build output, so when you fix this flow you edit the sources `scripts/`, `skills/`, `agents/`, `prompts/`, `templates/`, `validators/` and refresh with `npm run build`.
147
147
 
148
- ## 7. 공통 분기 규칙
148
+ ## 7. Common branching rules
149
149
 
150
150
  ```mermaid
151
151
  flowchart TD
@@ -165,14 +165,14 @@ flowchart TD
165
165
  PR --> Confirm
166
166
  ```
167
167
 
168
- 중요한 점은 `Use defaults`가 model 기본값을 뜻한다는 것이다. non-implementation task-type에서는 defaults를 골라도 worker roster 질문은 계속 나온다. 반대로 `implementation`은 worker override 질문이 없다. profile default roster와 executor binding을 사용한다.
168
+ The important point is that `Use defaults` means the model defaults. For non-implementation task-types, the worker roster question still appears even if you choose defaults. Conversely, `implementation` has no worker override question; it uses the profile default roster and executor binding.
169
169
 
170
- Worktree 규칙은 phase별로 다르다. `requirements-discovery`부터 `implementation-planning`까지는 task-key worktree를 재사용한다. `implementation`은 task-key worktree를 anchor로 삼되 실제 실행은 stage-key(`stage-<N>`) worktree와 `runs/implementation/stage-<N>/` 산출물에서 한 stage씩 격리한다. `final-verification --stage N`은 해당 implementation stage worktree를 읽기 대상으로 재사용하고, whole-task 모드는 task-key worktree에 stage commit을 자동 통합한 뒤 검증 target을 만든다. Stage Lifecycle Snapshot은 이 저장 구조를 변경하지 않는 read-side view다.
170
+ Worktree rules differ per phase. From `requirements-discovery` through `implementation-planning`, the task-key worktree is reused. `implementation` uses the task-key worktree as an anchor but does the actual execution isolated one stage at a time in a stage-key (`stage-<N>`) worktree and the `runs/implementation/stage-<N>/` deliverables. `final-verification --stage N` reuses that implementation stage worktree as a read target, and whole-task mode auto-integrates the stage commits into the task-key worktree and then builds the verification target. The Stage Lifecycle Snapshot is a read-side view that does not change this storage structure.
171
171
 
172
- ## 8. 주의할 불일치 지점
172
+ ## 8. Inconsistencies to watch for
173
173
 
174
- - `okstra-run` wizard 경로는 implementation approved plan에 이미 approval marker가 있어야 통과한다. `scripts/okstra.sh`에는 `--approve`가 있어 checkbox를 CLI ack로 flip할 수 있지만, 현재 wizard `render_args()`에는 `approve` flag가 없다.
175
- - `release-handoff`는 brief가 없다. prepare가 accepted final-verification report를 인용해 `release-handoff-input.md`를 만들고, wizard의 `handoff_stage_pick` 또는 CLI `--stages`가 whole-task/stage-group 범위를 고정한다.
176
- - `release-handoff`도 task worktree provisioning 대상이다. 정상적인 handoff는 같은 task-key의 implementation/final-verification 결과를 재사용하는 흐름이 안전하다. 새 task로 시작하면 새 worktree가 만들어지고, profile의 "implementation commit이 있어야 함" entry gate에서 막힐 수 있다.
177
- - `release-handoff`는 profile에 `Required workers:` block이 없다. runtime도 worker roster를 강제로 empty로 만든다.
178
- - 모든 task-type은 한 run 안에서 다음 lifecycle phase를 시작하지 않는다. "다음 단계 진행해"는 현재 phase 산출을 마무리하라는 뜻으로만 해석한다.
174
+ - The `okstra-run` wizard path passes only if the implementation approved plan already has an approval marker. `scripts/okstra.sh` has `--approve`, which can flip the checkbox with a CLI ack, but the current wizard `render_args()` has no `approve` flag.
175
+ - `release-handoff` has no brief. Prepare cites the accepted final-verification report to build `release-handoff-input.md`, and the wizard's `handoff_stage_pick` or the CLI `--stages` fixes the whole-task/stage-group scope.
176
+ - `release-handoff` is also a target for task worktree provisioning. A healthy handoff is safest when it reuses the implementation/final-verification results of the same task-key. Starting a new task creates a new worktree, which may be blocked at the profile's "an implementation commit must exist" entry gate.
177
+ - `release-handoff` has no `Required workers:` block in its profile. The runtime also forces the worker roster to be empty.
178
+ - No task-type starts the next lifecycle phase within a single run. "Proceed to the next step" is interpreted only as wrapping up the current phase's output.
@@ -2,22 +2,22 @@
2
2
 
3
3
  ## Index
4
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-확인한-코드)
5
+ - [1. Purpose](#1-purpose)
6
+ - [2. okstra-run wizard flow](#2-okstra-run-wizard-flow)
7
+ - [3. prepare_task_bundle handling](#3-prepare_task_bundle-handling)
8
+ - [4. lead execution flow](#4-lead-execution-flow)
9
+ - [5. Deliverables and prohibitions](#5-deliverables-and-prohibitions)
10
+ - [6. Code reviewed](#6-code-reviewed)
11
11
 
12
- ## 1. 목적
12
+ ## 1. Purpose
13
13
 
14
- `error-analysis`는 보고된 error 또는 incident를 분석해 symptom, trigger, root-cause candidate, reproduction gap, validation path를 정리한다. fix 자체나 implementation design을 만드는 phase가 아니다.
14
+ `error-analysis` analyzes a reported error or incident to organize the symptom, trigger, root-cause candidate, reproduction gap, and validation path. It is not the phase that produces the fix itself or an implementation design.
15
15
 
16
- ## 2. okstra-run wizard 흐름
16
+ ## 2. okstra-run wizard flow
17
17
 
18
18
  ```mermaid
19
19
  flowchart TD
20
- Start[/okstra-run/] --> Common[공통 task identity flow]
20
+ Start[/okstra-run/] --> Common[common task identity flow]
21
21
  Common --> Type[task-type = error-analysis]
22
22
  Type --> Worktree{active worktree exists?}
23
23
  Worktree -->|yes| Defaults[Use defaults / Customize]
@@ -32,9 +32,9 @@ flowchart TD
32
32
  Confirm --> Render[render-bundle --render-only]
33
33
  ```
34
34
 
35
- 기본 required roster는 `claude`, `codex`, `report-writer`다. `antigravity`는 optional worker이고, 선택하면 analyser set에 들어간다.
35
+ The default required roster is `claude`, `codex`, `report-writer`. `antigravity` is an optional worker, and if selected it joins the analyser set.
36
36
 
37
- ## 3. prepare_task_bundle 처리
37
+ ## 3. prepare_task_bundle handling
38
38
 
39
39
  ```mermaid
40
40
  sequenceDiagram
@@ -54,9 +54,9 @@ sequenceDiagram
54
54
  Run->>Art: task-manifest workflow next=implementation-planning
55
55
  ```
56
56
 
57
- `workflow.py`의 static next phase는 `implementation-planning`이다. 실제 final report는 더 조사해야 한다고 할 수 있지만, lifecycle상 fix는 바로 가지 않고 planning으로 넘어간다.
57
+ The static next phase in `workflow.py` is `implementation-planning`. The actual final report may say more investigation is needed, but in the lifecycle the fix does not go straight ahead; it moves on to planning.
58
58
 
59
- ## 4. lead 실행 흐름
59
+ ## 4. lead execution flow
60
60
 
61
61
  ```mermaid
62
62
  flowchart TD
@@ -69,9 +69,9 @@ flowchart TD
69
69
  Report --> Persist[Phase 7 persist + validate]
70
70
  ```
71
71
 
72
- worker들은 symptom과 evidence를 독립적으로 분석한다. report-writer는 Phase 4/5에 분석하지 않고 Phase 6에서 final report를 작성한다.
72
+ The workers analyze the symptom and evidence independently. The report-writer does not analyze during Phase 4/5 but writes the final report in Phase 6.
73
73
 
74
- ## 5. 산출물과 금지선
74
+ ## 5. Deliverables and prohibitions
75
75
 
76
76
  ```mermaid
77
77
  flowchart LR
@@ -82,20 +82,19 @@ flowchart LR
82
82
  Hyp -. forbidden .-> Fix[Code fix in this run]
83
83
  ```
84
84
 
85
- final report는 다음을 담아야 한다.
85
+ The final report must contain the following.
86
86
 
87
87
  - evidence-backed cause analysis
88
88
  - uncertainty boundary
89
89
  - practical next diagnostic steps
90
- - blocking uncertainty가 있으면 `## 1. Clarification Items`, 보통 `Blocks=next-phase`
90
+ - if there is blocking uncertainty, `## 1. Clarification Items`, usually `Blocks=next-phase`
91
91
 
92
- 금지되는 것은 source edit, refactor, fix attempt, implementation design artifact, build/migration/deploy 실행이다. code나 log로 답할 수 있는 ambiguity를 사용자 질문으로 넘기는 것도 profile상 defect다.
92
+ What is prohibited is source edit, refactor, fix attempt, implementation design artifact, and running build/migration/deploy. Deferring ambiguity that could be answered from code or logs to a user question is also a defect per the profile.
93
93
 
94
- ## 6. 확인한 코드
94
+ ## 6. Code reviewed
95
95
 
96
96
  - [`prompts/profiles/error-analysis.md`](../../prompts/profiles/error-analysis.md)
97
97
  - [`templates/reports/error-analysis-input.template.md`](../../templates/reports/error-analysis-input.template.md)
98
98
  - [`scripts/okstra_ctl/workflow.py`](../../scripts/okstra_ctl/workflow.py)
99
99
  - [`scripts/okstra_ctl/wizard.py`](../../scripts/okstra_ctl/wizard.py)
100
100
  - [`prompts/lead/okstra-lead-contract.md`](../../prompts/lead/okstra-lead-contract.md)
101
-
@@ -2,24 +2,24 @@
2
2
 
3
3
  ## Index
4
4
 
5
- - [1. 목적](#1-목적)
6
- - [2. okstra-run wizard 흐름](#2-okstra-run-wizard-흐름)
5
+ - [1. Purpose](#1-purpose)
6
+ - [2. okstra-run wizard flow](#2-okstra-run-wizard-flow)
7
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-확인한-코드)
8
+ - [4. Verification execution flow](#4-verification-execution-flow)
9
+ - [5. Verdict and routing](#5-verdict-and-routing)
10
+ - [6. Deliverables](#6-deliverables)
11
+ - [7. Forbidden actions](#7-forbidden-actions)
12
+ - [8. Verified code](#8-verified-code)
13
13
 
14
- ## 1. 목적
14
+ ## 1. Purpose
15
15
 
16
- `final-verification`은 `implementation`이 만든 committed diff를 최종 수락할 수 있는지 판정한다. source edit나 follow-up fix를 수행하지 않고, 구현 report와 실제 checkout이 일치하는지 확인한 뒤 acceptance blocker, residual risk, release recommendation을 남긴다.
16
+ `final-verification` determines whether the committed diff produced by `implementation` can be finally accepted. Without performing any source edit or follow-up fix, it confirms that the implementation report matches the actual checkout, then records acceptance blockers, residual risk, and a release recommendation.
17
17
 
18
- ## 2. okstra-run wizard 흐름
18
+ ## 2. okstra-run wizard flow
19
19
 
20
20
  ```mermaid
21
21
  flowchart TD
22
- Start[/okstra-run/] --> Common[공통 task identity flow]
22
+ Start[/okstra-run/] --> Common[common task identity flow]
23
23
  Common --> Type[task-type = final-verification]
24
24
  Type --> PlanPick[approved plan pick]
25
25
  PlanPick --> Approved[approval marker confirm]
@@ -33,9 +33,9 @@ flowchart TD
33
33
  Confirm --> Render[render-bundle]
34
34
  ```
35
35
 
36
- `final-verification`은 analyser roster가 있는 non-implementation phase다. 따라서 `Use defaults`를 골라도 worker roster prompt는 계속 나온다. 기본 required workers는 `claude`, `codex`, `report-writer`이고, `antigravity`는 opt-in이다.
36
+ `final-verification` is a non-implementation phase that has an analyser roster. So even if you pick `Use defaults`, the worker roster prompt still appears. The default required workers are `claude`, `codex`, and `report-writer`, and `antigravity` is opt-in.
37
37
 
38
- 이 phase는 `base-ref`를 직접 묻지 않는다. wizard는 approved plan의 Stage Map을 기준으로 whole-task 또는 단일 stage를 선택하고, prepare가 registry/`consumers.jsonl`/git 상태에서 `VERIFICATION_TARGET`을 해소한다.
38
+ This phase does not ask for `base-ref` directly. The wizard selects whole-task or a single stage from the approved plan's Stage Map, and prepare resolves `VERIFICATION_TARGET` from the registry / `consumers.jsonl` / git state.
39
39
 
40
40
  ## 3. entry gate
41
41
 
@@ -60,17 +60,17 @@ sequenceDiagram
60
60
  Lead->>Lead: verify against injected target only
61
61
  ```
62
62
 
63
- prepare는 worker dispatch 전에 verification target을 고정한다. 다음 중 하나라도 실패하면 lead prompt가 시작되지 않고 `PrepareError`로 멈춘다.
63
+ prepare fixes the verification target before worker dispatch. If any of the following fails, the lead prompt does not start and it stops with `PrepareError`.
64
64
 
65
- - approved plan의 Stage Map을 읽을 수 없다.
66
- - whole-task인데 Stage Map의 모든 stage가 `done`이 아니다.
67
- - whole-task 자동 통합 중 merge conflict가 난다.
68
- - single-stage인데 선택 stage의 implementation stage worktree가 없거나 dirty다.
69
- - verification worktree가 `.okstra/` 밖 dirty state다.
65
+ - The approved plan's Stage Map cannot be read.
66
+ - It is whole-task but not every stage in the Stage Map is `done`.
67
+ - A merge conflict occurs during whole-task auto-integration.
68
+ - It is single-stage but the selected stage's implementation stage worktree is missing or dirty.
69
+ - The verification worktree is in a dirty state outside `.okstra/`.
70
70
 
71
- 시작된 lead는 `VERIFICATION_TARGET`을 권위로 취급한다. worktree/base/head/stage/source report를 brief에서 다시 고르지 않는다.
71
+ Once started, the lead treats `VERIFICATION_TARGET` as authoritative. It does not re-pick worktree/base/head/stage/source report from the brief.
72
72
 
73
- ## 4. 검증 실행 흐름
73
+ ## 4. Verification execution flow
74
74
 
75
75
  ```mermaid
76
76
  flowchart TD
@@ -90,7 +90,7 @@ flowchart TD
90
90
  SelfReview --> Persist[final report + manifests]
91
91
  ```
92
92
 
93
- 검증 command는 자동 추측하지 않는다. 독립 재검증이 필요하면 command source는 두 tier뿐이다.
93
+ The validation command is never guessed automatically. When independent re-verification is needed, there are only two tiers of command source.
94
94
 
95
95
  ```mermaid
96
96
  flowchart LR
@@ -103,9 +103,9 @@ flowchart LR
103
103
  Deny -->|denied token| Reject[record rejected command<br/>do not execute]
104
104
  ```
105
105
 
106
- `implementation` runtime은 `qaCommands` deny-list를 prepare 단계에서 검증하지만, `final-verification`은 그 fail-fast gate가 없다. profile contract상 lead가 실행 직전에 직접 deny-list를 self-check해야 한다.
106
+ The `implementation` runtime validates the `qaCommands` deny-list at the prepare stage, but `final-verification` has no such fail-fast gate. Per the profile contract, the lead must self-check the deny-list directly right before execution.
107
107
 
108
- ## 5. verdict와 routing
108
+ ## 5. Verdict and routing
109
109
 
110
110
  ```mermaid
111
111
  flowchart TD
@@ -117,15 +117,15 @@ flowchart TD
117
117
  Blockers --> Followup
118
118
  ```
119
119
 
120
- `## 7. Final Verdict`에는 `Verdict Token` field가 정확히 하나 들어가야 하며 값은 다음 셋 중 하나다.
120
+ `## 7. Final Verdict` must contain exactly one `Verdict Token` field, and its value is one of the following three.
121
121
 
122
- - `accepted`: whole-task이면 plain `release-handoff`, single-stage이면 `release-handoff(stage-group)` 후보가 되는 상태
123
- - `conditional-accept`: 조건을 모두 명시해야 하며, 조건이 gate면 다음 phase를 막는다
124
- - `blocked`: acceptance blocker가 있어 release-handoff로 갈 수 없는 상태
122
+ - `accepted`: a state that becomes a candidate for plain `release-handoff` when whole-task, or `release-handoff(stage-group)` when single-stage
123
+ - `conditional-accept`: all conditions must be stated explicitly, and when a condition is a gate it blocks the next phase
124
+ - `blocked`: a state that has acceptance blockers and cannot proceed to release-handoff
125
125
 
126
- 애매한 표현인 "looks good", "mostly ready"는 허용되지 않는다.
126
+ Vague phrasings such as "looks good" or "mostly ready" are not allowed.
127
127
 
128
- ## 6. 산출물
128
+ ## 6. Deliverables
129
129
 
130
130
  ```mermaid
131
131
  flowchart TD
@@ -138,21 +138,21 @@ flowchart TD
138
138
  Report --> Route[routing recommendation]
139
139
  ```
140
140
 
141
- final report에는 최소 다음이 필요하다.
141
+ The final report requires at least the following.
142
142
 
143
143
  - originating implementation final-report path
144
- - verification scope(`whole-task` 또는 `single-stage`)와 injected `VERIFICATION_TARGET`
144
+ - verification scope (`whole-task` or `single-stage`) and the injected `VERIFICATION_TARGET`
145
145
  - inspected worktree path
146
- - implementation base ref와 run start head SHA
146
+ - implementation base ref and run start head SHA
147
147
  - quoted commit list / diff summary
148
148
  - `Verdict Token`
149
- - blocker table 또는 `No acceptance blockers found.`
150
- - residual risk와 escalation trigger
151
- - requirement별 coverage artifact
152
- - read-only command log와 exit code
153
- - 다음 safe phase recommendation
149
+ - blocker table or `No acceptance blockers found.`
150
+ - residual risk and escalation trigger
151
+ - coverage artifact per requirement
152
+ - read-only command log and exit code
153
+ - next safe phase recommendation
154
154
 
155
- ## 7. 금지선
155
+ ## 7. Forbidden actions
156
156
 
157
157
  ```mermaid
158
158
  flowchart TD
@@ -165,9 +165,9 @@ flowchart TD
165
165
  FV -. forbidden .-> Hide[hide verifier dissent]
166
166
  ```
167
167
 
168
- whole-task mode의 stage merge/teardown은 prepare가 수행하는 runtime-owned 통합 단계다. 그 이후 lead 검증은 read-only다. source edit, follow-up fix, scope expansion은 전부 금지다. 결함을 발견하면 현재 run 안에서 고치지 않고 final report에 blocker로 기록한 뒤 새 `error-analysis` 또는 `implementation-planning` 입력으로 넘긴다.
168
+ The stage merge/teardown of whole-task mode is a runtime-owned integration step that prepare performs. After that, lead verification is read-only. Source edit, follow-up fix, and scope expansion are all forbidden. When a defect is found, it is not fixed within the current run; instead it is recorded as a blocker in the final report and handed off as new `error-analysis` or `implementation-planning` input.
169
169
 
170
- ## 8. 확인한 코드
170
+ ## 8. Verified code
171
171
 
172
172
  - [`prompts/profiles/final-verification.md`](../../prompts/profiles/final-verification.md)
173
173
  - [`templates/reports/final-verification-input.template.md`](../../templates/reports/final-verification-input.template.md)
@@ -2,23 +2,23 @@
2
2
 
3
3
  ## Index
4
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-확인한-코드)
5
+ - [1. Purpose](#1-purpose)
6
+ - [2. okstra-run wizard flow](#2-okstra-run-wizard-flow)
7
+ - [3. prepare_task_bundle handling](#3-prepare_task_bundle-handling)
8
+ - [4. lead execution flow](#4-lead-execution-flow)
9
+ - [5. design preparation and final report gate](#5-design-preparation-and-final-report-gate)
10
+ - [6. Forbidden actions](#6-forbidden-actions)
11
+ - [7. Verified code](#7-verified-code)
12
12
 
13
- ## 1. 목적
13
+ ## 1. Purpose
14
14
 
15
- `implementation-planning`은 coding 전에 구현 방향을 정하는 phase다. 최소 두 개의 implementation option, trade-off, recommended option, stepwise execution order, validation checklist, rollback strategy를 만들고 사용자 approval gate를 둔다.
15
+ `implementation-planning` is the phase that decides the implementation direction before coding. It produces at least two implementation options, trade-offs, a recommended option, a stepwise execution order, a validation checklist, and a rollback strategy, and it places a user approval gate.
16
16
 
17
- ## 2. okstra-run wizard 흐름
17
+ ## 2. okstra-run wizard flow
18
18
 
19
19
  ```mermaid
20
20
  flowchart TD
21
- Start[/okstra-run/] --> Common[공통 task identity flow]
21
+ Start[/okstra-run/] --> Common[common task identity flow]
22
22
  Common --> Type[task-type = implementation-planning]
23
23
  Type --> Worktree{active task worktree?}
24
24
  Worktree -->|yes| Defaults[Use defaults / Customize]
@@ -33,9 +33,9 @@ flowchart TD
33
33
  Confirm --> Render[render-bundle]
34
34
  ```
35
35
 
36
- wizard는 현재 `--no-plan-verification`을 묻지 않는다. okstra-run 경로에서는 plan-body verification이 기본 enabled로 준비된다. shell/CLI 경로에는 `--no-plan-verification` flag가 있다.
36
+ The wizard currently does not ask about `--no-plan-verification`. On the okstra-run path, plan-body verification is prepared as enabled by default. The shell/CLI path has a `--no-plan-verification` flag.
37
37
 
38
- ## 3. prepare_task_bundle 처리
38
+ ## 3. prepare_task_bundle handling
39
39
 
40
40
  ```mermaid
41
41
  sequenceDiagram
@@ -55,9 +55,9 @@ sequenceDiagram
55
55
  P-->>W: prepared lead prompt
56
56
  ```
57
57
 
58
- runtime prepare 단계는 source edit를 막는 것이 아니라 "현재 phase boundary를 lead prompt와 manifest에 박아 넣는" 방식이다. 실제 no-edit/no-build 규칙은 lead와 worker가 profile을 읽고 지켜야 한다.
58
+ The runtime prepare stage does not block source edits itself; instead it "bakes the current phase boundary into the lead prompt and manifest." The actual no-edit/no-build rules must be honored by the lead and workers reading the profile.
59
59
 
60
- ## 4. lead 실행 흐름
60
+ ## 4. lead execution flow
61
61
 
62
62
  ```mermaid
63
63
  flowchart TD
@@ -74,37 +74,62 @@ flowchart TD
74
74
  NoApproval --> P7
75
75
  ```
76
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 단위로 다시 검증한다.
77
+ Plan-body verification uses a different queue from Phase 5.5. Phase 5.5 verifies worker findings, and the Phase 6 sub-step re-verifies the consolidated plan body produced by the report-writer at the `P-*` plan-item level.
78
78
 
79
- ## 5. final report gate
79
+ ## 5. design preparation and final report gate
80
+
81
+ The lead deterministically detects domain contract, persistence schema, external interface, transaction/consistency, transformation mapping, lifecycle state machine, rollout/observability, and manual user test surface from the Stage Map. The report-writer does not ask the user starting from blanks; instead it first writes a concrete AI draft for each surface using known facts and evidence.
82
+
83
+ The status of `designPreparation.items[]` does not forcibly pin completeness to a single stage.
84
+
85
+ | Status | Meaning | Handling on implementation entry |
86
+ |---|---|---|
87
+ | `ready` | The implementation contract is sufficiently finalized within the planning snapshot | Proceed with that stage |
88
+ | `provisional` | There is a reversible working assumption and guardrail, so it is safe to proceed now | Proceed with that stage, inject the assumption into the executor prompt, and re-confirm at the designated review point |
89
+ | `blocked` | There is no safe default and it needs an external authorization, business policy, or destructive-change decision | Only the stage in this item's `stageRefs` waits for input or is replanned |
90
+ | `not-applicable` | The surface found by the detector does not require a separate contract in this stage | Record a concrete reason and proceed |
91
+
92
+ If there is no detected surface and no manual test input that changes the interface/acceptance, write `mode: no-design-inputs` with a concrete reason. So there is no need to create a formal empty document for a simple task.
93
+
94
+ `manual-user-test` does not have to fully fix the execution method at planning time. If there is a safe default procedure even before seeing the actual diff, proceed with `provisional` and `ifStillOpen: follow-up`, and the implementation report finally owns the `implementation.manualUserTest` aligned to the actual change. Conversely, use `blocked` only when the stage cannot be safely completed without an acceptance method that only the user can provide.
95
+
96
+ Phase 7 deterministically creates a `design-prep-requests/` document filled with an AI proposal for each `provisional`/`blocked` item. When the user or wizard approves, edits, rejects, or holds the draft, only after confirmation does it append a new revision sidecar under `design-prep-inputs/`. This response does not modify the approved planning report.
97
+
98
+ Plan approval and design-preparation status are independent gates. If plan-body verification passed, the plan itself can be approved even when there is a `blocked` item. The actual `implementation` preflight resolves only the items of the selected stage, and unrelated stages keep proceeding.
80
99
 
81
100
  ```mermaid
82
101
  flowchart LR
83
102
  Options[Option Candidates] --> Matrix[Trade-off Matrix]
84
103
  Matrix --> Rec[Recommended Option]
85
- Rec --> Steps[Stepwise Execution Order]
86
- Steps --> Dep[Dependency / Migration Risk]
104
+ Rec --> Stages[Stage Map + Stage Exit/Validation]
105
+ Stages --> Prep[Implementation Design Preparation]
106
+ Prep --> Dep[Dependency / Migration Risk]
87
107
  Dep --> Val[Validation Checklist]
88
108
  Val --> Rb[Rollback Strategy]
89
109
  Rb --> Verify[Plan Body Verification]
90
- Verify --> Approval[User Approval Request]
110
+ Verify --> Approval[YAML frontmatter approval]
91
111
  Approval --> Impl[Next run: implementation]
92
112
  ```
93
113
 
94
- validator가 section heading의 영문 substring을 찾기 때문에 다음 문자열은 heading line에 그대로 남아야 한다.
114
+ Because the validator searches for the English substring of the section heading, the following strings must remain verbatim on the heading line.
95
115
 
96
116
  - `Option Candidates`
97
117
  - `Trade-off`
98
118
  - `Recommended Option`
99
- - `Stepwise Execution Order`
119
+ - `Stage Map`
120
+ - `Stage Exit Contract`
121
+ - `Stage Validation`
100
122
  - `Dependency`
123
+ - `Cross-Project Dependencies`
124
+ - `Decision Drafts`
101
125
  - `Validation Checklist`
102
126
  - `Rollback`
103
- - `User Approval Request`
127
+ - `Requirement Coverage`
128
+ - `Implementation Design Preparation`
104
129
 
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에서 거부된다.
130
+ Approval is recorded with `approved: true` in the YAML frontmatter and the chosen `implementation-option`. If a `Blocks=approval` clarification row is unresolved, the implementation prepare rejects it even when the frontmatter is in an approved state. The `blocked` status of design-preparation is not the same as `Blocks=approval`, and it operates only at that stage's implementation preflight.
106
131
 
107
- ## 6. 금지선
132
+ ## 6. Forbidden actions
108
133
 
109
134
  ```mermaid
110
135
  flowchart TD
@@ -115,9 +140,9 @@ flowchart TD
115
140
  Plan -. forbidden .-> NextPhase[start implementation in same run]
116
141
  ```
117
142
 
118
- 이 phase는 plan document만 만든다. code-level micro-optimization, source edit, build, migration, deployment, run artifact directory 밖 write는 금지된다.
143
+ This phase only produces the plan document. Code-level micro-optimization, source edit, build, migration, deployment, and any write outside the run artifact directory are forbidden.
119
144
 
120
- ## 7. 확인한 코드
145
+ ## 7. Verified code
121
146
 
122
147
  - [`prompts/profiles/implementation-planning.md`](../../prompts/profiles/implementation-planning.md)
123
148
  - [`templates/reports/implementation-planning-input.template.md`](../../templates/reports/implementation-planning-input.template.md)
@@ -125,4 +150,3 @@ flowchart TD
125
150
  - [`scripts/okstra_ctl/render.py`](../../scripts/okstra_ctl/render.py)
126
151
  - [`validators/validate-run.py`](../../validators/validate-run.py)
127
152
  - [`prompts/lead/okstra-lead-contract.md`](../../prompts/lead/okstra-lead-contract.md)
128
-