Skip to content

fix(miner): apply isValidRepoSegment to four normalizeRepoFullName parsers (#7795) - #7889

Closed
RealDiligent wants to merge 1 commit into
JSONbored:mainfrom
RealDiligent:fix/normalize-repo-path-safety-7795-v2
Closed

fix(miner): apply isValidRepoSegment to four normalizeRepoFullName parsers (#7795)#7889
RealDiligent wants to merge 1 commit into
JSONbored:mainfrom
RealDiligent:fix/normalize-repo-path-safety-7795-v2

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

Notes

Test plan

  • Unit regression cases on all four modules
  • CI green (no follow-up pushes)

Fixes #7795

Made with Cursor

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 21, 2026 16:12
…rsers (JSONbored#7795)

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.72%. Comparing base (e7e10e7) to head (e52ecc7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/loopover-miner/lib/contribution-profile-cache.ts 0.00% 2 Missing ⚠️
packages/loopover-miner/lib/prediction-ledger.ts 0.00% 1 Missing ⚠️
packages/loopover-miner/lib/replay-snapshot.ts 0.00% 1 Missing ⚠️
packages/loopover-miner/lib/run-state.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7889      +/-   ##
==========================================
- Coverage   91.39%   87.72%   -3.68%     
==========================================
  Files         730       92     -638     
  Lines       74774    21487   -53287     
  Branches    22818     3733   -19085     
==========================================
- Hits        68343    18849   -49494     
+ Misses       5389     2460    -2929     
+ Partials     1042      178     -864     
Flag Coverage Δ
shard-1 0.00% <0.00%> (-58.57%) ⬇️
shard-2 0.00% <0.00%> (-51.85%) ⬇️
shard-3 0.00% <0.00%> (-50.22%) ⬇️

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/prediction-ledger.ts 0.00% <0.00%> (-80.60%) ⬇️
packages/loopover-miner/lib/replay-snapshot.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/loopover-miner/lib/run-state.ts 0.00% <0.00%> (-100.00%) ⬇️
...s/loopover-miner/lib/contribution-profile-cache.ts 0.00% <0.00%> (-100.00%) ⬇️

... and 638 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 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-21 16:26:07 UTC

8 files · 1 AI reviewer · no blockers · CI failing · unstable

🛑 Suggested Action - Fix Blockers

Review summary
This PR applies the existing `isValidRepoSegment` guard (already used by `miner-claim-ledger`, per #5831) to the four remaining `normalizeRepoFullName` parsers that skipped it — contribution-profile-cache, prediction-ledger, replay-snapshot, and run-state — closing a path-traversal/invalid-character gap consistently across the module. The fix is applied at the correct source layer (the shared normalize function each store calls before any DB/filesystem use of the repo name), each change is paired with a regression test mirroring the established `../etc` / `o/..` / `o baz/a` cases, and the diff is narrowly scoped to exactly the stated fix with no unrelated changes.

Nits — 4 non-blocking
  • Each file duplicates the same 4-line `isValidRepoSegment` check inline; consider centralizing the full `normalizeRepoFullName` logic (or at least the segment-validation call) in one shared helper in local-store.js or repo-clone.js to prevent a sixth parser from being added later without the guard.
  • The codecov/patch failure (0.00% diff coverage) is likely a coverage-tool artifact given the added regression tests directly exercise every new line — worth confirming the coverage report is picking up the right test files rather than an actual gap.
  • Factor the now-five-times-repeated `normalizeRepoFullName` body into a single exported helper (e.g. in repo-clone.js) that all five stores call, so future new stores can't reintroduce this gap.
  • Consider a lint rule or a repo-wide grep-based check (as done here) run in CI to catch any future `normalizeRepoFullName`-shaped function missing the `isValidRepoSegment` guard.

CI checks failing

  • codecov/patch — 0.00% of diff hit (target 99.00%)

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 #7882, #7795
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 (2 linked issues).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 387 registered-repo PR(s), 179 merged, 36 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 387 PR(s), 36 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff applies isValidRepoSegment guards to all four named parsers (contribution-profile-cache, prediction-ledger, replay-snapshot, run-state) and adds matching regression tests for the ../etc, o/.., and o baz/a cases across each module, fulfilling the stated scope.

Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, Ruby, Svelte, TypeScript, Markdown, MDX
  • Official Gittensor activity: 387 PR(s), 36 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 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

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.

4 sibling normalizeRepoFullName parsers still skip the path-safety guard #5831/#7525 already added to every other sibling

1 participant