Zongzi. Anchor. ScoredHost
(zongzi v0.3.0)
Copy Markdown
多候选打分的孤儿归宿策略。
ScoredHost 里的 host 为孤儿重定位时的新 focus seq 。
与 NoteTriplet 的区别:relocate 时不单向找最近邻居,而是
向两侧各扫 N 个候选,按领域规则打分,择优落户。
打分规则
- 无 Note 信息 → score 1(垫底)
- 同 key(同音高)→ 100
- 同 Window(同渲染窗)→ 50
- 跨 Window →
:forbid(硬约束;seq_to_window 缺映射降为低分 1,不硬禁)
同分且同 hops → {:conflict, :ambiguous_host}。
match_threshold / allow_follow_merge 语义同 NoteTriplet,通过 ScoredHost.Options 结构传递。
Context 键(共享快照)
:notes_by_seq—%{SeqID.t() => Note.t()}:seq_to_window—%{SeqID.t() => window_id}:focus_note— 原始 focus 的 Note
策略专属旋钮见 ScoredHost.Options。
Summary
Types
@type triplet() :: {Zongzi.Timeline.SeqID.t() | nil, Zongzi.Timeline.SeqID.t(), Zongzi.Timeline.SeqID.t() | nil}