unmerge deletes a relation an independent insert reasserted on the survivor (data loss)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Read src/selfgraph/resolution.py around unmerge (lines 1180–1305) and trace how rewritten relations, their versions, and evidence are restored before runner.delete_edges runs. Reproduce with the Kuzu example in the issue, then check existing unmerge tests for coverage. Done means unmerging removes only the merge’s contribution and preserves the independent survivor relation, matching the no-merge replay.
索引モデルが issue の本文から書いたものです。
説明
Summary
unmerge deletes a relation that an independent insert created on the survivor after the merge, causing silent data loss. The docs state that unmerging every merge of an insert leaves exactly what the inserts would have written without the merge, but here a relation written after the merge is removed entirely.
Reproduction (0.2.2, Kuzu backend)
g = SelfGraph(store=KuzuStore(path), namespace="e", resolver="exact")
await g.initialize()
await g.insert.facts({"entities": [{"type": "Person", "name": "Bob Ray"}, {"type": "Company", "name": "Zed Inc"}]}, source_id="seed")
r = await g.insert.facts(
{"entities": [{"type": "Person", "name": "Bob Raye"}],
"relations": [{"from_entity": "person:bob-raye", "type": "WORKS_AT", "to_entity": "company:zed"}]},
resolver="fuzzy", source_id="s2")
# "Bob Raye" resolves and merges into person:bob-ray; the relation is rewritten onto person:bob-ray.
await g.insert.facts(
{"relations": [{"from_entity": "person:bob-ray", "type": "WORKS_AT", "to_entity": "company:zed"}]}, source_id="s3")
# An independent, explicit bob-ray -> zed from a different source.
await g.entities.unmerge(r.merges[0].id)
# Observed: only person:bob-raye -> company:zed remains (carrying 2 sources). person:bob-ray -> company:zed is gone.
# Expected (what the same inserts produce with resolver="exact", no merge): both relations present,
# person:bob-ray -> zed and person:bob-raye -> zed.
Cause
In src/selfgraph/resolution.py, unmerge (around lines 1180 to 1305) restores each rewritten relation by reading the survivor-side relation's current versions and evidence, then runner.delete_edges(ns, rw.id) removes every version of it and writes the relation back onto the absorbed endpoint. It cannot distinguish the merge's own contribution from an independent assertion made on the survivor after the merge, so the later write is deleted with it.
Expected
Unmerge removes only the merge's contribution and leaves relations written independently after the merge in place, so unmerge-all equals the no-merge replay.
- 主要言語
- TypeScript
- スター
- 173
- フォーク
- 58
- 平均マージ
- 6時間
- マージ済み PR(30日)
- 120
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hydra-db/selfgraph のほかの issue
-
approved-for-pr area: cli-mcp area: errors bug effort: S P3
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
hydra-db/selfgraph#401 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
approved-for-pr area: errors area: store bug effort: S P3
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
hydra-db/selfgraph#398 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
approved-for-pr area: errors area: write bug effort: S P3
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
hydra-db/selfgraph#392 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
approved-for-pr area: parity area: write bug effort: S P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
hydra-db/selfgraph#391 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
hydra-db/selfgraph の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
code-yeongyu/senpi#7139 ·
メンテナーはふだん 1 日以内に返信
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
lingdojo/kana-dojo#34395 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
bug status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mastra-ai/mastra#31093 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:web p2 product:business triage:active type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 89/100
cuadrao-ai/argus#2328 ·
メンテナーはふだん 1 日以内に返信
-
bug frontend good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
nikhilb2/simple_invoicing#907 ·