nx_wiki_license.nx
buildroot/runtime/wiki/nx_wiki_license.nx
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
imports: nx_wiki_archive.nx
imported by: nx_wiki_cite_render.nx
structs
| none |
consts
| 44 | const NXLIC_UNKNOWN: i64 = 0 |
| 45 | const NXLIC_PUBLIC_DOMAIN: i64 = 1 |
| 46 | const NXLIC_CC0: i64 = 2 |
| 47 | const NXLIC_CC_BY: i64 = 3 |
| 48 | const NXLIC_CC_BY_SA: i64 = 4 |
| 49 | const NXLIC_CC_BY_NC: i64 = 5 |
| 50 | const NXLIC_CC_BY_ND: i64 = 6 |
| 51 | const NXLIC_CC_BY_NC_SA: i64 = 7 |
| 52 | const NXLIC_PROPRIETARY: i64 = 8 |
| 56 | const NXLIC_CAP: i64 = 64 |
functions
| 60 | func nx_wiki_license_name(cls: i64) -> *u8 called by 1: nx_wiki_cite_one |
| 77 | func nx_wiki_license_hostable(cls: i64) -> i64 |
| 92 | func nx_wiki_license_attribution_required(cls: i64) -> i64 |
| 103 | func nx_wiki_lickey(cid: *u8, out: *u8) -> i64 |
| 116 | func nx_wiki_license_set_w(w: *i64, cid: *u8, cls: i64) -> i64 |
| 130 | func nx_wiki_license_set(prefix: *u8, cid: *u8, cls: i64, segid: i64) -> i64 |
| 140 | func nx_wiki_license_get(prefix: *u8, cid: *u8) -> i64 |