harbor run -t scale-ai/hil-bench-swe_78-full_infoharbor download scale-ai/hil-bench-swe_78-full_infoMissing support for positive and negative operators in constraint evaluation
The evaluation engine lacks support for checking whether a given string contains or does not contain a specific substring when evaluating constraints. This prevents the use of substring-based logic in feature flag evaluations or other constraint-driven rules.
When a constraint is defined using the positive and negative operators in constraint evaluation, the system does not recognize them as valid operators. These constraints are ignored or result in no match, even if the evaluated string includes (or excludes) the target substring.
The evaluation system should support the positive and negative operators in constraint evaluation operators, allowing it to evaluate whether a string includes or excludes a specific substring. These operators should behave consistently with existing string-based operators in the system.
"No new interfaces are introduced"
Use exactly 'contains-strings' strings for the positive operator (string includes substring).
Use exactly 'not-contains-strings' for the negative operator (string does not include substring).
Use case-insensitive comparison. Normalize case before comparing so that 'Bar' and 'bar' match the same. Example: constraint value 'Bar' must match evaluated value 'foobar' for the positive substring operator. Use strings.Contains(strings.ToLower(v), strings.ToLower(value)) or strings.EqualFold for the substring check. Counter-example: do not use raw strings.Contains(v, value) without normalizing case.
When the evaluated value is empty, the positive substring operator must never match (always yield no match). For the negative substring operator, when the evaluated value is empty, the constraint must match (an empty string does not contain any non-empty substring; the negative operator matches when the substring is absent). Add an explicit check: if the evaluated value is empty, return false for the positive operator before performing the substring check; the negative operator need not special-case empty, as the normal string semantics already yield match when the value is empty and the constraint value is non-empty.