code wiki / (root) / nx_organkind.nx

nx_organkind.nx

buildroot/runtime/nx_organkind.nx

10429 B207 linesdepth 2pulls 2 transitivereach 9 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_organkind.nx -- WHAT KIND OF THING IS THIS ORGAN? The classifier seq1492 says both ship verbs need. THE DEFECT IT FIXES: `/api/promote target=nx_torrent_get` -> 400 'daemon/oracle names are never promotable (use /api/deploy)'; `/api/deploy target=nx_torrent_get` -> 400 'unknown target'. Promote calls it a DAEMON, deploy has never heard of it, so a gate-proven binary (nx_poolgov_gate 21/21, deleting a hardcoded MAXP=32) cannot ship by ANY sanctioned route. Both verdicts come from matching NAMES -- a `torrent`/daemon-ish substring -- rather than from what the organ IS. LAW: TWO VERBS THAT DISAGREE ABOUT AN ARTEFACT'S KIND LEAVE IT UNSHIPPABLE -- the classifier, not the allowlist, is the defect. WHY A DECLARED KIND AND NOT A BETTER HEURISTIC: a smarter name rule is still a guess, and the cost of guessing is asymmetric -- misfiling a DAEMON as a one-shot lets promote swap a binary underneath a running process with no health check and no rollback (a rule-26 hazard), while misfiling a one-shot as a daemon merely makes it unshippable. So the kind must be DECLARED DATA (rule 11/17), and anything undeclared must be REFUSED BY BOTH VERBS rather than fall through to a name guess. THE ASYMMETRY IS THE WHOLE POLICY: deploy = for things with a HEALTH SURFACE (a port to probe, so never-brick rollback is meaningful). promote = for one-shots/oracles: atomic rename + .prev backup, no probe needed because nothing is holding the old binary open -- its 'health' is that the NEXT invocation succeeds. A one-shot handed to deploy would have a port-based health check run against a target with no port, making the never-brick verdict meaningless-or-wrong BY CONSTRUCTION. Lives in runtime/ (PRIMITIVE layer, seq1450) so BOTH mgmt handlers can reach it; imports nothing above. license_tier: ORIGINAL Pure + read-only. No hw writes (Rule 26).

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_organkind.nx nx_mgmt_api.nx nx_organkind_gate.nx

imports: nx_syscalls.nx

imported by: nx_mgmt_api.nxnx_organkind_gate.nx

structs

none

consts

28const OK_UNKNOWN: i64 = 0
29const OK_DAEMON: i64 = 1
30const OK_ONESHOT: i64 = 2
31const OK_ORACLE: i64 = 3
32const OK_LIB: i64 = 4
33const OK_NL: i64 = 10
34const OK_SP: i64 = 32
35const OK_TAB: i64 = 9
107const OK_CONFBUF: i64 = 65536
108const OK_CONF_PATH_LEN: i64 = 256

functions

37func ok_is_sep(c: i64) -> i64
43func ok_kind_code(buf: *u8, s: i64, e: i64) -> i64
called by 1: ok_kind_of
56func ok_kind_of(buf: *u8, n: i64, name: *u8) -> i64
116func ok_kind_of_path(path: *u8, name: *u8) -> i64
134func ok_may_deploy(kind: i64) -> i64
called by 2: ok_is_shippablemain
141func ok_may_promote(kind: i64) -> i64
149func ok_is_shippable(kind: i64) -> i64
called by 1: main calls 2: ok_may_deployok_may_promote
175func ok_ends_with(name: *u8, sfx: *u8) -> i64
called by 2: ok_suffix_kindmain
192func ok_suffix_kind(name: *u8) -> i64
204func ok_kind_or_suffix(declared: i64, name: *u8) -> i64
called by 2: ma_do_promotemain calls 1: ok_suffix_kind