Skip to content

test(examples): regression test for seller_agent PRODUCTS schema compliance (#324)#327

Merged
bokelley merged 1 commit intomainfrom
claude/issue-324-seller-products-schema-regression-test
Apr 30, 2026
Merged

test(examples): regression test for seller_agent PRODUCTS schema compliance (#324)#327
bokelley merged 1 commit intomainfrom
claude/issue-324-seller-products-schema-regression-test

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented Apr 30, 2026

Refs #324

Summary

Issue #324 reports that @adcp/client@5.21.1's Ajv oneOf validator falsely flags products 2–5 in seller_agent.py as missing required properties (name, description, publisher_properties, etc.) — fields that are clearly present in the dumped CI response. The Python jsonschema validator confirms all six static products are 3.0.1 spec-compliant; the failures are in the npm-side error reporter, not in the shape we emit.

This PR adds a regression test that anchors that Python-side verdict and guardrails future PRODUCTS additions.

What's in this PR

  • tests/test_seller_agent_products_schema.py — 7 test cases:
    • test_full_products_list_passes_response_validation — validates all 6 products as a batch (catches array-level constraints)
    • test_individual_product_passes_response_validation[] — parametrized per product, so a failing product ID appears directly in the pytest node name

Both tests guard against outcome.variant == "skipped" (the silent-pass case when schemas/cache/ is absent).

_PRODUCTS is a copy.deepcopy snapshot at collection time, guarding against seed_pricing_option() mutating per-dict pricing_options contents if an integration test runs in the same process.

What was tested

  • pytest tests/test_seller_agent_products_schema.py -v — 7 passed (initial + fixup pass)
  • ruff check tests/test_seller_agent_products_schema.py — clean
  • mypy tests/test_seller_agent_products_schema.py --ignore-missing-imports — clean

Pre-PR review (initial)

  • code-reviewer: approved — two issues flagged in round 1 (variant != "skipped" guard, list() copy); both fixed; round-2 pass found no new blockers, 1 nit (shallow copy leaves per-dict pricing_options mutable)
  • dx-expert: approved — 3 nits noted: import path, raw repr vs format_issues(), shallow vs deep copy. None blockers.

Fixup commit — nits addressed (re-trigger via /triage execute on #324)

Three nits from the initial review were addressed in a follow-up commit:

# Location Change
1 line 19 Import validate_response + format_issues from public adcp.validation (not internal schema_validator submodule)
2 lines 50, 68 format_issues(outcome.issues) in assert messages for actionable CI output
3 line 35 copy.deepcopy(...) instead of list(...) to guard per-dict contents

Fixup pre-PR review:

  • code-reviewer: approved — no blockers; 1 nit (comment could be more precise about which mutations deepcopy guards); pre-existing internal imports in protocols/ are out of scope
  • dx-expert: approved — all three nits correctly fixed, no new issues introduced

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See adcp#3121
for context.

Session: https://claude.ai/code/session_01XcYd2AQ7o5h5SP2HEpbcXL

…liance (#324)

Validates all static products in seller_agent.py against the local AdCP
3.0.1 schema cache via the Python jsonschema validator, anchoring the
Python-side verdict that the CI divergence is in @adcp/client's Ajv
oneOf error reporter rather than in the response shape we emit.

https://claude.ai/code/session_019rDGvdv7HHDKwJeNri9Lff
@bokelley bokelley marked this pull request as ready for review April 30, 2026 15:08
@bokelley bokelley merged commit d3e1a0f into main Apr 30, 2026
11 of 12 checks passed
@bokelley bokelley deleted the claude/issue-324-seller-products-schema-regression-test branch April 30, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants