code wiki / _hdl_build / nx_anatomy_risk.nx

nx_anatomy_risk.nx

buildroot/runtime/_hdl_build/nx_anatomy_risk.nx

9451 B161 linesdepth 2pulls 2 transitivereach 10 importersview sourcekind librarytopic anatomy
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_anatomy_risk.nx nx_gen_orchestrator.nx nx_render_coherence.nx test_anatomy_risk.nx test_render_coherence.nx

imports: nx_syscalls.nx

imported by: nx_gen_orchestrator.nxnx_render_coherence.nxtest_anatomy_risk.nxtest_render_coherence.nx

structs

none

consts

none

functions

14func 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
16func ar_contains(hay: *u8, hlen: i64, needle: *u8) -> i64
34func ar_count(hay: *u8, hlen: i64, needle: *u8) -> i64
called by 1: go_anatomy_risk
52func ar_wordcount(hay: *u8, hlen: i64) -> i64
called by 1: go_anatomy_risk
64func go_anatomy_risk(prompt: *u8, plen: i64, factors_out: *u8) -> i64