⚠️ 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.
Context
src/api/routes.ts has two live, maintainer-authenticated selftune-override routes, each backed by
an MCP tool with its own Zod output shape in src/mcp/server.ts:
GET /v1/repos/:owner/:repo/selftune/overrides/audit → loopover_get_selftune_override_audit
(outputSchema: selftuneOverrideAuditOutputSchema)
DELETE /v1/repos/:owner/:repo/selftune/overrides → loopover_clear_selftune_override
(outputSchema: clearSelftuneOverrideOutputSchema)
Neither route appears in src/openapi/spec.ts — grep for selftune in that file returns nothing.
Both are already tested, both already have a CLI mirror in packages/loopover-mcp for the audit
route (#7997), and both have well-defined output shapes in src/mcp/server.ts — the only missing
piece is the OpenAPI documentation.
Requirements
- In
src/openapi/schemas.ts, define SelftuneOverrideAuditResponseSchema and
ClearSelftuneOverrideResponseSchema as z.object({...}) schemas, using
selftuneOverrideAuditOutputSchema and clearSelftuneOverrideOutputSchema (the raw Zod shapes
already validated in src/mcp/server.ts) as the field-level source of truth.
- In
src/openapi/spec.ts, registry.register both schemas as components, then add
registerPath entries for GET /v1/repos/{owner}/{repo}/selftune/overrides/audit (with its
optional limit query param, matching the MCP tool's selftuneOverrideAuditShape) and
DELETE /v1/repos/{owner}/{repo}/selftune/overrides (with the confirm:true request body the
route requires).
- 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
All deliverables are required in this one PR — there is no follow-up issue.
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 both paths appear in buildOpenApiSpec()'s output with
the correct method and a response schema whose keys match each route's MCP tool output shape.
Expected Outcome
Both selftune-override routes are documented in GET /openapi.json /
apps/loopover-ui/public/openapi.json, matching what their MCP tools and CLI mirror already
validate.
Links & Resources
Context
src/api/routes.tshas two live, maintainer-authenticated selftune-override routes, each backed byan MCP tool with its own Zod output shape in
src/mcp/server.ts:GET /v1/repos/:owner/:repo/selftune/overrides/audit→loopover_get_selftune_override_audit(
outputSchema: selftuneOverrideAuditOutputSchema)DELETE /v1/repos/:owner/:repo/selftune/overrides→loopover_clear_selftune_override(
outputSchema: clearSelftuneOverrideOutputSchema)Neither route appears in
src/openapi/spec.ts— grep forselftunein that file returns nothing.Both are already tested, both already have a CLI mirror in
packages/loopover-mcpfor the auditroute (#7997), and both have well-defined output shapes in
src/mcp/server.ts— the only missingpiece is the OpenAPI documentation.
Requirements
src/openapi/schemas.ts, defineSelftuneOverrideAuditResponseSchemaandClearSelftuneOverrideResponseSchemaasz.object({...})schemas, usingselftuneOverrideAuditOutputSchemaandclearSelftuneOverrideOutputSchema(the raw Zod shapesalready validated in
src/mcp/server.ts) as the field-level source of truth.src/openapi/spec.ts,registry.registerboth schemas as components, then addregisterPathentries forGET /v1/repos/{owner}/{repo}/selftune/overrides/audit(with itsoptional
limitquery param, matching the MCP tool'sselftuneOverrideAuditShape) andDELETE /v1/repos/{owner}/{repo}/selftune/overrides(with theconfirm:truerequest body theroute requires).
npm run ui:openapiafter the edits andcommit the regenerated
apps/loopover-ui/public/openapi.jsonin this same PR. CI enforces this vianpm run ui:openapi:check(part ofnpm run test:ci).Deliverables
SelftuneOverrideAuditResponseSchemaandClearSelftuneOverrideResponseSchemaadded tosrc/openapi/schemas.ts.src/openapi/spec.ts.apps/loopover-ui/public/openapi.jsonregenerated vianpm run ui:openapiand committed.npm run ui:openapi:checkpasses in CI.All deliverables are required in this one PR — there is no follow-up issue.
Test Coverage Requirements
99%+ Codecov patch target (
codecov/patch, unsharded vianpm run test:coverage) on any new schemahelper code. Add a regression test asserting both paths appear in
buildOpenApiSpec()'s output withthe correct method and a response schema whose keys match each route's MCP tool output shape.
Expected Outcome
Both selftune-override routes are documented in
GET /openapi.json/apps/loopover-ui/public/openapi.json, matching what their MCP tools and CLI mirror alreadyvalidate.
Links & Resources
src/api/routes.ts:GET .../selftune/overrides/audit,DELETE .../selftune/overridessrc/mcp/server.ts:selftuneOverrideAuditOutputSchema,clearSelftuneOverrideOutputSchemasrc/openapi/spec.ts:/v1/repos/{owner}/{repo}/gate-config/effectiveregistration (pattern tomirror)
audit tool