fix(registry): resolve registry.json from canonical data-dir, survive plugin updates#180
Conversation
Bin scripts read registry.json from $PLUGIN_ROOT/scripts/registry.json, which is wiped on every plugin update. The canonical user-data location is $CLAUDE_PLUGIN_DATA_DIR/registry.json (already used by ops-projects), which survives plugin upgrades. Symptom: after a plugin version bump, /ops:ops-dash and friends report "No project registry found" until the user manually re-runs /ops:setup, even though their data-dir registry is intact. Fix: introduce lib/registry-path.sh that resolves OPS_DATA_DIR and REGISTRY with the precedence: 1. \$OPS_DATA_DIR/registry.json (canonical) 2. \$OPS_PLUGIN_ROOT_FALLBACK/scripts/registry.json (legacy) 3. \$PLUGIN_ROOT/scripts/registry.json (legacy) 4. canonical path as default for write-paths All 9 bin scripts and the daemon's prefetch_project_health now resolve through the helper. ops-projects already followed this pattern; this brings the rest of the surface in line. Verified end-to-end: ops-dash now reads 38 projects from data-dir even with the cache symlink absent. Legacy fallback verified against a synthetic plugin tree with registry only in scripts/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 32 minutes and 51 seconds.Comment |
Bumps marketplace.json + plugin.json to 2.0.4 and adds CHANGELOG entry for the registry-path fix in #180. Plugin updates wiped the cache-path registry; resolver now prefers the data-dir canonical path. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
\$PLUGIN_ROOT/scripts/registry.json(cache path), which most bin scripts read from. After every version bump,/ops:ops-dashand friends report "No project registry found" even though the user's data-dir registry is intact.bin/ops-projectsalready resolves from\$CLAUDE_PLUGIN_DATA_DIR/registry.json(canonical, survives updates). This PR brings the rest of the surface in line via a sharedlib/registry-path.shhelper.prefetch_project_healthnow use the helper. Resolution order: data-dir → caller-supplied legacy fallback → $PLUGIN_ROOT legacy → canonical default for write-paths.Test plan
bash -non all 11 modified filesscripts/resolves correctlybin/ops-dashreports38 projects | 14 GSD activeafter cache wipeNote
Medium Risk
Touches multiple operational scripts and the daemon to change how
registry.json/preferences paths are resolved; mistakes could cause dashboards/health checks to see an empty registry or write to the wrong location.Overview
Standardizes how ops scripts find
registry.jsonso plugin updates don’t wipe state. Addslib/registry-path.shto resolveOPS_DATA_DIRand pickREGISTRYfrom the canonical per-user data directory first, with fallback to legacyscripts/registry.jsonpaths.Updates the affected
bin/ops-*commands to source the resolver (and in a couple cases derivePREFSfromOPS_DATA_DIR), and adjustsops-daemon.sh’s project-health prefetch to prefer the data-dir registry with a legacy fallback. Also updates theops-doctormissing-registry warning to point at the canonical location.Reviewed by Cursor Bugbot for commit 979fd12. Bugbot is set up for automated code reviews on this repo. Configure here.