code wiki / _hdl_build / nx_leasemine.nx
nx_leasemine.nx
buildroot/runtime/_hdl_build/nx_leasemine.nx
about
nx_leasemine.nx -- LEASES-CLASS MINER over the claims journal (miner-sota F1017, 2026-07-23).
The census (nx_minecov MC04) measured leases COVERED-but-UNMINED: nx_claims walk derives CURRENT
holder/TTL state, but nobody mines the HISTORY. This derives what a point-in-time walk cannot:
ORPHANED = CLAIMs with no matching RELEASE (the F214 crash-lease signal, per resource)
CONTENDED = a resource claimed by MORE THAN ONE distinct actor (where lanes actually collide)
CHURN = claims per resource, ranked; plus hold-time (avg/max) from matched CLAIM->RELEASE pairs
A resource claimed once and released is healthy; one claimed 9 times by 4 actors is a coordination
hotspot, and one claimed and never released is an orphan a walker must reap. now is INJECTABLE so
hold-time arithmetic is deterministic under test. Composes nx_sovjson_lib (sj_*). Read-only. Rule 26.
mine <journal> [minsup] [now] -> JSON: totals, by_resource ranked, orphans, contention
selftest <scratch-prefix> -> gate T1..T8
frame cols: ts TAB verb(CLAIM|BEAT|RELEASE) TAB resource TAB actor TAB ttl TAB note
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_sovjson_lib.nxnx_syscalls.nxnx_gate_verdict.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
| 17 | const LM_MAGIC_1785000000: i64 = 1785000000 |
| 18 | const LM_MAGIC_4088: i64 = 4088 |
| 20 | const LM_WIN: i64 = 4194304 |
| 21 | const LM_OUT: i64 = 65536 |
| 22 | const LM_PATH: i64 = 512 |
| 23 | const LM_RES: i64 = 512 |
| 24 | const LM_ACTORS: i64 = 8 |
| 25 | const LM_TOPN: i64 = 20 |
| 26 | const LM_PERMIL: i64 = 1000 |
| 27 | const LM_NAME_MAX: i64 = 120 |
| 28 | const LM_MODE_644: i64 = 420 |
functions
| 30 | func lm_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 39 | func lm_find(q: *u8, n: i64, lit: *u8) -> i64 |
| 52 | func lm_key(d: *u8, o: i64, name: *u8) -> i64 |
| 62 | func lm_digits(q: *u8, s: i64, e: i64) -> i64 called by 1: lm_mine_json |
| 68 | func lm_span_eq(q: *u8, a: i64, ae: i64, b: i64, be: i64) -> i64 called by 1: lm_mine_json |
| 74 | func lm_mine_json(jpath: *u8, minsup: i64, now: i64, d: *u8) -> i64 |
| 257 | func lm_selftest(prefix: *u8) -> i64 |
| 321 | func main(argc: i64, argv: *i64) -> i64 |