Skip to content

fix(openapi): document /v1/loop idea/task-graph routes in the public spec (#9309)#9352

Closed
andriypolanski wants to merge 1 commit into
JSONbored:mainfrom
andriypolanski:fix/9309-openapi-loop-idea-routes
Closed

fix(openapi): document /v1/loop idea/task-graph routes in the public spec (#9309)#9352
andriypolanski wants to merge 1 commit into
JSONbored:mainfrom
andriypolanski:fix/9309-openapi-loop-idea-routes

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • 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 (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

If any required check was skipped, explain why:

OpenAPI schemas + path registration + regenerated artifact + regression test complete. Full test:ci left for the opener.

Safety

  • No secrets, wallets, hotkeys, trust scores, or reward values.
  • Does not touch site/, CNAME, **/lovable/**, or root CHANGELOG.md.

UI Evidence

N/A — OpenAPI contract documentation only; no visible UI change.

Notes for reviewers / gate

  • Routes covered: evaluate-escalation, results-payload, progress-snapshot, intake-idea, plan-idea-claims.
  • Response component schema property keys match each MCP *OutputSchema in src/mcp/server.ts.

…spec (JSONbored#9309)

Five REST mirrors of the loopover_* idea/task-graph MCP tools were live in
routes.ts but absent from OpenAPI. Register request/response schemas and
paths for evaluate-escalation, results-payload, progress-snapshot, intake-idea,
and plan-idea-claims (request-apr-transfer stays out of scope).

Co-authored-by: Cursor <cursoragent@cursor.com>
@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.52%. Comparing base (aad3f93) to head (cc33a8a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9352      +/-   ##
==========================================
+ Coverage   75.38%   75.52%   +0.14%     
==========================================
  Files         275      277       +2     
  Lines       58023    58365     +342     
  Branches     6181     6188       +7     
==========================================
+ Hits        43739    44080     +341     
  Misses      14014    14014              
- Partials      270      271       +1     
Flag Coverage Δ
backend 99.70% <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

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-27 14:00:33 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds OpenAPI request/response schemas and path registrations for five /v1/loop/* routes (evaluate-escalation, results-payload, progress-snapshot, intake-idea, plan-idea-claims), regenerates openapi.json, and adds a regression test asserting each path exists with a response schema whose properties match the expected MCP tool output keys. The EvaluateEscalationRequestSchema aligns with the actual evaluateEscalation function signature shown in test/unit/loop-escalation.test.ts (runStatus required, others optional), which is a good sign the mirroring claim holds for at least that route. This is low-risk, additive documentation work with no runtime code path changes — the generated JSON, Zod schemas, and registry wiring are internally consistent in the diff shown.

Nits — 5 non-blocking
  • src/openapi/schemas.ts: PlanIdeaClaimsRequestSchema is a byte-for-byte duplicate of IntakeIdeaRequestSchema (same fields, same comment acknowledging it) — consider `export const PlanIdeaClaimsRequestSchema = IntakeIdeaRequestSchema.openapi("PlanIdeaClaimsRequest")` or a shared base schema instead of copy-pasting the object literal, so the two can't drift independently.
  • Response schemas (EvaluateEscalationResponse, BuildResultsPayloadResponse, etc.) mark nearly every field `.optional()` rather than asserting `required` where the underlying MCP outputSchema guarantees a value — e.g. IntakeIdeaResponseSchema only requires `ok`, worth double-checking against the actual MCP outputSchema constants in src/mcp/server.ts (not shown in this diff) to confirm nothing is over-relaxed.
  • `diffPreview`, `totals`, `taskGraph`, `claimPlan`, and `recentActivity` are typed `z.unknown()`/bare `nullable` — reasonable for opaque nested shapes, but worth a one-line comment noting these are intentionally left loose rather than under-specified.
  • Consider factoring PlanIdeaClaimsRequestSchema from IntakeIdeaRequestSchema (src/openapi/schemas.ts:~2011) to avoid the duplicate-drift risk called out above.
  • If src/mcp/server.ts's outputSchema constants have stricter `required` fields than what's reflected here, tighten the corresponding response schemas to match before merge.

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: 174 registered-repo PR(s), 113 merged, 22 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 174 PR(s), 22 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR defines request/response schemas for all five /v1/loop/* routes mirroring the MCP output/input shapes, registers each as a component and registerPath entry in spec.ts following the gate-config/effective pattern, regenerates and commits openapi.json, and adds a regression test verifying paths and matching response schema keys while confirming request-apr-transfer stays excluded.

Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Rust, Cuda, JavaScript, Kotlin, MDX, Scala
  • Official Gittensor activity: 174 PR(s), 22 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
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 &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; 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

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

@loopover-orb loopover-orb Bot closed this Jul 27, 2026
@andriypolanski

Copy link
Copy Markdown
Contributor Author

Hi, @JSONbored
this issue does not require UI evidence, but closed pr, please review.

@andriypolanski

Copy link
Copy Markdown
Contributor Author

Hi, @JSONbored
this issue does not require UI evidence, but closed pr, please reopen.

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

2 participants