Skip to content

ump_spec.models.client

module ump-spec

Client, profile and contract terms (onboarding, §20, §25.5, §25.9).

class

class Licence(StrictModel)

Fields

NameTypeDefaultDescription
vendorstr
productstr | NoneNone
scopeLiteral['pooled_use', 'client_only']'client_only'
feed_costfloat | NoneNoneAnnual feed cost in client currency.

Source: packages/ump-spec/src/ump_spec/models/client.py, line 92

class

class MaterialityThresholds(StrictModel)

G-MAT-01 thresholds, per account. All proposed (spec §15).

Fields

NameTypeDefaultDescription
standard_spendProposedProposed(value=250000, source='§15')
full_spendProposedProposed(value=2000000, source='§15')
full_review_costProposedProposed(value=25000, source='§15')
light_max_weeks_to_reverseProposedProposed(value=4, source="§15 'a month'")
full_min_weeks_to_reverseProposedProposed(value=13, source="§15 'a quarter'")

Source: packages/ump-spec/src/ump_spec/models/client.py, line 99

class

class ContractTerms(StrictModel)

Fields

NameTypeDefaultDescription
min_segment_sizeint50G-PRIV-01 floor from the contract.
pool_opt_inboolTrue
opt_out_channelslist[str]list()
licenceslist[Licence]list()
retention_daysint | NoneNone
query_budgetint | NoneNoneG-PRIV-03 aggregate query budget.
on_gate_failOnGateFail'fallback'Account policy (spec §15): a string for every gate or {gate_id: mode, ’*’: default}. A request never relaxes it.
strict_gateslist[str]list()Deprecated: read as on_gate_fail {gate_id: strict} entries.
materialityMaterialityThresholdsMaterialityThresholds()

Source: packages/ump-spec/src/ump_spec/models/client.py, line 109

class

class ClientProfile(StrictModel)

Fields

NameTypeDefaultDescription
namestr
verticalstre.g. apparel, beverage, beauty, insurance.
annual_media_spendfloat
currencystr'USD'
annual_revenuefloat | NoneNone
kpislist[str]lambda: ['revenue']()
channelslist[str]list()Shared-name media ids in use.
geoslist[str]list()
contactslist[str]list()Principal ids, never emails in leaves.
channel_spenddict[str, float] | NoneNoneOptional annual spend per shared-name channel id. When present, maturity’s share_spend_with_test_or_cal uses it instead of the share of channels.

Source: packages/ump-spec/src/ump_spec/models/client.py, line 124

class

class Client(ArtifactDoc)

Fields

NameTypeDefaultDescription
idstr
client_refstrSalted hash used in pooled tables; client names never pooled.
profileClientProfile
contractContractTermsContractTerms()
maturity_stageMaturityStage'none'
maturity_scorefloat | NoneNone
pool_onlyboolFalseBenchmark contributor without portfolio views.
created_atdatetime | NoneNone
onboarding_termsdict[str, Any] | NoneNoneOnboarding contract terms beyond contract: clean room, data licences, vendors. Written by onboarding (wizard.py) and core’s client view (services/clients.view).
namestr | NoneNoneCore client view only: profile.name, served flat; not stored. Written by onboarding (wizard.py) and core’s client view (services/clients.view).
verticalstr | NoneNoneCore client view only: profile.vertical, served flat; not stored. Written by onboarding (wizard.py) and core’s client view (services/clients.view).
created_bystr | NoneNoneCore client view only: the principal that created the client; not stored. Written by onboarding (wizard.py) and core’s client view (services/clients.view).
updated_atstr | NoneNoneCore client view only: last change, RFC 3339; not stored. Written by onboarding (wizard.py) and core’s client view (services/clients.view).

Source: packages/ump-spec/src/ump_spec/models/client.py, line 139

function

def gate_mode_map(
value: Any,
*,
pointer: str = '/on_gate_fail',
) -> dict[str, GateFailMode]

Normalise either form of on_gate_fail to {"*": default, gate_id: mode, ...}. None is the default fallback. Anything else is 422 SCHEMA_INVALID at pointer.

Source: packages/ump-spec/src/ump_spec/models/client.py, line 28

function

def resolve_gate_mode(
request: Any,
account: Any = None,
account_strict_gates: Iterable[str] = (),
) -> dict[str, GateFailMode]

The 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.

Source: packages/ump-spec/src/ump_spec/models/client.py, line 53

function

def gate_mode_args(
effective: Mapping[str, GateFailMode],
) -> tuple[GateFailMode, list[str]]

(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.

Source: packages/ump-spec/src/ump_spec/models/client.py, line 68

function

def gate_mode_header(effective: Mapping[str, GateFailMode]) -> str

The UMP-On-Gate-Fail echo: the string when one mode covers every gate, else the object form as compact JSON with sorted keys.

Source: packages/ump-spec/src/ump_spec/models/client.py, line 83

function

def salted_client_ref(client_id: str, salt: str) -> str

cref_<16 hex>: salted ref for pooled tables (§25.9). Erasure deletes the salt.

Source: packages/ump-spec/src/ump_spec/models/client.py, line 170

NameTypeValueDescription
MaturityStageLiteral['none', 'foundations', 'model_live', 'experimenting', 'calibrated', '...
GateFailModeLiteral['fallback', 'strict']on_gate_fail: strict turns a gate fallback into a stop (spec §15).
GATE_MODE_KEY_RE'^(\\*|G-[A-Z]+-[0-9]{2})$'
GateModeKeyAnnotated[str, StringConstraints(pattern=GATE_MODE_KEY_RE)]
OnGateFailGateFailMode | dict[GateModeKey, GateFailMode]Spec §15: the string "fallback" or "strict" for every gate, or an object mapping gate ids to either value with "*" as the default key.
MATURITY_STAGEStuple[str, ...]('foundations', 'model_live', 'experimenting', 'calibrated', 'reallocating')