nx_acquire_lib.nx
buildroot/runtime/nx_acquire_lib.nx
about
nx_acquire_lib.nx -- THE LIBRARIAN'S DOOR: what may we do with an EXTERNAL artifact?
WHY THIS EXISTS. The estate already holds every primitive for taking in a third-party research
artifact: nx_research_fetch mirrors the bytes and emits a provenance line, nx_canon_cid content-
addresses them (cid_of_file), nx_asset_provenance signs the binding and already ships a
prov_class_downloaded, nx_mirror_orchestrator verifies a digest FAIL-CLOSED and derives an
idempotent CAS key, and nx_licgate_lib decides commercial rights. NOTHING JOINS THEM, so an
external work has never had a record. This lib is that record's DECISION half.
THE MEASUREMENT THAT SHAPED IT, taken 2026-08-25 against the mirrored listing at
https://europe.naverlabs.com/research/code/ (knowledge/fetched/cmp_librarian_naverlabs_code.html,
522716 bytes, sha256 deeb6ab8..5592): of the 26 releases on page 1, exactly 2 carry ANY licence
string -- 77 permil -- and BOTH are prose parentheticals inside a description, not a field. The
markup has no licence element at all. 24 of 26 would require opening the linked repository.
=> A LIBRARIAN THAT READS THE LICENCE OFF A LISTING PAGE IS WRONG 923 TIMES IN 1000.
=> EVIDENCE IS ITS OWN AXIS. "the page asserted Apache-2.0" and "we hold the LICENSE file and read
it" are DIFFERENT FACTS and must never collapse into one column. An unread licence ABSTAINS.
This is the same law nx_licgate_lib's `verified` column encodes -- and which, until 2026-08-25, it
parsed and never consulted, so an admittedly-UNCONFIRMED row returned full SHIP_OK.
THE FOUR VERDICTS ARE DELIBERATELY INDEPENDENT, because they fail apart in practice. Collapsing
them is exactly how a project gets mirrored for study and then accidentally republished:
may_mirror -- may we keep a copy at all. THE ANTI-ROT RIGHT.
may_redistribute -- may we serve that copy onward to third parties.
may_learn_from -- may we study it, and use it as an ORACLE or a BENCHMARK, taking no code.
must_attribute -- an OBLIGATION, not a right: it takes the MAX and DEFAULTS TO YES.
REVIEW BLOCKS. THE ONLY VERDICT THAT PERMITS IS YES. A consumer that reads REVIEW as permission
has misread this lib -- REVIEW means "a human must settle a term a machine may not", which is the
third state, not a soft pass. Encoded in the SAME order as nx_licgate_lib (0 NO < 1 REVIEW < 2 YES)
so "most restrictive wins" stays a plain MIN and the two rulers can never disagree on direction.
PURE BY CONSTRUCTION: aq_decide touches no file and no clock. Its whole input is its arguments, so
its gate needs no fixture and cannot go vacuous through a missing one.
license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_acquire.nxnx_acquire_gate.nx
structs
| none |
consts
| 39 | const AQ_EV_NONE: i64 = 0 // no licence seen anywhere. The 24-of-26 NAVER case. |
| 40 | const AQ_EV_DECLARED: i64 = 1 // an upstream page ASSERTED one; we have NOT read its text. |
| 41 | const AQ_EV_READ: i64 = 2 // we hold the licence text in our own mirror and read it. |
| 44 | const AQ_NO: i64 = 0 |
| 45 | const AQ_REVIEW: i64 = 1 |
| 46 | const AQ_YES: i64 = 2 |
| 49 | const AQ_R_MIRROR: i64 = 0 |
| 50 | const AQ_R_REDIST: i64 = 1 |
| 51 | const AQ_R_LEARN: i64 = 2 |
| 52 | const AQ_R_ATTRIB: i64 = 3 |
| 53 | const AQ_R_SLOTS: i64 = 4 |
| 54 | const AQ_WORD: i64 = 8 |
| 59 | const AQ_RC_OK: i64 = 0 |
| 60 | const AQ_RC_REVIEW: i64 = 3 |
| 61 | const AQ_RC_REFUSE: i64 = 4 |
| 185 | const AQ_ALG_UNKNOWN: i64 = 0 |
| 186 | const AQ_ALG_MD5: i64 = 1 |
| 187 | const AQ_ALG_SHA1: i64 = 2 |
| 188 | const AQ_ALG_SHA256: i64 = 3 |
| 189 | const AQ_HEXLEN_MD5: i64 = 32 |
| 190 | const AQ_HEXLEN_SHA1: i64 = 40 |
| 191 | const AQ_HEXLEN_SHA256: i64 = 64 |
| 196 | const AQ_FIX_MATCH: i64 = 0 |
| 197 | const AQ_FIX_UNAVAILABLE: i64 = 3 |
| 198 | const AQ_FIX_MISMATCH: i64 = 4 |
functions
| 63 | func aq_res() -> *i64 { return sys_mmap(AQ_R_SLOTS * AQ_WORD) as *i64 } |
| 70 | func aq_decide(ev: i64, redist: i64, verified: i64, res: *i64) -> i64 |
| 128 | func aq_right_name(v: i64) -> *u8 called by 1: main |
| 135 | func aq_ev_name(ev: i64) -> *u8 called by 1: main |
| 142 | func aq_rc_name(rc: i64) -> *u8 called by 1: main |
| 152 | func aq_ev_parse(s: *u8) -> i64 |
| 200 | func aq_alg_hexlen(alg: i64) -> i64 |
| 210 | func aq_digest_shape_ok(alg: i64, hexlen: i64) -> i64 |
| 224 | func aq_fixity(alg: i64, declared_bytes: i64, actual_bytes: i64, declared_hexlen: i64, digest_equal: i64) -> i64 |
| 235 | func aq_fix_name(v: i64) -> *u8 |