记忆信任等级
wesgine 记忆系统的信任等级(Trust)分类及其对 GC、冲突解决的影响。
信任等级
| 等级 | 含义 | 典型 Kind |
|---|---|---|
TrustSystem | 最高,系统级只读 | KindEnvironment |
TrustExplicit | 用户显式声明 | KindInstruction / KindConstraint |
TrustMulti | 多方确认 | KindCollective / KindFact |
TrustInferred | 引擎推断 | KindPreference / KindCorrection / KindConvention |
TrustUnknown | 未知来源 | 其他 |
零值陷阱
Go 零值 0 = TrustSystem = 最高信任。
漏设 Trust 的条目静默成为系统级只读,污染冲突解决与 GC 打分。
兜底映射
saveCore 在 Trust==TrustSystem && Kind!=KindEnvironment 时自动兜底:
defaultTrustForKind:
Environment → System
Instruction / Constraint → Explicit
Collective / Fact → Multi
Preference / Correction / Convention → Inferred
其余 → Unknown
显式设置的 Trust 不受影响。
信任等级的消费者
GC retentionScore
高 Trust 条目更不容易被淘汰。
冲突解决
detectSupersession 中高 Trust 条目不被低 Trust 条目否定。
Digest
跨条目合并时考虑 Trust 等级。