Skip to content

fix(miner)!: full-cutover rename gittensory-miner config dir + Prometheus metric names - #5721

Merged
JSONbored merged 2 commits into
mainfrom
rebrand-miner-config-dir-v2
Jul 14, 2026
Merged

fix(miner)!: full-cutover rename gittensory-miner config dir + Prometheus metric names#5721
JSONbored merged 2 commits into
mainfrom
rebrand-miner-config-dir-v2

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Phase 1 (#5707) renamed GITTENSORY_MINER_*/GITTENSORY_* env vars but missed two things the env var still fell back to when unset:

  • The default local-store config directory (~/.config/gittensory-miner) via local-store.js's shared resolveLocalStoreDbPath() helper, used by governor-state/ledger/plan/prediction/portfolio-queue/run-state/claim-ledger/event-ledger/ranked-candidates stores, laptop-init, status, repo-clone, and worktree-allocator — now ~/.config/loopover-miner.
  • 8 Prometheus textfile-exporter metric names (gittensory_miner_events_total, gittensory_miner_portfolio_queue_{items,oldest_in_progress_lease_age_seconds}, gittensory_miner_governor_{rate_limit_remaining_ratio,cap_usage_ratio}, gittensory_miner_prediction{s,_correct,_incorrect}_total) and their matching prometheus/rules/alerts.yml expressions — left unrenamed, the alert rules would silently query metric names that no longer exist.

Also renames the miner-ui's own local dev-server auth cookie (gittensory_miner_ui_token -> loopover_miner_ui_token, apps/gittensory-miner-ui) — a localhost-only dev cookie, not the core product's production session cookie (tracked separately).

Found and fixed a related pre-existing test bug along the way: alerts-miner-*.test.ts's "never references any loopover_* server metric" guard used a bare /loopover_/ regex, which broke once miner metrics themselves gained the loopover_ prefix — narrowed to /loopover_(?!miner_)/ so it still correctly flags a miner rule accidentally referencing a server metric.

BREAKING CHANGE: the miner's default config directory and every gittensory_miner_* Prometheus metric name changed; no dual-read/alias, per the epic's full-cutover mandate (#5705). A self-hoster's existing ~/.config/gittensory-miner state does not migrate automatically.

Explicitly NOT touched (separate, larger, higher-risk scopes — flagged for follow-up):

  • packages/gittensory-miner/bin/gittensory-miner-mcp.js's gittensory_miner_* MCP tool names and packages/gittensory-mcp's own tool names (Phase 4: MCP server + 96 tool names, external-client breaking change).
  • The .gittensory-miner.yml per-repo config filename and its ~30 references across the miner's goal-spec/config-precedence system (new gap discovered while investigating this fix; needs its own dedicated pass, mirroring the .gittensory.yml -> .loopover.yml rename already done for the core product).
  • packages/gittensory-miner/ as a directory/package name, and the gittensory-miner CLI binary name (Phase 3/5).

Test plan

  • npx vitest run test/unit/miner-*.test.ts test/unit/alerts-miner-*.test.ts apps/gittensory-miner-ui/src/auth.test.ts — 152 files / 1883 tests pass
  • npm run typecheck clean
  • npm run miner:env-reference:check / npm run docs:drift-check clean
  • Confirmed every remaining gittensory-miner/gittensory_miner_ reference is legitimately out of scope (MCP tool names, CLI usage strings, packages/gittensory-miner/ directory path, .gittensory-miner.yml filename)

@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 913e620 Commit Preview URL

Branch Preview URL
Jul 14 2026, 07:49 AM

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.06%. Comparing base (a6c8f1d) to head (3b05e44).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5721      +/-   ##
==========================================
+ Coverage   95.05%   95.06%   +0.01%     
==========================================
  Files         581      581              
  Lines       46164    46164              
  Branches    14810    14810              
==========================================
+ Hits        43880    43886       +6     
+ Misses       1523     1517       -6     
  Partials      761      761              
Flag Coverage Δ
shard-1 43.97% <47.36%> (ø)
shard-2 35.72% <52.63%> (+0.01%) ⬆️
shard-3 32.28% <42.10%> (ø)
shard-4 33.02% <78.94%> (+<0.01%) ⬆️
shard-5 31.59% <52.63%> (ø)
shard-6 44.47% <78.94%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../gittensory-engine/src/miner-prediction-metrics.ts 100.00% <100.00%> (ø)
...ckages/gittensory-miner/lib/deny-hook-synthesis.js 96.61% <100.00%> (+10.16%) ⬆️
packages/gittensory-miner/lib/event-ledger-cli.js 98.27% <100.00%> (ø)
packages/gittensory-miner/lib/governor-ledger.js 98.36% <100.00%> (ø)
...kages/gittensory-miner/lib/governor-metrics-cli.js 100.00% <100.00%> (ø)
packages/gittensory-miner/lib/laptop-init.js 98.26% <100.00%> (ø)
packages/gittensory-miner/lib/local-store.js 100.00% <100.00%> (ø)
packages/gittensory-miner/lib/orb-export.js 98.47% <100.00%> (ø)
packages/gittensory-miner/lib/plan-store.js 92.45% <100.00%> (ø)
...ckages/gittensory-miner/lib/portfolio-queue-cli.js 94.50% <100.00%> (ø)
... and 4 more
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 14, 2026
…heus metric names to loopover-miner/loopover_miner_

Phase 1 (#5707) renamed GITTENSORY_MINER_*/GITTENSORY_* env vars but
missed two things that env var still fell back to when unset:

- The default local-store config directory (~/.config/gittensory-miner,
  used by governor-state/ledger/plan/prediction/portfolio-queue/run-state/
  claim-ledger/event-ledger/ranked-candidates stores, laptop-init, status,
  repo-clone, and worktree-allocator) via local-store.js's shared
  resolveLocalStoreDbPath() helper -- now ~/.config/loopover-miner.
- 8 Prometheus textfile-exporter metric names (gittensory_miner_events_total,
  gittensory_miner_portfolio_queue_{items,oldest_in_progress_lease_age_seconds},
  gittensory_miner_governor_{rate_limit_remaining_ratio,cap_usage_ratio},
  gittensory_miner_prediction{s,_correct,_incorrect}_total) and their
  matching prometheus/rules/alerts.yml expressions -- left unrenamed, the
  alert rules would have silently queried metric names that no longer exist.

Also renames the miner-ui's own local dev-server auth cookie
(gittensory_miner_ui_token -> loopover_miner_ui_token, apps/gittensory-miner-ui) --
a localhost-only dev cookie, not the core product's production session
cookie (that one is tracked separately, out of scope here).

BREAKING CHANGE: the miner's default config directory and every
gittensory_miner_* Prometheus metric name changed; no dual-read/alias,
per the epic's full-cutover mandate (#5705). A self-hoster's existing
~/.config/gittensory-miner state does not migrate automatically.

Explicitly NOT touched (separate, larger, higher-risk scopes):
- packages/gittensory-miner/bin/gittensory-miner-mcp.js's gittensory_miner_*
  MCP tool names and packages/gittensory-mcp's own tool names (Phase 4:
  MCP server + 96 tool names, external-client breaking change).
- The .gittensory-miner.yml per-repo config filename and its ~30 references
  across the miner's goal-spec/config-precedence system (new, separate gap
  discovered while investigating this fix; needs its own dedicated pass,
  mirroring the .gittensory.yml -> .loopover.yml rename already done for
  the core product).
- packages/gittensory-miner/ as a directory/package name, and the
  gittensory-miner CLI binary name (Phase 3/5).
@loopover-orb

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Important

🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪

🔍 LoopOver is reviewing…

AI analysis is in progress. This comment will update when the review is complete.

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

…back

Every sibling local-store resolver (governor-ledger, laptop-init, plan-store,
prediction-ledger, etc.) already has this exact "env override, config dir,
XDG, then home default" test; deny-hook-synthesis.js was missing it, which
is why the config-dir rename's line 75 touch dropped patch coverage below
the gate's 99% target.
@JSONbored
JSONbored merged commit 8496b4f into main Jul 14, 2026
18 checks passed
@JSONbored
JSONbored deleted the rebrand-miner-config-dir-v2 branch July 14, 2026 07:59
JSONbored added a commit that referenced this pull request Jul 14, 2026
…ests to loopover-* (#5733)

* feat(docker)!: Phase 7 - full-cutover rename Docker/k8s/systemd manifests to loopover-*

Phase 7 of the gittensory -> loopover rebrand (#5705): renames every
Docker/k8s/systemd resource identifier and the operator-mounted
gittensory-config/ directory convention, full cutover.

- Root Dockerfile: comments, DATABASE_PATH default (gittensory.sqlite ->
  loopover.sqlite).
- k8s/miner-deployment.yaml, k8s/miner-secret.example.yaml, k8s/README.md:
  StatefulSet/label/service/secret names, image tag, kubectl examples.
- systemd/gittensory-miner.service.example -> loopover-miner.service.example,
  systemd/gittensory-miner-ui.service.example -> loopover-miner-ui.service.example
  (renamed to match the existing loopover-docker-prune.*.example
  convention): unit descriptions, User=, host paths, install steps.
- docker-compose.yml + .gitignore + config/examples/: the operator-mounted
  ./gittensory-config -> ./loopover-config bind-mount convention, plus the
  stale ~/.config/gittensory-miner AMS-ledger-export doc-drift left behind
  by the config-directory rename in #5721.
- scripts/gittensory-config-lint.ts -> scripts/loopover-config-lint.ts
  (git mv, its own error-message prefix, and every reference: package.json,
  docs, tests).
- scripts/selfhost-update.sh, scripts/selfhost-post-update-check.sh: the
  same directory-convention comments.
- 6 apps/gittensory-ui self-hosting docs pages (operations, quickstart,
  configuration, release-checklist, docs-audit, maintainer-self-hosting):
  every gittensory-config/ code example and prose reference.

Explicitly NOT touched: .env.example's Sentry/OTEL/domain-example/hosted-
collector-URL prose (Phase 8 scope, unrelated to Docker/k8s) and
apps/gittensory-*/packages/gittensory-* directory names themselves
(Phase 5).

BREAKING CHANGE: the self-host operator-mounted config directory is now
./loopover-config (was ./gittensory-config); systemd unit filenames
changed; k8s StatefulSet/Secret/label names changed. No dual-read/alias,
per the epic's full-cutover mandate. Self-host operators must rename
their existing ./gittensory-config directory (and any k8s/systemd units
built from the old examples) to match.

* fix(docker): fix systemd cross-references missed by the Phase 7 sweep

test/unit/miner-ui-systemd-launcher.test.ts, apps/gittensory-miner-ui/README.md,
and packages/gittensory-miner/DEPLOYMENT.md still pointed at the pre-rename
systemd/gittensory-miner{,-ui}.service.example filenames after those files were
git mv'd to systemd/loopover-miner{,-ui}.service.example earlier in this branch.

* style(ui): fix prettier formatting in docs.self-hosting-operations.tsx

Phase 7's .gittensory.yml -> .loopover.yml text substitution changed line
lengths enough to trip prettier's wrap rules; auto-fixed via eslint --fix.

* style(ui): correct prettier formatting using the properly pinned toolchain

The prior formatting commit ran against an incomplete local node_modules
(prettier wasn't actually installed), producing multi-line union-type
wraps that CI's pinned prettier 3.9.4 disagrees with. Re-running lint --fix
after a clean npm ci reverts those 5 files to the correct single-line form.
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.

1 participant