Skip to content

ump_spec.models

module ump-spec

All UMP contract models. Import from here: from ump_spec.models import Estimand, ShownNumber.

ModuleWhat it holds
ump_spec.models.benchmarkBenchmark store rows (spec §25.9): evidence, cells, prior cards, release ledger, maturity.
ump_spec.models.calibrationCalibration record (spec §10): routes R1 to R6, checks 0 to 6, PSIS diagnostics.
ump_spec.models.capabilityCapability manifest (spec §8) and capability lifecycle (§16).
ump_spec.models.clientClient, profile and contract terms (onboarding, §20, §25.5, §25.9).
ump_spec.models.commonShared value objects: Interval, FallbackEntry, Note, ShownNumber, Problem (RFC 9457).
ump_spec.models.connectionData connections: reusable, client-scoped access to data UMP may read but not keep (POC blueprint DATA-CATALOGUE §2 and §6; a proposed addition to spec §6 and §20, see context/open-questions.md).
ump_spec.models.contractWorkflow input contract: the “same necessary shape” a saved workflow accepts on new data.
ump_spec.models.datasetDatasets, deliveries and transform steps (spec §6).
ump_spec.models.decisionDecision records and approvals (spec §12, §15, §18).
ump_spec.models.estimandSeven-field estimand (spec §5) and its scope (applies_to).
ump_spec.models.evidenceEvidence cards (spec §17, §19 /evidence-card) and acceptance reports (§14).
ump_spec.models.experimentTest plans and results (spec §9, EMA guide §5).
ump_spec.models.gateGate definitions (registry YAML) and gate results (spec §15, §25.4).
ump_spec.models.infraInfrastructure records: lineage edges (§6), log entries and proofs (§18), CloudEvents (§19), jobs (Temporal stand-in) and run records (§13).
ump_spec.models.lifecycleArtifact envelope and the one state machine for every kind (spec §15).
ump_spec.models.modelModel manifest (spec §7), tiers, dependence declaration, acceptance status (§14).
ump_spec.models.planningScenarios and optimisation results (spec §8 ladder, §12).
ump_spec.models.recipeTransform recipes: how a derived dataset was made (POC blueprint TRANSFORM-RECIPES §4 and §6; spec §6).

Documented on the page of the module that defines them.

