HYP-203 Align handler docs with direct composition#421
Draft
proboscis wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
HYP-203 は、deprecated な
WithHandler互換 shim を現行の handler 合成 API として README / docs / examples が案内していた問題を直します。変更内容
README.mdと現行 docs の handler 合成例をhandler(program)の直接呼び出しへ更新しました。examples/のWithHandler(...)例を、raw dispatcher を Program -> Program installer に変換してから直接呼ぶ形へ更新しました。packages/doeff-core-effects/doeff_core_effects/handlers.pyの core handler factory が Program -> Program installer を返すようにし、README の標準例が警告なしで実行できるようにしました。tests/test_docs_withhandler_contract.pyに docs / examples guard と canonical snippet の警告なし検証を追加しました。packages/doeff-hy/src/doeff_hy/macros.hyの defhandler 説明文も直接呼び出しに揃えました。境界
default_handlers/async_rundrift は別課題として残しています。この PR ではWithHandlershim を推奨合成 API として案内しないことに絞っています。WithHandler互換 shim とWithHandlerTypeは削除していません。互換 shim は deprecation warning を維持し、低レベル構築はWithHandlerTypeを使う説明に整理しています。確認したこと
uv run pytest tests/test_docs_withhandler_contract.py -quv run pytest tests/test_withhandler_shim_deprecation.py -quv run python -W defaultでwriter()(state()(reader(...)(program)))型の標準例がDeprecationWarningなしで1を返すことを確認rg -n "WithHandler\\(|handler=\\.\\.\\.|default_handlers\\(|async_run\\(" README.md docs -g '*.md'で、WithHandler(...)の残存が archival/spec docs だけになったことを確認uv run pytest -qは836 passed, 84 skipped未解消の既存状態
uv run pyrightは既存のdoeff/cli/discovery.py:57のIndexerimport symbol エラーで停止しました。今回の変更箇所ではありません。ruffの全体実行は既存の広範な import / re-export / 複雑度指摘を拾うため、今回追加・変更した docs guard と handler wrapper 周辺の focused check を確認しました。