Extraction provider conformance#
Decision#
Bundled adapters implement one provider-neutral ExtractionProvider contract
and declare capabilities for structured output, exact excerpts, task specs,
usage, and warnings. The extraction core rejects a missing required declared
capability before issuing a call. Capability metadata remains optional for
existing injected providers, preserving their behavior.
Anthropic, OpenAI, and Gemini are isolated optional subpath adapters. Each maps its native forced-function response, finish reason, and usage accounting into the same proposal parser and then the same core grounding normalization. No adapter is selected by the core and adding one does not create a default.
Provider exceptions are classified into authentication, rate-limit, timeout,
invalid-request, unavailable, or unknown failures with an explicit retryable
flag. The original exception is retained unchanged as native; normalization
adds control-flow semantics and never replaces diagnostic evidence.
Physical batching is optional and capability-gated. extractBatch() means one
provider- or runtime-native physical operation, never a Promise.all wrapper.
It returns one positional fulfilled/rejected outcome per input so item-local
failures remain typed and successful siblings survive. The Relay adapter
projects this seam only when its runtime truthfully declares a positive batch
bound and implements invokeBatch(); other runtimes omit it.
Verification#
The deterministic conformance suite runs the same schema, versioned task, fixture, expected proposal, locator, and token accounting across every bundled adapter through injected clients. The benchmark's existing optional provider module lane supplies live quality/cost comparison under the same corpus and task revisions without making credentials part of the hermetic gate. Physical-batch conformance separately proves one physical call, bounded batch size, input/output order, shared cancellation, partial item failure, and portable diagnostic redaction through Relay's injected fake runtime.
Dependency boundary#
Core imports no provider SDK. Adapter SDKs are optional peers loaded dynamically only when a caller does not inject a client. Provider-specific credentials, models, endpoints, response types, and diagnostics stay inside their subpaths.