nx_models_page_emit.nx
buildroot/runtime/nx_models_page_emit.nx
about
nx_models_page_emit.nx -- THE /world/models GALLERY IS EMITTED, NEVER HAND-WRITTEN (2026-08-23).
Until now the models page was a hand-maintained served file (proven: zero emitter matches over
23,108 sources, corpus_complete=1) -- every new rig cost a hand edit and the numbers could drift
from the assets with nothing to catch it. This organ owns the page:
data knowledge/models_page.rows (one row per card: id|artifact|png|title|suffix|bodyhtml)
chrome knowledge/models_page.tmpl (head/css/lead/footer with @TOKENS@)
numbers MEASURED on every emit -- it forks _offc/nx_rigfloor.elf derive over the cards' own
artifact column (composing THE ruler, never a second measurement path) and refuses to
emit any card whose artifact it could not measure. The floor footer reads
knowledge/rigfloor.conf, the same conf the floor gate enforces -- one owner per number.
A new rig is ONE data row. The page cannot drift from the assets because it is re-measured.
FAIL-CLOSED: empty rows REFUSE (an empty gallery would silently unpublish every model);
a malformed row REFUSES BY LINE; a truncated derive capture REFUSES; the write is atomic
(tmp + renameat) so the served page is never half-written.
license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gatekit_lib.nxnx_imgattr_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
| 22 | const MPE_EXIT_OK: i64 = 0 |
| 23 | const MPE_EXIT_USAGE: i64 = 2 |
| 24 | const MPE_EXIT_UNOBS: i64 = 3 |
| 26 | const MPE_A_NL: i64 = 10 |
| 27 | const MPE_A_CR: i64 = 13 |
| 28 | const MPE_A_HASH: i64 = 35 |
| 29 | const MPE_A_PIPE: i64 = 124 |
| 30 | const MPE_A_AT: i64 = 64 |
| 31 | const MPE_A_LT: i64 = 60 |
| 32 | const MPE_A_BANG: i64 = 33 |
| 33 | const MPE_A_DASH: i64 = 45 |
| 34 | const MPE_A_GT: i64 = 62 |
| 35 | const MPE_A_SP: i64 = 32 |
| 36 | const MPE_A_EQ: i64 = 61 |
| 37 | const MPE_A_D0: i64 = 48 |
| 38 | const MPE_A_D9: i64 = 57 |
| 42 | const MPE_MAX_ROWS: i64 = 256 |
| 43 | const MPE_FIELDS: i64 = 6 |
| 45 | const MPE_OUT_CAP: i64 = 1048576 |
| 48 | const MPE_DERIVE_CAP: i64 = 262144 |
| 49 | const MPE_WORD: i64 = 8 |
| 50 | const MPE_PATH_CAP: i64 = 4096 |
| 52 | const MPE_DEF_ROWS: *u8 = "knowledge/models_page.rows" |
| 53 | const MPE_DEF_OUT: *u8 = "sites/nishifamily/world/models.html" |
| 54 | const MPE_TMPL: *u8 = "knowledge/models_page.tmpl" |
| 55 | const MPE_FLOOR: *u8 = "knowledge/rigfloor.conf" |
| 56 | const MPE_RIGFLOOR: *u8 = "_offc/nx_rigfloor.elf" |
| 57 | const MPE_TMP_DIR: *u8 = "/tmp/nx_models_page_emit" |
| 58 | const MPE_TMP_ROSTER: *u8 = "/tmp/nx_models_page_emit/roster" |
| 59 | const MPE_TMP_FCONF: *u8 = "/tmp/nx_models_page_emit/floor_scratch.conf" |
functions
| 61 | func mpe_out(s: *u8) -> i64 { gk_say(s, gk_len(s)); return 0 } |
| 63 | func mpe_say_kv(k: *u8, v: i64) -> i64 |
| 73 | func mpe_find(hay: *u8, hn: i64, from: i64, ned: *u8) -> i64 |
| 89 | func mpe_num_at(b: *u8, n: i64, pos: i64) -> i64 |
| 102 | func mpe_conf_i64(buf: *u8, n: i64, key: *u8) -> i64 |
| 127 | func mpe_ap(out: *u8, pos: i64, s: *u8, cap: i64) -> i64 |
| 134 | func mpe_apn(out: *u8, pos: i64, v: i64, cap: i64) -> i64 |
| 142 | func mpe_stamp(out: *u8, pos: i64, cap: i64) -> i64 |
| 163 | func mpe_tok(t: *u8, tn: i64, i: i64, name: *u8) -> i64 |
| 175 | func mpe_usage() -> i64 |
| 180 | func mpe_refuse(why: *u8) -> i64 |
| 187 | func main(argc: i64, argv: *i64) -> i64 |