ump_spec.models.infra
module ump-spec
Infrastructure records: lineage edges (§6), log entries and proofs (§18), CloudEvents (§19), jobs (Temporal stand-in) and run records (§13).
Classes
Section titled “Classes”LineageEdge
Section titled “LineageEdge”class
class LineageEdge(StrictModel)Fields
| Name | Type | Default | Description |
|---|---|---|---|
from_id | str | Upstream (source) artifact id. | |
to_id | str | Downstream artifact id. | |
link_type | LinkType | ||
prov_relation | str | None | None | |
role | str | None | None | |
created_at | datetime | None | None |
Methods and properties (1)
with_prov method
def with_prov(self) -> LineageEdgeSource: packages/ump-spec/src/ump_spec/models/infra.py, line 27
LogEntry
Section titled “LogEntry”class
class LogEntry(StrictModel)Spec §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.
Fields
| Name | Type | Default | Description |
|---|---|---|---|
record_id | str | Id of the sealed record (approval, decision, override, …). | |
kind | str | Kind of the sealed record. | |
content_hash | str | sha256 of the RFC 8785 bytes of the complete stored record, governance members included (differs from the §6 artifact content hash). | |
key_version | str | Version of the key that signed the record. | |
signed_at | datetime | Instant the record was sealed (RFC 3339, UTC, Z, milliseconds). | |
subject_ref | str | None | None | HMAC-SHA-256(k_subject, person_ref), only when the record relates to a person (§18 Erasure). |
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 42
CheckpointSignature
Section titled “CheckpointSignature”class
class CheckpointSignature(StrictModel)Fields
| Name | Type | Default | Description |
|---|---|---|---|
name | str | ||
key_id | str | ||
signature | str | base64 Ed25519 signature over the checkpoint body. |
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 59
TimestampToken
Section titled “TimestampToken”class
class TimestampToken(StrictModel)RFC 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.
Fields
| Name | Type | Default | Description |
|---|---|---|---|
tsa | str | 'poc-standin' | Which TSA issued the token; poc-standin is the local key. |
name | str | TSA key name. | |
key_id | str | Key hash of the TSA key, as for a signed-note signer. | |
gen_time | datetime | genTime: the checkpoint’s time. | |
message_imprint | str | hex SHA-256 over the checkpoint’s signed-note bytes as first published by the log (body, blank line and the log’s own signature lines), before any cosignature. | |
nonce | str | ||
cert_req | bool | True | |
signature | str | base64 Ed25519 signature over the canonical token fields (stand-in). |
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 65
Checkpoint
Section titled “Checkpoint”class
class Checkpoint(StrictModel)C2SP 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.
Fields
| Name | Type | Default | Description |
|---|---|---|---|
origin | str | 'ump.poc/log' | |
size | int | ||
root_hash | str | hex | |
timestamp | datetime | genTime of tsa_token once stamped; not part of the signed body. | |
signatures | list[CheckpointSignature] | list() | |
tsa_token | TimestampToken | None | None |
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 82
InclusionProof
Section titled “InclusionProof”class
class InclusionProof(StrictModel)Fields
| Name | Type | Default | Description |
|---|---|---|---|
leaf_index | int | ||
tree_size | int | ||
leaf_hash | str | ||
audit_path | list[str] | ||
root_hash | str |
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 94
ConsistencyProof
Section titled “ConsistencyProof”class
class ConsistencyProof(StrictModel)Fields
| Name | Type | Default | Description |
|---|---|---|---|
first_size | int | ||
second_size | int | ||
first_root | str | ||
second_root | str | ||
proof | list[str] |
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 102
CloudEvent
Section titled “CloudEvent”class
class CloudEvent(StrictModel)CloudEvents 1.0.2 structured JSON with UMP extension attributes. IDs and states only.
Vendor extension attributes (x<prefix><name>, spec §21) are kept on round trip; their values are
strings, integers or booleans. Any other unknown attribute is refused.
Fields
| Name | Type | Default | Description |
|---|---|---|---|
specversion | Literal['1.0'] | '1.0' | |
id | str | ||
source | str | ||
type | str | ||
time | datetime | None | None | |
subject | str | None | None | |
datacontenttype | str | None | 'application/json' | |
artifactid | str | None | None | |
artifactversion | int | None | None | |
artifactseq | int | None | None | §19: strictly increasing per artifact, whatever the event type. |
scope | str | None | None | |
data | dict[str, Any] | None | None |
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 115
JobStep
Section titled “JobStep”class
class JobStep(StrictModel)Fields
| Name | Type | Default | Description |
|---|---|---|---|
name | str | ||
status | Literal['pending', 'running', 'succeeded', 'failed', 'skipped'] | 'pending' | |
started_at | datetime | None | None | |
ended_at | datetime | None | None | |
detail | str | '' | |
data | dict[str, Any] | None | None | Optional structured progress for UIs (e2e runner: key, title, plain_summary, status, facts, links, ids, technical_log). |
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 151
class
class Job(StrictModel)Spec §19 job: state, steps and, once terminal, result or problem (RFC 9457).
Fields
| Name | Type | Default | Description |
|---|---|---|---|
id | str | ||
kind | str | ||
state | JobState | 'queued' | |
steps | list[JobStep] | list() | |
progress | float | 0.0 | |
params | dict[str, Any] | dict() | |
result | Any | None | |
problem | Problem | None | None | |
principal | str | None | None | Who submitted the job. Job routes show and cancel it only for this principal, a service, an ops role or a caller scoped to client_id. |
client_id | str | None | None | The client the job works on, when it has one. A job with no client is visible only to its submitter, services and ops roles. |
created_at | datetime | None | None | |
updated_at | datetime | None | None |
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 168
RunRecord
Section titled “RunRecord”class
class RunRecord(StrictModel)Fields
| Name | Type | Default | Description |
|---|---|---|---|
id | str | None | None | |
tool | str | e.g. ‘adapter:redacted-engine/fit’ or ‘newton:actor/draft_decision’. | |
engine | str | None | None | |
engine_version | str | None | None | |
code_commit | str | None | None | |
lockfile_hash | str | None | None | |
image_digest | str | None | None | |
dataset_hashes | list[str] | list() | |
seeds | list[int] | list() | |
principal | str | None | None | |
inputs_digest | str | None | None | |
outputs_digest | str | None | None | |
audit_level | Literal[1, 2, 3, 4] | 2 | |
started_at | datetime | None | None | |
ended_at | datetime | None | None | |
artifact_ids | list[str] | list() | |
status | Literal['succeeded', 'failed', 'refused'] | 'succeeded' | |
session_id | str | None | None | Agent or UI session the call belonged to (Newton reader/actor sessions). |
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 187
Functions
Section titled “Functions”run_audit_level
Section titled “run_audit_level”function
def run_audit_level(rec: RunRecord, deterministic_given_seed: bool) -> int§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.
Source: packages/ump-spec/src/ump_spec/models/infra.py, line 209
Constants
Section titled “Constants”| Name | Type | Value | Description |
|---|---|---|---|
LinkType | Literal['derived_from', 'calibrated_by', 'designed_from', 'scored_against', '... | ||
PROV_RELATION | dict[str, str] | {'derived_from': 'wasDerivedFrom', 'calibrated_by': 'wasInfluencedBy', 'desig... | |
DomainTag | Literal['ump/decision/v1', 'ump/gate/v1', 'ump/run/v1', 'ump/approval/v1', 'u... | ||
EVENT_EXTENSION_PATTERN | '^x[a-z0-9]+$' | §21: a vendor event attribute is x + registered prefix + name, [a-z0-9] only (CloudEvents 1.0.2). | |
JobState | Literal['queued', 'running', 'succeeded', 'failed', 'cancelled'] | Spec §19 job states; terminal states (succeeded, failed, cancelled) never change. | |
JobStatus | JobState | Deprecated Python alias of JobState (the wire member is state). |