Context
scripts/export-miner-prometheus-textfile.sh (#4839) bridges the AMS miner's four one-shot CLI metrics
commands into a node_exporter textfile-collector .prom file. Its binary-invocation default is stale:
MINER_BIN="${LOOPOVER_MINER_BIN:-gittensory-miner}"
gittensory-miner is not an installable binary. packages/loopover-miner/package.json's bin field only
exposes:
"bin": {
"loopover-miner": "bin/loopover-miner.js",
"loopover-miner-mcp": "bin/loopover-miner-mcp.js"
},
confirmed as a deliberate, final cutover (no alias) by packages/loopover-mcp/CHANGELOG.md: "gittensory-miner,
gittensory-miner-mcp, and gittensory-mcp no longer exist as installed binaries; use loopover-miner,
loopover-miner-mcp, and loopover-mcp. No dual-read/alias... A global npm install/link of the old package
names must be reinstalled."
Practical effect: the script's own header comment says it's meant to be wired into "your own cron/systemd
timer alongside node_exporter" with zero other configuration implied. An operator who does exactly that —
runs the script with no LOOPOVER_MINER_BIN override, the documented/expected path — gets command not found: gittensory-miner (exit 127) on the very first export_family call. Because export_family is
fail-open per family (mirroring export-ams-reporting-db.sh's philosophy, per this script's own comment),
all four metric families silently fail on every run rather than the export erroring loudly once, so the
.prom file is simply never populated and the failure is easy to miss in a cron/systemd journal.
Requirements
- Change the default
MINER_BIN fallback from gittensory-miner to loopover-miner, matching the package's
real bin entry.
- Leave the
LOOPOVER_MINER_BIN override mechanism itself unchanged — this only fixes the default value an
operator gets when they don't set it.
- Do not change
OUT_FILE's default filename (gittensory_miner.prom) as part of this fix unless doing so
cleanly — that's a cosmetic naming choice, not a functional break like the binary name; note in the PR
description whether it was touched or deliberately left alone.
Deliverables
Test Coverage Requirements
scripts/** is outside src/** / Codecov's coverage.include, so patch coverage does not gate this
directly. Add a real Vitest test (same pattern as test/unit/miner-docker-compose.test.ts: readFileSync the
script and assert on its content) so the correct default is enforced going forward.
Expected Outcome
Running sh scripts/export-miner-prometheus-textfile.sh with no LOOPOVER_MINER_BIN override successfully
invokes the real loopover-miner binary for all four metric families and produces a populated .prom file,
matching the zero-extra-configuration promise in the script's own header comment.
Links & Resources
Context
scripts/export-miner-prometheus-textfile.sh(#4839) bridges the AMS miner's four one-shot CLI metricscommands into a
node_exportertextfile-collector.promfile. Its binary-invocation default is stale:MINER_BIN="${LOOPOVER_MINER_BIN:-gittensory-miner}"gittensory-mineris not an installable binary.packages/loopover-miner/package.json'sbinfield onlyexposes:
confirmed as a deliberate, final cutover (no alias) by
packages/loopover-mcp/CHANGELOG.md: "gittensory-miner,gittensory-miner-mcp, andgittensory-mcpno longer exist as installed binaries; useloopover-miner,loopover-miner-mcp, andloopover-mcp. No dual-read/alias... A global npm install/link of the old packagenames must be reinstalled."
Practical effect: the script's own header comment says it's meant to be wired into "your own cron/systemd
timer alongside node_exporter" with zero other configuration implied. An operator who does exactly that —
runs the script with no
LOOPOVER_MINER_BINoverride, the documented/expected path — getscommand not found: gittensory-miner(exit 127) on the very firstexport_familycall. Becauseexport_familyisfail-open per family (mirroring
export-ams-reporting-db.sh's philosophy, per this script's own comment),all four metric families silently fail on every run rather than the export erroring loudly once, so the
.promfile is simply never populated and the failure is easy to miss in a cron/systemd journal.Requirements
MINER_BINfallback fromgittensory-minertoloopover-miner, matching the package'sreal
binentry.LOOPOVER_MINER_BINoverride mechanism itself unchanged — this only fixes the default value anoperator gets when they don't set it.
OUT_FILE's default filename (gittensory_miner.prom) as part of this fix unless doing socleanly — that's a cosmetic naming choice, not a functional break like the binary name; note in the PR
description whether it was touched or deliberately left alone.
Deliverables
scripts/export-miner-prometheus-textfile.sh: defaultMINER_BINfixed toloopover-miner.test/unit/) asserting the script's defaultMINER_BINfallback stringis
loopover-miner, notgittensory-miner.Test Coverage Requirements
scripts/**is outsidesrc/**/ Codecov'scoverage.include, so patch coverage does not gate thisdirectly. Add a real Vitest test (same pattern as
test/unit/miner-docker-compose.test.ts:readFileSyncthescript and assert on its content) so the correct default is enforced going forward.
Expected Outcome
Running
sh scripts/export-miner-prometheus-textfile.shwith noLOOPOVER_MINER_BINoverride successfullyinvokes the real
loopover-minerbinary for all four metric families and produces a populated.promfile,matching the zero-extra-configuration promise in the script's own header comment.
Links & Resources
packages/loopover-miner/package.json— the authoritativebinfield.packages/loopover-mcp/CHANGELOG.md/packages/loopover-miner/CHANGELOG.md— confirm the hard-cutoverbinary rename with no alias.
packages/loopover-miner/docs/observability.md— the doc this script's header points operators at forwiring instructions.
failure mode: a nonexistent default binary name, not a doc/profile/metric gap).