code wiki / _hdl_build / _fetch_bounded_gate.nx
_fetch_bounded_gate.nx
buildroot/runtime/_hdl_build/_fetch_bounded_gate.nx
about
_fetch_bounded_gate.nx -- RES-R7 gate: bounded fetch (timeout + no
silent truncation).
Proves the nx_fetch_bounded capability with a SOVEREIGN, network-free
harness: a sys_pipe2 stands in for any readable fd (socket/TLS/file).
Write a body into the pipe's write end, drain it through the new
bounded consumer, and assert the contract.
REQUIRED CHECKS (each computed from a REAL drain, no fabrication):
POS-1 small body fully consumed -> FB_OK, counted==1000
POS-2 >512KB body, NO SILENT TRUNCATION -> FB_OVERFLOW, counted==600000
(explicit code + FULL counted length, never clamped to cap)
TIMEOUT stalled read returns in budget -> FB_TIMEOUT, elapsed<1000ms
NEG-CTL OLD br_drain on same >512KB body truncates at cap with NO
signal -> proves the test can actually detect truncation
TAMPER tiny cap on a 1000-byte body -> FB_OVERFLOW, never FB_OK
A GREEN requires BOTH (old path truncates, == cap, silently) AND (new
path returns FB_OVERFLOW with the full count) AND (timeout returns
within budget). If the new consumer ever silently clamped like the
old one, POS-2 / TAMPER fail RED.
build/placement: harness resolves `_fetch_bounded_gate` ->
runtime/_hdl_build/_fetch_bounded_gate.nx (1st match).
expect_exit: 0
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_fetch_bounded.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 31 | func st_puts(s: *u8) -> i64 called by 1: main |
| 37 | func st_putn(v: i64) -> i64 called by 1: main |
| 51 | func st_fdn(fd: i64, v: i64) -> i64 called by 1: main |
| 71 | func gate_old_drain(fd: i64, buf: *u8, cap: i64) -> i64 |
| 88 | func gate_pipe(rfd: *i64, wfd: *i64) -> i64 |
| 101 | func gate_fill_pipe(wfd: i64, n: i64) -> i64 called by 1: main |
| 115 | func main() -> i64 |