resolver="llm" merges on a non-bool reply and raises AttributeError on a dict
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 77/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Empieza en src/selfgraph/resolution.py, en LLMResolver.resolve, y compara cómo gestiona su respuesta con _checked_output, que, según indica el issue, acepta respuestas dict. Revisa las pruebas existentes sobre el comportamiento del resolver y las salidas no válidas del LLM; después, añade cobertura para un valor no booleano de same y para respuestas dict o ausentes. El trabajo estará terminado cuando las respuestas no válidas generen ExtractionError con el código invalid_llm_output y las válidas sigan resolviéndose correctamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
LLMResolver reads answer.same from the client's reply and branches on its truthiness. Nothing validates the reply:
- A reply whose
sameis a non-empty string such as"no"or"false"merges the two entities. - A dict reply (
{"same": False}),None, or an object withoutsameraises a rawAttributeErrorout ofinsert.facts/insert.text, not aSelfGraphError.
The extraction path accepts dict replies (_checked_output validates them), so a client that returns dicts works for extraction and breaks resolution.
Reproduce
On main (5a277c9), embedded Kuzu. "Globex" and "Globex Systems" score 0.886, inside the default band, so the resolver asks the LLM.
import asyncio, tempfile
from types import SimpleNamespace
from selfgraph import KuzuStore, SelfGraph
class LLM:
def __init__(self, reply):
self.reply = reply
async def generate(self, *, system, user, output):
return self.reply if output.__name__ == "_SameEntity" else output()
async def run(reply):
with tempfile.TemporaryDirectory() as tmp:
async with SelfGraph(store=KuzuStore(f"{tmp}/g.kuzu"), llm=LLM(reply), resolver="llm") as g:
await g.insert.facts({"entities": [{"type": "Person", "name": "Globex"}]})
try:
r = await g.insert.facts({"entities": [{"type": "Person", "name": "Globex Systems"}]})
print(repr(reply), "merges:", [(m.absorbed_id, m.survivor_id) for m in r.merges])
except Exception as exc:
print(repr(reply), type(exc).__name__, exc)
for reply in [SimpleNamespace(same="no"), {"same": False}, None]:
asyncio.run(run(reply))
Output:
namespace(same='no') merges: [('person:globex-systems', 'person:globex')]
{'same': False} AttributeError 'dict' object has no attribute 'same'
None AttributeError 'NoneType' object has no attribute 'same'
Cause
src/selfgraph/resolution.py, LLMResolver.resolve: answer = await self._llm.generate(...) then if answer.same:. It should validate the reply as _SameEntity (strict bool, accepting a mapping or attributes as extraction does) and raise ExtractionError with code invalid_llm_output when it cannot.
- Lenguaje dominante
- TypeScript
- Estrellas
- 173
- Forks
- 58
- Merge medio
- 6 h
- PR fusionados (30 d)
- 120
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de hydra-db/selfgraph
-
approved-for-pr area: cli-mcp area: errors bug effort: S P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
hydra-db/selfgraph#401 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
approved-for-pr area: errors area: store bug effort: S P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
hydra-db/selfgraph#398 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
approved-for-pr area: errors area: write bug effort: S P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
hydra-db/selfgraph#392 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
approved-for-pr area: parity area: write bug effort: S P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
hydra-db/selfgraph#391 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
Todos los issues de hydra-db/selfgraph
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
code-yeongyu/senpi#7139 ·
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
lingdojo/kana-dojo#34395 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
bug status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
mastra-ai/mastra#31093 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area:web p2 product:business triage:active type:bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 89/100
cuadrao-ai/argus#2328 ·
Los mantenedores suelen responder en 1 día
-
bug frontend good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
nikhilb2/simple_invoicing#907 ·