graflo.architecture.schema.context.rank¶
Ranking vertex types by how useful they are to an agent orienting itself.
Local signals only — degree, identity policy, property count, index presence, hop distance from a seed. No embeddings and no corpus statistics: semantic ranking is the server's business (it has the index), core stays dependency-free.
RankingWeights
¶
Bases: ConfigBaseModel
Relative weight of each local signal. Weights need not sum to 1.
Source code in graflo/architecture/schema/context/rank.py
VertexSignals
¶
Bases: ConfigBaseModel
Per-vertex-type ranking inputs and the score derived from them.
Source code in graflo/architecture/schema/context/rank.py
score_vertices(graph, seeds=(), *, weights=None, max_hops=3, direction=EdgeDirection.ANY)
¶
Rank every vertex type in graph, highest score first.
With no seeds, ranking is seed-independent (structure only) and answers "what are the important types here" — which is what the orientation card needs. With seeds, hop distance dominates and answers "what is near what I asked about".
Ties break by vertex name ascending. This is not cosmetic: without a total order the elision report is not reproducible across runs, and the budget tests become flaky.