code wiki / wiki / nx_wiki_license.nx

nx_wiki_license.nx

buildroot/runtime/wiki/nx_wiki_license.nx

7527 B153 linesdepth 7pulls 8 transitivereach 25 importersview sourcekind librarytopic wiki
docsdependenciesstructsconstsfunctions

about

nx_wiki_license.nx -- PER-SOURCE LICENSE LAYER for the no-link-rot archive. THE EXCEED OVER WIKIPEDIA (anti-pushout, done RIGHT): We render a cited supporting source INLINE in the wiki -- but ONLY when the license permits us to host/redistribute it. This module is the gate that decides hostable vs link-only. Getting this WRONG is the one unacceptable failure: inlining content we are not licensed to host. So the rule is sealed here, data-driven (per-source tag in the archive store), and the cite-render asks THIS module -- never guesses. LICENSE CLASSES (sealed enum; values are stable on-disk so a stored tag keeps meaning forever -- additive-only, never renumber): 0 UNKNOWN not hostable (we don't know -> we don't inline) 1 PUBLIC_DOMAIN hostable, no attribution required 2 CC0 hostable, no attribution required (PD-equivalent dedication) 3 CC_BY hostable, attribution required 4 CC_BY_SA hostable, attribution required (share-alike) 5 CC_BY_NC hostable, attribution required (non-commercial) 6 CC_BY_ND hostable, attribution required (no-derivatives -- verbatim redistribution, which inline display IS, is permitted) 7 CC_BY_NC_SA hostable, attribution required 8 PROPRIETARY NOT hostable (all-rights-reserved -> link only) HOSTABLE = "the license permits us to redistribute / display the verbatim source bytes to a reader". Public-domain + CC0 + every Creative-Commons variant grant redistribution (the NC/ND/SA conditions constrain commercial use / derivatives / relicensing, NOT verbatim display, which is exactly what an inline read is). PROPRIETARY and UNKNOWN are the deny set. STORE: the per-source tag lives in the SAME content-addressed seg_store the archive uses (prefix WAR_PREFIX from nx_wiki_archive.nx), under key wikilic:<cid> -> one byte = the license class (0..8) keyed by the SOURCE's CID so the license travels with the content address. Absent tag => UNKNOWN (fail-closed: an un-tagged source is never inlined). IMPORTS: nx_wiki_archive.nx (for WAR_PREFIX + the seg_store API it re-exports transitively). NishiLang's resolver de-dups imports by module identity (the archive itself imports nx_seg_store + nx_canon_cid; importing the archive here splices each ONCE), so no double-import nxasm-rc6 landmine. Pure NishiLang, NO SQL, NO .sh/.py/.js, no new .tsv/.conf. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_wiki_archive.nx nx_wiki_license.nx nx_wiki_cite_render.nx

imports: nx_wiki_archive.nx

imported by: nx_wiki_cite_render.nx

structs

none

consts

44const NXLIC_UNKNOWN: i64 = 0
45const NXLIC_PUBLIC_DOMAIN: i64 = 1
46const NXLIC_CC0: i64 = 2
47const NXLIC_CC_BY: i64 = 3
48const NXLIC_CC_BY_SA: i64 = 4
49const NXLIC_CC_BY_NC: i64 = 5
50const NXLIC_CC_BY_ND: i64 = 6
51const NXLIC_CC_BY_NC_SA: i64 = 7
52const NXLIC_PROPRIETARY: i64 = 8
56const NXLIC_CAP: i64 = 64

functions

60func nx_wiki_license_name(cls: i64) -> *u8
called by 1: nx_wiki_cite_one
77func nx_wiki_license_hostable(cls: i64) -> i64
92func nx_wiki_license_attribution_required(cls: i64) -> i64
103func nx_wiki_lickey(cid: *u8, out: *u8) -> i64
116func nx_wiki_license_set_w(w: *i64, cid: *u8, cls: i64) -> i64
130func nx_wiki_license_set(prefix: *u8, cid: *u8, cls: i64, segid: i64) -> i64
140func nx_wiki_license_get(prefix: *u8, cid: *u8) -> i64