From 2b28a10221bb1d24f2cc4dd16a45a3ec0b9030d0 Mon Sep 17 00:00:00 2001 From: vvillait88 Date: Mon, 14 Sep 2026 13:26:39 -0400 Subject: [PATCH] Make the integration smoke probe a real 402 The step checked https://example.com with || true and continue-on-error, so it passed whatever pay did. It now probes the fullenrich storefront without paying and fails unless the challenge is a 402 that parses into the Base x402, Tempo and Solana rails. --- .github/workflows/integration.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 9c9f4ac..a4fe8ae 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -62,11 +62,20 @@ jobs: - name: Read balance again run: ./dist/index.js balance --chain ${{ matrix.chain }} --network ${{ matrix.network }} --json - - name: Probe an x402-gated testnet endpoint (smoke) + # A real merchant 402, probed without paying, asserting the challenge + # parses into every rail pay settles on. A probe of a page that never + # returns 402 passes whatever pay does, so this one has to be able to fail. + - name: Parse a live 402 challenge (no payment) if: matrix.chain == 'base' run: | - ./dist/index.js check https://example.com --json || true - continue-on-error: true + set -euo pipefail + url=https://fullenrich.agentscore.com/company/lookup + ./dist/index.js check "$url" --method POST -H 'Content-Type: application/json' -d '{"domain":"stripe.com"}' --json > probe.json + jq -e '.status == 402 and .payment_required == true' probe.json > /dev/null || { echo "expected a 402 challenge from $url" >&2; cat probe.json >&2; exit 1; } + for rail in 'exact/eip155:8453' 'tempo/charge' 'solana/charge'; do + jq -e --arg r "$rail" '[.rails[].rail] | index($r) != null' probe.json > /dev/null || { echo "rail $rail missing from the parsed challenge" >&2; jq '[.rails[].rail]' probe.json >&2; exit 1; } + done + echo "parsed rails: $(jq -c '[.rails[].rail]' probe.json)" - name: Faucet hint summary if: matrix.chain != 'tempo'