feat(X402-47): fixture-consumption infrastructure + 3 hand-rolled D.x captures#82
Merged
Merged
Conversation
… captures Closes the v0.3.2 audit-gate gap: D.2 / D.3 / D.5 verdict-synthesis paths now have end-to-end coverage via hermetic captured-response fixtures (no live HTTP, no service-up dependencies). New tests/fixtures/bazaar/captured-responses/ directory with three self-describing JSON fixtures: - d2-missing-propagation.json — manifest correct, indexer returns blank resource → metadata_propagation: missing → upstream_issue. Models @zev / TheRoosters / GM pattern. - d3-processing-stuck.json — CDP discovery returns 0 resources → indexer_state: processing → upstream_stuck verdict. Models Max's polyodds.bet pattern (canonical #2207 cluster). - d5-body-discovery.json — extensions.bazaar uses BodyDiscoveryExtension shape (info.input/output/schema). Was false-positive implementation_issue pre-v0.3.2; now passes cleanly with looks_correct. Models AsaiShota test-echo-cdp + 0xdespot hyperD pattern. Self-describing fixture schema: {scenario, input, mocks, expected}. New integration test iterates over every .json in the directory, builds a mock fetcher dispatching by URL pattern (well-known / discovery / challenge fallback), runs runBazaarCheck end-to-end, asserts both the top-level verdict and per-check detail facets via dotted-path extraction (e.g., "indexing.indexer_state"). Adding a new fixture is one JSON file — the harness picks it up automatically. Scope cut vs original X402-47 AC: the ticket called for consuming 6 named contributor fixtures (TomSmart cdp-mature, AsaiShota test-echo-cdp, evanatpizzarobot tensorfeed, 0xdespot hyperd, hypeprinter007 anchor-x402 multi-rail). Only TomSmart's first fixture is in the repo; the rest are pre-committed but not delivered. This PR ships the infrastructure with synthetic captures so the v0.3.2 audit gate has D.x coverage NOW; real contributor fixtures wire in via the same harness as they land (TomSmart Sunday drop is the next external event). Tests: 511 pass (was 499; +12 captured-response). 105 files (102 + 3 fixture JSON files) / 393 KB. Under both caps. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The CHANGELOG entry was prepared but the Edit failed mid-commit due to a concurrent linter touch on the file. Adding as a follow-up so the v0.3.2 ### Added section captures X402-47. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
X402-47 — closes the v0.3.2 audit-gate gap on D.2 / D.3 / D.5 verdict-synthesis paths. Ships fixture-consumption infrastructure + 3 hand-rolled captured-response fixtures covering one v0.3.2 D.x failure mode each. Hermetic, no live HTTP, no service-up dependencies.
What this PR adds
New directory:
tests/fixtures/bazaar/captured-responses/Three self-describing JSON fixtures, each capturing the three mock responses (well-known + challenge + discovery) needed to exercise one D.x verdict-synthesis path through
runBazaarCheckend-to-end:d2-missing-propagation.jsonmetadata_propagation: missing→upstream_issued3-processing-stuck.jsonindexer_state: processing→upstream_stuckd5-body-discovery.jsonlooks_correct(no false-positive)Schema (self-describing)
{ "$comment": "...", "scenario": "<slug>", // matches file basename "input": { "serviceUrl": "...", "chain": "base-sepolia" }, "mocks": { "well-known": { "status": 200, "body": {...} }, "challenge": { "status": 402, "body": {...} }, "discovery": { "status": 200, "body": {...} } }, "expected": { "verdict": "upstream_stuck", "exitCode": 3, "facets": { "indexing.indexer_state": "processing" } } }New integration test:
tests/integration/bazaar-check-captured-responses.test.tsAuto-discovers every
.jsonin the fixture directory. For each fixture:runBazaarCheckend-to-endkind+exitCode) match expecteddetailfacet via dotted-path extraction (e.g.,"indexing.indexer_state")Adding a new fixture is one JSON file — the harness picks it up automatically (no test code change required for new scenarios that fit the existing schema).
Scope cut vs original X402-47 AC
The original ticket called for consuming 6 named contributor fixtures:
production-set/)Reality: only TomSmart's first fixture is in the repo. The other 5 are pre-committed but not yet delivered (TomSmart's Sunday drop is ~24h out as of writing; the others are rolling).
This PR ships the infrastructure NOW with synthetic hand-rolled captures so the v0.3.2 audit gate has D.x coverage; real contributor fixtures wire in via the same harness as they arrive. The synthetic fixtures and the real ones coexist — no migration needed when contributor fixtures land.
Acceptance criteria (X402-47, satisfied at the infrastructure layer)
captured-responses/) — extending the loader ford4-targets/+multi-rail/is one-line work when those land--endpointmode)test-echo-cdp-shape produceslooks_correct(NOT false-positiveimplementation_issue) under v0.3.2### Addedentry documenting the new infrastructure + scope cutStrict audit gate — abbreviated (user-in-loop mode)
6624e21(PR feat(X402-46): D.3 indexer-state probe + upstream_stuck composite verdict #81 X402-46 + cap-bump merged); .gitignore WIP not staged$commentfield as documented free-text (test ignores it)What unblocks on merge
🤖 Generated with Claude Code