code wiki / _hdl_build / nx_pm_dashboard.nx

nx_pm_dashboard.nx

buildroot/runtime/_hdl_build/nx_pm_dashboard.nx

46694 B901 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic pm
docsdependenciesstructsconstsfunctions

about

nx_pm_dashboard.nx -- the PM OVERSIGHT + ROI organ (operator 2026-07-18: "the pm to give us based on my executive, management, and operations layer a dashboard and feedback... return on investment with non fake numbers but real estimates in time and money and energy and other savings"). THREE LAYERS, one artifact-derived truth: EXECUTIVE -- ROI ledger + portfolio rollup + research-opps (the invest/return view) MANAGEMENT -- feedback: gating debts, stalest lanes, debt burn, phase mix (the decide/unblock view) OPERATIONS -- live in-progress table with ACTIVE/STALE liveness (the standup / right-now view) ROI HONESTY BY CONSTRUCTION (operator: "not fake numbers... bad form leads to bad gains and injuries"): every figure = a MEASURED event count (frontier D-rows, cron/daemon/tool rows, journal frames, debt rows) x a DECLARED rate that lives as a CONFIG row in the roi- store (rule 11, no magic numbers). The arithmetic (count x rate) is shown inline so any figure is auditable; nothing is hardcoded. Rates absent/unseeded -> the ROI block says "unseeded (run seedroi)" and emits NO numbers (fail-closed). Scale-law: journal read is TAIL-windowed with journal_bytes vs window_bytes DECLARED in every output. nx_pm_dashboard seedroi [roiprefix] (idempotent: 16 rate CONFIG + 4 RESEARCH rows) nx_pm_dashboard roi [roiprefix] [frontier] [journal] [debtprefix] (JSON: the ROI ledger, tagged) nx_pm_dashboard exec [journal] [debtprefix] [frontier] [roiprefix] (JSON: portfolio + roi + attention) nx_pm_dashboard page [outpath] [journal] [debtprefix] [frontier] [roiprefix] [cycleprefix] (HTML, 3 layers) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0 NOTE (DRY debt, filed): the journal/debt/store scan helpers are shared in spirit with nx_ws_cycle; extract a common nx_loop_lib.nx and import from both (avoided a mid-flight refactor of a contended organ).

dependencies 3 imports · 0 importers

nx_store_seed_lib.nx nx_seg_store.nx nx_syscalls.nx nx_pm_dashboard.nx

imports: nx_store_seed_lib.nxnx_seg_store.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main pd_werr sys_write sys_exit pd_vlen pd_lit_eq pd_seedroi sys_mmap pd_cat sts_seed ss_begin_cap sys_mmap ↻ sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ↻ sts_rowkey ss_catn sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ss_catn ↻ ss_commit ss_segid_ok sys_mmap ↻ ss_cat ss_catn ↻ sys_write ↻ ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻ ss_catn ↻ sys_write ↻ ss_segname ss_cat ↻ ss_catn ↻

structs

none

consts

27const PD_MAGIC_2880: i64 = 2880
28const PD_MAGIC_30000: i64 = 30000
29const PD_MAGIC_7200: i64 = 7200
31const PD_CAP: i64 = 1048576
32const PD_JCAP: i64 = 1048576
33const PD_SEEK_SET: i64 = 0
34const PD_SEEK_END: i64 = 2
35const PD_TAB: i64 = 9
36const PD_NL: i64 = 10
37const PD_HASH: i64 = 35
38const PD_STDERR: i64 = 2
39const PD_MODE: i64 = 420
40const PD_SPAN: i64 = 16
41const PD_EXIT_USAGE: i64 = 2
348const R_TOOLS: i64 = 0
349const R_CAPDONE: i64 = 1
350const R_CAPTOT: i64 = 2
351const R_RUNGS: i64 = 3
352const R_CRONS: i64 = 4
353const R_DAEMONS: i64 = 5
354const R_DOPEN: i64 = 6
355const R_DEATEN: i64 = 7
356const R_GATELOGS: i64 = 8
357const R_BUILDH: i64 = 9
358const R_OPSH: i64 = 10
359const R_RESILH: i64 = 11
360const R_TOTH: i64 = 12
361const R_VLOW: i64 = 13
362const R_VHIGH: i64 = 14
363const R_ENERGYCC: i64 = 15
364const R_TOKENS: i64 = 16
365const R_LANES: i64 = 17
366const R_LDONE: i64 = 18
367const R_LACTIVE: i64 = 19
368const R_LGATED: i64 = 20
369const R_STALEST: i64 = 21
370const R_UPH: i64 = 22
371const R_USDHR: i64 = 23
372const R_USDMKT: i64 = 24
373const R_SEVMIN: i64 = 25

