unmerge discards survivor and decision writes made after the merge
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- database
Direzione di ricerca
Start with src/selfgraph/resolution.ts, reading unmerge around the cited lines and trace how it uses the merge record and current entity or decision state. Reproduce both cases with the Kuzu backend, then run the relevant tests or add focused regressions. Done means unmerge removes only merge additions, preserves later writes and decision edits, and matches the no-merge replay.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
unmerge reverts the survivor entity and a touched decision to the state captured in the merge record, discarding writes made to them after the merge. The docs say unmerging leaves exactly what the inserts would have written without the merge, and that a decision keeps edits made after the merge, but later writes are lost.
Reproductions (0.2.2, Kuzu backend)
Survivor aliases and properties re-added by a later write are stripped
g = SelfGraph(store=KuzuStore(path), namespace="e", resolver="exact")
await g.initialize()
await g.insert.facts({"entities": [{"type": "Person", "name": "Ann Lee", "aliases": ["AL"]}]})
r = await g.insert.facts({"entities": [{"type": "Person", "name": "AL", "aliases": ["Annie"], "properties": {"k": 1}}]}, resolver="default")
# "AL" merges into person:ann-lee, adding alias "Annie" and k=1.
await g.insert.facts({"entities": [{"type": "Person", "name": "Ann Lee", "aliases": ["Annie"], "properties": {"k": 2}}]})
# A later explicit write that also sets alias "Annie" and k=2.
await g.entities.unmerge(r.merges[0].id)
e = await g.entities.get("person:ann-lee")
# Observed: aliases ['AL'], properties {}. Expected: aliases ['AL', 'Annie'], properties {'k': 2}.
Decision outcome and alternatives revert to the pre-merge snapshot
# Insert 1 merges and records decision d with outcome person:xavier.
# Insert 2 upserts the same decision id with outcome person:yolanda.
# After unmerge: outcome reverts to person:xavier (expected: person:yolanda).
Cause
In src/selfgraph/resolution.py, unmerge:
- removes survivor aliases and properties by name with
remove_aliases=list(rec.added_aliases)/remove_properties=list(rec.added_properties)(around lines 1419 to 1420), so a key re-added by a later write is stripped; - rebuilds a decision's
outcome_entityandalternative_entitiesfrom the merge record'soriginal/rewrittensnapshot (around lines 1344 to 1370) instead of the decision's current version, while it does take the other fields from the current version.
Expected
Unmerge removes only the merge's own additions and keeps any value a later write set, and a decision keeps its post-merge outcome and alternatives, so unmerge-all equals the no-merge replay.
- Lingua principale
- TypeScript
- Stelle
- 173
- Fork
- 58
- Merge medio
- 6h
- PR unite (30g)
- 120
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hydra-db/selfgraph
-
approved-for-pr area: cli-mcp area: errors bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
hydra-db/selfgraph#401 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: errors area: store bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
hydra-db/selfgraph#398 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: errors area: write bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
hydra-db/selfgraph#392 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: parity area: write bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hydra-db/selfgraph#391 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hydra-db/selfgraph
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
code-yeongyu/senpi#7139 ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
lingdojo/kana-dojo#34395 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mastra-ai/mastra#31093 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:web p2 product:business triage:active type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
cuadrao-ai/argus#2328 ·
I maintainer di solito rispondono entro 1 giorno
-
bug frontend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
nikhilb2/simple_invoicing#907 ·