Mondaic

salvus.flow.acta.store.artifact

salvus.flow.acta.store.artifact salvus flow acta store artifact

Digest-based artifact references and context-local store bindings.

Functions

current_store()

def current_store() -> ContentStoreBase: ...

Return the bound store, falling back to ACTA_STORE_URL.

Returns ContentStoreBase — The bound or environment-resolved store.

use_store()

def use_store(store: ContentStoreBase) -> Iterator[ContentStoreBase]: ...

Bind and yield the current context’s content store.

Parameters
  • store ContentStoreBase — Store used for artifact operations inside this context.
Returns Iterator[ContentStoreBase]

Classes

Artifact

class Artifact(pydantic.main.BaseModel):
    def __init__(self, **data):
        ...

A stored, immutable object, identified by its digest.

Args: digest: Content digest used for identity, equality, and serialization.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Attributes
model_extra Dict[str, Any] | None

Get extra fields set during validation.

Returns: A dictionary of extra fields, or None if config.extra is not set to "allow".

model_fields_set set[str]

Returns the set of fields that have been explicitly set on this model instance.

Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.

path pathlib.Path

Return a read-only local path to the artifact’s bytes.

Materialize and cache the path on first access. Use the backend’s local file when available, otherwise fetch to a temporary file.

payload_digest str

Return the digest of the raw serialized payload.

Methods
from_bytes()
def from_bytes(data: builtins.bytes) -> Artifact: ...

Store data and return the artifact identifying it.

Parameters
  • data builtins.bytes — Bytes to store; existing objects are verified and reused.
Returns Artifact
from_file()
def from_file(path: pathlib.Path | str) -> Artifact: ...

Store an existing file’s bytes and return the artifact.

Parameters
  • path pathlib.Path | str — Path to the file whose contents should be stored.
Returns Artifact
of()
def of(value: object) -> Artifact: ...

Serialize value through its type’s serializer and store it.

Parameters
  • value object — The object to serialize and store. An Artifact passes through unchanged.
Returns Artifact
bind()
def bind(self, store: ContentStoreBase) -> Artifact: ...

Return this artifact bound to store for later reads.

Parameters
  • store ContentStoreBase — The store bytes/path should read from, taking precedence over the ambient context.
Returns Artifact
bytes()
def bytes(self) -> builtins.bytes: ...

Return the artifact’s bytes, verified per store policy.

Returns builtins.bytes
describe()
def describe(self) -> ArtifactDescriptor | None: ...

Return stored metadata, or None for a legacy raw artifact.

Returns ArtifactDescriptor | None
load()
def load(self, python_type: object = None) -> Any: ...

Deserialize with the stored reader, optionally checking a type.

Parameters
  • python_type object — Optional expected type (must have a registered serializer, the acta serialization dunders, or arrive as Annotated[T, serializer]). Concrete subclasses are accepted and decoded with their own stored reader.
Returns Any