A repeated id in one insert adds two revisions on every replay
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
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- database
Direzione di ricerca
Start with src/selfgraph/_ops.py, especially upsert_relations, upsert_preference, _assemble, and plan_resolution, which the issue names as the write and deduplication paths. Trace how duplicate IDs are handled before and after entity resolution, then run the reproduction against embedded Kuzu. Done means replaying the same insert adds no revisions, while distinct inputs that resolve to the same ID produce the intended final content.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
When one insert carries two inputs with the same relation or preference id but different content, each input is applied in turn, so the item gets two new revisions. Replaying the identical insert writes both again, so every replay adds two revisions, though the final content never changes.
insert.text dedups extracted items by id, but entity resolution can merge two entities after that dedup. Two extracted preferences on different values then collapse onto one preference id, and every replay of the same text grows that preference's history.
Reproduce
On main (5a277c9), embedded Kuzu:
import asyncio, tempfile
from selfgraph import KuzuStore, SelfGraph
ENTS = [{"type": "Person", "name": "Ann"}, {"type": "Food", "name": "Pizza"}]
PREF = {"subject_entity": "person:ann", "key": "food", "value_entity": "food:pizza"}
FACTS = {"entities": ENTS, "preferences": [{**PREF, "strength": 1.0}, {**PREF, "strength": 0.1}]}
async def main():
with tempfile.TemporaryDirectory() as tmp:
async with SelfGraph(store=KuzuStore(f"{tmp}/g.kuzu")) as g:
for i in range(3):
r = await g.insert.facts(FACTS)
print(i, [(p.revision, p.strength) for p in r.preferences])
asyncio.run(main())
0 [(2, 0.1)]
1 [(4, 0.1)]
2 [(6, 0.1)]
Two relations with one id and properties {"w": 1} and {"w": 2} behave the same way.
Cause
upsert_relations and upsert_preference in src/selfgraph/_ops.py apply a repeated id "as sequential upserts would", so A then B always means two writes. Folding repeated ids into one input before writing, as _assemble does for extracted relations, would make the replay a no-op. plan_resolution should dedup again after it rewrites references.
- 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 ·