salvus.flow.acta.memo.protocol
salvus.flow.acta.memo.protocol salvus flow acta memo protocol Cache lookup, output verification, and result commit.
Functions
all_refs_resolve()
all_refs_resolve()def all_refs_resolve(
output_refs: Mapping[str, Any], store: ContentStoreBase
) -> bool: ...Check output descriptors and their payloads exist in store.
Parameters
output_refsMapping[str, Any] — Mapping from output name to a single digest or a list of digests.storeContentStoreBase — The content store to check presence against.
Returns bool
commit()
commit()def commit(
records: RecordStore,
key: str,
task: str,
envelope: dict[str, Any],
arg_values: dict[str, Any],
output_refs: dict[str, Any],
timings: dict[str, float],
package_names: tuple[str, ...] = ("salvus",),
provenance: dict[str, Any] | None = None,
fingerprint_parts: Mapping[str, str] | None = None,
retention: Retention = Retention.STANDARD,
run_id: str | None = None,
input_snapshot: dict[str, Any] | None = None,
from_binding: bool = False,
) -> Manifest: ...Write a manifest for a fresh computation and commit its record.
Parameters
recordsRecordStore — The record store to write into.keystr — The envelope key this execution was computed for.taskstr — Task name.envelopedict[str, Any] — The full envelope mapping (seesalvus.flow.acta.memo.envelope.build_envelope).arg_valuesdict[str, Any] — The call’s raw argument values, after normalizing and eliding. Stored soexplaincan name a changed argument; never hashed.output_refsdict[str, Any] — Mapping from output name to digest(s); every digest must already be present in the content store before this is called.timingsdict[str, float] — Mapping from stage name to elapsed seconds.package_namestuple[str, ...] =('salvus',)— Packages whose installed versions to record; missing packages are omitted.provenancedict[str, Any] | None =None— Execution metadata, such as worker hostname and backend. The manifest’s own hostname identifies the calling process.fingerprint_partsMapping[str, str] | None =None— The per-node digests behind the task’s fingerprint, soexplaincan name a changed reference. Omit for a task that pinsimpl.retentionRetention =Retention.STANDARD— Retention class to store on the record.run_idstr | None =None— The run this execution belonged to, orNone.input_snapshotdict[str, Any] | None =None— Full dispatch inputs, orNoneif unavailable.from_bindingbool =False— Whether to adopt a published result. Local invalidation markers block adoption.
Returns Manifest — The newly-written manifest.
lookup()
lookup()def lookup(
records: RecordStore, store: ContentStoreBase, key: str
) -> Hit | Miss: ...Look up key, verifying its payloads before reporting a hit.
Delete records with missing outputs and report a miss. On a hit, update
last_used_at if it is older than TOUCH_COALESCE_AFTER.
Parameters
recordsRecordStore — The record store to query.storeContentStoreBase — The content store whose payloads back the record.keystr — The envelope key to look up.
Returns Hit | Miss —
Hit if the record exists and every output ref resolves; Miss otherwise.Classes
Hit
Hitclass Hit(builtins.object):
def __init__(
self, output_refs: dict[str, Any], manifest: Manifest
) -> None: ...A verified cache hit: record and payloads both present.
Parameters
output_refsdict[str, Any] — Mapping from output name to digest(s), as stored in the record.manifestManifest — The manifest that produced this record.
Miss
Missclass Miss(builtins.object):
def __init__(self) -> None: ...No usable record: either none exists, or its refs were dangling.