model id + injected seams (+ optional pk field / dated sources)
Optionalassembler: FeatureAssemblyExecutoroptional FeatureAssembly executor override (tests may inject one)
Assemble a unit model's feature rows for scoring through the same AsOfFeatureAssembler training uses. The scoped
rows are read by key (only the fields that date them: the decision-date column, the grain foreign key, the time
column); each is dated by the unit's rule ('unit-rule', the reader's own rule) or, given a date, every row is read
as of that day. The assembler gets the feature columns and kept categorical levels training stored, so a value
reads and folds exactly as it did in training. A refusal (a key that is not found, a read the history does not
cover) is returned as the refused result; the scoring path throws it as a typed TrainingRefusedError. The run
reads its clock once, on its first assembly: every batch of the run is dated and assembled as of that instant and
reads its lags from one series history, built by the first batch that needs it.
the rows to score; each carries the unit row entity's primary key
the run's user and provider
'unit-rule' to date each row by the unit, or one date for every row
Run-level readiness check (the Record Set Processing Preflight seam): warm-loads
the model + artifact ONCE before the first batch, so a model that needs training
refuses the whole run with one clear message instead of failing every record into
the error-rate circuit breaker. The loaded model is the same warm cache every
record then reuses, so this costs no extra load.
A dry run (context.DryRun) never auto-trains: training creates and publishes a model, repoints the
Record Process and archives the old model, none of which a compute-only run may do. It reports the
ModelNeedsTrainingError instead.
the run-level execution context (user + provider)
Batch-score many records in one sidecar round-trip. The warm model is loaded
once; features for all rows are assembled together (transform-only), then a
single /predict carries every row. Returns one RecordResult per
input record, positionally aligned. Useful for bulk / materialization paths;
the per-record WriteBackProcessor wrapper still owns write-back when the
engine drives records individually.
the records to score (each must carry/resolve a row of data)
the execution context (user + provider)
Score one record. Warm-loads the model on first call, assembles the single
record's features (transform-only), calls the sidecar, and returns the
prediction as the record's ResultPayload. Write-back, if configured, is
applied by the WriteBackProcessor wrapper — not here.
the record to score
the per-record execution context (user + provider)
StaticMatrixConvert a row-major MatrixData into schema-ordered feature row objects. Exposed as a static method so callers and unit tests can spy on conversion counts.
StaticSeriesThe series history a unit with a Temporal Spec reads its lags from at scoring, built from the unit's rows the way
training builds it. Rows whose outcome window has not closed by the unit's cutoff are kept, not censored: a period's
value is its resolved outcome, and a lag reads it only once its outcome window has closed by the row's decision day
and the scoring day (SeriesFeatures.ComputeSeriesFeature). A period whose window closed after the unit's cutoff but
before the scoring day is therefore read, as training would read it had it run on the scoring day, and a period
still open is kept in the history but never read.
Record Set Processing scoring processor. Stateless across records except for a warm, lazily-loaded model cache (artifact + frozen contract) shared across a batch. Construct one per Record Process run.
Note on drift population: An ML Record Process with no challenger configured does not run shadow sampling, so no Feature Values are recorded and the scheduled drift sweep reports InsufficientData for it (S5).