nx_register.nx
buildroot/runtime/nx_register.nx
about
nx_register.nx -- WRITING arc, rung W-ING-3 (X-WRITE-ING-002): the REGISTER
CLASSIFIER + SFW/EXPLICIT ROUTING SEAM with GOVERNANCE. This is the seam from
the 2026-06-12 fiction-ingestion spec: the tutor (Claude) builds the
content-agnostic mechanism; the operator's local-LLM lane runs the explicit
register THROUGH it.
MECHANISM ONLY (no explicit content authored here): a register is scored by an
intensity LEXICON that is pure DATA (rule 25) -- the caller supplies terms +
per-term weights. The SFW lane and the operator's explicit lane each extend the
lexicon WITHOUT touching this organ. The gate proves the math with benign
proxy terms (calm/heated/graphic).
GOVERNANCE is non-bypassable by construction: content that scores at/above the
explicit threshold may route to the explicit lane ONLY if age + consent + locale
all pass; otherwise it is REFUSED. (Anti-exploitation X-ETH-001, consent/
provenance, locale-law + age-verification -- all DATA inputs to rg_decision.)
rg_score(t, a, b, terms, weights, nterms) -> sum(count(term)*weight) = intensity
rg_decision(score, threshold, age_ok, consent_ok, locale_ok) ->
RG_ROUTE_SFW(0) : below threshold -> tutor/team SFW lane
RG_ROUTE_EXPLICIT_LANE(1): at/above threshold AND governance OK -> local lane
RG_ROUTE_REFUSE(2) : at/above threshold AND governance NOT satisfied
Pure integer, NO syscalls. Reuses nx_ingest's whole-word counter (DRY).
license_tier: ORIGINAL
module: nishi-core.write.register
depends: nishi-core.write.ingest
capability: WRITE_REGISTER_ROUTING
dependencies 2 imports · 5 importers
imports: nx_ingest.nxnx_ingest_scene.nx
imported by: nx_dialogue.nxnx_emit_gate.nxnx_register_gate.nxnx_write_exceed_gate.nxnx_write_run.nx
structs
| none |
consts
| 33 | const RG_ROUTE_SFW: i64 = 0 |
| 34 | const RG_ROUTE_EXPLICIT_LANE: i64 = 1 |
| 35 | const RG_ROUTE_REFUSE: i64 = 2 |
functions
| 38 | func rg_score(t: *u8, a: i64, b: i64, terms: *u8, weights: *i64, nterms: i64) -> i64 called by 7: dl_side_maxdl_first_explicitdl_slopemainmainmain+1 calls 2: ig_name_offig_count_name_in |
| 51 | func rg_decision(score: i64, threshold: i64, age_ok: i64, consent_ok: i64, locale_ok: i64) -> i64 |