@ai-dev-methodologies/rlp-desk 0.15.6 → 0.16.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.
package/CHANGELOG.md CHANGED
@@ -11,6 +11,17 @@ For pre-v0.15.4 versions, refer to `git log` and individual GitHub release notes
11
11
  - Post-v0.15.6: remove `RLP_LIFECYCLE_METRICS` flag entirely (per plan v3 ADR follow-ups).
12
12
  - Phase D.1 (handoff documents) + Phase D.2 (per-stage agent role specialization) — both deferred per `docs/plans/v0.15.4-release-runbook.md` §7.6.
13
13
 
14
+ ## [0.16.0] — 2026-06-18
15
+
16
+ Leader consolidation (ADR-001): `--mode tmux` is now the canonical production leader, self-verification works on it, and the deprecated `--mode agent` Node-CLI path is on a dated removal schedule.
17
+
18
+ ### Added
19
+ - **Self-verification now works under `--mode tmux`.** `--with-self-verification` previously required the deprecated `--mode agent` path; the report is now generated by a pure-filesystem post-pass that runs after the zsh leader exits (reading the campaign's done-claim/verdict artifacts), so the canonical production path gets SV reports without the `claude --print` no-TTY hang.
20
+
21
+ ### Deprecated
22
+ - **`node run.mjs run <slug> --mode agent` (Node-leader CLI alpha) is on a dated removal schedule** (ADR-001): 0.16.x louder banner → **0.17.0 hard-error** (and the Node-CLI default flips to `tmux`) → 0.18.0 dispatch branch removed. The `src/node/**` engine modules are retained throughout. Migrate direct-CLI wrappers to `--mode tmux` (canonical). This does NOT affect the slash command's `--mode native` default.
23
+ - **The flywheel (`--flywheel` / `--flywheel-guard`) is deprecated.** It was only ever implemented in the deprecated `--mode agent` Node path (never in the canonical zsh leader, despite a stale comment that claimed otherwise). Its only output, the advisory `next_mission_candidate` field, has no shipped runnable consumer. It will not be ported to the canonical leader; use a consumer-side wrapper for multi-mission chaining.
24
+
14
25
  ## [0.15.6] — 2026-06-18
15
26
 
16
27
  Patch: CI/test integrity, a codex command-builder security fix, and documentation reconciliation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-dev-methodologies/rlp-desk",
3
- "version": "0.15.6",
3
+ "version": "0.16.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",
@@ -303,7 +303,7 @@ Legacy `--mode agent` typed against this slash command emits a deprecation notic
303
303
 
304
304
  #### Tmux Mode (`--mode tmux`)
305
305
 
306
- When `--mode tmux` is specified (v0.14.0+: `run.mjs` accepts the same flags as before but spawns `run_ralph_desk.zsh` as a subprocess and inherits stdio. Flywheel and self-verification flags are not honored under tmux mode they currently require the deprecated Node-leader direct-CLI path `node run.mjs --mode agent` (see "Direct Node CLI invocation" below). Native Agent() port is a post-Node-leader-retirement task):
306
+ When `--mode tmux` is specified (v0.14.0+: `run.mjs` accepts the same flags as before but spawns `run_ralph_desk.zsh` as a subprocess and inherits stdio. ARCH Wave C: `--with-self-verification` **is honored** under tmux mode via a Node post-pass that runs after the zsh leader exits (see §348). `--flywheel`/`--flywheel-guard` are deprecated (ADR-001) and remain unimplemented in the zsh leader):
307
307
 
308
308
  1. **Validate scaffold** — same as Agent() mode: check `.rlp-desk/prompts/<slug>.worker.prompt.md` etc.
309
309
  2. **Check sentinels** — same as Agent() mode.
@@ -345,7 +345,7 @@ node ~/.claude/ralph-desk/node/run.mjs run '<slug>' \
345
345
  - MUST launch with `run_in_background: true` so `/rlp-desk` returns control immediately while preserving live tmux visibility.
346
346
  - Run-in-background is used so the shell can keep the command visible and keep the pane layout stable for status checks and completion flow.
347
347
  - Do NOT kill panes after completion. Panes stay alive for inspection. User cleans up with `/rlp-desk clean <slug> --kill-session`.
348
- - v0.14.0: `--with-self-verification`, `--flywheel`, and `--flywheel-guard` are **not honored** under `--mode tmux` the zsh runner has no SV/flywheel implementation. The Node leader emits a stderr WARNING listing the dropped flags. For SV/flywheel today, use the deprecated Node-leader direct-CLI path `node run.mjs --mode agent` (see "Direct Node CLI invocation" below). The slash command's Native Agent() (`--mode native`) does not yet implement SV/flywheel — port is a post-Node-leader-retirement task.
348
+ - ARCH Wave C (ADR-001): `--with-self-verification` **is honored** under `--mode tmux`. The zsh leader cannot generate the SV report in-pane (`claude --print` hangs without a TTY hence its `$TMUX` early-return), so `run.mjs` runs the **pure-filesystem** `generateSVReport` as a **post-pass after the zsh child exits**, reading the campaign's on-disk done-claim/verdict artifacts. `--flywheel` and `--flywheel-guard` are **deprecated** (ADR-001) and remain unimplemented in the zsh leader; the Node leader emits a stderr WARNING for those two only. The slash command's Native Agent() (`--mode native`) does not yet implement SV/flywheel.
349
349
  - **For `--mode tmux` only**: the slash command invokes `node ~/.claude/ralph-desk/node/run.mjs run --mode tmux ...`. Do NOT invoke `~/.claude/ralph-desk/run_ralph_desk.zsh` directly — the Node router resolves the runner path, runs legacy detection, and surfaces actionable errors when the runner is missing. **For `--mode native`**, the slash command does NOT invoke the Node CLI — it acts as the leader itself; see Native Agent() Mode section below.
350
350
 
351
351
  **tmux UX model (5 items):**
@@ -374,7 +374,17 @@ This contract MUST be observed in every iteration of the leader loop below. Futu
374
374
 
375
375
  #### Direct Node CLI invocation (`node run.mjs run <slug> --mode agent` — deprecated alpha)
376
376
 
377
- Direct invocation of `node ~/.claude/ralph-desk/node/run.mjs run <slug> --mode agent` is **the deprecated Node-leader alpha path**. This is unrelated to the slash command's Native Agent() path above — different code, different leader, different lifecycle. The Node leader currently retains SV/flywheel implementations not yet ported to Native Agent(). The Node CLI emits a deprecation banner on this mode and is scheduled for hard-error in the next major release. For production tmux orchestration, use `--mode tmux`. For Claude Code Native Agent() campaigns, use `/rlp-desk run <slug> --mode native` from a Claude Code session.
377
+ Direct invocation of `node ~/.claude/ralph-desk/node/run.mjs run <slug> --mode agent` is **the deprecated Node-leader alpha path**. This is unrelated to the slash command's Native Agent() path above — different code, different leader, different lifecycle. The Node leader currently retains SV/flywheel implementations not yet ported to Native Agent(). For production tmux orchestration, use `--mode tmux` (the **canonical** leader). For Claude Code Native Agent() campaigns, use `/rlp-desk run <slug> --mode native` from a Claude Code session.
378
+
379
+ **Deprecation schedule** (per [ADR-001](../../docs/plans/adr-001-leader-consolidation.md) §3 — applies to the Node-CLI `--mode agent` entry point ONLY; the `src/node/**` engine modules are retained throughout):
380
+
381
+ | Version | Behavior of `node run.mjs run <slug> --mode agent` |
382
+ |---------|-----------------------------------------------------|
383
+ | 0.16.x | runs, with a louder deprecation banner |
384
+ | **0.17.0** | **hard-errors** (exit 2) with a redirect to `--mode tmux` / `--mode native`; the Node-CLI default also flips to `tmux` |
385
+ | 0.18.0 | the `--mode agent` dispatch branch is removed (engine modules stay) |
386
+
387
+ External wrappers calling `--mode agent` must migrate to `--mode tmux` by 0.17.0. This is a breaking CLI change for that entry point, announced in CHANGELOG at each step.
378
388
 
379
389
  ### Preparation
380
390
  1. Validate scaffold: `.rlp-desk/prompts/<slug>.worker.prompt.md` etc.
package/src/node/run.mjs CHANGED
@@ -5,7 +5,7 @@ import { spawn, spawnSync } from 'node:child_process';
5
5
  import { fileURLToPath } from 'node:url';
6
6
 
7
7
  import { initCampaign } from './init/campaign-initializer.mjs';
8
- import { readStatus } from './reporting/campaign-reporting.mjs';
8
+ import { readStatus, generateSVReport } from './reporting/campaign-reporting.mjs';
9
9
  import {
10
10
  run as runCampaignMain,
11
11
  detectLegacyDeskInRunMode,
@@ -318,6 +318,10 @@ function buildZshEnv(slug, options, parentEnv) {
318
318
  AUTONOMOUS_MODE: options.autonomous ? '1' : '0',
319
319
  LANE_MODE: options.laneStrict ? 'strict' : 'warn',
320
320
  TEST_DENSITY_MODE: options.testDensityStrict ? 'strict' : 'warn',
321
+ // ARCH Wave C-SV: forwarded for traceability only. The zsh leader keeps its
322
+ // $TMUX early-return (no in-pane `claude --print`); the SV report itself is
323
+ // produced by the Node post-pass in runTmuxViaZsh after the zsh child exits.
324
+ WITH_SELF_VERIFICATION: options.withSelfVerification ? '1' : '0',
321
325
  };
322
326
  }
323
327
 
@@ -360,23 +364,47 @@ async function runTmuxViaZsh(slug, options, deps) {
360
364
  return 1;
361
365
  }
362
366
 
363
- // Surface flags the zsh runner cannot honor. Flywheel and self-verification
364
- // remain Node-leader features, available only in --mode agent. Warn loudly
365
- // instead of silent no-op so the operator understands the trade-off.
367
+ // Surface flags the zsh runner cannot honor. ARCH Wave C: --with-self-verification
368
+ // IS now honored in tmux mode via a post-zsh-return pass (see below) — only the
369
+ // flywheel flags remain unsupported here. Warn loudly instead of silent no-op.
366
370
  const unsupported = [];
367
371
  if (options.flywheel !== 'off') unsupported.push('--flywheel');
368
372
  if (options.flywheelGuard !== 'off') unsupported.push('--flywheel-guard');
369
- if (options.withSelfVerification) unsupported.push('--with-self-verification');
370
373
  if (unsupported.length > 0) {
371
374
  write(
372
375
  deps.stderr,
373
- `WARNING: ${unsupported.join(', ')} not honored in --mode tmux (zsh runner). Use --mode agent for those features.`,
376
+ `WARNING: ${unsupported.join(', ')} not honored in --mode tmux (zsh runner). Flywheel is deprecated (ADR-001) — use --mode agent if you still need it.`,
374
377
  );
375
378
  }
376
379
 
377
380
  const env = buildZshEnv(slug, options, process.env);
378
381
  const spawnZsh = deps.spawnZsh ?? defaultSpawnZsh;
379
- return spawnZsh(zshPath, env, options.rootDir);
382
+ const exitCode = await spawnZsh(zshPath, env, options.rootDir);
383
+
384
+ // ARCH Wave C-SV: home self-verification onto --mode tmux. The zsh runner cannot
385
+ // produce the SV report itself (`claude --print` hangs without a TTY in a tmux
386
+ // pane — that is why lib_ralph_desk.zsh keeps its $TMUX early-return). Instead we
387
+ // run the Node PURE-FS generateSVReport as a post-pass AFTER the zsh child exits:
388
+ // real stdout, no pane, no TTY → no hang. It reads the campaign's on-disk
389
+ // iter-*-done-claim/verify-verdict artifacts the zsh leader already wrote.
390
+ if (options.withSelfVerification) {
391
+ try {
392
+ const paths = buildPaths(options.rootDir, slug);
393
+ const sv = await generateSVReport({
394
+ slug,
395
+ logsDir: paths.campaignLogDir,
396
+ prdFile: paths.prdFile,
397
+ testSpecFile: paths.testSpecFile,
398
+ analyticsFile: paths.analyticsFile,
399
+ outputDir: paths.analyticsDir,
400
+ });
401
+ write(deps.stdout, `\nSelf-verification report (tmux post-pass): ${sv.summary ?? 'generated'}`);
402
+ } catch (err) {
403
+ write(deps.stderr, `WARNING: self-verification post-pass failed: ${err.message}`);
404
+ }
405
+ }
406
+
407
+ return exitCode;
380
408
  }
