code wiki / (root) / nx_accept_lib.nx

nx_accept_lib.nx

buildroot/runtime/nx_accept_lib.nx

45494 B1032 linesdepth 5pulls 9 transitivereach 209 importersview sourcekind librarytopic accept
docsdependenciesstructsconstsfunctions

about

nx_accept_lib.nx -- THE THREE-PARTY ACCEPTANCE LEDGER: the decision core behind every ACCEPTANCE cell on /compare (2026-08-30). Operator standing order, verbatim: "doing it poorly isn't a complete and needs to be shown as that on /compare and your work; it's not complete till you and I and the nishi team agree." A subject is ACCEPTED iff ALL THREE signatures hold, each read from its own sovereign plane: 1. OPERATOR -- knowledge/store/accept- : the LATEST row whose actor is `operator` and whose targets field carries the token ga_accept_<subject> says ACCEPT (REJECT, UNJUDGED, absent do not). 2. REFEREE -- knowledge/store/referee- : the LATEST row for <subject> says composite GOOD AND its percept is at or above floor_percept_<tier> READ FROM knowledge/cjc_panel.conf (never a literal here), its tier is in the panel receipt's tiers_admitted list, and that receipt says admitted=1. The row's own word GOOD is necessary and NOT sufficient: the floor is re-derived so a row cannot lie. 3. SEAT -- knowledge/store/attest- : a row for <subject> naming the shipping seat and its stamp. Anything less is INCOMPLETE, and INCOMPLETE names WHICH signature is missing and WHY. HOW THE BOARD FLIPS. `nx_accept emit` regenerates buildroot/runtime/nx_accept_decl.nx from the planes: one top-level declaration ga_accept_<subject> per ACCEPTED subject and NOTHING for any other. The /compare regen measures that file exactly as it measures every organ (nx_symdecl_lib: a column-0 declaration), so an ACCEPTANCE watch row lands only when the three-party rule holds. A hand-written declaration is a lie: the next emit erases it and nx_accept_gate convicts it (re-derivation must equal the bytes on disk). JOIN RULE, stated once: a plane row GOVERNS subject X iff its targets field carries the token ga_accept_X, bare or domain-qualified (gameengine:ga_accept_X). The subject key IS the suffix of the acceptance symbol, so the board and the ledger cannot name the same thing two ways. Rows with no such token are counted UNMAPPED and printed, never silently dropped. LIB+PROGRAM SPLIT ON PURPOSE: every rule is a function of caller-supplied plane prefixes, conf path and buffers, so nx_accept_gate drives the SAME code over fixture planes under /tmp and never the production planes. COMPOSES, NEVER RE-IMPLEMENTS: nx_seg_store's sequential cursor (plane iteration; ss_get point lookups are the documented quadratic read), nx_comparewatch_lib (tab-field parsing + strict q:<n> keys), nx_lineconf_lib (line-anchored key=value), nx_estate_path (CWD-independent artifact paths). HONEST LIMIT: the actor column is caller-supplied. This ledger buys ATTRIBUTION and TAMPER-EVIDENCE through the plane's own hist- provenance, not cryptographic proof of who the operator is; the signed-row rung (nx_evattest, role=human key) is the named next step, not a claim made here. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 6 imports · 5 importers

nx_syscalls.nx nx_seg_store.nx nx_comparewatch_lib.nx nx_lineconf_lib.nx nx_estate_path.nx nx_store_seed_lib.nx nx_accept_lib.nx nx_accept.nx nx_accept_candidate_t230.nx nx_accept_gate.nx nx_accept_ref_lib.nx nx_release_delta_lib.nx

imports: nx_syscalls.nxnx_seg_store.nxnx_comparewatch_lib.nxnx_lineconf_lib.nxnx_estate_path.nxnx_store_seed_lib.nx

imported by: nx_accept.nxnx_accept_candidate_t230.nxnx_accept_gate.nxnx_accept_ref_lib.nxnx_release_delta_lib.nx

structs

none

consts

