@ai-dev-methodologies/rlp-desk 0.2.3 → 0.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-dev-methodologies/rlp-desk",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
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",
@@ -97,7 +97,7 @@ Options (parse from `$ARGUMENTS`):
97
97
  - `--consensus-scope all|final-only` — when consensus runs (default: `all`)
98
98
  - `all`: consensus runs on every verify (current behavior)
99
99
  - `final-only`: consensus only on final ALL verify
100
- - `--debug` — enable debug logging (tmux mode only, writes to logs/<slug>/debug.log)
100
+ - `--debug` — enable debug logging (writes to logs/<slug>/debug.log)
101
101
 
102
102
  ### Mode Selection
103
103
 
@@ -144,11 +144,14 @@ DEBUG=<1 if --debug, else 0> \
144
144
  1. Validate scaffold: `.claude/ralph-desk/prompts/<slug>.worker.prompt.md` etc.
145
145
  2. Check sentinels (complete/blocked). Found → tell user `/rlp-desk clean <slug>`.
146
146
  3. Clean previous `done-claim.json`, `verify-verdict.json`.
147
+ 4. If `--debug`: create/clear `logs/<slug>/debug.log`. Define a helper: to "debug_log" means append a timestamped line to this file via `Bash("echo \"[$(date '+%Y-%m-%d %H:%M:%S')] $msg\" >> .claude/ralph-desk/logs/<slug>/debug.log")`.
147
148
 
148
149
  ### Leader Loop
149
150
 
150
151
  **CRITICAL: DO NOT STOP between iterations.** You MUST continue the loop automatically until a sentinel is written (COMPLETE or BLOCKED) or max_iter is reached. Do NOT pause to ask the user. Do NOT wait for confirmation. The loop is fully autonomous — just report each iteration result briefly and immediately proceed to the next iteration.
151
152
 
153
+ If `--debug`, at loop start debug_log: `[PLAN] slug=<slug> max_iter=<N> worker_engine=<engine> worker_model=<model> verifier_engine=<engine> verifier_model=<model> verify_mode=<mode> consensus=<0|1> consensus_scope=<scope>`
154
+
152
155
  For each iteration (1 to max_iter):
153
156
 
154
157
  **① Check sentinels**
@@ -166,11 +169,13 @@ rm -f .claude/ralph-desk/memos/<slug>-verify-verdict.json
166
169
  **② Read memory.md** → Stop Status, Next Iteration Contract
167
170
  - Also read **Completed Stories** → verified work so far
168
171
  - Also read **Key Decisions** → settled architectural choices
172
+ - If `--debug`: debug_log `[EXEC] iter=N phase=read_memory stop_status=<status> contract="<summary>"`
169
173
 
170
174
  **③ Decide model** (§4 of governance.md)
171
175
  - Previous iteration failed → upgrade model
172
176
  - Simple task → downgrade
173
177
  - User specified → use that
178
+ - If `--debug`: debug_log `[EXEC] iter=N phase=model_select worker_model=<model> reason=<reason>`
174
179
 
175
180
  **④ Build worker prompt**
176
181
  - Read `.claude/ralph-desk/prompts/<slug>.worker.prompt.md`
@@ -178,6 +183,7 @@ rm -f .claude/ralph-desk/memos/<slug>-verify-verdict.json
178
183
  - Write to `.claude/ralph-desk/logs/<slug>/iter-NNN.worker-prompt.md` (audit trail)
179
184
 
180
185
  **⑤ Execute Worker**
186
+ - If `--debug`: debug_log `[EXEC] iter=N phase=worker engine=<engine> model=<model> dispatched=true`
181
187
 
182
188
  If `--worker-engine claude` (default):
183
189
  ```
@@ -199,11 +205,14 @@ Bash("codex exec --model <worker_codex_model> --reasoning-effort <worker_codex_r
199
205
  - Codex runs as a subprocess via Bash(), not Agent().
200
206
  - Each Bash() call = fresh context for codex.
201
207
 
208
+ - If `--debug`: debug_log `[EXEC] iter=N phase=worker_done engine=<engine>`
209
+
202
210
  **⑥ Read memory.md again** (Worker updated it)
203
211
  - `stop=continue` → go to ⑧
204
212
  - `stop=verify` → go to ⑦
205
213
  - `stop=blocked` → write BLOCKED sentinel, stop
206
214
  - Also read `iter-signal.json` for `us_id` field (which US was just completed)
215
+ - If `--debug`: debug_log `[EXEC] iter=N phase=worker_signal status=<stop_status> us_id=<us_id>`
207
216
 
208
217
  **⑦ Execute Verifier**
209
218
 
@@ -225,6 +234,7 @@ Bash("codex exec --model <worker_codex_model> --reasoning-effort <worker_codex_r
225
234
  - Verifier checks all AC at once
226
235
 
227
236
  **⑦a Dispatch Verifier**
237
+ - If `--debug`: debug_log `[EXEC] iter=N phase=verifier engine=<engine> model=<model> scope=<us_id> dispatched=true`
228
238
 
229
239
  If `--verifier-engine claude` (default):
230
240
  ```
@@ -263,6 +273,8 @@ After the primary verifier runs, run a second verifier with the OTHER engine:
263
273
  5. Go to ⑧ with fix contract as next Worker contract
264
274
  - `request_info` → Leader reads Verifier's questions, decides outcome (or relays to Worker in next contract) → go to ⑧
265
275
  - `blocked` → write BLOCKED sentinel, stop
276
+ - If `--debug`: debug_log `[EXEC] iter=N phase=verdict engine=<engine> verdict=<pass|fail|request_info> us_id=<us_id>`
277
+ - If `--debug` and consensus: debug_log `[EXEC] iter=N phase=consensus claude=<verdict> codex=<verdict> round=<N>`
266
278
 
267
279
  **⑧ Write result log and report to user, continue loop**
268
280
  - Write `logs/<slug>/iter-NNN.result.md`:
@@ -271,6 +283,10 @@ After the primary verifier runs, run a second verifier with the OTHER engine:
271
283
  - Verifier verdict `[leader-measured]`
272
284
  - Write `status.json`
273
285
  - Report: iteration N, phase, model used, result
286
+ - If `--debug`: debug_log `[EXEC] iter=N phase=result status=<result> consecutive_failures=<N> verified_us=<list>`
287
+
288
+ At loop end (COMPLETE, BLOCKED, or TIMEOUT):
289
+ - If `--debug`: debug_log `[VALIDATE] result=<COMPLETE|BLOCKED|TIMEOUT> iterations=<N> verified_us=<list>`
274
290
 
275
291
  ### Circuit Breaker
276
292
  - context-latest.md unchanged 3 iterations → BLOCKED
@@ -342,7 +358,7 @@ Run options:
342
358
  --verify-mode per-us|batch Verification strategy (default: per-us)
343
359
  --verify-consensus Cross-engine consensus verification
344
360
  --consensus-scope SCOPE When consensus runs: all|final-only (default: all)
345
- --debug Debug logging (tmux mode only)
361
+ --debug Debug logging (logs/<slug>/debug.log)
346
362
  ```
347
363
 
348
364
  ## Architecture