provrun.stagers

Stagers: make granted snapshots visible to the agent.

InProcessStager copies each snapshot into the input folder of the run, with a copy-on-write clone where the disk has one, and keeps every file read-only. A clone shares no inode with the snapshot, so nothing a run does to its inputs reaches the snapshot that other runs use. The PydanticAI backend mounts that folder read-only at /input. The Docker stager will bind-mount the same folder; a Foundry stager will upload the files instead, so integrity rests on the digests, which verify_inputs checks after the run.

class InputCheckError

source

A staged input changed during the run.

class Stager

source

Makes the snapshots of a run visible to its agent, and checks them after the run.

Stager.stage

source

Stager.stage(ctx: RunContext, inputs: list[tuple[str, Snapshot]]) -> RunSpec

Stage (name, snapshot) pairs for one run.

Parameter Type Default Description
ctx RunContext required The run; its recorder takes the evidence
inputs list[tuple[str, Snapshot]] required Each input’s name under /input, and its snapshot
returns RunSpec The staged inputs and the run’s folders, as the backend gets them

Stager.verify_inputs

source

Stager.verify_inputs(ctx: RunContext, run: RunSpec) -> None

Hash each staged input again, and write input_verified for each.

Raises InputCheckError if one changed.

Parameter Type Default Description
ctx RunContext required The run; its recorder takes one input_verified for each input
run RunSpec required The run spec that stage returned

class InProcessStager

source

Copies each snapshot, read-only, into the run folder’s input folder.

InProcessStager.stage

source

InProcessStager.stage(ctx: RunContext, inputs: list[tuple[str, Snapshot]]) -> RunSpec

Copy each snapshot to /input/, and check its SHA-256.

Then make the input folder read-only. Raises ValueError for a bad or repeated name, and InputCheckError if a copy differs from its snapshot.

Parameter Type Default Description
ctx RunContext required The run; its folder holds the input folder, and its recorder takes input_staged
inputs list[tuple[str, Snapshot]] required Each input’s name, one part of a path and not repeated, and its snapshot
returns RunSpec The staged inputs, seen by the agent at /input/, and the run’s output and scratch folders