Skip to content

fix(openapi): document the /v1/loop/* idea/task-graph route family in the spec - #9414

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-9309
Jul 27, 2026
Merged

fix(openapi): document the /v1/loop/* idea/task-graph route family in the spec#9414
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-9309

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

Summary

The five idea/task-graph composer routes under /v1/loop/* are each the REST mirror of an
existing MCP tool, but none of them were present in the generated OpenAPI contract:

  • POST /v1/loop/evaluate-escalation
  • POST /v1/loop/results-payload
  • POST /v1/loop/progress-snapshot
  • POST /v1/loop/intake-idea
  • POST /v1/loop/plan-idea-claims

This documents all five in the public spec by adding request/response component schemas in
field-level parity with each tool's existing inputSchema/outputSchema constant, registering the
five routes as OpenAPI paths (mirroring the existing gate-config/effective registration pattern),
and regenerating the committed apps/loopover-ui/public/openapi.json. request-apr-transfer is left
undocumented on purpose — it is explicitly out of scope for this batch per the issue, and a test pins
that exclusion.

The MCP shape constants are made export-only so the regression test can assert component-key parity
against the source of truth; no runtime behavior changes.

Closes #9309

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • 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 (Closes #9309).

Validation

  • git diff --check
  • npm run ui:openapi:check — no drift
  • npm run ui:openapi:settings-parity
  • npx vitest run test/unit/openapi.test.ts — 4 passing (path documented, request/response
    components registered, component keys in sync with each MCP tool shape, apr-transfer stays excluded)
  • New behavior has unit tests for every added path and the intentional exclusion.

The spec/schema additions are import-time-evaluated object/registration literals covered by the
parity test; the export-only changes in src/mcp/server.ts add no branches.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, PATs, private keys, trust scores, or private
    evidence are exposed.
  • Public GitHub text stays sanitized and low-noise.
  • API/OpenAPI/MCP behavior is updated and tested where needed.

UI Evidence

N/A — no visible UI change. The only file under apps/loopover-ui/ is the generated
public/openapi.json, regenerated verbatim by npm run ui:openapi from the schema/spec source. No
route, component, style, or rendered page is added or modified, so there is no visual surface to
screenshot.

Notes

  • The route set and the request-apr-transfer exclusion follow the issue exactly; the exclusion is
    asserted by the regression test so a future PR documenting it will not silently regress this one.

… the spec

The five idea/task-graph composer routes under /v1/loop/* (evaluate-escalation,
results-payload, progress-snapshot, intake-idea, plan-idea-claims) are each the
REST mirror of an MCP tool with an existing Zod input/output shape, but none of
them appeared in the generated OpenAPI contract.

Add request/response component schemas in field-level parity with each tool's
inputSchema/outputSchema constant, register all five routes as OpenAPI paths
mirroring the gate-config/effective precedent, and regenerate the committed
openapi.json. Add a regression test asserting each path is a documented POST
whose request/response component keys stay in sync with the MCP tool shapes,
and that request-apr-transfer stays intentionally excluded from this batch.
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 27, 2026 17:05
@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 17:31:34 UTC

5 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 documentation (component schemas + path registrations) for five existing /v1/loop/* routes that mirror MCP tools, plus a parity test asserting the new components stay field-for-field in sync with the corresponding Zod shapes in src/mcp/server.ts. The mechanical change (schemas.ts, spec.ts, regenerated openapi.json) is well-targeted and the parity test is a genuine safeguard, not a fabricated one — it imports the actual exported shapes and diffs property keys, and also pins the request-apr-transfer exclusion. The only functional change to runtime code is exporting five previously-private consts in src/mcp/server.ts so the test can import them, which is a no-op behavior change.

Nits — 5 non-blocking
  • The magic numbers 50/5000/1000 duplicated across schemas.ts and the pre-existing MCP shapes in server.ts (e.g. schemas.ts:1966, 2032-2072) aren't pulled from a shared constant, so the two copies can silently drift if one side changes a cap without the other — consider importing the caps or asserting them in the parity test too.
  • The 400 response descriptions ('Invalid X request body') are generic boilerplate copy-pasted five times; consider tightening or at least keeping this pattern consistent with GateConfigEffectiveResponse's existing description style.
  • diffPreview/totals/taskGraph/claimPlan/recentActivity are all left as opaque `unknown` in the OpenAPI schemas, which is reasonable per the comments but means those fields get zero real API-consumer-facing type documentation — worth a follow-up issue if callers need shape guidance.
  • Consider adding a JSDoc-level comment cross-referencing the MAX_* limits (50/1000/5000) between src/mcp/server.ts and src/openapi/schemas.ts, or centralize the shared caps in one location.
  • The parity test only checks property-key sets equal, not required-ness/nullability parity — consider extending the test to also assert which fields are optional vs required for tighter contract-drift protection.

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 #9309
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: 80 registered-repo PR(s), 54 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 80 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The PR adds all five request/response schemas mirroring the MCP tool shapes, registers them as components, adds registerPath entries for all five /v1/loop/* routes (excluding request-apr-transfer as required), regenerates the committed openapi.json, and adds a regression test asserting path/component parity plus the exclusion.

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

Decision record
  • action: close · clause: policy_close:screenshot_table
  • config: db0b1a729e2370a3d864aee24e81b05d8aaa435109accff8f71d5e59c757f6e8 · pack: oss-anti-slop · ci: passed
  • record: ee57471bbdb0d530793be8f6149dffb028719ad8481c15e0a38b197742c8bc94 (schema v5, head 00f08f0)
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 76.09%. Comparing base (0a93e29) to head (00f08f0).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #9414       +/-   ##
===========================================
- Coverage   89.52%   76.09%   -13.43%     
===========================================
  Files         840      278      -562     
  Lines      109777    59604    -50173     
  Branches    26147     8446    -17701     
===========================================
- Hits        98275    45356    -52919     
- Misses      10239    13955     +3716     
+ Partials     1263      293      -970     
Flag Coverage Δ
backend 97.70% <100.00%> (+2.47%) ⬆️

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.53% <100.00%> (+0.03%) ⬆️

... and 700 files with indirect coverage changes

@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.

@andriypolanski

Copy link
Copy Markdown
Contributor

Hi, @JSONbored
#9352 is created earlier than this pr, but that is not reopened.

@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.

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/loop/* idea/task-graph family (5 routes, excl. request-apr-transfer) missing from spec

3 participants