Skip to content

Extend update-sdk-examples skill to cover the RPC OpenRPC spec#2670

Open
ElliotFriend wants to merge 4 commits into
mainfrom
chore/skill-track-rpc-spec
Open

Extend update-sdk-examples skill to cover the RPC OpenRPC spec#2670
ElliotFriend wants to merge 4 commits into
mainfrom
chore/skill-track-rpc-spec

Conversation

@ElliotFriend

Copy link
Copy Markdown
Contributor

The update-sdk-examples skill already tracks stellar/stellar-rpc (for the Go-client relocation). This extends it so a new stellar-rpc release also triggers a check of the Stellar RPC OpenRPC spec we ship in openrpc/ — encoding the workflow used in #2669.

Changes to .claude/skills/update-sdk-examples/SKILL.md

  • New Stellar RPC OpenRPC spec section: bump info.version in build.mjs; verify each method's request/response types against the canonical Go structs in go-stellar-sdk/protocols/rpc at the commit stellar-rpc pins (including the ,string wire-encoding quirks and the per-method string-vs-number divergence); refresh examples from the live testnet RPC (truncating oversized xdr blobs); regenerate with pnpm rpcspec:build and validate with pnpm rpcspec:validate, committing sources + regenerated static/stellar-rpc.openrpc.json together.
  • Reuses the existing stellar/stellar-rpc state-file entry to gate the check (no new state key).
  • Wires the spec outcome into the Report step and cross-links from the existing stellar-rpc gotcha and the intro/Context.

No behavior change to the SDK-example workflow itself.

🤖 Generated with Claude Code

The skill already tracks stellar/stellar-rpc for the Go-client relocation; a new
release should also trigger a check of the Stellar RPC OpenRPC spec we ship in
openrpc/. Adds a dedicated section describing that workflow:

- bump info.version in openrpc/scripts/build.mjs to the current release
- verify each method's request/response types against the canonical Go structs
  in go-stellar-sdk/protocols/rpc at the commit stellar-rpc pins (incl. the
  ,string wire-encoding quirks and per-method type divergence)
- refresh examples from the live testnet RPC, truncating oversized xdr blobs
- regenerate with pnpm rpcspec:build and validate with pnpm rpcspec:validate,
  committing sources + regenerated static spec together

Also wires the spec outcome into the report and cross-links from the existing
stellar-rpc gotcha.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 21, 2026 22:22
@ElliotFriend
ElliotFriend requested a review from kaankacar July 21, 2026 22:23

Copilot AI 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.

Pull request overview

Extends the SDK-update skill to audit and regenerate the Stellar RPC OpenRPC specification.

Changes:

  • Adds release-triggered OpenRPC auditing and reporting.
  • Documents type verification, example refresh, build, and validation steps.
  • Reuses the existing stellar-rpc release state.

Recommendation: NEEDS-CHANGES — fix state sequencing, version normalization, and JSON wire-shape inference.

Comment thread .claude/skills/update-sdk-examples/SKILL.md Outdated
Comment thread .claude/skills/update-sdk-examples/SKILL.md Outdated
Comment on lines +178 to +182
URL. For each method, compare our `methods/<m>.json` params and result against
the Go struct `json:"..."` tags — missing/extra/renamed fields, type
mismatches, and required-vs-optional (`,omitempty` or a pointer ⇒ optional).
Resolve our `$ref`s (into `schemas/`, `contentDescriptors/`) before concluding
a field is missing. **Wire-encoding quirks matter:** a `json:",string"` tag

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved in cdb711c

Comment thread .claude/skills/update-sdk-examples/SKILL.md Outdated
Comment thread .claude/skills/update-sdk-examples/SKILL.md Outdated
@stellar-jenkins-ci

Copy link
Copy Markdown

@kaankacar

Copy link
Copy Markdown
Contributor

Reviewed with full source verification — the encoded procedure is factually accurate, but I'd address two of Copilot's comments before merge.

