HomeRoadmapsProgressive Delivery Day 1
Shift-Right QE & Progressive Delivery Β· Day 1 Β· 20 min

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.

⚑ Runtime: Node.js 22 LTS Β· VitestπŸ›‘οΈ Shift-Right & Progressive Delivery QE Architect
Feature FlagsOpenFeatureSticky BucketingTargeting RulesFail-Safe
About this lab

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.

Healthy Progressive Canary (5% β†’ 100%)

All feature flag pairs verified; canary error rate and p95 latency stay well within SLO budget.

Canary Error Rate
0.1% (base 0.12%)
p95 Latency Ratio
1.02x
Gate Verdict
PROMOTE
Decision Log: Initial 5% cohort healthy
πŸ“¦Sample Codebase & Working Solution (Day 1)Available Now
View on GitHub

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 β€” Working Solution
git clone https://github.com/777abhi/progressive-delivery-qe-roadmap.git
cd progressive-delivery-qe-roadmap/tests/day1-flag-evaluator.spec.ts
🏭Production Context & Enterprise Implementation
πŸ’‘ Why We Are Doing This: If a flag SDK uses Math.random() or lacks a fallbackVariation, a transient control-plane outage or missing targetingKey can crash checkout flows.
🏒 Real-World Production Usecase: Verifying OpenFeature providers, sticky A/B cohorts, and semantic-version mobile rollouts in CI before enabling flags in production.
βš™οΈ How Implemented in Production: Pure deterministic evaluator hashing flagKey + targetingKey via SHA-256 modulo 100 with explicit ERROR_FALLBACK and DISABLED reason codes.
Phase 1

Run & Inspect the Flag Evaluator

Clone the standalone reference repository and run the Day 1 Vitest suite.

Step 1.1: Clone and Run Day 1 Tests
Terminal β€” Setup Day 1 Lab
git clone https://github.com/777abhi/progressive-delivery-qe-roadmap.git
cd progressive-delivery-qe-roadmap
npm ci
npm run test:day1
Step 1.2: Sample Codebase & Working Solution (Day 1)
src/flags/flagEvaluator.ts
export function computeStickyBucket(flagKey: string, targetingKey: string): number {
  const hash = createHash('sha256').update(`${flagKey}:${targetingKey}`).digest();
  return hash.readUInt32BE(0) % 100;
}
Day 1 Key Learnings
  • 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()?