feat(catalog): single-source buyer prompts, docs deep links, signing metadata - #687
Closed
OisinKyne wants to merge 1 commit into
Closed
feat(catalog): single-source buyer prompts, docs deep links, signing metadata#687OisinKyne wants to merge 1 commit into
OisinKyne wants to merge 1 commit into
Conversation
…metadata
- new internal/buyprompts package is the one authoring point for how-to-buy
copy; the 402 page, /api/services.json ('buy' block with callShape +
prompts per buyer-software kind), the storefront, and 'obol sell info'
all render it, so instructions can no longer drift between surfaces
(the storefront was still advertising the removed --no-verify-identity flag)
- catalog entries gain openapiPath + docsPath (Scalar deep-link anchor);
storefront shows API-docs links for every offer type, skill.md service
details link the anchored docs
- x-payment-info always emits accepts[] with payTo, CAIP-2 network, atomic
amount, and the asset's EIP-712 signing domain, so an OpenAPI-only client
can construct a valid X-PAYMENT without a second fetch
- @scalar/api-reference bumped 1.34.0 -> 1.62.1; renovate custom manager +
postUpgradeTasks now keep it current, with scripts/update-scalar-sri.sh
refreshing the SRI hash inside the same renovate PR
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Superseded by #690. The buyer-funnel stack (#686 → #687 → #688) and the x402 v2 Leaving this open for the author to close in favor of #690. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Buyer-facing "how to buy" instructions were authored in three independent places: the 402 paywall page (Go string literals), the public storefront (TSX literals), and
/skill.md(template funcs). They had already drifted twice — the 402 agent page taught a call path that 404s (fixed in the gateway PR), and the storefront still advertisedobol buy inference --no-verify-identity, a flag the CLI removed. Every future buyer-software variant would have forked a fourth copy.What
internal/buypromptsis now the single authoring point for buyer instructions. It generates a machine-readable call shape (method/path/bodyKind/streaming) plus copy-paste prompts keyed by buyer-software kind (obol-agent,generic-llm,cli)./api/services.jsonentries carry abuyblock (JSON Schema updated, additive). The storefront renders these prompts verbatim (with task interpolation, legacy fallback for old catalogs), the 402 page builds its prompt cards from the same package, andobol sell info's "How to buy" prefers the published block. Supporting a new kind of buying software = one new prompt key, published to every surface simultaneously.openapiPath(key into/openapi.jsonpaths) anddocsPath(Scalar hash-routing anchor, e.g./api#tag/agent/POST/services/x/v1/chat/completions— format centralized in the controller so consumers never hardcode it). The storefront now shows API-docs links for all offer types (was HTTP-only), and skill.md service details link the anchored docs.x-payment-infosigning metadata: every operation now advertisesaccepts[](single-payment offers included) withpayTo, CAIP-2 network, atomic amount, and the asset's EIP-712 signing domain — an OpenAPI-only client can construct a validX-PAYMENTwithout a second fetch ofservices.json. Wrong-domain signing is our top silent buyer killer.@scalar/api-referencebumped 1.34.0 → 1.62.1 (SRI refreshed). New renovate custom manager watches the pin;postUpgradeTasksrunsscripts/update-scalar-sri.shinside the renovate branch (allow-listed viaRENOVATE_ALLOWED_COMMANDSin the workflow), so bump PRs arrive with the SRI hash already correct. The script works on dev machines (openssl) and in the renovate container (node fallback, byte-identical output verified).Testing
internal/buypromptstests pin the anti-drift invariants: chat offers always teach/v1/chat/completions, all types carry all prompt keys, unknown types get safe single-shot semanticstsc --noEmit); renovate regex verified to match the annotated const; SRI script round-trips to the identical hash🤖 Generated with Claude Code