code wiki / (root) / nx_accept_ref_lib.nx

nx_accept_ref_lib.nx

buildroot/runtime/nx_accept_ref_lib.nx

20329 B407 linesdepth 6pulls 13 transitivereach 5 importersview sourcekind librarytopic accept
docsdependenciesstructsconstsfunctions

about

nx_accept_ref_lib.nx -- THE VERB-SIDE HALF OF THE THREE-PARTY ACCEPTANCE LEDGER (2026-08-31). nx_accept_lib.nx is the DECISION CORE: three planes in, ACCEPTED or INCOMPLETE out, reason codes in why[]. This lib is everything the verbs (nx_accept) and their referee (nx_accept_gate) need ON TOP of that core, kept out of the organ's main() so the gate drives the identical code over /tmp fixtures: * acr_party -- INCOMPLETE is never enough. The FIRST missing signature is NAMED, in the order the operator's standing order lists them (operator, referee, seat), so a NOT-AGREED can always say WHICH negative it is: OPERATOR-MISSING is not OPERATOR-REJECT, REFEREE-BELOW-BAND is not REFEREE-MISSING, and none of them is SEAT-MISSING. * acr_status_line -- one line per subject carrying every input the verdict was derived from (operator verdict and row count, referee code, percept, floor, tier, seat rows, board and organ file), so a reader can refute the verdict from the line instead of trusting it. * acr_unmapped -- an operator row whose targets carry no ga_accept_<subject> token governs NOTHING and the core only COUNTS it. This prints each one with id, verdict, actor, targets and the remedy, because a counted-but-unnamed row is not actionable. * acr_boards -- every ACCEPTANCE watch row on the /compare boards becomes a subject too, so a board subject nobody has judged reads NOT-AGREED missing=OPERATOR-MISSING instead of vanishing from the list, and a watch row naming the WRONG organ file is flagged -- it could never flip, however many signatures arrived. * acr_ref_admit -- may a referee row be written for this tier at all? The panel receipt decides (admitted, tiers_admitted, a floor for the tier); an abstaining panel is not a grade. * acr_kvint -- the mid-line key=<int> reader for the panel lens line (cjp_percept=<n>), because nx_lineconf_lib is deliberately LINE-anchored and that field is not at a line start. * acr_sha256_file -- the artifact identity a seat attests to and the frame identity a referee row carries: sha256 of the bytes, hex, never a hand-typed stamp. -1 when unreadable, never the digest of nothing. * acr_decl_shape -- the emitted declaration file's ONE permitted code form, as a ruler: every non-comment line must be exactly `func ga_accept_<ident>() -> i64 { return 1 }`, the form the compiler is proven to accept, so a buffer that passes this ruler is the form that builds. COMPOSES, NEVER RE-IMPLEMENTS: nx_accept_lib for every rule, nx_seg_store's cursor through al_next for the plane walk, nx_comparewatch_lib's cw_field for tab fields, nx_sha256 for the digest. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 3 importers

nx_syscalls.nx nx_sha256.nx nx_accept_lib.nx nx_accept_ref_lib.nx nx_accept.nx nx_accept_candidate_t230.nx nx_accept_gate.nx

imports: nx_syscalls.nxnx_sha256.nxnx_accept_lib.nx

imported by: nx_accept.nxnx_accept_candidate_t230.nxnx_accept_gate.nx

structs

none

consts

