nx_ingest_admit.nx
buildroot/runtime/nx_ingest_admit.nx
about
nx_ingest_admit.nx -- INGEST ADMISSION CONTROL (/compare/mediaingest R2; contract symbol ig_disk_floor).
WHY: a capture path that writes an asset onto a filesystem below its free-space floor risks a TORN write --
a half-written file that then classifies as a real item. Harvestr guards this with min_disk_gb plus a disk
manager; ours had the disk axis (sys_fs_avail_bytes, landed in nx_syscalls 2026-08-27) and NOTHING in the
capture path read it. This is the one admission check every capture verb calls before it opens a destination.
THREE STATES, because "I could not measure the disk" is not "the disk is fine":
IG_ADMIT the volume holding <root> has at least <floor> bytes free to a non-root writer
IG_REFUSE_FULL measured, and below the floor -- the capture must not write
IG_UNMEASURABLE statfs failed (unmounted / permission / gone) -- FAIL-CLOSED: the caller must refuse, because
"unmeasurable" read as "empty" is the most flattering possible lie (nx_syscalls says so of
the permil twin). A transient statfs failure blocking one capture is safe; a torn write is not.
The floor is DATA (rule 11): knowledge/status/ingest_floor.conf holds a single decimal byte count; absent or
unreadable falls back to IG_DEFAULT_FLOOR_BYTES, named for its purpose, never buried as a literal at a call site.
license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_ingest_admit_gate.nxnx_vault_capture.nx
structs
| none |
consts
| 20 | const IG_ADMIT: i64 = 0 |
| 21 | const IG_REFUSE_FULL: i64 = 1 |
| 22 | const IG_UNMEASURABLE: i64 = 2 |
| 26 | const IG_DEFAULT_FLOOR_BYTES: i64 = 5368709120 |
| 27 | const IG_FLOOR_CONF: *u8 = "knowledge/status/ingest_floor.conf" |
| 28 | const IG_CONF_CAP: i64 = 64 |
functions
| 30 | func ig_atoi(s: *u8, n: i64) -> i64 called by 1: ig_floor_bytes |
| 44 | func ig_floor_bytes() -> i64 |
| 60 | func ig_decide(avail_bytes: i64, floor_bytes: i64) -> i64 |
| 69 | func ig_disk_floor(root: *u8, out_avail: *i64, out_floor: *i64) -> i64 |
| 77 | func ig_verdict_str(v: i64) -> *u8 |