* Compare strings by UTF-16 code unit in the rules engine
A JS string is a sequence of UTF-16 code units and every string operation
works on those units. Swift's String compares canonical equivalence over
Unicode scalars, so <, <=, >, >=, ==, ===, in and rc.entries key ordering
all had cases where a predicate evaluated one way on iOS and the other in
JS and Kotlin.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Keep the new fixture descriptions platform-neutral
The fixture files are byte-identical across the iOS and Android engines, so
a description that explains the contract in terms of one host language's
string comparison does not read correctly in the other repository.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Name the characters under test in the UTF-16 fixture descriptions
The predicates spell these strings as \uXXXX escapes so the exact code
units are unambiguous, which leaves a reader unable to tell which
character a fixture is about. Each description now shows the glyph and
its code point, and spells out the surrogate pair where one is the
point of the case.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Route rc.sortBy string keys through jsStringPrecedes
The operator open-coded the UTF-16 comparison because the shared helper
did not exist yet when it landed. It does now, and the rationale lives
in the helper's doc, so the operator no longer repeats it.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Compare object keys by UTF-16 code unit
A Swift dictionary keys by canonical equivalence, so é (U+00E9) and e
followed by a combining acute (U+0301) were one key: an object holding
both spellings kept only one, and a var path spelled either way resolved
against the other. JS and Kotlin keep the two apart, so a rule reading a
non-ASCII key could answer differently per platform.
Value.object now stores an ObjectValue, whose keys compare and hash by
code unit, and the JSON parser iterates the NSDictionary rather than
casting to [String: Any], which merges the keys before the engine sees
them.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fold the ObjectValue.filter condition into a where clause
SwiftLint's for_where rule, and it reads better.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Seven operators hand-wrote the same count check and the same message.
Move it to Operators, next to evalArgs, whose result it always checks.
Messages are unchanged, so no fixture moves.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add rc.regexReplace custom operator
Co-authored-by: Cursor <cursoragent@cursor.com>
* Place the replacement template divergence on the right axis
The note blamed the three regex engines, but the template is parsed by
each platform's own API and never reaches ICU, so this is the one part of
the feature where the two devices differ rather than agreeing against
Funnels. Records what each actually does with $& and with a $1 the
pattern cannot supply.
Co-authored-by: Cursor <cursoragent@cursor.com>
* State the replacement contract without surveying the engines
What a reader needs is that the replacement is taken literally; which
template syntax each engine would otherwise have honoured is background
that belongs with whoever authors the patterns.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Compose rc.regexReplace with an operator that still exists
The fixture proving a replaced string is usable downstream fed it to
rc.length, which main has since removed. rc.upper keeps the point of the
case without depending on an operator that is gone.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add rc.regexMatch custom operator
Co-authored-by: Cursor <cursoragent@cursor.com>
* Report why a regex pattern failed to compile
The engine discarded the compile error and said only that the pattern was
bad, which leaves whoever authored the rule to find the mistake by eye.
NSRegularExpression has little to add today: every syntax failure is the
same NSCocoaErrorDomain 2048 whose description restates the pattern. The
catch is here so the message keeps its shape across the engines, where
the JVM names the fault and points at the offset.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Name the engines the regex operators actually run on
The divergence list said ICU here and java.util.regex on Android, which
is wrong: Android's java.util.regex has wrapped ICU4C since 2.3, so both
devices run ICU and Funnels is the outlier. Read the old note and you
would expect \d to behave differently on the two devices when it behaves
differently in Funnels instead.
Adds the rule the old list was missing — ICU rejects a bare literal }
that JS accepts — and the one genuine device difference, unknown escapes.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Pin how the regex operators read an empty input
An empty input was untested, and it is the input a variable lookup is
most likely to produce by accident. All three engines agree: the string
is still searched, so a pattern that can match nothing succeeds on it
and one that needs a character does not.
The empty *pattern* is deliberately not fixtured. ICU refuses to compile
it while JS reads it as a match at every position, so it is a divergence
rather than a shared rule, and it is now recorded as one.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Delegate regex syntax to the platform's own documentation
The divergence list restated what each engine does, which the vendor
pages already document and do more reliably than a comment that has to be
kept true by hand. The syntax reference now lives behind a link, leaving
only what this file decides for itself.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Name only the pattern when a regex fails to compile
The Android branch hand-assembled the first line of PatternSyntaxException's
own message, and its iOS counterpart appended a localizedDescription that
only repeats the pattern back. Neither is asserted anywhere, and the useful
half is OpenJDK phrasing that a device's ICU-backed engine words differently.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Bind both regex operands before reading them
The arity guard proves the count matches what the caller asked for, not
that it reaches two, so a caller passing a smaller count would index past
the end. An out-of-bounds read traps, and a trap is the one failure the
engine cannot hand back as an error.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add rc.indexOf custom operator
Arrays get a position, which nothing else expressed: in answers whether
a value is present, never where it sits.
Strings report the position through LengthOperator.stringLength, the
same function behind rc.length, so both operators always measure in one
unit and a later change to that unit moves them together.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Frame stringLength as the engine's single string measurement
Co-authored-by: Cursor <cursoragent@cursor.com>
* Trim rc.indexOf doc comment
Co-authored-by: Cursor <cursoragent@cursor.com>
* Move stringLength out of the rc.length operator
It is the engine's measurement, not that operator's, and rc.indexOf had
to reach across to another operator to state a position in the same
unit. Mirrors the same move in purchases-android.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Compare strings by UTF-16 code unit in the rules engine
A JS string is a sequence of UTF-16 code units and every string operation
works on those units. Swift's String compares canonical equivalence over
Unicode scalars, so <, <=, >, >=, ==, ===, in and rc.entries key ordering
all had cases where a predicate evaluated one way on iOS and the other in
JS and Kotlin.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Keep the new fixture descriptions platform-neutral
The fixture files are byte-identical across the iOS and Android engines, so
a description that explains the contract in terms of one host language's
string comparison does not read correctly in the other repository.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Name the characters under test in the UTF-16 fixture descriptions
The predicates spell these strings as \uXXXX escapes so the exact code
units are unambiguous, which leaves a reader unable to tell which
character a fixture is about. Each description now shows the glyph and
its code point, and spells out the surrogate pair where one is the
point of the case.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Route rc.sortBy string keys through jsStringPrecedes
The operator open-coded the UTF-16 comparison because the shared helper
did not exist yet when it landed. It does now, and the rationale lives
in the helper's doc, so the operator no longer repeats it.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add rc.sortBy custom operator
Orders an array by a key computed per item, ascending, with ties keeping
their input order. Keys must be all strings or all numbers so the two
engines never have to invent a cross-type ordering.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add rc.slice custom operator
Takes a run of elements out of an array, with the start and length
semantics substr already uses for strings. Pairs with rc.sortBy to
express top-N without a reduce carrying a compound accumulator.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Exempt the custom operator dispatcher from cyclomatic complexity
The tenth operator pushed the switch past the limit. Operators.dispatch
carries the same exemption for the same reason.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Reject non-finite rc.sortBy keys
A NaN key compares false in both directions, so every pair tied and the
input came back unsorted with no error. Negating a string key to attempt
a descending sort produced exactly that.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Note ascending order in the rc.sortBy summary
Co-authored-by: Cursor <cursoragent@cursor.com>
* Trim the rc.sortBy doc comment
Co-authored-by: Cursor <cursoragent@cursor.com>
* Trim the rc.sortBy stability comment
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop the dispatcher comment above the lint annotation
Co-authored-by: Cursor <cursoragent@cursor.com>
* Scope the substr hint to string input in rc.slice
Co-authored-by: Cursor <cursoragent@cursor.com>
* Pin rc.slice index and source type strictness in fixtures
Co-authored-by: Cursor <cursoragent@cursor.com>
* Reach the float index branch through arithmetic in rc.slice fixtures
Co-authored-by: Cursor <cursoragent@cursor.com>
* Order rc.sortBy string keys by UTF-16 code unit
Swift's < orders by Unicode scalar and treats canonically equivalent
strings as equal, while JS and Kotlin order by UTF-16 code unit. The two
disagree once a scalar above the surrogate range meets an astral one, so
the same rule would sort differently on iOS and Android.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Keep the rc.sortBy ordering fixtures platform-neutral
The fixture files are byte-identical across the iOS and Android engines, so
a description that explains the contract in terms of one host language's
string comparison does not read correctly in the other repository.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add rc.sortBy custom operator
Orders an array by a key computed per item, ascending, with ties keeping
their input order. Keys must be all strings or all numbers so the two
engines never have to invent a cross-type ordering.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Reject non-finite rc.sortBy keys
A NaN key compares false in both directions, so every pair tied and the
input came back unsorted with no error. Negating a string key to attempt
a descending sort produced exactly that.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Note ascending order in the rc.sortBy summary
Co-authored-by: Cursor <cursoragent@cursor.com>
* Trim the rc.sortBy doc comment
Co-authored-by: Cursor <cursoragent@cursor.com>
* Trim the rc.sortBy stability comment
Co-authored-by: Cursor <cursoragent@cursor.com>
* Order rc.sortBy string keys by UTF-16 code unit
Swift's < orders by Unicode scalar and treats canonically equivalent
strings as equal, while JS and Kotlin order by UTF-16 code unit. The two
disagree once a scalar above the surrogate range meets an astral one, so
the same rule would sort differently on iOS and Android.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Keep the rc.sortBy ordering fixtures platform-neutral
The fixture files are byte-identical across the iOS and Android engines, so
a description that explains the contract in terms of one host language's
string comparison does not read correctly in the other repository.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Raised in review on the Android port: everything from the first + on is
discarded without being checked, so "1.0.0++junk" compares as "1.0.0".
That is intended, but it sat outside the list of concessions and read as
an oversight. A fixture now pins it.
Co-authored-by: Cursor <cursoragent@cursor.com>
rc.length justifies throwing with a missing var, which cannot reach the
operator any more: the lookup raises first, as
length_missing_variable_fails_at_the_lookup pins. The reason now rests on
a key that is present but holds null, the case that does reach it.
objectList tells providers a record must carry everything a predicate
about it needs. rc.rootVar reaches the snapshot from inside an iteration
scope, so that is no longer the only option.
Co-authored-by: Cursor <cursoragent@cursor.com>
Version targeting is the most common audience condition, and the built-in
< / > compare version strings lexicographically, ranking "10.0.0" below
"9.0.0".
rc.semverCompare returns -1, 0, or 1 so rules compose it with the existing
comparison operators. Precedence follows semver 2.0.0: numeric core first,
then prerelease identifiers, with build metadata excluded. Unparseable
input and inexact arity throw typeMismatch rather than reporting "equal",
which would quietly match every rule built on it.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add Scope plumbing and custom operator extension point
Thread evaluation scope through the rules engine and delegate unknown
operators to an empty CustomOperators dispatcher, without changing behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix project.pbxproj: restore RewardedAdTrackingMetadata entries
The RulesEngine registration edit accidentally dropped four
RewardedAdTrackingMetadata.swift entries from the Xcode project.
Restore them and normalize CustomOperators identifiers to 24 hex chars.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add rc.entries and rc.fromEntries for keyed object iteration
Introduce pair conversion operators so filter/map/some can iterate
subscriptions, entitlements, and other keyed objects via existing iteration ops.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Use firstArgEvaluated for rc.entries argument convention
Promote the shared unary-arg helper to Operators and align rc.entries
and rc.fromEntries with json-logic-js spread semantics. Update fixtures
for wrapped array operands and add a multi-arg interop case.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Promote firstArgEvaluated to shared Operators helpers
Move the unary-arg helper from LogicOperators to Operators so custom
operators can use the same json-logic-js spread convention.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Address review comments on custom operator extension point
Drop the cross-engine registration note from CustomOperators, and restore
the single-line var extra-args warning that was reflowed without changing
its text.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Reformat rc.entries fixtures so subexpressions read as units
The one-token-per-line formatting spread predicates over dozens of lines,
so a comparison like {"===": [{"var": "0"}, "a"]} took seven lines and its
shape was impossible to see at a glance. Subtrees that fit within 120
columns are now inlined, which keeps each operator and its operands
together on one line while deeply nested structures still expand.
No fixture content changed; the document is byte-identical after parsing,
key order included.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Trim EntriesOperators docs of cross-repo references
Drops the cross-engine contract paragraph and the Audience.swift pointer.
Both described obligations outside this file, which will drift as those
places change.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Make rc.entries throw typeMismatch on non-object, non-array input
Returning [] with a warning let a misaimed rule keep evaluating: a some
over an empty list is simply false, so a rule pointed at a string or a
missing variable reported a confident answer rather than a failure. Null,
undefined, bool, number and string now throw, matching rc.length.
Strings in particular do not yield the character pairs JS Object.entries
produces. This is JSON, not JS, and a string here means the rule targets
the wrong field.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Make rc.fromEntries throw typeMismatch on malformed input
Skipping bad entries produced a partial object indistinguishable from a
legitimate one, letting a rule match on whichever keys happened to survive.
Non-array arguments and entries that are not two-element [key, value] pairs
now throw, so rc.fromEntries fails the same way as rc.entries.
Entry arity is checked exactly: a one-element entry no longer defaults its
value to null, and an over-long entry no longer silently ignores the extra
elements the way JS Object.fromEntries does.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Raise an error for unresolved variables instead of degrading to null
A `var` lookup that found nothing returned `null`, following the JSON
Logic spec. That null then coerces: `0` in a numeric comparison, `""`
in a string one. A rule that reads a dimension the SDK never supplied
therefore still produces an answer, and often the wrong one — a missing
`now` turns `{">": [expires, now]}` into `expires > 0`, which is true
for every subscription that ever existed.
An absent variable means "unknown", and unknown is not the same answer
as "no". The lookup now throws `EvaluationError.unresolvedVariable`
carrying the path, so the rule fails loudly and the SDK decides what an
unanswerable rule means. `LocalRulesEvaluator` already distinguishes an
error from a non-match: it keeps walking later rules and only throws if
none matched.
Absence a rule genuinely tolerates is opted into with the spec's own
escape hatch, `{"var": ["path", default]}`. A key that is present but
holds `null` is a known value and still resolves. `missing` and
`missing_some` exist to probe for absence and keep reporting it.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Stop pinning the rendered path for the oversized float fixture
iOS renders `1e19` as `1e+19` and Android as `1.0E19`, so pinning the
path would keep this fixture from being shared verbatim between the two
engines. The fixture is about the formatter not trapping on a value past
Int64.max, not about how that magnitude is spelled.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Apply the unresolved-variable contract to rc.lower and rc.upper
`rc.lower` arrived on main while this branch was open, carrying a
fixture that pinned a missing variable as a `typeMismatch` from the
operator. The lookup now fails first, so the error names the unresolved
path instead. Its companion pins that an explicit null still reaches
`rc.lower` and is refused there.
The operator's rationale for not coercing cited a missing `var`
resolving to null, which is no longer how that ends. It refuses
non-strings because an explicit null would lower to "null" and compare
equal to it, which is the part that still holds.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Trim the warn doc comment
Co-authored-by: Cursor <cursoragent@cursor.com>
* Name the expected-error path field for the case it belongs to
`path` sits next to `kind` and `operator` with nothing to say which
error it qualifies. The JSON key stays `path`, since there it appears
alongside `"error": "unresolvedVariable"` and reads unambiguously.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Describe the rc.rootVar fixture by what it does today
The description narrated the previous null-degrading behavior instead of
the case the fixture pins.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Give the absent-attribute predicates a default
Two non-matching predicates read attribute paths that resolve to nothing,
which is now an error rather than a false-y null. The Android counterpart
already carried this change.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Report an unanswerable audience as unavailable rather than no match
Two checkpoint tests pinned the null-degrading behavior: an audience
reading a dimension no provider supplies was merely false, so it read as
noMatch, and under negation it matched everyone.
The lookup throws now, which routes both through the resolver's existing
decision that an audience the SDK failed to evaluate is not the same
answer as an audience the customer falls outside of.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Splits a string into an array of fields, keeping empty ones, so rules can
target locale subtags, product-id namespaces and similar composite values.
A var path cannot index the result of an expression, so a positional field
is read by wrapping the array in a one-element list and letting an
iteration operator rebind scope to it. The array is also usable directly
by in and by the iteration operators.
Fields are never coerced to numbers, and a non-string operand or empty
separator throws typeMismatch rather than splitting into characters.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add Scope plumbing and custom operator extension point
Thread evaluation scope through the rules engine and delegate unknown
operators to an empty CustomOperators dispatcher, without changing behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix project.pbxproj: restore RewardedAdTrackingMetadata entries
The RulesEngine registration edit accidentally dropped four
RewardedAdTrackingMetadata.swift entries from the Xcode project.
Restore them and normalize CustomOperators identifiers to 24 hex chars.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Promote firstArgEvaluated to shared Operators helpers
Move the unary-arg helper from LogicOperators to Operators so custom
operators can use the same json-logic-js spread convention.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add rc.lower and rc.upper for case-insensitive rules
Locale-independent case conversion via jsString coercion, with predicate
fixtures covering coercion, Unicode behavior, and motivating match cases.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Address review comments on custom operator extension point
Drop the cross-engine registration note from CustomOperators, and restore
the single-line var extra-args warning that was reflowed without changing
its text.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Pin locale-independent uppercasing of ASCII i
rc.lower already had a fixture asserting the Unicode default mapping for
the Turkish I, but rc.upper had no equivalent. The uppercase direction is
the more consequential one: Turkish maps i to U+0130, a scalar with no
ASCII counterpart, so a locale-sensitive implementation would silently
change what rules match.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Require string input for rc.lower and rc.upper
Both operators coerced non-strings through jsString, mirroring JS
String(x).toLowerCase(). That makes absent data look like real data: a
missing var resolves to null, so comparing a lowercased path against
"null" would quietly match.
Throw typeMismatch instead, matching rc.length and rc.entries. The four
coercion fixtures are replaced by nine type-error fixtures covering null,
undefined, numbers, booleans, arrays, objects and missing vars, with
rc.upper cases pinning that it shares the guard.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Correct the jsNumberString divergence note
The note claimed the JS mismatch only surfaces through var path coercion
and looseEq, and only for large magnitudes. cat, substr and in stringify
numbers through the same helper, and small values diverge too: 1e-6
renders as "1e-06" rather than "0.000001".
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add Scope plumbing and custom operator extension point
Thread evaluation scope through the rules engine and delegate unknown
operators to an empty CustomOperators dispatcher, without changing behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix project.pbxproj: restore RewardedAdTrackingMetadata entries
The RulesEngine registration edit accidentally dropped four
RewardedAdTrackingMetadata.swift entries from the Xcode project.
Restore them and normalize CustomOperators identifiers to 24 hex chars.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Promote firstArgEvaluated to shared Operators helpers
Move the unary-arg helper from LogicOperators to Operators so custom
operators can use the same json-logic-js spread convention.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add rc.length operator for string and array lengths
UTF-16 code-unit count for strings (JS String.length parity), element
count for arrays, typeMismatch for other inputs. Thirteen new fixtures.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Address review comments on custom operator extension point
Drop the cross-engine registration note from CustomOperators, and restore
the single-line var extra-args warning that was reflowed without changing
its text.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Trim rc.length doc comment
Drop the rationale contrasting rc.length's throwing behavior with
rc.entries' lenient empty result.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Pin that rc.length ignores extra arguments
The doc comment claimed extra args are silently ignored but no fixture
covered it. Under single-operand semantics ["abc", "ignored"] would
measure the arg list itself and yield 2, so the fixture fails if the
spread convention regresses.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add Scope plumbing and custom operator extension point
Thread evaluation scope through the rules engine and delegate unknown
operators to an empty CustomOperators dispatcher, without changing behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add rc.rootVar operator for nested predicate root access
Introduce the rc.rootVar custom operator and shared resolveVar lookup,
with fixture coverage including falsy-item empty-path discrimination.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix project.pbxproj: restore RewardedAdTrackingMetadata entries
The RulesEngine registration edit accidentally dropped four
RewardedAdTrackingMetadata.swift entries from the Xcode project.
Restore them and normalize CustomOperators identifiers to 24 hex chars.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Promote firstArgEvaluated to shared Operators helpers
Move the unary-arg helper from LogicOperators to Operators so custom
operators can use the same json-logic-js spread convention.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Address review comments on custom operator extension point
Drop the cross-engine registration note from CustomOperators, and restore
the single-line var extra-args warning that was reflowed without changing
its text.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add Scope plumbing and custom operator extension point
Thread evaluation scope through the rules engine and delegate unknown
operators to an empty CustomOperators dispatcher, without changing behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix project.pbxproj: restore RewardedAdTrackingMetadata entries
The RulesEngine registration edit accidentally dropped four
RewardedAdTrackingMetadata.swift entries from the Xcode project.
Restore them and normalize CustomOperators identifiers to 24 hex chars.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Promote firstArgEvaluated to shared Operators helpers
Move the unary-arg helper from LogicOperators to Operators so custom
operators can use the same json-logic-js spread convention.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Address review comments on custom operator extension point
Drop the cross-engine registration note from CustomOperators, and restore
the single-line var extra-args warning that was reflowed without changing
its text.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>