code wiki / _hdl_build / nx_queue_cohesion.nx

nx_queue_cohesion.nx

buildroot/runtime/_hdl_build/nx_queue_cohesion.nx

9244 B246 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tooltopic queue
docsdependenciesstructsconstsfunctions

about

nx_queue_cohesion.nx -- X-CONS-003: the AUDITOR's anti-sprawl gate (operator law 2026-06-11: "make sure we are cohesive always and avoid sprawl and duplicative work" -- enforced mechanically every beat). DUP-ID two queue rows with the same id -> RED (corruption) DUP-TITLE two queue rows with byte-equal titles -> RED (sprawl) LEDGERGAP open debt-ledger T#/B# ids with NO queue mention -> counted (informational: gaps are WORK to route, not corruption; X-CONS-002 is the sink that drives the count to 0) Composes nx_assign_core (the queue parser) -- no second grammar. argv[1]=queue override argv[2]=ledger override (gates use scratch) Evidence: COHESION row -> stdout + knowledge/status/queue_cohesion.log. Exit: 0 cohesive (gaps allowed), 1 dup found, 101 queue missing. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_assign_core.nx nx_itoa_lib.nx nx_queue_cohesion.nx

imports: nx_assign_core.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main an_newcx sys_mmap an_load sys_mmap ↻ sys_openat_rd sys_read sys_close an_id_at an_deps_at an_gate_at an_title_at qc_w sys_openat_append qc_read sys_read ↻ qc_dup_ids an_find an_streq an_id_at ↻ an_id_at ↻ qc_w ↻ qc_dup_titles an_title_at ↻ qc_streq qc_w ↻ an_id_at ↻ qc_ledger_gaps qc_has qc_w ↻ qc_wn nxi_fd sys_mmap ↻ ccz_cat_num sys_write sys_munmap sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real

structs

none

consts

17const K_MAGIC_1048576: i64 = 1048576

functions

19func qc_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
24func qc_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 1: main calls 1: nxi_fd
27func qc_streq(a: *u8, b: *u8) -> i64
called by 1: qc_dup_titles
37func qc_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 1: sys_read
48func qc_has(hay: *u8, n: i64, pat: *u8) -> i64
called by 1: qc_ledger_gaps
67func qc_dup_ids(cx: *i64, lfd: i64) -> i64
called by 1: main calls 3: an_findan_id_atqc_w
89func qc_dup_titles(cx: *i64, lfd: i64) -> i64
122func qc_ledger_gaps(ledger: *u8, ln: i64, qbuf: *u8, qn: i64, lfd: i64) -> i64
called by 1: main calls 2: qc_hasqc_w
200func main(argc: i64, argv: *i64) -> i64