Repository navigation
fix(doctor): address four review findings from #31 (closes #107) - #110
Conversation
|
Hi, Mycroft here, Anton's synthetic AI co-founder. I read this before the human did, which is the one race I always win. Logged your pull request ("fix(doctor): address four review findings from #31 (closes #107)") after 2 h of silence, which is on us. What a machine can already tell: 3 file(s) touched, +160/-15, CI green. A human from the lab reads it within 48 hours, as CONTRIBUTING.md promises; if that clock runs out, ping the thread, it is not rude. — TonyDzi, Palo Alto AI Research Lab · more of the machine this came from (second brain + fleet coordination) lives at github.com/tonydzi, DMs open. |
tonydzi
left a comment
There was a problem hiding this comment.
Mycroft again (Anton's synthetic AI co-founder). Here is the substantive review, not just the receipt.
Read the diff and ran tests/test_doctor.py on your branch against current main (which now includes #108): 17 passed, 1 skipped. CI is green on all three workflows.
All four findings from #107 are addressed, and the tests are the right kind: the 0-byte and row-count-mismatch index cases fail on main and pass here, and test_doctor_importable_when_numpy_is_none exercises the actual traceback path in a subprocess instead of mocking around it.
One non-blocking observation: FEEDBACK is now a string literal in doctor.py while brain_ask.FEEDBACK_URL holds the same URL, so the two can drift. It does not affect behavior today and is not worth another round.
You claimed #107 first and the PR is clean, so I am merging it. Thank you, @Kaap10, for coming back to a finding from #31 and closing it properly.
Closes #107.
Addresses the four review findings in
src/sqlite_graph_memory/doctor.py:Changes
from sqlite_graph_memory import brain_askand replacedFEEDBACKwith a literal string. Importedbrain_asklazily insidecheck_embeddings,check_models, andcheck_indexso a missing or broken NumPy reports a clean[FAIL]rather than an unhandled traceback.check_embeddings,except ModuleNotFoundErrorchecksexc.name in ('torch', 'sentence_transformers')so that only absent top-level extras report[warn]; missing transitive dependencies (e.g.safetensors,tokenizers) report[FAIL]with reinstall instructions._hf_cache_dirs()now respectsXDG_CACHE_HOMEand isolates custom caches (HF_HUB_CACHE,HF_HOME) without mixing in the default~/.cache/huggingface/hub.check_index()now unpickles metadata and checksnumpy.loadarray shape (emb.shape[0] == len(meta)). Empty, truncated, or row/chunk-mismatched index files report[FAIL]with rebuild guidance.Verification
python -c "import sys; sys.modules['numpy']=None; import sqlite_graph_memory.doctor"raisedModuleNotFoundError: No module named 'numpy'.[ok] Index found.tests/test_doctor.pyfail againstmain.pytest tests/test_doctor.py -v: 18 passed.pytest tests/test_changelog_released.py -v: 8 passed.[FAIL] numpy: numpy is not installed. -> pip install sqlite-graph-memory.[FAIL] Index: The index is empty: _brain_e5_meta.pkl is 0 bytes. -> Rebuild it: sgm-index /path/to/your/notes.[lite]ONNX install exit 0 with 0 failures.AI Disclosure
Code and tests written with AI assistance (Antigravity / Gemini) and verified locally.