Skip to content

feat: add deterministic test provider for staging/testnet closes #459#476

Merged
Cedarich merged 6 commits into
Pulsefy:mainfrom
kimanicode:feat/test-provider-deterministic-#459
May 29, 2026
Merged

feat: add deterministic test provider for staging/testnet closes #459#476
Cedarich merged 6 commits into
Pulsefy:mainfrom
kimanicode:feat/test-provider-deterministic-#459

Conversation

@kimanicode
Copy link
Copy Markdown
Contributor

@kimanicode kimanicode commented May 26, 2026

Closes #459


Summary

Adds a TEST_PROVIDER_MODE environment variable that activates a fixture-driven test provider, enabling the AI service to run without any API keys in staging/testnet/CI environments. The test provider returns stable, deterministic responses loaded from JSON fixture files, selected via SHA-256 hash of the request content — guaranteeing the same input always produces identical output.

Changes

New files:

  • services/test_provider.py — TestProvider class that loads endpoint-specific fixtures from fixtures/ and returns deterministic responses based on a hash of the serialized request data
  • fixtures/humanitarian_responses.json — 6 fixture responses covering credible, inconclusive, and not_credible verdicts with varied confidence scores

Copy link
Copy Markdown
Contributor

@Cedarich Cedarich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly resolve conflict

@Cedarich
Copy link
Copy Markdown
Contributor

@kimanicode

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 26, 2026

@kimanicode Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@kimanicode kimanicode requested a review from Cedarich May 26, 2026 17:21
@Cedarich Cedarich merged commit f1e8e3c into Pulsefy:main May 29, 2026
6 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.

Deterministic “Test Provider” for Staging/Testnet

2 participants