[parity] declare the API routes alerts/account/web/agent already call in schema.json - #549
[parity] declare the API routes alerts/account/web/agent already call in schema.json#549gulshngill wants to merge 1 commit into
Conversation
… call src/schema.json is the CLI's machine-readable surface description — shell completions, `--help` and docs tooling all read it, and it is what the API/MCP/CLI parity check diffs against the public OpenAPI spec. Eight routes the code requests were undeclared, so none of those consumers could see them: alerts list -> GET /api/v1/smart-alert/list alerts create -> POST /api/v1/smart-alert alerts update -> PATCH /api/v1/smart-alert alerts toggle -> PATCH /api/v1/smart-alert/toggle account -> GET /api/v1/account web search -> POST /api/v1/search/web-search web fetch -> POST /api/v1/search/web-fetch agent -> POST /api/v1/agent/fast, /api/v1/agent/expert `agent` picks its route from --expert at call time, so it declares both under apiEndpoints rather than claiming a single billed `endpoint`, matching the convention the perp commands already follow. Docs-only: no handler or request behaviour changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pr-reviewer Summary for #28714c6📝 1 finding Review completed. Please address the findings below. Findings by Severity
Review effort: 1/5 (Trivial) SummaryThis is a clean, well-scoped docs-only PR. All eight Findings (1 medium)
|
There was a problem hiding this comment.
Auto-approved
This PR was automatically approved because:
- Claude recommends approval
- Claude assessed this as a minimal effort change
- The effort level is within the auto-approval threshold of 2
- No high or critical issues were detected
- Review comment contains non-blocking feedback
If you have any concerns, please request a manual review.
What
src/schema.jsonis the CLI's machine-readable surface description — shell completions,--help, docs tooling and automated surface checks all read it. It is maintained by hand, and eight routes the code already requests were never declared in it.This PR declares them. Docs-only: no handler, request, or behaviour changes.
alerts listGET /api/v1/smart-alert/listendpointalerts createPOST /api/v1/smart-alertendpointalerts updatePATCH /api/v1/smart-alertendpointalerts togglePATCH /api/v1/smart-alert/toggleendpointaccountGET /api/v1/accountendpointweb searchPOST /api/v1/search/web-searchendpointweb fetchPOST /api/v1/search/web-fetchendpointagentPOST /api/v1/agent/fastor/api/v1/agent/expertapiEndpointsagentresolves its route from--expertat call time (src/commands/agent.js:210), so it declares both underapiEndpointsrather than naming a single billedendpoint— the convention the perp commands already follow, and the onesrc/__tests__/schema-bridge-perp.test.jsencodes.What this closes
Before this change, nine routes were requested by CLI code without being declared in
src/schema.json. This PR declares eight of them, taking the undeclared count from nine to one.The remaining one,
/api/v1/points/leaderboard, is deliberately not declared here: #542 removes that dead route together with its schema leaf, so declaring it now would conflict. None of the declarations added here contradict the documented HTTP method for their path.Validation
Each declared route was checked for existence against the published API surface. No credentials, wallet addresses, or response payloads were used or reproduced.
POST /api/v1/search/web-searchPOST /api/v1/search/web-fetchPOST /api/v1/agent/fastPOST /api/v1/agent/expertGET /api/v1/accountGET, not deprecatedGET /api/v1/smart-alert/listGET, not deprecatedPOST/PATCH /api/v1/smart-alertPOST+PATCH, not deprecated; call sitessrc/api.js:1644,1648PATCH /api/v1/smart-alert/togglePATCH, not deprecated; call sitesrc/api.js:1652Nothing here is a removal, so no route needed proof of absence. Every declared path is one the CLI code demonstrably requests today — call sites are cited above and in the commit message.
Run from a fresh
npm ci, with API and service credentials cleared from the environment:npm test— 62 files, 2540 passed, 2 skippednpm run lint— cleanSame result on pristine
main, so the suite is green either side of this change.One flake was seen on an earlier
npm testrun (update-check.test.js→ "should show update notification on stderr for help command"). It reads and writes the real per-user update-check state file, so it races with anything else touching that file; it passes in isolation and on clean full-suite runs, on this branch and onmainalike. Unrelated to this change — flagging it as a pre-existing test-isolation weakness, not fixing it here.Notes
Opened by an automated surface-parity check that compares the API's published surface against the MCP server and this CLI.
Scope is limited to the routes that check flagged.
alerts deletecalls a path-parameterised route (/api/v1/smart-alert/{id}), which the check excludes as a template and which was not flagged — left alone deliberately.This is a proposal for human review. Auto-merge is not enabled.
🤖 Generated with Claude Code