43const AL_PFX_ACCEPT: *u8 = "knowledge/store/accept-"
44const AL_PFX_REFEREE: *u8 = "knowledge/store/referee-"
45const AL_PFX_ATTEST: *u8 = "knowledge/store/attest-"
46const AL_PANEL_CONF: *u8 = "knowledge/cjc_panel.conf"
47const AL_DECL_PATH: *u8 = "buildroot/runtime/nx_accept_decl.nx"
48const AL_DECL_SIBLING: *u8 = "buildroot/runtime/nx_accept_lib.nx"
49const AL_DECL_BASENAME: *u8 = "nx_accept_decl.nx"
50const AL_DECL_ROW: *u8 = "runtime/nx_accept_decl.nx"
51const AL_BOARDS_DIR: *u8 = "buildroot/knowledge/compare"
52const AL_BOARDS_DIR_FROM_BUILDROOT: *u8 = "knowledge/compare"
53const AL_SYM_PFX: *u8 = "ga_accept_"
54const AL_WATCH_PFX: *u8 = "_ABSENT_:"
55const AL_MATRIX_SFX: *u8 = ".matrix"
56const AL_ACTOR_OPERATOR: *u8 = "operator"
57const AL_KEY_RECEIPT: *u8 = "receipt"
58const AL_KEY_ADMITTED: *u8 = "admitted"
59const AL_KEY_TIERS_ADMITTED: *u8 = "tiers_admitted"
60const AL_KEY_TIERS: *u8 = "tiers"
61const AL_KEY_FLOOR_PFX: *u8 = "floor_percept_"
62const AL_TMP_SFX: *u8 = ".tmp"
65const AL_TAB: i64 = 9
66const AL_NL: i64 = 10
67const AL_CR: i64 = 13
68const AL_SPACE: i64 = 32
69const AL_BANG: i64 = 33
70const AL_HASH: i64 = 35
71const AL_COMMA: i64 = 44
72const AL_MINUS: i64 = 45
73const AL_DOT: i64 = 46
74const AL_SLASH: i64 = 47
75const AL_D0: i64 = 48
76const AL_D9: i64 = 57
77const AL_COLON: i64 = 58
78const AL_AT: i64 = 64
79const AL_LOWA: i64 = 97
80const AL_LOWZ: i64 = 122
81const AL_USCORE: i64 = 95
82const AL_PIPE: i64 = 124
83const AL_BASE10: i64 = 10
84const AL_KIND_TOMB: i64 = 2 // seg-store record kind 2 = tombstone (nx_seg_store contract)
87const AL_MAX_SUBJ: i64 = 64
88const AL_MAX_TOK: i64 = 16
89const AL_MAX_WATCH: i64 = 64
90const AL_NAMEW: i64 = 64
91const AL_ORGW: i64 = 128
92const AL_REC: i64 = 512
93const AL_NUMCAP: i64 = 32
94const AL_PATHCAP: i64 = 1024
95const AL_LISTCAP: i64 = 256
96const AL_KEYCAP: i64 = 128
97const AL_DENTCAP: i64 = 65536
98const AL_DECL_CAP: i64 = 65536
99const AL_LINE_MAX: i64 = 1024
100const AL_DATECAP: i64 = 16
101const AL_SC_WORDS: i64 = 8
104const AL_F_NAME: i64 = 0
105const AL_W_NAME: i64 = 64
106const AL_F_OPID: i64 = 64
107const AL_W_OPID: i64 = 96
108const AL_F_OPDATE: i64 = 160
109const AL_W_DATE: i64 = 16
110const AL_F_OPACTOR: i64 = 176
111const AL_W_ACTOR: i64 = 32
112const AL_F_RTIER: i64 = 208
113const AL_W_TIER: i64 = 16
114const AL_F_RSHA: i64 = 224
115const AL_W_SHA: i64 = 72
116const AL_F_RSEAT: i64 = 296
117const AL_W_SEAT: i64 = 32
118const AL_F_RDATE: i64 = 328
119const AL_F_ASEAT: i64 = 344
120const AL_F_ASTAMP: i64 = 376
121const AL_W_STAMP: i64 = 64
122const AL_F_ADATE: i64 = 440
125const AL_IW: i64 = 16
126const AL_I_OPV: i64 = 0 // operator verdict code (actor == operator rows only)
127const AL_I_ANYV: i64 = 1 // latest verdict of ANY actor (informational)
128const AL_I_RCOMP: i64 = 2 // referee composite code
129const AL_I_RPERCEPT: i64 = 3
130const AL_I_ATT: i64 = 4 // 1 = a usable attestation row exists
131const AL_I_OPSEEN: i64 = 5
132const AL_I_RSEEN: i64 = 6
133const AL_I_ASEEN: i64 = 7
136const AL_BK_WORDS: i64 = 32
137const AL_B_N: i64 = 0
138const AL_B_INTS: i64 = 1
139const AL_B_STRS: i64 = 2
140const AL_B_OVERFLOW: i64 = 3
141const AL_B_ACC_ROWS: i64 = 4
142const AL_B_REF_ROWS: i64 = 5
143const AL_B_ATT_ROWS: i64 = 6
144const AL_B_UNMAPPED: i64 = 7
145const AL_B_MALFORMED: i64 = 8
146const AL_B_ACC_PLANE: i64 = 9
147const AL_B_REF_PLANE: i64 = 10
148const AL_B_ATT_PLANE: i64 = 11
149const AL_B_TOMB: i64 = 12
150const AL_B_FOREIGN: i64 = 13
151const AL_B_BADNAME: i64 = 14
152const AL_B_ACC_PATH: i64 = 16
153const AL_B_REF_PATH: i64 = 17
154const AL_B_ATT_PATH: i64 = 18
157const AL_AF_ID: i64 = 0
158const AL_AF_VERDICT: i64 = 2
159const AL_AF_DATE: i64 = 3
160const AL_AF_ACTOR: i64 = 4
161const AL_AF_TARGETS: i64 = 6
163const AL_RF_SUBJECT: i64 = 1
164const AL_RF_SHA: i64 = 2
165const AL_RF_COMP: i64 = 3
166const AL_RF_PERCEPT: i64 = 4
167const AL_RF_TIER: i64 = 5
168const AL_RF_DATE: i64 = 6
169const AL_RF_SEAT: i64 = 7
171const AL_TF_SUBJECT: i64 = 1
172const AL_TF_SEAT: i64 = 2
173const AL_TF_STAMP: i64 = 3
174const AL_TF_DATE: i64 = 5
177const AL_V_NONE: i64 = 0
178const AL_V_ACCEPT: i64 = 1
179const AL_V_REJECT: i64 = 2
180const AL_V_UNJUDGED: i64 = 3
181const AL_V_INVALID: i64 = 4
182const AL_R_NONE: i64 = 0
183const AL_R_GOOD: i64 = 1
184const AL_R_BAD: i64 = 2
185const AL_R_INVALID: i64 = 3
186const AL_RC_OK: i64 = 0
187const AL_RC_MISSING: i64 = 1
188const AL_RC_BAD: i64 = 2
189const AL_RC_INVALID: i64 = 3
190const AL_RC_TIER_UNADMITTED: i64 = 4
191const AL_RC_NO_FLOOR: i64 = 5
192const AL_RC_BELOW_FLOOR: i64 = 6
193const AL_RC_PANEL_UNADMITTED: i64 = 7
194const AL_ST_UNKNOWN: i64 = 0
195const AL_ST_ACCEPTED: i64 = 1
196const AL_ST_INCOMPLETE: i64 = 2
197const AL_DV_IDENTICAL: i64 = 0
198const AL_DV_DIFFERS: i64 = 1
199const AL_DV_ABSENT: i64 = 2
200const AL_DV_CAP: i64 = 3
202const AL_WHY_OP: i64 = 0
203const AL_WHY_REF: i64 = 1
204const AL_WHY_ATT: i64 = 2
205const AL_WHY_FLOOR: i64 = 3
206const AL_WHY_WORDS: i64 = 4
209const AL_CF_WORDS: i64 = 16
210const AL_C_BUF: i64 = 0
211const AL_C_LEN: i64 = 1
212const AL_C_ADMITTED: i64 = 2
213const AL_C_TADM: i64 = 3
214const AL_C_TIERS: i64 = 4
215const AL_C_CONF_OK: i64 = 5
216const AL_C_RCPT_OK: i64 = 6
217const AL_C_PATH: i64 = 7
218const AL_C_RPATH: i64 = 8
221const AL_SEC_PER_DAY: i64 = 86400
222const AL_EPOCH_SHIFT_DAYS: i64 = 719468
223const AL_DAYS_PER_ERA: i64 = 146097
224const AL_YEARS_PER_ERA: i64 = 400
225const AL_DAYS_4Y: i64 = 1460
226const AL_DAYS_100Y: i64 = 36524
227const AL_DAYS_400Y_LESS1: i64 = 146096
228const AL_DAYS_YEAR: i64 = 365
229const AL_LEAP_4: i64 = 4
230const AL_LEAP_100: i64 = 100
231const AL_MP_MUL: i64 = 5
232const AL_MP_ADD: i64 = 2
233const AL_MP_DIV: i64 = 153
234const AL_MONTH_WRAP: i64 = 10
235const AL_MONTH_ADD: i64 = 3
236const AL_MONTH_SUB: i64 = 9
237const AL_FEB: i64 = 2
238const AL_TWO_DIGITS: i64 = 10
503const AL_RS_WORDS: i64 = 4
504const AL_RS_BUF: i64 = 0
505const AL_RS_LEN: i64 = 1
506const AL_RS_POS: i64 = 2

