fix(memory,loop): 记忆作用域读写成对 + source_conversation 结构化(裁决 1.9/04.4.2/04.4.3)
- 04.4.2/1.9 读侧:Retrieve 候选集并集 = 本人 persona 域 ∪ user 共享域 ∪ project 共享域(他角色 persona 域仍排除),群聊/陌生人取受限收窄
- 写侧:群聊/陌生人整段跳过记忆提取(可查不可写),persona 域仅属主可写
- 04.4.3:source_conversation 不再由 LLM 自由生成(prompt 不索要、候选结构不含该键),落库时无条件盖真实 {session_id,message_id},编解码集中在 memory/source.go
- 新增跨角色种子用例(原用例即使关掉并集也会通过)+ 成对用例「同群聊上下文:读得到共享域、写不进 store」
- 同步 store.go/retrieve.go 文档注释,与 design/03 §3/§4 口径一致
This commit is contained in:
1 parent
af8591b78a
commit
0ce498754a
11 files changed
+428
-60
No files matched your search
@@ -234,9 +234,10 @@ func (s *Store) Get(ctx context.Context, id string) (MemoryItem, error) {
|
||||
// ListByPersona returns every item for personaID, newest first. rowid breaks
|
||||
// created_at ties so items written within the same clock tick keep a stable
|
||||
// newest-first order. It is the persona-isolation boundary: items belonging to
|
||||
// other personas are never returned, so personas never share memory (design
|
||||
// §4). Use ListScope when a caller needs to see shared user/project scopes or
|
||||
// another persona's read-only items.
|
||||
// other personas are never returned, so personas never share their own 角色日常
|
||||
// namespace (design §4). It is only the *own* half of the retrieval candidate
|
||||
// set — the retriever unions it with the shared user/project scopes before
|
||||
// ranking (design §3/§4, see Retriever.visibleCandidates).
|
||||
func (s *Store) ListByPersona(ctx context.Context, personaID string) ([]MemoryItem, error) {
|
||||
if strings.TrimSpace(personaID) == "" {
|
||||
return nil, ErrMissingPersona
|
||||
|
||||
Reference in new issue
Block a user