Skip to main content

apply_importance_reweight

Function apply_importance_reweight 

Source
pub fn apply_importance_reweight(
    hits: Vec<SearchHit>,
    importance_by_id: &HashMap<u64, f64>,
    confidence_by_id: &HashMap<u64, f64>,
    enabled: bool,
) -> Vec<SearchHit>
Expand description

0.8.16 Slice 5 / F9 — OFF-by-default importance/confidence reweight, applied to the fused hits AFTER bit-KNN + RRF (mirrors [apply_recency_reweight]).

Multiplicative-on-fused (ADR-0.8.16 §2.2, HITL-SIGNED 2026-07-08): a hit’s score is scaled by node importance (importance_by_id) × edge confidence (confidence_by_id), each keyed by the hit’s interim id (write_cursor). A missing key = NULL = never assigned = graceful-absent ⇒ neutral (1.0), the OPP-12 Q6a graceful-absent state. Node hits carry importance; graph/edge hits carry confidence; the two id-spaces never collide (cursors are globally unique), so each hit gets exactly one non-neutral factor.

R-F9-4 graceful-neutral identity: when enabled but no hit has a non-neutral factor (every importance/confidence absent), the input is returned unchanged — byte-identical to the enabled == false result (no re-sort), so declaring the mechanism never perturbs an all-absent corpus.