Skip to content

docs(openapi): document agent/pending-actions approval-queue routes - #9416

Closed
bitfathers94 wants to merge 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-9307
Closed

docs(openapi): document agent/pending-actions approval-queue routes#9416
bitfathers94 wants to merge 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-9307

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

docs(openapi): document agent/pending-actions approval-queue routes

The three agent/pending-actions routes (list, propose, decide) were missing
from the OpenAPI spec while their agent/audit-feed neighbor was documented.
Add ListPendingActionsResponse/ProposeActionRequest/ProposeActionResponse/
DecidePendingActionResponse schemas mirroring the MCP tool shapes, register
the GET and two POST paths, regenerate openapi.json, and add a parity test
asserting each documented shape matches its MCP tool output.

Closes #9307

Validation

Verified locally on this branch before opening:

  • npm run typecheck
  • npx turbo run build:tsc build:verify
  • npm run test:coverage — patch coverage 100.0% of changed lines

The three agent/pending-actions routes (list, propose, decide) were missing
from the OpenAPI spec while their agent/audit-feed neighbor was documented.
Add ListPendingActionsResponse/ProposeActionRequest/ProposeActionResponse/
DecidePendingActionResponse schemas mirroring the MCP tool shapes, register
the GET and two POST paths, regenerate openapi.json, and add a parity test
asserting each documented shape matches its MCP tool output.
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 27, 2026 17:19
@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-27 17:32:50 UTC

5 files · 1 AI reviewer · no blockers · CI green · dirty

⏸️ Suggested Action - Manual Review

Review summary
This PR fills a real OpenAPI documentation gap: the three agent/pending-actions routes (list/propose/decide) were unregistered while their audit-feed neighbor was documented. The new schemas in src/openapi/schemas.ts are hand-mirrored from the MCP tool shapes (now exported from src/mcp/server.ts for the new parity test), and the generated openapi.json and spec.ts registrations match those schemas field-for-field including nullable/optional handling. The added parity test in test/unit/openapi.test.ts asserts registered schema property keys equal the MCP output schema keys, which is a reasonable (if shallow) regression guard against future drift.

Nits — 5 non-blocking
  • The parity test in test/unit/openapi.test.ts only compares property-name sets (schemaProps vs Object.keys(...)), not types/nullability/optionality, so a field that changes from nullable to non-nullable (or number to string) on either side wouldn't be caught.
  • The maxLength/positive-integer constraints (500, 60000, pullNumber positivity) are duplicated by hand between src/mcp/server.ts's Zod shapes and src/openapi/schemas.ts's mirrored schemas; the file comment explains why (avoiding pulling the heavy MCP module into the OpenAPI build) but this remains a manual sync point worth a lint/test guard longer-term.
  • Widening proposeActionShape, proposeActionOutputSchema, listPendingActionsOutputSchema, and decidePendingActionOutputSchema from module-private to exported in src/mcp/server.ts is a visibility change purely to support the new test import — worth calling out explicitly in the PR description since it slightly increases that file's public surface.
  • Consider adding a lightweight structural (not just key-set) comparison in the parity test, e.g. diffing z.ZodObject shape kinds against the OpenAPI property types, to catch nullable/type drift as well as missing/extra keys.
  • If openapi.json is generated by a script, note that in the PR description or CI step so reviewers can confirm the checked-in JSON isn't hand-edited and will stay in sync with spec.ts.

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: 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 · LLM: moderate
Linked issue satisfaction

Addressed
The PR adds ListPendingActionsResponse/ProposeActionRequest/ProposeActionResponse/DecidePendingActionResponse schemas, registers all three agent/pending-actions routes in spec.ts mirroring the audit-feed pattern, regenerates openapi.json, and adds a regression test asserting parity between each schema and its MCP tool's output shape.

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.

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 (fbec593) to head (539f7e6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9416      +/-   ##
==========================================
+ Coverage   75.51%   76.09%   +0.58%     
==========================================
  Files         275      278       +3     
  Lines       58032    59591    +1559     
  Branches     6209     6456     +247     
==========================================
+ Hits        43820    45343    +1523     
- Misses      13942    13955      +13     
- Partials      270      293      +23     
Flag Coverage Δ
backend 97.69% <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.51% <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

LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 27, 2026
loopover-orb Bot pushed a commit that referenced this pull request Jul 27, 2026
…9307) (#9426)

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 #9416 on current main.

Co-authored-by: Andriy Polanski <andriy.polanski@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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

1 participant