pub struct Ranker<'a> { /* private fields */ }Implementations§
Source§impl<'a> Ranker<'a>
impl<'a> Ranker<'a>
pub fn new(engine: &'a Engine<'a>) -> Self
Sourcepub fn pagerank_global(&self) -> Result<Vec<(String, f64)>>
pub fn pagerank_global(&self) -> Result<Vec<(String, f64)>>
Raw global PageRank vector: (node_id, score) over the full heterogeneous universe, id-sorted. No projection, no blending.
Sourcepub fn pagerank_global_with(
&self,
contributors: &[EdgeWeightFn],
) -> Result<Vec<(String, f64)>>
pub fn pagerank_global_with( &self, contributors: &[EdgeWeightFn], ) -> Result<Vec<(String, f64)>>
Global vector with edge-weight contributors applied.
Sourcepub fn pagerank_global_with_hooks(
&self,
contributors: &[EdgeWeightFn],
extra: &[(String, String, String, f64)],
) -> Result<Vec<(String, f64)>>
pub fn pagerank_global_with_hooks( &self, contributors: &[EdgeWeightFn], extra: &[(String, String, String, f64)], ) -> Result<Vec<(String, f64)>>
Global vector with edge weights and extra rank-time edges applied.
Sourcepub fn reference_graph(&self) -> Result<Vec<ReferenceEdge>>
pub fn reference_graph(&self) -> Result<Vec<ReferenceEdge>>
Normalized reference graph (§123 intermediate): trusted
relationships mapped to reference kinds (call/read/write/…).
Read-only projection — the reference surface SystemRanker
diffuses over, with per-edge provenance and confidence.
Sourcepub fn universe(&self) -> Result<Vec<(String, String)>>
pub fn universe(&self) -> Result<Vec<(String, String)>>
Rank-universe nodes (§123 intermediate): (id, kind) over the full heterogeneous universe in rank order. Same nodes every vector is indexed by — the node table for pagerank.global/task.
Sourcepub fn universe_with(
&self,
hooks: &RankHooks,
goal: &str,
) -> Result<Vec<(String, String)>>
pub fn universe_with( &self, hooks: &RankHooks, goal: &str, ) -> Result<Vec<(String, String)>>
Rank universe merged with plugin rank-node providers (§124 item
17): the same table symbols_with_hooks diffuses over. Read-only
stage view — no entity, relationship, or evidence is written.
Sourcepub fn project_symbols(
&self,
vector: &[(String, f64)],
) -> Result<Vec<(String, f64)>>
pub fn project_symbols( &self, vector: &[(String, f64)], ) -> Result<Vec<(String, f64)>>
Project a universe vector to per-symbol scores (§123
intermediate): entity importance reaching owner/handler symbols.
vector is (id, score) pairs over universe ids (e.g. a
pagerank.global/task row); unknown ids score 0. Same projection
symbols_with_hooks blends from — exposed for debuggability.
Sourcepub fn rank_edges(&self) -> Result<Vec<(String, String, String, f64)>>
pub fn rank_edges(&self) -> Result<Vec<(String, String, String, f64)>>
Raw rank-universe edges (§123.12): (subject, predicate, object, base weight), pre-aggregation. No plugin hooks by contract — the structure the vectors diffuse over.
Sourcepub fn pagerank_task(&self, goal: &str) -> Result<Vec<(String, f64)>>
pub fn pagerank_task(&self, goal: &str) -> Result<Vec<(String, f64)>>
Raw task-personalized PPR vector for goal.
Sourcepub fn pagerank_task_with(
&self,
goal: &str,
contributors: &[EdgeWeightFn],
) -> Result<Vec<(String, f64)>>
pub fn pagerank_task_with( &self, goal: &str, contributors: &[EdgeWeightFn], ) -> Result<Vec<(String, f64)>>
Task vector with edge-weight contributors applied.
Sourcepub fn pagerank_task_with_hooks(
&self,
goal: &str,
contributors: &[EdgeWeightFn],
extra: &[(String, String, String, f64)],
) -> Result<Vec<(String, f64)>>
pub fn pagerank_task_with_hooks( &self, goal: &str, contributors: &[EdgeWeightFn], extra: &[(String, String, String, f64)], ) -> Result<Vec<(String, f64)>>
Task vector with edge weights and extra rank-time edges applied.
Sourcepub fn required_with(
&self,
goal: &str,
hooks: &RankHooks,
) -> Result<BTreeSet<String>>
pub fn required_with( &self, goal: &str, hooks: &RankHooks, ) -> Result<BTreeSet<String>>
Engine required-coverage base set (entry ids build_surface
partitions on): invariant/invocation/flow/state-owner entries.
The op unions plugin coverage providers over this.
Sourcepub fn seeds_with(&self, goal: &str, hooks: &RankHooks) -> Result<Vec<TaskSeed>>
pub fn seeds_with(&self, goal: &str, hooks: &RankHooks) -> Result<Vec<TaskSeed>>
Task-seed merge for goal (§123.11): lexical seeds + plugin
providers, weights summed by id. Shared by ranking.seeds and
symbols_with_hooks — one merge, two callers.
Sourcepub fn candidates(&self, goal: &str, limit: usize) -> Result<Vec<ScoredEntity>>
pub fn candidates(&self, goal: &str, limit: usize) -> Result<Vec<ScoredEntity>>
Lexical candidate generation for goal (stage 1).
Sourcepub fn candidates_with(
&self,
goal: &str,
limit: usize,
hooks: &RankHooks,
) -> Result<Vec<ScoredEntity>>
pub fn candidates_with( &self, goal: &str, limit: usize, hooks: &RankHooks, ) -> Result<Vec<ScoredEntity>>
Candidates with explicit plugin providers (one call, deterministic
order). Provider rows merge by canonical id: max score wins, the
provider reason is tagged plugin:<id> for explainability.
Sourcepub fn symbols(&self, req: &RankRequest) -> Result<RankResult>
pub fn symbols(&self, req: &RankRequest) -> Result<RankResult>
Full task/global blend per symbol with feature decomposition. Same math as build_surface (no MMR/quotas/budget — pure ranking). Plugin seed/feature/rerank hooks apply here and are recorded.
Sourcepub fn trace_with_hooks(
&self,
req: &RankRequest,
hooks: &RankHooks,
) -> Result<(RankResult, Vec<String>, Vec<String>)>
pub fn trace_with_hooks( &self, req: &RankRequest, hooks: &RankHooks, ) -> Result<(RankResult, Vec<String>, Vec<String>)>
Full ranking trace (§19): the RankResult plus the inputs the blend consumed — seed ids and required entry ids. Same computation as symbols_with_hooks (no new math); the envelope makes the decision auditable without re-deriving inputs.
Sourcepub fn symbols_with_hooks(
&self,
req: &RankRequest,
hooks: &RankHooks,
) -> Result<RankResult>
pub fn symbols_with_hooks( &self, req: &RankRequest, hooks: &RankHooks, ) -> Result<RankResult>
symbols() with explicit plugin hooks (one call, deterministic order).
Derivation shares the pipeline’s inputs BY CONSTRUCTION: per-entry
confidence, required set, seed membership, and lexical scores come
from the compiled surface map and its helpers — the same values
build_surface blends. Per-symbol totals take the max over that
symbol’s entries (overloads); blends are otherwise identical math.