Conversation
review_poll_entry._gh_json() が kaji pr view --jq '.headRefOid' / '.commits[-1].committedDate' のスカラー抽出(クォートなし生文字列)を json.loads して JSONDecodeError でクラッシュしていた。スカラー抽出用の _gh_raw() を新設し、headRefOid / committedDate を json.loads を経由せず 生文字列で解決する。.[0] object 抽出(pr list)は _gh_json のまま据置。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
review_poll_entry.pyがkaji pr view --jqでスカラー値(headRefOid / committedDate)を取得した生 CLI 出力をjson.loads()に渡していたため、review-poll が毎回JSONDecodeErrorで exit code 1 クラッシュしていた。スカラー抽出専用ヘルパー_gh_raw()を新設し、json.loadsを経由しない生文字列解決に切り替えた。Closes #209
Changes
kaji_harness/scripts/review_poll_entry.py:_gh_raw()ヘルパー新設。スカラー抽出 2 箇所(headRefOid / committedDate)を_gh_json→_gh_rawに差し替えtests/test_review_poll_entry.py:subprocess.run境界モックへ移行し、生 SHA / 生日付をそのまま流す再現テストを追加(修正前 FAIL・修正後 PASS を確認済み)Documentation
draft/design/issue-209-fix-review-poll-exec-script-jq-json-load.md: 設計書追加(根本原因・修正方針・テスト戦略・影響範囲を記載)Test Plan
subprocess.run境界モック、生 SHA / 生日付の raw scalar 抽出を検証)subprocess.run境界モックへ移行(_gh_json直接 patch から脱却)make check通過(lint / format / typecheck / pytest すべて green)