@ai-dev-methodologies/rlp-desk 0.5.1 → 0.5.2

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.md CHANGED
@@ -49,8 +49,12 @@ You'll be asked to confirm each item:
49
49
 
50
50
  ### 3. Run
51
51
 
52
- ```
53
- /rlp-desk run calculator
52
+ ```bash
53
+ # Recommended (cross-engine + final consensus):
54
+ /rlp-desk run <slug> --mode tmux --worker-model spark:high --consensus final-only --debug
55
+
56
+ # Claude-only:
57
+ /rlp-desk run <slug> --debug
54
58
  ```
55
59
 
56
60
  The leader loop runs autonomously — spawning workers, verifying results, and tracking progress until completion or a circuit breaker triggers.
@@ -232,28 +236,39 @@ When all US pass individually, the final ALL verify runs **sequentially per-US**
232
236
 
233
237
  ### Run Options
234
238
 
235
- | Flag | Default | Description |
236
- |------|---------|-------------|
237
- | `--max-iter N` | 100 | Maximum iterations before timeout |
238
- | `--mode agent\|tmux` | agent | Execution mode (see below) |
239
- | `--worker-model MODEL` | sonnet | Claude worker model (haiku/sonnet/opus) |
240
- | `--worker-engine claude\|codex` | claude | Worker engine |
241
- | `--verifier-model MODEL` | auto | Auto-selected: +1 tier (same-engine) or cross-engine |
242
- | `--verifier-engine claude\|codex` | auto | Opposite of worker engine if codex available |
243
- | `--codex-model MODEL` | gpt-5.4 | Codex model (spark requires GPT Pro) |
244
- | `--codex-reasoning LEVEL` | medium | low/medium/high/xhigh |
245
- | `--verify-mode per-us\|batch` | per-us | Verification strategy (see below) |
246
- | `--lock-worker-model` | off | Disable progressive model upgrade on failure |
247
- | `--debug` | off | Debug logging to `logs/<slug>/debug.log` |
248
- | `--with-self-verification` | off | Campaign-level post-loop analysis report |
239
+ | Option | Default | Description |
240
+ |--------|---------|-------------|
241
+ | `--mode agent\|tmux` | agent | agent=LLM Leader, tmux=shell Leader |
242
+ | `--worker-model MODEL` | haiku | Worker model. `name`=claude, `name:reasoning`=codex |
243
+ | `--lock-worker-model` | off | Disable auto model upgrade on failure |
244
+ | `--verifier-model MODEL` | sonnet | per-US verification model (lighter) |
245
+ | `--final-verifier-model MODEL` | opus | final ALL verification model (stricter) |
246
+ | `--consensus off\|all\|final-only` | off | Cross-engine consensus scope |
247
+ | `--consensus-model MODEL` | gpt-5.4:medium | per-US cross-verifier (lighter) |
248
+ | `--final-consensus-model MODEL` | gpt-5.4:high | final cross-verifier (stricter) |
249
+ | `--verify-mode per-us\|batch` | per-us | per-us: verify each US → final ALL |
250
+ | `--cb-threshold N` | 6 | Consecutive failures BLOCKED |
251
+ | `--max-iter N` | 100 | Max iterations TIMEOUT |
252
+ | `--iter-timeout N` | 600 | Per-iteration timeout seconds (tmux only) |
253
+ | `--debug` | off | Debug logging |
254
+ | `--with-self-verification` | off | Post-campaign SV report |
255
+
256
+ #### Per-US vs Final Verification
257
+
258
+ RLP Desk runs two distinct verification passes:
259
+
260
+ - **Per-US** (`--verifier-model`, default: sonnet) — runs after each user story completes. Lightweight and fast, catches issues early before later stories build on broken foundations.
261
+ - **Final ALL** (`--final-verifier-model`, default: opus) — runs once after all user stories pass individually. Stricter and more thorough, catches cross-US integration issues and anything per-US missed.
262
+
263
+ When `--consensus` is enabled, a second cross-engine verifier runs alongside each pass: `--consensus-model` for per-US and `--final-consensus-model` for the final ALL gate. Both engines must pass.
249
264
 
250
265
  ### Init Presets
251
266
 
252
267
  After `brainstorm`, `init` detects your environment and presents run command presets:
253
268
 
254
- - **Codex detected** → recommends cross-engine mode (`--worker-model gpt-5.4:high --verify-consensus`)
255
- - **GPT Pro (spark)** → offers spark preset (`--worker-model gpt-5.3-codex-spark:high`)
256
- - **Claude-only** → defaults to `--worker-model sonnet` with opus verifier
269
+ - **Codex detected (GPT Pro / spark)** → recommends cross-engine mode (`--worker-model spark:high --consensus final-only`)
270
+ - **Codex detected (large PRD, AC > 15)** → offers gpt-5.4 preset (`--worker-model gpt-5.4:high --consensus final-only`)
271
+ - **Claude-only** → defaults to `--debug` with haiku worker and opus final verifier
257
272
  - **Basic** → minimal flags for quick iteration
258
273
 
259
274
  The brainstorm phase evaluates complexity (US count, file scope, logic, dependencies, code impact) and recommends a starting model. You can override any recommendation.
@@ -332,9 +347,8 @@ RLP Desk supports two execution engines for Worker and Verifier. **Claude is the
332
347
 
333
348
  ### Claude (default)
334
349
 
335
- ```
350
+ ```bash
336
351
  /rlp-desk run calculator
337
- /rlp-desk run calculator --worker-engine claude --verifier-engine claude
338
352
  ```
