Skip to content

feat(sdk): offline SDKs name their read endpoint or say how to get one - #476

Merged
adiman9 merged 6 commits into
mainfrom
feat/sdk-create-read-endpoint
Oct 30, 2026
Merged

adiman9 merged 6 commits into
mainfrom
feat/sdk-create-read-endpoint

Conversation

@adiman9

@adiman9 adiman9 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

SDKs generated offline by a4 sdk create no longer emit a Program Read transport that silently depends on ConnectOptions.httpUrl. Account reads either name their endpoint or fail with how to get one.

What changed

  • Generators (TypeScript, Rust, Python): a program generated offline gets an unavailable read descriptor by default. Its message: install the program from the registry (a4 install program <package>) and use a4 dev, or regenerate with a4 sdk create --read-endpoint <url> for a self-hosted Arete server. Instructions and PDAs still generate offline.
  • a4 sdk create --read-endpoint <url> emits {kind: 'local-http', endpointSource: 'explicit', endpoint: <url>} for each offline program (IDL, ProgramSpec and local StackManifest paths, all three languages). Registry installs are unchanged.
  • Runtimes (TS core, Rust arete-sdk, Python arete-sdk) accept the two new descriptor shapes and keep accepting the existing local-http / connect-http-url descriptor, so SDKs generated before this still load. An unavailable read fails at read time with its message (INVALID_CONFIG), not at connect with a missing-httpUrl error; a program-only SDK with unavailable reads connects without a stack URL. Rust adds ProgramReadDescriptor::{LocalHttpEndpoint, Unavailable} and ProgramReadTransportKind::Unavailable.
  • CLI help and the CLI docs lead with a4 install / a4 dev.

Tests

  • TS core: explicit endpoint read without httpUrl; unavailable read rejects with the message and makes no request; validation of both shapes.
  • Rust SDK: wire round trip of both shapes, explicit endpoint transport without a base URL, unavailable transport error.
  • Python SDK: same, plus the message assertion update.
  • Interpreters: offline generation emits unavailable with the fix (TS/Rust/Python); TS with_read_endpoint emits the explicit descriptor.
  • Ran locally: TS core vitest (725 passed), Python SDK pytest (1073 passed); scripts/generate-example-sdks.sh and the CLI golden tests with A4_UPDATE_GOLDEN=1 (24 passed) to regenerate the example SDKs and goldens, whose only change is the offline read transport. CI only: the rest of the Rust build and tests (SDK, interpreter, CLI), all green.
  • The ORE example SDKs are generated offline, so their account readers are now unavailable with the fix text; the Rust example's board read was already best-effort and prints it. The interpreter's managed Solana fixture keeps reading its mock server through a configured program read.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue was found.

Summary

Offline-generated SDKs now name their account-read endpoint or explain how to get one.

  • Offline-generated SDKs name a read endpoint or explain how to get one.
  • SDK runtimes read from named endpoints and explain unavailable account reads.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Generate SDK] --> B{Registry install?}
  B -->|Yes| C[Use installed hosted binding]
  B -->|No| D{Read endpoint supplied?}
  D -->|Yes| E[Read from explicit URL]
  D -->|No| F[Emit unavailable descriptor]
  F --> G[Account read returns setup instructions]
Loading

Reviews (5) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

Comment thread cli/src/commands/public_artifacts.rs Resolved
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
arete-docs Ready Ready Preview Oct 30, 2026 4:21am UTC

Request Review

# Conflicts:
#	examples/ore-rust/src/generated/ore/sdk-manifest.json
@adiman9
adiman9 merged commit 574f5f0 into main Oct 30, 2026
35 checks passed
@adiman9
adiman9 deleted the feat/sdk-create-read-endpoint branch October 30, 2026 20:33

This branch was successfully deployed

1 active deployment
Preview — b9a83039 Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant