⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
apps/loopover-ui/src/lib/miner-commands.ts (107 lines) has zero direct test coverage anywhere in
the repo. Its sole consumer, miner-panel.test.tsx, never exercises buildMinerCommandActions or
sanitizeMinerCommand directly. This module specifically redacts terms this repo's own house rules
forbid from ever reaching a public surface (wallet|hotkey|coldkey|mnemonic|trust score-shaped
patterns) — a security/compliance-relevant function with no regression protection at all. A future
refactor could silently break the redaction logic and no test would catch it.
Requirements
- Add a dedicated test file for
miner-commands.ts directly exercising buildMinerCommandActions
and sanitizeMinerCommand, not relying on indirect coverage through miner-panel.test.tsx.
- Cover, at minimum: a command containing each of the forbidden term categories (wallet, hotkey,
coldkey, mnemonic, trust score — matching whatever exact pattern sanitizeMinerCommand uses), a
command containing none of them (passthrough case), and buildMinerCommandActions's branch
structure (every conditional path in the function).
Deliverables
All three Deliverables are required in the same PR.
Test Coverage Requirements
apps/** is excluded from codecov/patch gating, but apps/loopover-ui's own local vitest
coverage thresholds (branch-level) apply — this module currently has 0% direct coverage; the new
test file must bring both functions to full branch coverage.
Expected Outcome
miner-commands.ts's redaction logic — which exists specifically to keep forbidden sensitive terms
out of a public-facing surface — has direct, explicit regression-test coverage, so a future
refactor that weakens the redaction is caught immediately instead of silently shipping.
Links & Resources
apps/loopover-ui/src/lib/miner-commands.ts (the module to test)
apps/loopover-ui/src/components/site/app-panels/miner-panel.test.tsx (existing indirect-only
coverage)
Context
apps/loopover-ui/src/lib/miner-commands.ts(107 lines) has zero direct test coverage anywhere inthe repo. Its sole consumer,
miner-panel.test.tsx, never exercisesbuildMinerCommandActionsorsanitizeMinerCommanddirectly. This module specifically redacts terms this repo's own house rulesforbid from ever reaching a public surface (
wallet|hotkey|coldkey|mnemonic|trust score-shapedpatterns) — a security/compliance-relevant function with no regression protection at all. A future
refactor could silently break the redaction logic and no test would catch it.
Requirements
miner-commands.tsdirectly exercisingbuildMinerCommandActionsand
sanitizeMinerCommand, not relying on indirect coverage throughminer-panel.test.tsx.coldkey, mnemonic, trust score — matching whatever exact pattern
sanitizeMinerCommanduses), acommand containing none of them (passthrough case), and
buildMinerCommandActions's branchstructure (every conditional path in the function).
Deliverables
sanitizeMinerCommandagainst each forbidden-termcategory it's designed to redact, asserting the sensitive term never appears in the output.
buildMinerCommandActions's full branch coverage.unmodified (or handled per the function's actual documented contract).
All three Deliverables are required in the same PR.
Test Coverage Requirements
apps/**is excluded fromcodecov/patchgating, butapps/loopover-ui's own local vitestcoverage thresholds (branch-level) apply — this module currently has 0% direct coverage; the new
test file must bring both functions to full branch coverage.
Expected Outcome
miner-commands.ts's redaction logic — which exists specifically to keep forbidden sensitive termsout of a public-facing surface — has direct, explicit regression-test coverage, so a future
refactor that weakens the redaction is caught immediately instead of silently shipping.
Links & Resources
apps/loopover-ui/src/lib/miner-commands.ts(the module to test)apps/loopover-ui/src/components/site/app-panels/miner-panel.test.tsx(existing indirect-onlycoverage)