nx_organkind.nx
buildroot/runtime/nx_organkind.nx
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
imports: nx_syscalls.nx
imported by: nx_mgmt_api.nxnx_organkind_gate.nx
structs
| none |
consts
| 28 | const OK_UNKNOWN: i64 = 0 |
| 29 | const OK_DAEMON: i64 = 1 |
| 30 | const OK_ONESHOT: i64 = 2 |
| 31 | const OK_ORACLE: i64 = 3 |
| 32 | const OK_LIB: i64 = 4 |
| 33 | const OK_NL: i64 = 10 |
| 34 | const OK_SP: i64 = 32 |
| 35 | const OK_TAB: i64 = 9 |
| 107 | const OK_CONFBUF: i64 = 65536 |
| 108 | const OK_CONF_PATH_LEN: i64 = 256 |
functions
| 37 | func ok_is_sep(c: i64) -> i64 |
| 43 | func ok_kind_code(buf: *u8, s: i64, e: i64) -> i64 called by 1: ok_kind_of |
| 56 | func ok_kind_of(buf: *u8, n: i64, name: *u8) -> i64 |
| 116 | func ok_kind_of_path(path: *u8, name: *u8) -> i64 |
| 134 | func ok_may_deploy(kind: i64) -> i64 |
| 141 | func ok_may_promote(kind: i64) -> i64 |
| 149 | func ok_is_shippable(kind: i64) -> i64 |
| 175 | func ok_ends_with(name: *u8, sfx: *u8) -> i64 |
| 192 | func ok_suffix_kind(name: *u8) -> i64 |
| 204 | func ok_kind_or_suffix(declared: i64, name: *u8) -> i64 |