Skip to content

feat(selfhost): bridge fleet-mode miner state to the ams-observability exporter - #5844

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
real-venus:feat/loopover-fleet-observability-bridge
Jul 14, 2026
Merged

feat(selfhost): bridge fleet-mode miner state to the ams-observability exporter#5844
JSONbored merged 1 commit into
JSONbored:mainfrom
real-venus:feat/loopover-fleet-observability-bridge

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

Fleet mode (packages/loopover-miner/docker-compose.miner.yml) keeps miner state in a Docker-managed named volume (miner-data), whose host path is an internal detail. ORB's ams-reporting-exporter (root docker-compose.yml, --profile ams-observability) reads the miner's ledgers from a host bind mount defaulting to ~/.config/loopover-miner. The two never resolve to the same location, so an operator who installs AMS the documented containerized way and enables the observability profile gets a silently non-functional bridge — the exporter reads an empty directory and the Grafana AMS datasources stay empty with no error (#5805).

This wires the missing connective tissue, purely additively:

  • packages/loopover-miner/docker-compose.miner.override.yml.example — an opt-in override (mirroring the root docker-compose.override.yml.example pattern) that bind-mounts /data/miner onto the same ${LOOPOVER_MINER_CONFIG_DIR:-~/.config/loopover-miner} host path the exporter already uses. Because it reuses that exact variable + default, the two profiles read one location with zero extra config; Compose merges the service's volumes by target, so it replaces the named-volume mount rather than adding a second mount to /data/miner.
  • DEPLOYMENT.md — a new "Running fleet mode alongside ORB's ams-observability profile" section with the exact combined three-file docker compose -f … -f … -f … command.
  • Cross-link comment on the ams-reporting-exporter block in root docker-compose.yml pointing at that walkthrough.
  • .gitignore for the operator's copied docker-compose.miner.override.yml (only the .example is tracked).
  • A static parity test (test/unit/ams-observability-compose-parity.test.ts) that parses the three compose files and asserts the override's and exporter's bind sources match, the override replaces /data/miner with no duplicate-target collision, introduces no colliding top-level names, and that DEPLOYMENT.md documents the override + combined command + shared variable — so the two can never silently drift apart again the way the originals did.

The default (no-override) behavior of docker-compose.miner.yml is unchanged — the named-volume default stays for operators who don't need the observability bridge.

Scope

Validation

  • git diff --check
  • npm run typecheck clean
  • npm run test:coverage — the 5-case parity test passes. The primary artifacts (.example compose override, Markdown docs, root compose comment, .gitignore) sit outside src/** and aren't measured by Codecov's patch gate; no code under src/** was added, so there are no new coverable lines.
  • npm run selfhost:validate-observability — dashboards and alert rules still valid.
  • npm run docs:drift-check — passes.
  • The parity test statically validates the merged compose (via the yaml parser) — no Docker daemon required — asserting no service/volume/network name collisions between the three files, covering both the "paths match" (pass) and, by construction of the shared-source assertions, guarding the "paths could drift" failure mode.
  • Rebased onto the latest main immediately before pushing — no base conflict.

Per house style: no regression test applies — this is net-new interoperability tooling for a bridge that was never wired, not a fix to previously-working behavior.

If any required check was skipped, explain why:

  • actionlint, test:workers, ui:*, npm audit were not run — no workflow, worker, UI, or dependency surface changed. The full npm run test:ci runs them on CI.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, PATs, private keys, raw trust scores, private rankings, or private maintainer evidence exposed. The override ships no real host paths (a .example template with a documented default; the operator's real copy is gitignored), and the exporter's read-only + redaction behavior is unchanged.
  • Public GitHub text stays sanitized and low-noise.
  • Public docs updated (DEPLOYMENT.md); no changelog edited.

Auth/CORS/session, API/OpenAPI/MCP, and UI safety boxes are not applicable.

…y exporter

Fleet mode (docker-compose.miner.yml) keeps miner state in a named miner-data
volume, but ORB's ams-reporting-exporter reads the ledgers from a host bind
mount defaulting to ~/.config/loopover-miner, so the two never line up and the
Grafana AMS datasources stay silently empty (JSONbored#5805). Add an opt-in
docker-compose.miner.override.yml.example that relocates /data/miner onto the
SAME ${LOOPOVER_MINER_CONFIG_DIR:-~/.config/loopover-miner} host path the
exporter already uses, a DEPLOYMENT.md walkthrough with the combined three-file
command, a cross-link comment on the exporter block, and a gitignore for the
operator's copy. A static parity test asserts the override and exporter bind
sources match and the docs can't silently drift. Additive: the named-volume
default is unchanged for operators who don't enable observability.

Closes JSONbored#5805
@real-venus
real-venus requested a review from JSONbored as a code owner July 14, 2026 19:28
@superagent-security

Copy link
Copy Markdown
Contributor

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

@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.11%. Comparing base (90f477e) to head (07305f4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5844   +/-   ##
=======================================
  Coverage   95.11%   95.11%           
=======================================
  Files         587      587           
  Lines       46509    46509           
  Branches    14870    14870           
=======================================
  Hits        44238    44238           
  Misses       1515     1515           
  Partials      756      756           
Flag Coverage Δ
shard-1 43.34% <ø> (-0.42%) ⬇️
shard-2 36.19% <ø> (+<0.01%) ⬆️
shard-3 31.95% <ø> (-0.18%) ⬇️
shard-4 31.89% <ø> (-0.92%) ⬇️
shard-5 32.49% <ø> (+0.86%) ⬆️
shard-6 44.86% <ø> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out 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
@loopover-orb

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Tip

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

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-14 20:02:46 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds an opt-in docker-compose override that relocates fleet-mode's named-volume miner state onto the same host path the ams-observability exporter already reads via `${LOOPOVER_MINER_CONFIG_DIR:-~/.config/loopover-miner}`, plus DEPLOYMENT.md docs, a cross-link comment, gitignore entries, and a static parity test asserting the two bind sources match and the override replaces (not duplicates) the `/data/miner` target. The change is purely additive — it doesn't touch the base compose files' default behavior — and the parity test correctly parses all three YAML files and checks source/target alignment rather than fabricating a scenario. Design is sound: reusing the exact same env var + default is what keeps both profiles in sync automatically, and the comment correctly documents that compose merges `volumes` by target so the named-volume mount is cleanly superseded.

Nits — 5 non-blocking
  • packages/loopover-miner/docker-compose.miner.override.yml.example has ~24 lines of header comments for 2 lines of actual config — consider trimming to the essential WHY/HOW and pointing to DEPLOYMENT.md for the rest.
  • docker-compose.yml is already large (859 lines per the size-smell note) and this adds 3 more comment lines to an already sprawling file — not this PR's fault, but worth a future split into included compose fragments.
  • test/unit/ams-observability-compose-parity.test.ts:41 uses substring matching (`v.includes(':/data/miner')`) for sourceForTarget, which could false-match if a source path ever legitimately contains that exact string — low risk given controlled inputs but worth a comment noting the assumption.
  • The regex check in test/unit/ams-observability-compose-parity.test.ts:86 (`/fleet mode[\s\S]{0,200}ams-observability/i`) is a fairly loose free-text assertion on the cross-link comment and could pass on unrelated prose — a plain `.toContain()` on the actual comment line would be more precise.
  • Consider a short automated check (or at least a DEPLOYMENT.md callout) for the case where an operator already has fleet-mode data in the named volume and applies the override — historical data won't appear at the new bind path since the two are physically different stores; a one-line migration note (`docker cp`/`docker run --rm -v miner-data:/from -v $HOST:/to alpine cp -a /from/. /to`) would help.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5805
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low 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: 112 registered-repo PR(s), 59 merged, 17 issue(s).
Contributor context ✅ Confirmed Gittensor contributor real-venus; Gittensor profile; 112 PR(s), 17 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ⚠️ ℹ️ Insufficient signal risk: clean · value: insufficient-signal — Nothing measurable for the structural-improvement analyzers on this PR (e.g. no code files changed).
Review context
  • Author: real-venus
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 112 PR(s), 17 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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.
[BETA] Chat with Gittensory

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

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory 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/gittensory-commands

🟩 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 added the manual-review Gittensor contributor context label Jul 14, 2026
@JSONbored
JSONbored merged commit 15f6610 into JSONbored:main Jul 14, 2026
17 checks passed
This was referenced Jul 14, 2026
This was referenced Jul 15, 2026
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. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bridge fleet-mode AMS miner state to ORB's ams-observability Grafana profile

2 participants