nx_accept_ref_lib.nx
buildroot/runtime/nx_accept_ref_lib.nx
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
imports: nx_syscalls.nxnx_sha256.nxnx_accept_lib.nx
imported by: nx_accept.nxnx_accept_candidate_t230.nxnx_accept_gate.nx
structs
| none |
consts
| 38 | const ACR_P_AGREED: i64 = 0 |
| 39 | const ACR_P_OP_MISSING: i64 = 1 |
| 40 | const ACR_P_OP_REJECT: i64 = 2 |
| 41 | const ACR_P_OP_UNJUDGED: i64 = 3 |
| 42 | const ACR_P_OP_INVALID: i64 = 4 |
| 43 | const ACR_P_REF_MISSING: i64 = 5 |
| 44 | const ACR_P_REF_BAD: i64 = 6 |
| 45 | const ACR_P_REF_INVALID: i64 = 7 |
| 46 | const ACR_P_REF_PANEL: i64 = 8 |
| 47 | const ACR_P_REF_TIER: i64 = 9 |
| 48 | const ACR_P_REF_NOFLOOR: i64 = 10 |
| 49 | const ACR_P_REF_BELOW: i64 = 11 |
| 50 | const ACR_P_SEAT_MISSING: i64 = 12 |
| 51 | const ACR_P_UNKNOWN: i64 = 13 |
| 53 | const ACR_REF_OK: i64 = 0 |
| 54 | const ACR_REF_NO_CONF: i64 = 1 |
| 55 | const ACR_REF_NO_RECEIPT: i64 = 2 |
| 56 | const ACR_REF_PANEL_UNADMITTED: i64 = 3 |
| 57 | const ACR_REF_TIER_UNADMITTED: i64 = 4 |
| 58 | const ACR_REF_NO_FLOOR: i64 = 5 |
| 60 | const ACR_EXIT_AGREED: i64 = 0 |
| 61 | const ACR_EXIT_NOT_AGREED: i64 = 1 |
| 62 | const ACR_EXIT_USAGE: i64 = 2 |
| 63 | const ACR_EXIT_UNKNOWN: i64 = 3 |
| 64 | const ACR_EXIT_REFUSED: i64 = 4 |
| 65 | const ACR_EXIT_IO: i64 = 5 |
| 66 | const ACR_EXIT_UNOBS: i64 = 6 |
| 68 | const ACR_DIGEST_BYTES: i64 = 32 |
| 69 | const ACR_HEXCAP: i64 = 72 |
| 70 | const ACR_NIB: i64 = 16 |
| 71 | const ACR_HEX_ALPHA: i64 = 87 // 'a' minus 10: nibbles 10..15 print as a..f |
| 72 | const ACR_UNOBS: i64 = 0 - 9999 // nx_charjudge_census CJP_UNOBS: a lens that could not see |
| 73 | const ACR_LINECAP: i64 = 1024 |
| 74 | const ACR_LP: i64 = 16 |
| 75 | const ACR_WHY_WORDS: i64 = 8 |
| 76 | const ACR_DECL_TAIL: *u8 = "() -> i64 { return 1 }" |
| 77 | const ACR_FUNC_KW: *u8 = "func " |
functions
| 79 | func 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 } |
| 80 | func 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 } |
| 83 | func acr_party(bk: *i64, cf: *i64, si: i64, why: *i64) -> i64 |
| 102 | func acr_party_name(c: i64) -> *u8 called by 1: acr_status_line |
| 120 | func acr_ref_admit(cf: *i64, tier: *u8, floor_out: *i64) -> i64 |
| 131 | func acr_ref_admit_name(c: i64) -> *u8 |
| 141 | func acr_composite(percept: i64, floor: i64) -> i64 { if floor == LCF_MISS { return 0 } if percept >= floor { return 1 } return 0 } |
| 144 | func acr_kvint(buf: *u8, n: i64, key: *u8, absent: i64) -> i64 |
| 177 | func acr_hex(d: *u8, out: *u8) -> i64 called by 1: acr_sha256_buf |
| 190 | func acr_sha256_buf(b: *u8, n: i64, outhex: *u8) -> i64 |
| 196 | func acr_sha256_file(path: *u8, outhex: *u8) -> i64 called by 5: acm_attestacm_refereeacm_attestacm_refereemain calls 3: sys_mmapsys_read_fileacr_sha256_buf |
| 207 | func acr_status_line(bk: *i64, cf: *i64, si: i64, dom: *u8, org: *u8, out: *u8, o0: i64, cap: i64) -> i64 called by 5: acm_ledgeracm_statusacm_ledgeracm_statusmain calls 12: sys_mmapacr_partyal_bk_intsal_bk_recacr_catfal_bk_name+6 |
| 240 | func acr_summary(bk: *i64, cf: *i64, planes: i64, unmapped_named: i64, out: *u8, o0: i64, cap: i64) -> i64 |
| 267 | func acr_order(bk: *i64, ord: *i64) -> i64 |
| 283 | func acr_unmapped(pfx: *u8, out: *u8, oo: *i64, cap: i64) -> i64 |
| 322 | func acr_boards(bk: *i64, dir: *u8, doms: *u8, orgs: *u8, over: *i64) -> i64 |
| 345 | func acr_lines_starting(b: *u8, n: i64, needle: *u8) -> i64 |
| 363 | func acr_declares(b: *u8, n: i64, subject: *u8) -> i64 |
| 374 | func acr_decl_shape(b: *u8, n: i64) -> i64 |