Skip to main content

measured_write_bytes

Function measured_write_bytes 

Source
pub fn measured_write_bytes(
    tool_name: &str,
    arguments: &Value,
    workdir: &Path,
) -> u64
Expand description

How many bytes a finished shell call put on disk, for charging the run’s budget.

The current size of every literal redirect target, measured now that the command has run - which is the only moment those bytes are visible to Leviath at all.

Zero for a declaring tool. Those are charged when they are checked, before the batch runs: a batch’s calls are all authorized before any of them execute, so a per-run budget charged only afterwards would let every call in one batch check against a budget none of them had spent yet. Charging a known size up front is what makes the second write in a two-write batch see the first.

A target that no longer exists, or was never created, contributes nothing: a command that failed should not spend the run’s budget on a file it did not write.