<!-- [doc->REQ-DISK-FLOOR-PREFLIGHT] -->

# IR-59 instrument — `xtask disk-floor`, the run-start free-space reading

The log-the-floor half of [[IR-59]] in `docs/INFRA-REGISTER.md`. Call it as the FIRST step of any
rig or gate script, before the first cargo invocation.

```
cargo run -p xtask -- disk-floor --label <lane>
```

It prints one line whether it passes or fails:

```
disk preflight: drive=C:\ free_bytes=155184713728 floor_bytes=34359738368 label=gate-w2
```

## Why a verb and not a line in a script

The entry asks for the reading in "the rig/gate preflight path". There is no such path in this tree
to amend — the gate legs that hit this ran as **plain per-run scripts**, which is the entry's own
second face. There was nothing to add a line to, so the verb is the template: one command, carrying
the floor with it, that a rig script calls at run start.

## Flags

| Flag | Default | Means |
| --- | --- | --- |
| `--path <dir>` | cwd | the volume to read |
| `--floor-gb <n>` | `32` | refuse below this; **`0` is print-only and never refuses** |
| `--label <lane>` | none | attributes the reading on a box carrying several lanes |

`32` is the golden runner's number, so a local rig and a golden leg refuse at one floor rather than
at two. The keys are the golden runner's too (`disk preflight: drive= free_bytes= floor_bytes=`, and
`RESOURCE=disk` on refusal), so one grep reads a local rig log and a CI log alike.

## What it is answering

A full volume **reds as a linker defect that names no disk**: `LNK1318: Unexpected PDB error` (the
parenthesised code varies — do not key recognition on it), often beside `LNK4209: debugging
information corrupt`. It has also arrived as a `traceable-reqs check` PANIC carrying `os error 112`,
so even a registry red can be the disk's. Nothing in those texts says "disk". Two agents spent hours
on a mechanism for one of them and neither read free space.

**A run that starts under the floor produces reds that belong to nothing. They are re-run, never
re-read.**

## The limit, and it is the important sentence

**One reading is an INSTANT, not headroom** (IR-46). The danger window is the TAIL of a cold build,
not a steady state you can check once: the measured instance died linking the last and largest
artifact of a 74 GB pool while that same build was draining the volume out from under itself, and a
reading taken before it started looked fine. A green preflight says the run was allowed to start. It
is not a guarantee about the run.

The lever this leaves alone is pool accumulation — a pool re-accumulated to 152–169 GB within one
day of a clean, and a reap is an instant too. Free space at run start is the falsifier for a red in
hand; `xtask pool-sweep` is what keeps the number healthy.
