code wiki / _hdl_build / nx_anatomy_risk.nx
nx_anatomy_risk.nx
buildroot/runtime/_hdl_build/nx_anatomy_risk.nx
about
nx_anatomy_risk.nx -- the AnatomyRisk object: a PRE-RENDER body-horror RISK score from the composed prompt text.
FAITHFUL integer port of elder-ai-platform/services/svc-identity/anatomy_score_v2.py (Mode A -- the no-GPU proxy that
predicts anatomy-failure risk from KNOWN bug-class features in the prompt). Weights are the Python floats x1000 (no-float
doctrine); score = 1000 - total_risk, clamped [0,1000] (HIGHER = LESS body-horror risk). This is the QC the operator
tests Elara against ("we used to get body horror"): it fires on the exact contradictions a prompt-builder can create
(rear pose + face-into-camera, ecu + full-body tokens, undress + clothed tokens, too many hand tokens...). It also
EMITS which factors fired, so a flag is ACTIONABLE (clear feedback, per the no-bare-refusal rule) not a bare number.
8 of the 11 Python features are prompt-derivable and ported here; the 3 that need a structured scene_context the
sovereign daemon does not yet produce (has_companion_but_pose_solo, background_clutter_high, lighting_location_mismatch)
are DEFERRED (documented, not silently dropped) until the daemon carries a typed scene. Object model: companion_arch.md.
license_tier: ORIGINAL
dependencies 1 imports · 4 importers
imports: nx_syscalls.nx
imported by: nx_gen_orchestrator.nxnx_render_coherence.nxtest_anatomy_risk.nxtest_render_coherence.nx
structs
| none |
consts
| none |
functions
| 14 | func ar_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o } called by 1: go_anatomy_risk |
| 16 | func ar_contains(hay: *u8, hlen: i64, needle: *u8) -> i64 |
| 34 | func ar_count(hay: *u8, hlen: i64, needle: *u8) -> i64 called by 1: go_anatomy_risk |
| 52 | func ar_wordcount(hay: *u8, hlen: i64) -> i64 called by 1: go_anatomy_risk |
| 64 | func go_anatomy_risk(prompt: *u8, plen: i64, factors_out: *u8) -> i64 called by 4: go_handle_chatgo_handle_anatomycheckcheck_integration calls 4: ar_containsar_catar_countar_wordcount |