38const ACR_P_AGREED: i64 = 0
39const ACR_P_OP_MISSING: i64 = 1
40const ACR_P_OP_REJECT: i64 = 2
41const ACR_P_OP_UNJUDGED: i64 = 3
42const ACR_P_OP_INVALID: i64 = 4
43const ACR_P_REF_MISSING: i64 = 5
44const ACR_P_REF_BAD: i64 = 6
45const ACR_P_REF_INVALID: i64 = 7
46const ACR_P_REF_PANEL: i64 = 8
47const ACR_P_REF_TIER: i64 = 9
48const ACR_P_REF_NOFLOOR: i64 = 10
49const ACR_P_REF_BELOW: i64 = 11
50const ACR_P_SEAT_MISSING: i64 = 12
51const ACR_P_UNKNOWN: i64 = 13
53const ACR_REF_OK: i64 = 0
54const ACR_REF_NO_CONF: i64 = 1
55const ACR_REF_NO_RECEIPT: i64 = 2
56const ACR_REF_PANEL_UNADMITTED: i64 = 3
57const ACR_REF_TIER_UNADMITTED: i64 = 4
58const ACR_REF_NO_FLOOR: i64 = 5
60const ACR_EXIT_AGREED: i64 = 0
61const ACR_EXIT_NOT_AGREED: i64 = 1
62const ACR_EXIT_USAGE: i64 = 2
63const ACR_EXIT_UNKNOWN: i64 = 3
64const ACR_EXIT_REFUSED: i64 = 4
65const ACR_EXIT_IO: i64 = 5
66const ACR_EXIT_UNOBS: i64 = 6
68const ACR_DIGEST_BYTES: i64 = 32
69const ACR_HEXCAP: i64 = 72
70const ACR_NIB: i64 = 16
71const ACR_HEX_ALPHA: i64 = 87 // 'a' minus 10: nibbles 10..15 print as a..f
72const ACR_UNOBS: i64 = 0 - 9999 // nx_charjudge_census CJP_UNOBS: a lens that could not see
73const ACR_LINECAP: i64 = 1024
74const ACR_LP: i64 = 16
75const ACR_WHY_WORDS: i64 = 8
76const ACR_DECL_TAIL: *u8 = "() -> i64 { return 1 }"
77const ACR_FUNC_KW: *u8 = "func "

functions

79func acr_catf(d: *u8, o: i64, key: *u8, v: *u8) -> i64 { var p: i64 = al_cat(d, o, key); p = al_cat(d, p, v); return p }
80func acr_catfn(d: *u8, o: i64, key: *u8, v: i64) -> i64 { var p: i64 = al_cat(d, o, key); p = al_catn(d, p, v); return p }
83func acr_party(bk: *i64, cf: *i64, si: i64, why: *i64) -> i64
102func acr_party_name(c: i64) -> *u8
called by 1: acr_status_line
120func acr_ref_admit(cf: *i64, tier: *u8, floor_out: *i64) -> i64
131func acr_ref_admit_name(c: i64) -> *u8
141func acr_composite(percept: i64, floor: i64) -> i64 { if floor == LCF_MISS { return 0 } if percept >= floor { return 1 } return 0 }
144func acr_kvint(buf: *u8, n: i64, key: *u8, absent: i64) -> i64
called by 2: acm_refereeacm_referee calls 1: al_slen
177func acr_hex(d: *u8, out: *u8) -> i64
called by 1: acr_sha256_buf
190func acr_sha256_buf(b: *u8, n: i64, outhex: *u8) -> i64
196func acr_sha256_file(path: *u8, outhex: *u8) -> i64
207func acr_status_line(bk: *i64, cf: *i64, si: i64, dom: *u8, org: *u8, out: *u8, o0: i64, cap: i64) -> i64
240func acr_summary(bk: *i64, cf: *i64, planes: i64, unmapped_named: i64, out: *u8, o0: i64, cap: i64) -> i64
267func acr_order(bk: *i64, ord: *i64) -> i64
283func acr_unmapped(pfx: *u8, out: *u8, oo: *i64, cap: i64) -> i64
322func acr_boards(bk: *i64, dir: *u8, doms: *u8, orgs: *u8, over: *i64) -> i64
345func acr_lines_starting(b: *u8, n: i64, needle: *u8) -> i64
called by 1: acr_declares calls 1: al_slen
363func acr_declares(b: *u8, n: i64, subject: *u8) -> i64
374func acr_decl_shape(b: *u8, n: i64) -> i64