sgm-index --help is an error, and sgm-ask embeds --help or a mistyped flag as the query
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python, sqlite
- Lĩnh vực
- cli, developer-experience
Hướng nghiên cứu
Bắt đầu với main() trong src/sqlite_graph_memory/brain_ask.py, src/sqlite_graph_memory/index_notes.py và src/sqlite_graph_memory/doctor.py; đọc các mẫu parser hiện có và tests/test_version_flag.py. Thêm kiểm thử cho phần trợ giúp, các cờ không xác định, dấu phân cách -- và sgm-index --version, đồng thời đảm bảo phần trợ giúp không tải mô hình hoặc thao tác với tệp. Chạy các kiểm thử tập trung, rồi chạy python -m pytest -q; hoàn tất khi tất cả hành vi lệnh được liệt kê đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
The two commands a new user runs first have no working --help, and sgm-ask accepts any unknown flag as part of the question.
On a clone of master (0.3.9, Windows 11, Python 3.12, [lite] backend, index built from bench/vault):
$ sgm-index --help
usage: sgm-index [--full] [notes_dir]
sgm-index: error: unrecognized arguments: --help
$ echo $?
2
$ sgm-index --version
usage: sgm-index [--full] [notes_dir]
sgm-index: error: unrecognized arguments: --version
$ sgm-ask --help
12 hits (scope=all) -> _brain_answer.txt
$ head -2 _brain_answer.txt
QUERY: --help
(scope=all; e5 60 files -> dense; 204 chunks)
$ sgm-ask --grahp "ouzel" # typo of --graph
12 hits (scope=all) -> _brain_answer.txt
$ head -1 _brain_answer.txt
QUERY: --grahp ouzel
Causes:
src/sqlite_graph_memory/index_notes.py:258builds the parser withargparse.ArgumentParser(add_help=False), so--helpis rejected. Runningsgm-indexwith no arguments does print the module docstring.src/sqlite_graph_memory/brain_ask.py:547-548keeps a fixed set of known flags and joins everything else into the query.--helploads the model, runs a recall for the text--help, overwrites_brain_answer.txtand exits 0. A mistyped flag silently turns the mode off and changes the query.
sgm-stats and sgm-turnstate-show already use a normal argparse parser, and #75 added --version to sgm-stats and sgm-ask. sgm-doctor --help ignores the flag and just runs the checks.
Why it matters
--help is the first thing people type. Today it is an error for one command and a slow, misleading recall for the other. The typo case is worse for evaluation work: sgm-ask --grahp ... looks like a successful graph run but is a vector run on a different query.
Suggested approach
sgm-index: dropadd_help=False, pass the module docstring as the description (withformatter_class=argparse.RawDescriptionHelpFormatter), add--versionin the same style as #75.sgm-ask: handle-h/--helpfirst by printing the module docstring and exiting 0. For any other argument that starts with--and is not a known flag, printunknown option: <arg>to stderr and exit 2. Support a literal--separator so a question that really starts with dashes can still be asked (todaysgm-ask -- "--help"runs a recall for the text-- --help).sgm-doctor: accept-h/--helpand print a short usage text.- Keep the manual parsing in
brain_ask.pyif a full argparse rewrite feels too large; the checks above are enough. Mind the--pooloption, which_parse_poolalready strips before the flag set is applied.
Done when
sgm-index --help,sgm-ask --helpandsgm-doctor --helpexit 0, print usage, do not load a model and do not write_brain_answer.txtor touch the index.sgm-ask --grahp "x"exits 2 with a message that names the unknown option.sgm-ask -- "--help"runs a recall for the text--help.sgm-index --versionprintssgm-index <version>.- New tests next to
tests/test_version_flag.pycover these cases without a model or an index, and fail on current master. python -m pytest -qshows no new failures.
Where to start
src/sqlite_graph_memory/brain_ask.py:main()from line 538,_parse_poolat line 495 for the existing style of manual flag parsingsrc/sqlite_graph_memory/index_notes.py:main()at line 257src/sqlite_graph_memory/doctor.py:main()at line 185tests/test_version_flag.pyas a template
New here? Comment that you are taking it and ask anything in this thread; small PRs are reviewed within a day.
- Ngôn ngữ chính
- Python
- Star
- 9
- Fork
- 6
- Merge trung bình
- 13 giờ 8 phút
- Pull request đã merge (30 ngày)
- 40
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tonydzi/sqlite-graph-memory
-
bug documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
tonydzi/sqlite-graph-memory#131 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
tonydzi/sqlite-graph-memory#132 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sgm-index on a mistyped or empty folder overwrites the existing index with an empty one and exits 0Đang mởbug good first issue
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
tonydzi/sqlite-graph-memory#130 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
tonydzi/sqlite-graph-memory#126 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
tonydzi/sqlite-graph-memory#125 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của tonydzi/sqlite-graph-memory
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
LearningCircuit/local-deep-research#10161 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
chore: contact address [email protected]Có thể đã có người làm @larsrollik đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Gustavo-Galvao-e-Silva/panchi#228 ·
Maintainer thường phản hồi trong vòng 1 ngày