STDLIB.md: handle_key documented as returning 1/0; it returns true/false, so a test written from the doc raises on == 1
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ó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 85/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- bash, python
- Lĩnh vực
- documentation
Hướng nghiên cứu
Đoạn văn lỗi thời nằm trong docs/STDLIB.md quanh dòng 880, ở đoạn về handle_key, ghi rằng hàm trả về 1 hoặc 0. Hãy đọc lib/ui.eigs (dòng 606-627) để xác nhận hàm trả về true/false, sau đó kiểm tra dòng bảng gần dòng 2246, dòng này đã đúng. Công việc hoàn tất khi đoạn văn ghi true/false, bash tools/docs_claims_check.sh chạy thành công và python3 tests/test_doc_examples.py docs/STDLIB.md chạy thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Found by audit area 11 (do doc examples run), read-only, against main b367cd7.
docs/STDLIB.md:877-881 says handle_key of [root, ev] "returns 1 when the toolkit consumed the key, 0 when it is free for the app". The function returns booleans: lib/ui.eigs:606-627 has return true / return false on every path, and its tail call _handle_focus_key (lib/ui_focus.eigs:58) also returns true/false.
Why it matters: the paragraph is written for headless tests ("a headless test drives keys exactly like mouse"), and the natural test assertion follows the doc:
consumed is true
print of (consumed == 1)
$ ./src/eigenscript repro.eigs
Error repro.eigs:2: cannot compare bool and num with '=='
So a test written from the doc dies instead of asserting. The table row at docs/STDLIB.md:2246 ("report whether a key was consumed") is correct; only the prose is stale. A search of docs/STDLIB.md, docs/BUILTINS.md, docs/llms.txt, docs/SYNTAX.md, README.md and AGENTS.md for other predicates documented as 1/0 found only this one and docs/SYNTAX.md:407 (filed with the SYNTAX.md issue). task_detach's documented 1/0 (docs/BUILTINS.md:920) matches what it returns.
Blind spot: I did not drive handle_key itself with a real root and event; the return values come from reading lib/ui.eigs, and the error comes from running the comparison.
Done when
-
docs/STDLIB.md:880sayshandle_keyreturnstruewhen the toolkit consumed the key andfalsewhen it is free for the app. -
bash tools/docs_claims_check.shandpython3 tests/test_doc_examples.py docs/STDLIB.mdpass.
— Duet (orchestrator)
Generated by Claude Code
- Ngôn ngữ chính
- C
- Star
- 3
- Fork
- 7
- Merge trung bình
- 6 giờ 26 phút
- Pull request đã merge (30 ngày)
- 318
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- 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 InauguralSystems/EigenScript
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
InauguralSystems/EigenScript#2311 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
InauguralSystems/EigenScript#2305 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ci bug found-by:duet-audit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
InauguralSystems/EigenScript#2283 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:docs found-by:duet-audit kind:docs-drift
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
InauguralSystems/EigenScript#2282 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
X11 title and ctype tests pick their display from $$ and can silently attach to a foreign X serverĐang mởarea:gfx kind:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
InauguralSystems/EigenScript#2216 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của InauguralSystems/EigenScript
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
colbymchenry/codegraph#3223 ·
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 70/100
arduino/ArduinoCore-megaavr#152 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
FujiNetWIFI/fujinet-firmware#2261 ·
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 62/100
kivy/python-for-android#3405 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Nmap
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày