code wiki / _hdl_build / nx_capability_ladder.nx
nx_capability_ladder.nx
buildroot/runtime/_hdl_build/nx_capability_ladder.nx
about
nx_capability_ladder.nx -- THE BUILD-UP MAP, hardware rung up (operator 2026-06-13:
"we need mapping on how we build from the hardware rung up ... so we never have floating
capabilities but each layer below acts as the foundation for the one above").
Organ-AUTHORED (not hand-drawn): composes nx_assign_core to read the REAL queue and
COMPUTE, from the deps graph + DONE status, a layered map:
layer(row) = 0 if deps "-" ; else 1 + max(layer(dep)) (topological depth, fixpoint)
layer 0 = the foundations with no dependency = the hardware/toolchain rung.
FLOATING = a DONE capability whose foundation (a dep) is NOT DONE / is unknown
-- a capability standing on nothing. The no-floating LAW: zero floating.
Emits the map to knowledge/registry/capability_ladder.tsv (layer-ascending = bottom-up)
and a CAPLADDER evidence line. Navigation: the lowest ABSENT foundation is what to build
next; never build a row whose foundation is ABSENT (that would float).
SELF-VALIDATING (no false-green): a baked pos control (DONE row on a DONE foundation ->
NOT floating) and neg control (DONE row on a TODO foundation -> floating) run on a
synthetic in-memory context BEFORE the real queue; controls wrong -> RED. Reuses
an_deps_done as the grounding primitive (DRY). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_assign_core.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 CL_QUEUE: *u8 = "knowledge/registry/assignment_queue.tsv" |
| 22 | const CL_MAP: *u8 = "knowledge/registry/capability_ladder.tsv" |
| 23 | const CL_LOG: *u8 = "knowledge/status/capability_ladder.log" |
functions
| 25 | func cl_w(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 } |
| 26 | func cl_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;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 } |
| 28 | func cl_status_str(b: i64) -> *u8 |
| 40 | func cl_try_open(prefix: *u8, name: *u8) -> i64 called by 1: cl_organ_exists |
| 55 | func cl_organ_exists(name: *u8) -> i64 |
| 66 | func cl_deps_grounded(cx: *i64, r: i64) -> i64 |
| 100 | func cl_is_floating(cx: *i64, r: i64) -> i64 |
| 108 | func cl_max_dep_layer(cx: *i64, r: i64, lay: *i64, tok: *u8) -> i64 |
| 136 | func cl_emit_row(fd: i64, L: i64, cx: *i64, r: i64, stx: *i64, flt: *i64) -> i64 |
| 151 | func cl_arc_sibling(cx: *i64, tok: *u8) -> i64 |
| 175 | func cl_dep_blockers(fd: i64, cx: *i64, r: i64, tok: *u8) -> i64 |
| 204 | func cl_float_line(fd: i64, cx: *i64, r: i64, lay: *i64, stx: *i64, tok: *u8) -> i64 |
| 214 | func cl_gate(fd: i64, cpos: i64, cneg: i64, corgpos: i64, corgneg: i64, caps: i64, layers: i64, present: i64, floating: i64, epoch: i64, ok: i64) -> i64 |
| 230 | func cl_make_test(a_status: i64) -> i64 |
| 245 | func cl_make_test_org(dep: *u8) -> i64 |
| 258 | func main() -> i64 |