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>
* 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>