Refine memory filtering and lexicon sources for focus entities

This commit is contained in:
2026-02-13 18:54:19 +08:00
parent f7abdd8e94
commit c6c07a2104
2 changed files with 19 additions and 11 deletions

View File

@@ -30,7 +30,8 @@ function normalize(s) {
* 1. store.json.characters.main — 已确认主要角色
* 2. store.json.arcs[].name — 弧光对象
* 3. context.name2 — 当前角色
* 4. store.json.facts[].s — L3实主语
* 4. store.json.events[].participants — L2件参与者
* 5. L0 atoms edges.s/edges.t
*
* 硬约束:永远排除 normalize(context.name1)
*
@@ -64,11 +65,12 @@ export function buildEntityLexicon(store, context) {
add(context.name2);
}
// 4. L3 facts 主语
const facts = store?.json?.facts || [];
for (const f of facts) {
if (f.retracted) continue;
add(f.s);
// 4. L2 events 参与者
const events = store?.json?.events || [];
for (const ev of events) {
for (const p of (ev?.participants || [])) {
add(p);
}
}
// 5. L0 atoms 的 edges.s/edges.t新角色在 L2 总结前即可进入词典)
@@ -118,9 +120,12 @@ export function buildDisplayNameMap(store, context) {
if (context?.name2) register(context.name2);
const facts = store?.json?.facts || [];
for (const f of facts) {
if (!f.retracted) register(f.s);
// 4. L2 events 参与者
const events = store?.json?.events || [];
for (const ev of events) {
for (const p of (ev?.participants || [])) {
register(p);
}
}
// 5. L0 atoms 的 edges.s/edges.t