Skip to content

BE039 - Product Substitution Quality, Observability and Controlled Rollout - #222

Open
shshwtsuthar wants to merge 1 commit into
BE037-authenticated-product-substitutionsfrom
BE039-substitution-quality-rollout
Open

shshwtsuthar wants to merge 1 commit into
BE037-authenticated-product-substitutionsfrom
BE039-substitution-quality-rollout

Conversation

@shshwtsuthar

Copy link
Copy Markdown
Collaborator

Ticket

BE039 - Product Substitution Quality, Observability and Controlled Rollout

  • BE039

Description

Adds controlled release gates and privacy-preserving operational evidence for the authenticated substitutions API.

  • Adds a fail-closed environment rollout switch with disabled, canary, and enabled modes.
  • Emits aggregate-only candidate, filter, empty-state, duration, and reason-code metrics without user, profile, barcode, or allergy values.
  • Adds a synthetic evaluation set and regression gates for known conflicts, category relevance, coverage, empty results, and ranking latency.
  • Documents dashboard panels, alert thresholds, incident ownership, staged rollout, rollback, and known limitations.
  • Keeps internal ranking metrics out of the public response contract.

Testing

cd mobile-app
npm test -- --runInBand __tests__/substitutionEligibility.test.ts __tests__/productSubstitutionApi.test.ts __tests__/substitutionObservability.test.ts __tests__/substitutionQualityEvaluation.test.ts

Result: 24 tests passed, 4 test suites passed.

npx firebase-tools@15.28.2 emulators:exec --project demo-food-remedy-be037 --only firestore "npm test -- --runInBand __tests__/firestoreProductSubstitutionRepository.test.ts"

Result: 2 tests passed against the Firestore emulator.

cd ..
python3 -m unittest test.test_recommendation_contract_v1 -v

Result: 8 tests passed.

Checks

  • All requirements of the ticket have been implemented, or I have commented on any exclusions
  • Unit tests have been added or updated for any backend changes (if applicable)
  • I have reviewed the Files Changed tab and verified it only contains relevant changes (comment if unsure about any)
  • This PR has been reviewed and approved

Screenshots

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