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()
current_store()def current_store() -> ContentStoreBase: ...Return the bound store, falling back to ACTA_STORE_URL.
use_store()
use_store()def use_store(store: ContentStoreBase) -> Iterator[ContentStoreBase]: ...Bind and yield the current context’s content store.
storeContentStoreBase — Store used for artifact operations inside this context.
Classes
Artifact
Artifactclass 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.
model_extra Dict[str, Any] | None
model_extra Dict[str, Any] | NoneGet 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]
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
path pathlib.PathReturn 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
payload_digest strReturn the digest of the raw serialized payload.
from_bytes()
from_bytes()def from_bytes(data: builtins.bytes) -> Artifact: ...Store data and return the artifact identifying it.
databuiltins.bytes — Bytes to store; existing objects are verified and reused.
from_file()
from_file()def from_file(path: pathlib.Path | str) -> Artifact: ...Store an existing file’s bytes and return the artifact.
pathpathlib.Path | str — Path to the file whose contents should be stored.
of()
of()def of(value: object) -> Artifact: ...Serialize value through its type’s serializer and store it.
valueobject — The object to serialize and store. AnArtifactpasses through unchanged.
bind()
bind()def bind(self, store: ContentStoreBase) -> Artifact: ...Return this artifact bound to store for later reads.
storeContentStoreBase — The storebytes/pathshould read from, taking precedence over the ambient context.
bytes()
bytes()def bytes(self) -> builtins.bytes: ...Return the artifact’s bytes, verified per store policy.
describe()
describe()def describe(self) -> ArtifactDescriptor | None: ...Return stored metadata, or None for a legacy raw artifact.
load()
load()def load(self, python_type: object = None) -> Any: ...Deserialize with the stored reader, optionally checking a type.
python_typeobject =None— Optional expected type (must have a registered serializer, the acta serialization dunders, or arrive asAnnotated[T, serializer]). Concrete subclasses are accepted and decoded with their own stored reader.