Skip to content

fix(openapi): document contributor watches GET/POST/DELETE - #9456

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
andriypolanski:fix/9306-openapi-contributor-watches
Jul 27, 2026
Merged

fix(openapi): document contributor watches GET/POST/DELETE #9456
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
andriypolanski:fix/9306-openapi-contributor-watches

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

Why #9446 closed

PR #9446 had green CI and no review blockers, but was auto-closed for a base-branch conflict. This is a fresh reimplementation on current upstream/main.

Competing open PR

#9453 is also open for #9306. Do not open this branch while #9453 is still mergeable unless racing it — same issue / same OpenAPI surfaces.

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 ui:openapi + npm run ui:openapi:check
  • npx vitest run test/unit/openapi.test.ts — 10 passed
  • npm run test:ci (full gate; run before push)
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

OpenAPI documentation + regeneration + targeted contract test complete. Full test:ci left for the opener.

Safety

  • No secrets, wallets, hotkeys, trust scores, or reward values.
  • Does not touch site/, CNAME, **/lovable/**, or root CHANGELOG.md.

UI Evidence

N/A — OpenAPI contract / generated openapi.json only; no product UI change.

Notes for reviewers / gate

  • No production route behavior change — documentation parity only.
  • After other OpenAPI PRs land, rebase and re-run npm run ui:openapi rather than hand-merging openapi.json.

andriy-polanski and others added 2 commits July 27, 2026 19:32
…#9306)

GET/POST/DELETE /v1/contributors/{login}/watches were live (REST mirror of
loopover_watch_issues) but absent from OpenAPI. Add MCP-aligned request and
response schemas, register all three verbs, regenerate openapi.json, and add
a field-parity regression test. Replaces conflict-closed PR 9446 on current main.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 27, 2026
@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 76.13%. Comparing base (c8c9e44) to head (3d7db53).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9456      +/-   ##
==========================================
+ Coverage   75.51%   76.13%   +0.62%     
==========================================
  Files         275      278       +3     
  Lines       58032    59708    +1676     
  Branches     6209     6456     +247     
==========================================
+ Hits        43820    45460    +1640     
- Misses      13942    13955      +13     
- Partials      270      293      +23     
Flag Coverage Δ
backend 97.85% <100.00%> (?)

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

Files with missing lines Coverage Δ
src/mcp/server.ts 97.13% <100.00%> (ø)
src/openapi/schemas.ts 100.00% <100.00%> (ø)
src/openapi/spec.ts 99.63% <100.00%> (ø)

@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 19:46:27 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds OpenAPI documentation for the existing GET/POST/DELETE /v1/contributors/{login}/watches REST endpoints, introducing ContributorWatchRequest/ContributorWatchesResponse schemas that mirror the MCP tool's watchIssuesShape/watchIssuesOutputSchema, and adds a parity regression test verifying schema keys and path registration. The request/response schemas track the mirrored MCP shapes field-for-field (repoFullName, labels, watching, changed), and the new test asserts both the path registration and property-key parity, which is the right assertion to make for a documentation PR. I can't see src/api/routes.ts in this diff to confirm the actual REST handlers already exist under that path, but the pattern (self-described as 'REST mirror of loopover_watch_issues') matches many already-merged sibling entries visible elsewhere in the same openapi.json (e.g. the lint/* and validate/* REST mirrors), so this reads as pure contract documentation for a pre-existing route rather than documenting a phantom endpoint.

Nits — 5 non-blocking
  • Verify that GET/POST/DELETE /v1/contributors/{login}/watches actually exist as live route handlers in src/api/routes.ts (not shown in this diff) — this PR only adds the OpenAPI contract, and if the underlying route isn't wired up yet, the spec would describe a non-existent endpoint.
  • The description flags a competing open PR (docs(openapi): document contributor watches GET/POST/DELETE routes (#9306) #9453) targeting the same issue/surface — worth confirming with the contributor which one lands first to avoid a wasted merge or spec conflict.
  • src/mcp/server.ts:1539 widens `watchIssuesOutputSchema` from module-private to exported solely to satisfy the new test import; fine, but consider whether other similarly-shaped output-schema objects should follow the same export convention for consistency across the file.
  • Add a code comment or CI check that fails if a REST route path referenced in the OpenAPI spec has no matching handler registered in src/api/routes.ts, to prevent future doc-only PRs from silently describing dead endpoints.
  • Consider a 404 response entry for GET when `login` doesn't resolve to a known contributor, matching the 401/403 pattern already documented for this path.

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 #9306
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High 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: 180 registered-repo PR(s), 117 merged, 22 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 180 PR(s), 22 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The PR adds ContributorWatchRequestSchema/ContributorWatchesResponseSchema built from the shared watchIssuesOutputSchema, registers all three GET/POST/DELETE paths for /v1/contributors/{login}/watches mirroring the notifications pattern, regenerates openapi.json, and adds a regression test verifying all three verbs and matching schema keys.

Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Rust, Cuda, JavaScript, Kotlin, MDX, Scala
  • Official Gittensor activity: 180 PR(s), 22 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step in the Signals table above.
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.

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 49b7ada 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: /v1/contributors/:login/watches (GET/POST/DELETE) missing from spec (loopover_watch_issues already validates the shape)

2 participants