Skip to content

fix(miner): resolve status.ts's monorepo-sibling paths at the compiled dist/lib depth - #8636

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

fix(miner): resolve status.ts's monorepo-sibling paths at the compiled dist/lib depth#8636
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-8630

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

The 2026-07-24 out-of-place dist/ emit migration (c896797) added a directory
level between the compiled CLI and its monorepo siblings, and introduced
resolveMonorepoSiblingPath to try both the source (lib/) and compiled (dist/lib/)
depths. That helper was wired into two of the four sibling-path call sites in
status.ts, but the other two were left on the pre-migration hardcoded
join(moduleDir(), "../../loopover-engine/package.json"), which only resolves
correctly from lib/:

  • readInstalledEnginePackageVersion's catch-all workspace fallback returned null
    from the real compiled CLI instead of finding the workspace engine version.
  • readExpectedEnginePackageVersion's monorepo-engine check always missed, so it
    always fell through to the static expected-engine.version pin even when a live
    packages/loopover-engine/package.json was present.

Route both through resolveMonorepoSiblingPath (now taking the module dir as an
explicit argument so tests can simulate the dist/lib depth without a real build),
and add regression tests covering both fixed call sites from a simulated dist/lib
depth — including every branch of the now-reachable catch block, whose
/* v8 ignore next 9 */ annotation is removed.

Closes #8630

…d dist/lib depth

The 2026-07-24 out-of-place dist/ emit migration (c896797) added a directory
level between the compiled CLI and its monorepo siblings, and introduced
resolveMonorepoSiblingPath to try both the source (lib/) and compiled (dist/lib/)
depths. That helper was wired into two of the four sibling-path call sites in
status.ts, but the other two were left on the pre-migration hardcoded
join(moduleDir(), "../../loopover-engine/package.json"), which only resolves
correctly from lib/:

- readInstalledEnginePackageVersion's catch-all workspace fallback returned null
  from the real compiled CLI instead of finding the workspace engine version.
- readExpectedEnginePackageVersion's monorepo-engine check always missed, so it
  always fell through to the static expected-engine.version pin even when a live
  packages/loopover-engine/package.json was present.

Route both through resolveMonorepoSiblingPath (now taking the module dir as an
explicit argument so tests can simulate the dist/lib depth without a real build),
and add regression tests covering both fixed call sites from a simulated dist/lib
depth — including every branch of the now-reachable catch block, whose
/* v8 ignore next 9 */ annotation is removed.

Closes JSONbored#8630
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 25, 2026 16:25
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.62%. Comparing base (e62f6f1) to head (47a6ba2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8636      +/-   ##
==========================================
- Coverage   93.76%   90.62%   -3.15%     
==========================================
  Files         798       97     -701     
  Lines       79464    22661   -56803     
  Branches    24078     3952   -20126     
==========================================
- Hits        74512    20536   -53976     
+ Misses       3566     1945    -1621     
+ Partials     1386      180    -1206     
Flag Coverage Δ
backend 98.83% <100.00%> (+3.79%) ⬆️

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/status.ts 98.83% <100.00%> (+1.33%) ⬆️

... and 701 files with indirect coverage changes

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

loopover-orb Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-25 16:29:40 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This correctly routes the two remaining hardcoded `../../loopover-engine/package.json` lookups in status.ts through the depth-flexible resolveMonorepoSiblingPath, matching the two call sites already fixed in the prior migration, and closes the two dead branches (workspace-fallback catch-all and the monorepo-engine check in readExpectedEnginePackageVersion) that #8630 flagged as unreachable from the compiled dist/lib depth. Both functions gain injectable `dir`/`resolveEntry` params defaulting to the real values, which is exactly the pattern buildEngineVersionSkewCheck already used, and the new tests exercise every branch of the previously-ignored catch block (found, versionless, malformed JSON, absent) from a simulated dist/lib depth. The fix is traced correctly to the source: resolveMonorepoSiblingPath now takes `dir` as an explicit argument instead of always calling moduleDir() internally, so tests can simulate the extra nesting level without a real build.

Nits — 2 non-blocking
  • status.ts:186-188 duplicates `resolveMonorepoSiblingPath(dir, "..", "loopover-engine", "package.json")` in both the try and catch paths of readInstalledEnginePackageVersion — could be hoisted to a single local before the try to avoid the redundant computation on the success path.
  • Consider computing `workspacePkg` once above the try/catch in readInstalledEnginePackageVersion (status.ts) since it's now identical in both branches.

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 #8630
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 ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 45 registered-repo PR(s), 28 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 45 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff routes both remaining hardcoded-depth call sites (readInstalledEnginePackageVersion's catch-all fallback and readExpectedEnginePackageVersion's monorepoEnginePkg argument) through the depth-flexible resolveMonorepoSiblingPath, and adds regression tests simulating the dist/lib depth for both call sites, including the previously v8-ignored catch-all branches.

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: TypeScript
  • Official Gittensor activity: 45 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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 &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; 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

@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 ee390f5 into JSONbored:main Jul 25, 2026
8 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 25, 2026
7 tasks
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.

fix(miner): status.ts's two remaining monorepo-sibling path lookups still use the pre-dist-migration hardcoded depth

1 participant