code wiki / (root) / nx_term_registry.nx

nx_term_registry.nx

buildroot/runtime/nx_term_registry.nx

15458 B437 linesdepth 2pulls 2 transitivereach 13 importersview sourcekind librarytopic term
docsdependenciesstructsconstsfunctions

about

nx_term_registry.nx -- open string-id pool with sightings + stage. Foundation of the LEARNING ingestion layer. Replaces hand-written sealed-enum dictionaries (nx_outfit_vocabulary, nx_location_dict, etc.) with a self-grown registry that LEARNS its vocabulary from the ingested corpus. Every noun phrase the discovery layer finds gets registered here with provenance: where first seen, how many times sighted across the corpus, what semantic role (outfit / location / character / action / object), and which self-surfacing-intelligence stage it has reached. Per cardinals: feedback-self-surfacing-intelligence-staged-autonomy: STAGE1 SUPERVISED (default for fresh sightings), STAGE2 PROMPTED (>= N sightings + 0 contradictions), STAGE3 UNSUPERVISED (user-pinned or arc-anchor confirmed). feedback-user-owns-every-bit: this primitive holds the LIVE counts in-memory; durable snapshots ship to nishi-library/seeds/*.toml on demand, never via background daemon. feedback-loras-and-negatives-are-patches: the registry is a substrate-native CLOSED-LOOP measurement surface -- not a black-box embedding -- so confidence is auditable per-term. nx_safety_envelope: intended_use: "Open string-id pool for discovered noun phrases, with sighting counts, semantic role tags, and self-surfacing stage." sil_target: SIL2 asil_target: QM dal_target: DAL C iec_62304_class: NONE evidence: [no_floating_point, fixed_capacity_hash_table, bounded_probe_length_per_jpl_rule_2, sealed_role_enum, sealed_stage_enum,

dependencies 1 imports · 11 importers

nx_syscalls.nx nx_term_registry.nx nx_arc_anchor.nx nx_arc_anchor_test.nx nx_caption_emit_test.nx nx_content_guard_test.nx nx_ingest_cli.nx nx_noun_phrase_scan.nx nx_scene_index.nx nx_scene_index_test.nx nx_term_cooccur.nx nx_term_extract.nx

diagram shows first 10 each side; +0 more imports, +1 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_arc_anchor.nxnx_arc_anchor_test.nxnx_caption_emit_test.nxnx_content_guard_test.nxnx_ingest_cli.nxnx_noun_phrase_scan.nxnx_scene_index.nxnx_scene_index_test.nxnx_term_cooccur.nxnx_term_extract.nxnx_term_extract_test.nx

structs

88struct Term
118struct TermRegistry

consts

62const NX_TERM_ROLE_UNKNOWN: i64 = 0
63const NX_TERM_ROLE_OUTFIT: i64 = 1
64const NX_TERM_ROLE_LOCATION: i64 = 2
65const NX_TERM_ROLE_CHARACTER: i64 = 3
66const NX_TERM_ROLE_ACTION: i64 = 4
67const NX_TERM_ROLE_OBJECT: i64 = 5
68const NX_TERM_ROLE_AFFECT: i64 = 6
69const NX_TERM_ROLE_TIME: i64 = 7
75const NX_TERM_STAGE_UNKNOWN: i64 = 0
76const NX_TERM_STAGE_SUPERVISED: i64 = 1 // fresh sighting, human reviews
77const NX_TERM_STAGE_PROMPTED: i64 = 2 // proposes; human approves
78const NX_TERM_STAGE_UNSUPERVISED: i64 = 3 // auto-applies; logs only
81const NX_TERM_PROMOTE_N_PROMPTED: i64 = 5 // 5 sightings -> STAGE2
82const NX_TERM_PROMOTE_N_UNSUPERVISED: i64 = 30 // user pin or 30+ sights
106const NX_TERM_BYTES: i64 = 96
114const NX_TERM_REGISTRY_DEFAULT_CAP: i64 = 16384
115const NX_TERM_REGISTRY_STR_ARENA: i64 = 1048576 // 1 MiB
116const NX_TERM_PROBE_LIMIT: i64 = 64
128const NX_TERM_REGISTRY_BYTES: i64 = 48

functions

132func nx_term_load_u8(p: *u8, i: i64) -> i64
137func nx_term_store_u8(p: *u8, i: i64, v: i64)
142func nx_term_to_lower(c: i64) -> i64
155func nx_term_fnv1a_lower(buf: *u8, n: i64) -> i64
174func nx_term_registry_alloc_sized(cap: i64, str_cap: i64) -> *TermRegistry
called by 1: nx_term_registry_alloc calls 1: sys_mmap
191func nx_term_registry_alloc() -> *TermRegistry
195func nx_term_at(r: *TermRegistry, i: i64) -> *Term
206func nx_term_is_trim(c: i64) -> i64
222func nx_term_intern_canonical(r: *TermRegistry, src: *u8,
273func nx_term_canon_eq(r: *TermRegistry, off1: i64, len1: i64,
called by 1: nx_term_find_slot calls 1: nx_term_load_u8
295func nx_term_find_slot(r: *TermRegistry, h: i64,
336func nx_term_observe(r: *TermRegistry, src: *u8,
409func nx_term_pin(r: *TermRegistry, slot: i64) -> i64
calls 1: nx_term_at
419func nx_term_lookup(r: *TermRegistry, src: *u8,