Repository navigation
feat(#692): publish_termination_report.py で termination report の GitHub 投稿を仲介する - #698
Conversation
…ub 投稿を仲介する - scripts/publish_termination_report.py を新設: render_termination_report.py を subprocess.run(shell=False) で呼び出し、publishable=true かつ body 非空の場合のみ gh issue comment --body-file で投稿する(fail-closed 設計) - tests/test_publish_termination_report.py を追加: fake gh + fake renderer による integration tests (AC2-AC8 対応) - SKILL.md Step 5 に publish_termination_report.py 呼び出し手順を追記 (AC1) - docs/dev/schema-governance.md に TERMINATION_REPORT_RENDER_RESULT_V1 を登録 (AC7) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Preview URLPreview removed (PR #698 closed). |
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN
Evidence Check
AC coverage:
- AC1: diff で SKILL.md に
publish_termination_report参照が追加されていることを確認(Termination Report Publish Flowセクション) - AC2:
publish_termination_report.pyL157-164 でsubprocess.run([sys.executable, str(RENDERER_SCRIPT)], ..., shell=False, ...)を確認 - AC3:
_post_github_comment関数で["gh", "issue", "comment", str(issue_number), "--body-file", body_file]のみ使用、--body直接渡しなし(L251-258) - AC4:
publishable=false、non-zero exit、invalid JSON、schema 不一致、publishable=true/body=null、publishable=false/body 非null、timeout の全異常系で gh を呼ばないことをテストで確認(TestFailClosed クラス、10件) - AC5:
_record_artifact関数で reason_code / renderer_stderr / returncode / issue_number / timestamp をローカル artifact に記録(L99-139)。body は記録しない設計を確認 - AC6: diff の changed files に
render_termination_report.pyが含まれないことを確認(Forbidden Paths 遵守) - AC7: diff で
docs/dev/schema-governance.mdにTERMINATION_REPORT_RENDER_RESULT_V1行が追加されていることを確認 - AC8:
TestIntegrationクラスに正常投稿・非投稿・renderer 異常 fail-closed・marker 共存テストが含まれていることを確認 - AC9: CI python-test ジョブの
Run uv run --locked pytest .claude/skills/issue-refinement-loop/tests/ -qステップがconclusion: success(head SHA14e9ed01ade1c8ba427f18505b3286bac81d4ffdと一致)
Allowed Paths 遵守: changed files 4件すべてが contract の Allowed Paths に収まる。Forbidden Paths (render_termination_report.py) は変更なし。
CI Verification(CI_CHECK_RUN_SCOPED):
- run_id: 27054511156, workflow: ci, conclusion: success
- head SHA:
14e9ed01ade1c8ba427f18505b3286bac81d4ffd— PR head SHA と一致 python-testジョブ内Run uv run --locked pytest .claude/skills/issue-refinement-loop/tests/ -qステップ:conclusion: success- AC9 の VC
uv run pytest .claude/skills/issue-refinement-loop/tests/ -qと対応する CI step が存在し PASS
Schema Change Applicability: PR 本文に記載あり(schema_change: TERMINATION_REPORT_RENDER_RESULT_V1 新規登録)
Schema Consumer Inventory: PR 本文に記載あり。consumer 列挙コマンド出力結果も含まれている。
Safety Claim Matrix: PR 本文に記載あり(.claude/skills/** 変更による safety-sensitive 判定に対応)。Not controlled 列は非空項目なし。安全主張の overclaim なし。
検証コマンド結果: PR 本文の「テスト計画」セクションに結果記録あり(self-report)。CI_CHECK_RUN_SCOPED で独立確認済みのため単独根拠としない。
Blockers
なし
Non-blockers
なし
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: 14e9ed01ade1c8ba427f18505b3286bac81d4ffd
merge_ready: true
mergeability:
mergeable: MERGEABLE
merge_state_status: CLEAN
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
結論REQUEST_CHANGES。 本レビューは GitHub 上の PR/Issue/コメント/diff と公式ドキュメントに基づく静的レビューです。ローカルでの再実行はしていません。 Blocking 1:
|
…eason_code validation, --renderer removal - B1: _post_github_comment now uses --body-file - + stdin, timeout=30, GH_PROMPT_DISABLED=1/GH_NO_UPDATE_NOTIFIER=1; gh timeout recorded as reason_code=gh_comment_timeout - B2: _record_artifact stores stderr_len+stderr_sha256 instead of raw renderer_stderr; publisher stderr limited to reason_code/returncode/artifact path only - B3: _validate_render_result guards isinstance(result, dict); publishable=true enforces reason_code=null; publishable=false requires non-empty reason_code string - High: --renderer CLI arg removed from argparse; tests use monkeypatch / module-level pub.RENDERER_SCRIPT assignment instead - Tests: added B2 stderr-not-leaked test, B3 list/string/reason_code edge-case tests, gh env/timeout tests (38→38 tests all pass, 313 total pass) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
fix_delta 適用完了(commit eb55b1a)REQUEST_CHANGES の全 Blocking / High 項目を適用しました。 B1(gh 呼び出し強化): NamedTemporaryFile を廃止し stdin 渡しに変更。タイムアウト 30 秒を追加。GH_PROMPT_DISABLED と GH_NO_UPDATE_NOTIFIER を env に設定。タイムアウト発生時は fail-closed で artifact に記録。テスト: gh 環境変数テスト・タイムアウト fail-closed テストを追加。 B2(stderr raw 保存禁止): artifact には stderr 全文を保存しなくなり、バイト数とハッシュのみを保存。publisher 標準エラーを reason_code / returncode / artifact パスのみに制限。テスト: fake renderer が body 断片を stderr に吐いても artifact と publisher 標準エラーにその文字列が含まれないことを検証。 B3(validate 強化): dict 型チェックをガード先頭に追加。publishable=true のとき reason_code は null 必須。publishable=false のとき reason_code は非空文字列必須。テスト: リスト・文字列・reason_code 欠落・非文字列・publishable=true かつ非 null の各ケースを追加。 High(--renderer 削除): argparse から削除し、テストは module attribute 直接差し替え方式に移行。 検証
|
squne121
left a comment
There was a problem hiding this comment.
判定結果: APPROVE(承認)
マージ可否
- mergeable=MERGEABLE, merge_state_status=CLEAN(マージ可能・競合なし)
証跡確認
AC カバレッジ: 全 AC 対応済み (AC1〜AC9)
- AC1: SKILL.md に
publish_termination_report参照追記済み - AC2:
subprocess.run([sys.executable, ...], shell=False)実装確認済み - AC3:
gh issue comment --body-file -(stdin) のみ使用、--body直接渡し禁止を遵守 - AC4: fail-closed テスト 10 件 PASS(publishable=false / renderer エラー / validation fail / timeout)
- AC5: artifact に
stderr_len/stderr_sha256/returncode/reason_code/issue_number/timestampのみ記録、raw stderr 非保存 - AC6:
render_termination_report.py変更なし(Forbidden Paths 遵守) - AC7:
TERMINATION_REPORT_RENDER_RESULT_V1を schema-governance.md に登録済み - AC8: fake gh + fake renderer による統合テスト 30 件 PASS
- AC9: 既存テスト全通過(PR 本文: 305 passed)
Allowed Paths: 遵守
- 変更ファイル 4 件すべてが Allowed Paths 内
- Forbidden Paths(
render_termination_report.py)変更なし
CI 証跡(CI_CHECK_RUN_SCOPED):
- CI run:
27054812758、head_sha=eb55b1a1e0815328f3c9ce0dbcc5f2ed6a689269(PR head SHA と一致) - python-test: 成功、test: 成功、typecheck: 成功、lint: 成功、build: 成功、e2e: 成功
- TEST_VERDICT_MACHINE コメントは存在しないが CI_CHECK_RUN_SCOPED の全条件を満たす
前回 REQUEST_CHANGES(iteration 1)の解消確認:
| 指摘項目 | 解消状況 |
|---|---|
| B1: gh 呼び出しに timeout/GH_PROMPT_DISABLED/--body-file 欠落 | 解消: timeout=30, GH_PROMPT_DISABLED=1, GH_NO_UPDATE_NOTIFIER=1, --body-file - (stdin) 追加、NamedTemporaryFile 廃止 |
| B2: renderer stderr を raw 保存 | 解消: artifact は stderr_len/stderr_sha256/returncode/reason_code/issue_number/timestamp のみ |
B3: _validate_render_result() の型・reason_code 検証不足 |
解消: isinstance(result, dict) 確認、publishable=true 時 reason_code=null 必須、publishable=false 時 reason_code 非空 string 必須、list/string/missing 追加テスト実装 |
| High: --renderer が production CLI に露出 | 解消: argparse から --renderer 削除、テストは monkeypatch で RENDERER_SCRIPT を差し替え |
スキーマ変更適用可否: 新規スキーマ登録(TERMINATION_REPORT_RENDER_RESULT_V1)のため breaking change なし、migration 不要
Safety Claim Matrix: 存在(changed path が .claude/skills/ に該当する safety-sensitive PR として確認)
- Not controlled 相当事項なし(全項目 true)
- APPROVE 禁止条件に非該当
ブロッカー
なし
非ブロッカー(任意改善)
- Safety Claim Matrix の列構造が SKILL.md 必須列(Claim / Implemented? / Not controlled / Evidence / Follow-up)と形式が異なる(現在:
| 項目 | 値 |)。マージ blocking ではないが、今後は pr-review-judge の必須列形式に揃えると schema gate の自動検査と整合しやすくなる。
機械可読判定(LOOP_VERDICT_V2)
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: eb55b1a1e0815328f3c9ce0dbcc5f2ed6a689269
merge_ready: true
mergeability:
mergeable: MERGEABLE
merge_state_status: CLEAN
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests:
- title: "Safety Claim Matrix の列形式を SKILL.md 必須列に統一する"
issue_kind: implementation
severity: note_only
blocking_merge_ready: false
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/698"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:pr-698:1"
desired_destination: "PR テンプレートの Safety Claim Matrix 列が pr-review-judge 必須列と一致し、自動 schema gate が機能する状態"
validated_scope_delta: "Safety Claim Matrix 形式を SKILL.md 必須列に統一するテンプレート更新"
origin_skill: pr-review-judge
labels:
- triage-required
initial_label_profile: docs
materialization: optional
概要
publish_termination_report.py(新規)を作成:render_termination_report.pyを subprocess 経由で呼び出す薄い publisher。publishable=trueかつ body 非空の場合のみgh issue comment --body-fileで GitHub 投稿する(fail-closed 設計)SKILL.mdStep 5 にpublish_termination_report.pyの呼び出し手順を追記test_publish_termination_report.pyに統合テストを追加(30 件)docs/dev/schema-governance.mdにTERMINATION_REPORT_RENDER_RESULT_V1を登録Closes #692 (Issue #692 を完了)
AC 対応状況
publish_termination_report参照subprocess.run([sys.executable,...], shell=False, ...)使用gh issue comment --body-file経由のみ(--body直接渡し禁止)テスト計画
uv run pytest .claude/skills/issue-refinement-loop/tests/test_publish_termination_report.py -q→ 30 passed(全件通過)uv run pytest .claude/skills/issue-refinement-loop/tests/ -q→ 305 passed(全件通過)pnpm typecheck && pnpm lint && pnpm test && pnpm build→ 全 PASSスキーマ変更適用可否(Schema Change Applicability)
schema_change:TERMINATION_REPORT_RENDER_RESULT_V1をdocs/dev/schema-governance.mdに新規登録(schema の追加)。スキーマ Consumer 一覧(Schema Consumer Inventory)
新規登録のため変更前は未登録。変更後の consumer 一覧:
publish_termination_report.py(新規)issue-refinement-loopStep 5render_termination_report.py(producer)test_publish_termination_report.py(テスト)Consumer 列挙コマンド(
rg -l "TERMINATION_REPORT_RENDER_RESULT_V1" .claude/)の実行結果:セキュリティ要求事項(Safety Claim Matrix)
🤖 Claude Code により生成 Claude Code