code wiki / _hdl_build / nx_treediverge_beat.nx

nx_treediverge_beat.nx

buildroot/runtime/_hdl_build/nx_treediverge_beat.nx

8026 B168 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_treediverge_beat.nx -- no-arg BEAT for the ONE clock: the standing cross-tree divergence gauge (debt 1785622769: divergence must be caught the day it appears, not by archaeology). Composes the three PROVEN instruments through tr_run_capture -- zero detector logic duplicated: nx_treediff regenerates the NAS manifest, nx_treediverge compares it against the authoring manifest (pushed fresh at every session start by the treecanon SessionStart hook), nx_treecanon_gate re-runs the canon verdict. APPENDS one evidence line per run to the trend log -- including BEAT-FAIL lines (a beat with no evidence line is a claim; failure lines are evidence too). The BURN-DOWN is the point: divergent= over time IS the 8,258-file fork shrinking, minable from the trend file. Scheduler contract: the tickless clock (clock_jobs.tsv / the clockjobs- store plane) fork+execs this elf with NO args from cwd nishihost. argv[1]=authoring-manifest argv[2]=trendfile override the defaults for testing (argv[1] pointed at a missing file is the negative control: nx_treediverge REFUSES by its own non-vacuity law and this beat must append BEAT-FAIL + exit 1, never a comforting line). trend line: <epoch>\tDIVERGE <envelope, newlines as ' | '>\tGATE rc=<rc> <verdict line>\n license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_sovjson_lib.nx nx_syscalls.nx nx_tool_run.nx nx_treediverge_beat.nx

imports: nx_sovjson_lib.nxnx_syscalls.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork sys_close sys_dup3 sys_execve_clean sys_close ↻ sys_execve sys_exit sys_read sys_wait4 wait_exit_code tdb_contains sj_catn sys_mmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sj_cat tdb_cat_span tdb_tail_start tdb_tail_end tdb_tail_end ↻ tdb_append sys_openat_append sys_write sys_fsync sys_close ↻ tdb_werr sys_write ↻ sys_exit ↻ tdb_puts sys_write ↻

structs

none

consts

20const TDB_DIVCAP: i64 = 4194304 // treediverge prints a row per divergent file (8,258 today, ~40B
24const TDB_SMALLCAP: i64 = 16384
25const TDB_LINE: i64 = 4096
26const TDB_MODE: i64 = 420
27const TDB_TAB: i64 = 9
28const TDB_NL: i64 = 10
29const TDB_SPACE: i64 = 32
30const TDB_PIPE: i64 = 124

functions

32func tdb_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
33func tdb_werr(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(2, s, n); return 0 }
called by 1: main calls 1: sys_write
34func tdb_append(path: *u8, buf: *u8, n: i64) -> i64
43func tdb_tail_end(buf: *u8, n: i64) -> i64
called by 2: tdb_tail_startmain
50func tdb_tail_start(buf: *u8, n: i64, want: i64) -> i64
called by 1: main calls 1: tdb_tail_end
63func tdb_contains(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main
78func tdb_cat_span(ln: *u8, o: i64, buf: *u8, s: i64, e: i64) -> i64
called by 1: main
91func main(argc: i64, argv: *i64) -> i64