feat(providers): add deterministic test provider for staging/CI (#459)#512
Merged
Cedarich merged 2 commits intoMay 29, 2026
Merged
Conversation
Cedarich
approved these changes
May 29, 2026
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
Provides deterministic AI outputs for predictable integration testing across the entire platform by extending the existing
TestProviderpattern to all key endpoints — OCR, proof-of-life, PII anonymization, and verification. All test providers are fixture-driven and activated purely via environment variable, requiring no code changes to enable in CI or staging.Closes #459
Changes
Python AI Service (
app/ai-service/)New fixture files:
fixtures/ocr_responses.json— 6 deterministic OCR results (varied fields, quality levels, edge cases)fixtures/proof_of_life_responses.json— 6 deterministic proof-of-life results (pass/fail, with/without burst frames)fixtures/anonymize_responses.json— 6 deterministic PII scrubbing results (varying PII types and counts)Extended
TestProviderto additional services (all bypass system dependencies whenTEST_PROVIDER_MODE=true):services/ocr.py— returns fixture OCR data instead of calling Tesseractservices/pii_scrubber.py— returns fixture anonymization data instead of calling spaCyproof_of_life.py— returns fixture POL data instead of calling OpenCVNew stability tests (
tests/test_test_provider_stability.py— 17 tests):TestProviderunit-level determinism (key generation, caching)NestJS Backend (
app/backend/)Added
VERIFICATION_MODE=testtoverification.service.ts:New stability tests (4 tests in
verification.service.spec.ts):How to Enable
No code changes required — purely environment variable driven.
CI / Staging / Testnet:
Checklist
issue/<number>-<slug>pnpm-lock.yaml/package-lock.jsonnot modified