Repository navigation
feat(atomic-memory): recall merged memories through historical aliases - #2674
Tech-Circle-48 wants to merge 10 commits into
Conversation
hidb4ai
left a comment
There was a problem hiding this comment.
The Atomic maintenance initialization regression below blocks approval.
Design note (non-blocking): #2326 specifies a lexical baseline and a separately evaluated historical-vector rollout. This implementation enables both by default, while the reported comparison uses deterministic vectors and covers only repeated wording and an unrelated control. Please reconcile that scope/default decision with the issue and provide the requested lexical-versus-vector and total-flush cost evidence, or retain an opt-in rollout until that decision is made.
|
Design note (non-blocking): Could we reuse the existing revision history and authoritative merge links for this lookup instead of introducing I understand that resolving a known merged identity is different from discovering it through historical wording. However, the historical content and merge relationships already exist. Please explain what prevents us from searching the selected revisions of currently merged identities, then resolving their active successors under the existing authorization checks. Before adding another table and its lifecycle/rebuild logic, please compare that approach with the proposed projection, including query support and measured cost. If a separate projection is necessary, please also justify historical vector storage separately from the lexical baseline. |
PR oceanbase#2674 registers the same v1_5_0_006 ID and adds identically named migration files; two linear chains cannot share a revision ID. Renumber the prepare diagnostics revision, its schema resources, manifest registrations, docs and target-revision assertions, and refresh the compatibility review digest. Co-Authored-By: Claude Code <noreply@anthropic.com>
hireview001
left a comment
There was a problem hiding this comment.
- Resolve merge conflicts with the target branch.
|
The old queued CI run was cancelled while migrating eligible Linux checks to the internal runner pools in #2711. At head
Please sync the branch with master, resolve the conflicts, and push the update. GitHub cannot start a new |
| else: | ||
| raise AtomicMemoryIndexError("dialect", "Atomic Memory projection needs SQLite or MySQL") | ||
| await connection.execute(statement, values) | ||
| if self.alias_table not in self.tables: |
There was a problem hiding this comment.
[P2] self.alias_table not in self.tables 恒为 False,注释描述的清理豁免永远不会生效
:975 把 alias_table 无条件放进 self.tables,且 self.tables 只有这一处赋值:
self.alias_table = atomic_memory_alias_table(table.c.embedding.type)
self.tables: tuple[Table, ...] = (table, self.alias_table, ...)因此 :1075 的 if self.alias_table not in self.tables: return 在对象构造完成后不可能成立,replace_many() 末尾的 alias 清理对所有路径都会执行。注释「Frozen historical conversion publishes before the alias revision / Only the registered current layout owns outgoing alias cleanup」描述的是一个真实场景,但这个判据表达不出来它。
两种可能都不理想:该场景不存在时,这里是死代码,且注释会让人以为有保护;该场景存在时(冻结历史转换早于 alias revision 建表),replace_many() 会对尚未创建的 pc_atomic_memory_alias 执行 DELETE,在 SQLite 上就是 no such table。
建议把判据换成能表达该场景的事实(连接上的实际表清单、或索引是否注册了 alias 表),或者删掉分支并把注释改为「alias 清理随 tables 一同注册」。若判断该场景不必保留,补一条在 alias 表缺失的连接上调用 replace_many() 的用例即可把这个分支的语义钉住。
Which issue or RFC does this PR close?
Closes #2326.
Rationale for this change
After a memory is merged, its historical wording may no longer match its active successor. Repeating that wording can therefore create a duplicate active identity. Historical aliases allow reconciliation to consider the current successor under existing filtering, authorization and decision rules.
What changes are included in this PR?
pc_atomic_memory_aliasprojection and transactional lifecycle maintenance.atomic_memory_alias_recallswitch; disabling it skips alias queries.v1_5_0_006without changing frozen historical migration contracts.Are there any user-facing changes?
Reconciliation can now find an active successor through a merged memory's historical wording. Public search, content/state models, reconciliation actions and prompts retain their existing semantics.
Managed databases require an explicit schema upgrade. Existing merged records require a separate projection rebuild to populate aliases.
Empty projections or embedding-profile changes may regenerate vectors. Nondeterministic embedding services cannot reproduce deleted historical vector bytes from authority alone.
How was this change tested?
uv run prek run -a: passed.ty checkandgit diff --check: passed.Authored SQLite cases used deterministic vectors. Historical wording changed from
createtonoop, adding one successor candidate and approximately 217 estimated input tokens. The unrelated-fact control retainedcreatewith no token increase.Actual SQLite behavior was exercised. OceanBase/MySQL validation covered generated SQL and schema fixtures; no real OceanBase service or real embedding/generation model acceptance was performed.
AI usage statement