fix(miner): AmsPolicySpec parse warnings are computed but never surfaced to the operator - #8978
Conversation
…ced to the operator Fixes JSONbored#8853
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8978 +/- ##
==========================================
+ Coverage 90.56% 90.79% +0.23%
==========================================
Files 96 99 +3
Lines 22490 23052 +562
Branches 3884 4076 +192
==========================================
+ Hits 20367 20929 +562
Misses 1945 1945
Partials 178 178
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 15:00:33 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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.
|
Summary
resolveAmsPolicy()(packages/loopover-miner/lib/ams-policy.ts:18-22,53-63,74-88) returns awarnings: string[]specifically to surface a malformed.loopover-ams.ymlfield (per-field messages generated atpackages/loopover-engine/src/ams-policy-spec.ts:163,170,179,188,195,213, e.g.AmsPolicySpec field "capLimits" must be a mapping; falling back to defaults.)..loopover-ams.yml.exampleexplicitly documents "a single malformed field falls back to its default with a warning." But the only two real callers,packages/loopover-miner/lib/attempt-cli.ts(lines 693,758,775,874-875,995) andpackages/loopover-miner/lib/loop-cli.ts(lines 309,434-437), read only.specand discard.warnings/.sourceentirely -- never logged or printed. This contradicts the package's own stated design philosophy, honored elsewhere in the same package:discover-cli.ts:406printsai-policy warnings: ${result.warnings.length}and line 424 explicitly surfaces a goal-spec fallback rather than staying silent (README:43-44's documented rationale, "explicit rather than silent"). Additionally,readLocalAmsPolicyContent(ams-policy.ts:53-63) treats an unreadable existing file identically to an absent one (source: "default", warnings: []either way), so a permissions error on an operator's real policy file is indistinguishable from never having configured one.Deliverables
attempt-cli.tsprints non-emptyamsPolicy.warningsin both human and--jsonoutput modesloop-cli.tsprints non-emptyamsPolicy.warningsin both human and--jsonoutput modes.loopover-ams.ymlfixture produces visible warning output (not just a silently-defaulted policy)All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test plan
packages/loopover-miner/**-- 99%+ patch coverage on both changed files, covering the non-empty-warnings branch in both human and JSON modes.Fixes #8853