Skip to content

fix(miner): make readMinRankAutotuneEnabled probe all four AMS policy filenames - #10215

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-10009
Jul 31, 2026
Merged

fix(miner): make readMinRankAutotuneEnabled probe all four AMS policy filenames#10215
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-10009

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

fix(miner): make readMinRankAutotuneEnabled probe all four AMS policy filenames

readMinRankAutotuneEnabled resolved only the canonical .loopover-ams.yml path,
so an operator whose policy lived at .github/loopover-ams.yml, .loopover-ams.json,
or .github/loopover-ams.json got their minRankAutotuneEnabled flag silently
ignored by discover and calibration apply/revert-min-rank, even though the same
file was already honoured at attempt time via resolveAmsPolicy. Export the
shared resolveLocalAmsPolicyReadPath resolver from ams-policy.ts and call it
here instead of recreating a second, narrower path lookup.

Closes #10009

… filenames

readMinRankAutotuneEnabled resolved only the canonical .loopover-ams.yml path,
so an operator whose policy lived at .github/loopover-ams.yml, .loopover-ams.json,
or .github/loopover-ams.json got their minRankAutotuneEnabled flag silently
ignored by discover and calibration apply/revert-min-rank, even though the same
file was already honoured at attempt time via resolveAmsPolicy. Export the
shared resolveLocalAmsPolicyReadPath resolver from ams-policy.ts and call it
here instead of recreating a second, narrower path lookup.
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 31, 2026 12:50
@loopover-orb

loopover-orb Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-31 13:01:34 UTC

4 files · 1 AI reviewer · no blockers · readiness 93/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This correctly fixes #10009 by having readMinRankAutotuneEnabled call the exported resolveLocalAmsPolicyReadPath instead of its own narrower resolveAmsPolicyConfigPath+existsSync check, so the flag is now honoured for all four documented AMS policy filenames instead of only the canonical .loopover-ams.yml, matching resolveAmsPolicy's attempt-time behavior. The refactor is a straightforward extract-and-reuse (ams-policy.ts:99-105) with no behavioral risk to the existing resolver logic itself, and is backed by thorough new regression tests covering all four filenames, first-match-wins precedence, and both explicit-path branches.

Nits — 5 non-blocking
  • The numbers '10009' and '8863' cited in the external brief are just issue-number references in comments (ams-calibration.ts:309, ams-policy.ts:99), not magic numbers needing a named constant — the brief's flag here is a false positive.
  • test/unit/miner-discover-cli.test.ts's new regression test duplicates the existing '.loopover-ams.yml' dry-run override test almost verbatim except for the file path; consider parameterizing both into one test.for..of over candidate paths.
  • ams-calibration.ts:309-315's doc comment is quite long for a one-line behavioral change; could be trimmed now that the historical canonical-only behavior is no longer relevant to future readers.
  • Consider adding a short CHANGELOG or migration note since this silently changes observed behavior for operators who were unknowingly relying on the flag being ignored outside .loopover-ams.yml (unlikely but worth a one-line mention in the PR description).
  • test/unit/miner-ams-calibration.test.ts's new 'first-match-wins' test is a good addition — no changes needed there.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #10009
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ⚠️ 20/25 Preflight is ready, but the PR body does not name the validation run.
Contributor workload ✅ 10/10 Author activity: 130 registered-repo PR(s), 92 merged, 3 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 130 PR(s), 3 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR exports resolveLocalAmsPolicyReadPath from ams-policy.ts and rewires readMinRankAutotuneEnabled to call it (threading the injected existsSync), matching the required pattern, while keeping the function synchronous and fail-closed, and adds regression tests covering all four candidate filenames, precedence, and explicit-path override behavior.

Review context
  • Author: bitfathers94
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 130 PR(s), 3 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add validation command/output.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.49%. Comparing base (cc9d102) to head (5d6af46).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10215      +/-   ##
==========================================
+ Coverage   80.47%   80.49%   +0.02%     
==========================================
  Files         282      284       +2     
  Lines       58844    59007     +163     
  Branches     6977     7047      +70     
==========================================
+ Hits        47354    47497     +143     
  Misses      11199    11199              
- Partials      291      311      +20     
Flag Coverage Δ
backend 87.73% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-miner/lib/ams-calibration.ts 84.49% <100.00%> (ø)
packages/loopover-miner/lib/ams-policy.ts 100.00% <ø> (ø)

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 447dff1 into JSONbored:main Jul 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

miner(ams-policy): readMinRankAutotuneEnabled probes one filename while the attempt-time resolver probes the documented four

1 participant