code wiki / (root) / nx_txtscan_gate.nx

nx_txtscan_gate.nx

buildroot/runtime/nx_txtscan_gate.nx

6855 B120 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_txtscan_gate.nx -- REFEREE for nx_txtscan_lib (byte-oriented text search). Inherits the canonical verdict base class (nx_gate_verdict, D001) rather than rolling its own counters, so nx_gate_green can judge this gate from outside and every run records a harness.jrnl frame. The promote path REFUSED this gate while it hand-rolled a verdict, which is the guard doing exactly its job -- a gate nothing can read is a gate whose flake stays invisible. TEETH: [T1] u2605BITE: the search fires on a present pattern and stays SILENT on an absent one. A search that cannot report absence always "finds" something. [T2] boundary: a match at offset 0. [T3] boundary: a match ending on the FINAL byte -- where an off-by-one reads past the buffer. [T4] POSITION: successive calls return every distinct offset, strictly increasing, and the count agrees with the walk. [T5] u2605THE REGRESSION THIS ORGAN EXISTS FOR: a haystack containing NO newline at all still resolves distinct offsets. This is the exact input on which the estate's line-oriented greps degenerate to echoing the whole file (measured on a 112,755-byte one-line corpus). [T6] overlap semantics are DEFINED, not accidental: "aaa" occurs 3x overlapping, 1x disjoint. [T7] u2605BITE: case folding -- insensitive finds it, sensitive does not. [T8] u2605NEG-CONTROL: an empty needle matches NOTHING. The natural implementation makes it match at every offset, which would report a clean file as entirely corrupt. [T9] u2605BITE: the control-byte detector fires on a 119-byte 0x0E run and stays SILENT on text made only of tab/LF/CR. Without the silent half it flags every source file in the estate and the sweep that found the real defect would have been worthless. [T10] run length is measured exactly -- the signature that separates a mechanical overwrite from a stray byte. [T11] context windows clamp at BOTH ends. Hermetic: every fixture is in memory. No filesystem, no network, no engine. Sovereign x86_64. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_gate_verdict.nx nx_txtscan_lib.nx nx_txtscan_gate.nx

imports: nx_gate_verdict.nxnx_txtscan_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr sys_mmap gv_head gv_puts sys_write tx_len gv_bite gv_puts ↻ tfound tx_next tx_match_at tx_lower gv_check gv_puts ↻ tq tx_count tx_next ↻ tx_next_ctl tx_is_ctl tx_run_len tx_is_ctl ↻ tx_ctx_lo tx_ctx_hi gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat

structs

none

consts

none

functions

34func tq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
35func tfound(h: i64) -> i64 { if h == TX_NOT_FOUND { return 0 } return 1 }
called by 1: main
37func main(argc: i64, argv: *i64) -> i64