Skip to content

fix(openapi): document agent/pending-actions approval-queue routes - #9426

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
andriypolanski:fix/9307-openapi-pending-actions
Jul 27, 2026
Merged

fix(openapi): document agent/pending-actions approval-queue routes#9426
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
andriypolanski:fix/9307-openapi-pending-actions

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

  • Closes openapi: agent/pending-actions routes missing from spec, unlike their agent/audit-feed neighbor #9307
  • Adds ListPendingActionsResponse, ProposeActionRequest/ProposeActionResponse, and DecidePendingActionResponse schemas mirroring the MCP tool shapes.
  • Registers GET + POST /agent/pending-actions and POST /agent/pending-actions/{id}/{decision} next to the documented agent/audit-feed neighbor.
  • Regenerates and commits apps/loopover-ui/public/openapi.json.
  • Adds an OpenAPI parity test asserting path registration and response/request schema key parity with the MCP tools.

Why #9416 closed

PR #9416 had green CI and no review blockers, but was auto-closed for a base-branch conflict after other OpenAPI work landed on main (e.g. #9417, #9421). This is a fresh reimplementation on current main.

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

  • git diff --check
  • npm run ui:openapi + npm run ui:openapi:check
  • npx vitest run test/unit/openapi.test.ts — 6 passed
  • npm run test:ci (full gate; run before push)
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

OpenAPI documentation + regeneration + targeted contract test complete. Full test:ci left for CI on this PR.

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 / generated openapi.json only; no product UI change.

Notes for reviewers / gate

  • Decide uses path params ({id}/{decision}); only propose has a JSON request body (owner/repo stay path params).
  • No production route behavior change — documentation parity only.

Made with Cursor

…SONbored#9307)

The list/propose/decide pending-actions routes were live (and MCP-backed) but
absent from OpenAPI while agent/audit-feed was documented. Add response +
propose request schemas mirroring the MCP tool shapes, register the three
paths, regenerate openapi.json, and add a parity regression test. Replaces
conflict-closed JSONbored#9416 on current main.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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.10%. Comparing base (4b761fa) to head (d125725).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9426      +/-   ##
==========================================
+ Coverage   75.51%   76.10%   +0.59%     
==========================================
  Files         275      278       +3     
  Lines       58032    59625    +1593     
  Branches     6209     6456     +247     
==========================================
+ Hits        43820    45377    +1557     
- Misses      13942    13955      +13     
- Partials      270      293      +23     
Flag Coverage Δ
backend 97.74% <100.00%> (?)

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.55% <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 18:22:30 UTC

5 files · 1 AI reviewer · no blockers · readiness 98/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR documents the three agent/pending-actions approval-queue routes (GET/POST /agent/pending-actions and POST /agent/pending-actions/{id}/{decision}) in the OpenAPI spec, hand-mirroring the MCP tool shapes (proposeActionShape, listPendingActionsOutputSchema, decidePendingActionOutputSchema) and adding a contract test that imports the real MCP shapes and asserts key parity against the new OpenAPI schemas rather than fabricating expected values. The three previously-private consts in src/mcp/server.ts are exported specifically to support that parity test, and the regenerated openapi.json matches the spec.ts changes shown. This is a narrow, well-targeted doc-only change with a real (not fabricated) regression test tying the two representations together.

Nits — 3 non-blocking
  • src/openapi/schemas.ts: ProposeActionRequestSchema is hand-duplicated from src/mcp/server.ts's proposeActionShape rather than derived from it — the new test guards key-parity at runtime, but a future field-level change (e.g. a stricter max length) could still silently diverge since only key names are compared, not full schema shape.
  • The external brief's flagged 'magic numbers' (HTTP status codes like 200/400/403/409) are consistent with how every other route in src/openapi/spec.ts is already written, so no action needed there.
  • Consider having the openapi.test.ts parity check also compare a couple of field-level constraints (e.g. reason maxLength, pullNumber positivity) in addition to key sets, to catch drift beyond just key names.

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

Addressed
The PR adds the three response/request schemas mirroring the MCP tool shapes, registers all three routes (GET/POST pending-actions, POST :id/:decision) in spec.ts following the audit-feed pattern, regenerates and commits openapi.json, and includes a parity test asserting path registration and schema key matching against the MCP output shapes.

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: not available
  • Official Gittensor activity: 180 PR(s), 22 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 &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 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: agent/pending-actions routes missing from spec, unlike their agent/audit-feed neighbor

2 participants