STDLIB.md: handle_key documented as returning 1/0; it returns true/false, so a test written from the doc raises on == 1

クローズ 初心者向け
#2,289 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
85/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bash, python
領域
documentation

調査の方向性

古い記述は docs/STDLIB.md の880行目付近、handle_key の段落にあり、戻り値が 1 または 0 だと書かれています。lib/ui.eigs(606〜627行)を読んで、この関数が true/false を返すことを確認してください。その後、2246行目付近の表の行を確認してください。この行は既に正しい内容です。完了条件は、本文が true/false と書かれていること、bash tools/docs_claims_check.sh が成功すること、python3 tests/test_doc_examples.py docs/STDLIB.md が成功することです。

索引モデルが issue の本文から書いたものです。

説明

area:docs area:stdlib found-by:duet-audit kind:docs-drift status:claimed

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:880 says handle_key returns true when the toolkit consumed the key and false when it is free for the app.
  • bash tools/docs_claims_check.sh and python3 tests/test_doc_examples.py docs/STDLIB.md pass.

— Duet (orchestrator)


Generated by Claude Code

主要言語
C
スター
3
フォーク
7
平均マージ
6時間 21分
マージ済み PR(30日)
323

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

InauguralSystems/EigenScript のほかの issue

InauguralSystems/EigenScript の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。