Skip to content

feat(orb): gate APR repo-transfer on trusted idea completion - #8001

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jsdevninja:feat/apr-request-transfer-trusted
Jul 22, 2026
Merged

feat(orb): gate APR repo-transfer on trusted idea completion#8001
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jsdevninja:feat/apr-request-transfer-trusted

Conversation

@jsdevninja

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • Unit: eligibility; request uses trusted lookup; incomplete never calls initiate; injectable complete path initiates / surfaces failure
  • Route: 409 under default fail-closed lookup; 400 on smuggled ideaComplete; 202/502 when lookup mocked complete; optional ideaId forwarded; no wallet/hotkey/trust-score leakage
  • npm run typecheck
  • Focused vitest: orb-apr-repo-transfer + routes-request-apr-transfer (21 passing)

Closes JSONbored#7742. Customer-request-only APR transfer via POST
/v1/loop/request-apr-transfer; ideaComplete comes from a fail-closed
server lookup (not the request body), so callers cannot bypass the
JSONbored#7591 completion gate. Strict body schema rejects smuggled fields.
@jsdevninja
jsdevninja requested a review from JSONbored as a code owner July 22, 2026 06:00
@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:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 22, 2026
@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-22 06:07:06 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds a customer-facing APR transfer-request endpoint gated on a fail-closed, server-side idea-completion lookup (currently hardcoded to always return incomplete), with a `.strict()` Zod schema that rejects any attempt to smuggle `ideaComplete` in the request body — directly closing the #8000 Superagent P1. The implementation is correct: `requestAprRepoTransfer` never calls `initiateAprRepoTransfer` (and thus never contacts GitHub) unless the trusted lookup reports complete, and the route correctly maps rejected/failed/initiated to 409/502/202. Test coverage is thorough (eligibility, gate short-circuiting, route status codes, schema strictness, no-leak assertions) and traces the real path rather than a fabricated one.

Nits — 5 non-blocking

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 #7742
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: 210 registered-repo PR(s), 132 merged, 37 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jsdevninja; Gittensor profile; 210 PR(s), 37 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff adds a customer-request-only requestAprRepoTransfer path and REST route gated on a server-side loadAprIdeaCompletion signal (fail-closed until #7591/#7664 persist it), rejects client-supplied ideaComplete via a strict schema, ignores plan/tier fields, and includes tests confirming no auto-offer path exists, matching the deliverables in the issue.

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: 210 PR(s), 37 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 <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

@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 162b7cb into JSONbored:main Jul 22, 2026
10 checks passed
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.79%. Comparing base (24ddd19) to head (1faaa18).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8001      +/-   ##
==========================================
- Coverage   91.92%   89.79%   -2.14%     
==========================================
  Files         740       97     -643     
  Lines       75933    24344   -51589     
  Branches    23040     4579   -18461     
==========================================
- Hits        69803    21860   -47943     
+ Misses       5037     2214    -2823     
+ Partials     1093      270     -823     
Flag Coverage Δ
shard-1 28.19% <100.00%> (-30.23%) ⬇️
shard-2 44.25% <9.52%> (-8.25%) ⬇️
shard-3 72.00% <9.52%> (+22.66%) ⬆️

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

Files with missing lines Coverage Δ
src/api/routes.ts 95.18% <100.00%> (+0.01%) ⬆️
src/orb/apr-idea-completion.ts 100.00% <100.00%> (ø)
src/orb/apr-repo-transfer.ts 100.00% <100.00%> (ø)

... and 644 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decide policy for when an APR repo-transfer offer is surfaced to a customer (deferred from #7638)

1 participant