Context
packages/loopover-miner/bin/loopover-miner.js:40-45's loadMinerFileSecrets() catch block calls process.exit(1) on failure. But packages/loopover-miner/docs/unattended-scheduling.md:15-18's documented exit-code contract only covers 0 (success) and 2 (failure — "Alert on this"). An operator wiring alerting strictly to exit code 2, per the doc's own phrasing, misses this real, reachable failure path — a broken GITHUB_TOKEN_FILE or similar secret-mount misconfiguration. The underlying throw comes from lib/env-file-indirection.js's loadMinerFileSecrets.
Requirements
- Change
bin/loopover-miner.js:40-45's catch block to exit with code 2 (matching the documented contract) instead of 1, so this failure path is captured by an operator's existing exit-code-2 alerting.
- Double-check no other startup failure path in this same file uses exit code
1 for a similarly-reachable failure — if so, fix those too as part of the same pass (same root cause, same fix).
- Do not change
lib/env-file-indirection.js's loadMinerFileSecrets itself — the throw behavior is correct, only the exit-code translation at the CLI boundary is wrong.
Test Coverage Requirements
99%+ Codecov patch coverage on the changed exit-code path; add/update a CLI test asserting exit code 2 (not 1) on a simulated secret-mount failure.
Deliverables
Expected Outcome
An operator's exit-code-2 alerting catches a broken secret mount, matching the documented 0/2 exit-code contract.
Links & Resources
packages/loopover-miner/bin/loopover-miner.js:40-45
packages/loopover-miner/docs/unattended-scheduling.md:15-18
packages/loopover-miner/lib/env-file-indirection.js (loadMinerFileSecrets)
Context
packages/loopover-miner/bin/loopover-miner.js:40-45'sloadMinerFileSecrets()catch block callsprocess.exit(1)on failure. Butpackages/loopover-miner/docs/unattended-scheduling.md:15-18's documented exit-code contract only covers0(success) and2(failure — "Alert on this"). An operator wiring alerting strictly to exit code2, per the doc's own phrasing, misses this real, reachable failure path — a brokenGITHUB_TOKEN_FILEor similar secret-mount misconfiguration. The underlying throw comes fromlib/env-file-indirection.js'sloadMinerFileSecrets.Requirements
bin/loopover-miner.js:40-45's catch block to exit with code2(matching the documented contract) instead of1, so this failure path is captured by an operator's existing exit-code-2 alerting.1for a similarly-reachable failure — if so, fix those too as part of the same pass (same root cause, same fix).lib/env-file-indirection.js'sloadMinerFileSecretsitself — the throw behavior is correct, only the exit-code translation at the CLI boundary is wrong.Test Coverage Requirements
99%+ Codecov patch coverage on the changed exit-code path; add/update a CLI test asserting exit code
2(not1) on a simulated secret-mount failure.Deliverables
2.Expected Outcome
An operator's exit-code-2 alerting catches a broken secret mount, matching the documented 0/2 exit-code contract.
Links & Resources
packages/loopover-miner/bin/loopover-miner.js:40-45packages/loopover-miner/docs/unattended-scheduling.md:15-18packages/loopover-miner/lib/env-file-indirection.js(loadMinerFileSecrets)