name: request-params
description: Request.Params — named constants a request's expressions read as params.<name> instead of splicing values into expression text; types, refusals, the read-only rule and Compose / chain inheritance.
type: guide
kind: design
applies_to: process, compose, predict
covers: [params, Request.Params, params.name, PULSE_PARAMS_INVALID, PULSE_PARAMS_UNDECLARED, PULSE_PARAMS_FIELD_COLLISION]
requires: [capability:params]
Request params
"params": {...} on a request declares constants; an expression reads one as params.name (or params["name"]). Change the value, never the expression text: no string splicing, no quoting bugs, one expression shape per question.
{
"cohort": {"filename": "customers.pulse"},
"params": {"region": "north", "min_age": 30},
"filterers": [{"type": "FILTER_EXPRESSION", "expression": "region == params.region && age >= params.min_age"}]
}
Values
| Value | Binds as |
|---|---|
| number | exact: an integer is int64 (uint64 above int64 range), else float64 |
| string, bool | itself |
| list, ONE kind (all numbers, strings or bools) | a typed list: id in params.ids |
null, an invalid name (a Go-style identifier is required) or a mixed list → PULSE_PARAMS_INVALID (details.reason).
Where they bind
ATTR_FORMULA, FILTER_EXPRESSION, total() and the holdout expression. OVERLAY_FORMULA reads them too. FilterToFileWithRequest takes its own params (the values key its dedup hash). Not synth rules. A FacetSchema request’s filterers read the facet’s own params (same rules, same refusals). Params are READ-ONLY constants folded per run: an expression cannot write one, and a run sees only its own values.
Refusals (predict raises the same)
params.xwherexis not declared →PULSE_PARAMS_UNDECLARED.- A cohort field, derived label or vector NAMED
params, while the request readsparams.→PULSE_PARAMS_FIELD_COLLISION. That name stays readable as bareparamsor$env["params"]. - A bare
paramsis never a parameter read.
Batch roots
A top-level params on a batch root (Compose) (process chain) merges into EVERY sub-request (slots, fits, stages); a sub-request’s own key wins. A Compose-level formula overlay reads the top-level params. --echo-request shows the merged view. Same on the CLI api leaves and the MCP tools.
A sweep axis "target": "params.x" writes each slot’s axis value into its params.x (declared, or overriding the body’s and the batch’s) — no placeholder needed. A {"$var"} marker naming a targeted axis, or standing at params.x, is refused axis_target_conflict; the "params": {"x": {"$var": "x"}} route still works. An item for_each cannot target params (target_unsupported).
Gotchas
u64fields compare exactly against params, literals and each other (==,<,in); arithmetic still goes through float64.- A feature profile hiding
capability:paramsmakes the slot unknown (PULSE_REQUEST_UNKNOWN_FIELD). - Not request templating: templates fill a request BEFORE it is validated; params are the request’s own constants, read at compile time.
- A template fills params with a marker,
"params":{"w":{"$var":"w"}}(the number stays a number);{{w}}inside an expression is refusedPULSE_TEMPLATE_EXPR_SPLICE(request-templating).
See
expression-language,compose-requests,process-chain,request-envelopepulse_examples_search tags=[feature-engineering]