Skip to content

salvus.flow.acta.memo.labels

salvus.flow.acta.memo.labels salvus flow acta memo labels

Mutable labels for computation keys and artifact references.

Functions

load_by_label()

def load_by_label(
    name: str | Label, store: ContentStoreBase, record_store: RecordStore
) -> Any: ...

Load the single stored value named by a key or ref label.

Key labels require exactly one single-digest output. Ref labels identify the artifact directly. This lookup does not execute tasks or use shared publication bindings. Missing readers raise TypeError; storage and decoding errors propagate.

Parameters
  • name str | Label — Exact label name, or a label whose current target must still match. Only key and ref are compared, not creation time. This check does not lock the label throughout loading.
  • store ContentStoreBase — Content store holding the artifact and its payload.
  • record_store RecordStore — Record store containing the label and any record.
Returns Any — The deserialized Python value.

validate_label_name()

def validate_label_name(name: str) -> str: ...

Validate and return a label name.

Parameters
  • name str — The candidate name.
Returns str — The same name, so this can be used inline at a call site.

Classes

Label

class Label(builtins.object):
    def __init__(
        self, name: str, key: str | None, ref: str | None, created_at: str
    ) -> None: ...

A named computation key or artifact reference.

Parameters
  • name str — The label name, unique within a record store.
  • key str | None — The envelope key this label names, or None when it names bytes instead.
  • ref str | None — The content digest this label names, or None when it names a computation instead.
  • created_at str — Time the label was assigned to its current target.
Attributes
kind str

Return 'key' or 'ref', for display.

target str

Return whichever of key/ref this label carries.

Raises: RuntimeError: If neither target is set.