Skip to content

salvus.flow.acta.registry

salvus.flow.acta.registry salvus flow acta registry

Task registration and metadata.

Functions

get_task()

def get_task(name: str) -> TaskDef: ...

Look up a registered task by name.

Parameters
  • name str — The task name to look up.
Returns TaskDef

register_task()

def register_task(task_def: TaskDef) -> None: ...

Register task_def under its own name.

Replace existing registrations. Warn if a name is reused for a different function or a nested or lambda function; module-level reloads are silent.

Parameters
  • task_def TaskDef — The task metadata to register.
Returns None

registered_task_names()

def registered_task_names() -> frozenset[str]: ...

Return every currently registered task name.

Returns frozenset[str]

Classes

TaskDef

class TaskDef(builtins.object):
    def __init__(
        self,
        name: str,
        impl_version: int,
        tags: tuple[str, ...] = (),
        input_ref_names: tuple[str, ...] = (),
        input_serializers: Mapping[str, Any] = default,
        sequence_inputs: tuple[str, ...] = (),
        normalize: Callable[[dict[str, Any]], Mapping[str, Any]] | None = None,
        fn: Callable[..., dict[str, object]] | None = None,
        spec_model: type[BaseModel] | None = None,
        explicit_spec: bool | None = None,
        fingerprint: str | None = None,
        cache: bool = True,
        retention: Retention = Retention.STANDARD,
        fingerprint_parts: Mapping[str, str] = default,
    ) -> None: ...

Metadata for a registered task.

Parameters
  • name str — Unique task name used for lookup, cache keys, and deployment names.
  • impl_version int — Implementation version included in the cache key.
  • tags tuple[str, ...] = () — Placement tags, excluded from cache keys.
  • input_ref_names tuple[str, ...] = () — Names of arguments represented by content digests.
  • input_serializers Mapping[str, Any] = <factory> — Serializer for each input argument, or None for raw artifacts. Empty for manual registrations.
  • sequence_inputs tuple[str, ...] = () — Input names accepting ordered sequences of digests.
  • normalize Callable[[dict[str, Any]], Mapping[str, Any]] | None = None — Argument normalizer for cache keys and manifests. Does not change arguments passed to the task body.
  • fn Callable[..., dict[str, object]] | None = None — Callable using the executor dispatch convention, or None for remote-only tasks.
  • spec_model type[BaseModel] | None = None — Parameter model, or None for low-level registrations.
  • explicit_spec bool | None = None — Whether the body receives a spec model; None for low-level registrations.
  • fingerprint str | None = None — Source fingerprint, or None when impl is explicit.
  • cache bool = True — Whether to memoize results. If false, execution skips locks, records, and manifests; outputs are still stored.
  • retention Retention = Retention.STANDARD — Result lifetime recorded at commit, excluded from cache keys.
  • fingerprint_parts Mapping[str, str] = <factory> — Qualified names and source digests for diagnostics. Empty when impl is explicit.