Deterministic Feature Flag Evaluation
Shift-Right QE & Progressive Delivery β Day 1
Build an OpenFeature-style deterministic flag evaluator with SHA-256 sticky bucketing, semver/segment targeting rules, and fail-safe offline fallback defaults.
Non-deterministic flag evaluations cause users to flicker between v1 and v2 mid-session and make production incidents impossible to reproduce. Today you will test a deterministic SHA-256 sticky-bucketing evaluator with attribute targeting and fail-safe ERROR_FALLBACK defaults.
π¦ Progressive Delivery & Canary Rollout Simulator
Simulate feature-flag combinations, dark-launch shadow parity, and automated canary SLO kill-switches.
All feature flag pairs verified; canary error rate and p95 latency stay well within SLO budget.
The official reference codebase for Day 1 is hosted in the repository. Clone the repository and navigate to tests/day1-flag-evaluator.spec.ts to run the working solution.
git clone https://github.com/777abhi/progressive-delivery-qe-roadmap.git
cd progressive-delivery-qe-roadmap/tests/day1-flag-evaluator.spec.tsRun & Inspect the Flag Evaluator
Clone the standalone reference repository and run the Day 1 Vitest suite.
git clone https://github.com/777abhi/progressive-delivery-qe-roadmap.git
cd progressive-delivery-qe-roadmap
npm ci
npm run test:day1export function computeStickyBucket(flagKey: string, targetingKey: string): number {
const hash = createHash('sha256').update(`${flagKey}:${targetingKey}`).digest();
return hash.readUInt32BE(0) % 100;
}- Implemented deterministic SHA-256 sticky bucketing keyed by (flagKey, targetingKey).
- Evaluated multi-condition targeting rules with eq, in, and semverGte operators.
- Verified safe ERROR_FALLBACK behavior when targetingKey is empty or flag is disabled.
π§ Knowledge Check
Why should percentage rollouts use a cryptographic or consistent hash of (flagKey + targetingKey) instead of Math.random()?