@memberjunction/feature-pipelines-engine
Server-side execution engine for Knowledge Hub Feature Pipelines (WorkType = 'Infer' on MJ: Record Processes).
All Feature Pipeline runtime logic — inference drivers, MJ: Feature Values persistence, version activation & backfill
stewardship, and golden-set test evaluation — lives here, decoupled from the generic Record Set Processing, Scheduling,
and Testing Framework substrates.
Pure specification types, constraint/escalation validators, pin hashing, and FeaturePipelineRunResults live in
@memberjunction/feature-pipelines.
Architecture & Substrate Seams
Section titled “Architecture & Substrate Seams”| Surface | Registration / Entry Point | Description |
|---|---|---|
WorkType = 'Infer' | FeaturePipelineStartup (@RegisterForStartup) -> RegisterInferRecordProcessor() | Registers the 'Infer' factory in RecordProcessorRegistry.Instance on module load and startup |
| Pipeline Drivers | LLMFeaturePipelineDriver, DecisionFeaturePipelineDriver (BaseFeaturePipelineDriver) | Turn a record’s context into structured output values via AIPromptRunner or AIDecisionRunner, with optional borderline escalation |
| Record Processor | InferProcessor (FailRunOnRecordError = true, BuildRunSummary) | Enforces version activation gates, resolves lookup taxonomies, validates output constraints & confidence floors, upserts MJ: Feature Values via FeatureValueStore, and delegates write-back |
| Version Steward | FeaturePipelineVersionSteward + StewardFeaturePipelineVersionAction (@RegisterClass(BaseAction, 'Steward Feature Pipeline Version')) | Evaluates unevaluated gated versions and runs the one backfill of an active changed version; invoked per pipeline by the scheduled 'Feature Pipeline Version Steward' MJ: Record Processes row (WorkType = 'Action', every 15 minutes via RecordProcessScheduledJobDriver) |
| Golden Set Driver | FeaturePipelineGoldenSetDriver (@RegisterClass(BaseTestDriver, 'FeaturePipelineGoldenSetDriver')), GoldenSetScorer, GoldenLabelQualityCheck | Evaluates a Feature Pipeline Golden Set test against the pipeline’s current version in one dry-run batch (BypassCache: true) and records the evaluation through FeaturePipelineVersionService |
Feature Pipeline Results (ResultSummary)
Section titled “Feature Pipeline Results (ResultSummary)”InferProcessor upserts each record’s Feature Values on their key (ValueKeyHash). Its RecordResult carries
Outcome (Unchanged or Upserted), PipelineVersion, HumanValuesPreserved, RejectedInvalid when an output
violates its constraint, and Warnings (stored in MJ: Process Run Details.Warnings).
At the end of the run, InferProcessor.BuildRunSummary builds a FeaturePipelineRunResult (via
FeaturePipelineRunResults.Build in @memberjunction/feature-pipelines) and stores it in
MJ: Process Runs.ResultSummary:
- The pin (
PromptVersionHash,PrimaryModelID,ParametersHash,SpecHash) andPipelineVersionthe run used - Tallies:
Attempted,Upserted,Unchanged,Previewed,RejectedInvalid,BelowConfidence,Failed,Skipped,HumanValuesPreserved - Because
InferProcessor.FailRunOnRecordError = true, a Feature Pipeline run with any failed or rejected record endsFailed.
Dry Runs
Section titled “Dry Runs”An Infer dry run writes nothing (no Dedup Cache entry, Feature Value, watermark, target or child row) but still calls
the model, so its MJ: AI Prompt Runs are recorded and cost what a real run of those records would.
- Without a scope or a single record it previews at most 25 records (
DryRunSampleSizeoverrides it). - A record whose real write would fail is reported
Failedwith the write-back’s reason (PreviewErrors). - It reports, in
WouldRefuse, why a real run would be refused (a version that has not passed its golden set), and never registers or activates a version.RecordProcess.RunNow/PredictiveStudio.RunFeaturePipelinereturn it aswouldRefuse; the Bulk Operations dialog then offers no Apply. - Each record’s
previewFields/previewChildren/previewTagshold only what the real write would change. Outputs withheld below their confidence floor are listed inwithheldFields(andwithheldKeptFieldswhen the column does not allow null) andwithheldChildEntities. - An output with no
Target(“Feature value only”) writes nothing to the record; its dry-run result ispreviewFeatureValues(FeatureName,Previous,Proposed), listing the Feature Values a real run would store.
Golden-Set Evaluation & Label Quality
Section titled “Golden-Set Evaluation & Label Quality”FeaturePipelineGoldenSetDriver— Driver of the Feature Pipeline Golden Set test type. Verifies that the pipeline names the test as itsActivation.GoldenSetTestIDand that model-made labels passGoldenLabelQualityCheck, runs the current version as one dry-run batch with the cache bypassed (AI Prompt Runsare recorded), scores the answers withGoldenSetScorer, and records the result on that version throughFeaturePipelineVersionService, which activates or refuses it against the pipeline’sActivationthreshold.GoldenSetScorer— Pure scoring of a golden set: per-output accuracy with alternates accepted case-insensitively and a Wilson 95% confidence interval, abstention cases (ExpectAbstain), and overall pipeline value equal to its lowest output accuracy (or0when anyRequiredcase is wrong).GoldenLabelQualityCheck— Automated quality check for model-made golden labels:Adjudicatebuilds cases from labelers A, B, and C (A–B agreement keeps A, C adjudicates disagreements, three-way disagreements are excluded) andCheckverifies a storedInputDefinition.LabelQualityrecord (two independent vendors, pairwise Wilson 95% lower bound >= 0.70, <= 5 of 52 excluded, and SHA-256 of cases) before any model call.
Version Stewardship
Section titled “Version Stewardship”FeaturePipelineVersionSteward— Evaluates a gated pipeline’s unevaluated version (running itsActivation.GoldenSetTestID) and executes the one backfill of an active changed version (records whose latest value is under another version or none, withSkipUnchanged: falseso watermarks are refreshed). A pipeline can opt out per step viaUnattended: { AutoEvaluate: false }/{ AutoBackfill: false }.StewardFeaturePipelineVersionAction— MJ Action (DriverClass = 'Steward Feature Pipeline Version') that runsFeaturePipelineVersionSteward.Instance.StewardPipelineByID(recordProcessID, { ContextUser, Provider })for a single pipeline and outputsOutcomes,Version,LastAction, andDetail.- Scheduled execution — Seeded as the
'Feature Pipeline Version Steward'MJ: Record Processesrow (WorkType = 'Action',Entity = 'MJ: Record Processes',ScopeFilter = "WorkType='Infer' AND Status='Active'"), dispatched every 15 minutes by the'Feature Pipeline Version Steward'MJ: Scheduled Jobsrow (RecordProcessScheduledJobDriver).