Skip to content

fix(review): skip unlinked-issue verify rate ceiling without AI binding (#8356)#8446

Merged
JSONbored merged 4 commits into
JSONbored:mainfrom
jsdevninja:fix/unlinked-issue-verify-rate-no-ai
Jul 24, 2026
Merged

fix(review): skip unlinked-issue verify rate ceiling without AI binding (#8356)#8446
JSONbored merged 4 commits into
JSONbored:mainfrom
jsdevninja:fix/unlinked-issue-verify-rate-no-ai

Conversation

@jsdevninja

Copy link
Copy Markdown
Contributor

Summary

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Focused coverage for the changed module: npx vitest run test/unit/unlinked-issue-guardrail.test.ts --coverage --coverage.include=src/review/unlinked-issue-guardrail.ts100% branches / 100% lines on unlinked-issue-guardrail.ts (37 tests). No UI/API surface change.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — backend review-guardrail fix only; no visible UI change.

Notes

  • Regression: with env.AI absent / non-callable, many candidate checks leave the verify-attempt audit count at 0; with a callable binding, attempts are recorded as before.

@jsdevninja
jsdevninja requested a review from JSONbored as a code owner July 24, 2026 13:24
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.61%. Comparing base (9adcccb) to head (d5fb07d).
⚠️ Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8446      +/-   ##
==========================================
- Coverage   92.50%   89.61%   -2.89%     
==========================================
  Files         791       98     -693     
  Lines       79333    22778   -56555     
  Branches    23960     3890   -20070     
==========================================
- Hits        73386    20413   -52973     
+ Misses       4807     2187    -2620     
+ Partials     1140      178     -962     
Flag Coverage Δ
shard-1 100.00% <100.00%> (+44.48%) ⬆️
shard-2 15.27% <0.00%> (-34.63%) ⬇️
shard-3 61.11% <0.00%> (+4.24%) ⬆️

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

Files with missing lines Coverage Δ
src/review/unlinked-issue-guardrail.ts 100.00% <100.00%> (ø)

... and 693 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 24, 2026
@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-24 15:41:39 UTC

2 files · 1 AI reviewer · no blockers · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This PR gates recordUnlinkedIssueVerifyAttempt on hasUnlinkedIssueVerifyAiBinding(env), mirroring the existing spend-budget gate below it, so self-host/no-AI environments no longer burn the per-actor rate ceiling on no-op NO_MATCH checks while still failing closed. The change correctly checks the AI binding once per candidate and reuses that boolean for both the attempt-recording gate and the existing usage-recording gate, avoiding duplicate calls to hasUnlinkedIssueVerifyAiBinding. Tests cover the no-binding case across many candidates/PRs (rate ceiling stays at 0), the non-function `run` case, and confirm normal recording resumes once a real AI binding is present.

Nits — 3 non-blocking
  • The two nearly-identical inline comments in unlinked-issue-guardrail.ts:245-246 and the one above `recordUnlinkedIssueVerifyUsage`'s call site restate the same rationale twice in the loop body; consider consolidating into one comment above `hadAiBinding`.
  • `hasUnlinkedIssueVerifyAiBinding(env)` is now called once per candidate inside the loop even though the binding can't change PR-to-loop; hoisting it above the `for` loop (like the rate/budget checks) would be marginally cleaner, though this is a non-issue performance-wise since it's a cheap typeof check.
  • Consider hoisting `const hadAiBinding = hasUnlinkedIssueVerifyAiBinding(env);` above the `for` loop in src/review/unlinked-issue-guardrail.ts:244 since it's loop-invariant, matching the style of the rate/budget checks already hoisted above the loop.

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 #8356
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: 223 registered-repo PR(s), 133 merged, 39 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jsdevninja; Gittensor profile; 223 PR(s), 39 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The diff moves the hasUnlinkedIssueVerifyAiBinding check ahead of recordUnlinkedIssueVerifyAttempt and gates the call on hadAiBinding, exactly matching the requested reordering, and adds tests confirming the rate ceiling isn't consumed without a binding while normal recording still occurs when AI is present.

Review context
  • Author: jsdevninja
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Swift, C, CSS, MDX, Python, TypeScript, Vue
  • Official Gittensor activity: 223 PR(s), 39 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
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 added the manual-review Gittensor contributor context label Jul 24, 2026
@JSONbored
JSONbored merged commit ac5ffbd into JSONbored:main Jul 24, 2026
4 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. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(review): unlinked-issue-match rate ceiling accumulates spend even when no AI binding is available to verify

2 participants