nx_manga_rating_lib.nx
buildroot/runtime/nx_manga_rating_lib.nx
about
nx_manga_rating_lib.nx -- THE CONTENT RATING DECISION as a shared lib (mangagen MG24 mr_rate_row,
MG32 mr_adult_invariant). SINGLE RESPONSIBILITY: this file DECIDES, nx_manga_rating is a thin CLI
over it, and nx_manga_rating_gate tests it IN-PROCESS. One decision, one home -- so the CLI and the
gate cannot drift into two different answers, which is the whole reason for the split.
COMPOSES THE INCUMBENTS AND RE-IMPLEMENTS NEITHER:
nx_torrent_access nx_taccess_allow(viewer_level, area) -- the fail-closed VIEWER-LEVEL decision
from the operator directive of 2026-06-20. OWNER 3 / FAMILY 1 / ANON 0;
areas SFW 0 requires FAMILY, NSFW 1 requires OWNER. This lib NEVER re-decides
access: it says which AREA an asset belongs in and hands that to the incumbent.
nx_wardrobe_state WS_ADULT_AGE -- the adult threshold already failing closed at construction in
the character lane. IMPORTED, never redeclared: the same constant written twice
is two constants to every scanner, and an age threshold that can drift between
two organs is a defect generator rather than a policy.
THE LOAD-BEARING PROPERTY:
AN UNRATED ASSET IS TREATED AS GATED, NEVER AS SAFE. An absent rating is not evidence of innocence.
Every mapping fails toward the MORE restrictive area, so a missing row costs a family viewer a page
it could have seen -- never the reverse.
dependencies 3 imports · 1 importers
imports: nx_syscalls.nxnx_torrent_access.nxnx_wardrobe_state.nx
imported by: nx_manga_rating_gate.nx
structs
| none |
consts
| 25 | const MR_RATE_UNRATED: i64 = 0-1 |
| 26 | const MR_RATE_ALLAGES: i64 = 0 |
| 27 | const MR_RATE_TEEN: i64 = 1 |
| 28 | const MR_RATE_MATURE: i64 = 2 |
| 29 | const MR_RATE_ADULT: i64 = 3 |
| 30 | const MR_RATE_MAX: i64 = 3 |
| 34 | const MR_CLOTHED: i64 = 0 |
| 35 | const MR_EXPOSED: i64 = 1 |
| 37 | const MR_OK: i64 = 0 |
| 38 | const MR_E_MINOR: i64 = 0-1 |
| 39 | const MR_E_RATING: i64 = 0-2 |
| 40 | const MR_E_ROW: i64 = 0-3 |
| 42 | const MR_ROWCAP: i64 = 512 |
| 43 | const MR_PIPE: i64 = 124 |
functions
| 45 | func mr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: mr_rate_row |
| 47 | func mr_apps(dst: *u8, o: i64, s: *u8) -> i64 called by 1: mr_rate_row |
| 53 | func mr_num(dst: *u8, o: i64, v: i64) -> i64 |
| 65 | func mr_atoi(s: *u8) -> i64 |
| 83 | func mr_rating_valid(r: i64) -> i64 |
| 91 | func mr_area_for_rating(r: i64) -> i64 |
| 99 | func mr_may_serve(viewer_level: i64, r: i64) -> i64 |
| 120 | func mr_depiction_legal(subject_age: i64, exposed: i64) -> i64 called by 1: main |
| 129 | func mr_rate_row(cid: *u8, r: i64, src: *u8, epoch: i64, out: *u8, cap: i64) -> i64 |