Namespaces
args — the VPoint’s inputs. Parameters are reachable only through args:
BasePrice is args.base_price — see each SDK’s field-naming rules).
ctx — context functions registered by the service: ctx.applyTax(invoke(), 0.08). See context functions.
Varianz builtins
invoke()
Executes the next stage in the pipeline — or, at the end of the chain, the real function — and returns its result.
invoke()with zero arguments forwards the original arguments.invoke(a, b, ...)with exactly the VPoint’s parameter count substitutes different arguments.- Any other arity is a compile error.
invoke() fully replaces the function’s result; the real code never runs.
sample(name, value)
Captures value under the label name for the test session to assert on, and returns value unchanged. Exactly two arguments. Because it’s transparent, it composes anywhere:
Struct construction
- Type names must match the schema exactly and are case-sensitive. Use the simple name (
ChargeResult), never a package-qualified one (pb.ChargeResult,hipstershop.ChargeResult). - All required fields must be provided.
- Nested structs work inline:
GetProductOutput { id: "X", price: Money { currency_code: "USD", units: 42, nanos: 0 } }.
Supported syntax
Tuple values expose synthetic positional fields: read
pair._0 (or pair[0] when the schema proves a fixed tuple), construct with Pair { _0: "north", _1: 8 }. Generated wrapper names may be lowercase.
Optionals and null at the stage boundary
During evaluation, CEL keeps the standard distinction — optional.of(null).hasValue() is true, optional.none().hasValue() is false. At the stage boundary, however, Varianz transports an optional as either its inner value or absent: both optional.of(null) and optional.none() materialize as absence to the SDK on the other side.
Not yet supported
- Comprehensions
map,filter,exists_one(onlyexists/all) - Type conversions (
int(),string(), …) and date/time functions - Error diagnostics carry byte offsets, not line/column
Where CEL runs
CEL stages attach to a VPoint at an anchor —MID by default — scoped to your session. Insert them from any test SDK (cel(target, expression)); target syntax and routing filters are in Naming and routing.