Verified against primary sources (all true):

  • Repo layout: the five openrpc/src/stellar-rpc/ subdirs, hardcoded version: "27.1.1" in build.mjs, both rpcspec:* scripts, committed static/stellar-rpc.openrpc.json, and the .gitignore rule for the build intermediates.
  • stellar/stellar-rpc v27.1.1 go.mod pins go-stellar-sdk v0.6.1-0.20260625225930-6181cdf8bda5 (pseudo-version, trailing hash usable exactly as described); protocols/rpc/ is one file per method.
  • Every wire-encoding claim checked at that pinned commit: getTransaction/getEvents/getHealth close-times and getFeeStats.transactionCount all carry json:",string"; getTransactions/getLedgers top-level close-times don't; the cross-method divergence (createdAt string in getTransaction vs number in getTransactions) is real. Live testnet getHealth returns "latestLedgerCloseTime":"1784733317" — string on the wire, as stated.
  • Bump RPC OpenRPC info.version to 27.1.1 and fix request/response type drift #2669 (the workflow this encodes) merged today; step-3.3 cross-references are consistent with the existing file.

On Copilot's five comments — two are confirmed real and worth a small patch:

  1. State-ordering (line 154): confirmed. Step 3.6 advances the stellar/stellar-rpc state entry during SDK processing, and this new check is gated by that same entry — an interruption after 3.6 but before/during the spec check means the next release-diff run silently skips the spec check for that release, permanently. One sentence fixes it (don't advance the stellar-rpc entry until the spec check completes, or re-run the spec check on the recorded tag if the last run didn't finish).
  2. Custom marshalers (line 182): confirmed. EventTypeSet and SegmentFilter have custom MarshalJSON/UnmarshalJSON, so the struct-tag heuristic can flag currently-correct schemas as drift. Worth a caveat sentence in step 2 (check for custom JSON methods before trusting tag-derived shapes).

The other three (future tagged go.mod pin, v-prefix normalization, "all under openrpc/" wording) are fair but minor nits — fine to fold in or skip.

Since this skill runs unattended on a schedule, the state-ordering gap is the one I'd consider blocking; everything else is polish.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@stellar-jenkins-ci

Copy link
Copy Markdown

ElliotFriend and others added 2 commits July 22, 2026 15:53
…alers

Addresses Copilot review on the OpenRPC spec-check step. Corrects the
required-vs-optional heuristic (a pointer without `,omitempty` is a
required nullable field, not optional) and adds a caveat that types with
custom Marshal/UnmarshalJSON serialize independently of their struct tags
(EventTypeSet, SegmentFilter, LedgerEntryChangeType). Keeps the existing
`json:",string"` wire-encoding guidance. Examples verified against
go-stellar-sdk protocols/rpc.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Kaan's review flagged that the state-ordering fix lived only in the RPC
spec section while step 3.6 still gave a blanket "update the state file
entry" instruction — a latent contradiction for the stellar/stellar-rpc
entry. Carve out the exception where the agent actually acts, so an
interrupted spec audit reliably stays in scope for the next run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stellar-jenkins-ci

Copy link
Copy Markdown

1 similar comment
@stellar-jenkins-ci

Copy link
Copy Markdown

@ElliotFriend

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review, @kaankacar — the full source verification is much appreciated. All points are now resolved:

  • State-ordering (Copilot init #1, your blocking item): step 3.6 now carves out the stellar/stellar-rpc entry explicitly — it isn't advanced until the OpenRPC spec check completes successfully, so an interrupted spec audit stays in scope next run (03415c9), with the matching caveat in the spec section (7e8192e).
  • Custom marshalers (Copilot Pulling in new OpenAPI /api into our new new docs site #2): added a step-2 caveat that types with custom MarshalJSON/UnmarshalJSON (EventTypeSet, SegmentFilter, LedgerEntryChangeType) serialize independently of their struct tags — verify from the marshaler, don't rewrite correct schemas (cdb711c). Also corrected the required-vs-optional heuristic: a pointer without ,omitempty is nullable but still required (e.g. LedgerEntryChange.before/after).
  • The three minor nits (pseudo- vs tagged go.mod pin, v-prefix normalization, "all under openrpc/" wording) were folded in as well.

Should be good to merge.

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.

3 participants