Skip to main content

Module ranking

Module ranking 

Source
Expand description

Engine ranking namespace: every ranker stage callable independently.

Thin wrappers over the existing scc-context pipeline pieces — no algorithm changes. ranking.symbols runs the FULL blend (same math as build_surface) and returns per-item feature decomposition plus plugin contributions; stage ops expose the raw vectors. Plugin hooks (spec 18): seed providers, edge-weight contributors, rank features, and rerankers chain deterministically; every contribution is recorded in the explanation.

Structs§

BlendWeights
Per-feature linear blend weights. None = SCC default.
RankFeatureValue
RankHooks
Ranker
ScoreRow
One explicit feature row for score_entries: all eight core inputs plus the task-mode flag, keyed by id.

Functions§

apply_edge_weight
apply_quotas
default_similarity
Default MMR similarity: same non-empty group => 1.0, else 0.0. Groups are caller-supplied (component/path); None/empty never match.
fold_similarity
Fold chained similarity providers over one pair: first nonzero wins. Falls back to default_similarity when no provider fires.
group_of2
Group lookup for a ranked id (parallel groups vec).
mmr_select
resolve_override
First-Some-wins override resolution: providers abstain with None; out-of-range values ([0,1] required) abstain too. Returns the value plus a provider(N) source tag for reasons, or None source when every provider abstained and the default stands.
score_entries
Pure per-entry blend (§123 intermediate ranking.score_entries): final_importance over each explicit row. No store, no hooks — the same math symbols_with_hooks blends from, exposed for audit and for callers scoring their own feature rows.
select_with_budget

Type Aliases§

CandidateProvider
CoverageProvider
Required-coverage contributor (§124 item 26): symbol ids that MUST count as required (criticality 1.0), unioned with the engine’s required_ids base. E.g. a security plugin marks tainted sinks required so task ranking never demotes them.
CriticalityProvider
Criticality override (§53 CriticalityProvider): per-symbol criticality in [0,1], or None to keep the engine default (seed/required => 1.0, else file-importance score). First Some in chain order wins; out-of-range values degrade to the default (never clamp silently into the blend — a contributor that cannot name a valid score abstains).
EdgeWeightFn
Edge-weight contributor: per-edge (subject, predicate, object, base) adjustment. Return Some((mode, value)) to alter the weight, None for no change. Modes: add | multiply | replace | veto. Every applied contribution is recorded on the affected rank items’ reasons.
NoveltyProvider
Novelty override (§53 NoveltyProvider): per-symbol novelty in [0,1], or None to keep the engine default of 1.0. Same first-Some-wins and range discipline as CriticalityProvider.
RankEdgeProvider
Rank-time edge contributor (§48): (subject, predicate, object, weight) triples that enter diffusion without becoming canonical architecture facts. Every edge records its source (see the rank-edges(N) reason); endpoint ids outside the rank universe and non-positive/non-finite weights are skipped by the ranker.
RankFeatureFn
RankNodeProvider
Rank-universe node contributor (§124 item 17 RankNodeProvider): (id, kind) pairs merged into the rank universe before edge indexing. Only rankable kinds enter (the ranker’s RANKABLE_KINDS gate); empty ids, unknown kinds, and duplicates of view nodes abstain. Rank-time only: no entity, relationship, or evidence is written. Deterministic chain order; the universe stays id-sorted regardless of provider order.
RerankerFn
RiskProvider
Change-risk override (§53 RiskProvider): per-symbol change risk in [0,1], or None to keep the engine default (stale path => 1.0, else 0.0). Same first-Some-wins and range discipline as CriticalityProvider (shared ScalarOverrideProvider alias).
ScalarOverrideProvider
One scalar-override provider (criticality or novelty): None abstains.
SeedProvider
SemanticProvider
Semantic-score override (§53 SemanticProvider): per-symbol semantic relevance in [0,1] against the goal, or None to keep the engine default of 0.0 (no scorer configured). Same first-Some-wins and range discipline as CriticalityProvider. When any provider contributes, the blend keeps the documented redistribution math: the semantic share is real, so no renormalization applies.
SimilarityFn