nx_execsurface.nx
buildroot/runtime/nx_execsurface.nx
about
nx_execsurface.nx -- WHICH SURFACE RUNS THIS PROGRAM? The execution-surface census for PROMOTED organs
(2026-08-23, compare CE2, operator: no false ceilings).
THE FALSE CEILING THIS CLOSES: the adoption ladder's INVOKED axis reads knowledge/status/actlog.jrnl,
which records MCP-surface invocations ONLY. A program the clock plane fires nightly, a cron row, a daemon
supervisor, the gate roster, or a ./x.elf fork from another organ therefore read REGISTERED-DARK ("no MCP
invocation on record") while executing every day -- measured on the live graphics board: 12 of 19
PARTIAL rows, among them organs gates fork on every beat. nx_gateadjudicate solved exactly this for
GATES by joining the gate population to the surfaces that CAUSE EXECUTION; nobody did it for programs.
THE MCP REGISTRY IS NOT THE ONLY DOOR, AND A LADDER THAT ONLY WATCHES ONE DOOR CALLS EVERY OTHER
ENTRANT DARK.
THE EDGE DEFINITION IS THE QUESTION (gateadjudicate's law, measured 08-07: four definitions gave
75 / 0 / 2,043 / 30). A program counts as ON A SURFACE only through something that CAUSES execution:
CLOCK the live clocksched- plane names its .elf in the organ column, split at spaces so an organ
named in another row's ARGUMENTS (nx_sov_build_run.elf <gate>) counts too
CRON a cron.reg row names <n>.elf, <n>.sh or <n>.cron.sh (shell wrappers spawn the organ)
PLAN a clock row runs nx_plan_run.elf <id>: every tool the rows of knowledge/store/plan-<id>- name is
credited (2026-09-17; the clock row is the cause, the plan the route -- workflows-as-data are a
surface, and before this every plan-run organ read REGISTERED-DARK, measured on nx_search_ship)
DAEMON a daemons.reg row's argv names <n>.elf (the supervisor keeps it alive)
ROSTER a row of a ROSTER CONF names it (a beat of nx_gate_roster_run forks it): the runner's default
knowledge/gateroster.conf and every conf a live clock row runs through nx_gate_roster_run beat, whatever
journal that beat writes, derived from the plane by nx_rosterconf_lib and read with the beat's own row grammar
(2026-09-18: the heavy roster's gates read roster=0 while its beat ran them daily; a later roster is read by
declaring its clock row, with no edit here). A slow beat writing its own journal is credited like any other:
the close ruler reads each roster's evidence from that roster's journal; the stamp still counts those beats
(roster_beats_other_journal)
ACTLOG the MCP tail window mentions it (the one door the ladder already watched)
FORK another organ's SOURCE carries the string literal "./<n>.elf", "../<n>.elf" or "_offc/<n>.elf" AND that
caller is itself on a surface -- 2-hop, iterated to a fixed point, so a beat-run organ that
forks a helper that forks a third credits the third. A literal in a caller that is NOT on any
surface is a REF: something wants it, nothing runs it. A MERE MENTION IS NOT INVOCATION.
The literal must open a string ("./x.elf), so prose in a comment cannot credit a fork.
ROWS name<TAB>clock<TAB>cron<TAB>daemon<TAB>fork<TAB>roster<TAB>actlog<TAB>first_surface
clock/cron/daemon/roster/actlog are 0|1; fork is "-" or the first crediting caller's basename;
first_surface is clock|cron|daemon|roster|actlog|plan|fork:<caller>|ref:<caller>|- (the token a board prints)
LAST LINE (the canonical stamp, anchored BY POSITION; consumers never grep the rows for it):
# asof=<epoch> organs=N on_surface=A ref_only=B dark=C sources=clock:<rows>,cron:<rows>,daemon:<rows>,
roster:<rows>,roster_confs:<read>,roster_beats:<n>,roster_beats_other_journal:<n>,actlog:<bytes>,fork_files:<n>,
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_tool_run.nxnx_rosterconf_lib.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
| 54 | const ES_DEC_MAX: i64 = 20 |
| 55 | const ES_NAME_CAP: i64 = 128 // one organ basename; a longer name is refused and counted |
| 56 | const ES_DIRBUF: i64 = 131072 // one getdents64 window (looped until 0, so no listing is a prefix) |
| 57 | const ES_PATHCAP: i64 = 4096 // Linux PATH_MAX |
| 58 | const ES_ROW_FIXED: i64 = 16 + 2 * ES_NAME_CAP // tabs, five flags, "fork:" + caller, newline |
| 59 | const ES_TAIL_FIXED: i64 = 512 |
| 60 | const ES_ACT_TAIL: i64 = 4194304 // the same tail window nx_catalog reads (declared in the stamp) |
| 61 | const ES_PLANE_CAP: i64 = 1048576 // captured stdout of nx_store_put load: a pipe has no knowable size; ANNOUNCED if it fills |
| 62 | const ES_MIN_LIT: i64 = 9 // the shortest fork literal: "./x.elf" plus its opening quote |
| 140 | const ES_F_CLOCK: i64 = 0 |
| 141 | const ES_F_CRON: i64 = 1 |
| 142 | const ES_F_DAEMON: i64 = 2 |
| 143 | const ES_F_ROSTER: i64 = 3 |
| 144 | const ES_F_ACTLOG: i64 = 4 |
| 145 | const ES_F_FORK: i64 = 5 // index of the crediting caller organ, -1 none |
| 146 | const ES_F_REF: i64 = 6 // index of the first caller organ that merely names it, -1 none |
| 147 | const ES_F_PLAN: i64 = 7 // 1 = a clock row runs nx_plan_run <id> and that plan's rows name this organ |
| 148 | const ES_F_N: i64 = 8 |
| 403 | const ES_PLAN_PFX: *u8 = "knowledge/store/plan-" |
| 404 | const ES_PLAN_RUNNER: *u8 = "nx_plan_run" |
| 478 | const ESW_STAMP_KEY: *u8 = "# asof=" |
| 479 | const ESW_BEAT_S: i64 = 86400 // the clock row's declared cadence for this census (execsurface 86400) |
| 480 | const ESW_STALE_FACTOR: i64 = 2 // two missed beats = STALE, the same bound the cron watch uses |
functions
| 64 | func es_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 65 | func es_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 66 | func es_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } d[p] = 0 as u8; return p } |
| 67 | func es_catn(d: *u8, o: i64, v: i64) -> i64 |
| 81 | func es_putn(v: i64) -> i64 { let b: *u8 = sys_mmap(ES_DEC_MAX + 4); let n: i64 = es_catn(b, 0, v); sys_write(1, b, n); sys_munmap(b, ES_DEC_MAX + 4); return 0 } |
| 82 | func es_eq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 } |
| 83 | func es_ends(s: *u8, sfx: *u8) -> i64 |
| 91 | func es_isdotdot(nm: *u8) -> i64 |
| 96 | func es_read(path: *u8, lp: *i64) -> *u8 |
| 118 | func es_read_tail(path: *u8, cap: i64, lp: *i64) -> *u8 |
| 150 | func es_name(arena: *u8, off: *i64, i: i64) -> *u8 { return ((arena as i64) + off[i]) as *u8 } |
| 152 | func es_find(arena: *u8, off: *i64, n: i64, name: *u8) -> i64 |
| 158 | func es_organ_token(tok: *u8, out: *u8) -> i64 |
| 182 | func es_credit_tokens(line: *u8, lstart: i64, lend: i64, arena: *u8, off: *i64, n: i64, st: *i64, f: i64) -> i64 |
| 203 | func es_credit_file(b: *u8, bn: i64, arena: *u8, off: *i64, n: i64, st: *i64, f: i64, rows_out: *i64) -> i64 |
| 223 | func es_credit_roster(b: *u8, bn: i64, arena: *u8, off: *i64, n: i64, st: *i64, rows_out: *i64) -> i64 |
| 250 | func es_list_elfs(dir: *u8, arena: *u8, aused: *i64, acap: i64, off: *i64, n: *i64, ncap: i64, toolong: *i64) -> i64 |
| 292 | func es_count_entries(dir: *u8) -> i64 |
| 313 | func es_walk(pass: i64, path: *u8, path_n: i64, arena: *u8, off: *i64, n: i64, esrc: *i64, edst: *i64, ecap: i64, st2: *i64) -> i64 called by 2: es_walkmain calls 16: sys_openat_rdsys_mmapsys_getdents64dirent_typedirent_namees_isdotdot+10 |
| 405 | func es_sep(c: i64) -> i64 { if c == 32 { return 1 } if c == 9 { return 1 } if c == 124 { return 1 } if c == 10 { return 1 } return 0 } called by 1: es_credit_plan |
| 406 | func es_credit_plan(line: *u8, lstart: i64, lend: i64, arena: *u8, off: *i64, n: i64, st: *i64, plans: *i64) -> i64 |
| 459 | func es_on_surface(st: *i64, i: i64) -> i64 called by 1: main |
| 482 | func esw_key_at(b: *u8, n: i64, i: i64, key: *u8) -> i64 called by 1: es_who |
| 491 | func esw_field(row: *u8, n: i64, idx: i64, out: *u8, cap: i64) -> i64 called by 1: es_who |
| 504 | func es_who(name: *u8, census: *u8) -> i64 |
| 573 | func main(argc: i64, argv: *i64) -> i64 |