Skip to content

Expose the add-only CLI and terminal output - #4322

Draft
Ji-One1 wants to merge 3 commits into
jb/storefront-e2e-v2-14-buyer-adapterfrom
jb/storefront-e2e-v2-15-cli
Draft

Ji-One1 wants to merge 3 commits into
jb/storefront-e2e-v2-14-buyer-adapterfrom
jb/storefront-e2e-v2-15-cli

Conversation

@Ji-One1

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

Copy link
Copy Markdown
Collaborator

The preceding layers need one command that runs the add-only scenario against an existing storefront. This PR connects those layers and gives the operator a result and artifact location.

What this changes

  • Add pnpm storefront-e2e, argument validation, limits, exit codes, signal handling, and a terminal summary.
  • Require --country and --language before browser startup. They configure catalog queries and the buyer goal; they do not set the market or verify browser/effective API context.
  • Wire the owned browser, early Stagehand observer, catalog scenario, selected Standard Events, buyer, and same-session cart reader. Resolve model credentials only when the buyer starts.
  • Remove Stagehand flow-log variables before SDK loading. Document setup, verdicts, private artifacts, and known limits. Standard Event records keep only the focused payload fields from Define read-only Standard Event evidence #4311, with no event cart IDs; captured checkout URLs remain private, unredacted diagnostics.
  • Update the documentation and scripted browser fixtures for blocked checkout without automatic buyer stop. Cover continued execution, recovery to a readable storefront page, a blocked popup that leaves the original page readable, and an unrecovered same-tab error page that makes the cart read inconclusive. These fixtures do not test model recovery. Checkout capture does not confirm an add or suppress the configured cart reader.

Developer impact

Uses Node 24 source execution and built workspace packages. Internal tooling only; no published Hydrogen changes or changeset. The existing scripted Playwright suite remains separate.

Risk

Use a storefront where a guest add is permitted. The agent changes its session cart and makes model calls. Private artifacts and terminal output retain recorded values; screenshots are not masked. The Storefront API supplies catalog data only. Cart proof requires the storefront's same-session AJAX endpoint.

How to Test

  1. From the repository root, use Node 24, run pnpm install and pnpm run build:pkgs, and install Chrome or set PLAYWRIGHT_BROWSER_EXECUTABLE_PATH.
  2. Set a supported model credential, such as ANTHROPIC_API_KEY.
  3. Run pnpm storefront-e2e https://<your-storefront> --country US --language EN with values suited to that storefront.
  4. Read the terminal reason and saved result.json, evidence, and screenshots. For a pass, confirm one unit of the pinned variant in the recorded session-cart assertion. No purchase should occur.

Stack: 14/15. Previous: #4321. Optional report: #4323.

@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch from c8a88a1 to a685b73 Compare November 5, 2026 16:23
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch 2 times, most recently from 4d09eaf to 831fb41 Compare November 5, 2026 18:42
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch from a685b73 to 8d126d5 Compare November 5, 2026 18:42
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch from 831fb41 to cb638e2 Compare November 6, 2026 00:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch from 8d126d5 to 5b1742f Compare November 6, 2026 00:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch from cb638e2 to 9100cc5 Compare November 6, 2026 01:36
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch 2 times, most recently from 623d06d to f25adc8 Compare November 6, 2026 01:45
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch from 9100cc5 to a4ebdf1 Compare November 6, 2026 01:45
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch from f25adc8 to 57a0f04 Compare November 6, 2026 14:27
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch from a4ebdf1 to 63550c2 Compare November 6, 2026 14:27
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch from 57a0f04 to e18c1ca Compare November 6, 2026 15:08
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch from 63550c2 to 276db42 Compare November 6, 2026 15:08
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch from e18c1ca to eaebcf1 Compare November 6, 2026 16:20
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch 2 times, most recently from 4b8acdf to 7e435b8 Compare November 6, 2026 19:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch 2 times, most recently from 74aadd1 to d77676c Compare November 6, 2026 20:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch 2 times, most recently from 8f592db to 8eea5c9 Compare November 6, 2026 20:32
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch 2 times, most recently from 7a8f734 to cba879e Compare November 6, 2026 20:59
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch from 8eea5c9 to bf9a568 Compare November 6, 2026 20:59
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch from cba879e to a8a0841 Compare November 9, 2026 00:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch 2 times, most recently from 7ef7a2e to 9cce697 Compare November 9, 2026 00:37
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch from a8a0841 to 4dc68a4 Compare November 9, 2026 00:37
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch from 9cce697 to ea5026a Compare November 9, 2026 04:23
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch from 4dc68a4 to dab3705 Compare November 9, 2026 04:23
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-14-buyer-adapter branch from dab3705 to bcf7c66 Compare November 9, 2026 06:55
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-15-cli branch from ea5026a to 4cad020 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