Skip to content

fix(selfhost): default miner DR scripts to the post-rename config dir - #5991

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:fix-selfhost-backup-restore-config-dir
Jul 15, 2026
Merged

fix(selfhost): default miner DR scripts to the post-rename config dir#5991
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:fix-selfhost-backup-restore-config-dir

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

Closes #5933.

scripts/backup-miner.sh and scripts/restore-miner.sh defaulted STATE_DIR to the pre-rename $HOME/.config/gittensory-miner. The miner's real current default is ~/.config/loopover-miner (per packages/loopover-miner/lib/local-store.js's resolveLocalStoreDbPath, shared by every store), so an operator who never sets LOOPOVER_MINER_CONFIG_DIR would run a backup/restore against a directory that no longer exists after the rebrand's hard cutover — the script exits 1 ("nothing to back up"), easy to miss in an unattended cron/systemd timer.

Changes

  • scripts/backup-miner.sh / scripts/restore-miner.sh: STATE_DIR default gittensory-minerloopover-miner (no dual-read/alias, matching the CHANGELOG's no-migration-shim mandate). Refreshed the describing header/usage comments to the current name (kept the #4872 issue references).
  • test/unit/miner-dr-scripts-config-default.test.ts (new): the regression guard the issue asks for — reads both scripts and asserts the default fallback is ~/.config/loopover-miner and that no gittensory-miner residue remains. Mirrors test/unit/miner-docker-compose.test.ts's readFileSync+assert pattern.

Validation

  • New regression test passes (4/4).
  • Existing test/unit/miner-backup-restore-scripts.test.ts still green (14/14) — it always sets LOOPOVER_MINER_CONFIG_DIR explicitly, so the default change doesn't affect it.
  • sh -n clean on both scripts; the loopover-miner doctor subcommand referenced in restore output is real (packages/loopover-miner/bin/loopover-miner.js).
  • Scripts are scripts/**, outside Codecov's coverage.include, so no patch-coverage gate applies.
  • Confirmed no other repo file depends on the old ~/.config/gittensory-miner default (the two CHANGELOG references are intentional historical notes).

backup-miner.sh and restore-miner.sh defaulted STATE_DIR to the pre-rename
$HOME/.config/gittensory-miner, so an operator who never sets
LOOPOVER_MINER_CONFIG_DIR would back up/restore a directory that no longer
exists after the rebrand's hard cutover (the real default is
~/.config/loopover-miner, per local-store.js's resolveLocalStoreDbPath).
Fix both defaults to loopover-miner, refresh the describing comments (keeping
the JSONbored#4872 references), and add a test/unit regression guard asserting the
default fallback string.

Closes JSONbored#5933
@davion-knight
davion-knight requested a review from JSONbored as a code owner July 15, 2026 06:01
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 15, 2026
@loopover-orb

loopover-orb Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-15 06:11:09 UTC

3 files · 1 AI reviewer · no blockers · readiness 80/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a narrow, well-targeted fix that corrects the default STATE_DIR fallback in scripts/backup-miner.sh and scripts/restore-miner.sh from the pre-rename ~/.config/gittensory-miner to the current ~/.config/loopover-miner, matching the miner's actual default per local-store.js. It also updates comments/usage text and adds a focused regression test asserting the exact default string and absence of gittensory-miner residue. The change is simple, closes the linked issue #5933, and is low-risk since it only touches shell script defaults and adds a test.

Nits — 4 non-blocking
  • The regression test in test/unit/miner-dr-scripts-config-default.test.ts asserts an exact string match on the STATE_DIR line, which is brittle to harmless formatting changes (e.g. quote style) in the scripts.
  • The `Add backup/restore tooling and guidance #4872` comment header references remain even though the surrounding text was rebranded — worth double-checking that issue number is still the correct historical reference and not itself a residue of the old naming.
  • Consider a slightly looser regex-based assertion in the new test (e.g. matching the STATE_DIR default value rather than the full literal line) to reduce future test churn from unrelated formatting tweaks.
  • No functional changes needed beyond this; the PR is otherwise complete and matches its stated scope.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5933
Related work ⚠️ 2 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 143 registered-repo PR(s), 95 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 143 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ℹ️ Insufficient signal risk: clean · value: insufficient-signal · LLM: minor
Linked issue satisfaction

Addressed
Both scripts' STATE_DIR default is changed from ~/.config/gittensory-miner to ~/.config/loopover-miner exactly as required, descriptive comments are updated, no dual-read shim is introduced, and a new Vitest regression test greps both scripts to assert the correct default and absence of the stale string.

Review context
Contributor next steps
  • Start here: Review top overlaps.
  • Then work through the remaining 2 steps in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit a9f932f into JSONbored:main Jul 15, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(selfhost): backup-miner.sh / restore-miner.sh default to the pre-rename ~/.config/gittensory-miner state dir

1 participant