NameKindSummary
ACCEPTANCE_LAYERSconstant
ADMISSIBILITYconstantG-EXP-05: only A to C calibrate incrementality. E feeds the brand family only.
APPLY_ORDERconstantFixed apply order (architecture doc): hard stops, exclusions, fallbacks, routes, warnings.
APPROVAL_TRANSITIONSconstantTransitions that need an approval (POST :approve), not a plain :transition.
ARTIFACT_KINDSconstant
ARTIFACT_STATESconstant
CALIBRATION_CHECKSconstant
CAPABILITY_LIFECYCLEconstant
CAPABILITY_TRANSITIONSconstantAny state may go to withdrawn immediately (§16).
CATALOGUE_FINGERPRINT_BASISconstantBasis of inputs[].catalogue_fingerprint: rules.canonical_rows_fingerprint over the frame’s cells as plain JSON values, the same basis a connected dataset registers its sha256 under.
CHECK_GATESconstant
CONNECTOR_KINDSconstant
COPY_POLICIESconstant
CURRENCY_REconstantISO 4217 alpha-3 code (spec §5 unit.currency).
DATA_USESconstant
ESTIMAND_FIELDSconstantThe seven estimand fields, in spec order.
EXTRACTION_ORDERconstantBest to worst; a model shows the lowest rating among its inputs.
FAMILY_ALIASESconstantLabels seen in briefs and adapters mapped to the canonical ModelFamily value.
FAMILY_NOTESconstantPlain words per family. Experiments are not a model family (see adapter.AdapterKind).
FAMILY_REQUESTSconstant
HARNESS_MEASURESconstantThe six §17 harness measures (injection resistance split into write/run successes and exfiltrations).
INPUT_CONTRACT_VERSIONconstant
MATURITY_STAGESconstant
MODEL_FAMILIESconstant
PER_VALUESconstantunit.per values (spec §5).
PROV_RELATIONconstant
RECIPE_FINGERPRINT_BASISconstantBasis of inputs[].fingerprint and output.fingerprint (the client package’s round-trip rule).
RECIPE_NOTE_CODESconstant
RECIPE_SCHEMA_VERSIONconstant
RECIPE_STEP_HASH_BASISconstant
RECIPE_VERIFICATION_STATUSESconstant
ROUTESconstant
STANDARD_REQUESTSconstant
STOP_OUTCOMESconstant
TIERSconstant
TIER_NAMESconstant
TRANSITIONSconstantAllowed transitions. checks_failed -> draft and rejected -> draft let an author revise (a new version); the spec’s arrows are the forward path.
UNDECLAREDconstantThe wire word for a field the source did not declare (spec §5).
AcceptanceLayerclass
AcceptanceMetricclass
AcceptanceReportclass
AcceptanceStatusclass§14: three layers. Untested is usable with reduced trust; failed is excluded (G-ACC-01).
AcceptanceStatusValueconstant
AccessPolicyclassAccess rules on a data connection, copied onto each connected dataset (POC DATA-CATALOGUE §2).
AdmissibilityClassconstant
AgentEvalReportclass§17 agent evaluation harness run (G-NEW-03 release gate) for one agent version.
AllocationLineclass
AppliesToclassScope beside the estimand: compared by G-EST-02 like the seven fields.
Approvalclass
ApproveRequestclass
ArtifactclassCatalogue row (one per version). doc holds the kind-specific body.
ArtifactKindconstant
ArtifactStateconstant
AuditLevelconstant§13: 4 exact rerun, 3 close rerun, 2 logged, 1 taken on trust.
BaselineKindconstant
BenchmarkCellclass
BenchmarkEvidenceclassOne evidence row. client_ref is salted; client names never enter pooled tables.
BenchmarkRowconstant
Calibrationclass
CalibrationCheckclass
CalibrationSupportclass
CapabilityManifestclass
CapabilityStatusconstant
CastResultconstant
CategoryProfileclassA categorical column’s level set in the input frame (hashes and count, never values). rows counts the rows per level hash, so a note can say how many rows a new level excludes.
ChannelResultclass
CheckOutcomeconstant
CheckpointclassC2SP tlog-checkpoint: the signed body is origin, decimal tree size and base64 root hash only. Its time is the genTime of the RFC 3161 token held beside it (tsa_token), never a line in the body.
CheckpointSignatureclass
Clientclass
ClientMaturityclass
ClientProfileclass
CloudEventclassCloudEvents 1.0.2 structured JSON with UMP extension attributes. IDs and states only.
ColumnProfileclassOne column of the input frame. cast is the caller’s cast result to the contract dtype (None when the contract names no dtype for the column).
Conflictclass
ConnectionTestclassResult of POST /v1/connections/{id}:test: reachability, auth and schema. No rows.
ConnectorKindconstant
ConsistencyProofclass
ContractTermsclass
ControlOutcomeclass
CopyPolicyconstantallowed: may be cached to the blob store. transient_only: rows live in memory for one run (the default for connections). aggregates_only: clean room, only aggregates above the minimum segment size come out (G-PRIV-01..03 run on every fetch).
CostBasisconstant
CurveParamsclassTier B per-channel curve.
DataConnectionclass
DataUseconstantWhat a client lets UMP do with the data. Benchmark pooling is off unless listed and the licence allows it.
Datasetclass
DatasetStorageconstant
DecisionRecordclass
DeliveryclassG-DATA-01 intake record.
DependenceDeclarationclass
DependenceKindconstant
Designconstant
DomainTagconstant
EstimandclassThe seven fields plus applies_to and the registered optional members. None (written "undeclared") means undeclared.
Estimatorconstant
EvidenceCardclass
Excisionclass
ExcisionModeconstant
Expectedclass
ExtractionRatingconstant
FallbackEntryclass§19 fallback note. effect says how the interval changed, in plain words.
FetchRecordclassWhat a run saw when it read a dataset (POST /v1/datasets/{id}:materialize). Run records and model lineage keep this record, never the rows of a transient_only dataset.
FieldStatusconstant
FingerprintBasisconstantWhat sha256 hashes: the raw file’s bytes (stored) or the canonical JSON of the query result’s rows (connected; rules.canonical_rows_fingerprint).
FrameProfileclassEverything the input check reads about a frame, with no row values in it.
GateAppliesToclass
GateDefinitionclass
GateFailModeconstanton_gate_fail: strict turns a gate fallback into a stop (spec §15).
GateOutcomeconstantResult outcomes. strict_stop is a fallback turned into a stop by strict mode.
GateResultclass
HorizonclassTime over which the effect is counted. {type: window, anchor: fit} is the model’s fit window: a template written before any fit (an adapter’s metadata) leaves weeks absent, and every quantity a fit produces states weeks (spec §5, “Fit-window horizon”). weeks is never null.
HorizonTypeconstant
HostedEndpointclassTier X.
InclusionProofclass
InputContractclassWhat new input must look like for a saved workflow to rerun on it.
InputModeconstant
InputNoteclassOne finding about the input, in plain words. Never carries row values.
InputReportclassThe outcome of checking input against a workflow’s contract. ok is false when a note refuses; route is where the rerun goes (score, refit, or not available).
InputRouteconstant
InputSeverityconstant
InputVarclassA variable the workflow reads. required: false makes it optional: absent gives a warning.
IntegrityRefclass
Intervalclass
IntervalMethodconstant
IntervalSpecclass
Interventionclass
InterventionTypeconstant
JobclassSpec §19 job: state, steps and, once terminal, result or problem (RFC 9457).
JobStateconstantSpec §19 job states; terminal states (succeeded, failed, cancelled) never change.
JobStatusconstantDeprecated Python alias of JobState (the wire member is state).
JobStepclass
LadderStepconstant
LayerNameconstant
LayerStatusclass
LevelSetclassA categorical column’s levels without the values: the sha256 (hex) of the canonical JSON of the sorted unique non-null level values (as strings), their count, and the sorted sha256 of each level’s canonical JSON (empty in contracts written before per-level hashes; the check then compares the set hash and count only).
Licenceclass
LicenceLimitsclassVendor or client licence limits checked before export (spec §20).
LineageEdgeclass
LinkTypeconstant
LogEntryclassSpec §18 log entry: the record appended under a domain tag. The leaf is SHA-256(0x00 || domain_tag || 0x0A || JCS(log_entry)); the record itself is bound by content_hash.
MaterialityInputsclass
MaterialityThresholdsclassG-MAT-01 thresholds, per account. All proposed (spec §15).
MaterialityTierconstant
Materializationconstant
MaturityStageconstant
MetricFamilyconstant
ModelFamilyconstant
ModelManifestclass
Moderatorsclass
NoteclassInformational or warning note (e.g. ENGINE_STUB, NOT_IMPLEMENTED_IN_POC).
OnFailconstant
OnGateFailconstantSpec §15: the string "fallback" or "strict" for every gate, or an object mapping gate ids to either value with "*" as the default key.
OperationSupportconstant
OptimisationResultclass
Outcomeconstant
Perconstant
PeriodclassCalendar dates, half-open [start, end) (spec §4).
PlanLineclass
PointRuleconstant
PointRuleSpecclass{rule, scale} form of point_rule (spec §5): scale is identity or log.
PointScaleconstant
PoolStatusconstant
Populationconstant
PowerAnalysisclass
Preregistrationclass
PriorCardclass
PrioritySnapshotclass§11 test prioritisation snapshot: model version, joint draws used, scores, the kept portfolio (P1 cost-scaled greedy on EIG vs P2 best single test), alternatives by joint EVOI and the reason for any override. Briefs MUST NOT claim the (1 - 1/e) bound for EVOI or budget-constrained selection, so guarantee_note states what is (and is not) guaranteed. Signed off by the measurement lead.
ProblemclassRFC 9457 problem details plus the UMP extension members of spec §19: stable code, gate_id, pointer, suggested_action, errors (every problem when several are returned) and untrusted_text kept apart from platform text. type is always the code’s registered URI. Served as application/problem+json.
ProblemIssueclassOne entry of a problem’s errors member (spec §19): {code, gate_id, pointer, detail}.
ProposedThresholdclass
PsisDiagnosticsclass
ReaderSpecclass
Realisedclass
RecipeCaptureconstant
RecipeCellclass
RecipeEnvironmentclass
RecipeExternalInputclassA recipe input with no catalogued match in the client’s scope (UNCATALOGUED_INPUT).
RecipeInputclass
RecipeInputMatchclassA recipe input matched to a catalogued dataset in the same client’s scope (a derived_from edge).
RecipeNoteclass
RecipeNoteCodeconstant
RecipeOutputclass
RecipeRefclassWhat a catalogued dataset keeps of its recipe (Dataset.recipe). The body lives in the blob store.
RecipeStepclass
RecipeVerificationclass
RecipeVerificationRefclassThe recipe’s own verification as uploaded. Self-reported: apps/data never replays a recipe.
RecipeVerificationStatusconstantnot_checked is untested, not failed (RECIPE_UNVERIFIED).
RegistryStatusconstantStatus of a registry entry (spec §21, Registries).
ReleaseLedgerEntryclass
Representationconstant
Routeconstant
RunRecordclass
Scenarioclass
ScenarioResultclass
SecretStatusclassAll the API ever echoes about a secret: its reference, whether one is set, and when it changed. Rotating the secret changes updated_at, never the connection’s id.
ShownNumberclassThe display contract: a value can only be shown with its interval, estimand and trust labels.
SizeKindconstant
SourceTypeconstant
SpendGridclassTier C declaration. Grid >= 21 points from 0 to 2.5x current spend is proposed (§7).
StageFlagclass
SummaryNumberclassTier D: ROI or mROI at current spend only.
TestPlanclass
TestResultclass
Tierconstant
TimeProfileclassThe time column of the input frame. duplicates counts rows whose time value repeats (expected in a panel); regular is false when a time is off the frequency’s grid; gaps counts missing steps inside the range at the frequency.
TimestampTokenclassRFC 3161 time-stamp token held beside a checkpoint, never a cosignature (spec §18). The POC signs with a local key standing in for a TSA (tsa: poc-standin); a real token is a CMS SignedData blob.
TransformRecipeclass<output>.recipe.json: inputs by hash, steps, notebook cells, the output’s fingerprint and the analyst’s own replay check.
TransformStepclass
TransformTypeconstant
TransitionRequestclass
TrustLevelconstant1 is lowest (taken on trust / unvalidated vendor). POC scale 1..4.
Unitclassper is spend, impression or absolute. currency (ISO 4217) is required with per: spend and allowed with per: absolute (a money KPI); there its absence means the KPI is not money. Build a spend unit with spend_unit(currency).
allowed_transitionsfunction
as_audit_levelfunctionNarrow an int to AuditLevel (raises ValueError outside 1..4), for typed callers.
can_transitionfunction
capability_transition_allowedfunction
check_approvalfunction§15 invariants (G-INT-02, hard stop): approver is a human with the approver role, is neither the submitter nor the owner nor an author of the version (the reviewer is “never the builder”), never an agent or API token; only the measurement lead approves calibrations; a rejection needs a comment.
check_transitionfunctionRaise UmpError(INVALID_TRANSITION) when src -> dst is not allowed.
gate_mode_argsfunction(mode, strict_gates) for gates.evaluate. A "*": strict map with named fallback gates becomes fallback mode with every other strict-capable gate (strict_override) listed.
gate_mode_headerfunctionThe UMP-On-Gate-Fail echo: the string when one mode covers every gate, else the object form as compact JSON with sorted keys.
gate_mode_mapfunctionNormalise either form of on_gate_fail to {"*": default, gate_id: mode, ...}. None is the default fallback. Anything else is 422 SCHEMA_INVALID at pointer.
make_dataset_reffunctiondataset://{scope}/{name}@sha256:{hash}.
normalise_legacy_estimandfunctionRead a stored estimand written before the spec §5 wire rules (fixtures, old docs; never a writer).
normalise_legacy_unitfunctionRead compatibility for one cycle: per: "<ccy>_spend" becomes per: spend plus currency: "CCY", and null members are dropped. Other values pass through unchanged (a per-thousand unit such as usd_k_spend is rescaled by its adapter, never here).
normalize_familyfunctionCanonical family for a label ("brand_funnel/track" -> "media_tracking").
parse_dataset_reffunction
principal_kindfunctionuser:maya.chen -> user; agent:newton-actor -> agent; token:... -> token.
psis_khat_thresholdfunction§10 (proposed): k-hat < min(1 - 1/log10(S), 0.7).
resolve_gate_modefunctionThe effective mode per gate: the stricter of the request and the account policy (spec §15: a request MUST NOT relax a gate the account sets to strict). The account’s deprecated strict_gates map in as strict entries.
run_audit_levelfunction§13: a level 3 or 4 claim needs a lockfile, an image digest, the code commit and the dataset hashes; without any of them the run is capped at level 2. Level 4 also needs seeds and a deterministic engine.
salted_client_reffunctioncref_<16 hex>: salted ref for pooled tables (§25.9). Erasure deletes the salt.
spend_unitfunctionMembers of a per-spend unit (spec §5): {"per": "spend", "currency": "USD", ...}. currency is an ISO 4217 code; lower case is upper-cased. Splat it into a unit dict or Unit(**...).
validity_expiredfunctionSpec §7: the window is half-open [valid_from, valid_to), so a model is expired when valid_to <= now. No (or an unreadable) valid_to never expires.
validity_instantfunctionA validity bound as a UTC instant (spec §4 time profile, §7 half-open window). A calendar date (2026-01-01 or a date) reads as midnight UTC; a naive datetime reads as UTC; an offset is converted. Anything unreadable (or empty) is None.
without_unsetfunctionA producer’s own estimand dict with every None member dropped, at any depth, so optional state that is not known (no client id, no period) is left out instead of written as null. Use it only on dicts the producer builds; received input is validated as sent, where null is refused.
worst_extractionfunction

function

def validate_doc(kind: str, doc: dict[str, Any]) -> BaseModel

Validate an artifact doc against its kind. Raises UmpError(SCHEMA_INVALID) with every issue at once (pointer per issue).

Source: packages/ump-spec/src/ump_spec/models/__init__.py, line 305

function

def validation_issues(errors: Any, prefix: str = '') -> tuple[str, list[ProblemIssue]]

Pydantic errors as problem issues with JSON pointers under prefix. An estimand member the contract does not recognise is its own issue per member with code ESTIMAND_UNKNOWN_FIELD (spec §5), and that code then names the problem; anything else is SCHEMA_INVALID.

Source: packages/ump-spec/src/ump_spec/models/__init__.py, line 323

NameTypeValueDescription
KIND_DOC_MODELSdict[str, type[BaseModel]]{'dataset': Dataset, 'transform_step': TransformStep, 'model_manifest': Model...Artifact kind -> Pydantic model for its doc body.