nx_arc_anchor.nx
buildroot/runtime/nx_arc_anchor.nx
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
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
| 67 | struct ArcAnchor |
consts
| 54 | const NX_ANCHOR_UNKNOWN: i64 = 0 |
| 55 | const NX_ANCHOR_OUTFIT_LOCATION: i64 = 1 // apron + kitchen |
| 56 | const NX_ANCHOR_OUTFIT_CHARACTER: i64 = 2 // suit + boss |
| 57 | const NX_ANCHOR_LOCATION_CHARACTER: i64 = 3 // bedroom + spouse |
| 58 | const NX_ANCHOR_OUTFIT_OUTFIT: i64 = 4 // layered clothing |
| 59 | const NX_ANCHOR_LOCATION_LOCATION: i64 = 5 // adjacent rooms |
| 63 | const NX_ARC_ANCHOR_PROMOTE_N: i64 = 3 |
| 78 | const NX_ARC_ANCHOR_BYTES: i64 = 64 |
functions
| 82 | func nx_arc_anchor_classify(role_a: i64, role_b: i64) -> i64 called by 1: nx_arc_anchor_discover |
| 111 | func nx_arc_anchor_discover(co: *Cooccur, reg: *TermRegistry, |