evalResult for an environment that decodes against the Schemas expr was
built from, where no operand is null: it returns the value and throws the
Node.Refusal. Evaluation is null-strict, so over a null or absent operand
the result is null whatever A says.
Evaluate expr against a complete environment env: its value, null where
an operand was null or absent, or the Node.Refusal of an integer past
±(2^53−1), a non-finite number, an ill-typed operand or an unmatched case.
A path that reads a number turns -0 into 0.
evalResult for an environment that decodes against the Schemas expr was
built from, where no operand is null: it returns the value and throws the
Node.Refusal. Evaluation is null-strict, so over a null or absent operand
the result is null whatever A says.
Pure, terminating expression reading paths from Env and producing A.
Env is contravariant (phantom) so an expression over { row } widens into
{ row, principal } without adapters.
Opaque evidence authorizing algebraic rewrites for a specific foreign
operation descriptor bound to a specific JS implementation function.
Only attestClaims creates it, for a claim whose equation held; rebinding
the operation or any binding it was checked through, or changing the
claim, invalidates it.
Trust policy controlling whether a reader answers from a foreign
operation's declared claims: the rewrites of residualize and judge,
Transition.can, Pairs.commutes and Pairs.idempotent, the
checker's bounds from a monotone claim, and what reorders or inverts a
reduce fold.
Absent (undefined): applies no claim.
Expr.RewritePolicy.trusted: applies declared op.claims without
checking them. A claim that is false of the implementation then gives
wrong answers from every reader above; use verified to have claims
checked.
Expr.RewritePolicy.verified(evidence, { minAssurance? }): applies a claim
rewrite only when evidence holds a genuine ForeignRewriteEvidence
instance matching the exact operation descriptor, bound implementation,
current claim value, recorded dependency bindings, and claim at or above
minAssurance (default 'tested'). Conservative fallback preserves the
original call (Unknown in judge) when evidence is absent, insufficient,
or invalidated by rebinding.
Partially evaluate a boolean expr and say whether it holds: True where
it is known to be true, False where it is known to be false, null or
refused (the refusal is the witness), Unknown where it cannot tell.
A foreign call with no implementation given is Unknown.
An omitted optional struct key is unknown in the partial environment.
Exhaustive literal Match over a string union expression: one case for
each value and no other, checked by the types and again where the
expression is built. A null on gives null.
Exhaustive tagged-union Match over a Path to a union of Schema.TaggedStructs.
Each branch receives a narrowed PathAccessor for that variant's payload fields
and lowers directly to Node.Match over subject._tag, so JS eval, prepare,
residualize, judge, reads, Artifact, and Fn all work without a second AST.
First-class escape hatch for arbitrary JavaScript logic.
Declaring reads lets partial evaluation run the function once those paths
are known, and lets footprint analyses stay precise. Omitting reads
declares Footprint.All (unbounded reads). Every static checker treats an
Opaque node soundly as Unknown.
What lit takes: a string, number, boolean, null, or an array or object type of these.
An interface or class (Date, Map, Set, Option) has no index signature, so it is refused at the call.
What evaluation, residualize, judge and every reader that answers from
a custom operation's claims (Pairs.commutes, Pairs.idempotent,
the Abstract checks, reduceProperties) take besides what they read: the
implementations of the foreign operations it calls, by id, and an optional
rewritePolicy (Expr.RewritePolicy.trusted or
Expr.RewritePolicy.verified(evidence); trusted applies claims unchecked, so a
false claim gives wrong answers from every reader here). When rewritePolicy is omitted,
no claim is applied. A call with no implementation is refused by evaluation
and Unknown to judge.
Attach a symbolic Expr invariant to an Effect Schema.
Compiles to a real Schema.makeFilter (so Schema.decodeUnknownSync
enforces it at runtime) AND stores the ExprNode in the filter's
SchemaAST annotations (so SQL, Zone, Z3, and Forms read the AST straight
off the Schema).
Partially evaluate expr against a partially known environment, returning
the simplified residual Expr. A whole struct read stays open until the
environment supplies all declared keys, including optional keys.
Read every rule attached to schema, with where it sits and its message:
each Expr.refine and each built-in Effect numeric bound (isGreaterThan,
isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, and
isBetween, which gives one rule per side), on the schema itself, on
nested struct properties, and under Schema.optional, Schema.optionalKey,
and Schema.NullOr (guarded with Null.isNull(at) || rule so absent or
null values pass). Checks on multi-branch non-nullish unions are not read.
Read every rule attached to schema, along with any checks rulesOf could
not express as an Expr (such as effect/schema/isInt, custom filters, or
checks inside multi-branch non-nullish unions).