ump_spec.models.gate
module ump-spec
Gate definitions (registry YAML) and gate results (spec §15, §25.4).
Classes
Section titled “Classes”ProposedThreshold
Section titled “ProposedThreshold”class
class ProposedThreshold(StrictModel)Fields
| Name | Type | Default | Description |
|---|---|---|---|
name | str | ||
value | Any | ||
proposed | bool | True | |
note | str | None | None |
Source: packages/ump-spec/src/ump_spec/models/gate.py, line 37
GateAppliesTo
Section titled “GateAppliesTo”class
class GateAppliesTo(StrictModel)Fields
| Name | Type | Default | Description |
|---|---|---|---|
kinds | list[str] | list() | Artifact kinds; ’*’ for every kind. |
transitions | list[str] | list() | Target states that trigger the gate (‘checks_running’, …); ’*’ all. |
operations | list[str] | list() | Non-transition hooks: combine, export, … |
Source: packages/ump-spec/src/ump_spec/models/gate.py, line 44
GateDefinition
Section titled “GateDefinition”class
class GateDefinition(StrictModel)Fields
| Name | Type | Default | Description |
|---|---|---|---|
id | str | ||
area | str | ||
title | str | ||
rule | str | Plain-words rule from the spec. | |
on_fail | OnFail | ||
instead | str | '' | What happens instead, from the spec table. |
applies_to | GateAppliesTo | GateAppliesTo() | |
fallback_handler | str | None | None | |
route_to | str | None | None | |
strict_override | bool | False | Can strict mode turn the fallback into a stop? |
strict_status | int | None | None | |
note_code | str | None | None | |
extra_note_codes | list[str] | list() | |
thresholds | list[ProposedThreshold] | list() | |
spec_ref | str | '' | |
status | RegistryStatus | 'active' | Registry status (spec §21): gates the reference implementation uses but the spec does not define are ‘provisional’ and MUST NOT be presented as normative. |
implemented_in_poc | bool | True | |
policy_version | str | 'gates/0.1.0' |
Source: packages/ump-spec/src/ump_spec/models/gate.py, line 52
GateResult
Section titled “GateResult”class
class GateResult(StrictModel)Fields
| Name | Type | Default | Description |
|---|---|---|---|
gate_id | str | ||
outcome | GateOutcome | ||
on_fail | OnFail | None | None | |
policy_version | str | 'gates/0.1.0' | |
artifact_id | str | None | None | |
artifact_version | int | None | None | |
passed | bool | True | |
message | str | '' | |
fallback_applied | str | None | None | |
fallbacks | list[FallbackEntry] | list() | |
notes | list[Note] | list() | |
route_to | str | None | None | |
evidence | dict[str, Any] | dict() | |
predicate | str | '' | Python predicate name; ‘not_implemented_in_poc’ if none. |
strict | bool | False | |
ts | datetime | None | None |
Source: packages/ump-spec/src/ump_spec/models/gate.py, line 77
Constants
Section titled “Constants”| Name | Type | Value | Description |
|---|---|---|---|
OnFail | Literal['hard_stop', 'exclude_and_continue', 'fallback', 'route', 'warn', 'in... | ||
GateOutcome | Literal['pass', 'hard_stop', 'strict_stop', 'exclude_and_continue', 'fallback... | Result outcomes. strict_stop is a fallback turned into a stop by strict mode. | |
RegistryStatus | Literal['provisional', 'active', 'deprecated'] | Status of a registry entry (spec §21, Registries). | |
APPLY_ORDER | dict[str, int] | {'hard_stop': 0, 'strict_stop': 0, 'exclude_and_continue': 1, 'fallback': 2, ... | Fixed apply order (architecture doc): hard stops, exclusions, fallbacks, routes, warnings. |
STOP_OUTCOMES | frozenset[str] | frozenset({'hard_stop', 'strict_stop'}) |