Skip to content

Add Storefront API client and shared verification contracts - #4309

Open
Ji-One1 wants to merge 2 commits into
jb/storefront-e2e-v2-01-dependenciesfrom
jb/storefront-e2e-v2-02-contracts-api
Open

Ji-One1 wants to merge 2 commits into
jb/storefront-e2e-v2-01-dependenciesfrom
jb/storefront-e2e-v2-02-contracts-api

Conversation

@Ji-One1

@Ji-One1 Ji-One1 commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

The buyer tool needs shared contracts so that later layers can separate an agent's report from code-verified storefront state. This PR adds those contracts and the catalog API client, not an executable buyer flow.

What this changes

  • Wrap Hydrogen's public Storefront client for tokenless queries. Pass country and language through request-context i18n and let each caller parse response data. There is no extra response-object schema check.
  • Define buyer, scenario, checkpoint, cart snapshot, evidence, and result contracts. RunResult.context is directly {country, language}.
  • Define CartReadError in src/browser/cart-error.ts, with five codes: unavailable, request-failed, timeout, invalid-response, and unreadable. The reader is not implemented here.
  • Define the supported Standard Event names with a private, type-only check against Hydrogen's vendored StandardEventType. Scenarios select which supported events to record.
  • Add per-run JSON/JSONL artifact storage, atomic result writes, and TypeScript source-import settings. Reuse Pick<GraphQLFormattedError, "message"> in the legacy validation helper.

Developer impact

Internal tooling only; no Hydrogen public exports change. No changeset is needed.

Risk

Country and language are configured values, not verified browser or effective API context. Artifact serialization preserves values; Error objects retain only name and message. This is not redaction or a guarantee that messages contain no secrets.

Stack: 02/15. Previous: #4308. Next: #4310.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset.
If the changes are user-facing and should cause a version bump, run pnpm run changeset add to track your changes and include them in the next release CHANGELOG.
If you are making simple updates to examples or documentation, you do not need to add a changeset.

@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-02-contracts-api branch from a0f3cd0 to 448ff24 Compare November 9, 2026 00:37
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-02-contracts-api branch from 448ff24 to 15ace48 Compare November 9, 2026 06:55

This branch has not been deployed

No deployments
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