@ai-dev-methodologies/rlp-desk 0.18.0 → 0.18.1

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,16 @@ 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.18.1] — 2026-06-25
15
+
16
+ ### Fixed
17
+ - End-of-campaign resilience: when the last user story passes its per-US verify, the
18
+ leader now runs the final verification directly instead of dispatching one more
19
+ worker iteration solely to hand off to the final verify. That extra round-trip was a
20
+ fragile dependency on a healthy worker at the very end of a campaign (a worker stall
21
+ or API rate-limit at that moment could block a campaign whose work was already
22
+ complete and verified). Per-US campaigns now finalize without it.
23
+
14
24
  ## [0.18.0] — 2026-06-24
15
25
 
16
26
  **Leader hardening: campaigns that complete.** The `--mode tmux` leader's decision
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-dev-methodologies/rlp-desk",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
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",
@@ -350,6 +350,9 @@ BASELINE_COMMIT="" # git HEAD at campaign start (captured before loop)
350
350
  CAMPAIGN_REPORT_GENERATED=0 # guard against double-generation in cleanup trap
351
351
  SV_REPORT_GENERATED=0 # guard against double-generation in generate_sv_report
352
352
  VERIFIED_US="" # comma-separated list of verified US IDs (per-us mode)
353
+ _FINALIZE_PENDING=0 # D-16: armed when the last per-US pass completes coverage;
354
+ # the next loop top synthesizes an ALL verify signal and
355
+ # skips the (fragile) worker round-trip to emit it.
353
356
  CONSENSUS_ROUND=0 # current consensus round for current US
354
357
  US_LIST="" # comma-separated US IDs from PRD (per-us mode)
355
358
  LOCKFILE_ACQUIRED=0
@@ -2818,6 +2821,17 @@ run_single_verifier() {
2818
2821
  # --- Sequential final verify: run per-US scoped verifiers instead of one big ALL verify ---
2819
2822
  # Returns 0 if all US pass + integration check pass, 1 if any US fails, 2 if integration fails.
2820
2823
  # Sets FAILED_US global on failure.
2824
+ # D-16: true when every US in US_LIST is already present in VERIFIED_US.
2825
+ # Used to arm leader-driven finalize after the last per-US pass.
2826
+ _all_us_verified() {
2827
+ [[ -n "$US_LIST" ]] || return 1
2828
+ local _us
2829
+ for _us in $(echo "$US_LIST" | tr ',' ' '); do
2830
+ echo ",$VERIFIED_US," | grep -q ",$_us," || return 1
2831
+ done
2832
+ return 0
2833
+ }
2834
+
2821
2835
  run_sequential_final_verify() {
2822
2836
  local iter="$1"
2823
2837
  FAILED_US=""
@@ -3487,6 +3501,28 @@ main() {
3487
3501
  fi
3488
3502
  fi
3489
3503
 
3504
+ # D-16: leader-driven finalize. The previous iteration's last per-US pass
3505
+ # completed coverage and armed _FINALIZE_PENDING instead of dispatching a
3506
+ # worker round-trip to emit an ALL signal. Synthesize that ALL verify signal
3507
+ # ourselves and skip the worker; the existing verify path (signal_us_id=ALL →
3508
+ # run_sequential_final_verify) handles completion AND the fix-loop on failure.
3509
+ # Operator recovery (PR-A) takes precedence — only finalize if it did not claim
3510
+ # this iteration. A crash before this point loses the flag and safely falls
3511
+ # back to the worker round-trip (the pre-D-16 path).
3512
+ if (( _FINALIZE_PENDING )) && [[ "$SKIP_NEXT_WORKER" -eq 0 ]]; then
3513
+ _FINALIZE_PENDING=0
3514
+ log " Leader finalize (D-16): all US verified ($VERIFIED_US) — synthesizing ALL verify signal, skipping worker round-trip."
3515
+ log_debug "[FLOW] iter=$ITERATION d16_finalize=true verified_us=$VERIFIED_US"
3516
+ printf '{"iteration": %d, "status": "verify", "us_id": "ALL", "summary": "leader finalize (D-16: all per-US verified)", "timestamp": "%s"}\n' \
3517
+ "$ITERATION" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" | atomic_write "$SIGNAL_FILE"
3518
+ update_status "verify" "running"
3519
+ SKIP_NEXT_WORKER=1
3520
+ else
3521
+ # Any normally-dispatched iteration clears a stale arm (defensive; the flag
3522
+ # is consumed above on the immediately-following iteration in practice).
3523
+ _FINALIZE_PENDING=0
3524
+ fi
3525
+
3490
3526
  if (( ! SKIP_NEXT_WORKER )); then
3491
3527
  # --- governance.md s7 step 8 (cleanup): Clean previous iteration signals ---
3492
3528
  # Bug #7 Fix-R cleanup: unlock 0o444 sentinels written by the previous
@@ -3967,7 +4003,18 @@ main() {
3967
4003
  _append_verified_ledger "$signal_us_id" # F-14: durable source-of-truth
3968
4004
  fi
3969
4005
  update_status "verifier" "pass_us"
3970
- # Worker will do next US on next iteration
4006
+ # D-16: if this pass completed coverage (every US in US_LIST is now
4007
+ # verified), arm leader-driven finalize so the NEXT loop top runs the
4008
+ # sequential final verify DIRECTLY — instead of a worker round-trip
4009
+ # whose only job is to emit an ALL signal (a fragile extra LLM
4010
+ # iteration, observed hanging on an API rate-limit in SV CRITICAL).
4011
+ if [[ "$VERIFY_MODE" == "per-us" && -n "$US_LIST" ]] && _all_us_verified; then
4012
+ _FINALIZE_PENDING=1
4013
+ log " Coverage complete ($VERIFIED_US) — arming leader finalize (D-16, no worker round-trip)."
4014
+ log_debug "[FLOW] iter=$ITERATION d16_arm_finalize=true verified_us=$VERIFIED_US"
4015
+ else
4016
+ : # more US remain → Worker will do next US on next iteration
4017
+ fi
3971
4018
  fi
3972
4019
  elif [[ "$recommended" == (complete|completed|done) || "$signal_us_id" == "ALL" ]]; then
3973
4020
  # Final full verify passed or complete recommended