339
353
 
340
354
  Uses Claude Code's `Agent()` tool (agent mode) or `claude -p` CLI (tmux mode). Supports dynamic model routing (haiku/sonnet/opus).
@@ -345,17 +359,17 @@ Uses Claude Code's `Agent()` tool (agent mode) or `claude -p` CLI (tmux mode). S
345
359
  # Install codex CLI first
346
360
  npm install -g @openai/codex
347
361
 
348
- # Run with codex worker
349
- /rlp-desk run calculator --worker-engine codex
362
+ # Run with codex worker (spark requires GPT Pro)
363
+ /rlp-desk run calculator --worker-model spark:high
350
364
 
351
365
  # Customize model and reasoning effort
352
- /rlp-desk run calculator --worker-engine codex --codex-model gpt-5.4 --codex-reasoning high
366
+ /rlp-desk run calculator --worker-model gpt-5.4:high
353
367
 
354
- # Mix engines: codex worker, claude verifier
355
- /rlp-desk run calculator --worker-engine codex --verifier-engine claude
368
+ # Cross-engine: codex worker, claude verifier (recommended)
369
+ /rlp-desk run calculator --worker-model spark:high --consensus final-only --debug
356
370
  ```
357
371
 
358
- Uses the `codex` CLI via `Bash()` (agent mode) or as an interactive TUI (tmux mode). The `codex` binary is only required when an engine is set to `codex`.
372
+ The engine is inferred automatically from the `--worker-model` value: a plain model name (e.g. `haiku`) routes to Claude, while `name:reasoning` format (e.g. `spark:high`) routes to Codex. The `codex` binary is only required when a codex model is specified.
359
373
 
360
374
  | Engine | Agent Mode | Tmux Mode | Dynamic Routing |
361
375
  |--------|-----------|-----------|-----------------|
@@ -0,0 +1,253 @@
1
+ # Plan: rlp-desk 옵션 인터페이스 정리 + brainstorm/init 추천 보강
2
+
3
+ ## Context
4
+
5
+ rlp-desk 옵션이 유기적으로 성장하면서 20개+로 늘어남. 중복, 충돌, 미구분 문제 발생:
6
+ - `--worker-engine`, `--worker-codex-model`, `--worker-codex-reasoning`은 `--worker-model`이 이미 통합 처리 (parse_model_flag)
7
+ - consensus 옵션 3중 충돌 (`--verify-consensus`, `--final-consensus`, `--consensus-scope`)
8
+ - per-US Verifier vs Final Verifier 구분 없음
9
+ - brainstorm 모델 추천이 2열(Worker/Verifier)만 있어 per-US/Final 구분 안 됨
10
+ - gpt-5.3-codex 경로가 유저 결정 없이 코드에 존재
11
+ - brainstorm/init에서 정책 기반 추천이 부족 (batch capacity, spark vs gpt-5.4 기준 등)
12
+
13
+ ## 근거 문서
14
+
15
+ | 근거 | 위치 | 핵심 내용 |
16
+ |------|------|----------|
17
+ | 검증 철학 | `memory/feedback_verification_philosophy.md` | 기본값: haiku/sonnet/opus, per-US 가볍게, final 엄격, cross-engine 추천 |
18
+ | CB threshold | `memory/feedback_cb_threshold_six.md` | CB=6 확정, claude 3단계 커버 |
19
+ | 모델 구분 | `memory/feedback_no_assumption.md` | spark=Pro 적극 추천, gpt-5.4=fallback, gpt-5.3-codex 미확정 |
20
+ | Task sizing | `memory/feedback_us_size_limit.md` | Worker comfortable zone 안에 분할 |
21
+ | 현행 옵션 | `src/commands/rlp-desk.md:186-207` | 현재 20개+ 옵션 목록 |
22
+ | parse_model_flag | `src/scripts/lib_ralph_desk.zsh:38-57` | `모델명`=claude, `모델명:추론`=codex 통합 파싱 |
23
+ | get_next_model | `src/scripts/lib_ralph_desk.zsh:81-110` | 엔진별 업그레이드 경로 |
24
+ | check_model_upgrade | `src/scripts/lib_ralph_desk.zsh:116-168` | Worker만 상향, Verifier 고정 |
25
+
26
+ ---
27
+
28
+ ## 최종 옵션 (14개)
29
+
30
+ ### 1. 실행
31
+
32
+ | # | 옵션 | 고정 기본값 | 설명 |
33
+ |---|------|------------|------|
34
+ | 1 | `--mode agent\|tmux` | `agent` | agent=LLM Leader, tmux=shell Leader |
35
+
36
+ ### 2. Worker
37
+
38
+ | # | 옵션 | 고정 기본값 | 포맷 | 설명 |
39
+ |---|------|------------|------|------|
40
+ | 2 | `--worker-model` | `haiku` | `haiku` 또는 `spark:high` | `모델명`=claude, `모델명:추론`=codex. parse_model_flag()가 engine/model/reasoning 자동 분리 |
41
+ | 3 | `--lock-worker-model` | off | flag | 실패 시 자동 모델 업그레이드(check_model_upgrade) 비활성화 |
42
+
43
+ ### 3. Verifier (per-US)
44
+
45
+ | # | 옵션 | 고정 기본값 | 포맷 | 설명 |
46
+ |---|------|------------|------|------|
47
+ | 4 | `--verifier-model` | `sonnet` | `sonnet` 또는 `gpt-5.4:high` | per-US 검증 모델. 캠페인 내내 고정 (progressive upgrade 없음) |
48
+
49
+ ### 4. Verifier (final ALL)
50
+
51
+ | # | 옵션 | 고정 기본값 | 포맷 | 설명 |
52
+ |---|------|------------|------|------|
53
+ | 5 | `--final-verifier-model` | `opus` | `opus` 또는 `gpt-5.4:high` | final ALL 검증 모델. 미지정 시 opus 고정 (per-US와 독립) |
54
+
55
+ ### 5. Consensus
56
+
57
+ | # | 옵션 | 고정 기본값 | 설명 |
58
+ |---|------|------------|------|
59
+ | 6 | `--consensus` | `off` | `off`: 단일 엔진 / `all`: 매 verify 교차 / `final-only`: final ALL에서만 교차 |
60
+ | 7 | `--consensus-model` | `gpt-5.4:medium` | per-US 교차 verifier. 가볍게 |
61
+ | 8 | `--final-consensus-model` | `gpt-5.4:high` | final 교차 verifier. 엄격하게. spark 불가(100k limit) |
62
+
63
+ consensus 동작:
64
+
65
+ | 상황 | 주 verifier | 교차 verifier |
66
+ |------|------------|--------------|
67
+ | per-US, 주=claude | `--verifier-model` (sonnet) | `--consensus-model` (gpt-5.4:medium) |
68
+ | per-US, 주=codex | `--verifier-model` (gpt-5.4:high 등) | claude `opus` 고정 |
69
+ | final, 주=claude | `--final-verifier-model` (opus) | `--final-consensus-model` (gpt-5.4:high) |
70
+ | final, 주=codex | `--final-verifier-model` (gpt-5.4:high 등) | claude `opus` 고정 |
71
+
72
+ - 양쪽 모두 pass해야 통과. 엔진 우선권 없음.
73
+ - spark는 consensus 교차에 사용 불가 (100k output limit).
74
+
75
+ ### 6. 검증 전략
76
+
77
+ | # | 옵션 | 고정 기본값 | 설명 |
78
+ |---|------|------------|------|
79
+ | 9 | `--verify-mode` | `per-us` | `per-us`: US마다 검증→final ALL / `batch`: 전부 후 한번에 |
80
+
81
+ ### 7. 안전장치
82
+
83
+ | # | 옵션 | 고정 기본값 | 설명 |
84
+ |---|------|------------|------|
85
+ | 10 | `--cb-threshold` | `6` | 연속 fail N회 → BLOCKED. consensus 시 자동 ×2 (=12) |
86
+ | 11 | `--max-iter` | `100` | 최대 iteration → TIMEOUT |
87
+ | 12 | `--iter-timeout` | `600` | iteration당 timeout 초 (tmux만 적용) |
88
+
89
+ ### 8. 로깅/분석
90
+
91
+ | # | 옵션 | 고정 기본값 | 설명 |
92
+ |---|------|------------|------|
93
+ | 13 | `--debug` | off | `~/.claude/ralph-desk/analytics/<slug>/debug.log` |
94
+ | 14 | `--with-self-verification` | off | campaign 후 SV 리포트 → 다음 brainstorm 피드백(§8½) |
95
+
96
+ ---
97
+
98
+ ## 제거 옵션 (내부 구현으로 숨김)
99
+
100
+ | 제거 옵션 | 대체 방법 |
101
+ |-----------|----------|
102
+ | `--worker-engine` | `--worker-model` 포맷에서 자동 추론 |
103
+ | `--worker-codex-model` | `--worker-model spark:high`에 포함 |
104
+ | `--worker-codex-reasoning` | `--worker-model spark:high`에 포함 |
105
+ | `--verifier-engine` | `--verifier-model` 포맷에서 자동 추론 |
106
+ | `--verifier-codex-model` | `--verifier-model`에 포함 |
107
+ | `--verifier-codex-reasoning` | `--verifier-model`에 포함 |
108
+ | `--verify-consensus` | `--consensus all` |
109
+ | `--final-consensus` | `--consensus final-only` |
110
+ | `--consensus-scope` | `--consensus`에 통합 |
111
+ | `--consensus-fail-fast` | 제거 (복잡도 대비 가치 낮음) |
112
+
113
+ 내부적으로 env var (`WORKER_ENGINE`, `WORKER_CODEX_MODEL` 등)는 유지 — `parse_model_flag()`가 `--worker-model`에서 분리하여 설정.
114
+
115
+ ---
116
+
117
+ ## Brainstorm 모델 추천 구조 (신규)
118
+
119
+ ### Claude-only (codex 미설치)
120
+
121
+ | 복잡도 | Worker | per-US Verifier | Final Verifier | Consensus |
122
+ |--------|--------|----------------|----------------|-----------|
123
+ | LOW | haiku | sonnet | opus | off |
124
+ | MEDIUM | sonnet | opus | opus | off |
125
+ | HIGH | opus | opus | opus | off |
126
+ | CRITICAL | opus | opus | opus + human | off |
127
+
128
+ ### Cross-engine (codex 설치, ★ 추천)
129
+
130
+ | 복잡도 | Worker | per-US Verifier | Final Verifier | Consensus |
131
+ |--------|--------|----------------|----------------|-----------|
132
+ | LOW | spark:high | sonnet | opus | final-only |
133
+ | MEDIUM | spark:high | opus | opus | final-only |
134
+ | HIGH | gpt-5.4:high | opus | opus | all |
135
+ | CRITICAL | gpt-5.4:high | opus | opus + human | all |
136
+
137
+ Worker 모델 선택 기준:
138
+ - **spark:high** — 기본 추천. Pro 토큰풀 분리 = 비용 절감. PRD AC ≤ 15개
139
+ - **gpt-5.4:high** — spark 100k output limit 초과 시 fallback. PRD AC > 15개
140
+
141
+ ### Brainstorm 추천 예시 (codex 있을 때)
142
+
143
+ ```
144
+ ★ 추천: cross-engine + final-consensus
145
+ /rlp-desk run <slug> --mode tmux --worker-model spark:high --consensus final-only --debug
146
+
147
+ 대규모 PRD (spark 100k 초과):
148
+ /rlp-desk run <slug> --mode tmux --worker-model gpt-5.4:high --consensus final-only --debug
149
+
150
+ 극도로 중요 (전체 consensus):
151
+ /rlp-desk run <slug> --mode tmux --worker-model gpt-5.4:high --consensus all --debug
152
+
153
+ claude-only:
154
+ /rlp-desk run <slug> --debug
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Batch Capacity Check (신규)
160
+
161
+ brainstorm에서 batch 모드 + 대규모 PRD 감지 시 자동 경고:
162
+
163
+ | 조건 | 경고 | 제안 |
164
+ |------|------|------|
165
+ | batch + spark + AC > 10 | "spark 100k output limit 주의" | wave split 또는 gpt-5.4 전환 |
166
+ | batch + gpt-5.4 + AC > 15 | "단일 batch에 AC 과다" | wave split (US 3-4개씩 묶음) |
167
+ | per-us + 어떤 모델이든 | 경고 없음 | US별 처리라 limit 문제 없음 |
168
+
169
+ ---
170
+
171
+ ## 확정 사항
172
+
173
+ 1. **교차 verifier claude 기본값**: `opus` 확정 (주 verifier가 codex일 때)
174
+ 2. **gpt-5.3-codex 경로**: get_next_model()에서 **제거** 확정 (spark + gpt-5.4만 유지)
175
+ 3. **`--verifier-model` 기본값**: `sonnet` (per-US 가볍게, feedback_verification_philosophy.md)
176
+ 4. **`--consensus-model` 기본값**: `gpt-5.4:medium` (per-US 교차, 가볍게)
177
+ 5. **`--final-consensus-model` 기본값**: `gpt-5.4:high` (final 교차, 엄격하게)
178
+ 6. **교차 claude** (주 verifier가 codex일 때): `opus` 고정
179
+
180
+ ---
181
+
182
+ ## Brainstorm/Init 추천 흐름 (보강)
183
+
184
+ brainstorm 단계 7~8번을 아래로 교체:
185
+
186
+ ### brainstorm step 7: 모델 추천
187
+
188
+ 1. 복잡도 평가 (5-factor table, 현행 유지)
189
+ 2. codex 설치 여부 확인 (`command -v codex`)
190
+ 3. **4열 추천 테이블 제시** (Worker / per-US Verifier / Final Verifier / Consensus)
191
+ 4. spark vs gpt-5.4 판단: AC 총 개수 세어서
192
+ - AC ≤ 15 → spark:high 추천 ("Pro 토큰풀 분리, 비용 절감")
193
+ - AC > 15 → gpt-5.4:high 추천 ("spark 100k output limit 초과")
194
+ 5. verify-mode가 batch이면 batch capacity check 실행 (아래 참조)
195
+
196
+ ### brainstorm step 8 (init 후 명령어 제시): 추천 순서
197
+
198
+ codex 있을 때:
199
+ ```
200
+ ★ 추천: cross-engine + final-consensus (비용 절감 + blind-spot 커버)
201
+ /rlp-desk run <slug> --mode tmux --worker-model spark:high --consensus final-only --debug
202
+
203
+ 대규모 PRD (AC > 15, spark limit 초과):
204
+ /rlp-desk run <slug> --mode tmux --worker-model gpt-5.4:high --consensus final-only --debug
205
+
206
+ 극도로 중요 (매 US 교차검증):
207
+ /rlp-desk run <slug> --mode tmux --worker-model gpt-5.4:high --consensus all --debug
208
+
209
+ claude-only (교차검증 없음):
210
+ /rlp-desk run <slug> --debug
211
+ ```
212
+
213
+ codex 없을 때:
214
+ ```
215
+ ★ 추천:
216
+ /rlp-desk run <slug> --mode tmux --debug
217
+
218
+ ⚠️ codex 미설치 — 같은 엔진은 같은 blind spot을 공유합니다.
219
+ cross-engine 교차검증: npm install -g @openai/codex
220
+ ```
221
+
222
+ ### init 후 옵션 설명
223
+
224
+ init 완료 후 명령어 제시 시 아래 설명 포함:
225
+
226
+ ```
227
+ 옵션 설명:
228
+ --worker-model Worker 모델 (haiku|sonnet|opus 또는 spark:high|gpt-5.4:high)
229
+ --verifier-model per-US 검증 모델 (기본: sonnet, 가볍게)
230
+ --final-verifier-model final ALL 검증 모델 (기본: opus, 엄격하게)
231
+ --consensus 교차검증 (off|all|final-only)
232
+ --consensus-model per-US 교차 모델 (기본: gpt-5.4:medium)
233
+ --final-consensus-model final 교차 모델 (기본: gpt-5.4:high)
234
+ ```
235
+
236
+ ---
237
+
238
+ ## 변경 대상 파일
239
+
240
+ | 파일 | 변경 내용 |
241
+ |------|----------|
242
+ | `src/commands/rlp-desk.md` | 옵션 14개로 정리, brainstorm 추천 4열 테이블, batch capacity check, init 추천 예시 보강 |
243
+ | `src/governance.md` | consensus 섹션 정리, `--final-verifier-model` + `--final-consensus-model` 문서화, §7b 교차검증 테이블 |
244
+ | `src/scripts/run_ralph_desk.zsh` | `--consensus` 통합 플래그, `--final-verifier-model`, `--final-consensus-model` 파싱, deprecated 옵션 경고 |
245
+ | `src/scripts/lib_ralph_desk.zsh` | gpt-5.3-codex 경로 제거 (spark + gpt-5.4만 유지) |
246
+ | `README.md` | 옵션 레퍼런스 테이블 14개로 갱신, 추천 예시, per-US/final 구분 설명 |
247
+
248
+ ## 검증
249
+
250
+ 1. 기존 테스트 regression: `bash tests/test_cb_and_analytics.sh && bash tests/test_us004_progressive_upgrade.sh && bash tests/test_v052_improvements.sh`
251
+ 2. 신규 테스트: `tests/test_option_cleanup.sh` — 옵션 파싱, 기본값, deprecated 경고
252
+ 3. `zsh -n` syntax check
253
+ 4. Self-verification 3 scenarios (CLAUDE.md gate)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-dev-methodologies/rlp-desk",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Fresh-context iterative loops for Claude Code — autonomous task completion with independent verification",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/postinstall.js",