feat!: move the SDK and CLI to the /api/v2 platform API (Toolkit 1.0.0) #215
All Vouch review confidence checks passed
Residual risk 0.42 = Change Risk (0.52) × (1 − Review Confidence (0.20)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 28% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #215"
general
weight: 0.35
chatgpt-codex-connector[bot]
Summary
/api/v2platform API program): the SDK and CLI move from/api/v1REST and GraphQL to the gateway's/api/v2platform API, one resource at a time, in a major release whose main breaking change is the ID format (human decision).client._v2Request/client._v2Pagesbeside_request, sharing its headers, credential, timeout and network-error path: camelCase JSON,{items, nextPageToken}pages, repeated query parameters for lists, JSON Merge Patch on PATCH, and anIdempotency-Keyon every write (the caller's request ID when a method takes one, else a new UUID per call).AlvaErrorwithcode,status,message, and, when present,requiredPermission,invalidParamsandretryAfter; the CLI prints them with the error. The v1 envelope is still read on/api/v2, because the gateway's authentication middleware writes it there.AlvaId,task_0...). Public method signatures, CLI commands and output otherwise keep their shape (R16). Theses also returnnumber,author_version_numberandpublication.thesisNumber, so agents can still linkalva.ai/thesis/<number>and the App's Thesis cards./api/v1(no/api/v2route yet, 0.x transport and IDs):steward(GraphQL),trading.executeandsubscribe({executeLatest: true}),notifications.listFeed,subscriptions.subscribeFeed/unsubscribeFeed,secrets.get,channelGroupSubscriptions, andfsplus Playbook/Skillhub discovery for clients without an API key (browser Playbooks with a PBSV or viewer token), the browser UDF runtime andauth login.Architecture and Key Decisions
docs/changelogs/2026-11-19-agent-api-permissions.md(D10 conventions, D16 IDs, R16, 4.2 and 4.6 M20) anddoc/api-v2-conventions.md. Local changelogs:docs/changelogs/2026-11-19-agent-api-v2.md(transport and integration) and the three slices2026-11-19-content-resources-v2.md,2026-11-19-agent-api-v2-social-automation-files-account.md,2026-11-19-agent-api-v2-market-trading-runtime.md._request;_requestis split into_headers,_sendanddecodeResponsewithout a behavior change, so both doors keep one credential and error path.Idempotency-Keymakes the retries that exist safe;retryAfteris exposed for the one retrying caller (steward) when it moves.AlvaErrormembers are declared fields assigned only when present, so other errors and the CLI output of v1 errors keep their shape.client.user._username(), cached per client) for release, own-Playbook lookups and copy trading.AlvaClient._sendsApiKey()): a client without an API key, or one whose requests carry a PBSV or viewer token, keeps/api/v1forfsand discovery, because/api/v2accepts only API keys and sends no CORS headers.package.jsonstays 0.36.0:scripts/release.sh majorbumps it to 1.0.0 at release (a pre-bumped version would release as 2.0.0).CHANGELOG.mdis new and holds the complete 1.0.0 notes; the README has a "Migrating from 0.x to 1.0" section.Risks and Remaining Work
thesisNumber) ship with this version in the skillsagent-api-v2PR.<reply_to>Thesis and version IDs, whichthesis version getsends to/api/v2and the gateway refuses; the quote then stays an ordinary quote. Fix in the App (write platform IDs) or the gateway (a version lookup by number).entity-idis a platform Asset ID; the App's share sheet reads it as an entity ID (frontend follow-up)./api/v1:trading.execute,subscribe({executeLatest}), broker--accountand the embeddedtrading accountsuse trex numeric IDs;alert groupuses numeric feed IDs.Breaking Changes
Major version (1.0.0). Details in
CHANGELOG.mdand the README migration section:/api/v1)./api/v2problem codes replace v1 and GraphQL codes (for example a failed precondition isCONFLICT409, a malformed responseINVALID_RESPONSE502);detailsis undefined for problems./api/v2route requires one credential permission and refuses withINSUFFICIENT_PERMISSION; calls that need the caller's username readGET /api/v2/me(social:read); every broker command needstrading:write.for-you list --newer-than,trading orders --source(use--origin),functions register --clear-run-as, andservice-account revoke --path --permission(use--grant-id).--run-as-service-accountrefuses empty values and0./api/v1.Database Migrations
None
Verification
npm run lint,npm run format:check,npm run typecheck,npm test(75 files, 1,499 tests) andnpm run buildpass on the PR head (2026-11-19);git statusis clean after the build. The tracked pre-push hook is not installed in the shared hooks directory, so the same five checks were run by hand.test/platformApi.test.tscovers query encoding,v2Path, headers, Merge Patch withnull, 204, idempotency keys, problem parsing, CLI error JSON and pagination. Mutations of each rule (repeated query parameters, Merge Patch, the caller's key,requiredPermission,retryAfterprecedence,invalidParams, page parameters, the repeated-token guard,./..segments, declared fields) each failed a test and were restored./api/v2request the suite sends (620 calls on 145 routes; every_v2Requestcall site insrc/ran at least once) was matched against the gateway's route snapshotpkg/v2/api/testdata/v2_snapshot.goldenat alva-gatewayb34005a9: method and path, every query parameter and body field with its type and enum value, and every ID's prefix. Fake responses were checked against the routes' response fields the same way. The only mismatches were the synthetic routes of the transport test.functions register --run-as-service-account 0) and the Thesis number fields (version number source, Thesis number, summary number, number validation) each failed a test and were restored./api/v2.Merge Order
1. alva-backend https://github.com/alva-ai/alva-backend/pull/3835 (platform permissions in
pkg/authctx).2. alva-gateway P1 (branch
agent-api-permissions), then alva-gateway P2 (branchagent-api-v2, the/api/v2routes), merged and deployed to STG and PRD.3. This PR. Every release cut from
mainafter this merge is 1.0.0, so merge it only when the/api/v2routes are live in the environments the release targets.4. Release 1.0.0 with
scripts/release.sh major, then the Toolkit submodule and Dispatch pin in sdk-monorepo (main publishes STG, the release tag PRD), together with the skillsagent-api-v2PR.Related PRs
agent-api-permissionsandagent-api-v2).Changelog:
docs/changelogs/2026-11-19-agent-api-v2.md