Skip to content

salvus.flow.acta.memo.envelope

salvus.flow.acta.memo.envelope salvus flow acta memo envelope

Cache-key envelopes.

Keys hash the canonical encoding of kv, task, impl, args, tenant, and optional salt. Arguments are represented by name and digest; salt contains the source fingerprint when impl is not explicit.

Functions

build_envelope()

def build_envelope(
    task: str,
    impl_version: int,
    args: Mapping[str, str],
    tenant: str = "local",
    salt: str | None = None,
) -> dict[str, object]: ...

Assemble the key envelope for one task execution.

Parameters
  • task str — Registered task name.
  • impl_version int — The task’s semantic implementation version.
  • args Mapping[str, str] — Argument names mapped to digests, including effective defaults. See session.arguments.key_arguments.
  • tenant str = 'local' — Tenant id. Constant "local" today.
  • salt str | None = None — Source fingerprint for tasks without an explicit impl. Omitted when None.
Returns dict[str, object] — The envelope as a plain mapping, ready for envelope_key or for storing verbatim in a manifest.

envelope_key()

def envelope_key(envelope: Mapping[str, object]) -> str: ...

Compute the cache key for an envelope.

Parameters
  • envelope Mapping[str, object] — An envelope as returned by build_envelope.
Returns str — The content digest of the envelope’s canonical JSON form.