functions

241func al_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
242func al_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 } return p }
243func al_catsl(d: *u8, o: i64, s: *u8, so: i64, n: i64) -> i64 { var i: i64 = 0; var p: i64 = o; while i < n { d[p] = s[so + i]; p = p + 1; i = i + 1 } return p }
called by 2: mainacr_unmapped
244func al_catn(d: *u8, o: i64, v: i64) -> i64
256func al_streq(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 }
257func al_strcmp(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return (a[i] as i64) - (b[i] as i64) } i = i + 1 } return 0 - (b[i] as i64) }
258func al_starts(s: *u8, p: *u8) -> i64 { var i: i64 = 0; while p[i] != (0 as u8) { if s[i] != p[i] { return 0 } i = i + 1 } return 1 }
called by 2: mainmain
259func al_ends(s: *u8, sfx: *u8) -> i64
called by 1: al_scan_boards calls 1: al_slen
268func al_ident_char(c: i64) -> i64
274func al_ident_ok(s: *u8, so: i64, n: i64) -> i64
284func al_setf(rec: *u8, off: i64, w: i64, src: *u8, so: i64, n: i64) -> i64
293func al_parse_int(v: *u8, o: i64, l: i64, ok: *i64) -> i64
called by 2: al_walk_refereemain
315func al_list_has(list: *u8, tok: *u8) -> i64
called by 2: al_ref_checkacr_ref_admit calls 1: al_slen
340func al_civil_date(epoch_s: i64, out: *u8) -> i64
367func al_bk_new() -> *i64
378func al_bk_rec(bk: *i64, i: i64) -> *u8 { return (bk[AL_B_STRS] + i * AL_REC) as *u8 }
379func al_bk_ints(bk: *i64, i: i64) -> *i64 { return (bk[AL_B_INTS] + i * AL_IW * 8) as *i64 }
380func al_bk_name(bk: *i64, i: i64) -> *u8 { return (bk[AL_B_STRS] + i * AL_REC + AL_F_NAME) as *u8 }
381func al_bk_find(bk: *i64, name: *u8, so: i64, n: i64) -> i64
390func al_bk_find_z(bk: *i64, z: *u8) -> i64 { return al_bk_find(bk, z, 0, al_slen(z)) }
392func al_bk_get(bk: *i64, name: *u8, so: i64, n: i64) -> i64
410func al_targets_subjects(bk: *i64, v: *u8, o: i64, l: i64, idx: *i64, cap: i64) -> i64
447func al_has_token(targets: *u8, subject: *u8) -> i64
458func al_plane_resolve(rel: *u8, out: *u8) -> i64
called by 1: al_load calls 2: ss_cur_openal_cat
476func al_next(bk: *i64, pfx: *u8, cur: *i64, sc: *i64) -> i64
507func al_rows_open(pfx: *u8) -> *i64
519func al_rows_next(rs: *i64, sc: *i64) -> i64
540func al_walk_accept(bk: *i64, pfx: *u8) -> i64
582func al_walk_referee(bk: *i64, pfx: *u8) -> i64
620func al_walk_attest(bk: *i64, pfx: *u8) -> i64
650func al_load(bk: *i64, pfx_acc: *u8, pfx_ref: *u8, pfx_att: *u8) -> i64
662func al_conf_load(conf_rel: *u8) -> *i64
699func al_floor_for_tier(cf: *i64, tier: *u8) -> i64
709func al_ref_check(bk: *i64, cf: *i64, si: i64, floor_out: *i64) -> i64
727func al_state(bk: *i64, cf: *i64, si: i64, why: *i64) -> i64
737func al_vname(c: i64) -> *u8
called by 1: acr_status_line
744func al_rname(c: i64) -> *u8
750func al_rcname(c: i64) -> *u8
called by 1: acr_status_line
760func al_stname(c: i64) -> *u8
770func al_emit_buf(bk: *i64, cf: *i64, out: *u8, cap: i64) -> i64
846func al_count_accepted(bk: *i64, cf: *i64) -> i64
854func al_decl_verify(bk: *i64, cf: *i64, path: *u8) -> i64
866func al_dvname(c: i64) -> *u8
873func al_write_atomic(path: *u8, buf: *u8, n: i64) -> i64
892func al_count_decls(b: *u8, n: i64) -> i64
915func al_decl_path(out: *u8) -> i64
925func al_boards_dir(out: *u8) -> i64
937func al_scan_one_board(dir: *u8, nm: *u8, subj: *u8, doms: *u8, orgs: *u8, cap: i64, count0: i64, over: *i64) -> i64
1010func al_scan_boards(dir: *u8, subj: *u8, doms: *u8, orgs: *u8, cap: i64, over: *i64) -> i64