code wiki / (root) / nx_acquire_lib.nx

nx_acquire_lib.nx

buildroot/runtime/nx_acquire_lib.nx

13223 B240 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic acquire
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_acquire_lib.nx nx_acquire.nx nx_acquire_gate.nx

imports: nx_syscalls.nx

imported by: nx_acquire.nxnx_acquire_gate.nx

structs

none

consts

39const AQ_EV_NONE: i64 = 0 // no licence seen anywhere. The 24-of-26 NAVER case.
40const AQ_EV_DECLARED: i64 = 1 // an upstream page ASSERTED one; we have NOT read its text.
41const AQ_EV_READ: i64 = 2 // we hold the licence text in our own mirror and read it.
44const AQ_NO: i64 = 0
45const AQ_REVIEW: i64 = 1
46const AQ_YES: i64 = 2
49const AQ_R_MIRROR: i64 = 0
50const AQ_R_REDIST: i64 = 1
51const AQ_R_LEARN: i64 = 2
52const AQ_R_ATTRIB: i64 = 3
53const AQ_R_SLOTS: i64 = 4
54const AQ_WORD: i64 = 8
59const AQ_RC_OK: i64 = 0
60const AQ_RC_REVIEW: i64 = 3
61const AQ_RC_REFUSE: i64 = 4
185const AQ_ALG_UNKNOWN: i64 = 0
186const AQ_ALG_MD5: i64 = 1
187const AQ_ALG_SHA1: i64 = 2
188const AQ_ALG_SHA256: i64 = 3
189const AQ_HEXLEN_MD5: i64 = 32
190const AQ_HEXLEN_SHA1: i64 = 40
191const AQ_HEXLEN_SHA256: i64 = 64
196const AQ_FIX_MATCH: i64 = 0
197const AQ_FIX_UNAVAILABLE: i64 = 3
198const AQ_FIX_MISMATCH: i64 = 4

functions

63func aq_res() -> *i64 { return sys_mmap(AQ_R_SLOTS * AQ_WORD) as *i64 }
called by 2: mainmain calls 1: sys_mmap
70func aq_decide(ev: i64, redist: i64, verified: i64, res: *i64) -> i64
called by 2: mainmain
128func aq_right_name(v: i64) -> *u8
called by 1: main
135func aq_ev_name(ev: i64) -> *u8
called by 1: main
142func aq_rc_name(rc: i64) -> *u8
called by 1: main
152func aq_ev_parse(s: *u8) -> i64
called by 2: mainmain
200func aq_alg_hexlen(alg: i64) -> i64
210func aq_digest_shape_ok(alg: i64, hexlen: i64) -> i64
called by 2: mainaq_fixity calls 1: aq_alg_hexlen
224func aq_fixity(alg: i64, declared_bytes: i64, actual_bytes: i64, declared_hexlen: i64, digest_equal: i64) -> i64
called by 1: main calls 1: aq_digest_shape_ok
235func aq_fix_name(v: i64) -> *u8