Documentation
¶
Overview ¶
Package exprslots is the one list of request string slots that carry an expr-lang expression, shared by the engine and the request-template renderer.
The engine names its compile sites through the Site* constants here (internal/exprenv re-exports them, so CompileError messages keep the same nouns) and reads the OVERLAY_FORMULA source through OverlayFormulaParam. The template package (internal/template) reads All / Match to refuse a `{{token}}` spliced into one of these slots (PULSE_TEMPLATE_EXPR_SPLICE): request params carry values into an expression, a template never splices text into it.
Leaf: stdlib only, so the template package's import ceiling (TestTemplatePackage_ImportBoundary) admits it. The coverage gates — every exprenv compile site is one of these (TestTemplateExprSplice_ CompileSitesShared, internal/exprenv), every engine expression path matches (TestTemplateExprSplice_EngineExprSlotsMatch, internal/vectors), every owner position in the request roots matches (TestTemplateExprSplice_SlotsCoverRequestRoots, here) — keep it from becoming a second hand-kept list.
Index ¶
Constants ¶
const ( SiteFormula = "formula" // an ATTR_FORMULA expression SiteFilter = "filter" // a FILTER_EXPRESSION expression SiteTotalArgument = "formula total() argument" // one total(expr) argument SiteHoldout = "regression holdout" // a RegressionSpec.Holdout predicate )
The compile sites: the what of an expression compile error. The runtime build and predict both name a site through these (via internal/exprenv), so their messages agree to the byte.
const ( SlotExpression = "expression" SlotHoldout = "holdout" SlotOverlayFormula = "overlay_formula" SlotFeatureFitOn = "feature_fit_on" )
The slot names.
const FeatureFitOnParam = "fit_on"
FeatureFitOnParam is the feature params key carrying a row expression (FEAT_TARGET_ENCODE params.fit_on).
const OverlayFormulaParam = "formula"
OverlayFormulaParam is the OVERLAY_FORMULA params key carrying the formula source, on a Request overlay and a Compose overlay alike.
const ParamsKey = "params"
ParamsKey is the key of a params object: the request's own constants (Request.Params) or an operator's configuration. A tail directly under one is a params entry that happens to share the slot's key — `"params": {"expression": "…"}` is data, not an expression slot — and never matches.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Slot ¶
type Slot struct {
// Name identifies the slot in a refusal's details.
Name string
// Owners are the types structs the slot lives on.
Owners []string
// Tail is the JSON key path the expression string sits at, array
// indices dropped, matched as a suffix of the string's key path from
// any request root: ["expression"] matches every filterer and
// attribute expression wherever it nests (a Compose request, a chain
// stage, a sweep request, a params-borne fit_on filterer list).
Tail []string
// Sites are the compile sites the engine reads the slot under; nil
// for OVERLAY_FORMULA, which compiles through the overlay subset.
Sites []string
}
Slot is one expression-bearing request string slot.