provrun.resolve

Resolution: from a granted URI to a read-only snapshot.

ProvcatResolver pins the URI through provcat, fetches that version and copies it into a snapshot that no later fetch changes. It writes context_resolved and snapshot_materialized.

class Snapshot

source

Snapshot(uri: str, pinned: str, path: Path, digest: str, kind: str)

One granted input, copied where no later fetch changes it.

Parameter Type Default Description
uri str required The URI as asked for
pinned str required The physical URI at a fixed version, where the store has versions
path Path required A read-only file or folder
digest str required The SHA-256 of the file, or of the folder as provcat.cache.tree_digest defines it
kind str required “file” or “folder”

class Resolver

source

Turns a grant into a read-only snapshot of what it grants.

Resolver.snapshot

source

Resolver.snapshot(ctx: RunContext, grant: Grant) -> Snapshot

Make the snapshot of one granted input, and write its evidence.

Parameter Type Default Description
ctx RunContext required The run that asks; its recorder takes the evidence
grant Grant required The broker’s grant for one input
returns Snapshot The snapshot of the granted URI

class ProvcatResolver

source

ProvcatResolver(catalog: Catalog)

Pins each granted URI through provcat and snapshots that version.

Parameter Type Default Description
catalog Catalog required The catalog that resolves, pins and fetches each URI

ProvcatResolver.snapshot

source

ProvcatResolver.snapshot(ctx: RunContext, grant: Grant) -> Snapshot

Resolve the granted URI, then snapshot it through the catalog at a pinned version.

Parameter Type Default Description
ctx RunContext required The run that asks; its recorder takes context_resolved and snapshot_materialized
grant Grant required The broker’s grant; a deny raises ValueError
returns Snapshot The pinned, read-only snapshot, with its SHA-256 and kind