code wiki / _hdl_build / nx_autonomy_meter.nx
nx_autonomy_meter.nx
buildroot/runtime/_hdl_build/nx_autonomy_meter.nx
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
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
structs
| none |
consts
| 21 | const K_MAGIC_1048576: i64 = 1048576 |
| 22 | const K_MAGIC_1048560: i64 = 1048560 |
functions
| 23 | func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 24 | func _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 } |
| 25 | func _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 } |
| 26 | func 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 |
| 27 | func am_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 36 | func am_slice_has(hay: *u8, a: i64, b: i64, pat: *u8) -> i64 |
| 50 | func am_lines2(buf: *u8, n: i64, p1: *u8, p2: *u8) -> i64 |
| 66 | func am_axis(num: i64, den: i64) -> i64 called by 1: main |
| 74 | func am_grade(fd: i64, permil: i64) -> i64 |
| 83 | func main(argc: i64, argv: *i64) -> i64 |