projecta-rrr 1.21.4 → 1.21.6

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
@@ -4,6 +4,47 @@ All notable changes to RRR will be documented in this file.
4
4
 
5
5
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [1.21.6] - 2026-04-18
8
+
9
+ ### Fixed
10
+
11
+ - **`index_repo` NOT NULL violation on `ingestion_jobs.repo_id`.** The tool's
12
+ initial INSERT used `NULL` for repo_id (planning to fill in post-clone)
13
+ but the column schema is NOT NULL. Every `index_repo` call returned
14
+ `{error: internal_error}`. Caught during second-repo dogfood onboarding.
15
+ Fix: insert the same `pending:{slug}` placeholder the tool already
16
+ passes to `enqueueIndexRepo`; worker overwrites with real repo_id
17
+ after clone + root_sha computation.
18
+
19
+ ## [1.21.5] - 2026-04-18
20
+
21
+ **Stale-global-CLI detection + `/rrr:update` global-binary refresh.**
22
+
23
+ ### Fixed
24
+
25
+ - **`/rrr:update` now refreshes the global `projecta-rrr` CLI binary.**
26
+ Previously, update ran `npx --yes projecta-rrr@latest --global` which
27
+ updates RRR runtime files in `~/.claude/rrr/` but does NOT touch the
28
+ `projecta-rrr` binary installed via `npm install -g`. Result: RRR
29
+ slash-commands worked at the latest version, but subcommands like
30
+ `projecta-rrr hosted-setup` (added in 1.21.4) failed because the
31
+ binary on PATH was still from an older version. The update workflow
32
+ now additionally runs `npm install -g projecta-rrr@latest` with
33
+ best-effort EACCES tolerance.
34
+
35
+ - **`install.js` self-detects stale global CLI** at end of install.
36
+ If `command -v projecta-rrr` resolves to a package.json version older
37
+ than the currently-running install, prints a clear warning with the
38
+ two fixes: `npm install -g projecta-rrr@latest` OR use
39
+ `npx projecta-rrr@latest <subcommand>`.
40
+
41
+ ### Why this matters
42
+
43
+ A user reported: after `/rrr:update` from 1.20.0 to 1.21.4, running
44
+ `projecta-rrr hosted-setup` fell through to the default RRR install
45
+ flow ("Global/Local?" prompt). Cause: the stale v1.19.1 binary on PATH
46
+ didn't know about `hosted-setup`. Fix lands in 1.21.5.
47
+
7
48
  ## [1.21.4] - 2026-04-18
8
49
 
9
50
  **One-command adoption + slash-command integration.**
package/bin/install.js CHANGED
@@ -2497,6 +2497,40 @@ ${optimizationNote}
2497
2497
  `);
2498
2498
  }
2499
2499
  } catch { /* never block install on nudge */ }
2500
+
2501
+ // v1.21.5+: detect stale global CLI. When user ran via `npx projecta-rrr@latest`,
2502
+ // the RRR runtime at ~/.claude/rrr/ is up-to-date but an older
2503
+ // `projecta-rrr` on PATH (from a previous `npm install -g`) may still exist.
2504
+ // Surface the mismatch so users know to run `npm install -g projecta-rrr@latest`.
2505
+ try {
2506
+ const pkgVersion = require('../package.json').version;
2507
+ let onPathVersion = null;
2508
+ try {
2509
+ const onPathBin = execSync('command -v projecta-rrr', { stdio: ['pipe', 'pipe', 'ignore'] }).toString().trim();
2510
+ if (onPathBin) {
2511
+ // Read the package.json of whatever bin is on PATH
2512
+ const realPath = fs.realpathSync(onPathBin);
2513
+ // The bin is bin/install.js inside its package; go up to package.json
2514
+ const binDir = path.dirname(realPath);
2515
+ let candidate = path.dirname(binDir); // .../projecta-rrr
2516
+ const pkgJson = path.join(candidate, 'package.json');
2517
+ if (fs.existsSync(pkgJson)) {
2518
+ onPathVersion = require(pkgJson).version;
2519
+ }
2520
+ }
2521
+ } catch { /* no bin on PATH → not stale, no warning needed */ }
2522
+
2523
+ if (onPathVersion && onPathVersion !== pkgVersion) {
2524
+ console.log(` ${orange}━━━ Stale global CLI detected ━━━${reset}
2525
+ ${yellow}Your RRR runtime is ${pkgVersion} but the${reset} ${cyan}projecta-rrr${reset} ${yellow}binary on PATH is ${onPathVersion}.${reset}
2526
+ ${dim}This means RRR slash-commands are current, but the${reset} ${cyan}projecta-rrr${reset} ${dim}CLI (e.g.,${reset} ${cyan}hosted-setup${reset}${dim}) is stale.${reset}
2527
+
2528
+ ${dim}Fix (one of):${reset}
2529
+ ${green}npm install -g projecta-rrr@latest${reset}
2530
+ ${green}npx projecta-rrr@latest <subcommand>${reset} ${dim}(always latest, slower)${reset}
2531
+ `);
2532
+ }
2533
+ } catch { /* never block install on stale-check */ }
2500
2534
  }
2501
2535
 
2502
2536
  /**
@@ -124,6 +124,33 @@ npx --yes projecta-rrr@latest --global
124
124
  2. Should show "Wrote INSTALL_INFO.json"
125
125
  3. Should show "Quarantined X legacy/duplicate root(s)" if any were found
126
126
 
127
+ **Then refresh the global CLI binary** (v1.21.5+ fix). The `npx` line above
128
+ updates RRR runtime files in `~/.claude/rrr/` but does NOT update the
129
+ `projecta-rrr` binary on the user's PATH (via `~/.npm-global/bin/` or
130
+ equivalent). Run this additional step — it's best-effort and tolerates
131
+ EACCES silently:
132
+
133
+ ```bash
134
+ # Best-effort global CLI refresh — does NOT block update if it fails.
135
+ # On macOS with a prefix-configured npm (~/.npm-global or nvm), this works
136
+ # without sudo. On a raw system install it may hit EACCES — that's fine,
137
+ # user keeps working via npx for CLI invocations.
138
+ npm install -g projecta-rrr@latest 2>&1 | tail -5 || echo "(global CLI refresh skipped — user's npm prefix not writable; use 'npx projecta-rrr' or fix with: npm config set prefix ~/.npm-global)"
139
+ ```
140
+
141
+ **After this step, verify the CLI matches:**
142
+
143
+ ```bash
144
+ projecta-rrr --version 2>&1 | head -1 || which projecta-rrr
145
+ ```
146
+
147
+ If the version shown is older than what just installed, print a warning:
148
+ ```
149
+ ⚠ CLI binary stale (shows vX.Y.Z, expected vA.B.C).
150
+ Fix: `npm install -g projecta-rrr@latest` (may need sudo).
151
+ Workaround: use `npx projecta-rrr <subcommand>` until fixed.
152
+ ```
153
+
127
154
  **If install fails:**
128
155
  Show error and STOP. Do not proceed.
129
156
  </step>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projecta-rrr",
3
- "version": "1.21.4",
3
+ "version": "1.21.6",
4
4
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code by Projecta.ai",
5
5
  "bin": {
6
6
  "projecta-rrr": "bin/install.js",