Skip to content

openapi: entire /v1/lint/* + /v1/validate/focus-manifest family (8 routes) missing from spec #9308

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

⚠️ Required pattern: mirror how GET /v1/repos/{owner}/{repo}/gate-config/effective is documented
in src/openapi/spec.ts — issue #6611 fixed the exact same class of gap for that route — applied
uniformly across all eight routes below.

Context

src/api/routes.ts groups eight deterministic, source-free advisory-check POST routes under
/v1/lint/* and /v1/validate/focus-manifest, each backed by an MCP tool with its own Zod output
shape already defined in src/mcp/server.ts:

Route MCP tool Output shape
POST /v1/lint/pr-text loopover_lint_pr_text lintPrTextOutputSchema
POST /v1/lint/slop-risk loopover_check_slop_risk checkSlopRiskOutputSchema
POST /v1/lint/improvement-potential loopover_check_improvement_potential checkImprovementPotentialOutputSchema
POST /v1/lint/open-pr-pressure loopover_simulate_open_pr_pressure simulateOpenPrPressureOutputSchema
POST /v1/lint/boundary-tests loopover_suggest_boundary_tests suggestBoundaryTestsOutputSchema
POST /v1/lint/test-evidence loopover_check_test_evidence checkTestEvidenceOutputSchema
POST /v1/lint/issue-slop loopover_check_issue_slop checkIssueSlopOutputSchema
POST /v1/validate/focus-manifest loopover_validate_config validateConfigOutputSchema

None of the eight appears in src/openapi/spec.ts — grep for /v1/lint/ and
/v1/validate/focus-manifest in that file returns nothing, even though every one of them is a real,
tested, publicly-callable route with an MCP-tool-validated response shape.

Requirements

  • In src/openapi/schemas.ts, define one z.object({...}) response schema per route (8 total,
    e.g. LintPrTextResponseSchema, CheckSlopRiskResponseSchema,
    CheckImprovementPotentialResponseSchema, SimulateOpenPrPressureResponseSchema,
    SuggestBoundaryTestsResponseSchema, CheckTestEvidenceResponseSchema,
    CheckIssueSlopResponseSchema, ValidateFocusManifestResponseSchema), using each route's
    existing MCP outputSchema constant (table above) as the field-level source of truth. Also add
    request-body schemas mirroring each tool's corresponding inputSchema/shape constant in
    src/mcp/server.ts.
  • In src/openapi/spec.ts, registry.register all eight response schemas as components, then add a
    registerPath entry for each of the eight routes.
  • Schema is the contract — regenerate and commit. Run npm run ui:openapi after the edits and
    commit the regenerated apps/loopover-ui/public/openapi.json in this same PR. CI enforces this via
    npm run ui:openapi:check (part of npm run test:ci).

Deliverables

  • Eight new response schemas (plus matching request-body schemas) added to
    src/openapi/schemas.ts, one per route in the table above.
  • All eight routes registered as OpenAPI paths in src/openapi/spec.ts.
  • apps/loopover-ui/public/openapi.json regenerated via npm run ui:openapi and committed.
  • npm run ui:openapi:check passes in CI.

All eight routes are required in this one PR — there is no follow-up issue. Do not ship a partial
subset of the family.

Test Coverage Requirements

99%+ Codecov patch target (codecov/patch, unsharded via npm run test:coverage) on any new schema
helper code. Add a regression test asserting all eight paths appear in buildOpenApiSpec()'s output
with response schemas whose keys match each route's MCP tool output shape from the table above.

Expected Outcome

The entire /v1/lint/* + /v1/validate/focus-manifest advisory-check family is documented in
GET /openapi.json / apps/loopover-ui/public/openapi.json, matching what each route's MCP tool
already validates.

Links & Resources

  • src/api/routes.ts: the eight routes in the table above (contiguous block starting at
    app.post("/v1/lint/pr-text", ...))
  • src/mcp/server.ts: the eight output-shape constants in the table above (contiguous block of
    register("loopover_lint_pr_text"...) through register("loopover_check_issue_slop"...) /
    register("loopover_validate_config"...))
  • src/openapi/spec.ts: /v1/repos/{owner}/{repo}/gate-config/effective registration (pattern to
    mirror)
  • OpenAPI spec is missing GET /v1/repos/{owner}/{repo}/gate-config/effective (documented sibling: live-gate-thresholds) #6611 — the precedent issue for this exact class of gap

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions