code wiki / _hdl_build / nx_treediverge_beat.nx
nx_treediverge_beat.nx
buildroot/runtime/_hdl_build/nx_treediverge_beat.nx
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
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
structs
| none |
consts
| 20 | const TDB_DIVCAP: i64 = 4194304 // treediverge prints a row per divergent file (8,258 today, ~40B |
| 24 | const TDB_SMALLCAP: i64 = 16384 |
| 25 | const TDB_LINE: i64 = 4096 |
| 26 | const TDB_MODE: i64 = 420 |
| 27 | const TDB_TAB: i64 = 9 |
| 28 | const TDB_NL: i64 = 10 |
| 29 | const TDB_SPACE: i64 = 32 |
| 30 | const TDB_PIPE: i64 = 124 |
functions
| 32 | func 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 } |
| 33 | func 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 } |
| 34 | func tdb_append(path: *u8, buf: *u8, n: i64) -> i64 |
| 43 | func tdb_tail_end(buf: *u8, n: i64) -> i64 |
| 50 | func tdb_tail_start(buf: *u8, n: i64, want: i64) -> i64 |
| 63 | func tdb_contains(buf: *u8, n: i64, pat: *u8) -> i64 called by 1: main |
| 78 | func tdb_cat_span(ln: *u8, o: i64, buf: *u8, s: i64, e: i64) -> i64 called by 1: main |
| 91 | func main(argc: i64, argv: *i64) -> i64 |