Skip to content

fix(api): document ai-review-findings pull request route in openapi spec - #9417

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
nghetien:fix/issue-9305-a1-openapi-pulls-number-ai
Jul 27, 2026
Merged

fix(api): document ai-review-findings pull request route in openapi spec#9417
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
nghetien:fix/issue-9305-a1-openapi-pulls-number-ai

Conversation

@nghetien

Copy link
Copy Markdown
Contributor

Summary

The GET /v1/repos/{owner}/{repo}/pulls/{number}/ai-review-findings route has existed for a while, but it was never registered in the OpenAPI spec — unlike its maintainer-packet and reviewability siblings under the same /pulls/{number}/* path prefix.

This adds the missing documentation:

  • PullRequestAiReviewFindingsSchema in src/openapi/schemas.ts, built from the route's actual response shape (reusing the same fields as the existing prAiReviewFindingsOutputSchema MCP tool shape).
  • The path registration in src/openapi/spec.ts, including the login query parameter the route requires and its 400/403/404 responses.
  • Regenerated apps/loopover-ui/public/openapi.json (npm run ui:openapi).
  • A regression assertion in test/unit/openapi.test.ts so the path/schema can't silently disappear again.

Closes #9305

Scope

Validation

  • git diff --check
  • npm run typecheck
  • npm run ui:openapi:check
  • npx vitest run test/unit/openapi.test.ts
  • npx vitest run --changed=upstream/main --passWithNoTests (136 files / 1736 tests passed, run after rebasing onto latest main)
  • engine/mcp/miner builds (turbo run build --filter=@loopover/engine, --filter=@loopover/mcp, build:tsc build:verify --filter=@loopover/miner)

Safety

  • No secrets/wallet/hotkey/trust-score/reward data anywhere.
  • No auth/cookie/CORS/session changes.
  • OpenAPI contract updated and tested.
  • No UI/visual change — this only documents an existing, already-gated backend route.
  • No changelog edit.

UI Evidence

N/A — no visible UI change. This is purely an OpenAPI schema/path registration for an already-live backend route, plus the regenerated openapi.json artifact.

Notes

The route itself already existed with its access checks in place (requireContributorAccess + assertContributorOwnsPullRequest in src/api/routes.ts); this PR only closes the documentation gap so it shows up in the OpenAPI contract like its siblings.

nghetien added 2 commits July 27, 2026 23:39
Closes JSONbored#9305

The GET /v1/repos/{owner}/{repo}/pulls/{number}/ai-review-findings route
existed and was live, but was never registered in the OpenAPI spec, unlike
its maintainer-packet and reviewability siblings. Adds
PullRequestAiReviewFindingsSchema, registers the path (including its
login query param), and regenerates apps/loopover-ui/public/openapi.json.
…sue-9305-a1-openapi-pulls-number-ai

# Conflicts:
#	apps/loopover-ui/public/openapi.json
@nghetien
nghetien requested a review from JSONbored as a code owner July 27, 2026 17:21
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.64%. Comparing base (0a93e29) to head (9139046).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #9417       +/-   ##
===========================================
- Coverage   89.52%   75.64%   -13.88%     
===========================================
  Files         840      277      -563     
  Lines      109777    58361    -51416     
  Branches    26147     8206    -17941     
===========================================
- Hits        98275    44148    -54127     
- Misses      10239    13942     +3703     
+ Partials     1263      271      -992     
Flag Coverage Δ
backend 99.69% <100.00%> (+4.45%) ⬆️

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

Files with missing lines Coverage Δ
src/openapi/schemas.ts 100.00% <100.00%> (ø)
src/openapi/spec.ts 99.50% <100.00%> (+<0.01%) ⬆️

... 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 27, 2026
@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-27 18:02:26 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The AI review returned non-blocking notes for this change but did not include a separate narrative summary. Review the nits below before deciding this PR.

Nits — 4 non-blocking
  • schemas.ts:2833 makes `headSha` optional in addition to nullable, but the description doesn't clarify whether the field is ever omitted entirely vs. just null — worth confirming against the actual route handler so the contract isn't looser than reality.
  • The external size-smell flags on openapi.json/schemas.ts/spec.ts are pre-existing long files, not something this diff meaningfully worsens — not actionable here.
  • Confirm the linked issue openapi: pulls/:number/ai-review-findings missing from spec, unlike its maintainer-packet + reviewability siblings #9305 is indeed about this missing-route-documentation gap so the issue-scope requirement is unambiguous.
  • Consider verifying `categoryCounts` values in the schema always come back as plain numbers (not undefined) so `z.record(z.string(), z.number())` doesn't reject a real response.

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 #9305
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: 14 registered-repo PR(s), 7 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor nghetien; Gittensor profile; 14 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The PR adds PullRequestAiReviewFindingsSchema in schemas.ts, registers the GET /pulls/{number}/ai-review-findings path in spec.ts mirroring the sibling patterns, regenerates openapi.json, and adds regression assertions covering both the path and schema keys.

Review context
  • Author: nghetien
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Dart, JavaScript, Python, CSS, C#, C++, TypeScript
  • Official Gittensor activity: 14 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.

Decision record
  • action: merge · clause: success
  • config: 880f7f2f791554bb185ac1707c083434bb87378275801e67888915c88211a699 · pack: oss-anti-slop · ci: passed
  • record: cbe047ebae2941af90ef8fbf01a0ea29dfb263d5f1daac07daf58eb65622a129 (schema v5, head 9139046)
Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/ before / (scroll)
before / (scroll)
after / (scroll)
after / (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

🟩 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 726a12e into JSONbored:main Jul 27, 2026
10 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.

openapi: pulls/:number/ai-review-findings missing from spec, unlike its maintainer-packet + reviewability siblings

1 participant