functions

43func pd_werr(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(PD_STDERR, s, n); return 0 }
called by 2: pd_seedroimain calls 1: sys_write
44func pd_vlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
45func pd_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o] = s[i]; o = o + 1; i = i + 1 } return o }
46func pd_catn(d: *u8, o: i64, v: i64) -> i64 { let t: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 } 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 { d[o] = t[k-1-i]; o = o + 1; i = i + 1 } return o }
called by 3: pd_emit_roipd_seedroimain calls 1: sys_mmap
48func pd_cat_cc(d: *u8, o: i64, c: i64) -> i64 { var cc: i64 = c; if cc < 0 { cc = 0 } cc = cc % 100; d[o] = (48 + (cc / 10)) as u8; d[o+1] = (48 + (cc % 10)) as u8; return o + 2 }
called by 2: pd_emit_roimain
49func pd_cat_esc(d: *u8, o: i64, q: *u8, s: i64, e: i64) -> i64
called by 1: pd_emit_research
58func pd_cat_esc_html(d: *u8, o: i64, q: *u8, s: i64, e: i64) -> i64
called by 1: main calls 1: pd_cat
72func pd_read(path: *u8, buf: *u8, cap: i64, sizep: *i64) -> i64
94func pd_le(q: *u8, i: i64, n: i64) -> i64 { var e: i64 = i; var s: i64 = 1; while s == 1 { if e >= n { s = 0 } else { if q[e] == (PD_NL as u8) { s = 0 } else { e = e + 1 } } } return e }
95func pd_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64
111func pd_lit_eq(q: *u8, s: i64, e: i64, lit: *u8) -> i64
117func pd_span_eq(q: *u8, s1: i64, e1: i64, s2: i64, e2: i64) -> i64
123func pd_atoi_span(q: *u8, s: i64, e: i64) -> i64 { var v: i64 = 0; var i: i64 = s; while i < e { let c: i64 = q[i] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v }
125func pd_cfg(cprefix: *u8, key: *u8, defv: i64) -> i64
144func pd_store_seeded(cprefix: *u8) -> i64 { let b: *u8 = sys_mmap(PD_CAP); let n: i64 = sts_load(cprefix, b, PD_CAP); if n > 0 { return 1 } return 0 }
called by 1: pd_compute calls 2: sys_mmapsts_load
146func pd_starts(buf: *u8, n: i64, lit: *u8) -> i64 { var i: i64 = 0; while lit[i] != (0 as u8) { if i >= n { return 0 } if buf[i] != lit[i] { return 0 } i = i + 1 } return 1 }
called by 1: main
148func pd_count_noncomment(path: *u8) -> i64
called by 1: pd_compute calls 3: sys_mmappd_readpd_le
168func pd_scan_frontier(path: *u8, ch: i64, totp: *i64) -> i64
188func pd_count_debt(dprefix: *u8, lit: *u8) -> i64
202func pd_count_verb(q: *u8, n: i64, verb: *u8) -> i64
213func pd_first_kick(q: *u8, upto: i64, ws_s: i64, ws_e: i64) -> i64
226func pd_has_span(q: *u8, n: i64, verb: *u8, ws_s: i64, ws_e: i64) -> i64
239func pd_last(q: *u8, n: i64, ws_s: i64, ws_e: i64, ons: *i64) -> i64
257func pd_row_legacy(q: *u8, ls: i64, le: i64, c0: *i64) -> i64
called by 2: pd_debts_scoped_wsmain calls 1: pd_col
264func pd_scope_hits_ws(q: *u8, s: i64, e: i64, ws: *u8) -> i64
called by 1: pd_debts_scoped_ws calls 1: pd_lit_eq
280func pd_debts_scoped_ws(dbuf: *u8, dn: i64, ws: *u8, sevmin: i64) -> i64
303func pd_lane_tally(q: *u8, n: i64, dbuf: *u8, dn: i64, sevmin: i64, now: i64, wsb: *u8, out: *i64) -> i64
375func pd_compute(jr: *u8, dp: *u8, fr: *u8, rp: *u8, R: *i64, roiok: *i64) -> i64
451func pd_emit_roi(out: *u8, o: i64, R: *i64, roiok: i64) -> i64
called by 1: main calls 3: pd_catpd_catnpd_cat_cc
496func pd_seedroi(prefix: *u8) -> i64
531func pd_emit_research(out: *u8, o: i64, rp: *u8) -> i64
554func main(argc: i64, argv: *i64) -> i64