Skip to content

feat(openapi): document selftune override audit and clear routes - #9411

Closed
nghetien wants to merge 1 commit into
JSONbored:mainfrom
nghetien:fix/issue-9303-a1-openapi-selftune
Closed

feat(openapi): document selftune override audit and clear routes#9411
nghetien wants to merge 1 commit into
JSONbored:mainfrom
nghetien:fix/issue-9303-a1-openapi-selftune

Conversation

@nghetien

Copy link
Copy Markdown
Contributor

Summary

  • Add SelftuneOverrideAuditResponseSchema and ClearSelftuneOverrideResponseSchema to src/openapi/schemas.ts, mirroring the field shapes already validated by selftuneOverrideAuditOutputSchema/clearSelftuneOverrideOutputSchema in src/mcp/server.ts.
  • Register GET /v1/repos/{owner}/{repo}/selftune/overrides/audit (with its optional limit query param) and DELETE /v1/repos/{owner}/{repo}/selftune/overrides (with its optional confirm:true body) in src/openapi/spec.ts, following the same pattern used for GET .../gate-config/effective.
  • Regenerate and commit apps/loopover-ui/public/openapi.json via npm run ui:openapi.
  • Add a regression test in test/unit/openapi.test.ts asserting both paths/methods appear in buildOpenApiSpec()'s output and that each response schema's keys match its route's MCP tool output shape.

Closes #9303

Scope

  • Backend only: src/openapi/schemas.ts, src/openapi/spec.ts, test/unit/openapi.test.ts, generated apps/loopover-ui/public/openapi.json
  • No site/, CNAME, or VitePress changes

Validation

  • npx turbo run build --filter=@loopover/engine
  • npm run build:mcp
  • npm run build:miner
  • npm run ui:openapi (regenerated and committed openapi.json)
  • npx vitest run test/unit/openapi.test.ts — new + existing assertions pass
  • npx vitest run --changed=upstream/main --passWithNoTests — 134 files / 1723 tests passed

Safety

  • No secrets, wallets, hotkeys, or trust/reward values touched
  • No changes to auth/permission logic — purely additive documentation of existing, already-authenticated routes

Notes

No UI-visible change (schema/doc-only backend change to generated OpenAPI JSON), so no UI Evidence screenshots are applicable.

GET /v1/repos/{owner}/{repo}/selftune/overrides/audit and DELETE
/v1/repos/{owner}/{repo}/selftune/overrides were live and MCP-mirrored
but missing from the OpenAPI spec. Add SelftuneOverrideAuditResponseSchema
and ClearSelftuneOverrideResponseSchema mirroring the MCP tool output
shapes, register both routes following the gate-config/effective
pattern, and regenerate apps/loopover-ui/public/openapi.json.

Closes JSONbored#9303
@nghetien
nghetien requested a review from JSONbored as a code owner July 27, 2026 16:42
@superagent-security

Copy link
Copy Markdown
Contributor

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

@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Important

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏳ LoopOver is waiting…

LoopOver has seen this pull request and is waiting on CI checks to finish before reviewing it. This comment will update once the review runs.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟨 Waiting

@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.59%. Comparing base (b4064b6) to head (adab024).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9411      +/-   ##
==========================================
+ Coverage   75.46%   75.59%   +0.13%     
==========================================
  Files         275      277       +2     
  Lines       58030    58360     +330     
  Branches     6199     6206       +7     
==========================================
+ Hits        43790    44119     +329     
  Misses      13970    13970              
- Partials      270      271       +1     
Flag Coverage Δ
backend 99.69% <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.50% <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 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This pull request changes UI/visual code but its screenshot evidence is incomplete. Every required viewport × theme combination needs its own before/after image pair in a labeled table row (e.g. "Desktop · Light | before | after"). Still missing: Desktop · Dark, Tablet · Dark, Mobile · Dark.

Please resubmit with the remaining rows filled in.

See https://github.com/JSONbored/loopover/blob/main/.claude/skills/contributing-to-loopover/SKILL.md for the exact format and examples. This is an automated maintenance action.

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-opened to re-review, but merge conflicts so re-closing.

This branch has conflicts that must be resolved
Use the web editor or the command line to resolve conflicts before continuing.

apps/loopover-ui/public/openapi.json

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: selftune/overrides (audit + clear) missing from spec (MCP tools + schemas already exist)

2 participants