Skip to content

Probe sample envelope always carries resource; thread extensions - #116

Merged
vvillait88 merged 1 commit into
mainfrom
probe-resource-extensions
Aug 18, 2026
Merged

Probe sample envelope always carries resource; thread extensions#116
vvillait88 merged 1 commit into
mainfrom
probe-resource-extensions

Conversation

@vvillait88

Copy link
Copy Markdown
Contributor

Summary

Python twin of agentscore/node-commerce PR 109 (2.9.0). x402 v2 envelope validators (mppx, and the shared discovery engine behind x402scan and MPPScan) refuse a PAYMENT-REQUIRED header without a resource block, so a discovery-probe sample that omitted it read as "no valid x402 response"; the same engines read the Bazaar extension's example input to build valid bodies for their follow-up probes, so a probe without extensions got re-probed with junk bodies and the merchant's validation answers were reported as paywall failures.

  • build_discovery_probe_response: the sample envelope now always carries a v2 resource (explicit resource, the resource_url shorthand, or synthesized from the realm with an http-prefix guard) and threads optional extensions into both the header and the body mirror.
  • Checkout: an x402_sample on discovery_probe inherits resource (the checkout's own url + resource_info) and enriched Bazaar extensions from discovery_extensions; explicit values still win.
  • Version bumped to 2.7.0. Worked with Varun (fix-all ruling on the scanner-sweep findings).

Type of change

  • Bug fix (no breaking change)
  • New feature (no breaking change)
  • Breaking change (existing callers must update)
  • Docs, tests, or internal maintenance only

Public API

X402SampleProbe gains optional resource and extensions fields. No caller migration needed: existing configs keep working, and their emitted probes gain the resource (and, under Checkout, the inherited extensions) that validators require. The real 402 path is untouched.

Test plan

New tests: probe always carries resource (synthesized and explicit) and mirrors extensions in header and body; Checkout inheritance test (resource from url + resource_info, extensions from discovery_extensions). uv run pytest (1863 passed, coverage 95.37% over the 95% gate), uv run ruff check/format --check, uv run ty check all green locally. Deployed-path smoke with mppx validate and the @agentcash/discovery engine follows the core-store dep bump, this session.

Checklist

  • Tests cover the new behavior, and the suite passes locally
  • Lint, format, and type checks pass
  • Docs and README examples updated if the public surface changed
  • No secrets, credentials, or personal data in the diff or the tests

…p to 2.7.0

Python twin of node-commerce 2.9.0. x402 v2 envelope validators (mppx,
and the shared discovery engine behind x402scan and MPPScan) refuse a
PAYMENT-REQUIRED header without a resource block, and read the Bazaar
extension's example input to build valid follow-up probe bodies.

- build_discovery_probe_response: the sample envelope always carries a
  v2 resource (explicit, resource_url shorthand, or synthesized from
  the realm) and threads optional extensions into header and body.
- Checkout: an x402_sample on discovery_probe inherits resource (the
  checkout's url + resource_info) and enriched Bazaar extensions from
  discovery_extensions; explicit values win.
- Tests pin the sources, passthrough, and inheritance; README/CLAUDE.md
  document the behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vvillait88
vvillait88 merged commit a3279c9 into main Aug 18, 2026
7 checks passed
@vvillait88
vvillait88 deleted the probe-resource-extensions branch August 18, 2026 20:16
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