code wiki / _hdl_build / nx_autonomy_meter.nx

nx_autonomy_meter.nx

buildroot/runtime/_hdl_build/nx_autonomy_meter.nx

7950 B155 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic autonomy
docsdependenciesstructsconstsfunctions

about

nx_autonomy_meter.nx -- X-AUT-002: the autonomy GRADE, MEASURED never asserted (autonomy ladder spec 2026-06-11; declared W0 tutor-with-team scaffold -- and this organ COUNTS ITSELF against the grade: it is tutor-authored, so A2 stays honest). PLAIN LANGUAGE: how much of the work does the system do by itself? Four axes, each 0..1000 permil, each from a ledger anyone can re-read: A1 judged-DONE share : queue rows DONE carrying ||MARK= (machine-judged by reconcile evidence) / all DONE rows. Hand-flipped DONEs drag the grade. A2 emitter-authored share : ABSENT (named gap) -- registrations do not yet carry an author= tag (row X-AUT-002a files it). Counted 0, never faked. A3 daemon-run share : pulse runs fired by the autorun daemon (DAEMON-BEAT rows) / all pulse runs (PULSE-RUN rows). Hand-run beats drag the grade. A4 hands-off-heal share : ENG- defect rows DONE with MARK / all ENG- rows DONE. Zero closed = 0 with a note, never a crash. autonomy_permil = (A1+A2+A3+A4)/4 ; grade: <150 F, <500 D, <700 C, <850 B, <900 A, >=900 S (the ladder's bars). Durable: AUTMETER row -> knowledge/status/autonomy_meter.log. Exit 0 = measured (any grade); exit 1 = could not read its world. argv[1]=queue argv[2]=pulselog argv[3]=daemonlog argv[4]=outlog (gates use scratch). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_autonomy_meter.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main _p sys_write sys_mmap am_read sys_openat_rd sys_read sys_close sys_exit am_lines2 am_slice_has am_len am_axis sys_openat_append _fp sys_write ↻ _fn sys_mmap ↻ sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real am_grade _fp ↻ sys_close ↻ sys_write ↻

structs

none

consts

21const K_MAGIC_1048576: i64 = 1048576
22const K_MAGIC_1048560: i64 = 1048560

functions

23func _p(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
24func _fp(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 }
called by 2: am_grademain calls 1: sys_write
25func _fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
26func am_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: am_slice_has
27func am_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
36func am_slice_has(hay: *u8, a: i64, b: i64, pat: *u8) -> i64
called by 1: am_lines2 calls 1: am_len
50func am_lines2(buf: *u8, n: i64, p1: *u8, p2: *u8) -> i64
called by 1: main calls 1: am_slice_has
66func am_axis(num: i64, den: i64) -> i64
called by 1: main
74func am_grade(fd: i64, permil: i64) -> i64
called by 1: main calls 1: _fp
83func main(argc: i64, argv: *i64) -> i64