381
409
 
382
410
  async function runRunCommand(args, deps) {
@@ -478,7 +506,7 @@ async function runRunCommand(args, deps) {
478
506
  // not a replacement. See docs/plans/v0.15-stabilization-plan.md.
479
507
  write(
480
508
  deps.stderr,
481
- 'SCHEDULED REMOVAL: --mode agent (Node CLI alpha) will be removed in a future major release. Date TBD until stabilization milestones complete.',
509
+ 'SCHEDULED REMOVAL (ADR-001): --mode agent (Node CLI alpha) hard-errors in 0.17.0 (Node-CLI default flips to tmux) and the dispatch branch is removed in 0.18.0. Engine modules stay. Migrate to --mode tmux.',
482
510
  );
483
511
  write(
484
512
  deps.stderr,
@@ -67,8 +67,12 @@ SV_SKIPPED_REASON="" # set when SV is di
67
67
  # no-progress, stale-context, claude model upgrade chain, etc.), so the
68
68
  # Node leader is now reserved for `--mode agent` (LLM-driven) only.
69
69
  # `--mode tmux` invocations from src/node/run.mjs delegate here as a
70
- # subprocess via env vars. zsh continues to honor FLYWHEEL,
71
- # FLYWHEEL_GUARD, WITH_SELF_VERIFICATION.
70
+ # subprocess via env vars. ARCH Wave C / ADR-001: FLYWHEEL and FLYWHEEL_GUARD
71
+ # are NOT implemented in the zsh leader (no dispatch site) and are deprecated —
72
+ # do NOT claim otherwise. WITH_SELF_VERIFICATION is forwarded for traceability,
73
+ # but the SV report is produced by the Node post-pass in run.mjs runTmuxViaZsh
74
+ # after this script exits (this script keeps its $TMUX early-return to avoid the
75
+ # `claude --print` no-TTY hang).
72
76
  AUTONOMOUS_MODE="${AUTONOMOUS_MODE:-0}" # 1=don't stop on ambiguity, PRD is authoritative
73
77
  # P1-E Lane enforcement: WARN-only by default; --lane-strict opts into BLOCKED
74
78
  # escalation. governance §7¾. The opt-in defaults to "warn"; "strict" trips