code wiki / (root) / nx_arc_anchor.nx

nx_arc_anchor.nx

buildroot/runtime/nx_arc_anchor.nx

6235 B155 linesdepth 5pulls 7 transitivereach 8 importersview sourcekind librarytopic arc
docsdependenciesstructsconstsfunctions

about

nx_arc_anchor.nx -- discover recurring scene-motif tuples. An "arc anchor" is a tuple of co-occurring terms that recur across the ingested corpus and together identify a scene archetype: e.g. (OUTFIT=apron, LOCATION=kitchen) -> "domestic intimacy" anchor; (OUTFIT=robe, LOCATION=bedroom) -> "morning intimate" anchor. Discovery is BOTTOM-UP: nx_term_cooccur counts pairs across beats, and we surface the top-K pairs whose role combination matches one of the anchor templates. No hand-written motif list -- the templates are STRUCTURAL (which role-pairs are scene-archetypal) and the actual terms come from the registry. Per cardinals: feedback-self-surfacing-intelligence: anchors enter at STAGE1 SUPERVISED. Promotion happens when the anchor recurs in a fresh corpus, with sighting count crossing NX_ARC_ANCHOR_PROMOTE_N (3) and zero user-rejections. feedback-build-intelligence-never-strip-features: anchors with weak signals stay surfaced as STAGE1 candidates rather than getting filtered out; the user reviews and pins / dismisses. nx_safety_envelope: intended_use: "Surface recurring (outfit + location + character?) scene-archetype tuples from co-occurrence counts." sil_target: SIL2 asil_target: QM dal_target: DAL C iec_62304_class: NONE evidence: [no_floating_point, bounded_loops_per_jpl_rule_2, sealed_anchor_kind_enum, anchor_template_is_structural_not_topical] hazard_register: [bug-tape-anchor-spurious-on-tiny-corpus, bug-tape-anchor-misses-three-term-tuples] residual_risk: "V1 surfaces only 2-term anchors (the most

dependencies 3 imports · 6 importers

nx_syscalls.nx nx_term_registry.nx nx_term_cooccur.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_scene_index.nx nx_scene_index_test.nx

imports: nx_syscalls.nxnx_term_registry.nxnx_term_cooccur.nx

imported by: nx_arc_anchor_test.nxnx_caption_emit_test.nxnx_content_guard_test.nxnx_ingest_cli.nxnx_scene_index.nxnx_scene_index_test.nx

structs

67struct ArcAnchor

consts

54const NX_ANCHOR_UNKNOWN: i64 = 0
55const NX_ANCHOR_OUTFIT_LOCATION: i64 = 1 // apron + kitchen
56const NX_ANCHOR_OUTFIT_CHARACTER: i64 = 2 // suit + boss
57const NX_ANCHOR_LOCATION_CHARACTER: i64 = 3 // bedroom + spouse
58const NX_ANCHOR_OUTFIT_OUTFIT: i64 = 4 // layered clothing
59const NX_ANCHOR_LOCATION_LOCATION: i64 = 5 // adjacent rooms
63const NX_ARC_ANCHOR_PROMOTE_N: i64 = 3
78const NX_ARC_ANCHOR_BYTES: i64 = 64

functions

82func nx_arc_anchor_classify(role_a: i64, role_b: i64) -> i64
111func nx_arc_anchor_discover(co: *Cooccur, reg: *TermRegistry,