fix(miner): wire AMS policy resolver to the documented discovery order - #9106
Conversation
AMS_POLICY_SPEC_FILENAMES documented a 4-path first-match-wins discovery order "mirroring MINER_GOAL_SPEC_FILENAMES", but ams-policy.ts resolved policy from a single operator-config-dir filename (.loopover-ams.yml), never imported the constant, and had no fallback chain -- an operator using the .github/ or .json variants silently got defaults. Wire it up (issue option b): add a pure discoverAmsPolicySpecPath helper to the engine mirroring discoverMinerGoalSpecPath, and have the miner's readLocalAmsPolicyContent probe the full order inside the operator config directory. An explicit LOOPOVER_MINER_AMS_POLICY_PATH still bypasses discovery to one exact file. The config-dir resolution is factored into a shared resolveLocalStoreConfigDir so all LOOPOVER_MINER_CONFIG_DIR reads stay in local-store.ts and the generated env-reference is unchanged. Closes JSONbored#8863
|
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 #9106 +/- ##
=======================================
Coverage 93.88% 93.88%
=======================================
Files 812 812
Lines 80650 80662 +12
Branches 24470 24474 +4
=======================================
+ Hits 75721 75733 +12
Misses 3562 3562
Partials 1367 1367
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 18:15:21 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.
|
fix(miner): wire AMS policy resolver to the documented discovery order
AMS_POLICY_SPEC_FILENAMES documented a 4-path first-match-wins discovery
order "mirroring MINER_GOAL_SPEC_FILENAMES", but ams-policy.ts resolved
policy from a single operator-config-dir filename (.loopover-ams.yml),
never imported the constant, and had no fallback chain -- an operator
using the .github/ or .json variants silently got defaults.
Wire it up (issue option b): add a pure discoverAmsPolicySpecPath helper
to the engine mirroring discoverMinerGoalSpecPath, and have the miner's
readLocalAmsPolicyContent probe the full order inside the operator config
directory. An explicit LOOPOVER_MINER_AMS_POLICY_PATH still bypasses
discovery to one exact file. The config-dir resolution is factored into
a shared resolveLocalStoreConfigDir so all LOOPOVER_MINER_CONFIG_DIR reads
stay in local-store.ts and the generated env-reference is unchanged.
Closes #8863
Validation
Verified locally on this branch before opening:
npm run typechecknpx turbo run build:tsc build:verifynpm run test:coverage— patch coverage 100.0% of changed lines