Skip to content

fix(registry): resolve registry.json from canonical data-dir, survive plugin updates#180

Merged
auroracapital merged 1 commit intomainfrom
fix/registry-path-data-dir-canonical
May 1, 2026
Merged

fix(registry): resolve registry.json from canonical data-dir, survive plugin updates#180
auroracapital merged 1 commit intomainfrom
fix/registry-path-data-dir-canonical

Conversation

@auroracapital
Copy link
Copy Markdown
Collaborator

@auroracapital auroracapital commented May 1, 2026

Summary

  • Plugin updates wipe \$PLUGIN_ROOT/scripts/registry.json (cache path), which most bin scripts read from. After every version bump, /ops:ops-dash and friends report "No project registry found" even though the user's data-dir registry is intact.
  • bin/ops-projects already resolves from \$CLAUDE_PLUGIN_DATA_DIR/registry.json (canonical, survives updates). This PR brings the rest of the surface in line via a shared lib/registry-path.sh helper.
  • 9 bin scripts + the daemon's prefetch_project_health now use the helper. Resolution order: data-dir → caller-supplied legacy fallback → $PLUGIN_ROOT legacy → canonical default for write-paths.

Test plan

  • bash -n on all 11 modified files
  • Smoke: resolver finds 38-project registry from data-dir without cache symlink
  • Legacy fallback: synthetic plugin tree with registry only in scripts/ resolves correctly
  • End-to-end: bin/ops-dash reports 38 projects | 14 GSD active after cache wipe
  • CI green

Note

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.json so plugin updates don’t wipe state. Adds lib/registry-path.sh to resolve OPS_DATA_DIR and pick REGISTRY from the canonical per-user data directory first, with fallback to legacy scripts/registry.json paths.

Updates the affected bin/ops-* commands to source the resolver (and in a couple cases derive PREFS from OPS_DATA_DIR), and adjusts ops-daemon.sh’s project-health prefetch to prefer the data-dir registry with a legacy fallback. Also updates the ops-doctor missing-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.

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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

Warning

Rate limit exceeded

@auroracapital has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 32 minutes and 51 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d59b35b9-47f0-4e21-acc0-64f0e27cfaa5

📥 Commits

Reviewing files that changed from the base of the PR and between 8476733 and 979fd12.

📒 Files selected for processing (11)
  • claude-ops/bin/ops-ci
  • claude-ops/bin/ops-dash
  • claude-ops/bin/ops-doctor
  • claude-ops/bin/ops-external
  • claude-ops/bin/ops-git
  • claude-ops/bin/ops-infra
  • claude-ops/bin/ops-merge-scan
  • claude-ops/bin/ops-prs
  • claude-ops/bin/ops-setup-detect
  • claude-ops/lib/registry-path.sh
  • claude-ops/scripts/ops-daemon.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/registry-path-data-dir-canonical

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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 32 minutes and 51 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@auroracapital auroracapital merged commit b0e6bd0 into main May 1, 2026
11 checks passed
@auroracapital auroracapital deleted the fix/registry-path-data-dir-canonical branch May 1, 2026 05:35
auroracapital added a commit that referenced this pull request May 1, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant