Skip to content

Restore thin discovery adapter boundaries - #9

Merged
kev1n merged 1 commit into
mainfrom
fix/tolerant-discovery-adapter
Jul 28, 2026
Merged

Restore thin discovery adapter boundaries#9
kev1n merged 1 commit into
mainfrom
fix/tolerant-discovery-adapter

Conversation

@kev1n

@kev1n kev1n commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

  • bump anyapi-cli to 0.4.1 and make discovery a tolerant known-field projection
  • recursively fail closed on case-insensitive *credit* keys or any provider value other than AnyAPI before projection
  • preserve JSON Schemas as opaque objects and accept gateway-published pricing, lane, health, and failover facts without deriving relationships
  • stop recursively sanitizing successful run and balance responses so customer fields such as creditScore, provider, and providers pass through unchanged
  • add a credentialless live production canary to the existing CI and publish jobs

Compatibility contract

Discovery remains customer-safe but forward compatible: safe additive fields are ignored, optional failover and excludesCallerDelay are projected, older payloads without them remain valid, and malformed required known fields still fail. The bundled discovery skill now directs callers to consume gateway-published pricing.from, pricing.failoverMaxUsd, lane order, and failover without lane-derived assertions.

Run and balance bodies are not discovery metadata. Successful bodies are returned unchanged instead of being recursively rewritten.

Validation

  • npm run build
  • npm test — 9 files, 62 tests
  • npm run canary:live — parsed 274 production catalog APIs, /catalog/search?q=web&limit=1, and the public schema for ahrefs.backlinks through production readers
  • npm pack --dry-run
  • git diff --check

The canary retries only transport failures, HTTP 429, and 5xx responses. Reader/parser failures fail immediately.

@kev1n
kev1n merged commit 3bed211 into main Jul 28, 2026
2 checks passed
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