:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(flags): evaluate experiment rules (#113153)
Anders14fd81a12536
diff --git a/rust/feature-flags/src/api/types.rs b/rust/feature-flags/src/api/types.rsindex e6cd121d8bac..9d0f9de0b184 100644--- a/rust/feature-flags/src/api/types.rs+++ b/rust/feature-flags/src/api/types.rs@@ -563,7 +563,14 @@ impl From<FlagDetails> for FlagDetailsV3 {condition_index: rule.map(|rule| rule.index as i32),description: Some(evaluation.description),};- (evaluation.value, reason, rule, 2, None, None)+ (+ evaluation.value,+ reason,+ rule,+ 2,+ None,+ evaluation.variant_key,+ )}ConfigOutcome::V2(None) => {let reason = FlagEvaluationReason {diff --git a/rust/feature-flags/src/flags/config_v2.rs b/rust/feature-flags/src/flags/config_v2.rsindex 52f8a52d11ae..acb3d27ebdb1 100644--- a/rust/feature-flags/src/flags/config_v2.rs+++ b/rust/feature-flags/src/flags/config_v2.rs@@ -56,6 +56,25 @@ pub const PERCENTAGE_ROLLOUT_FIELDS: &[&str] = &["seed","assign_by",];+pub const EXPERIMENT_FIELDS: &[&str] = &[+ "id",+ "rule_type",+ "targeting",+ "description",+ "metadata",+ "paused",+ "rollout_percentage",+ "on_rollout_miss",+ "assignment_algorithm",+ "seed",+ "assign_by",+ "variants",+ "holdout",+];+pub const VARIANT_FIELDS: &[&str] = &["key", "weight", "value"];+pub const HOLDOUT_FIELDS: &[&str] = &["seed", "exclusion_percentage"];+pub const MIN_VARIANTS: usize = 2;+pub const MAX_VARIANTS: usize = 20;pub const TARGETING_FIELDS: &[&str] = &["properties"];pub const PROPERTY_FIELDS: &[&str] = &["key",@@ -129,6 +148,29 @@ pub enum Outcome {on_rollout_miss: RolloutMiss,seed: String,},+ /// A weighted variant split. An Experiment points at its rule; the rule never names it.+ Experiment {+ paused: bool,+ rollout_percentage: f64,+ on_rollout_miss: RolloutMiss,+ seed: String,+ variants: Vec<Variant>,+ holdout: Option<Holdout>,+ },+}++#[derive(Clone)]+pub struct Variant {+ pub key: String,+ pub weight: f64,+ pub value: Value,+}++/// A holdout that belongs to its rule and has no identity of its own.+#[derive(Clone)]+pub struct Holdout {+ pub seed: String,+ pub exclusion_percentage: f64,}#[derive(Clone, Copy, Debug, PartialEq, Eq)]@@ -159,6 +201,7 @@ impl fmt::Debug for Outcome {f.write_str(match self {Self::TargetedRelease { .. } => "TargetedRelease { .. }",Self::PercentageRollout { .. } => "PercentageRollout { .. }",+ Self::Experiment { .. } => "Experiment { .. }",})}}@@ -232,7 +275,7 @@ impl Rule {let fields: &[&str] = match rule_type {"targeted_release" => TARGETED_RELEASE_FIELDS,"percentage_rollout" => PERCENTAGE_ROLLOUT_FIELDS,- "experiment" => return Err(ParseError::Unsupported("rule_type")),+ "experiment" => EXPERIMENT_FIELDS,_ => return Err(ParseError::Malformed("rule_type")),};closed(rule, fields, "rule")?;@@ -249,37 +292,32 @@ impl Rule {return Err(ParseError::Malformed("metadata"));}let targeting = properties::parse_targeting(required(rule, "targeting")?)?;- let value = required(rule, "value")?;- if !return_type.accepts(value) {- return Err(ParseError::Malformed("value"));- }- let value = value.clone();- let outcome = if rule_type == "targeted_release" {- Outcome::TargetedRelease { value }- } else {- if string(rule, "assignment_algorithm")? != "sha1_60_v1" {- return Err(ParseError::Malformed("assignment_algorithm"));- }- if rule- .get("assign_by")- .is_some_and(|v| v.as_str() != Some("person"))- {- return Err(ParseError::Malformed("assign_by"));- }- let seed = string(rule, "seed")?;- if !(1..=MAX_SEED_LENGTH).contains(&seed.chars().count()) {- return Err(ParseError::Malformed("seed"));+ let outcome = match rule_type {+ "targeted_release" => Outcome::TargetedRelease {+ value: typed_value(rule, return_type)?,+ },+ "percentage_rollout" => {+ let (rollout_percentage, on_rollout_miss, seed) = rollout(rule)?;+ Outcome::PercentageRollout {+ value: typed_value(rule, return_type)?,+ rollout_percentage,+ on_rollout_miss,+ seed,+ }}- let on_rollout_miss = match string(rule, "on_rollout_miss")? {- "continue" => RolloutMiss::Continue,- "return_default" => RolloutMiss::ReturnDefault,- _ => return Err(ParseError::Malformed("on_rollout_miss")),- };- Outcome::PercentageRollout {- value,- rollout_percentage: percentage(required(rule, "rollout_percentage")?)?,- on_rollout_miss,- seed: seed.to_owned(),+ _ => {+ let paused = required(rule, "paused")?+ .as_bool()+ .ok_or(ParseError::Malformed("paused"))?;+ let (rollout_percentage, on_rollout_miss, seed) = rollout(rule)?;+ Outcome::Experiment {+ paused,+ rollout_percentage,+ on_rollout_miss,+ seed,+ variants: variants(required(rule, "variants")?, return_type)?,+ holdout: rule.get("holdout").map(holdout).transpose()?,+ }}};Ok(Self {@@ -301,10 +339,109 @@ impl Rule {seed.capacity() + estimate_json_heap_size(value)}Outcome::TargetedRelease { value } => estimate_json_heap_size(value),+ Outcome::Experiment {+ seed,+ variants,+ holdout,+ ..+ } => {+ seed.capacity()+ + variants.capacity() * std::mem::size_of::<Variant>()+ + variants+ .iter()+ .map(|v| v.key.capacity() + estimate_json_heap_size(&v.value))+ .sum::<usize>()+ + holdout.as_ref().map_or(0, |h| h.seed.capacity())+ }}}}+fn typed_value(object: &Map<String, Value>, return_type: ReturnType) -> Result<Value, ParseError> {+ let value = required(object, "value")?;+ if !return_type.accepts(value) {+ return Err(ParseError::Malformed("value"));+ }+ Ok(value.clone())+}++fn rollout(rule: &Map<String, Value>) -> Result<(f64, RolloutMiss, String), ParseError> {+ if string(rule, "assignment_algorithm")? != "sha1_60_v1" {+ return Err(ParseError::Malformed("assignment_algorithm"));+ }+ if rule+ .get("assign_by")+ .is_some_and(|v| v.as_str() != Some("person"))+ {+ return Err(ParseError::Malformed("assign_by"));+ }+ let on_rollout_miss = match string(rule, "on_rollout_miss")? {+ "continue" => RolloutMiss::Continue,+ "return_default" => RolloutMiss::ReturnDefault,+ _ => return Err(ParseError::Malformed("on_rollout_miss")),+ };+ Ok((+ percentage(rule, "rollout_percentage")?,+ on_rollout_miss,+ seed(rule)?,+ ))+}++fn seed(object: &Map<String, Value>) -> Result<String, ParseError> {+ let seed = string(object, "seed")?;+ if !(1..=MAX_SEED_LENGTH).contains(&seed.chars().count()) {+ return Err(ParseError::Malformed("seed"));+ }+ Ok(seed.to_owned())+}++/// Weights are checked to two decimal places by the raw scan, so whole hundredths sum exactly.+fn variants(value: &Value, return_type: ReturnType) -> Result<Vec<Variant>, ParseError> {+ let items = value.as_array().ok_or(ParseError::Malformed("variants"))?;+ if items.len() > MAX_VARIANTS {+ return Err(ParseError::LimitExceeded("variants"));+ }+ if items.len() < MIN_VARIANTS {+ return Err(ParseError::Malformed("variants"));+ }+ let mut keys = HashSet::with_capacity(items.len());+ let mut hundredths = 0;+ let mut variants = Vec::with_capacity(items.len());+ for item in items {+ let variant = object(item, "variant")?;+ closed(variant, VARIANT_FIELDS, "variant")?;+ let key = string(variant, "key")?;+ if key.is_empty()+ || !key+ .bytes()+ .all(|b| b.is_ascii_alphanumeric() || b == b'_' || b == b'-')+ || !keys.insert(key)+ {+ return Err(ParseError::Malformed("variant.key"));+ }+ let weight = percentage(variant, "weight")?;+ hundredths += (weight * 100.0).round() as u32;+ variants.push(Variant {+ key: key.to_owned(),+ weight,+ value: typed_value(variant, return_type)?,+ });+ }+ if hundredths != 10_000 {+ return Err(ParseError::Malformed("variants"));+ }+ Ok(variants)+}++fn holdout(value: &Value) -> Result<Holdout, ParseError> {+ let holdout = object(value, "holdout")?;+ closed(holdout, HOLDOUT_FIELDS, "holdout")?;+ Ok(Holdout {+ seed: seed(holdout)?,+ exclusion_percentage: percentage(holdout, "exclusion_percentage")?,+ })+}+#[derive(Clone, Copy)]enum ReturnType {Boolean,@@ -345,9 +482,9 @@ fn is_nested_value(value: &Value, depth: usize) -> bool {}}-fn percentage(value: &Value) -> Result<f64, ParseError> {- let error = ParseError::Malformed("rollout_percentage");- let Value::Number(number) = value else {+fn percentage(object: &Map<String, Value>, field: &'static str) -> Result<f64, ParseError> {+ let error = ParseError::Malformed(field);+ let Value::Number(number) = required(object, field)? else {return Err(error);};let numeric = number.as_f64().ok_or(error)?;diff --git a/rust/feature-flags/src/flags/config_v2/raw.rs b/rust/feature-flags/src/flags/config_v2/raw.rsindex 50205a6e8b1f..94553afad346 100644--- a/rust/feature-flags/src/flags/config_v2/raw.rs+++ b/rust/feature-flags/src/flags/config_v2/raw.rs@@ -31,18 +31,46 @@ pub(super) fn decimal_places_at_most(number: &str, places: i64) -> bool {<= places}+#[derive(Clone, Copy, PartialEq, Eq)]+enum Kind {+ Rules,+ Rule,+ Variants,+ Variant,+ Holdout,+ Other,+}+enum Container {Object {keys: HashSet<String>,key: String,expects_key: bool,- is_rule: bool,+ kind: Kind,},Array {- is_rule_list: bool,+ kind: Kind,},}+/// Which contract object a container opened under `parent` is. The two-decimal check applies+/// only to percentages directly in a rule, variant or holdout, not inside values or metadata.+fn kind_of(parent: Option<&Container>, depth: usize, opens_object: bool) -> Kind {+ let (parent_kind, key) = match parent {+ Some(Container::Object { kind, key, .. }) => (*kind, key.as_str()),+ Some(Container::Array { kind }) => (*kind, ""),+ None => (Kind::Other, ""),+ };+ match (parent_kind, key, opens_object) {+ (Kind::Rules, _, true) => Kind::Rule,+ (Kind::Variants, _, true) => Kind::Variant,+ (Kind::Rule, "holdout", true) => Kind::Holdout,+ (Kind::Rule, "variants", false) => Kind::Variants,+ (_, "rules", false) if depth == 1 => Kind::Rules,+ _ => Kind::Other,+ }+}+pub(crate) fn validate_raw_document(document: &RawValue) -> Result<(), ParseError> {// RawValue already checked JSON syntax. Inspect tokens before Value loses// duplicate keys or rounds nonzero numbers to zero.@@ -86,22 +114,18 @@ pub(crate) fn validate_raw_document(document: &RawValue) -> Result<(), ParseErro}}b'{' => {- let is_rule = matches!(- containers.last(),- Some(Container::Array { is_rule_list: true })- );+ let kind = kind_of(containers.last(), containers.len(), true);containers.push(Container::Object {keys: HashSet::new(),key: String::new(),expects_key: true,- is_rule,+ kind,});index += 1;}b'[' => {- let is_rule_list = containers.len() == 1- && matches!(containers.last(), Some(Container::Object { key, .. }) if key == "rules");- containers.push(Container::Array { is_rule_list });+ let kind = kind_of(containers.last(), containers.len(), false);+ containers.push(Container::Array { kind });index += 1;}b'}' | b']' => {@@ -130,10 +154,16 @@ pub(crate) fn validate_raw_document(document: &RawValue) -> Result<(), ParseErro{return Err(ParseError::Malformed("number_is_binary64"));}- if matches!(containers.last(), Some(Container::Object { key, is_rule: true, .. }) if key == "rollout_percentage")- && !decimal_places_at_most(token, 2)- {- return Err(ParseError::Malformed("rollout_percentage"));+ if let Some(Container::Object { key, kind, .. }) = containers.last() {+ let field = match (*kind, key.as_str()) {+ (Kind::Rule, "rollout_percentage") => Some("rollout_percentage"),+ (Kind::Variant, "weight") => Some("weight"),+ (Kind::Holdout, "exclusion_percentage") => Some("exclusion_percentage"),+ _ => None,+ };+ if let Some(field) = field.filter(|_| !decimal_places_at_most(token, 2)) {+ return Err(ParseError::Malformed(field));+ }}}_ => index += 1,diff --git a/rust/feature-flags/src/flags/evaluate_v2.rs b/rust/feature-flags/src/flags/evaluate_v2.rsindex 24be72822577..faf539706869 100644--- a/rust/feature-flags/src/flags/evaluate_v2.rs+++ b/rust/feature-flags/src/flags/evaluate_v2.rs@@ -7,7 +7,7 @@ use chrono_tz::Tz;use serde_json::Value;use uuid::Uuid;-use super::config_v2::{Config, Outcome, RolloutMiss, Rule};+use super::config_v2::{Config, Outcome, RolloutMiss, Rule, Variant};use super::flag_matching_utils::calculate_hash;use super::flag_request::MAX_DISTINCT_ID_LEN;use super::v1_bucketing::is_in_rollout;@@ -22,6 +22,26 @@ use crate::properties::property_models::CompiledRegex;pub enum RuleKind {TargetedRelease,PercentageRollout,+ Experiment,+}++#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]+pub enum HashUse {+ Rollout,+ Variant,+ Holdout,+}++impl HashUse {+ pub fn hash(self, seed: &str, subject: &str) -> Result<f64, EvaluationError> {+ match self {+ Self::Rollout => calculate_hash(&format!("{seed}."), subject, ""),+ Self::Variant => calculate_hash(&format!("{seed}."), subject, "variant"),+ // No ".": a holdout seed of "holdout-" reproduces v1's `get_holdout_hash`.+ Self::Holdout => calculate_hash(seed, subject, ""),+ }+ .map_err(|_| EvaluationError::Hash)+ }}#[derive(Clone, Copy, Debug, PartialEq, Eq)]@@ -39,10 +59,23 @@ pub enum Evaluation<'a> {value: &'a Value,rule: MatchedRule,},+ ExperimentSplit {+ value: &'a Value,+ rule: MatchedRule,+ variant_key: &'a str,+ },RolloutMiss {value: Option<&'a Value>,rule: MatchedRule,},+ ExperimentPaused {+ value: Option<&'a Value>,+ rule: MatchedRule,+ },+ Holdout {+ value: Option<&'a Value>,+ rule: MatchedRule,+ },NoRuleMatch {value: Option<&'a Value>,},@@ -53,6 +86,7 @@ impl RuleKind {match self {Self::TargetedRelease => "targeted_release",Self::PercentageRollout => "percentage_rollout",+ Self::Experiment => "experiment",}}}@@ -61,29 +95,51 @@ impl<'a> Evaluation<'a> {pub const fn code(self) -> &'static str {match self {Self::TargetingMatch { .. } => "targeting_match",+ Self::ExperimentSplit { .. } => "experiment_split",Self::RolloutMiss { .. } => "rollout_miss",+ Self::ExperimentPaused { .. } => "experiment_paused",+ Self::Holdout { .. } => "holdout",Self::NoRuleMatch { .. } => "no_rule_match",}}pub fn value(self) -> Option<&'a Value> {match self {- Self::TargetingMatch { value, .. } => Some(value),- Self::RolloutMiss { value, .. } | Self::NoRuleMatch { value } => value,+ Self::TargetingMatch { value, .. } | Self::ExperimentSplit { value, .. } => Some(value),+ Self::RolloutMiss { value, .. }+ | Self::ExperimentPaused { value, .. }+ | Self::Holdout { value, .. }+ | Self::NoRuleMatch { value } => value,}}pub fn rule(self) -> Option<MatchedRule> {match self {- Self::TargetingMatch { rule, .. } | Self::RolloutMiss { rule, .. } => Some(rule),+ Self::TargetingMatch { rule, .. }+ | Self::ExperimentSplit { rule, .. }+ | Self::RolloutMiss { rule, .. }+ | Self::ExperimentPaused { rule, .. }+ | Self::Holdout { rule, .. } => Some(rule),Self::NoRuleMatch { .. } => None,}}+ pub fn variant_key(self) -> Option<&'a str> {+ match self {+ Self::ExperimentSplit { variant_key, .. } => Some(variant_key),+ _ => None,+ }+ }+pub fn description(self) -> String {match self {Self::TargetingMatch { rule, .. } => format!("Matched rule {}", rule.index + 1),+ Self::ExperimentSplit { rule, .. } => {+ format!("Rule {} experiment split", rule.index + 1)+ }Self::RolloutMiss { rule, .. } => format!("Rule {} rollout miss", rule.index + 1),+ Self::ExperimentPaused { rule, .. } => format!("Rule {} is paused", rule.index + 1),+ Self::Holdout { rule, .. } => format!("Rule {} holdout", rule.index + 1),Self::NoRuleMatch { .. } => "No rule matched".to_string(),}}@@ -96,6 +152,7 @@ pub struct EvaluationDetail {/// `Value::Null` is a null default.pub value: Value,pub rule: Option<MatchedRule>,+ pub variant_key: Option<String>,pub description: String,}@@ -105,6 +162,7 @@ impl From<Evaluation<'_>> for EvaluationDetail {code: evaluation.code(),value: evaluation.value().cloned().unwrap_or(Value::Null),rule: evaluation.rule(),+ variant_key: evaluation.variant_key().map(str::to_owned),description: evaluation.description(),}}@@ -169,9 +227,7 @@ impl<'a> Evaluator<'a> {&self,context: &EvaluationContext<'_>,) -> Result<Evaluation<'a>, EvaluationError> {- self.evaluate_with_hash(context, |seed, subject| {- calculate_hash(&format!("{seed}."), subject, "").map_err(|_| EvaluationError::Hash)- })+ self.evaluate_with_hash(context, HashUse::hash)}/// Test seam for injecting hash values; not part of the supported API.@@ -179,7 +235,7 @@ impl<'a> Evaluator<'a> {pub fn evaluate_with_hash(&self,context: &EvaluationContext<'_>,- mut hash: impl FnMut(&str, &str) -> Result<f64, EvaluationError>,+ hash: impl FnMut(HashUse, &str, &str) -> Result<f64, EvaluationError>,) -> Result<Evaluation<'a>, EvaluationError> {let subject = truncate_chars(context.person_identifier, MAX_DISTINCT_ID_LEN);let matching =@@ -191,7 +247,12 @@ impl<'a> Evaluator<'a> {PersonProperties::Partial(properties) => Some((properties, true)),PersonProperties::Unavailable => None,};- let mut hashes = HashMap::new();+ let mut draws = Draws {+ subject,+ hash,+ cache: HashMap::new(),+ };+ let default = self.config.default_value.as_ref();for (index, rule) in self.config.rules.iter().enumerate() {if !rule_targets(rule, person_properties, matching)? {continue;@@ -201,46 +262,114 @@ impl<'a> Evaluator<'a> {index,kind,};- let (kind, value) = match &rule.outcome {- Outcome::TargetedRelease { value } => (RuleKind::TargetedRelease, value),+ let (rule, on_rollout_miss) = match &rule.outcome {+ Outcome::TargetedRelease { value } => {+ return Ok(Evaluation::TargetingMatch {+ value,+ rule: matched_rule(RuleKind::TargetedRelease),+ })+ }Outcome::PercentageRollout {value,rollout_percentage,on_rollout_miss,seed,} => {- let included = !subject.is_empty()- && is_in_rollout(*rollout_percentage, || {- match hashes.entry(seed.as_str()) {- Entry::Occupied(entry) => Ok(*entry.get()),- Entry::Vacant(entry) => {- hash(seed, subject).map(|value| *entry.insert(value))- }- }- })?;- if !included {- match on_rollout_miss {- RolloutMiss::Continue => continue,- RolloutMiss::ReturnDefault => {- return Ok(Evaluation::RolloutMiss {- value: self.config.default_value.as_ref(),- rule: matched_rule(RuleKind::PercentageRollout),- })- }+ let rule = matched_rule(RuleKind::PercentageRollout);+ if draws.includes(HashUse::Rollout, seed, *rollout_percentage)? {+ return Ok(Evaluation::TargetingMatch { value, rule });+ }+ (rule, on_rollout_miss)+ }+ Outcome::Experiment {+ paused,+ rollout_percentage,+ on_rollout_miss,+ seed,+ variants,+ holdout,+ } => {+ let rule = matched_rule(RuleKind::Experiment);+ if *paused {+ return Ok(Evaluation::ExperimentPaused {+ value: default,+ rule,+ });+ }+ if let Some(holdout) = holdout {+ if draws.includes(+ HashUse::Holdout,+ &holdout.seed,+ holdout.exclusion_percentage,+ )? {+ return Ok(Evaluation::Holdout {+ value: default,+ rule,+ });}}- (RuleKind::PercentageRollout, value)+ if draws.includes(HashUse::Rollout, seed, *rollout_percentage)? {+ let variant = select_variant(draws.draw(HashUse::Variant, seed)?, variants);+ return Ok(Evaluation::ExperimentSplit {+ value: &variant.value,+ rule,+ variant_key: &variant.key,+ });+ }+ (rule, on_rollout_miss)}};- return Ok(Evaluation::TargetingMatch {- value,- rule: matched_rule(kind),- });+ if *on_rollout_miss == RolloutMiss::ReturnDefault {+ return Ok(Evaluation::RolloutMiss {+ value: default,+ rule,+ });+ }+ }+ Ok(Evaluation::NoRuleMatch { value: default })+ }+}++/// The hashes one evaluation draws for its subject; repeated draws with the same use and seed+/// share a hash.+struct Draws<'a, 's, H> {+ subject: &'s str,+ hash: H,+ cache: HashMap<(HashUse, &'a str), f64>,+}++impl<'a, H: FnMut(HashUse, &str, &str) -> Result<f64, EvaluationError>> Draws<'a, '_, H> {+ fn draw(&mut self, hash_use: HashUse, seed: &'a str) -> Result<f64, EvaluationError> {+ match self.cache.entry((hash_use, seed)) {+ Entry::Occupied(entry) => Ok(*entry.get()),+ Entry::Vacant(entry) => {+ (self.hash)(hash_use, seed, self.subject).map(|value| *entry.insert(value))+ }+ }+ }++ /// An empty subject never enters a rollout or a holdout, so it is never hashed.+ fn includes(+ &mut self,+ hash_use: HashUse,+ seed: &'a str,+ percentage: f64,+ ) -> Result<bool, EvaluationError> {+ Ok(!self.subject.is_empty() && is_in_rollout(percentage, || self.draw(hash_use, seed))?)+ }+}++/// Boundaries add left to right in binary64; past the last one (rounding, or a hash of 1.0)+/// the last variant wins. The parser admits at least two variants.+fn select_variant(hash: f64, variants: &[Variant]) -> &Variant {+ let mut boundary = 0.0;+ for variant in variants {+ boundary += variant.weight / 100.0;+ if hash < boundary {+ return variant;}- Ok(Evaluation::NoRuleMatch {- value: self.config.default_value.as_ref(),- })}+ &variants[variants.len() - 1]}/// Whether every predicate of `rule` matches; a reached error fails the evaluation.diff --git a/rust/feature-flags/src/flags/flag_matching.rs b/rust/feature-flags/src/flags/flag_matching.rsindex 3f081e5a9b5b..a260a8803f46 100644--- a/rust/feature-flags/src/flags/flag_matching.rs+++ b/rust/feature-flags/src/flags/flag_matching.rs@@ -2103,22 +2103,19 @@ impl FeatureFlagMatcher {use_explicit_exact_matching: self.use_explicit_exact_matching,now: self.now,})?;- let (value, reason, condition_index) = match evaluation {- Evaluation::TargetingMatch { value, rule } => (- Some(value),- FeatureFlagMatchReason::ConditionMatch,- Some(rule.index),- ),- Evaluation::RolloutMiss { value, rule } => (- value,- FeatureFlagMatchReason::OutOfRolloutBound,- Some(rule.index),- ),- Evaluation::NoRuleMatch { value } => {- (value, FeatureFlagMatchReason::NoConditionMatch, None)+ // `/flags?v=2` reports these v1 reasons; `/flags?v=3` reports the evaluator's own code.+ let reason = match evaluation {+ Evaluation::TargetingMatch { .. } | Evaluation::ExperimentSplit { .. } => {+ FeatureFlagMatchReason::ConditionMatch+ }+ Evaluation::RolloutMiss { .. } => FeatureFlagMatchReason::OutOfRolloutBound,+ Evaluation::Holdout { .. } => FeatureFlagMatchReason::HoldoutConditionValue,+ Evaluation::ExperimentPaused { .. } | Evaluation::NoRuleMatch { .. } => {+ FeatureFlagMatchReason::NoConditionMatch}};- let (matches, variant, payload) = match value {+ let condition_index = evaluation.rule().map(|rule| rule.index);+ let (matches, variant, payload) = match evaluation.value() {None => (false, None, None),Some(Value::Bool(value)) => (*value, None, None),Some(Value::String(value)) => (true, Some(value.clone()), None),diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/SOURCE.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/SOURCE.jsonindex 4181a5ffe8a6..816520f7d019 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/SOURCE.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/SOURCE.json@@ -1,35 +1,37 @@{"repository": "https://github.com/PostHog/posthog-sdk-test-harness",- "release": "1.15.0",- "commit": "64ffa6ab19166541880c077d349abe18a7e42395",+ "release": null,+ "commit": "6c4182b71d8021fcb10919a6c20825413cbef3dc","path": "contracts/feature_flag_rules_v2",- "contract_version": "2.3.1",+ "contract_version": "3.0.0","files": {"corpus/hash_sha1_60_v1.json": "e9bea9cff58bac0c6c1021e9c8842c53594055b6874a2c58bc4350d0c28a93ca","corpus/legacy_projection.json": "536c8386eefa75721d113bd8718ddeb7fb1aad3b4f2cce1fbcf516a346a16e26","corpus/v1_evaluation.json": "752ff88dcb943ab1e21f9552b0c4ec606029393fca2b565b01a497da89cd8675","corpus/v2_boolean_evaluation.json": "2d2a4be5f7185445f6d6593533fe105e436bade1becc3e3b15ff380a8da477bb",+ "corpus/v2_experiment_evaluation.json": "28ed98efed5b58134dc93af3d667f37c15c120dba38cbe36dd1997c8454fe437","corpus/v2_value_evaluation.json": "aaddd05e47fc5a4ae07ea42ada5a659798f4b5fc8d0c0827f6a68e4daf68c128","fixtures/config/invalid/assign_by_not_person.json": "52d356d2bcdcbf705b0fe2673eb147ac352bda13c9b1bc3d53c4bbb1cb01a5aa","fixtures/config/invalid/default_value_type_mismatch.json": "516e72b6bd9f761de62166457528242723694f86e417b1aee6eb37b924acc4b5","fixtures/config/invalid/empty_seed.json": "f5aa796ba2abf17ab6b2f4706c872f2b15bfa77310cdf0400a3a460db22eda41","fixtures/config/invalid/empty_string_value.json": "6fac810e014d81b938f66909808e2a2fc1b7cf4db5462fe6522fde1e045cbdda",- "fixtures/config/invalid/group_experiment_with_assign_by.json": "cbe5d7e00f3abadd490a72055e6197d511fa59f6b3f7062dbacffea426cc5360",+ "fixtures/config/invalid/experiment_rule_with_experiment_id.json": "6943387d2644b2d93d3798fafe1c6168d9287340b8464c93efa530469ffa18f7",+ "fixtures/config/invalid/group_experiment_with_assign_by.json": "6aebbfb2896ec6febb20c661a1d2e9d023210d37e60daf6caa9481a559252cba","fixtures/config/invalid/group_percentage_rollout_with_assign_by.json": "82189b24744270ac2e4ad93b97efddbede530e6990d597fe80890cbd2820f70e",- "fixtures/config/invalid/missing_experiment_paused.json": "f3902f40a82f5f80c88a463768b24922bb787b774cb7cd3c4e77fe0e8748e487",+ "fixtures/config/invalid/holdout_with_id.json": "134ac9d3509fcf1e469ba761ee9d6061e9ad9424a3b66bdfd89efacb5f9c8721",+ "fixtures/config/invalid/missing_experiment_paused.json": "1fe269eeb50a25923a95e2ca6bc9531b0b36649d53c7cee77074b78e12013399","fixtures/config/invalid/missing_on_rollout_miss.json": "88541b7eb14532becb477a9d62797960d8cfdc38bc101b79c5294c1e611e26ec","fixtures/config/invalid/missing_rollout_seed.json": "bfc87e05621e30ec19647c8b4dc129b02433c7f2f2e17a9c52f8bf71ad3711ea","fixtures/config/invalid/non_uuid_rule_id.json": "3e35c5e211d8ba159824009be3ed26c4ac6f12c1426109fa1b53b49ff63fc770",- "fixtures/config/invalid/null_experiment_id.json": "de6c7a55d67adce2042d16db287dfcbe49f502d1e5e2f8e71532d0817e28e169","fixtures/config/invalid/null_rule_value.json": "ac6f0c04ffbe348a75be7249a7cce80a2ec0411954c46c142eaa3609d2842bd7","fixtures/config/invalid/object_value_too_deep.json": "8809275942a5fb5ed548d70d819baffa84ee4ccfec7414cc93903cc79f39c550","fixtures/config/invalid/return_value_type_mismatch.json": "b48ead6599cbb40a2a9eea606544b0ee083bb13ce768d57fc225f2da4924633a","fixtures/config/invalid/rollout_percentage_above_maximum.json": "9aeefb4ab1eb4140afb213554a91a2c1c085e54cdbe47734442e65ba9a17f99c","fixtures/config/invalid/rollout_percentage_below_minimum.json": "dc4102374a3e075c9501f915ead07e8061d46f07293d7b71c0eaa53d4e06fbcf",- "fixtures/config/invalid/seed_too_long.json": "2ca76285c4f9724603eecb980080bf7ddf0ff8dea4458eb60a2699dfad020941",+ "fixtures/config/invalid/seed_too_long.json": "fa04a8b212c909684ab93ce189822a16031f432bcc4aa367f0e6ff83960f2805","fixtures/config/invalid/targeted_release_with_rollout_fields.json": "7080ad218d8a04b26884aeca4828ada72a21ea8b85453a4f2ae6fafc567223be",- "fixtures/config/invalid/too_few_variants.json": "22b5201619d80be17bfb21c9a0bf93472e2231ad4a5f1c6bb8136275e64bb8a4",- "fixtures/config/invalid/too_many_variants.json": "aacabb57255580136b8e6a984c57cea7367e59ddeffed3d4a40137b804cf4c31",+ "fixtures/config/invalid/too_few_variants.json": "57504f3d25f3f82ee265ef92f9f0764a5f0e0ebe2b3fd90d6330e6af327bc61e",+ "fixtures/config/invalid/too_many_variants.json": "0f6e4eaae67c1e9da008783ac7fd0dcce5880336ee5695ceaa1ceae1903ee7d4","fixtures/config/invalid/unknown_assignment_algorithm.json": "a2cc3d33443fb50ca284ec0a053c1e29b5b752729808aca7f1a5d5009c3cc5cb","fixtures/config/invalid/unknown_config_field.json": "68c83e9c074a0a70e7753a6e52daa414aeb18977abdd9b702ec4c5c61d82c3a4","fixtures/config/invalid/unknown_config_version.json": "f5bba7fa0ea88e43834ac3b5e03ed4f7297ad0bf4ab2f09d962241521dd06787",@@ -38,25 +40,26 @@"fixtures/config/invalid/unknown_property_type.json": "06f5c1dafff26761dfe321765072161a1230e591e1e80a353e5093a8eca041bd","fixtures/config/invalid/unknown_rollout_miss_policy.json": "e1ed66e2d00c56c217af240b2cb5af3cc10d2f7f2d26299ecf998bcb73246c22","fixtures/config/invalid/unknown_rule_field.json": "8bcc957c38bb2b6a33e244ad1cfe76612cf6f4918c8f0b0cc22f86bd01cd1932",- "fixtures/config/invalid/variant_key_invalid_characters.json": "f5d71ea6a2ad839fb5f540c8a7f894438fe7c99f152d7469b86af83e938288db",- "fixtures/config/invalid/variant_value_type_mismatch.json": "aecfc8a8f49f1fa5586082fc4b70284a5212e14998984fc3a7bde1520b933095",+ "fixtures/config/invalid/variant_key_invalid_characters.json": "c29268de3f3599a3fff87c1f2266d21fe5a005ae161831adf934440a42d3f7ab",+ "fixtures/config/invalid/variant_value_type_mismatch.json": "35480f8e0c93315378059e1d3c31a506049dee78039ec0e09327437c3f8c02ee","fixtures/config/invalid/version_boolean.json": "49587173259e8b379c8f473e60af7bce7a52ad8f17088068dec021c2a3f9242d","fixtures/config/invalid/version_string.json": "4835228c5a390aa2497d4df5bd62a41d775c5ff75363d2f7dca0a5eee9e77649",- "fixtures/config/valid/boolean_all_rule_types.json": "bd56e3422fee0adf18ee9a4ad13ea96fe9bb4e4d11b3e9e0499e6be985b628e8",+ "fixtures/config/valid/boolean_all_rule_types.json": "fc9a4e604326deb0dea43370c8a22e300de0610f2cfabaf384a9f465e2fcf3d6","fixtures/config/valid/boolean_targeted_and_percentage_rollout.json": "ff39ff54ecdc16a52fe963b3d0e7f08b8e417567a147c7730fc932fc366944e8",- "fixtures/config/valid/group_all_rule_types.json": "bd163291f26d8a851d91ed8c76e4979e9af40608fe0c8a80eefa27c3cdd0f2ad",+ "fixtures/config/valid/experiment_rule_local_holdout.json": "717160ad80189b99312392b49aa9891601503de57db4f310af75ac5b83d071fd",+ "fixtures/config/valid/group_all_rule_types.json": "0681c035f38c5c2e58e93bf13b8ebca0057936ddf920c8ff8dd7a0bd854ad582","fixtures/config/valid/object_value_max_depth.json": "fb09e42911934248ff767dbcfe61be60fd39483972f3bb8b1f4b1a4e9e46d944","fixtures/config/valid/reserved_number_value.json": "6a3ce5d6c5522c71969f9141c5da06e0222f797a321de2c5a90c391bcb937947","fixtures/config/valid/reserved_object_value.json": "316ca827654b1a5585d25c534a889e963e5c603d293e605b3902357117802d27","fixtures/config/valid/string_group_assignment.json": "414987b3d374fc5fc2d912616cadce8241be9b346d66d6cf4945ca69c169354d","fixtures/config/valid/version_float_literal.json": "a848ae2e3e0dd2119600bb90ebbcba59040b3bb788586ba127a57eab1848a403",- "fixtures/wire/definitions.json": "b6398336370d8807b0874229e8dc94ed1f6e686736764d56666fc48021dabf31",- "fixtures/wire/responses.json": "e34659b62facbc594bdc1ce6c0f127ff25d94672da332670b383d729f45e5960",- "manifest.json": "e1dc17a0ef7a8388c05262c1a6c388a8237f028b7942bbce9ac1a8b45fa3fb5d",- "registries/literals.json": "afd25df141b5e05dfa5c8848e1685a4e8b81f3c80fbafc4769c944b815356069",- "schemas/config.schema.json": "74e43ed13dbfd578bcb8eedc5a247917788b320829b888eab84ce1126841d63b",+ "fixtures/wire/definitions.json": "894f37aaf7e6b360ca36e0b5beb5645abd8782dc9a09eb1f76db64285d02fe6d",+ "fixtures/wire/responses.json": "5995db3a23667a58aaefb050779c7b0fe3ff154e821729408d4e6c138a7535b1",+ "manifest.json": "6a9c0beffc378afafc1fe67f51297ff51252d2f293d59a1c835cbbaa91d80354",+ "registries/literals.json": "3e87e6c7c760f0ebac80289faa5412a6ecd17749cb5c79dabe5ed1efaea22578",+ "schemas/config.schema.json": "163507e0db1219329caef034a50516d27eb5759b5e4c250f313ceb53ca3f1e08","schemas/definitions_entry.schema.json": "6d920c77fb7f20c2031dc188d495ed28c3789b3f362334517a2e86021a226e85",- "schemas/flags_response_v3.schema.json": "98c1397bb7b5a1ceb3f317b34c6c57cff0ab30e94bf5945ee7b56f293536b70f",- "schemas/flags_response_v3_presence.schema.json": "3b3fb0be1ac89524f1a65bfcde92ba34b3cdc789ebce716c3ef2ad5938d0ce62"+ "schemas/flags_response_v3.schema.json": "15e18f44616b98a2ec9a9a0b446aac2235ee0bdc87353e909eb7444b01b7b447",+ "schemas/flags_response_v3_presence.schema.json": "987a07ed66fcae1b1e1e0e55e175c11ae1939af1818c18bd9d93551901ea26a7"}}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/corpus/v2_experiment_evaluation.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/corpus/v2_experiment_evaluation.jsonnew file mode 100644index 000000000000..55cea05406ee--- /dev/null+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/corpus/v2_experiment_evaluation.json@@ -0,0 +1,6662 @@+{+ "corpus_version": "1.0.0",+ "config_version": 2,+ "description": "Ordered evaluation of experiment rules: pause, holdout, rollout and weighted variant assignment, with the legacy rendering of each result. Expected terminal fields and legacy cells are exhaustive. Hash evidence lists every hash an evaluation draws. White-box rows replace every drawn hash through a private seam; parser rows run at the parser boundary.",+ "cases": [+ {+ "id": "v2_experiment.ordering.split",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-3",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-3",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3376617269616e74",+ "sha1_hex": "f31f53c835e3ac066ef4237aa9d552ce225ea64a",+ "first_15_hex": "f31f53c835e3ac0",+ "n": "1094925824678574784",+ "hash01_binary64_hex": "3fee63ea7906bc76",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.ordering.paused",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": true,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "experiment_paused",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.ordering.paused_before_holdout",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": true,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 100+ }+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "experiment_paused",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.ordering.paused_targeting_miss",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": [+ {+ "key": "plan",+ "type": "person",+ "operator": "exact",+ "value": [+ "free"+ ]+ }+ ]+ },+ "paused": true,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "targeted_release",+ "targeting": {+ "properties": []+ },+ "value": "targeted"+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "targeted",+ "reason": "targeting_match",+ "rule": {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "targeted_release",+ "index": 1+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "targeted",+ "value": "targeted",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.ordering.paused_before_rollout_miss",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": true,+ "rollout_percentage": 0,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "targeted_release",+ "targeting": {+ "properties": []+ },+ "value": "targeted"+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "experiment_paused",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.ordering.holdout",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 100+ }+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "holdout",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.ordering.holdout_terminal_with_continue",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 100+ }+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "targeted_release",+ "targeting": {+ "properties": []+ },+ "value": "targeted"+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "holdout",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.ordering.holdout_before_rollout_miss",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 0,+ "on_rollout_miss": "return_default",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 100+ }+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "holdout",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.ordering.holdout_zero",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 0+ }+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "holdout",+ "prefix": "example-holdout",+ "identifier": "person-1",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d686f6c646f7574706572736f6e2d31",+ "sha1_hex": "927ec0a2001c68ab093dd8f087f27e31c4ef9b51",+ "first_15_hex": "927ec0a2001c68a",+ "n": "659755398663882378",+ "hash01_binary64_hex": "3fe24fd81440038d",+ "threshold_binary64_hex": "0000000000000000"+ },+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "7097291b07ace0c5909564af9291976a174f3780",+ "first_15_hex": "7097291b07ace0c",+ "n": "507062403112553996",+ "hash01_binary64_hex": "3fdc25ca46c1eb38",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.ordering.miss_return_default",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 0,+ "on_rollout_miss": "return_default",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "rollout_miss",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "rollout",+ "prefix": "example-split.",+ "identifier": "person-example",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d6578616d706c65",+ "sha1_hex": "bb21a3739cb09b9fb960eeda9aa454ef538f08b9",+ "first_15_hex": "bb21a3739cb09b9",+ "n": "842764904766835129",+ "hash01_binary64_hex": "3fe764346e739613",+ "threshold_binary64_hex": "0000000000000000"+ }+ ]+ },+ {+ "id": "v2_experiment.ordering.miss_continue",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 0,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "targeted_release",+ "targeting": {+ "properties": []+ },+ "value": "targeted"+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "targeted",+ "reason": "targeting_match",+ "rule": {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "targeted_release",+ "index": 1+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "targeted",+ "value": "targeted",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "rollout",+ "prefix": "example-split.",+ "identifier": "person-example",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d6578616d706c65",+ "sha1_hex": "bb21a3739cb09b9fb960eeda9aa454ef538f08b9",+ "first_15_hex": "bb21a3739cb09b9",+ "n": "842764904766835129",+ "hash01_binary64_hex": "3fe764346e739613",+ "threshold_binary64_hex": "0000000000000000"+ }+ ]+ },+ {+ "id": "v2_experiment.ordering.miss_continue_exhausted",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 0,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "no_rule_match"+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "rollout",+ "prefix": "example-split.",+ "identifier": "person-example",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d6578616d706c65",+ "sha1_hex": "bb21a3739cb09b9fb960eeda9aa454ef538f08b9",+ "first_15_hex": "bb21a3739cb09b9",+ "n": "842764904766835129",+ "hash01_binary64_hex": "3fe764346e739613",+ "threshold_binary64_hex": "0000000000000000"+ }+ ]+ },+ {+ "id": "v2_experiment.ordering.targeted_above",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "targeted_release",+ "targeting": {+ "properties": [+ {+ "key": "plan",+ "type": "person",+ "operator": "exact",+ "value": [+ "pro"+ ]+ }+ ]+ },+ "value": "targeted"+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "targeted",+ "reason": "targeting_match",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "targeted_release",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "targeted",+ "value": "targeted",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.ordering.targeted_miss_above",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "targeted_release",+ "targeting": {+ "properties": [+ {+ "key": "plan",+ "type": "person",+ "operator": "exact",+ "value": [+ "free"+ ]+ }+ ]+ },+ "value": "targeted"+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "index": 1+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "7097291b07ace0c5909564af9291976a174f3780",+ "first_15_hex": "7097291b07ace0c",+ "n": "507062403112553996",+ "hash01_binary64_hex": "3fdc25ca46c1eb38",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.ordering.percentage_miss_above",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "percentage_rollout",+ "targeting": {+ "properties": []+ },+ "value": "percentage",+ "rollout_percentage": 0,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-allocation",+ "assign_by": "person"+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-3",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "index": 1+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "rollout",+ "prefix": "example-allocation.",+ "identifier": "person-3",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d616c6c6f636174696f6e2e706572736f6e2d33",+ "sha1_hex": "d394c898e308428824b26b96cde1b70f7613b105",+ "first_15_hex": "d394c898e308428",+ "n": "952876949845345320",+ "hash01_binary64_hex": "3fea7299131c6108",+ "threshold_binary64_hex": "0000000000000000"+ },+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-3",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3376617269616e74",+ "sha1_hex": "f31f53c835e3ac066ef4237aa9d552ce225ea64a",+ "first_15_hex": "f31f53c835e3ac0",+ "n": "1094925824678574784",+ "hash01_binary64_hex": "3fee63ea7906bc76",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.ordering.second_experiment_rule",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": [+ {+ "key": "plan",+ "type": "person",+ "operator": "exact",+ "value": [+ "free"+ ]+ }+ ]+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-second-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "arm_a",+ "weight": 50,+ "value": "red"+ },+ {+ "key": "arm_b",+ "weight": 50,+ "value": "yellow"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "yellow",+ "reason": "experiment_split",+ "rule": {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "index": 1+ },+ "variant": "arm_b"+ },+ "legacy": {+ "enabled": true,+ "variant": "yellow",+ "value": "yellow",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-second-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d7365636f6e642d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "988d4a5a63528a4a200e0f6cefd8e9d0f5166323",+ "first_15_hex": "988d4a5a63528a4",+ "n": "687032751097194660",+ "hash01_binary64_hex": "3fe311a94b4c6a51",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.ordering.second_experiment_after_miss",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 0,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-second-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "arm_a",+ "weight": 50,+ "value": "red"+ },+ {+ "key": "arm_b",+ "weight": 50,+ "value": "yellow"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-4",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "red",+ "reason": "experiment_split",+ "rule": {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "index": 1+ },+ "variant": "arm_a"+ },+ "legacy": {+ "enabled": true,+ "variant": "red",+ "value": "red",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "rollout",+ "prefix": "example-split.",+ "identifier": "person-4",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d34",+ "sha1_hex": "c9873d09c345f1f9a5b4ff8aacca2199ad855873",+ "first_15_hex": "c9873d09c345f1f",+ "n": "907602664726224671",+ "hash01_binary64_hex": "3fe930e7a13868be",+ "threshold_binary64_hex": "0000000000000000"+ },+ {+ "use": "variant",+ "prefix": "example-second-split.",+ "identifier": "person-4",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d7365636f6e642d73706c69742e706572736f6e2d3476617269616e74",+ "sha1_hex": "5d09e8ab208663d2d1b30d081c435875b19e7890",+ "first_15_hex": "5d09e8ab208663d",+ "n": "419009083875026493",+ "hash01_binary64_hex": "3fd7427a2ac82199",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.ordering.empty_identifier_return_default",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "return_default",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "rollout_miss",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.ordering.empty_identifier_skips_holdout",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 100+ }+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "targeted_release",+ "targeting": {+ "properties": []+ },+ "value": "targeted"+ }+ ]+ },+ "context": {+ "identifier": "",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "targeted",+ "reason": "targeting_match",+ "rule": {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "targeted_release",+ "index": 1+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "targeted",+ "value": "targeted",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.ordering.empty_identifier_paused",+ "family": "ordering",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": true,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "experiment_paused",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ }+ },+ {+ "id": "v2_experiment.assignment.fifty_fifty_control",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "7097291b07ace0c5909564af9291976a174f3780",+ "first_15_hex": "7097291b07ace0c",+ "n": "507062403112553996",+ "hash01_binary64_hex": "3fdc25ca46c1eb38",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.fifty_fifty_test",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-3",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-3",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3376617269616e74",+ "sha1_hex": "f31f53c835e3ac066ef4237aa9d552ce225ea64a",+ "first_15_hex": "f31f53c835e3ac0",+ "n": "1094925824678574784",+ "hash01_binary64_hex": "3fee63ea7906bc76",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.ten_ninety_first",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 10,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 90,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-5",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-5",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3576617269616e74",+ "sha1_hex": "13979f7741bec0e8630fce9217cb68b9a4e2dd83",+ "first_15_hex": "13979f7741bec0e",+ "n": "88235771422305294",+ "hash01_binary64_hex": "3fb3979f7741bec1",+ "boundaries_binary64_hex": [+ "3fb999999999999a",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.ten_ninety_second",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 10,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 90,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "7097291b07ace0c5909564af9291976a174f3780",+ "first_15_hex": "7097291b07ace0c",+ "n": "507062403112553996",+ "hash01_binary64_hex": "3fdc25ca46c1eb38",+ "boundaries_binary64_hex": [+ "3fb999999999999a",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.two_decimal_control",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 33.33,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 33.33,+ "value": "green"+ },+ {+ "key": "other",+ "weight": 33.34,+ "value": "red"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-5",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-5",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3576617269616e74",+ "sha1_hex": "13979f7741bec0e8630fce9217cb68b9a4e2dd83",+ "first_15_hex": "13979f7741bec0e",+ "n": "88235771422305294",+ "hash01_binary64_hex": "3fb3979f7741bec1",+ "boundaries_binary64_hex": [+ "3fd554c985f06f69",+ "3fe554c985f06f69",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.two_decimal_test",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 33.33,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 33.33,+ "value": "green"+ },+ {+ "key": "other",+ "weight": 33.34,+ "value": "red"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "7097291b07ace0c5909564af9291976a174f3780",+ "first_15_hex": "7097291b07ace0c",+ "n": "507062403112553996",+ "hash01_binary64_hex": "3fdc25ca46c1eb38",+ "boundaries_binary64_hex": [+ "3fd554c985f06f69",+ "3fe554c985f06f69",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.two_decimal_other",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 33.33,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 33.33,+ "value": "green"+ },+ {+ "key": "other",+ "weight": 33.34,+ "value": "red"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-3",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "red",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "other"+ },+ "legacy": {+ "enabled": true,+ "variant": "red",+ "value": "red",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-3",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3376617269616e74",+ "sha1_hex": "f31f53c835e3ac066ef4237aa9d552ce225ea64a",+ "first_15_hex": "f31f53c835e3ac0",+ "n": "1094925824678574784",+ "hash01_binary64_hex": "3fee63ea7906bc76",+ "boundaries_binary64_hex": [+ "3fd554c985f06f69",+ "3fe554c985f06f69",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.equal_values_control",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "same"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "same"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "same",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "same",+ "value": "same",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "7097291b07ace0c5909564af9291976a174f3780",+ "first_15_hex": "7097291b07ace0c",+ "n": "507062403112553996",+ "hash01_binary64_hex": "3fdc25ca46c1eb38",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.equal_values_test",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "same"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "same"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-3",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "same",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "same",+ "value": "same",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-3",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3376617269616e74",+ "sha1_hex": "f31f53c835e3ac066ef4237aa9d552ce225ea64a",+ "first_15_hex": "f31f53c835e3ac0",+ "n": "1094925824678574784",+ "hash01_binary64_hex": "3fee63ea7906bc76",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.zero_weight_first",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "never",+ "weight": 0,+ "value": "blue"+ },+ {+ "key": "always",+ "weight": 100,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "always"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-example",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d6578616d706c6576617269616e74",+ "sha1_hex": "8c2fcae2922c5679a32941db87271301753deaef",+ "first_15_hex": "8c2fcae2922c567",+ "n": "631344722729944423",+ "hash01_binary64_hex": "3fe185f95c52458b",+ "boundaries_binary64_hex": [+ "0000000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.twenty_variants",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "arm_00",+ "weight": 5,+ "value": "value-00"+ },+ {+ "key": "arm_01",+ "weight": 5,+ "value": "value-01"+ },+ {+ "key": "arm_02",+ "weight": 5,+ "value": "value-02"+ },+ {+ "key": "arm_03",+ "weight": 5,+ "value": "value-03"+ },+ {+ "key": "arm_04",+ "weight": 5,+ "value": "value-04"+ },+ {+ "key": "arm_05",+ "weight": 5,+ "value": "value-05"+ },+ {+ "key": "arm_06",+ "weight": 5,+ "value": "value-06"+ },+ {+ "key": "arm_07",+ "weight": 5,+ "value": "value-07"+ },+ {+ "key": "arm_08",+ "weight": 5,+ "value": "value-08"+ },+ {+ "key": "arm_09",+ "weight": 5,+ "value": "value-09"+ },+ {+ "key": "arm_10",+ "weight": 5,+ "value": "value-10"+ },+ {+ "key": "arm_11",+ "weight": 5,+ "value": "value-11"+ },+ {+ "key": "arm_12",+ "weight": 5,+ "value": "value-12"+ },+ {+ "key": "arm_13",+ "weight": 5,+ "value": "value-13"+ },+ {+ "key": "arm_14",+ "weight": 5,+ "value": "value-14"+ },+ {+ "key": "arm_15",+ "weight": 5,+ "value": "value-15"+ },+ {+ "key": "arm_16",+ "weight": 5,+ "value": "value-16"+ },+ {+ "key": "arm_17",+ "weight": 5,+ "value": "value-17"+ },+ {+ "key": "arm_18",+ "weight": 5,+ "value": "value-18"+ },+ {+ "key": "arm_19",+ "weight": 5,+ "value": "value-19"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "value-10",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "arm_10"+ },+ "legacy": {+ "enabled": true,+ "variant": "value-10",+ "value": "value-10",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-example",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d6578616d706c6576617269616e74",+ "sha1_hex": "8c2fcae2922c5679a32941db87271301753deaef",+ "first_15_hex": "8c2fcae2922c567",+ "n": "631344722729944423",+ "hash01_binary64_hex": "3fe185f95c52458b",+ "boundaries_binary64_hex": [+ "3fa999999999999a",+ "3fb999999999999a",+ "3fc3333333333334",+ "3fc999999999999a",+ "3fd0000000000000",+ "3fd3333333333333",+ "3fd6666666666666",+ "3fd9999999999999",+ "3fdccccccccccccc",+ "3fdfffffffffffff",+ "3fe1999999999999",+ "3fe3333333333333",+ "3fe4cccccccccccd",+ "3fe6666666666667",+ "3fe8000000000001",+ "3fe999999999999b",+ "3feb333333333335",+ "3feccccccccccccf",+ "3fee666666666669",+ "3ff0000000000001"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.stored_order",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ },+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "7097291b07ace0c5909564af9291976a174f3780",+ "first_15_hex": "7097291b07ace0c",+ "n": "507062403112553996",+ "hash01_binary64_hex": "3fdc25ca46c1eb38",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.flag_key_seed",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-display-key",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-9",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-display-key.",+ "identifier": "person-9",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d646973706c61792d6b65792e706572736f6e2d3976617269616e74",+ "sha1_hex": "2090020a34850978ecf974a4e945b3de0ff356fc",+ "first_15_hex": "2090020a3485097",+ "n": "146648603044630679",+ "hash01_binary64_hex": "3fc04801051a4285",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.rollout_hit",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 50,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-6",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "rollout",+ "prefix": "example-split.",+ "identifier": "person-6",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d36",+ "sha1_hex": "0884085a52c321e1a4a67d7712a950bbfb29c236",+ "first_15_hex": "0884085a52c321e",+ "n": "38351539578614302",+ "hash01_binary64_hex": "3fa10810b4a58644",+ "threshold_binary64_hex": "3fe0000000000000"+ },+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-6",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3676617269616e74",+ "sha1_hex": "8980bb6ec6763e56136cde7eeaf8ff963cddb5db",+ "first_15_hex": "8980bb6ec6763e5",+ "n": "619257829041595365",+ "hash01_binary64_hex": "3fe130176dd8cec8",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.rollout_miss_return_default",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 50,+ "on_rollout_miss": "return_default",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "rollout_miss",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "rollout",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d31",+ "sha1_hex": "ef0a543f86ebc4f681810ae2e9ad78a1b24508c0",+ "first_15_hex": "ef0a543f86ebc4f",+ "n": "1076542022290947151",+ "hash01_binary64_hex": "3fede14a87f0dd79",+ "threshold_binary64_hex": "3fe0000000000000"+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.rollout_miss_continue",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 50,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "targeted_release",+ "targeting": {+ "properties": []+ },+ "value": "targeted"+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "targeted",+ "reason": "targeting_match",+ "rule": {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "targeted_release",+ "index": 1+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "targeted",+ "value": "targeted",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "rollout",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d31",+ "sha1_hex": "ef0a543f86ebc4f681810ae2e9ad78a1b24508c0",+ "first_15_hex": "ef0a543f86ebc4f",+ "n": "1076542022290947151",+ "hash01_binary64_hex": "3fede14a87f0dd79",+ "threshold_binary64_hex": "3fe0000000000000"+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.holdout_in",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 20+ }+ }+ ]+ },+ "context": {+ "identifier": "person-12",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "holdout",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "holdout",+ "prefix": "example-holdout",+ "identifier": "person-12",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d686f6c646f7574706572736f6e2d3132",+ "sha1_hex": "0d1390c2884fe37d2f481cb1cd8b070c8f63bb49",+ "first_15_hex": "0d1390c2884fe37",+ "n": "58890994514722359",+ "hash01_binary64_hex": "3faa272185109fc7",+ "threshold_binary64_hex": "3fc999999999999a"+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.holdout_out",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 20+ }+ }+ ]+ },+ "context": {+ "identifier": "person-3",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "holdout",+ "prefix": "example-holdout",+ "identifier": "person-3",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d686f6c646f7574706572736f6e2d33",+ "sha1_hex": "e3d8dcb693162ca5505ae752dc954e3e0aa667a5",+ "first_15_hex": "e3d8dcb693162ca",+ "n": "1026132194893062858",+ "hash01_binary64_hex": "3fec7b1b96d262c6",+ "threshold_binary64_hex": "3fc999999999999a"+ },+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-3",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3376617269616e74",+ "sha1_hex": "f31f53c835e3ac066ef4237aa9d552ce225ea64a",+ "first_15_hex": "f31f53c835e3ac0",+ "n": "1094925824678574784",+ "hash01_binary64_hex": "3fee63ea7906bc76",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.legacy_holdout_seed",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "holdout-",+ "exclusion_percentage": 50+ }+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "holdout",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "holdout",+ "prefix": "holdout-",+ "identifier": "person-1",+ "salt": "",+ "input_utf8_hex": "686f6c646f75742d706572736f6e2d31",+ "sha1_hex": "621019936a5272952e325d32f848db322bcea920",+ "first_15_hex": "621019936a52729",+ "n": "441635996017436457",+ "hash01_binary64_hex": "3fd8840664da949d",+ "threshold_binary64_hex": "3fe0000000000000"+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.shared_rollout_seed",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "percentage_rollout",+ "targeting": {+ "properties": []+ },+ "value": "percentage",+ "rollout_percentage": 30,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-shared",+ "assign_by": "person"+ },+ {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 60,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-shared",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-2",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "22222222-2222-4222-8222-222222222222",+ "rule_type": "experiment",+ "index": 1+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "rollout",+ "prefix": "example-shared.",+ "identifier": "person-2",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d7368617265642e706572736f6e2d32",+ "sha1_hex": "51e2cf47f2ed1821aea41a38a24864add9c0db66",+ "first_15_hex": "51e2cf47f2ed182",+ "n": "368781648108376450",+ "hash01_binary64_hex": "3fd478b3d1fcbb46",+ "threshold_binary64_hex": "3fd3333333333333"+ },+ {+ "use": "rollout",+ "prefix": "example-shared.",+ "identifier": "person-2",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d7368617265642e706572736f6e2d32",+ "sha1_hex": "51e2cf47f2ed1821aea41a38a24864add9c0db66",+ "first_15_hex": "51e2cf47f2ed182",+ "n": "368781648108376450",+ "hash01_binary64_hex": "3fd478b3d1fcbb46",+ "threshold_binary64_hex": "3fe3333333333333"+ },+ {+ "use": "variant",+ "prefix": "example-shared.",+ "identifier": "person-2",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d7368617265642e706572736f6e2d3276617269616e74",+ "sha1_hex": "713eae155c71d29c717414f2631615d5a11e1174",+ "first_15_hex": "713eae155c71d29",+ "n": "510009436350651689",+ "hash01_binary64_hex": "3fdc4fab85571c75",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.identifier_200",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616176617269616e74",+ "sha1_hex": "5771a7badbc8521956075b915d499cd17c672efc",+ "first_15_hex": "5771a7badbc8521",+ "n": "393812610916320545",+ "hash01_binary64_hex": "3fd5dc69eeb6f215",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.assignment.identifier_201",+ "family": "assignment",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616176617269616e74",+ "sha1_hex": "5771a7badbc8521956075b915d499cd17c672efc",+ "first_15_hex": "5771a7badbc8521",+ "n": "393812610916320545",+ "hash01_binary64_hex": "3fd5dc69eeb6f215",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.values.boolean_false_variant",+ "family": "values",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "boolean",+ "default_value": false,+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": false+ },+ {+ "key": "test",+ "weight": 50,+ "value": true+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": false,+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": false,+ "variant": null,+ "value": false,+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "7097291b07ace0c5909564af9291976a174f3780",+ "first_15_hex": "7097291b07ace0c",+ "n": "507062403112553996",+ "hash01_binary64_hex": "3fdc25ca46c1eb38",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.values.boolean_true_variant",+ "family": "values",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "boolean",+ "default_value": false,+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": false+ },+ {+ "key": "test",+ "weight": 50,+ "value": true+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-3",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": true,+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": null,+ "value": true,+ "payload": null+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-3",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3376617269616e74",+ "sha1_hex": "f31f53c835e3ac066ef4237aa9d552ce225ea64a",+ "first_15_hex": "f31f53c835e3ac0",+ "n": "1094925824678574784",+ "hash01_binary64_hex": "3fee63ea7906bc76",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.values.number_zero",+ "family": "values",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "number",+ "default_value": -1,+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": 0+ },+ {+ "key": "test",+ "weight": 50,+ "value": 12.5+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": 0,+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": null,+ "value": true,+ "payload": 0+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "7097291b07ace0c5909564af9291976a174f3780",+ "first_15_hex": "7097291b07ace0c",+ "n": "507062403112553996",+ "hash01_binary64_hex": "3fdc25ca46c1eb38",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.values.number_decimal",+ "family": "values",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "number",+ "default_value": -1,+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": 0+ },+ {+ "key": "test",+ "weight": 50,+ "value": 12.5+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-3",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": 12.5,+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": null,+ "value": true,+ "payload": 12.5+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-3",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3376617269616e74",+ "sha1_hex": "f31f53c835e3ac066ef4237aa9d552ce225ea64a",+ "first_15_hex": "f31f53c835e3ac0",+ "n": "1094925824678574784",+ "hash01_binary64_hex": "3fee63ea7906bc76",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.values.object_empty",+ "family": "values",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "object",+ "default_value": {+ "layout": "default"+ },+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": {}+ },+ {+ "key": "test",+ "weight": 50,+ "value": {+ "layout": {+ "columns": 2+ }+ }+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-1",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": {},+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": null,+ "value": true,+ "payload": {}+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-1",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3176617269616e74",+ "sha1_hex": "7097291b07ace0c5909564af9291976a174f3780",+ "first_15_hex": "7097291b07ace0c",+ "n": "507062403112553996",+ "hash01_binary64_hex": "3fdc25ca46c1eb38",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.values.object_nested",+ "family": "values",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "object",+ "default_value": {+ "layout": "default"+ },+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": {}+ },+ {+ "key": "test",+ "weight": 50,+ "value": {+ "layout": {+ "columns": 2+ }+ }+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-3",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": {+ "layout": {+ "columns": 2+ }+ },+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": null,+ "value": true,+ "payload": {+ "layout": {+ "columns": 2+ }+ }+ },+ "hash_evidence": [+ {+ "use": "variant",+ "prefix": "example-split.",+ "identifier": "person-3",+ "salt": "variant",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d3376617269616e74",+ "sha1_hex": "f31f53c835e3ac066ef4237aa9d552ce225ea64a",+ "first_15_hex": "f31f53c835e3ac0",+ "n": "1094925824678574784",+ "hash01_binary64_hex": "3fee63ea7906bc76",+ "boundaries_binary64_hex": [+ "3fe0000000000000",+ "3ff0000000000000"+ ]+ }+ ]+ },+ {+ "id": "v2_experiment.values.null_default_paused",+ "family": "values",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": null,+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": true,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": null,+ "reason": "experiment_paused",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": false,+ "variant": null,+ "value": false,+ "payload": null+ }+ },+ {+ "id": "v2_experiment.values.null_default_holdout",+ "family": "values",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "boolean",+ "default_value": null,+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": false+ },+ {+ "key": "test",+ "weight": 50,+ "value": true+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 100+ }+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": null,+ "reason": "holdout",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": false,+ "variant": null,+ "value": false,+ "payload": null+ }+ },+ {+ "id": "v2_experiment.values.object_default_rollout_miss",+ "family": "values",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "object",+ "default_value": {+ "layout": "default"+ },+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 0,+ "on_rollout_miss": "return_default",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": {}+ },+ {+ "key": "test",+ "weight": 50,+ "value": {+ "a": 1+ }+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": {+ "layout": "default"+ },+ "reason": "rollout_miss",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": null,+ "value": true,+ "payload": {+ "layout": "default"+ }+ },+ "hash_evidence": [+ {+ "use": "rollout",+ "prefix": "example-split.",+ "identifier": "person-example",+ "salt": "",+ "input_utf8_hex": "6578616d706c652d73706c69742e706572736f6e2d6578616d706c65",+ "sha1_hex": "bb21a3739cb09b9fb960eeda9aa454ef538f08b9",+ "first_15_hex": "bb21a3739cb09b9",+ "n": "842764904766835129",+ "hash01_binary64_hex": "3fe764346e739613",+ "threshold_binary64_hex": "0000000000000000"+ }+ ]+ },+ {+ "id": "v2_experiment.white_box.variant_equal",+ "family": "white_box",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "white_box": {+ "hash01_binary64_hex": "3fe0000000000000",+ "against": "variant_boundary",+ "boundary_binary64_hex": "3fe0000000000000",+ "relation": "equal"+ }+ },+ {+ "id": "v2_experiment.white_box.variant_below",+ "family": "white_box",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "white_box": {+ "hash01_binary64_hex": "3fdfffffffffffff",+ "against": "variant_boundary",+ "boundary_binary64_hex": "3fe0000000000000",+ "relation": "below"+ }+ },+ {+ "id": "v2_experiment.white_box.accumulated_equal",+ "family": "white_box",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 33.33,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 33.33,+ "value": "green"+ },+ {+ "key": "other",+ "weight": 33.34,+ "value": "red"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "red",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "other"+ },+ "legacy": {+ "enabled": true,+ "variant": "red",+ "value": "red",+ "payload": null+ },+ "white_box": {+ "hash01_binary64_hex": "3fe554c985f06f69",+ "against": "variant_boundary",+ "boundary_binary64_hex": "3fe554c985f06f69",+ "relation": "equal"+ }+ },+ {+ "id": "v2_experiment.white_box.accumulated_below",+ "family": "white_box",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 33.33,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 33.33,+ "value": "green"+ },+ {+ "key": "other",+ "weight": 33.34,+ "value": "red"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "green",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "test"+ },+ "legacy": {+ "enabled": true,+ "variant": "green",+ "value": "green",+ "payload": null+ },+ "white_box": {+ "hash01_binary64_hex": "3fe554c985f06f68",+ "against": "variant_boundary",+ "boundary_binary64_hex": "3fe554c985f06f69",+ "relation": "below"+ }+ },+ {+ "id": "v2_experiment.white_box.off_the_end",+ "family": "white_box",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 33.33,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 33.33,+ "value": "green"+ },+ {+ "key": "other",+ "weight": 33.34,+ "value": "red"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "red",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "other"+ },+ "legacy": {+ "enabled": true,+ "variant": "red",+ "value": "red",+ "payload": null+ },+ "white_box": {+ "hash01_binary64_hex": "3ff0000000000000",+ "against": "variant_boundary",+ "boundary_binary64_hex": "3ff0000000000000",+ "relation": "equal"+ }+ },+ {+ "id": "v2_experiment.white_box.off_the_end_zero_weight",+ "family": "white_box",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "always",+ "weight": 100,+ "value": "green"+ },+ {+ "key": "never",+ "weight": 0,+ "value": "blue"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "never"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "white_box": {+ "hash01_binary64_hex": "3ff0000000000000",+ "against": "variant_boundary",+ "boundary_binary64_hex": "3ff0000000000000",+ "relation": "equal"+ }+ },+ {+ "id": "v2_experiment.white_box.holdout_equal",+ "family": "white_box",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 20+ }+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "holdout",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ },+ "white_box": {+ "hash01_binary64_hex": "3fc999999999999a",+ "against": "holdout_threshold",+ "boundary_binary64_hex": "3fc999999999999a",+ "relation": "equal"+ }+ },+ {+ "id": "v2_experiment.white_box.holdout_above",+ "family": "white_box",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 20+ }+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "white_box": {+ "hash01_binary64_hex": "3fc999999999999b",+ "against": "holdout_threshold",+ "boundary_binary64_hex": "3fc999999999999a",+ "relation": "above"+ }+ },+ {+ "id": "v2_experiment.white_box.rollout_equal",+ "family": "white_box",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 30,+ "on_rollout_miss": "return_default",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "blue",+ "reason": "experiment_split",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ },+ "variant": "control"+ },+ "legacy": {+ "enabled": true,+ "variant": "blue",+ "value": "blue",+ "payload": null+ },+ "white_box": {+ "hash01_binary64_hex": "3fd3333333333333",+ "against": "rollout_threshold",+ "boundary_binary64_hex": "3fd3333333333333",+ "relation": "equal"+ }+ },+ {+ "id": "v2_experiment.white_box.rollout_above",+ "family": "white_box",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 30,+ "on_rollout_miss": "return_default",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "success",+ "value": "default",+ "reason": "rollout_miss",+ "rule": {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "index": 0+ }+ },+ "legacy": {+ "enabled": true,+ "variant": "default",+ "value": "default",+ "payload": null+ },+ "white_box": {+ "hash01_binary64_hex": "3fd3333333333334",+ "against": "rollout_threshold",+ "boundary_binary64_hex": "3fd3333333333333",+ "relation": "above"+ }+ },+ {+ "id": "v2_experiment.parser.experiment_id",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "experiment_id": 42,+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.missing_paused",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.one_variant",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 100,+ "value": "blue"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.twenty_one_variants",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "arm_00",+ "weight": 5,+ "value": "v0"+ },+ {+ "key": "arm_01",+ "weight": 5,+ "value": "v1"+ },+ {+ "key": "arm_02",+ "weight": 5,+ "value": "v2"+ },+ {+ "key": "arm_03",+ "weight": 5,+ "value": "v3"+ },+ {+ "key": "arm_04",+ "weight": 5,+ "value": "v4"+ },+ {+ "key": "arm_05",+ "weight": 5,+ "value": "v5"+ },+ {+ "key": "arm_06",+ "weight": 5,+ "value": "v6"+ },+ {+ "key": "arm_07",+ "weight": 5,+ "value": "v7"+ },+ {+ "key": "arm_08",+ "weight": 5,+ "value": "v8"+ },+ {+ "key": "arm_09",+ "weight": 5,+ "value": "v9"+ },+ {+ "key": "arm_10",+ "weight": 5,+ "value": "v10"+ },+ {+ "key": "arm_11",+ "weight": 5,+ "value": "v11"+ },+ {+ "key": "arm_12",+ "weight": 5,+ "value": "v12"+ },+ {+ "key": "arm_13",+ "weight": 5,+ "value": "v13"+ },+ {+ "key": "arm_14",+ "weight": 5,+ "value": "v14"+ },+ {+ "key": "arm_15",+ "weight": 5,+ "value": "v15"+ },+ {+ "key": "arm_16",+ "weight": 5,+ "value": "v16"+ },+ {+ "key": "arm_17",+ "weight": 5,+ "value": "v17"+ },+ {+ "key": "arm_18",+ "weight": 5,+ "value": "v18"+ },+ {+ "key": "arm_19",+ "weight": 2.5,+ "value": "v19"+ },+ {+ "key": "arm_20",+ "weight": 2.5,+ "value": "v20"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.variant_key_characters",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test.v2",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.empty_variant_key",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.variant_value_type",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": true+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.null_variant_value",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": null+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.empty_variant_value",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": ""+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.unknown_variant_field",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green",+ "description": "Unknown variant field"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.weight_above_100",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 100.5,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": -0.5,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.holdout_missing_seed",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "exclusion_percentage": 5+ }+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.unknown_holdout_field",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 5,+ "name": "x"+ }+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.holdout_id",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "id": 7,+ "seed": "example-holdout",+ "exclusion_percentage": 5+ }+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.unknown_rule_field",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "variant_split": true+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.weights_below_100",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 33.33,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 33.33,+ "value": "green"+ },+ {+ "key": "other",+ "weight": 33.33,+ "value": "red"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.weights_above_100",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50.01,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.weight_three_decimals",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 33.333,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 66.667,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.exclusion_three_decimals",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "test",+ "weight": 50,+ "value": "green"+ }+ ],+ "holdout": {+ "seed": "example-holdout",+ "exclusion_percentage": 5.555+ }+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ },+ {+ "id": "v2_experiment.parser.duplicate_variant_keys",+ "family": "parser",+ "flag": {+ "key": "example-display-key",+ "name": "Example display name",+ "active": true,+ "deleted": false,+ "requested": true+ },+ "config": {+ "version": 2,+ "return_type": "string",+ "default_value": "default",+ "rules": [+ {+ "id": "11111111-1111-4111-8111-111111111111",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "example-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": "blue"+ },+ {+ "key": "control",+ "weight": 50,+ "value": "green"+ }+ ]+ }+ ]+ },+ "context": {+ "identifier": "person-example",+ "properties": {+ "plan": "pro"+ },+ "properties_complete": true,+ "timezone": "UTC",+ "explicit_exact_matching": true,+ "now": "2024-03-31T12:00:00Z"+ },+ "expected": {+ "status": "parse_error",+ "kind": "malformed"+ }+ }+ ]+}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/null_experiment_id.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/experiment_rule_with_experiment_id.jsonsimilarity index 85%rename from rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/null_experiment_id.jsonrename to rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/experiment_rule_with_experiment_id.jsonindex 7e6c8231080d..9f0159d26586 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/null_experiment_id.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/experiment_rule_with_experiment_id.json@@ -9,11 +9,12 @@"targeting": {"properties": []},- "experiment_id": null,+ "experiment_id": 42,+ "paused": false,"rollout_percentage": 100,"on_rollout_miss": "continue","assignment_algorithm": "sha1_60_v1",- "seed": "null-experiment-id",+ "seed": "experiment-id-field","variants": [{"key": "control",@@ -25,8 +26,7 @@"weight": 50,"value": true}- ],- "paused": false+ ]}]}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/group_experiment_with_assign_by.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/group_experiment_with_assign_by.jsonindex 6da55c0ad12a..ab995886b210 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/group_experiment_with_assign_by.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/group_experiment_with_assign_by.json@@ -9,7 +9,6 @@"targeting": {"properties": []},- "experiment_id": 42,"paused": false,"rollout_percentage": 100,"on_rollout_miss": "continue",@@ -29,7 +28,6 @@}],"holdout": {- "id": 7,"seed": "holdout-","exclusion_percentage": 5}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/holdout_with_id.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/holdout_with_id.jsonnew file mode 100644index 000000000000..8452e2126833--- /dev/null+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/holdout_with_id.json@@ -0,0 +1,36 @@+{+ "version": 2,+ "return_type": "boolean",+ "default_value": false,+ "rules": [+ {+ "id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",+ "rule_type": "experiment",+ "targeting": {+ "properties": []+ },+ "paused": false,+ "rollout_percentage": 100,+ "on_rollout_miss": "continue",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "holdout-id-field",+ "variants": [+ {+ "key": "control",+ "weight": 50,+ "value": false+ },+ {+ "key": "test",+ "weight": 50,+ "value": true+ }+ ],+ "holdout": {+ "id": 7,+ "seed": "holdout-",+ "exclusion_percentage": 5+ }+ }+ ]+}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/missing_experiment_paused.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/missing_experiment_paused.jsonindex 7dabb0282af8..4d9c0b1d8117 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/missing_experiment_paused.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/missing_experiment_paused.json@@ -9,7 +9,6 @@"targeting": {"properties": []},- "experiment_id": 21,"rollout_percentage": 100,"on_rollout_miss": "continue","assignment_algorithm": "sha1_60_v1",diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/seed_too_long.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/seed_too_long.jsonindex 6e706d2fdc66..5cb3ff1392cc 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/seed_too_long.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/seed_too_long.json@@ -9,7 +9,6 @@"targeting": {"properties": []},- "experiment_id": 42,"paused": false,"rollout_percentage": 100,"on_rollout_miss": "continue",@@ -29,7 +28,6 @@}],"holdout": {- "id": 7,"seed": "holdout-","exclusion_percentage": 5}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/too_few_variants.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/too_few_variants.jsonindex eac34c695e3a..467d0fd705ab 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/too_few_variants.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/too_few_variants.json@@ -9,7 +9,6 @@"targeting": {"properties": []},- "experiment_id": 42,"paused": false,"rollout_percentage": 100,"on_rollout_miss": "continue",@@ -24,7 +23,6 @@}],"holdout": {- "id": 7,"seed": "holdout-","exclusion_percentage": 5}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/too_many_variants.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/too_many_variants.jsonindex 60de1041556c..61d74e51d4c4 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/too_many_variants.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/too_many_variants.json@@ -9,7 +9,6 @@"targeting": {"properties": []},- "experiment_id": 42,"paused": false,"rollout_percentage": 100,"on_rollout_miss": "continue",@@ -124,7 +123,6 @@}],"holdout": {- "id": 7,"seed": "holdout-","exclusion_percentage": 5}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/variant_key_invalid_characters.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/variant_key_invalid_characters.jsonindex 292ba97aa4f2..79a8fbb51a0e 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/variant_key_invalid_characters.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/variant_key_invalid_characters.json@@ -9,7 +9,6 @@"targeting": {"properties": []},- "experiment_id": 42,"paused": false,"rollout_percentage": 100,"on_rollout_miss": "continue",@@ -29,7 +28,6 @@}],"holdout": {- "id": 7,"seed": "holdout-","exclusion_percentage": 5}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/variant_value_type_mismatch.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/variant_value_type_mismatch.jsonindex 6c777d1eef6e..d5005ad21a63 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/variant_value_type_mismatch.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/invalid/variant_value_type_mismatch.json@@ -9,7 +9,6 @@"targeting": {"properties": []},- "experiment_id": 21,"rollout_percentage": 100,"on_rollout_miss": "continue","assignment_algorithm": "sha1_60_v1",diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/boolean_all_rule_types.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/boolean_all_rule_types.jsonindex ef901e2a6986..212c736daec8 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/boolean_all_rule_types.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/boolean_all_rule_types.json@@ -42,7 +42,6 @@"targeting": {"properties": []},- "experiment_id": 42,"paused": false,"rollout_percentage": 100,"on_rollout_miss": "continue",@@ -62,7 +61,6 @@}],"holdout": {- "id": 7,"seed": "holdout-","exclusion_percentage": 5}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/experiment_rule_local_holdout.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/experiment_rule_local_holdout.jsonnew file mode 100644index 000000000000..ba765ccdb2ef--- /dev/null+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/experiment_rule_local_holdout.json@@ -0,0 +1,51 @@+{+ "version": 2,+ "return_type": "string",+ "default_value": "standard",+ "rules": [+ {+ "id": "55555555-5555-4555-8555-555555555555",+ "rule_type": "experiment",+ "targeting": {+ "properties": [+ {+ "key": "plan",+ "type": "person",+ "operator": "exact",+ "value": [+ "pro"+ ]+ }+ ]+ },+ "description": "Split checkout layouts with a holdout that belongs to this rule.",+ "paused": false,+ "rollout_percentage": 80.5,+ "on_rollout_miss": "return_default",+ "assignment_algorithm": "sha1_60_v1",+ "seed": "checkout-layout-split",+ "assign_by": "person",+ "variants": [+ {+ "key": "standard",+ "weight": 33.33,+ "value": "standard"+ },+ {+ "key": "compact",+ "weight": 33.33,+ "value": "compact"+ },+ {+ "key": "compact-copy",+ "weight": 33.34,+ "value": "compact"+ }+ ],+ "holdout": {+ "seed": "checkout-layout-holdout",+ "exclusion_percentage": 10+ }+ }+ ]+}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/group_all_rule_types.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/group_all_rule_types.jsonindex 4d6a091e86ee..b42c20fddf01 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/group_all_rule_types.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/config/valid/group_all_rule_types.json@@ -41,7 +41,6 @@"targeting": {"properties": []},- "experiment_id": 42,"paused": false,"rollout_percentage": 100,"on_rollout_miss": "continue",@@ -60,7 +59,6 @@}],"holdout": {- "id": 7,"seed": "holdout-","exclusion_percentage": 5}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/wire/definitions.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/wire/definitions.jsonindex 764a8c3bf01c..90984568ddea 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/wire/definitions.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/wire/definitions.json@@ -1,5 +1,4 @@{- "fixture_version": "1.0.0","schema": "schemas/definitions_entry.schema.json","templates": {"v2": {@@ -51,7 +50,6 @@"targeting": {"properties": []},- "experiment_id": 42,"paused": false,"rollout_percentage": 100,"on_rollout_miss": "continue",@@ -71,7 +69,6 @@}],"holdout": {- "id": 7,"seed": "holdout-","exclusion_percentage": 5}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/wire/responses.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/wire/responses.jsonindex 959dc51bee03..df43793f74e8 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/wire/responses.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/fixtures/wire/responses.json@@ -1,5 +1,4 @@{- "fixture_version": "1.0.0","schema": "schemas/flags_response_v3.schema.json","templates": {"targeting_match_targeted_release": {@@ -68,7 +67,6 @@"payload": null,"rule_type": "experiment","rule_id": "10000000-0000-4000-8000-000000000001",- "experiment_id": 301,"variant_key": "arm_a"}}@@ -117,8 +115,7 @@"has_experiment": true,"payload": null,"rule_type": "experiment",- "rule_id": "10000000-0000-4000-8000-000000000001",- "experiment_id": 301+ "rule_id": "10000000-0000-4000-8000-000000000001"}}},@@ -142,8 +139,7 @@"has_experiment": true,"payload": null,"rule_type": "experiment",- "rule_id": "10000000-0000-4000-8000-000000000001",- "experiment_id": 301+ "rule_id": "10000000-0000-4000-8000-000000000001"}}},@@ -167,9 +163,7 @@"has_experiment": true,"payload": null,"rule_type": "experiment",- "rule_id": "10000000-0000-4000-8000-000000000001",- "experiment_id": 301,- "holdout_id": 401+ "rule_id": "10000000-0000-4000-8000-000000000001"}}},@@ -331,1051 +325,22 @@}},{- "id": "responses.missing_config_version",- "template": "targeting_match_targeted_release",- "remove": [- "/flags/garden-layout/metadata/config_version"- ],- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "config_version"- }- },- {- "id": "responses.targeting_match_targeted_release_missing_has_experiment",- "template": "targeting_match_targeted_release",- "remove": [- "/flags/garden-layout/metadata/has_experiment"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"- }- },- {- "id": "responses.targeting_match_targeted_release_missing_rule_type",- "template": "targeting_match_targeted_release",- "remove": [- "/flags/garden-layout/metadata/rule_type"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_type"- }- },- {- "id": "responses.targeting_match_targeted_release_missing_rule_id",- "template": "targeting_match_targeted_release",- "remove": [- "/flags/garden-layout/metadata/rule_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_id"- }- },- {- "id": "responses.targeting_match_targeted_release_forbidden_experiment_id",- "template": "targeting_match_targeted_release",- "set": {- "/flags/garden-layout/metadata/experiment_id": 301- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.targeting_match_targeted_release_forbidden_variant_key",- "template": "targeting_match_targeted_release",- "set": {- "/flags/garden-layout/metadata/variant_key": "arm_a"- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.targeting_match_targeted_release_forbidden_holdout_id",- "template": "targeting_match_targeted_release",- "set": {- "/flags/garden-layout/metadata/holdout_id": 401- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.targeting_match_targeted_release_wrong_condition_index",- "template": "targeting_match_targeted_release",- "set": {- "/flags/garden-layout/reason/condition_index": null- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"- }- },- {- "id": "responses.targeting_match_targeted_release_forbidden_failed",- "template": "targeting_match_targeted_release",- "set": {- "/flags/garden-layout/failed": true,- "/flags/garden-layout/value": null,- "/errorsWhileComputingFlags": true- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.targeting_match_targeted_release_flag_with_experiment",- "template": "targeting_match_targeted_release",- "set": {- "/flags/garden-layout/metadata/has_experiment": true- },- "expected": "valid"- },- {- "id": "responses.targeting_match_percentage_rollout",- "template": "targeting_match_percentage_rollout",- "expected": "valid"- },- {- "id": "responses.targeting_match_percentage_rollout_missing_has_experiment",- "template": "targeting_match_percentage_rollout",- "remove": [- "/flags/garden-layout/metadata/has_experiment"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"- }- },- {- "id": "responses.targeting_match_percentage_rollout_missing_rule_type",- "template": "targeting_match_percentage_rollout",- "remove": [- "/flags/garden-layout/metadata/rule_type"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_type"- }- },- {- "id": "responses.targeting_match_percentage_rollout_missing_rule_id",- "template": "targeting_match_percentage_rollout",- "remove": [- "/flags/garden-layout/metadata/rule_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_id"- }- },- {- "id": "responses.targeting_match_percentage_rollout_forbidden_experiment_id",- "template": "targeting_match_percentage_rollout",- "set": {- "/flags/garden-layout/metadata/experiment_id": 301- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.targeting_match_percentage_rollout_forbidden_variant_key",- "template": "targeting_match_percentage_rollout",- "set": {- "/flags/garden-layout/metadata/variant_key": "arm_a"- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.targeting_match_percentage_rollout_forbidden_holdout_id",- "template": "targeting_match_percentage_rollout",- "set": {- "/flags/garden-layout/metadata/holdout_id": 401- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.targeting_match_percentage_rollout_wrong_condition_index",- "template": "targeting_match_percentage_rollout",- "set": {- "/flags/garden-layout/reason/condition_index": null- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"- }- },- {- "id": "responses.targeting_match_percentage_rollout_forbidden_failed",- "template": "targeting_match_percentage_rollout",- "set": {- "/flags/garden-layout/failed": true,- "/flags/garden-layout/value": null,- "/errorsWhileComputingFlags": true- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.experiment_split",- "template": "experiment_split",- "expected": "valid"- },- {- "id": "responses.experiment_split_missing_has_experiment",- "template": "experiment_split",- "remove": [- "/flags/garden-layout/metadata/has_experiment"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"- }- },- {- "id": "responses.experiment_split_missing_rule_type",- "template": "experiment_split",- "remove": [- "/flags/garden-layout/metadata/rule_type"- ],- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_type"- }- },- {- "id": "responses.experiment_split_missing_rule_id",- "template": "experiment_split",- "remove": [- "/flags/garden-layout/metadata/rule_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_id"- }- },- {- "id": "responses.experiment_split_missing_experiment_id",- "template": "experiment_split",- "remove": [- "/flags/garden-layout/metadata/experiment_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "experiment_id"- }- },- {- "id": "responses.experiment_split_missing_variant_key",- "template": "experiment_split",- "remove": [- "/flags/garden-layout/metadata/variant_key"- ],- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "variant_key"- }- },- {- "id": "responses.experiment_split_forbidden_holdout_id",- "template": "experiment_split",- "set": {- "/flags/garden-layout/metadata/holdout_id": 401- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.experiment_split_wrong_condition_index",- "template": "experiment_split",- "set": {- "/flags/garden-layout/reason/condition_index": null- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"- }- },- {- "id": "responses.experiment_split_forbidden_failed",- "template": "experiment_split",- "set": {- "/flags/garden-layout/failed": true,- "/flags/garden-layout/value": null,- "/errorsWhileComputingFlags": true- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.experiment_split_contradicted_has_experiment",- "template": "experiment_split",- "set": {- "/flags/garden-layout/metadata/has_experiment": false- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "const",- "instance_path": "/flags/garden-layout/metadata/has_experiment"- }- },- {- "id": "responses.rollout_miss_percentage_rollout",- "template": "rollout_miss_percentage_rollout",- "expected": "valid"- },- {- "id": "responses.rollout_miss_percentage_rollout_missing_has_experiment",- "template": "rollout_miss_percentage_rollout",- "remove": [- "/flags/garden-layout/metadata/has_experiment"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"- }- },- {- "id": "responses.rollout_miss_percentage_rollout_missing_rule_type",- "template": "rollout_miss_percentage_rollout",- "remove": [- "/flags/garden-layout/metadata/rule_type"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_type"- }- },- {- "id": "responses.rollout_miss_percentage_rollout_missing_rule_id",- "template": "rollout_miss_percentage_rollout",- "remove": [- "/flags/garden-layout/metadata/rule_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_id"- }- },- {- "id": "responses.rollout_miss_percentage_rollout_forbidden_experiment_id",- "template": "rollout_miss_percentage_rollout",- "set": {- "/flags/garden-layout/metadata/experiment_id": 301- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.rollout_miss_percentage_rollout_forbidden_variant_key",- "template": "rollout_miss_percentage_rollout",- "set": {- "/flags/garden-layout/metadata/variant_key": "arm_a"- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.rollout_miss_percentage_rollout_forbidden_holdout_id",- "template": "rollout_miss_percentage_rollout",- "set": {- "/flags/garden-layout/metadata/holdout_id": 401- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.rollout_miss_percentage_rollout_wrong_condition_index",- "template": "rollout_miss_percentage_rollout",- "set": {- "/flags/garden-layout/reason/condition_index": null- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"- }- },- {- "id": "responses.rollout_miss_percentage_rollout_forbidden_failed",- "template": "rollout_miss_percentage_rollout",- "set": {- "/flags/garden-layout/failed": true,- "/flags/garden-layout/value": null,- "/errorsWhileComputingFlags": true- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.rollout_miss_experiment",- "template": "rollout_miss_experiment",- "expected": "valid"- },- {- "id": "responses.rollout_miss_experiment_missing_has_experiment",- "template": "rollout_miss_experiment",- "remove": [- "/flags/garden-layout/metadata/has_experiment"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"- }- },- {- "id": "responses.rollout_miss_experiment_missing_rule_type",- "template": "rollout_miss_experiment",- "remove": [- "/flags/garden-layout/metadata/rule_type"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_type"- }- },- {- "id": "responses.rollout_miss_experiment_missing_rule_id",- "template": "rollout_miss_experiment",- "remove": [- "/flags/garden-layout/metadata/rule_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_id"- }- },- {- "id": "responses.rollout_miss_experiment_missing_experiment_id",- "template": "rollout_miss_experiment",- "remove": [- "/flags/garden-layout/metadata/experiment_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "experiment_id"- }- },- {- "id": "responses.rollout_miss_experiment_forbidden_variant_key",- "template": "rollout_miss_experiment",- "set": {- "/flags/garden-layout/metadata/variant_key": "arm_a"- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.rollout_miss_experiment_forbidden_holdout_id",- "template": "rollout_miss_experiment",- "set": {- "/flags/garden-layout/metadata/holdout_id": 401- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.rollout_miss_experiment_wrong_condition_index",- "template": "rollout_miss_experiment",- "set": {- "/flags/garden-layout/reason/condition_index": null- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"- }- },- {- "id": "responses.rollout_miss_experiment_forbidden_failed",- "template": "rollout_miss_experiment",- "set": {- "/flags/garden-layout/failed": true,- "/flags/garden-layout/value": null,- "/errorsWhileComputingFlags": true- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.experiment_paused",- "template": "experiment_paused",- "expected": "valid"- },- {- "id": "responses.experiment_paused_missing_has_experiment",- "template": "experiment_paused",- "remove": [- "/flags/garden-layout/metadata/has_experiment"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"- }- },- {- "id": "responses.experiment_paused_missing_rule_type",- "template": "experiment_paused",- "remove": [- "/flags/garden-layout/metadata/rule_type"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_type"- }- },- {- "id": "responses.experiment_paused_missing_rule_id",- "template": "experiment_paused",- "remove": [- "/flags/garden-layout/metadata/rule_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_id"- }- },- {- "id": "responses.experiment_paused_missing_experiment_id",- "template": "experiment_paused",- "remove": [- "/flags/garden-layout/metadata/experiment_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "experiment_id"- }- },- {- "id": "responses.experiment_paused_forbidden_variant_key",- "template": "experiment_paused",- "set": {- "/flags/garden-layout/metadata/variant_key": "arm_a"- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.experiment_paused_forbidden_holdout_id",- "template": "experiment_paused",- "set": {- "/flags/garden-layout/metadata/holdout_id": 401- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.experiment_paused_wrong_condition_index",- "template": "experiment_paused",- "set": {- "/flags/garden-layout/reason/condition_index": null- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"- }- },- {- "id": "responses.experiment_paused_forbidden_failed",- "template": "experiment_paused",- "set": {- "/flags/garden-layout/failed": true,- "/flags/garden-layout/value": null,- "/errorsWhileComputingFlags": true- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.holdout",- "template": "holdout",- "expected": "valid"- },- {- "id": "responses.holdout_missing_has_experiment",- "template": "holdout",- "remove": [- "/flags/garden-layout/metadata/has_experiment"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"- }- },- {- "id": "responses.holdout_missing_rule_type",- "template": "holdout",- "remove": [- "/flags/garden-layout/metadata/rule_type"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_type"- }- },- {- "id": "responses.holdout_missing_rule_id",- "template": "holdout",- "remove": [- "/flags/garden-layout/metadata/rule_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "rule_id"- }- },- {- "id": "responses.holdout_missing_experiment_id",- "template": "holdout",- "remove": [- "/flags/garden-layout/metadata/experiment_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "experiment_id"- }- },- {- "id": "responses.holdout_missing_holdout_id",- "template": "holdout",- "remove": [- "/flags/garden-layout/metadata/holdout_id"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "holdout_id"- }- },- {- "id": "responses.holdout_forbidden_variant_key",- "template": "holdout",- "set": {- "/flags/garden-layout/metadata/variant_key": "arm_a"- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.holdout_wrong_condition_index",- "template": "holdout",- "set": {- "/flags/garden-layout/reason/condition_index": null- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"- }- },- {- "id": "responses.holdout_forbidden_failed",- "template": "holdout",- "set": {- "/flags/garden-layout/failed": true,- "/flags/garden-layout/value": null,- "/errorsWhileComputingFlags": true- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.no_rule_match",- "template": "no_rule_match",- "expected": "valid"- },- {- "id": "responses.no_rule_match_missing_has_experiment",- "template": "no_rule_match",- "remove": [- "/flags/garden-layout/metadata/has_experiment"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"- }- },- {- "id": "responses.no_rule_match_forbidden_rule_type",- "template": "no_rule_match",- "set": {- "/flags/garden-layout/metadata/rule_type": "experiment"- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.no_rule_match_forbidden_rule_id",- "template": "no_rule_match",- "set": {- "/flags/garden-layout/metadata/rule_id": "10000000-0000-4000-8000-000000000001"- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.no_rule_match_forbidden_experiment_id",- "template": "no_rule_match",- "set": {- "/flags/garden-layout/metadata/experiment_id": 301- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.no_rule_match_forbidden_variant_key",- "template": "no_rule_match",- "set": {- "/flags/garden-layout/metadata/variant_key": "arm_a"- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.no_rule_match_forbidden_holdout_id",- "template": "no_rule_match",- "set": {- "/flags/garden-layout/metadata/holdout_id": 401- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.no_rule_match_wrong_condition_index",- "template": "no_rule_match",- "set": {- "/flags/garden-layout/reason/condition_index": 0- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"- }- },- {- "id": "responses.no_rule_match_forbidden_failed",- "template": "no_rule_match",- "set": {- "/flags/garden-layout/failed": true,- "/flags/garden-layout/value": null,- "/errorsWhileComputingFlags": true- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout"- }- },- {- "id": "responses.missing_group_key",- "template": "missing_group_key",- "expected": "valid"- },- {- "id": "responses.missing_group_key_missing_has_experiment",- "template": "missing_group_key",- "remove": [- "/flags/garden-layout/metadata/has_experiment"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"- }- },- {- "id": "responses.missing_group_key_forbidden_rule_type",- "template": "missing_group_key",- "set": {- "/flags/garden-layout/metadata/rule_type": "experiment"- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.missing_group_key_forbidden_rule_id",- "template": "missing_group_key",- "set": {- "/flags/garden-layout/metadata/rule_id": "10000000-0000-4000-8000-000000000001"- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.missing_group_key_forbidden_experiment_id",- "template": "missing_group_key",- "set": {- "/flags/garden-layout/metadata/experiment_id": 301- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.missing_group_key_forbidden_variant_key",- "template": "missing_group_key",- "set": {- "/flags/garden-layout/metadata/variant_key": "arm_a"- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.missing_group_key_forbidden_holdout_id",- "template": "missing_group_key",- "set": {- "/flags/garden-layout/metadata/holdout_id": 401- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },- {- "id": "responses.missing_group_key_wrong_condition_index",- "template": "missing_group_key",- "set": {- "/flags/garden-layout/reason/condition_index": 0- },+ "id": "responses.missing_config_version",+ "template": "targeting_match_targeted_release",+ "remove": [+ "/flags/garden-layout/metadata/config_version"+ ],"expected": "invalid","expected_failure": {"layer": "schema",- "keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"+ "keyword": "required",+ "instance_path": "/flags/garden-layout/metadata",+ "message_contains": "config_version"}},{- "id": "responses.missing_group_key_forbidden_failed",- "template": "missing_group_key",+ "id": "responses.targeting_match_targeted_release_forbidden_failed",+ "template": "targeting_match_targeted_release","set": {"/flags/garden-layout/failed": true,"/flags/garden-layout/value": null,@@ -1383,35 +348,31 @@},"expected": "invalid","expected_failure": {- "layer": "presence",+ "layer": "schema","keyword": "not",- "instance_path": "/flags/garden-layout"+ "instance_path": "/flags/garden-layout/metadata"}},{- "id": "responses.dependency_error",- "template": "dependency_error",+ "id": "responses.targeting_match_targeted_release_flag_with_experiment",+ "template": "targeting_match_targeted_release",+ "set": {+ "/flags/garden-layout/metadata/has_experiment": true+ },"expected": "valid"},{- "id": "responses.dependency_error_missing_has_experiment",- "template": "dependency_error",- "remove": [- "/flags/garden-layout/metadata/has_experiment"- ],- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "required",- "instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"- }+ "id": "responses.targeting_match_percentage_rollout",+ "template": "targeting_match_percentage_rollout",+ "expected": "valid"},{- "id": "responses.dependency_error_forbidden_rule_type",- "template": "dependency_error",+ "id": "responses.targeting_match_percentage_rollout_forbidden_failed",+ "template": "targeting_match_percentage_rollout","set": {- "/flags/garden-layout/metadata/rule_type": "experiment"+ "/flags/garden-layout/failed": true,+ "/flags/garden-layout/value": null,+ "/errorsWhileComputingFlags": true},"expected": "invalid","expected_failure": {@@ -1421,23 +382,17 @@}},{- "id": "responses.dependency_error_forbidden_rule_id",- "template": "dependency_error",- "set": {- "/flags/garden-layout/metadata/rule_id": "10000000-0000-4000-8000-000000000001"- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }+ "id": "responses.experiment_split",+ "template": "experiment_split",+ "expected": "valid"},{- "id": "responses.dependency_error_forbidden_experiment_id",- "template": "dependency_error",+ "id": "responses.experiment_split_forbidden_failed",+ "template": "experiment_split","set": {- "/flags/garden-layout/metadata/experiment_id": 301+ "/flags/garden-layout/failed": true,+ "/flags/garden-layout/value": null,+ "/errorsWhileComputingFlags": true},"expected": "invalid","expected_failure": {@@ -1447,23 +402,25 @@}},{- "id": "responses.dependency_error_forbidden_variant_key",- "template": "dependency_error",+ "id": "responses.experiment_split_flag_without_experiment",+ "template": "experiment_split","set": {- "/flags/garden-layout/metadata/variant_key": "arm_a"+ "/flags/garden-layout/metadata/has_experiment": false},- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }+ "expected": "valid"},{- "id": "responses.dependency_error_forbidden_holdout_id",- "template": "dependency_error",+ "id": "responses.rollout_miss_percentage_rollout",+ "template": "rollout_miss_percentage_rollout",+ "expected": "valid"+ },+ {+ "id": "responses.rollout_miss_percentage_rollout_forbidden_failed",+ "template": "rollout_miss_percentage_rollout","set": {- "/flags/garden-layout/metadata/holdout_id": 401+ "/flags/garden-layout/failed": true,+ "/flags/garden-layout/value": null,+ "/errorsWhileComputingFlags": true},"expected": "invalid","expected_failure": {@@ -1473,69 +430,71 @@}},{- "id": "responses.dependency_error_wrong_condition_index",- "template": "dependency_error",+ "id": "responses.rollout_miss_experiment",+ "template": "rollout_miss_experiment",+ "expected": "valid"+ },+ {+ "id": "responses.rollout_miss_experiment_forbidden_failed",+ "template": "rollout_miss_experiment","set": {- "/flags/garden-layout/reason/condition_index": 0+ "/flags/garden-layout/failed": true,+ "/flags/garden-layout/value": null,+ "/errorsWhileComputingFlags": true},"expected": "invalid","expected_failure": {"layer": "schema",- "keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"+ "keyword": "not",+ "instance_path": "/flags/garden-layout/metadata"}},{- "id": "responses.dependency_error_missing_failed",- "template": "dependency_error",- "remove": [- "/flags/garden-layout/failed"- ],- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "required",- "instance_path": "/flags/garden-layout",- "message_contains": "failed"- }+ "id": "responses.experiment_paused",+ "template": "experiment_paused",+ "expected": "valid"},{- "id": "responses.dependency_error_nonnull_value",- "template": "dependency_error",+ "id": "responses.experiment_paused_forbidden_failed",+ "template": "experiment_paused","set": {- "/flags/garden-layout/value": false+ "/flags/garden-layout/failed": true,+ "/flags/garden-layout/value": null,+ "/errorsWhileComputingFlags": true},"expected": "invalid","expected_failure": {"layer": "schema",- "keyword": "type",- "instance_path": "/flags/garden-layout/value"+ "keyword": "not",+ "instance_path": "/flags/garden-layout/metadata"}},{- "id": "responses.error",- "template": "error",+ "id": "responses.holdout",+ "template": "holdout","expected": "valid"},{- "id": "responses.error_missing_has_experiment",- "template": "error",+ "id": "responses.holdout_missing_rule_id",+ "template": "holdout","remove": [- "/flags/garden-layout/metadata/has_experiment"+ "/flags/garden-layout/metadata/rule_id"],"expected": "invalid","expected_failure": {"layer": "presence","keyword": "required","instance_path": "/flags/garden-layout/metadata",- "message_contains": "has_experiment"+ "message_contains": "rule_id"}},{- "id": "responses.error_forbidden_rule_type",- "template": "error",+ "id": "responses.holdout_forbidden_failed",+ "template": "holdout","set": {- "/flags/garden-layout/metadata/rule_type": "experiment"+ "/flags/garden-layout/failed": true,+ "/flags/garden-layout/value": null,+ "/errorsWhileComputingFlags": true},"expected": "invalid","expected_failure": {@@ -1545,70 +504,82 @@}},{- "id": "responses.error_forbidden_rule_id",- "template": "error",- "set": {- "/flags/garden-layout/metadata/rule_id": "10000000-0000-4000-8000-000000000001"- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }+ "id": "responses.no_rule_match",+ "template": "no_rule_match",+ "expected": "valid"},{- "id": "responses.error_forbidden_experiment_id",- "template": "error",+ "id": "responses.no_rule_match_forbidden_failed",+ "template": "no_rule_match","set": {- "/flags/garden-layout/metadata/experiment_id": 301+ "/flags/garden-layout/failed": true,+ "/flags/garden-layout/value": null,+ "/errorsWhileComputingFlags": true},"expected": "invalid","expected_failure": {- "layer": "schema",+ "layer": "presence","keyword": "not",- "instance_path": "/flags/garden-layout/metadata"+ "instance_path": "/flags/garden-layout"}},{- "id": "responses.error_forbidden_variant_key",- "template": "error",+ "id": "responses.missing_group_key",+ "template": "missing_group_key",+ "expected": "valid"+ },+ {+ "id": "responses.missing_group_key_forbidden_failed",+ "template": "missing_group_key","set": {- "/flags/garden-layout/metadata/variant_key": "arm_a"+ "/flags/garden-layout/failed": true,+ "/flags/garden-layout/value": null,+ "/errorsWhileComputingFlags": true},"expected": "invalid","expected_failure": {- "layer": "schema",+ "layer": "presence","keyword": "not",- "instance_path": "/flags/garden-layout/metadata"+ "instance_path": "/flags/garden-layout"}},{- "id": "responses.error_forbidden_holdout_id",- "template": "error",- "set": {- "/flags/garden-layout/metadata/holdout_id": 401- },+ "id": "responses.dependency_error",+ "template": "dependency_error",+ "expected": "valid"+ },+ {+ "id": "responses.dependency_error_missing_failed",+ "template": "dependency_error",+ "remove": [+ "/flags/garden-layout/failed"+ ],"expected": "invalid","expected_failure": {"layer": "schema",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"+ "keyword": "required",+ "instance_path": "/flags/garden-layout",+ "message_contains": "failed"}},{- "id": "responses.error_wrong_condition_index",- "template": "error",+ "id": "responses.dependency_error_nonnull_value",+ "template": "dependency_error","set": {- "/flags/garden-layout/reason/condition_index": 0+ "/flags/garden-layout/value": false},"expected": "invalid","expected_failure": {"layer": "schema","keyword": "type",- "instance_path": "/flags/garden-layout/reason/condition_index"+ "instance_path": "/flags/garden-layout/value"}},+ {+ "id": "responses.error",+ "template": "error",+ "expected": "valid"+ },{"id": "responses.error_missing_failed","template": "error",@@ -1685,19 +656,6 @@"instance_path": "/flags/garden-layout/metadata/rule_id"}},- {- "id": "responses.split_wrong_type_experiment_id",- "template": "experiment_split",- "set": {- "/flags/garden-layout/metadata/experiment_id": "301"- },- "expected": "invalid",- "expected_failure": {- "layer": "schema",- "keyword": "type",- "instance_path": "/flags/garden-layout/metadata/experiment_id"- }- },{"id": "responses.split_wrong_type_variant_key","template": "experiment_split",@@ -1947,32 +905,6 @@"instance_path": "/flags/garden-layout/metadata/rule_type"}},- {- "id": "responses.rollout_miss_percentage_rollout_wrong_rule_type",- "template": "rollout_miss_percentage_rollout",- "set": {- "/flags/garden-layout/metadata/rule_type": "experiment"- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "const",- "instance_path": "/flags/garden-layout/metadata/rule_type"- }- },- {- "id": "responses.rollout_miss_experiment_wrong_rule_type",- "template": "rollout_miss_experiment",- "set": {- "/flags/garden-layout/metadata/rule_type": "percentage_rollout"- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "const",- "instance_path": "/flags/garden-layout/metadata/rule_type"- }- },{"id": "responses.experiment_paused_wrong_rule_type","template": "experiment_paused",@@ -2091,7 +1023,6 @@"payload": null,"rule_type": "experiment","rule_id": "10000000-0000-4000-8000-000000000001",- "experiment_id": 301,"variant_key": "arm_a"}}@@ -2117,7 +1048,6 @@"payload": null,"rule_type": "experiment","rule_id": "10000000-0000-4000-8000-000000000001",- "experiment_id": 301,"variant_key": "arm_a"},"conditions": [@@ -2157,7 +1087,6 @@"payload": null,"rule_type": "experiment","rule_id": "10000000-0000-4000-8000-000000000001",- "experiment_id": 301,"variant_key": "arm_a"}}@@ -2190,19 +1119,6 @@"instance_path": "/flags/garden-layout/metadata"}},- {- "id": "responses.v1_forbidden_holdout_id",- "template": "v1",- "set": {- "/flags/garden-layout/metadata/holdout_id": 401- },- "expected": "invalid",- "expected_failure": {- "layer": "presence",- "keyword": "not",- "instance_path": "/flags/garden-layout/metadata"- }- },{"id": "responses.v1_object_payload","template": "v1",diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/manifest.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/manifest.jsonindex 1c96529d544a..7799846a7321 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/manifest.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/manifest.json@@ -1,34 +1,9 @@{- "manifest_version": 1,"contract": {"name": "feature_flag_rules_v2",- "version": "2.3.1",+ "version": "3.0.0","config_version": 2},- "corpus": {- "version": "1.1.0",- "config_version_locked": 1,- "case_id_pattern": "^[a-z][a-z0-9_]*(\\.[a-z0-9_]+)+$",- "published_versions_are_immutable": true,- "expectation_change": "Any changed expected value requires a new corpus version and a review explanation."- },- "schema_dialect": "https://json-schema.org/draft/2020-12/schema",- "compatibility": {- "published_versions_are_immutable": true,- "patch": "Documentation or integrity-tool changes that do not change accepted configs, wire payloads, frozen literals, or fixture expectations.",- "minor": "Additive fixtures or artifacts that do not change accepted configs, accepted or rejected wire payloads, frozen literals, or published fixture expectations.",- "major": "Any change to accepted or rejected configs, accepted or rejected wire payloads (responses, definitions, events, diagnostics), frozen literals, or published fixture expectations."- },- "integrity": {- "algorithm": "sha256",- "index": "SHA256SUMS",- "content": "raw_file_bytes",- "entry_format": "<lowercase_hex_digest><two_spaces><relative_posix_path><line_feed>",- "entry_order": "bytewise_path",- "excluded_from_index": [- "SHA256SUMS"- ]- },"artifacts": [{"path": "README.md",@@ -36,13 +11,11 @@},{"path": "registries/literals.json",- "kind": "registry",- "version": "2.0.0"+ "kind": "registry"},{"path": "schemas/config.schema.json",- "kind": "schema",- "version": "1.0.0"+ "kind": "schema"},{"path": "fixtures/config/valid/boolean_all_rule_types.json",@@ -210,17 +183,6 @@"instance_path": "/rules/0/variants/0/value"}},- {- "path": "fixtures/config/invalid/null_experiment_id.json",- "kind": "fixture",- "fixture_id": "config.invalid.null_experiment_id",- "expected": "invalid",- "expected_failure": {- "keyword": "type",- "instance_path": "/rules/0/experiment_id",- "message_contains": "integer"- }- },{"path": "fixtures/config/valid/object_value_max_depth.json","kind": "fixture",@@ -422,842 +384,129 @@"instance_path": "/rules/0/targeting/properties/0/type"}},+ {+ "path": "fixtures/config/valid/experiment_rule_local_holdout.json",+ "kind": "fixture",+ "fixture_id": "config.valid.experiment_rule_local_holdout",+ "expected": "valid"+ },+ {+ "path": "fixtures/config/invalid/experiment_rule_with_experiment_id.json",+ "kind": "fixture",+ "fixture_id": "config.invalid.experiment_rule_with_experiment_id",+ "expected": "invalid",+ "expected_failure": {+ "keyword": "additionalProperties",+ "instance_path": "/rules/0",+ "message_contains": "experiment_id"+ }+ },+ {+ "path": "fixtures/config/invalid/holdout_with_id.json",+ "kind": "fixture",+ "fixture_id": "config.invalid.holdout_with_id",+ "expected": "invalid",+ "expected_failure": {+ "keyword": "additionalProperties",+ "instance_path": "/rules/0/holdout",+ "message_contains": "'id'"+ }+ },{"path": "schemas/hash_sha1_60_v1.schema.json",- "kind": "schema",- "version": "1.1.0"+ "kind": "schema"},{"path": "schemas/v1_evaluation.schema.json",- "kind": "schema",- "version": "1.1.0"+ "kind": "schema"},{"path": "schemas/legacy_projection.schema.json",- "kind": "schema",- "version": "1.1.0"+ "kind": "schema"},{"path": "corpus/hash_sha1_60_v1.json",- "kind": "corpus",- "version": "1.1.0",- "schema": "schemas/hash_sha1_60_v1.schema.json",- "case_ids": [- "hash.rollout.ascii_division_edge",- "hash.rollout.ascii_excluded",- "hash.variant.ascii",- "hash.holdout.literal_prefix",- "hash.concatenation.no_separator_escaping",- "hash.identifier.empty",- "hash.identifier.unicode_utf8",- "hash.identifier.truncated_ascii",- "hash.identifier.truncated_scalar_values",- "hash.identifier.exactly_200_multibyte",- "hash.identifier.integer_group_key",- "threshold.equal_is_included",- "threshold.next_binary64_above_is_excluded",- "threshold.zero_percent_zero_hash",- "threshold.zero_percent_smallest_hash",- "threshold.hundred_percent_short_circuit",- "threshold.two_decimal_division_equal",- "threshold.two_decimal_division_excluded",- "threshold.two_decimal_division_included_below_quotient",- "variant.zero_hash_first_variant",- "variant.boundary_is_exclusive",- "variant.just_below_boundary",- "variant.accumulated_boundary_left_to_right",- "variant.accumulated_boundary_third",- "variant.two_decimal_weights_boundary",- "variant.hash_one_off_the_end",- "variant.sum_below_one_off_the_end",- "parity.rollout_identical_bytes",- "parity.variant_identical_bytes",- "parity.holdout_identical_bytes",- "parity.empty_identifier_divergent",- "parity.final_variant_fallback_divergent"- ]+ "kind": "corpus"},{"path": "corpus/v1_evaluation.json",- "kind": "corpus",- "version": "1.1.0",- "schema": "schemas/v1_evaluation.schema.json",- "case_ids": [- "v1.boolean.targeted_match_with_payload",- "v1.boolean.targeting_miss",- "v1.boolean.rollout_included",- "v1.boolean.rollout_excluded",- "v1.boolean.rollout_miss_continues_to_lower_condition",- "v1.boolean.rollout_miss_early_exit",- "v1.boolean.reason_priority_keeps_earlier_rollout_miss",- "v1.boolean.reason_priority_prefers_later_rollout_miss",- "v1.boolean.null_rollout_is_100",- "v1.boolean.empty_distinct_id_included_at_zero_percent",- "v1.boolean.empty_distinct_id_included_below_prefix_hash",- "v1.multivariate.variant_from_hash_with_payload",- "v1.multivariate.variant_from_hash_control",- "v1.multivariate.variant_override",- "v1.multivariate.invalid_variant_override_uses_hash",- "v1.multivariate.partial_rollout_included",- "v1.multivariate.partial_rollout_excluded",- "v1.multivariate.empty_distinct_id_first_variant",- "v1.group.included_by_group_key",- "v1.group.excluded_by_group_key",- "v1.group.integer_group_key_normalized",- "v1.group.missing_group_key",- "v1.dependency.satisfied",- "v1.dependency.unsatisfied",- "v1.dependency.variant_match",- "v1.dependency.variant_mismatch",- "v1.dependency.missing_target",- "v1.holdout.member",- "v1.holdout.not_member",- "v1.holdout.empty_distinct_id_hashes_prefix",- "v1.omission.inactive_flag"- ]+ "kind": "corpus"},{"path": "corpus/legacy_projection.json",- "kind": "corpus",- "version": "1.1.0",- "schema": "schemas/legacy_projection.schema.json",- "case_ids": [- "projection.boolean_true",- "projection.boolean_true_with_payload",- "projection.boolean_false_targeting_miss",- "projection.boolean_false_out_of_rollout",- "projection.variant",- "projection.variant_with_payload",- "projection.holdout_variant",- "projection.no_group_type",- "projection.missing_dependency",- "projection.failed_evaluation",- "projection.inactive_omitted"- ]+ "kind": "corpus"},{"path": "schemas/definitions_entry.schema.json",- "kind": "schema",- "version": "1.0.0"+ "kind": "schema"},{"path": "schemas/definitions_v2.schema.json",- "kind": "schema",- "version": "1.0.0"+ "kind": "schema"},{"path": "schemas/flags_response_v3.schema.json",- "kind": "schema",- "version": "1.0.1"+ "kind": "schema"},{"path": "schemas/flags_response_v3_presence.schema.json",- "kind": "schema",- "version": "1.0.0"+ "kind": "schema"},{"path": "schemas/management_warning.schema.json",- "kind": "schema",- "version": "1.0.0"+ "kind": "schema"},{"path": "schemas/management_error.schema.json",- "kind": "schema",- "version": "1.0.0"+ "kind": "schema"},{"path": "schemas/feature_flag_called_context.schema.json",- "kind": "schema",- "version": "1.0.1"+ "kind": "schema"},{"path": "schemas/experiment_exposure_properties.schema.json",- "kind": "schema",- "version": "1.0.1"+ "kind": "schema"},{"path": "rules/response_presence.json",- "kind": "presence_matrix",- "version": "1.0.0"+ "kind": "presence_matrix"},{"path": "fixtures/wire/definitions.json",- "kind": "fixture_set",- "version": "1.0.0",- "schema": "schemas/definitions_entry.schema.json",- "case_ids": [- "definitions.v2_canonical",- "definitions.v1_implicit",- "definitions.v1_explicit",- "definitions.v2_numeric_version",- "definitions.inactive",- "definitions.unsupported_version_future",- "definitions.unsupported_version_string",- "definitions.unsupported_version_boolean",- "definitions.unsupported_version_null",- "definitions.unknown_semantic_field",- "definitions.unknown_rule_field",- "definitions.unsupported_rule_type",- "definitions.missing_assignment_seed",- "definitions.v1_null_version",- "definitions.v1_wrong_type_version",- "definitions.v1_null_ensure_experience_continuity",- "definitions.v1_wrong_type_ensure_experience_continuity",- "definitions.v1_explicit_null_row_fields",- "definitions.missing_id",- "definitions.missing_key",- "definitions.missing_active",- "definitions.missing_filters",- "definitions.unknown_field"- ]- },- {- "path": "fixtures/wire/definitions_feed.json",- "kind": "fixture_set",- "version": "1.0.0",- "schema": "schemas/definitions_v2.schema.json",- "case_ids": [- "definitions_feed.mixed_versions",- "definitions_feed.missing_cohorts",- "definitions_feed.minimal_events_false",- "definitions_feed.minimal_events_true",- "definitions_feed.minimal_events_wrong_type",- "definitions_feed.null_legacy_row_fields",- "definitions_feed.missing_flags",- "definitions_feed.missing_group_type_mapping",- "definitions_feed.unknown_field"- ]+ "kind": "fixture_set"},{"path": "fixtures/wire/responses.json",- "kind": "fixture_set",- "version": "1.0.0",- "schema": "schemas/flags_response_v3.schema.json",- "case_ids": [- "responses.targeting_match_targeted_release",- "responses.missing_id",- "responses.missing_version",- "responses.missing_config_version",- "responses.targeting_match_targeted_release_missing_has_experiment",- "responses.targeting_match_targeted_release_missing_rule_type",- "responses.targeting_match_targeted_release_missing_rule_id",- "responses.targeting_match_targeted_release_forbidden_experiment_id",- "responses.targeting_match_targeted_release_forbidden_variant_key",- "responses.targeting_match_targeted_release_forbidden_holdout_id",- "responses.targeting_match_targeted_release_wrong_condition_index",- "responses.targeting_match_targeted_release_forbidden_failed",- "responses.targeting_match_targeted_release_flag_with_experiment",- "responses.targeting_match_percentage_rollout",- "responses.targeting_match_percentage_rollout_missing_has_experiment",- "responses.targeting_match_percentage_rollout_missing_rule_type",- "responses.targeting_match_percentage_rollout_missing_rule_id",- "responses.targeting_match_percentage_rollout_forbidden_experiment_id",- "responses.targeting_match_percentage_rollout_forbidden_variant_key",- "responses.targeting_match_percentage_rollout_forbidden_holdout_id",- "responses.targeting_match_percentage_rollout_wrong_condition_index",- "responses.targeting_match_percentage_rollout_forbidden_failed",- "responses.experiment_split",- "responses.experiment_split_missing_has_experiment",- "responses.experiment_split_missing_rule_type",- "responses.experiment_split_missing_rule_id",- "responses.experiment_split_missing_experiment_id",- "responses.experiment_split_missing_variant_key",- "responses.experiment_split_forbidden_holdout_id",- "responses.experiment_split_wrong_condition_index",- "responses.experiment_split_forbidden_failed",- "responses.experiment_split_contradicted_has_experiment",- "responses.rollout_miss_percentage_rollout",- "responses.rollout_miss_percentage_rollout_missing_has_experiment",- "responses.rollout_miss_percentage_rollout_missing_rule_type",- "responses.rollout_miss_percentage_rollout_missing_rule_id",- "responses.rollout_miss_percentage_rollout_forbidden_experiment_id",- "responses.rollout_miss_percentage_rollout_forbidden_variant_key",- "responses.rollout_miss_percentage_rollout_forbidden_holdout_id",- "responses.rollout_miss_percentage_rollout_wrong_condition_index",- "responses.rollout_miss_percentage_rollout_forbidden_failed",- "responses.rollout_miss_experiment",- "responses.rollout_miss_experiment_missing_has_experiment",- "responses.rollout_miss_experiment_missing_rule_type",- "responses.rollout_miss_experiment_missing_rule_id",- "responses.rollout_miss_experiment_missing_experiment_id",- "responses.rollout_miss_experiment_forbidden_variant_key",- "responses.rollout_miss_experiment_forbidden_holdout_id",- "responses.rollout_miss_experiment_wrong_condition_index",- "responses.rollout_miss_experiment_forbidden_failed",- "responses.experiment_paused",- "responses.experiment_paused_missing_has_experiment",- "responses.experiment_paused_missing_rule_type",- "responses.experiment_paused_missing_rule_id",- "responses.experiment_paused_missing_experiment_id",- "responses.experiment_paused_forbidden_variant_key",- "responses.experiment_paused_forbidden_holdout_id",- "responses.experiment_paused_wrong_condition_index",- "responses.experiment_paused_forbidden_failed",- "responses.holdout",- "responses.holdout_missing_has_experiment",- "responses.holdout_missing_rule_type",- "responses.holdout_missing_rule_id",- "responses.holdout_missing_experiment_id",- "responses.holdout_missing_holdout_id",- "responses.holdout_forbidden_variant_key",- "responses.holdout_wrong_condition_index",- "responses.holdout_forbidden_failed",- "responses.no_rule_match",- "responses.no_rule_match_missing_has_experiment",- "responses.no_rule_match_forbidden_rule_type",- "responses.no_rule_match_forbidden_rule_id",- "responses.no_rule_match_forbidden_experiment_id",- "responses.no_rule_match_forbidden_variant_key",- "responses.no_rule_match_forbidden_holdout_id",- "responses.no_rule_match_wrong_condition_index",- "responses.no_rule_match_forbidden_failed",- "responses.missing_group_key",- "responses.missing_group_key_missing_has_experiment",- "responses.missing_group_key_forbidden_rule_type",- "responses.missing_group_key_forbidden_rule_id",- "responses.missing_group_key_forbidden_experiment_id",- "responses.missing_group_key_forbidden_variant_key",- "responses.missing_group_key_forbidden_holdout_id",- "responses.missing_group_key_wrong_condition_index",- "responses.missing_group_key_forbidden_failed",- "responses.dependency_error",- "responses.dependency_error_missing_has_experiment",- "responses.dependency_error_forbidden_rule_type",- "responses.dependency_error_forbidden_rule_id",- "responses.dependency_error_forbidden_experiment_id",- "responses.dependency_error_forbidden_variant_key",- "responses.dependency_error_forbidden_holdout_id",- "responses.dependency_error_wrong_condition_index",- "responses.dependency_error_missing_failed",- "responses.dependency_error_nonnull_value",- "responses.error",- "responses.error_missing_has_experiment",- "responses.error_forbidden_rule_type",- "responses.error_forbidden_rule_id",- "responses.error_forbidden_experiment_id",- "responses.error_forbidden_variant_key",- "responses.error_forbidden_holdout_id",- "responses.error_wrong_condition_index",- "responses.error_missing_failed",- "responses.error_nonnull_value",- "responses.v1",- "responses.omitted",- "responses.split_wrong_type_config_version",- "responses.split_wrong_type_rule_type",- "responses.split_wrong_type_rule_id",- "responses.split_wrong_type_experiment_id",- "responses.split_wrong_type_variant_key",- "responses.forbidden_legacy_enabled",- "responses.forbidden_legacy_variant",- "responses.split_arm_b_equal_value",- "responses.split_string_value",- "responses.null_default",- "responses.request_failure_omission",- "responses.missing_group_nonnull_value",- "responses.v1_failed",- "responses.v1_quick_win",- "responses.v2_forced_variant",- "responses.key_mismatch",- "responses.failure_envelope",- "responses.local_only_reason",- "responses.nested_seed",- "responses.passthrough_seed",- "responses.reserved_number_wire_value",- "responses.reserved_object_wire_value",- "responses.targeting_match_targeted_release_wrong_rule_type",- "responses.experiment_split_wrong_rule_type",- "responses.rollout_miss_percentage_rollout_wrong_rule_type",- "responses.rollout_miss_experiment_wrong_rule_type",- "responses.experiment_paused_wrong_rule_type",- "responses.holdout_wrong_rule_type",- "responses.targeting_match_targeted_release_null_value",- "responses.targeting_match_percentage_rollout_null_value",- "responses.experiment_split_null_value",- "responses.empty_v2_string",- "responses.v1_experiment_without_linkage",- "responses.v1_ambiguous_experiment",- "responses.flag_key_seed",- "responses.seed_named_flag_nested_seed",- "responses.flag_key_assignment_seed",- "responses.v1_forbidden_rule_id",- "responses.v1_forbidden_rule_type",- "responses.v1_forbidden_holdout_id",- "responses.v1_object_payload",- "responses.v1_null_value_not_failed"- ]- },- {- "path": "fixtures/wire/warnings.json",- "kind": "fixture_set",- "version": "1.0.0",- "schema": "schemas/management_warning.schema.json",- "case_ids": [- "warnings.rule_order_changes_traffic",- "warnings.unreachable_lower_rule",- "warnings.rollout_miss_can_enter_lower_rule",- "warnings.assignment_reset_changes_traffic",- "warnings.conclusion_expands_population",- "warnings.detail_and_attr",- "warnings.unknown_code",- "warnings.missing_code",- "warnings.wrong_detail_type",- "warnings.unknown_field"- ]- },- {- "path": "fixtures/wire/errors.json",- "kind": "fixture_set",- "version": "1.0.0",- "schema": "schemas/management_error.schema.json",- "case_ids": [- "errors.validation",- "errors.nonfield",- "errors.missing_type",- "errors.missing_code",- "errors.missing_detail",- "errors.missing_attr",- "errors.wrong_detail_type",- "errors.unknown_field"- ]- },- {- "path": "fixtures/wire/calls.json",- "kind": "fixture_set",- "version": "1.0.0",- "schema": "schemas/feature_flag_called_context.schema.json",- "case_ids": [- "calls.targeting_match_targeted_release",- "calls.targeting_match_targeted_release_missing_rule_type",- "calls.targeting_match_targeted_release_missing_rule_id",- "calls.targeting_match_targeted_release_forbidden_experiment_id",- "calls.targeting_match_targeted_release_forbidden_variant_key",- "calls.targeting_match_targeted_release_forbidden_holdout_id",- "calls.targeting_match_percentage_rollout",- "calls.targeting_match_percentage_rollout_missing_rule_type",- "calls.targeting_match_percentage_rollout_missing_rule_id",- "calls.targeting_match_percentage_rollout_forbidden_experiment_id",- "calls.targeting_match_percentage_rollout_forbidden_variant_key",- "calls.targeting_match_percentage_rollout_forbidden_holdout_id",- "calls.experiment_split",- "calls.experiment_split_missing_rule_type",- "calls.experiment_split_missing_rule_id",- "calls.experiment_split_missing_experiment_id",- "calls.experiment_split_missing_variant_key",- "calls.experiment_split_forbidden_holdout_id",- "calls.rollout_miss_percentage_rollout",- "calls.rollout_miss_percentage_rollout_missing_rule_type",- "calls.rollout_miss_percentage_rollout_missing_rule_id",- "calls.rollout_miss_percentage_rollout_forbidden_experiment_id",- "calls.rollout_miss_percentage_rollout_forbidden_variant_key",- "calls.rollout_miss_percentage_rollout_forbidden_holdout_id",- "calls.rollout_miss_experiment",- "calls.rollout_miss_experiment_missing_rule_type",- "calls.rollout_miss_experiment_missing_rule_id",- "calls.rollout_miss_experiment_missing_experiment_id",- "calls.rollout_miss_experiment_forbidden_variant_key",- "calls.rollout_miss_experiment_forbidden_holdout_id",- "calls.experiment_paused",- "calls.experiment_paused_missing_rule_type",- "calls.experiment_paused_missing_rule_id",- "calls.experiment_paused_missing_experiment_id",- "calls.experiment_paused_forbidden_variant_key",- "calls.experiment_paused_forbidden_holdout_id",- "calls.holdout",- "calls.holdout_missing_rule_type",- "calls.holdout_missing_rule_id",- "calls.holdout_missing_experiment_id",- "calls.holdout_missing_holdout_id",- "calls.holdout_forbidden_variant_key",- "calls.no_rule_match",- "calls.no_rule_match_forbidden_rule_type",- "calls.no_rule_match_forbidden_rule_id",- "calls.no_rule_match_forbidden_experiment_id",- "calls.no_rule_match_forbidden_variant_key",- "calls.no_rule_match_forbidden_holdout_id",- "calls.missing_group_key",- "calls.missing_group_key_forbidden_rule_type",- "calls.missing_group_key_forbidden_rule_id",- "calls.missing_group_key_forbidden_experiment_id",- "calls.missing_group_key_forbidden_variant_key",- "calls.missing_group_key_forbidden_holdout_id",- "calls.dependency_error",- "calls.dependency_error_forbidden_rule_type",- "calls.dependency_error_forbidden_rule_id",- "calls.dependency_error_forbidden_experiment_id",- "calls.dependency_error_forbidden_variant_key",- "calls.dependency_error_forbidden_holdout_id",- "calls.error",- "calls.error_forbidden_rule_type",- "calls.error_forbidden_rule_id",- "calls.error_forbidden_experiment_id",- "calls.error_forbidden_variant_key",- "calls.error_forbidden_holdout_id",- "calls.v1",- "calls.missing",- "calls.inactive",- "calls.v1_quick_win",- "calls.arm_b_equal_value",- "calls.string",- "calls.v2_forced_variant",- "calls.forbidden_value_number",- "calls.forbidden_value_object",- "calls.forbidden_value_array",- "calls.forbidden_value_null",- "calls.forbidden_value_empty_string",- "calls.partial_split_diagnostic",- "calls.inactive_forbidden_experiment_id",- "calls.missing_feature_flag",- "calls.missing_feature_flag_response",- "calls.unknown_field"- ]- },- {- "path": "fixtures/wire/exposures.json",- "kind": "fixture_set",- "version": "1.0.0",- "schema": "schemas/experiment_exposure_properties.schema.json",- "case_ids": [- "exposures.remote_split",- "exposures.local_split",- "exposures.arm_b_equal_value",- "exposures.successor_experiment",- "exposures.string",- "exposures.missing_feature_flag",- "exposures.wrong_type_feature_flag",- "exposures.missing_feature_flag_response",- "exposures.wrong_type_feature_flag_response",- "exposures.missing_feature_flag_config_version",- "exposures.wrong_type_feature_flag_config_version",- "exposures.missing_feature_flag_reason_code",- "exposures.wrong_type_feature_flag_reason_code",- "exposures.missing_feature_flag_variant",- "exposures.wrong_type_feature_flag_variant",- "exposures.missing_feature_flag_rule_id",- "exposures.wrong_type_feature_flag_rule_id",- "exposures.missing_feature_flag_rule_type",- "exposures.wrong_type_feature_flag_rule_type",- "exposures.missing_feature_flag_experiment_id",- "exposures.wrong_type_feature_flag_experiment_id",- "exposures.missing_experiment_exposure_source",- "exposures.wrong_type_experiment_exposure_source",- "exposures.missing_locally_evaluated",- "exposures.wrong_type_locally_evaluated",- "exposures.forbidden_outcome_holdout",- "exposures.forbidden_outcome_pause",- "exposures.forbidden_outcome_rollout_miss",- "exposures.forbidden_outcome_no_rule",- "exposures.forbidden_outcome_failed",- "exposures.forbidden_value_object",- "exposures.forbidden_value_array",- "exposures.forbidden_value_null",- "exposures.forbidden_value_empty_string",- "exposures.holdout_context",- "exposures.ingestion_source",- "exposures.v1_config",- "exposures.forced_variant_context",- "exposures.unknown_field"- ]+ "kind": "fixture_set"},{"path": "fixtures/wire/readers.json",- "kind": "fixture_set",- "version": "1.0.0",- "schema": "schemas/flags_response_v3.schema.json",- "case_ids": [- "readers.complete_split",- "readers.partial_split_missing_config_version",- "readers.partial_split_missing_rule_type",- "readers.partial_split_missing_rule_id",- "readers.partial_split_missing_experiment_id",- "readers.partial_split_missing_variant_key",- "readers.split_wrong_type_config_version",- "readers.split_wrong_type_rule_type",- "readers.split_wrong_type_rule_id",- "readers.split_wrong_type_experiment_id",- "readers.split_wrong_type_variant_key",- "readers.wrong_rule_type_literal",- "readers.unknown_fields",- "readers.old_server_variant",- "readers.old_server_boolean",- "readers.old_server_null_variant",- "readers.old_server_false",- "readers.v3_value_takes_precedence",- "readers.missing_flag",- "readers.targeting_match_targeted_release",- "readers.targeting_match_percentage_rollout",- "readers.rollout_miss_percentage_rollout",- "readers.rollout_miss_experiment",- "readers.experiment_paused",- "readers.holdout",- "readers.holdout_variant_key",- "readers.no_rule_match",- "readers.missing_group_key",- "readers.dependency_error",- "readers.error",- "readers.error_with_value",- "readers.malformed_sibling_isolation",- "readers.partial_split_string_value",- "readers.v1_at_v3",- "readers.v1_failed",- "readers.integral_json_number_context",- "readers.flag_key_seed"- ]- },- {- "path": "fixtures/wire/exposure_transport.json",- "kind": "fixture_set",- "version": "1.0.0",- "schema": "schemas/experiment_exposure_properties.schema.json",- "case_ids": [- "exposure_transport.exposure_with_transport",- "exposure_transport.nested_seed",- "exposure_transport.nested_holdout_seed",- "exposure_transport.holdout_context",- "exposure_transport.forced_variant_context",- "exposure_transport.group_type_named_seed"- ]- },- {- "path": "fixtures/wire/call_transport.json",- "kind": "fixture_set",- "version": "1.0.0",- "schema": "schemas/feature_flag_called_context.schema.json",- "case_ids": [- "call_transport.call_with_transport",- "call_transport.nested_assignment_seed",- "call_transport.prefixed_seed",- "call_transport.person_property_named_seed"- ]+ "kind": "fixture_set"},{"path": "schemas/v2_boolean_evaluation.schema.json",- "kind": "schema",- "version": "1.0.0"+ "kind": "schema"},{"path": "corpus/v2_boolean_evaluation.json",- "kind": "boolean_evaluation_corpus",- "version": "1.0.0",- "schema": "schemas/v2_boolean_evaluation.schema.json",- "component": "v2_boolean_evaluation",- "case_ids": [- "v2_boolean.empty.null",- "v2_boolean.empty.false",- "v2_boolean.empty.true",- "v2_boolean.target.false",- "v2_boolean.target.true",- "v2_boolean.order.false_claims",- "v2_boolean.order.reversed",- "v2_boolean.order.original_index",- "v2_boolean.miss.continue",- "v2_boolean.miss.continue_false_default",- "v2_boolean.miss.return_default",- "v2_boolean.miss.return_default_false_default",- "v2_boolean.miss.consecutive",- "v2_boolean.miss.exhausted",- "v2_boolean.order.percentage_false",- "v2_boolean.order.targeting_miss",- "v2_boolean.miss.targeting_miss_continues",- "v2_boolean.property.exact_case",- "v2_boolean.property.exact_scalar",- "v2_boolean.property.exact_false",- "v2_boolean.property.is_not",- "v2_boolean.property.contains",- "v2_boolean.property.not_contains",- "v2_boolean.property.starts",- "v2_boolean.property.not_starts",- "v2_boolean.property.ends",- "v2_boolean.property.not_ends",- "v2_boolean.property.contains_multi",- "v2_boolean.property.not_contains_multi",- "v2_boolean.property.greater",- "v2_boolean.property.greater_equal",- "v2_boolean.property.less",- "v2_boolean.property.less_equal",- "v2_boolean.property.regex",- "v2_boolean.property.not_regex",- "v2_boolean.property.not_regex_negated",- "v2_boolean.property.regex_search",- "v2_boolean.property.semver_eq",- "v2_boolean.property.semver_neq",- "v2_boolean.property.semver_gt",- "v2_boolean.property.semver_gte",- "v2_boolean.property.semver_lt",- "v2_boolean.property.semver_lte",- "v2_boolean.property.semver_tilde",- "v2_boolean.property.semver_caret",- "v2_boolean.property.semver_wildcard",- "v2_boolean.property.semver_bad_subject",- "v2_boolean.property.date_exact",- "v2_boolean.property.date_after",- "v2_boolean.property.date_before",- "v2_boolean.property.date_before_negated",- "v2_boolean.property.date_relative",- "v2_boolean.property.relative_unsigned",- "v2_boolean.property.relative_hours",- "v2_boolean.property.relative_weeks",- "v2_boolean.property.relative_year_leap_clamp",- "v2_boolean.property.relative_month_clamp",- "v2_boolean.property.date_epoch",- "v2_boolean.property.date_epoch_string",- "v2_boolean.property.date_bad_subject",- "v2_boolean.property.legacy_exact_setting",- "v2_boolean.property.timezone",- "v2_boolean.property.wall_clock_no_offset",- "v2_boolean.property.relative_dst",- "v2_boolean.property.date_exact_same_day_miss",- "v2_boolean.property.date_before_equal",- "v2_boolean.property.date_after_equal",- "v2_boolean.property.relative_dst_elapsed_miss",- "v2_boolean.property.relative_dst_fall",- "v2_boolean.property.relative_dst_overlap_earliest",- "v2_boolean.property.relative_dst_overlap_later_miss",- "v2_boolean.property.relative_dst_gap",- "v2_boolean.property.null_is_set",- "v2_boolean.property.missing_is_not_set",- "v2_boolean.property.null_is_not_set",- "v2_boolean.property.missing_exact",- "v2_boolean.property.missing_is_not",- "v2_boolean.property.negated_missing",- "v2_boolean.property.negation",- "v2_boolean.property.double_negative",- "v2_boolean.property.negated_match",- "v2_boolean.property.and",- "v2_boolean.property.and_miss",- "v2_boolean.context.partial_is_not",- "v2_boolean.context.partial_is_not_set",- "v2_boolean.context.partial_exact",- "v2_boolean.context.unavailable",- "v2_boolean.context.unneeded",- "v2_boolean.context.partial_present",- "v2_boolean.context.false_before_missing",- "v2_boolean.context.missing_before_false",- "v2_boolean.error.invalid_regex_false",- "v2_boolean.error.invalid_regex_true",- "v2_boolean.error.numeric",- "v2_boolean.error.false_short_circuits",- "v2_boolean.error.terminal_short_circuits",- "v2_boolean.hash.ascii",- "v2_boolean.hash.seed_parity",- "v2_boolean.hash.empty",- "v2_boolean.hash.empty_return_default",- "v2_boolean.hash.ascii_200",- "v2_boolean.hash.ascii_201",- "v2_boolean.hash.multibyte_200",- "v2_boolean.hash.multibyte_201",- "v2_boolean.hash.supplementary_200",- "v2_boolean.hash.supplementary_201",- "v2_boolean.hash.composed",- "v2_boolean.hash.decomposed",- "v2_boolean.hash.zero",- "v2_boolean.hash.full",- "v2_boolean.hash.empty_full",- "v2_boolean.hash.partial",- "v2_boolean.hash.fraction",- "v2_boolean.hash.seed_changed",- "v2_boolean.hash.subject_changed",- "v2_boolean.hash.renamed",- "v2_boolean.hash.moved",- "v2_boolean.property.long_value",- "v2_boolean.threshold.p0_equal",- "v2_boolean.threshold.p0_above",- "v2_boolean.threshold.p33_33_equal",- "v2_boolean.threshold.p33_33_below",- "v2_boolean.threshold.p33_33_above",- "v2_boolean.threshold.p50_equal",- "v2_boolean.threshold.p50_below",- "v2_boolean.threshold.p50_above",- "v2_boolean.threshold.p100_equal",- "v2_boolean.threshold.p100_below",- "v2_boolean.eligibility.inactive",- "v2_boolean.eligibility.deleted",- "v2_boolean.eligibility.request_filtered",- "v2_boolean.parser.malformed",- "v2_boolean.parser.unsupported",- "v2_boolean.error.invalid_not_regex_negated",- "v2_boolean.target.empty_identifier"- ]+ "kind": "boolean_evaluation_corpus"},{"path": "schemas/v2_value_evaluation.schema.json",- "kind": "schema",- "version": "1.0.0"+ "kind": "schema"},{"path": "corpus/v2_value_evaluation.json",- "kind": "value_evaluation_corpus",- "version": "1.0.0",- "schema": "schemas/v2_value_evaluation.schema.json",- "component": "v2_value_evaluation",- "case_ids": [- "v2_value.string.target",- "v2_value.string.rollout_hit",- "v2_value.string.miss_return_default",- "v2_value.string.miss_return_default_null",- "v2_value.string.miss_continue",- "v2_value.string.no_match_default",- "v2_value.string.no_match_null",- "v2_value.string.order_first_match",- "v2_value.string.order_targeting_miss",- "v2_value.number.target",- "v2_value.number.rollout_hit",- "v2_value.number.miss_return_default",- "v2_value.number.miss_return_default_null",- "v2_value.number.miss_continue",- "v2_value.number.no_match_default",- "v2_value.number.no_match_null",- "v2_value.number.order_first_match",- "v2_value.number.order_targeting_miss",- "v2_value.object.target",- "v2_value.object.rollout_hit",- "v2_value.object.miss_return_default",- "v2_value.object.miss_return_default_null",- "v2_value.object.miss_continue",- "v2_value.object.no_match_default",- "v2_value.object.no_match_null",- "v2_value.object.order_first_match",- "v2_value.object.order_targeting_miss",- "v2_value.string.unicode",- "v2_value.string.looks_boolean",- "v2_value.number.zero",- "v2_value.number.negative_decimal",- "v2_value.number.short_decimal",- "v2_value.number.exponent",- "v2_value.number.max_safe_integer",- "v2_value.number.min_safe_integer",- "v2_value.object.empty",- "v2_value.object.nested",- "v2_value.object.max_depth",- "v2_value.parser.string_empty_value",- "v2_value.parser.string_empty_default",- "v2_value.parser.string_value_mismatch",- "v2_value.parser.number_value_mismatch",- "v2_value.parser.number_default_mismatch",- "v2_value.parser.number_above_safe_integer",- "v2_value.parser.number_below_safe_integer",- "v2_value.parser.object_array_value",- "v2_value.parser.object_default_mismatch",- "v2_value.parser.object_too_deep",- "v2_value.parser.object_nested_number_above_safe_integer"- ]+ "kind": "value_evaluation_corpus"+ },+ {+ "path": "schemas/v2_experiment_evaluation.schema.json",+ "kind": "schema"+ },+ {+ "path": "corpus/v2_experiment_evaluation.json",+ "kind": "experiment_evaluation_corpus"}- ],- "wire_contract": {- "version": "1.0.1",- "fixture_version": "1.0.0",- "published_versions_are_immutable": true,- "producer_schema_sha256": "98c1397bb7b5a1ceb3f317b34c6c57cff0ab30e94bf5945ee7b56f293536b70f",- "fixture_encoding": "Each case deep-copies its named template, removes the listed existing JSON Pointer members, then sets members by JSON Pointer. Set requires an existing parent. Templates and expectations are JSON, not executable SDK suites.",- "compatibility": "New artifacts are additive to contract 1.2.0. Published schema bytes and fixture expectations are immutable. Accepted/rejected wire-contract changes require a new major wire component version; additive cases require a new minor fixture version. Reader expectations never relax producer validation."- },- "v2_boolean_evaluation": {- "version": "1.0.0",- "config_version_locked": 2,- "published_versions_are_immutable": true- },- "v2_value_evaluation": {- "version": "1.0.0",- "config_version_locked": 2,- "published_versions_are_immutable": true- }+ ]}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/registries/literals.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/registries/literals.jsonindex ed8065689791..097bc7fd8a57 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/registries/literals.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/registries/literals.json@@ -1,5 +1,4 @@{- "registry_version": "2.0.0","config_versions": {"v1": 1,"v2": 2,@@ -15,7 +14,6 @@"default_value","description","exclusion_percentage",- "experiment_id","group_key_names","group_type_index","holdout",@@ -146,7 +144,7 @@"experiment_split": {"reason": "SPLIT","error_code": null,- "note": "Experiment identity is in flag metadata."+ "note": "The rule ID and variant key are in flag metadata."},"rollout_miss": {"reason": "DEFAULT",@@ -231,9 +229,7 @@"config_version","rule_type","rule_id",- "experiment_id","variant_key",- "holdout_id","id","version","reason_code",diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/config.schema.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/config.schema.jsonindex f44d12f0c44a..e1b7335ecfa4 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/config.schema.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/config.schema.json@@ -365,14 +365,10 @@"holdout": {"type": "object","required": [- "id","seed","exclusion_percentage"],"properties": {- "id": {- "type": "integer"- },"seed": {"$ref": "#/$defs/seed"},@@ -466,7 +462,6 @@"id","rule_type","targeting",- "experiment_id","paused","rollout_percentage","on_rollout_miss",@@ -490,9 +485,6 @@"metadata": {"$ref": "#/$defs/metadata"},- "experiment_id": {- "type": "integer"- },"paused": {"type": "boolean"},diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/flags_response_v3.schema.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/flags_response_v3.schema.jsonindex f0a17b035fc0..c9dc6732985f 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/flags_response_v3.schema.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/flags_response_v3.schema.json@@ -23,7 +23,7 @@"not": {"anyOf": [{ "required": ["rule_type"] }, { "required": ["rule_id"] }, { "required": ["experiment_id"] },- { "required": ["variant_key"] }, { "required": ["holdout_id"] }+ { "required": ["variant_key"] }]}},@@ -71,7 +71,6 @@"rule_id": { "type": "string", "format": "uuid" },"experiment_id": { "type": "integer" },"variant_key": { "type": "string" },- "holdout_id": { "type": "integer" },"forced_variant": { "const": true }}},@@ -80,7 +79,10 @@"then": {"properties": {"reason": { "properties": { "code": { "$ref": "#/$defs/v2_reason_code" } } },- "metadata": { "properties": { "payload": { "type": "null" } }, "not": { "required": ["forced_variant"] } }+ "metadata": {+ "properties": { "payload": { "type": "null" } },+ "not": { "anyOf": [{ "required": ["forced_variant"] }, { "required": ["experiment_id"] }] }+ }},"allOf": [{@@ -108,9 +110,8 @@"then": {"properties": {"metadata": {- "required": ["rule_type", "rule_id", "experiment_id", "variant_key"],- "properties": { "rule_type": { "const": "experiment" }, "config_version": { "const": 2 } },- "not": { "required": ["holdout_id"] }+ "required": ["rule_type", "rule_id", "variant_key"],+ "properties": { "rule_type": { "const": "experiment" }, "config_version": { "const": 2 } }}}}diff --git a/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/flags_response_v3_presence.schema.json b/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/flags_response_v3_presence.schema.jsonindex fd8e0573939a..e4fc07711e6c 100644--- a/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/flags_response_v3_presence.schema.json+++ b/rust/feature-flags/tests/fixtures/rules_v2_contract/schemas/flags_response_v3_presence.schema.json@@ -70,11 +70,6 @@"required": ["variant_key"]- },- {- "required": [- "holdout_id"- ]}]},@@ -129,11 +124,6 @@"required": ["variant_key"]- },- {- "required": [- "holdout_id"- ]}]},@@ -176,14 +166,13 @@"has_experiment","rule_type","rule_id",- "experiment_id","variant_key"],"not": {"anyOf": [{"required": [- "holdout_id"+ "experiment_id"]}]@@ -239,11 +228,6 @@"required": ["variant_key"]- },- {- "required": [- "holdout_id"- ]}]},@@ -277,19 +261,18 @@"required": ["has_experiment","rule_type",- "rule_id",- "experiment_id"+ "rule_id"],"not": {"anyOf": [{"required": [- "variant_key"+ "experiment_id"]},{"required": [- "holdout_id"+ "variant_key"]}]@@ -324,19 +307,18 @@"required": ["has_experiment","rule_type",- "rule_id",- "experiment_id"+ "rule_id"],"not": {"anyOf": [{"required": [- "variant_key"+ "experiment_id"]},{"required": [- "holdout_id"+ "variant_key"]}]@@ -371,12 +353,15 @@"required": ["has_experiment","rule_type",- "rule_id",- "experiment_id",- "holdout_id"+ "rule_id"],"not": {"anyOf": [+ {+ "required": [+ "experiment_id"+ ]+ },{"required": ["variant_key"@@ -434,11 +419,6 @@"required": ["variant_key"]- },- {- "required": [- "holdout_id"- ]}]}@@ -487,11 +467,6 @@"required": ["variant_key"]- },- {- "required": [- "holdout_id"- ]}]}@@ -540,11 +515,6 @@"required": ["variant_key"]- },- {- "required": [- "holdout_id"- ]}]}@@ -591,11 +561,6 @@"required": ["variant_key"]- },- {- "required": [- "holdout_id"- ]}]}@@ -626,11 +591,6 @@"required": ["rule_id"]- },- {- "required": [- "holdout_id"- ]}]},diff --git a/rust/feature-flags/tests/test_config_format.rs b/rust/feature-flags/tests/test_config_format.rsindex 4b3b63174611..87eeabf5222f 100644--- a/rust/feature-flags/tests/test_config_format.rs+++ b/rust/feature-flags/tests/test_config_format.rs@@ -40,10 +40,7 @@ fn documents() -> Vec<(String, Value, bool, bool)> {near_one["version"] = json!("__below_one__");cases.push(("rejected-below-one".to_string(), near_one, true, false));let mut unsupported = supported.clone();- unsupported["rules"]- .as_array_mut()- .unwrap()- .push(json!({"rule_type": "experiment"}));+ unsupported["aggregation_group_type_index"] = json!(0);cases.push(("rejected-unsupported-v2".to_string(),unsupported,diff --git a/rust/feature-flags/tests/test_config_v2.rs b/rust/feature-flags/tests/test_config_v2.rsindex 70180eed3829..3ebaaa2fdbac 100644--- a/rust/feature-flags/tests/test_config_v2.rs+++ b/rust/feature-flags/tests/test_config_v2.rs@@ -1,7 +1,7 @@use std::sync::Arc;use feature_flags::flags::config_v2::{- Config, Outcome, ParseError, RolloutMiss, MAX_CONFIG_BYTES, MAX_OBJECT_DEPTH,+ Config, Outcome, ParseError, RolloutMiss, MAX_CONFIG_BYTES, MAX_OBJECT_DEPTH, MAX_VARIANTS,};use feature_flags::flags::feature_flag_list::PreparedFlags;use feature_flags::flags::flag_models::{@@ -590,15 +590,6 @@ fn unsupported_members_reject_the_whole_flag_and_debug_redacts_config() {result(&read(document)).as_ref().unwrap_err(),&ParseError::Unsupported("aggregation_group_type_index"));- let mut document = config();- document["rules"]- .as_array_mut()- .unwrap()- .push(json!({"rule_type": "experiment", "holdout": {"seed": "private-holdout"}}));- assert_eq!(- result(&read(document)).as_ref().unwrap_err(),- &ParseError::Unsupported("rule_type")- );for version in [json!(2), json!(3), json!("private-version")] {let mut document = config();document["version"] = version;@@ -693,3 +684,261 @@ fn preparation_reuses_parsing_and_accounts_for_raw_and_typed_data() {let weighted = prepared(flag).estimated_size_bytes();assert!(weighted > document.to_string().len() + 2000 * std::mem::size_of::<Value>());}++fn experiment() -> Value {+ json!({+ "version": 2, "return_type": "string", "default_value": "standard",+ "rules": [{+ "id": "11111111-1111-4111-8111-111111111111", "rule_type": "experiment",+ "targeting": {"properties": []}, "paused": false,+ "rollout_percentage": 80.5, "on_rollout_miss": "return_default",+ "assignment_algorithm": "sha1_60_v1", "seed": "example-seed", "assign_by": "person",+ "variants": [+ {"key": "control", "weight": 33.33, "value": "standard"},+ {"key": "test", "weight": 33.33, "value": "compact"},+ {"key": "test-copy", "weight": 33.34, "value": "compact"}+ ],+ "holdout": {"seed": "example-holdout", "exclusion_percentage": 10.25}+ }]+ })+}++#[test]+fn experiment_rules_parse_into_a_weighted_split() {+ let document = experiment();+ let flag = read(document.clone());+ let parsed = result(&flag).as_ref().unwrap();+ let Outcome::Experiment {+ paused,+ rollout_percentage,+ on_rollout_miss,+ seed,+ variants,+ holdout,+ } = &parsed.rules[0].outcome+ else {+ panic!("unexpected outcome {:?}", parsed.rules[0].outcome);+ };+ assert!(!paused);+ assert_eq!(*rollout_percentage, 80.5);+ assert_eq!(*on_rollout_miss, RolloutMiss::ReturnDefault);+ assert_eq!(seed, "example-seed");+ let summary: Vec<_> = variants+ .iter()+ .map(|v| (v.key.as_str(), v.weight, v.value.clone()))+ .collect();+ assert_eq!(+ summary,+ [+ ("control", 33.33, json!("standard")),+ ("test", 33.33, json!("compact")),+ ("test-copy", 33.34, json!("compact"))+ ]+ );+ let holdout = holdout.as_ref().unwrap();+ assert_eq!(+ (holdout.seed.as_str(), holdout.exclusion_percentage),+ ("example-holdout", 10.25)+ );+ assert_eq!(serde_json::to_value(&flag).unwrap()["filters"], document);+ let debug = format!("{:?}", parsed.rules);+ assert!(+ !debug.contains("example-") && !debug.contains("compact"),+ "{debug}"+ );++ let mut without_holdout = experiment();+ let rule = without_holdout["rules"][0].as_object_mut().unwrap();+ rule.remove("holdout");+ rule.remove("assign_by");+ assert!(result(&read(without_holdout)).is_ok());++ // `weight` and percentages inside values and metadata are not contract percentages.+ let mut nested = experiment();+ nested["return_type"] = json!("object");+ nested["default_value"] = json!({"weight": 0.125});+ for (index, variant) in nested["rules"][0]["variants"]+ .as_array_mut()+ .unwrap()+ .iter_mut()+ .enumerate()+ {+ variant["value"] = json!({"weight": 0.001, "rank": index});+ }+ nested["rules"][0]["metadata"] = json!({"exclusion_percentage": 0.001});+ assert!(result(&read(nested)).is_ok());+}++#[test]+fn experiment_rule_contract_violations_reject_the_whole_flag() {+ let cases: Vec<(&str, Value, ParseError)> = vec![+ (+ "/rules/0/experiment_id",+ json!(42),+ ParseError::Malformed("rule"),+ ),+ (+ "/rules/0/paused",+ json!("false"),+ ParseError::Malformed("paused"),+ ),+ (+ "/rules/0/holdout/id",+ json!(7),+ ParseError::Malformed("holdout"),+ ),+ (+ "/rules/0/holdout/id",+ Value::Null,+ ParseError::Malformed("holdout"),+ ),+ (+ "/rules/0/holdout/seed",+ json!(""),+ ParseError::Malformed("seed"),+ ),+ (+ "/rules/0/holdout/exclusion_percentage",+ json!(100.5),+ ParseError::Malformed("exclusion_percentage"),+ ),+ (+ "/rules/0/holdout/exclusion_percentage",+ json!(5.555),+ ParseError::Malformed("exclusion_percentage"),+ ),+ (+ "/rules/0/variants/1/key",+ json!("control"),+ ParseError::Malformed("variant.key"),+ ),+ (+ "/rules/0/variants/1/key",+ json!("test.v2"),+ ParseError::Malformed("variant.key"),+ ),+ (+ "/rules/0/variants/1/key",+ json!(""),+ ParseError::Malformed("variant.key"),+ ),+ (+ "/rules/0/variants/1/weight",+ json!(33.32),+ ParseError::Malformed("variants"),+ ),+ (+ "/rules/0/variants/1/weight",+ json!(33.34),+ ParseError::Malformed("variants"),+ ),+ (+ "/rules/0/variants/1/weight",+ json!(33.333),+ ParseError::Malformed("weight"),+ ),+ (+ "/rules/0/variants/1/weight",+ json!(-1),+ ParseError::Malformed("weight"),+ ),+ (+ "/rules/0/variants/1/value",+ json!(true),+ ParseError::Malformed("value"),+ ),+ (+ "/rules/0/variants/1/value",+ Value::Null,+ ParseError::Malformed("value"),+ ),+ (+ "/rules/0/variants/1/value",+ json!(""),+ ParseError::Malformed("value"),+ ),+ (+ "/rules/0/variants/1/label",+ json!("x"),+ ParseError::Malformed("variant"),+ ),+ (+ "/rules/0/holdout/name",+ json!("x"),+ ParseError::Malformed("holdout"),+ ),+ (+ "/rules/0/value",+ json!("compact"),+ ParseError::Malformed("rule"),+ ),+ (+ "/rules/0/variants",+ json!([{"key": "control", "weight": 100, "value": "standard"}]),+ ParseError::Malformed("variants"),+ ),+ ];+ for (pointer, value, expected) in cases {+ let mut document = experiment();+ let (parent, key) = pointer.rsplit_once('/').unwrap();+ document+ .pointer_mut(parent)+ .unwrap()+ .as_object_mut()+ .unwrap()+ .insert(key.to_owned(), value.clone());+ let flag = read(document.clone());+ assert_eq!(+ result(&flag).as_ref().unwrap_err(),+ &expected,+ "{pointer} = {value}"+ );+ assert_eq!(serde_json::to_value(&flag).unwrap()["filters"], document);+ }+ for (pointer, expected) in [+ ("/rules/0/paused", ParseError::Malformed("paused")),+ ("/rules/0/variants", ParseError::Malformed("variants")),+ ("/rules/0/holdout/seed", ParseError::Malformed("seed")),+ ] {+ let mut document = experiment();+ let (parent, key) = pointer.rsplit_once('/').unwrap();+ document+ .pointer_mut(parent)+ .unwrap()+ .as_object_mut()+ .unwrap()+ .remove(key);+ assert_eq!(+ result(&read(document)).as_ref().unwrap_err(),+ &expected,+ "{pointer}"+ );+ }+ let mut document = experiment();+ document["rules"][0]["variants"] = json!((0..=MAX_VARIANTS)+ .map(|i| json!({"key": format!("arm_{i}"), "weight": 5, "value": "standard"}))+ .collect::<Vec<_>>());+ assert_eq!(+ result(&read(document)).as_ref().unwrap_err(),+ &ParseError::LimitExceeded("variants")+ );+ // Hundredths are summed exactly: these weights total 100, but their binary64 sum is+ // 100.00000000000001.+ let mut document = experiment();+ document["rules"][0]["variants"] = json!([+ {"key": "a", "weight": 0.01, "value": "standard"},+ {"key": "b", "weight": 65.4, "value": "standard"},+ {"key": "c", "weight": 34.59, "value": "standard"}+ ]);+ assert!(result(&read(document)).is_ok());+ let mut document = experiment();+ document["rules"][0]["variants"] = json!([+ {"key": "a", "weight": 33.33, "value": "standard"},+ {"key": "b", "weight": 33.33, "value": "standard"},+ {"key": "c", "weight": 33.33, "value": "standard"}+ ]);+ assert_eq!(+ result(&read(document)).as_ref().unwrap_err(),+ &ParseError::Malformed("variants")+ );+}diff --git a/rust/feature-flags/tests/test_config_v2/fixtures.rs b/rust/feature-flags/tests/test_config_v2/fixtures.rsindex abd6cbace43d..5427a5285d7c 100644--- a/rust/feature-flags/tests/test_config_v2/fixtures.rs+++ b/rust/feature-flags/tests/test_config_v2/fixtures.rs@@ -5,8 +5,9 @@ use serde_json::{json, Value};use super::{config, person_property_cases, read, result};use feature_flags::flags::config_v2::{- ParseError, CONFIG_FIELDS, MAX_PREDICATES, MAX_RULES, MAX_SEED_LENGTH,- PERCENTAGE_ROLLOUT_FIELDS, PROPERTY_FIELDS, TARGETED_RELEASE_FIELDS, TARGETING_FIELDS,+ ParseError, CONFIG_FIELDS, EXPERIMENT_FIELDS, HOLDOUT_FIELDS, MAX_PREDICATES, MAX_RULES,+ MAX_SEED_LENGTH, MAX_VARIANTS, MIN_VARIANTS, PERCENTAGE_ROLLOUT_FIELDS, PROPERTY_FIELDS,+ TARGETED_RELEASE_FIELDS, TARGETING_FIELDS, VARIANT_FIELDS,};use feature_flags::flags::flag_models::FeatureFlag;@@ -26,6 +27,7 @@ fn released_config_cases_distinguish_schema_expectations_from_supported_familiessupported: usize,valid_but_unsupported: usize,malformed: usize,+ limit_exceeded: usize,unsupported: usize,rejected_before_parsing: usize,}@@ -40,11 +42,13 @@ fn released_config_cases_distinguish_schema_expectations_from_supported_familieslet parsed = flag.filters.non_v1.as_ref().unwrap().parsed_v2.as_ref();if fixture["expected"] == "valid" {if [+ "boolean_all_rule_types.json","version_float_literal.json","boolean_targeted_and_percentage_rollout.json","reserved_number_value.json","reserved_object_value.json","object_value_max_depth.json",+ "experiment_rule_local_holdout.json",].iter().any(|name| path.ends_with(name))@@ -72,17 +76,20 @@ fn released_config_cases_distinguish_schema_expectations_from_supported_families"{path}");match expected {- Some(ParseError::Malformed(_)) => {- totals.malformed += 1;- let repaired = repair_supported_fixture(&name, document.clone());- assert!(- result(&read(repaired)).is_ok(),- "repair must make {path} supported"- );- }+ Some(ParseError::Malformed(_)) => totals.malformed += 1,+ Some(ParseError::LimitExceeded(_)) => totals.limit_exceeded += 1,Some(ParseError::Unsupported(_)) => totals.unsupported += 1,None => totals.rejected_before_parsing += 1,- other => panic!("unexpected fixture classification: {other:?}"),+ }+ if matches!(+ expected,+ Some(ParseError::Malformed(_) | ParseError::LimitExceeded(_))+ ) {+ let repaired = repair_supported_fixture(&name, document.clone());+ assert!(+ result(&read(repaired)).is_ok(),+ "repair must make {path} supported"+ );}}assert_eq!(@@ -94,31 +101,40 @@ fn released_config_cases_distinguish_schema_expectations_from_supported_familiesassert_eq!(totals,Totals {- supported: 5,- valid_but_unsupported: 3,- malformed: 20,- unsupported: 9,+ supported: 7,+ valid_but_unsupported: 2,+ malformed: 27,+ limit_exceeded: 1,+ unsupported: 2,rejected_before_parsing: 3,});}fn invalid_fixture_error(name: &str) -> Option<ParseError> {- use ParseError::{Malformed, Unsupported};+ use ParseError::{LimitExceeded, Malformed, Unsupported};Some(match name {"assign_by_not_person" => Malformed("assign_by"),"default_value_type_mismatch" => Malformed("default_value"),- "empty_seed" | "missing_rollout_seed" => Malformed("seed"),+ "empty_seed" | "missing_rollout_seed" | "seed_too_long" => Malformed("seed"),"missing_on_rollout_miss" => Malformed("on_rollout_miss"),+ "missing_experiment_paused" => Malformed("paused"),"non_uuid_rule_id" => Malformed("rule.id"),"null_rule_value"| "return_value_type_mismatch"| "empty_string_value"- | "object_value_too_deep" => Malformed("value"),+ | "object_value_too_deep"+ | "variant_value_type_mismatch" => Malformed("value"),"rollout_percentage_above_maximum" | "rollout_percentage_below_minimum" => {Malformed("rollout_percentage")}- "targeted_release_with_rollout_fields" | "unknown_rule_field" => Malformed("rule"),+ "targeted_release_with_rollout_fields"+ | "unknown_rule_field"+ | "experiment_rule_with_experiment_id" => Malformed("rule"),+ "holdout_with_id" => Malformed("holdout"),+ "too_few_variants" => Malformed("variants"),+ "too_many_variants" => LimitExceeded("variants"),+ "variant_key_invalid_characters" => Malformed("variant.key"),"unknown_assignment_algorithm" => Malformed("assignment_algorithm"),"unknown_config_field" => Malformed("filters"),"unknown_property_field" => Malformed("property"),@@ -128,13 +144,6 @@ fn invalid_fixture_error(name: &str) -> Option<ParseError> {"group_experiment_with_assign_by" | "group_percentage_rollout_with_assign_by" => {Unsupported("aggregation_group_type_index")}- "missing_experiment_paused"- | "null_experiment_id"- | "seed_too_long"- | "too_few_variants"- | "too_many_variants"- | "variant_key_invalid_characters"- | "variant_value_type_mismatch" => Unsupported("rule_type"),"unknown_config_version" | "version_boolean" | "version_string" => return None,_ => panic!("unclassified released fixture: {name}"),})@@ -144,9 +153,36 @@ fn repair_supported_fixture(name: &str, mut document: Value) -> Value {match name {"assign_by_not_person" => document["rules"][0]["assign_by"] = json!("person"),"default_value_type_mismatch" => document["default_value"] = json!(false),- "empty_seed" | "missing_rollout_seed" => {+ "empty_seed" | "missing_rollout_seed" | "seed_too_long" => {document["rules"][0]["seed"] = json!("example-seed")}+ "missing_experiment_paused" => document["rules"][0]["paused"] = json!(false),+ "variant_value_type_mismatch" => {+ document["rules"][0]["variants"][0]["value"] = json!(false)+ }+ "variant_key_invalid_characters" => {+ document["rules"][0]["variants"][0]["key"] = json!("control")+ }+ "too_few_variants" => document["rules"][0]["variants"]+ .as_array_mut()+ .unwrap()+ .push(json!({"key": "test", "weight": 0, "value": true})),+ "too_many_variants" => document["rules"][0]["variants"]+ .as_array_mut()+ .unwrap()+ .truncate(MAX_VARIANTS),+ "experiment_rule_with_experiment_id" => {+ document["rules"][0]+ .as_object_mut()+ .unwrap()+ .remove("experiment_id");+ }+ "holdout_with_id" => {+ document["rules"][0]["holdout"]+ .as_object_mut()+ .unwrap()+ .remove("id");+ }"missing_on_rollout_miss" | "unknown_rollout_miss_policy" => {document["rules"][0]["on_rollout_miss"] = json!("continue")}@@ -230,10 +266,7 @@ fn definitions_filters_use_the_same_parser_without_replacing_the_service_envelopif case["expected"] == "valid" {let flag = decoded.unwrap();if case["template"] == "v2" {- assert!(matches!(- result(&flag),- Err(ParseError::Unsupported("rule_type"))- ))+ assert!(result(&flag).is_ok(), "{}", case["id"]);} else {assert!(flag.filters.non_v1.is_none());}@@ -312,6 +345,9 @@ fn released_schema_and_registry_match_the_parser_contract() {"/$defs/percentageRolloutRule/properties",PERCENTAGE_ROLLOUT_FIELDS,),+ ("/$defs/experimentRule/properties", EXPERIMENT_FIELDS),+ ("/$defs/variant/properties", VARIANT_FIELDS),+ ("/$defs/holdout/properties", HOLDOUT_FIELDS),("/$defs/targeting/properties", TARGETING_FIELDS),("/$defs/propertyFilter/properties", PROPERTY_FIELDS),] {@@ -343,6 +379,14 @@ fn released_schema_and_registry_match_the_parser_contract() {MAX_SEED_LENGTH,schema["$defs"]["seed"]["maxLength"].as_u64().unwrap() as usize);+ let variants = &schema["$defs"]["experimentRule"]["properties"]["variants"];+ assert_eq!(+ (MIN_VARIANTS, MAX_VARIANTS),+ (+ variants["minItems"].as_u64().unwrap() as usize,+ variants["maxItems"].as_u64().unwrap() as usize+ )+ );let entries = load("schemas/definitions_entry.schema.json");assert_eq!(@@ -380,20 +424,22 @@ fn released_schema_and_registry_match_the_parser_contract() {for entry in registry["rule_types"].as_array().unwrap() {let mut document = config();document["rules"][0]["rule_type"] = entry["value"].clone();- if entry["value"] == "targeted_release" {- document["rules"][0]- .as_object_mut()- .unwrap()- .retain(|key, _| TARGETED_RELEASE_FIELDS.contains(&key.as_str()));- }- let flag = read(document);+ let rule = document["rules"][0].as_object_mut().unwrap();match entry["value"].as_str().unwrap() {- "targeted_release" | "percentage_rollout" => assert!(result(&flag).is_ok()),- _ => assert_eq!(- result(&flag).as_ref().unwrap_err(),- &ParseError::Unsupported("rule_type")- ),+ "targeted_release" => {+ rule.retain(|key, _| TARGETED_RELEASE_FIELDS.contains(&key.as_str()))+ }+ "experiment" => {+ rule.remove("value");+ rule.insert("paused".to_owned(), json!(false));+ rule.insert(+ "variants".to_owned(),+ json!([{"key": "control", "weight": 50, "value": false}, {"key": "test", "weight": 50, "value": true}]),+ );+ }+ _ => {}}+ assert!(result(&read(document)).is_ok(), "{entry}");}for (registry_field, rule_field) in [("assignment_algorithms", "assignment_algorithm"),diff --git a/rust/feature-flags/tests/test_flags_v3.rs b/rust/feature-flags/tests/test_flags_v3.rsindex f6e2cd157f5c..30345116cf7e 100644--- a/rust/feature-flags/tests/test_flags_v3.rs+++ b/rust/feature-flags/tests/test_flags_v3.rs@@ -455,67 +455,103 @@ async fn v3_and_above_serve_the_v2_record_while_the_setting_is_off() -> Result<(Ok(())}-#[tokio::test]-async fn v3_carries_every_typed_corpus_value_through_the_request_path() -> Result<()> {- let cases: Vec<_> = corpus::value_cases()+/// Serves the success cases and checks their v3 and v2 records. Each identifier gets its own+/// server, because the experiment corpus picks identifiers per outcome. Returns the cases checked.+async fn check_on_the_wire(cases: Vec<Value>) -> Result<usize> {+ let cases: Vec<_> = cases.into_iter().filter(|case| case["expected"]["status"] == "success").collect();- assert_eq!(cases.len(), 38);- let context = &cases[0]["context"];- assert!(cases.iter().all(|case| &case["context"] == context));- let distinct_id = context["identifier"].as_str().unwrap();- let flags = cases+ let mut identifiers: Vec<&str> = cases.iter()- .zip(100..)- .map(|(case, id)| corpus_flag(case, id));- let (server, token) = serve(- true,- distinct_id,- context["properties"].clone(),- flags.collect(),- )- .await?;- let body = json!({"token": token, "distinct_id": distinct_id});- let v3 = post(&server, "v=3&config=false", &[], body.clone()).await?;- wire::validate_v3(&v3).unwrap_or_else(|error| panic!("{error:?}"));- let v2 = post(&server, "v=2&config=false", &[], body).await?;+ .map(|case| case["context"]["identifier"].as_str().unwrap())+ .collect();+ identifiers.sort_unstable();+ identifiers.dedup();let decoded = |payload: &Value| {payload.as_str().map_or(Value::Null, |p| serde_json::from_str(p).unwrap())};+ let mut checked = 0;+ // Requests require a distinct ID; the empty-identifier rows run below the request path.+ for distinct_id in identifiers.into_iter().filter(|id| !id.is_empty()) {+ let group: Vec<_> = cases+ .iter()+ .filter(|case| case["context"]["identifier"] == distinct_id)+ .collect();+ let flags = group+ .iter()+ .zip(100..)+ .map(|(case, id)| corpus_flag(case, id));+ let (server, token) = serve(+ true,+ distinct_id,+ group[0]["context"]["properties"].clone(),+ flags.collect(),+ )+ .await?;+ let body = json!({"token": token, "distinct_id": distinct_id});+ let v3 = post(&server, "v=3&config=false", &[], body.clone()).await?;+ wire::validate_v3(&v3).unwrap_or_else(|error| panic!("{error:?}"));+ let v2 = post(&server, "v=2&config=false", &[], body).await?;+ for case in group {+ let key = case["id"].as_str().unwrap();+ let (expected, legacy) = (&case["expected"], &case["legacy"]);+ let record = &v3["flags"][key];+ assert_eq!(record["value"], expected["value"], "{key}");+ assert_eq!(record["reason"]["code"], expected["reason"], "{key}");+ assert_eq!(+ record["reason"]["condition_index"], expected["rule"]["index"],+ "{key}"+ );+ assert_eq!(+ record["metadata"].get("rule_type"),+ expected["rule"].get("rule_type"),+ "{key}"+ );+ assert_eq!(+ record["metadata"].get("rule_id"),+ expected["rule"].get("id"),+ "{key}"+ );+ assert_eq!(+ record["metadata"].get("variant_key"),+ expected.get("variant"),+ "{key}"+ );+ assert_eq!(record["metadata"]["payload"], Value::Null, "{key}");+ assert_eq!(record["metadata"]["has_experiment"], false, "{key}");+ for field in ["experiment_id", "holdout_id"] {+ assert_eq!(record["metadata"].get(field), None, "{key}");+ }+ let v2_record = &v2["flags"][key];+ assert_eq!(v2_record["enabled"], legacy["enabled"], "{key}");+ assert_eq!(v2_record["variant"], legacy["variant"], "{key}");+ assert_eq!(+ decoded(&v2_record["metadata"]["payload"]),+ legacy["payload"],+ "{key}"+ );+ checked += 1;+ }+ }+ Ok(checked)+}- for case in &cases {- let key = case["id"].as_str().unwrap();- let (expected, legacy) = (&case["expected"], &case["legacy"]);- let record = &v3["flags"][key];- assert_eq!(record["value"], expected["value"], "{key}");- assert_eq!(record["reason"]["code"], expected["reason"], "{key}");- assert_eq!(- record["reason"]["condition_index"], expected["rule"]["index"],- "{key}"- );- assert_eq!(- record["metadata"].get("rule_id"),- expected["rule"].get("id"),- "{key}"- );- assert_eq!(- record["metadata"].get("rule_type"),- expected["rule"].get("rule_type"),- "{key}"- );- assert_eq!(record["metadata"]["payload"], Value::Null, "{key}");+#[tokio::test]+async fn v3_carries_every_typed_corpus_value_through_the_request_path() -> Result<()> {+ assert_eq!(check_on_the_wire(corpus::value_cases()).await?, 38);+ Ok(())+}- let v2_record = &v2["flags"][key];- assert_eq!(v2_record["enabled"], legacy["enabled"], "{key}");- assert_eq!(v2_record["variant"], legacy["variant"], "{key}");- assert_eq!(- decoded(&v2_record["metadata"]["payload"]),- legacy["payload"],- "{key}"- );- }+#[tokio::test]+async fn experiment_rules_carry_the_assigned_variant_and_no_experiment_identity_on_the_wire(+) -> Result<()> {+ let cases = corpus::experiment_cases()+ .into_iter()+ .filter(|case| case["family"] != "white_box")+ .collect();+ assert_eq!(check_on_the_wire(cases).await?, 48);Ok(())}diff --git a/rust/feature-flags/tests/test_rules_v2_evaluation.rs b/rust/feature-flags/tests/test_rules_v2_evaluation.rsindex 4c97b7fc35ee..9b7539493a62 100644--- a/rust/feature-flags/tests/test_rules_v2_evaluation.rs+++ b/rust/feature-flags/tests/test_rules_v2_evaluation.rs@@ -2,7 +2,9 @@ use std::collections::{BTreeMap, BTreeSet};use std::sync::Arc;use feature_flags::flags::config_v2::{Outcome, ParseError};-use feature_flags::flags::evaluate_v2::{Evaluation, EvaluationError, Evaluator, PersonProperties};+use feature_flags::flags::evaluate_v2::{+ Evaluation, EvaluationError, Evaluator, HashUse, PersonProperties,+};use feature_flags::flags::feature_flag_list::PreparedFlags;use feature_flags::flags::flag_matching_utils::calculate_hash;use feature_flags::flags::flag_request::MAX_DISTINCT_ID_LEN;@@ -33,7 +35,7 @@ fn vendored_response_fixtures_agree_with_the_validator() {invalid += 1;}}- assert_eq!((valid, invalid), (25, 125));+ assert_eq!((valid, invalid), (26, 44));}#[test]@@ -42,6 +44,7 @@ fn evaluation_corpora_have_unique_ids_and_the_pinned_families() {for (component, cases) in [("v2_boolean_evaluation", corpus::cases()),("v2_value_evaluation", corpus::value_cases()),+ ("v2_experiment_evaluation", corpus::experiment_cases()),] {let ids: Vec<_> = cases.iter().map(|case| case["id"].clone()).collect();assert_eq!(@@ -72,6 +75,11 @@ fn evaluation_corpora_have_unique_ids_and_the_pinned_families() {family("v2_value_evaluation", "ordering", 27),family("v2_value_evaluation", "values", 11),family("v2_value_evaluation", "parser", 11),+ family("v2_experiment_evaluation", "ordering", 20),+ family("v2_experiment_evaluation", "assignment", 22),+ family("v2_experiment_evaluation", "values", 9),+ family("v2_experiment_evaluation", "white_box", 10),+ family("v2_experiment_evaluation", "parser", 20),]));}@@ -80,11 +88,16 @@ fn evaluation_corpora_have_unique_ids_and_the_pinned_families() {fn parsed_configs_match_every_core_case_without_mutating_cached_inputs() {let mut executed = 0;let mut rejected = 0;- for case in corpus::cases().into_iter().chain(corpus::value_cases()) {+ for case in corpus::cases()+ .into_iter()+ .chain(corpus::value_cases())+ .chain(corpus::experiment_cases())+ {let id = case["id"].as_str().unwrap();match case["family"].as_str().unwrap() {"white_box" | "eligibility" => continue,- "ordering" | "properties" | "context" | "errors" | "hashing" | "values" | "parser" => {}+ "ordering" | "properties" | "context" | "errors" | "hashing" | "values"+ | "assignment" | "parser" => {}other => panic!("unhandled family: {other}"),}let flag = corpus::read(&case);@@ -92,8 +105,9 @@ fn parsed_configs_match_every_core_case_without_mutating_cached_inputs() {let cached = PreparedFlags::seal(vec![flag]);let retained = cached[0].filters.non_v1.as_ref().unwrap();if case["family"] == "parser" {+ // A schema rejection: a too-long list is reported as a limit.let kind = match retained.parsed_v2.as_ref() {- Some(Err(ParseError::Malformed(_))) => "malformed",+ Some(Err(ParseError::Malformed(_) | ParseError::LimitExceeded(_))) => "malformed",Some(Err(ParseError::Unsupported(_))) | None => "unsupported",other => panic!("{id}: unexpected parse result {other:?}"),};@@ -124,7 +138,9 @@ fn parsed_configs_match_every_core_case_without_mutating_cached_inputs() {));assert_eq!(serde_json::to_value(&cached[0]).unwrap(), before, "{id}");assert_eq!(properties, properties_before);- if let Some(evidence) = case.get("hash_evidence") {+ if let Some(Value::Array(draws)) = case.get("hash_evidence") {+ assert_experiment_hash_evidence(id, &context, draws);+ } else if let Some(evidence) = case.get("hash_evidence") {let (seed, rollout_percentage) = config.rules.iter()@@ -157,7 +173,30 @@ fn parsed_configs_match_every_core_case_without_mutating_cached_inputs() {}executed += 1;}- assert_eq!((executed, rejected), (120 + 38, 2 + 11));+ assert_eq!((executed, rejected), (120 + 38 + 51, 2 + 11 + 20));+}++fn assert_experiment_hash_evidence(+ id: &str,+ context: &feature_flags::flags::evaluate_v2::EvaluationContext<'_>,+ draws: &[Value],+) {+ let hex = |value: f64| format!("{:016x}", value.to_bits());+ let subject: String = context+ .person_identifier+ .chars()+ .take(MAX_DISTINCT_ID_LEN)+ .collect();+ for draw in draws {+ assert_eq!(subject, draw["identifier"], "{id}");+ let hash = calculate_hash(+ draw["prefix"].as_str().unwrap(),+ &subject,+ draw["salt"].as_str().unwrap(),+ )+ .unwrap();+ assert_eq!(hex(hash), draw["hash01_binary64_hex"], "{id}");+ }}#[tokio::test]@@ -231,6 +270,7 @@ fn canonical_white_box_cases_exercise_the_production_ordered_evaluator() {let mut count = 0;for case in corpus::cases().into_iter()+ .chain(corpus::experiment_cases()).filter(|case| case["family"] == "white_box"){let flag = corpus::read(&case);@@ -245,7 +285,7 @@ fn canonical_white_box_cases_exercise_the_production_ordered_evaluator() {).unwrap(),);- let result = evaluator.evaluate_with_hash(&context, |_, _| Ok(hash));+ let result = evaluator.evaluate_with_hash(&context, |_, _, _| Ok(hash));assert_eq!(corpus::result_json(result),case["expected"],@@ -254,7 +294,7 @@ fn canonical_white_box_cases_exercise_the_production_ordered_evaluator() {);count += 1;}- assert_eq!(count, 10);+ assert_eq!(count, 10 + 10);}#[test]@@ -273,12 +313,12 @@ fn hashing_is_lazy_subject_is_resolved_once_and_repeated_seeds_reuse_the_hash()let properties = corpus::properties(&case);let mut context = corpus::context(&case, &properties);assert!(Evaluator::new(config)- .evaluate_with_hash(&context, |_, _| panic!("100% must not hash"))+ .evaluate_with_hash(&context, |_, _, _| panic!("100% must not hash")).is_ok());context.person_identifier = "";assert!(matches!(Evaluator::new(config)- .evaluate_with_hash(&context, |_, _| panic!("empty subject must not hash")),+ .evaluate_with_hash(&context, |_, _, _| panic!("empty subject must not hash")),Ok(Evaluation::NoRuleMatch { .. })));if let Outcome::PercentageRollout {@@ -294,8 +334,9 @@ fn hashing_is_lazy_subject_is_resolved_once_and_repeated_seeds_reuse_the_hash()context.person_identifier = &subject;let mut calls = 0;assert!(matches!(- Evaluator::new(config).evaluate_with_hash(&context, |seed, subject| {+ Evaluator::new(config).evaluate_with_hash(&context, |hash_use, seed, subject| {calls += 1;+ assert_eq!(hash_use, HashUse::Rollout);assert_eq!(seed, "example-allocation");assert_eq!(subject, "😀".repeat(200));Ok(0.5)@@ -304,11 +345,58 @@ fn hashing_is_lazy_subject_is_resolved_once_and_repeated_seeds_reuse_the_hash()));assert_eq!(calls, 1);assert_eq!(- Evaluator::new(config).evaluate_with_hash(&context, |_, _| Err(EvaluationError::Hash)),+ Evaluator::new(config).evaluate_with_hash(&context, |_, _, _| Err(EvaluationError::Hash)),Err(EvaluationError::Hash));}+#[test]+fn experiment_draws_follow_pause_holdout_rollout_variant_order() {+ for (id, expected) in [+ ("v2_experiment.ordering.paused_before_holdout", vec![]),+ (+ "v2_experiment.assignment.holdout_out",+ vec![+ (HashUse::Holdout, "example-holdout"),+ (HashUse::Variant, "example-split"),+ ],+ ),+ (+ "v2_experiment.assignment.rollout_hit",+ vec![+ (HashUse::Rollout, "example-split"),+ (HashUse::Variant, "example-split"),+ ],+ ),+ (+ "v2_experiment.assignment.shared_rollout_seed",+ vec![+ (HashUse::Rollout, "example-shared"),+ (HashUse::Variant, "example-shared"),+ ],+ ),+ ] {+ let case = corpus::experiment_cases()+ .into_iter()+ .find(|case| case["id"] == id)+ .unwrap();+ let flag = corpus::read(&case);+ let properties = corpus::properties(&case);+ let context = corpus::context(&case, &properties);+ let mut draws = Vec::new();+ let result = Evaluator::new(corpus::config(&flag)).evaluate_with_hash(+ &context,+ |hash_use, seed, subject| {+ draws.push((hash_use, seed.to_owned()));+ hash_use.hash(seed, subject)+ },+ );+ assert_eq!(corpus::result_json(result), case["expected"], "{id}");+ let draws: Vec<_> = draws.iter().map(|(u, s)| (*u, s.as_str())).collect();+ assert_eq!(draws, expected, "{id}");+ }+}+#[test]fn regex_execution_errors_are_not_inverted_by_negation() {let mut case = corpus::cases()@@ -389,7 +477,11 @@ async fn corpus_cases_project_through_the_matcher_and_the_legacy_formats() {None,));let (mut projected, mut direct, mut skipped) = (0, 0, 0);- for case in corpus::cases().into_iter().chain(corpus::value_cases()) {+ for case in corpus::cases()+ .into_iter()+ .chain(corpus::value_cases())+ .chain(corpus::experiment_cases())+ {let id = case["id"].as_str().unwrap();let properties = corpus::properties(&case);let context = corpus::context(&case, &properties);@@ -431,8 +523,9 @@ async fn corpus_cases_project_through_the_matcher_and_the_legacy_formats() {.map(|p| serde_json::from_str::<Value>(p.as_str().unwrap()).unwrap())};let reason = match expected["reason"].as_str() {- Some("targeting_match") => "condition_match",+ Some("targeting_match" | "experiment_split") => "condition_match",Some("rollout_miss") => "out_of_rollout_bound",+ Some("holdout") => "holdout_condition_value",_ => "no_condition_match",};let rule_index = expected["rule"]["index"].as_i64();@@ -574,8 +667,16 @@ async fn corpus_cases_project_through_the_matcher_and_the_legacy_formats() {expected["rule"].get("rule_type"),"{id}");+ assert_eq!(+ record["metadata"].get("variant_key"),+ expected.get("variant"),+ "{id}"+ );+ for field in ["experiment_id", "holdout_id"] {+ assert_eq!(record["metadata"].get(field), None, "{id}");+ }}projected += 1;}- assert_eq!((projected, direct, skipped), (114 + 49, 8, 13));+ assert_eq!((projected, direct, skipped), (114 + 49 + 71, 8, 13 + 10));}diff --git a/rust/feature-flags/tests/test_rules_v2_evaluation/corpus.rs b/rust/feature-flags/tests/test_rules_v2_evaluation/corpus.rsindex 8974aef7c7cc..bb8175170184 100644--- a/rust/feature-flags/tests/test_rules_v2_evaluation/corpus.rs+++ b/rust/feature-flags/tests/test_rules_v2_evaluation/corpus.rs@@ -3,7 +3,7 @@ use std::path::PathBuf;use feature_flags::flags::config_v2::Config;use feature_flags::flags::evaluate_v2::{- Evaluation, EvaluationContext, EvaluationError, MatchedRule, PersonProperties, RuleKind,+ Evaluation, EvaluationContext, EvaluationError, MatchedRule, PersonProperties,};use feature_flags::flags::flag_models::FeatureFlag;use serde_json::{json, Value};@@ -30,6 +30,13 @@ pub fn value_cases() -> Vec<Value> {.clone()}+pub fn experiment_cases() -> Vec<Value> {+ load("corpus/v2_experiment_evaluation.json")["cases"]+ .as_array()+ .unwrap()+ .clone()+}+pub fn read(case: &Value) -> FeatureFlag {serde_json::from_value(json!({"id": 1, "team_id": 1, "key": case["flag"]["key"], "name": case["flag"]["name"],@@ -74,21 +81,20 @@ pub fn context<'a>(}fn rule_json(rule: MatchedRule) -> Value {- json!({"id": rule.id.to_string(), "index": rule.index, "rule_type": match rule.kind {- RuleKind::TargetedRelease => "targeted_release", RuleKind::PercentageRollout => "percentage_rollout",- }})+ json!({"id": rule.id.to_string(), "index": rule.index, "rule_type": rule.kind.as_str()})}pub fn result_json(result: Result<Evaluation, EvaluationError>) -> Value {match result {- Ok(Evaluation::TargetingMatch { value, rule }) => {- json!({"status":"success","value":value,"reason":"targeting_match","rule":rule_json(rule)})- }- Ok(Evaluation::RolloutMiss { value, rule }) => {- json!({"status":"success","value":value,"reason":"rollout_miss","rule":rule_json(rule)})- }- Ok(Evaluation::NoRuleMatch { value }) => {- json!({"status":"success","value":value,"reason":"no_rule_match"})+ Ok(evaluation) => {+ let mut json = json!({"status": "success", "value": evaluation.value(), "reason": evaluation.code()});+ if let Some(rule) = evaluation.rule() {+ json["rule"] = rule_json(rule);+ }+ if let Some(variant) = evaluation.variant_key() {+ json["variant"] = json!(variant);+ }+ json}Err(error) => json!({"status":"error","error": match error {EvaluationError::MissingContext => "missing_context", EvaluationError::InvalidProperty => "invalid_property",