Skip to content

docs(openapi): document the /v1/lint/* + /v1/validate/focus-manifest route family in the spec - #9430

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jeffrey701:fix-9308-openapi-lint-validate
Jul 27, 2026
Merged

docs(openapi): document the /v1/lint/* + /v1/validate/focus-manifest route family in the spec#9430
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jeffrey701:fix-9308-openapi-lint-validate

Conversation

@jeffrey701

Copy link
Copy Markdown
Contributor

What

src/api/routes.ts exposes eight deterministic, source-free advisory-check POST routes under
/v1/lint/* and /v1/validate/focus-manifest, each backed by an MCP tool whose Zod output shape
already lives in src/mcp/server.ts. None of the eight appeared in src/openapi/spec.ts, so the
public API document (GET /openapi.json / apps/loopover-ui/public/openapi.json) silently omitted a
whole tested, publicly-callable route family.

Route MCP tool
POST /v1/lint/pr-text loopover_lint_pr_text
POST /v1/lint/slop-risk loopover_check_slop_risk
POST /v1/lint/improvement-potential loopover_check_improvement_potential
POST /v1/lint/open-pr-pressure loopover_simulate_open_pr_pressure
POST /v1/lint/boundary-tests loopover_suggest_boundary_tests
POST /v1/lint/test-evidence loopover_check_test_evidence
POST /v1/lint/issue-slop loopover_check_issue_slop
POST /v1/validate/focus-manifest loopover_validate_config

Change

Following the established #9309 /v1/loop/* pattern exactly:

  • src/openapi/schemas.ts: one …RequestSchema + one …ResponseSchema per route (16 total),
    each z.object({...}).openapi("Name"), mirroring the top-level keys of the corresponding MCP tool
    inputSchema/outputSchema. Deeply nested / opaque payloads are left as unknown, exactly as the
    #9309 schemas do. issue-slop's output mirrors checkSlopRiskOutputSchema (the MCP alias).
  • src/openapi/spec.ts: registry.register all 16 schemas as components + a registerPath
    entry for each of the eight POST routes (request body + 200/400 responses).
  • apps/loopover-ui/public/openapi.json: regenerated (pure addition — 738 inserts, 0 deletions).

Validation

  • New test in test/unit/openapi.test.ts (mirrors the #9309 block): for all eight routes asserts a
    documented POST path with a request body, both request/response components registered, and each
    component's top-level property keys equal to the MCP tool's shape keys. Full openapi.test.ts suite
    (5 tests, incl. the every-operation-has-summary and templated-path-param guards) passes.
  • Every changed line in schemas.ts and spec.ts is line+branch covered by the spec-build test.

Closes #9308

@jeffrey701
jeffrey701 requested a review from JSONbored as a code owner July 27, 2026 18:30
@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:38:25 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds OpenAPI request/response schemas and registerPath entries for the eight /v1/lint/* + /v1/validate/focus-manifest routes, following the exact #9309 loop-route pattern (schemas.ts components, spec.ts registration, regenerated openapi.json, and a parity test). The diff is a clean, additive documentation change with no route/handler logic touched; the new test asserts each route is registered and its schema keys match the stated MCP tool shapes. The magic-number and long-file flags from the external brief are pre-existing repo conventions (status codes, generated JSON, a large schema file) and not defects introduced by this diff's actual content.

Nits — 5 non-blocking
  • One nested-object field, `roleContext`, in `SimulateOpenPrPressureRequestSchema` (src/openapi/schemas.ts) is fully typed instead of left as `unknown` like other nested fields in this file — worth a one-line note on why it's the exception if intentional.
  • The PR description doesn't state whether the eight MCP tool `inputSchema`/`outputSchema` shapes in src/mcp/server.ts were diffed key-by-key against the new schemas beyond the table given — since I can't see src/mcp/server.ts here, that parity is unverified from this diff alone.
  • `ValidateFocusManifestResponseSchema.normalized` is typed `z.record(z.string(), z.unknown())` in schemas.ts but rendered as `type: object, additionalProperties: { nullable: true }` in the regenerated openapi.json — worth confirming the zod-to-openapi conversion round-trips as intended for record types.
  • No CHANGELOG or docs-index entry links to this new route family, though that may not be this repo's convention for OpenAPI-only PRs.
  • Consider adding a doc comment near `ChangedFileSchema` (src/openapi/schemas.ts) noting it's shared across CheckSlopRiskRequest/CheckImprovementPotentialRequest to make the intentional reuse explicit.

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 #9308
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: 88 registered-repo PR(s), 43 merged, 17 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jeffrey701; Gittensor profile; 88 PR(s), 17 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff adds all eight request/response schema pairs to schemas.ts, registers them and their registerPath entries in spec.ts mirroring the gate-config pattern, regenerates and commits openapi.json (pure addition), and adds a regression test asserting all eight paths and matching schema keys against the MCP tool output shapes.

Review context
  • Author: jeffrey701
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 88 PR(s), 17 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.

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

@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.68%. Comparing base (17045e8) to head (40f2bfd).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9430      +/-   ##
==========================================
+ Coverage   75.51%   75.68%   +0.17%     
==========================================
  Files         275      277       +2     
  Lines       58032    58445     +413     
  Branches     6209     6216       +7     
==========================================
+ Hits        43820    44232     +412     
  Misses      13942    13942              
- Partials      270      271       +1     
Flag Coverage Δ
backend 99.75% <100.00%> (?)

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.60% <100.00%> (ø)

@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 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 4211ac2 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: entire /v1/lint/* + /v1/validate/focus-manifest family (8 routes) missing from spec

1 participant