Notes shorter than 40 characters are silently skipped, so the README "Verify" example indexes 0 notes
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
Direzione di ricerca
Inizia con chunks_of() e _chunk_note in src/sqlite_graph_memory/index_notes.py, poi leggi la sezione «Verify» del README e gli esempi di encoder simulati in tests/test_index_notes.py o tests/test_incremental_index.py. Verifica come main segnala le note che non producono chunk. Il lavoro è completato quando le tre note del README sono indicizzate, una nota vuota viene conteggiata come saltata e test mirati coprono entrambi i casi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
chunks_of() drops every chunk shorter than 40 characters (src/sqlite_graph_memory/index_notes.py:66, if len(c) >= 40). A note whose whole body is shorter than that produces no chunk and is left out of the index. sgm-index does not say so.
The README section "Verify" suggests a first test with three notes and gives their text: project-ouzel.md ("Built with [[tool-lanternfish]]"), tool-lanternfish.md ("written in Elixir") and meeting-lighthouse.md ("See [[project-ouzel]]"). They are 31, 17 and 21 characters long. Following it literally on a clone of master (0.3.9, Windows 11, Python 3.12, [lite] backend, fresh index folder):
$ sgm-index ./notes
no indexable .md notes found under notes
$ echo $?
0
The README says to expect indexed 3 chunks from 3 files -> <index folder>. The next two commands of the same section then run against the empty index that this first run wrote: sgm-doctor ends with All good. and sgm-ask --ab ... stops with a traceback. That part is tracked in #130; this issue is about the notes being skipped.
With a mixed folder the skip is invisible. I made the meeting note 91 characters long and kept the other two as above, with a fresh index folder:
$ sgm-index ./notes
encoded 1/1
indexed 1 chunks from 1 files -> <index folder>
Nothing tells the user that two of three notes were left out. Those two notes can still be link targets, but they can never be returned by recall.
Why it matters
This is the documented first test for a new user or for an agent doing the setup, and it fails at step one with a message that suggests the folder is wrong. In real vaults, short notes are common (a person card with one line, a stub that only links elsewhere), and they vanish from recall without a trace.
Suggested approach
- Keep the 40-character floor for trailing fragments of a long note, but always emit at least one chunk for a note whose body is non-empty after stripping. For example: in
_chunk_note, ifchunks_of(body)yields nothing andbody.strip()is not empty, use the stripped body as the single chunk. - Count notes that produced no chunk (empty body, unreadable) and print it in the summary line, for example
indexed 1 chunks from 1 files (2 notes skipped: empty) -> .... - If you would rather keep short notes out on purpose, say so in this thread first. Then the minimal fix is: print the skipped count, and change the README example notes so each body is longer than 40 characters.
Done when
- The three notes from README "Verify", typed exactly as written there, give
indexed 3 chunks from 3 files. - A new test in
tests/test_index_notes.pyortests/test_incremental_index.py(fake encoder, no model) indexes a 17-character note and asserts it has a row in the meta. The test fails on current master. - A test asserts that a note with an empty body is reported in the skipped count and does not crash the run.
python -m pytest -qshows no new failures.
Where to start
src/sqlite_graph_memory/index_notes.py:chunks_of(line 62),_chunk_note(line 126),main(line 257)README.md: section "Verify"tests/test_index_notes.py,tests/test_incremental_index.py(shows how to inject a fake encoder)
New here? Comment that you are taking it and ask anything in this thread; small PRs are reviewed within a day.
- Lingua principale
- Python
- Stelle
- 9
- Fork
- 6
- Merge medio
- 13h 8m
- PR unite (30g)
- 40
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 tonydzi/sqlite-graph-memory
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
tonydzi/sqlite-graph-memory#133 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
tonydzi/sqlite-graph-memory#132 ·
I maintainer di solito rispondono entro 1 giorno
-
sgm-index on a mistyped or empty folder overwrites the existing index with an empty one and exits 0Apertabug good first issue
Difficoltà 3/5 1-2 giorni Idoneità per principianti 78/100
tonydzi/sqlite-graph-memory#130 ·
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
tonydzi/sqlite-graph-memory#126 ·
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
tonydzi/sqlite-graph-memory#125 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di tonydzi/sqlite-graph-memory
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
LearningCircuit/local-deep-research#10161 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
chore: contact address [email protected]Forse già presa @larsrollik l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Gustavo-Galvao-e-Silva/panchi#228 ·
I maintainer di solito rispondono entro 1 giorno