@ai-dev-methodologies/rlp-desk 0.8.0 → 0.9.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.
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
# Plan: Worker Planning, Preset Sync, Brainstorm Exploration, Memory Bridge & Coding Principles
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
rlp-desk의 Worker/Verifier 프롬프트와 brainstorm/init 흐름에 5가지 개선을 적용한다.
|
|
6
|
+
기존 iron law 정책 체계의 후속 업데이트로, 검증된 패턴을 Worker/Verifier fresh context에 내장한다.
|
|
7
|
+
|
|
8
|
+
**문제:**
|
|
9
|
+
1. `print_run_presets()`가 rlp-desk.md 옵션 인터페이스와 desync (stale 플래그, 틀린 기본값)
|
|
10
|
+
2. Worker가 파일 읽자마자 바로 TDD로 넘어감 (계획 단계 없음)
|
|
11
|
+
3. Brainstorm이 코드 안 보고 US 제안
|
|
12
|
+
4. Brainstorm 결과가 campaign memory에 안 남음 (첫 Worker가 재발견)
|
|
13
|
+
5. Worker/Verifier가 코딩 원칙 가이드라인 없이 작동 (글로벌 CLAUDE.md 의존 불가)
|
|
14
|
+
|
|
15
|
+
**브랜치:** `improve/worker-planning-and-preset-sync`
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Changes
|
|
20
|
+
|
|
21
|
+
### Change 1: Fix Run Preset Desync
|
|
22
|
+
**File:** `src/scripts/init_ralph_desk.zsh` lines 197-238
|
|
23
|
+
|
|
24
|
+
Rewrite `print_run_presets()` to match `src/commands/rlp-desk.md` lines 142-200.
|
|
25
|
+
|
|
26
|
+
**Desync table:**
|
|
27
|
+
|
|
28
|
+
| current (init_ralph_desk.zsh) | canonical (rlp-desk.md) |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `--final-consensus` (line 207) | `--consensus final-only` |
|
|
31
|
+
| `gpt-5.3-codex-spark:high` (line 210) | `spark:high` |
|
|
32
|
+
| `--verify-consensus` (line 232) | `--consensus off\|all\|final-only` |
|
|
33
|
+
| worker default `sonnet` (line 230) | `haiku` |
|
|
34
|
+
| verifier default `opus` (line 231) | per-US `sonnet`, final `opus` |
|
|
35
|
+
| Missing `--mode tmux` in recommended | Present |
|
|
36
|
+
| Missing 6 options | `--lock-worker-model`, `--consensus-model`, `--final-consensus-model`, `--cb-threshold`, `--iter-timeout`, `--final-verifier-model` |
|
|
37
|
+
|
|
38
|
+
**Action:** Replace lines 197-238 with function that mirrors rlp-desk.md lines 142-200.
|
|
39
|
+
|
|
40
|
+
### Change 2: Add Worker Planning Step
|
|
41
|
+
**Files:**
|
|
42
|
+
- `src/scripts/init_ralph_desk.zsh` Worker prompt — insert between line 316 and line 318
|
|
43
|
+
- `src/governance.md` line 217 — add `plan` to step types
|
|
44
|
+
- `src/scripts/init_ralph_desk.zsh` Verifier prompt — add audit after line 478
|
|
45
|
+
|
|
46
|
+
**Insert after line 316 ("Execute the plan for $SLUG."), before line 318 ("## Before you start"):**
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
## Planning (before writing any code)
|
|
50
|
+
After reading all files, BEFORE writing any test or code:
|
|
51
|
+
1. List the specific files you will create or modify
|
|
52
|
+
2. For each AC in the contract, state your approach in 1 sentence
|
|
53
|
+
3. Identify ordering constraints (which AC depends on which)
|
|
54
|
+
4. Record as first execution_step: {"step": "plan", "ac_id": "all", "command": null, "exit_code": null, "summary": "Plan: [files], [approach], [order]"}
|
|
55
|
+
Keep planning lightweight — 1-2 sentences per AC, not a detailed analysis.
|
|
56
|
+
If the plan reveals the contract is unclear or infeasible, signal "blocked" immediately.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**governance.md line 217:** Change from:
|
|
60
|
+
```
|
|
61
|
+
- Step types: `write_test`, `verify_red`, `implement`, `verify_green`, `refactor`, `commit`, `verify`, `verify_existing`
|
|
62
|
+
```
|
|
63
|
+
to:
|
|
64
|
+
```
|
|
65
|
+
- Step types: `plan`, `write_test`, `verify_red`, `implement`, `verify_green`, `refactor`, `commit`, `verify`, `verify_existing`
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Verifier prompt after line 478 (Worker Process Audit):** Add:
|
|
69
|
+
```
|
|
70
|
+
- Planning step presence: done-claim execution_steps should include a `plan` step as the first entry. If missing, record in reasoning as {"check": "Planning Step", "decision": "info", "basis": "plan step present/absent"} — informational only (does not affect pass/fail verdict)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Change 3: Brainstorm Exploration Phase
|
|
74
|
+
**File:** `src/commands/rlp-desk.md` — insert between line 25 and line 26
|
|
75
|
+
|
|
76
|
+
**Insert after line 25 ("2. **Objective**") and before line 26 ("3. **User Stories**"):**
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
2.5. **Codebase Exploration** — Before proposing user stories, examine the project:
|
|
80
|
+
- Read the project's entry points, key modules, and test structure
|
|
81
|
+
- Identify architectural patterns in use (frameworks, conventions, test setup)
|
|
82
|
+
- Note constraints the Worker will encounter (dependencies, build system, existing code style)
|
|
83
|
+
- Present findings: "I explored the codebase and found: [patterns], [constraints], [existing tests]. This informs the US breakdown below."
|
|
84
|
+
- If the project is new/empty, skip this step and note "greenfield project."
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Change 4: Memory Bridge
|
|
88
|
+
**Files:**
|
|
89
|
+
- `src/commands/rlp-desk.md` line 131
|
|
90
|
+
- `src/scripts/init_ralph_desk.zsh` lines 578-580 (campaign memory template)
|
|
91
|
+
- `src/scripts/init_ralph_desk.zsh` line 355 area (Worker prompt iteration rules)
|
|
92
|
+
|
|
93
|
+
**rlp-desk.md line 131:** Change from:
|
|
94
|
+
```
|
|
95
|
+
If brainstorm was done, auto-fill PRD and test-spec with the results.
|
|
96
|
+
```
|
|
97
|
+
to:
|
|
98
|
+
```
|
|
99
|
+
If brainstorm was done, auto-fill:
|
|
100
|
+
- PRD and test-spec with the brainstorm results
|
|
101
|
+
- Campaign memory "Key Decisions" with architectural decisions from brainstorm
|
|
102
|
+
- Campaign memory "Patterns Discovered" with codebase exploration findings (from step 2.5)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**init_ralph_desk.zsh lines 578-580:** Change from:
|
|
106
|
+
```
|
|
107
|
+
## Key Decisions
|
|
108
|
+
|
|
109
|
+
## Patterns Discovered
|
|
110
|
+
```
|
|
111
|
+
to:
|
|
112
|
+
```
|
|
113
|
+
## Key Decisions
|
|
114
|
+
(seeded from brainstorm — do not erase, only append)
|
|
115
|
+
|
|
116
|
+
## Patterns Discovered
|
|
117
|
+
(seeded from brainstorm codebase exploration — do not erase, only append)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**init_ralph_desk.zsh Worker prompt, after line 355 ("- Rewrite campaign memory in full."):** Add:
|
|
121
|
+
```
|
|
122
|
+
- When rewriting campaign memory, PRESERVE the Key Decisions and Patterns Discovered sections from prior iterations — append new entries, do not erase existing ones.
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Change 5: Coding Principles (Karpathy Guidelines)
|
|
126
|
+
**Files:**
|
|
127
|
+
- `src/scripts/init_ralph_desk.zsh` Worker prompt — insert after line 316, before Change 2's Planning section
|
|
128
|
+
- `src/scripts/init_ralph_desk.zsh` Verifier prompt — insert after line 429
|
|
129
|
+
|
|
130
|
+
**Worker prompt — insert after line 316 ("Execute the plan for $SLUG."), as first section:**
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
## Coding Principles (applies to ALL work in this iteration)
|
|
134
|
+
|
|
135
|
+
1. Think Before Coding
|
|
136
|
+
Don't assume. Don't hide confusion. Surface tradeoffs.
|
|
137
|
+
- State assumptions explicitly. If uncertain, signal blocked with your options
|
|
138
|
+
listed — do not guess.
|
|
139
|
+
- If multiple interpretations exist, present them in blocked signal — do not
|
|
140
|
+
pick silently.
|
|
141
|
+
- If a simpler approach exists, note it in your plan.
|
|
142
|
+
- If something important is unclear, stop and name what is confusing.
|
|
143
|
+
|
|
144
|
+
2. Simplicity First
|
|
145
|
+
Minimum code that solves the problem. Nothing speculative.
|
|
146
|
+
- No features beyond what was asked.
|
|
147
|
+
- No abstractions for single-use code.
|
|
148
|
+
- No configurability that was not specified.
|
|
149
|
+
- No defensive handling for implausible scenarios unless the context requires it.
|
|
150
|
+
- If 200 lines could be 50, rewrite it.
|
|
151
|
+
Ask: "Would a strong senior engineer call this overcomplicated?" If yes, simplify.
|
|
152
|
+
|
|
153
|
+
3. Surgical Changes
|
|
154
|
+
Touch only what you must. Clean up only your own mess.
|
|
155
|
+
- Do not improve adjacent code, comments, or formatting unless required by the task.
|
|
156
|
+
- Do not refactor unrelated code.
|
|
157
|
+
- Match the local style unless there is a compelling reason not to.
|
|
158
|
+
- If unrelated dead code is noticed, mention it in done-claim — do not delete it.
|
|
159
|
+
- Remove imports, variables, or functions that YOUR changes made unused.
|
|
160
|
+
- Do not remove pre-existing dead code.
|
|
161
|
+
Test: every changed line should trace directly to the contract.
|
|
162
|
+
|
|
163
|
+
4. Goal-Driven Execution
|
|
164
|
+
Define success criteria. Loop until verified.
|
|
165
|
+
These principles are enforced by the TDD Mandate and Planning step below.
|
|
166
|
+
If success criteria for any AC are unclear, signal blocked.
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Verifier prompt — insert after line 429 ("Independent verifier for Ralph Desk: $SLUG"), before line 431 ("## Iron Law"):**
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
## Verification Principles
|
|
173
|
+
|
|
174
|
+
1. Think Before Judging
|
|
175
|
+
Don't assume. Don't default to PASS or FAIL without evidence.
|
|
176
|
+
- State your assumptions about what PASS looks like for each AC before
|
|
177
|
+
checking evidence.
|
|
178
|
+
- If evidence is ambiguous or incomplete, say what is unclear and why —
|
|
179
|
+
do not default to either verdict.
|
|
180
|
+
- If multiple interpretations of an AC exist, flag it as a spec issue.
|
|
181
|
+
|
|
182
|
+
2. Goal-Driven Verification
|
|
183
|
+
Define the specific evidence required for PASS before you start checking.
|
|
184
|
+
- For each AC, state: "PASS requires [specific evidence]."
|
|
185
|
+
- Verify against that criteria, not against a general impression of code quality.
|
|
186
|
+
- If success criteria are unclear, note it in reasoning — do not invent criteria.
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Implementation Sequence
|
|
192
|
+
|
|
193
|
+
| Wave | Changes | Files | Risk |
|
|
194
|
+
|------|---------|-------|------|
|
|
195
|
+
| 1 | Change 1 (run preset desync) | init_ralph_desk.zsh | LOW |
|
|
196
|
+
| 2 | Change 5 (coding principles) | init_ralph_desk.zsh | LOW |
|
|
197
|
+
| 2 | Change 2 (planning step) | init_ralph_desk.zsh + governance.md | LOW-MED |
|
|
198
|
+
| 3 | Change 3 (brainstorm exploration) | rlp-desk.md | LOW |
|
|
199
|
+
| 3 | Change 4 (memory bridge) | rlp-desk.md + init_ralph_desk.zsh | MEDIUM |
|
|
200
|
+
|
|
201
|
+
**Order rationale:**
|
|
202
|
+
- Wave 1: Standalone bugfix, no dependencies
|
|
203
|
+
- Wave 2: Coding Principles first (top of prompt), then Planning step (uses principles). Both in init_ralph_desk.zsh Worker prompt.
|
|
204
|
+
- Wave 3: rlp-desk.md changes. Change 4 depends on Change 3 (exploration produces findings that get seeded).
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## TDD Verification Plan
|
|
209
|
+
|
|
210
|
+
Each change has tests written FIRST, verified to fail, then implementation, then re-verify.
|
|
211
|
+
|
|
212
|
+
### Test Script: `tests/test_template_generation.sh`
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
#!/bin/bash
|
|
216
|
+
# TDD tests for template generation changes
|
|
217
|
+
# Run: bash tests/test_template_generation.sh
|
|
218
|
+
set -euo pipefail
|
|
219
|
+
|
|
220
|
+
SCRIPT="src/scripts/init_ralph_desk.zsh"
|
|
221
|
+
CMD="src/commands/rlp-desk.md"
|
|
222
|
+
GOV="src/governance.md"
|
|
223
|
+
PASS=0; FAIL=0; TOTAL=0
|
|
224
|
+
|
|
225
|
+
assert_contains() {
|
|
226
|
+
local file="$1" pattern="$2" label="$3"
|
|
227
|
+
TOTAL=$((TOTAL+1))
|
|
228
|
+
if grep -q "$pattern" "$file" 2>/dev/null; then
|
|
229
|
+
echo " PASS: $label"; PASS=$((PASS+1))
|
|
230
|
+
else
|
|
231
|
+
echo " FAIL: $label (pattern not found: $pattern)"; FAIL=$((FAIL+1))
|
|
232
|
+
fi
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
assert_not_contains() {
|
|
236
|
+
local file="$1" pattern="$2" label="$3"
|
|
237
|
+
TOTAL=$((TOTAL+1))
|
|
238
|
+
if grep -q "$pattern" "$file" 2>/dev/null; then
|
|
239
|
+
echo " FAIL: $label (stale pattern still present: $pattern)"; FAIL=$((FAIL+1))
|
|
240
|
+
else
|
|
241
|
+
echo " PASS: $label"; PASS=$((PASS+1))
|
|
242
|
+
fi
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
echo "=== Change 1: Run Preset Desync ==="
|
|
246
|
+
assert_not_contains "$SCRIPT" "\-\-final-consensus" "C1: no --final-consensus"
|
|
247
|
+
assert_not_contains "$SCRIPT" "gpt-5.3-codex-spark" "C1: no gpt-5.3-codex-spark"
|
|
248
|
+
assert_not_contains "$SCRIPT" "\-\-verify-consensus" "C1: no --verify-consensus"
|
|
249
|
+
assert_contains "$SCRIPT" "\-\-consensus final-only" "C1: --consensus final-only present"
|
|
250
|
+
assert_contains "$SCRIPT" "spark:high" "C1: spark:high present"
|
|
251
|
+
assert_contains "$SCRIPT" "default: haiku" "C1: worker default haiku"
|
|
252
|
+
assert_contains "$SCRIPT" "\-\-lock-worker-model" "C1: --lock-worker-model in options"
|
|
253
|
+
assert_contains "$SCRIPT" "\-\-cb-threshold" "C1: --cb-threshold in options"
|
|
254
|
+
assert_contains "$SCRIPT" "\-\-iter-timeout" "C1: --iter-timeout in options"
|
|
255
|
+
assert_contains "$SCRIPT" "\-\-consensus-model" "C1: --consensus-model in options"
|
|
256
|
+
assert_contains "$SCRIPT" "\-\-mode tmux" "C1: --mode tmux in recommended"
|
|
257
|
+
|
|
258
|
+
echo ""
|
|
259
|
+
echo "=== Change 2: Worker Planning Step ==="
|
|
260
|
+
assert_contains "$SCRIPT" "## Planning" "C2: Planning section in Worker prompt"
|
|
261
|
+
assert_contains "$SCRIPT" "step.*plan.*ac_id.*all" "C2: plan execution_step format"
|
|
262
|
+
assert_contains "$SCRIPT" "Keep planning lightweight" "C2: lightweight constraint"
|
|
263
|
+
assert_contains "$GOV" "plan.*write_test.*verify_red" "C2: plan in §1f step types"
|
|
264
|
+
assert_contains "$SCRIPT" "Planning Step.*decision.*info" "C2: Verifier plan audit"
|
|
265
|
+
|
|
266
|
+
echo ""
|
|
267
|
+
echo "=== Change 3: Brainstorm Exploration ==="
|
|
268
|
+
assert_contains "$CMD" "Codebase Exploration" "C3: exploration step present"
|
|
269
|
+
assert_contains "$CMD" "greenfield project" "C3: greenfield skip path"
|
|
270
|
+
assert_contains "$CMD" "entry points.*key modules" "C3: exploration instructions"
|
|
271
|
+
|
|
272
|
+
echo ""
|
|
273
|
+
echo "=== Change 4: Memory Bridge ==="
|
|
274
|
+
assert_contains "$CMD" "Campaign memory.*Key Decisions" "C4: init seeds memory instruction"
|
|
275
|
+
assert_contains "$SCRIPT" "seeded from brainstorm" "C4: seed markers in template"
|
|
276
|
+
assert_contains "$SCRIPT" "PRESERVE the Key Decisions" "C4: Worker preservation instruction"
|
|
277
|
+
|
|
278
|
+
echo ""
|
|
279
|
+
echo "=== Change 5: Coding Principles ==="
|
|
280
|
+
assert_contains "$SCRIPT" "## Coding Principles" "C5: Worker coding principles section"
|
|
281
|
+
assert_contains "$SCRIPT" "Think Before Coding" "C5: principle 1 in Worker"
|
|
282
|
+
assert_contains "$SCRIPT" "Simplicity First" "C5: principle 2 in Worker"
|
|
283
|
+
assert_contains "$SCRIPT" "Surgical Changes" "C5: principle 3 in Worker"
|
|
284
|
+
assert_contains "$SCRIPT" "Goal-Driven Execution" "C5: principle 4 in Worker"
|
|
285
|
+
assert_contains "$SCRIPT" "## Verification Principles" "C5: Verifier principles section"
|
|
286
|
+
assert_contains "$SCRIPT" "Think Before Judging" "C5: Verifier principle 1"
|
|
287
|
+
assert_contains "$SCRIPT" "Goal-Driven Verification" "C5: Verifier principle 2"
|
|
288
|
+
|
|
289
|
+
echo ""
|
|
290
|
+
echo "=== RESULTS ==="
|
|
291
|
+
echo "PASS: $PASS / $TOTAL"
|
|
292
|
+
echo "FAIL: $FAIL / $TOTAL"
|
|
293
|
+
[ $FAIL -eq 0 ] && echo "ALL TESTS PASSED" || echo "SOME TESTS FAILED"
|
|
294
|
+
exit $FAIL
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### TDD Flow Per Wave
|
|
298
|
+
|
|
299
|
+
**Wave 1 (Change 1):**
|
|
300
|
+
1. Write test → run → expect 11 FAIL (stale patterns present, new patterns absent)
|
|
301
|
+
2. Implement Change 1
|
|
302
|
+
3. Run test → expect 11 PASS
|
|
303
|
+
4. `bash -n src/scripts/init_ralph_desk.zsh` (syntax check)
|
|
304
|
+
|
|
305
|
+
**Wave 2 (Changes 5, 2):**
|
|
306
|
+
1. Run test → expect Change 5 (7 tests) + Change 2 (5 tests) = 12 FAIL
|
|
307
|
+
2. Implement Change 5 (Worker + Verifier principles)
|
|
308
|
+
3. Run test → expect Change 5 PASS, Change 2 still FAIL
|
|
309
|
+
4. Implement Change 2 (Planning step + governance + Verifier audit)
|
|
310
|
+
5. Run test → expect all PASS
|
|
311
|
+
6. `bash -n src/scripts/init_ralph_desk.zsh` (syntax check)
|
|
312
|
+
|
|
313
|
+
**Wave 3 (Changes 3, 4):**
|
|
314
|
+
1. Run test → expect Change 3 (3 tests) + Change 4 (3 tests) = 6 FAIL
|
|
315
|
+
2. Implement Change 3 (brainstorm exploration)
|
|
316
|
+
3. Run test → expect Change 3 PASS, Change 4 still FAIL
|
|
317
|
+
4. Implement Change 4 (memory bridge — rlp-desk.md + init)
|
|
318
|
+
5. Run test → expect all PASS
|
|
319
|
+
|
|
320
|
+
### Artifact-Based End-to-End Verification
|
|
321
|
+
|
|
322
|
+
After all waves, run init on a test slug and verify generated artifacts:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
# E2E: generate artifacts and verify
|
|
326
|
+
TEST_SLUG="test-karpathy-e2e"
|
|
327
|
+
TEST_DIR=$(mktemp -d)
|
|
328
|
+
cd "$TEST_DIR" && git init && mkdir -p .claude/ralph-desk
|
|
329
|
+
|
|
330
|
+
bash /path/to/src/scripts/init_ralph_desk.zsh "$TEST_SLUG" "test objective"
|
|
331
|
+
|
|
332
|
+
# Check Worker prompt
|
|
333
|
+
grep -q "## Coding Principles" .claude/ralph-desk/prompts/$TEST_SLUG.worker.prompt.md
|
|
334
|
+
grep -q "## Planning" .claude/ralph-desk/prompts/$TEST_SLUG.worker.prompt.md
|
|
335
|
+
grep -q "Think Before Coding" .claude/ralph-desk/prompts/$TEST_SLUG.worker.prompt.md
|
|
336
|
+
grep -q "PRESERVE the Key Decisions" .claude/ralph-desk/prompts/$TEST_SLUG.worker.prompt.md
|
|
337
|
+
|
|
338
|
+
# Check Verifier prompt
|
|
339
|
+
grep -q "## Verification Principles" .claude/ralph-desk/prompts/$TEST_SLUG.verifier.prompt.md
|
|
340
|
+
grep -q "Think Before Judging" .claude/ralph-desk/prompts/$TEST_SLUG.verifier.prompt.md
|
|
341
|
+
|
|
342
|
+
# Check campaign memory
|
|
343
|
+
grep -q "seeded from brainstorm" .claude/ralph-desk/memos/$TEST_SLUG-memory.md
|
|
344
|
+
|
|
345
|
+
# Check run presets (capture init output)
|
|
346
|
+
# ... verify --consensus, spark:high, haiku defaults appear
|
|
347
|
+
|
|
348
|
+
rm -rf "$TEST_DIR"
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Self-Verification Gate (CLAUDE.md mandatory)
|
|
354
|
+
|
|
355
|
+
3 scenarios required because `governance.md`, `rlp-desk.md`, `init_ralph_desk.zsh` all change.
|
|
356
|
+
|
|
357
|
+
**Scenario 1: LOW risk — greenfield campaign, brainstorm skipped**
|
|
358
|
+
- Init with test slug, no brainstorm
|
|
359
|
+
- Verify: Worker prompt has Coding Principles + Planning section, run presets correct, campaign memory has default template (seed markers present but empty), Verifier has Verification Principles
|
|
360
|
+
- Layers: L1 (grep tests) + L3 (E2E artifact check)
|
|
361
|
+
|
|
362
|
+
**Scenario 2: MEDIUM risk — full brainstorm flow**
|
|
363
|
+
- Brainstorm + init with codex installed
|
|
364
|
+
- Verify: exploration step in brainstorm, init seeds memory, Worker preserves seeds, run presets show cross-engine commands, Verifier audits plan step
|
|
365
|
+
- Layers: L1 + L2 (real integration) + L3
|
|
366
|
+
|
|
367
|
+
**Scenario 3: CRITICAL risk — governance change verification**
|
|
368
|
+
- Verify governance §1f has `plan` in step types
|
|
369
|
+
- Simulate: Worker without plan step → Verifier records `info` (not fail)
|
|
370
|
+
- Simulate: Worker erases Key Decisions → next Worker loses context
|
|
371
|
+
- Layers: L1 + L2 + L3 + governance compliance
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Post-Commit Checklist
|
|
376
|
+
|
|
377
|
+
1. Local file sync (ALL distributable files):
|
|
378
|
+
```bash
|
|
379
|
+
cp src/commands/rlp-desk.md ~/.claude/commands/rlp-desk.md
|
|
380
|
+
cp src/governance.md ~/.claude/ralph-desk/governance.md
|
|
381
|
+
cp src/scripts/init_ralph_desk.zsh ~/.claude/ralph-desk/init_ralph_desk.zsh
|
|
382
|
+
cp src/scripts/run_ralph_desk.zsh ~/.claude/ralph-desk/run_ralph_desk.zsh
|
|
383
|
+
cp src/scripts/lib_ralph_desk.zsh ~/.claude/ralph-desk/lib_ralph_desk.zsh
|
|
384
|
+
cp README.md ~/.claude/ralph-desk/README.md
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
2. Verify sync:
|
|
388
|
+
```bash
|
|
389
|
+
diff -q src/commands/rlp-desk.md ~/.claude/commands/rlp-desk.md
|
|
390
|
+
diff -q src/governance.md ~/.claude/ralph-desk/governance.md
|
|
391
|
+
diff -q src/scripts/init_ralph_desk.zsh ~/.claude/ralph-desk/init_ralph_desk.zsh
|
|
392
|
+
diff -q src/scripts/run_ralph_desk.zsh ~/.claude/ralph-desk/run_ralph_desk.zsh
|
|
393
|
+
diff -q src/scripts/lib_ralph_desk.zsh ~/.claude/ralph-desk/lib_ralph_desk.zsh
|
|
394
|
+
diff -q README.md ~/.claude/ralph-desk/README.md
|
|
395
|
+
```
|
|
396
|
+
All must produce no output.
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## Critical Files
|
|
401
|
+
|
|
402
|
+
| File | Changes |
|
|
403
|
+
|------|---------|
|
|
404
|
+
| `src/scripts/init_ralph_desk.zsh` | C1 (lines 197-238), C2 (lines 316-318, 478), C4 (lines 355, 578-580), C5 (lines 316, 429) |
|
|
405
|
+
| `src/commands/rlp-desk.md` | C3 (lines 25-26), C4 (line 131) |
|
|
406
|
+
| `src/governance.md` | C2 (line 217) |
|
|
407
|
+
| `tests/test_template_generation.sh` | New — TDD test script |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-dev-methodologies/rlp-desk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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",
|
package/src/commands/rlp-desk.md
CHANGED
|
@@ -23,6 +23,12 @@ Present your suggestion, then wait for the user's confirmation or change.
|
|
|
23
23
|
Ask about these items one by one (or in small groups):
|
|
24
24
|
1. **Slug** — short identifier (e.g., `auth-refactor`). Suggest one, ask if OK.
|
|
25
25
|
2. **Objective** — what the loop achieves
|
|
26
|
+
2.5. **Codebase Exploration** — Before proposing user stories, examine the project:
|
|
27
|
+
- Read the project's entry points, key modules, and test structure
|
|
28
|
+
- Identify architectural patterns in use (frameworks, conventions, test setup)
|
|
29
|
+
- Note constraints the Worker will encounter (dependencies, build system, existing code style)
|
|
30
|
+
- Present findings: "I explored the codebase and found: [patterns], [constraints], [existing tests]. This informs the US breakdown below."
|
|
31
|
+
- If the project is new/empty, skip this step and note "greenfield project."
|
|
26
32
|
3. **User Stories** — discrete units with testable acceptance criteria. Propose a breakdown, ask the user to confirm/modify.
|
|
27
33
|
- Apply INVEST criteria: each US must be Independent, Negotiable, Valuable, Estimable, Small, Testable.
|
|
28
34
|
- **Task Sizing (governance §1c)**: Size each US within the Worker's comfortable zone — smaller than what the Worker can handle, not at its ceiling. Max 3-4 ACs, max 2 files. If a US feels "just barely doable" for the target model, split it further.
|
|
@@ -128,7 +134,10 @@ Do NOT auto-decide iteration unit — the user MUST explicitly choose.
|
|
|
128
134
|
## `init <slug> [objective]`
|
|
129
135
|
|
|
130
136
|
Run: `~/.claude/ralph-desk/init_ralph_desk.zsh <slug> "<objective>" [--mode fresh|improve]`
|
|
131
|
-
If brainstorm was done, auto-fill
|
|
137
|
+
If brainstorm was done, auto-fill:
|
|
138
|
+
- PRD and test-spec with the brainstorm results
|
|
139
|
+
- Campaign memory "Key Decisions" with architectural decisions from brainstorm
|
|
140
|
+
- Campaign memory "Patterns Discovered" with codebase exploration findings (from step 2.5)
|
|
132
141
|
|
|
133
142
|
**After init completes, STOP. Do NOT auto-run the loop.**
|
|
134
143
|
|
package/src/governance.md
CHANGED
|
@@ -214,7 +214,7 @@ This is the default behavior, not an optional flag. Without it, IL-1 (Evidence M
|
|
|
214
214
|
### Worker: execution_steps in done-claim.json
|
|
215
215
|
Worker records what was done, in what order, with command evidence in `done-claim.json`:
|
|
216
216
|
- Each step includes: what action, which AC, command executed, exit code, summary
|
|
217
|
-
- Step types: `write_test`, `verify_red`, `implement`, `verify_green`, `refactor`, `commit`, `verify`, `verify_existing`
|
|
217
|
+
- Step types: `plan`, `write_test`, `verify_red`, `implement`, `verify_green`, `refactor`, `commit`, `verify`, `verify_existing`
|
|
218
218
|
- This proves the Worker followed test-first approach and did not skip steps
|
|
219
219
|
- **Existing implementation rule**: When code already exists from a prior iteration/campaign, Worker MAY use `verify_existing` instead of `write_test → verify_red → implement → verify_green`. `verify_existing` requires: run all existing tests, record exit codes, confirm all AC are covered by passing tests. Worker MUST NOT skip recording evidence — `verify_existing` is evidence that existing code satisfies AC, not a shortcut to skip verification.
|
|
220
220
|
|