Skip to main content

Module write_limits

Module write_limits 

Source
Expand description

Deciding whether an agent may write, and how much.

Three questions, deliberately answered separately because they are not the same kind of thing (issue #252):

  1. Will this fill the disk? Always asked, not configurable away. A run that filled C: took the machine down with it, and every other process on it. Nobody wants that outcome, so nothing offers it.
  2. Is one call writing an absurd amount? Off unless configured. The reported incident was a single shell call appending in a loop until the 60-second timeout - about 14 GB - and a per-call ceiling is what would have caught it.
  3. Is the whole run writing an absurd amount? Also off unless configured. Three calls of 12-14 GB each is the shape 2 alone misses.

2 and 3 default to off in code and on in a fresh config. How much an agent should be allowed to write is a judgement about what the user is doing with it, not something this crate can know - so the code imposes nothing. lev setup writes concrete values into config.toml, where they are visible and can be deleted outright by anyone who wants no ceiling.

Structs§

WriteLimits
The ceilings in effect for one run.

Enums§

WriteVerdict
Why a write was refused, or that it was not.

Constants§

MIN_FREE_BYTES
How much free space must remain before a write is refused.

Functions§

check_write
Whether a write of bytes may proceed.