Skip to content

feat(pr-monitor): WP-09 PR 監視の GitHub Actions バックストップ Phase A(読み取り専用)#258

Merged
aloekun merged 2 commits into
masterfrom
wp-09-pr-monitor-actions
Jul 11, 2026
Merged

feat(pr-monitor): WP-09 PR 監視の GitHub Actions バックストップ Phase A(読み取り専用)#258
aloekun merged 2 commits into
masterfrom
wp-09-pr-monitor-actions

Conversation

@aloekun

@aloekun aloekun commented Jul 8, 2026

Copy link
Copy Markdown
Owner

概要

WP-09(ハーネス改善計画 1-C)。PR 監視をローカルセッションの寿命から切り離す第一歩として、GitHub Actions 上の読み取り専用バックストップ監視 .github/workflows/pr-monitor.yml を新設する。セッション不在時に PR のレビュー・CI 状態を無人で分析し、日本語コメントを PR に投稿する(fix push はしない = Phase A)。

背景: ローカル cli-pr-monitor は wakeup 機構がセッション寿命に依存し、PR #237 で失効を実測。Actions 経路をバックストップとして併存させる(責務分離は ADR-022 原則6 に追記)。

設計のポイント

  • トリガーはレビュアー非依存: pull_request_review(全レビュアー)+ pull_request(opened/ready_for_review)+ issue_comment(coderabbitai[bot] 発のみ)。特定レビューツール固有の条件は issue_comment の 1 条件に局所化し、CodeRabbit へのロックインを回避。レートリミット時も待機・ポーリングせず、required check にも登録しないためマージ・他ツールを一切ブロックしない。
  • 読み取り専用の担保は LLM の外側(ADR-022 原則6 の 2 不変条件):
    1. 分析エージェントは書き込み能力を一切持たない(Edit/Write/WebFetch/gh 書き込み系すべて不許可、Read は 3 パスに scope)。
    2. コメント投稿は非エージェント step が --body-file でデータとして実行(injection を受けた出力がコマンド/secrets 露出に転じない)。
    • 補助: permissions: contents: read(push は 403)、persist-credentials: false
  • 暴走ガード: PR 単位 concurrency(cancel-in-progress)、synchronize 非対象、timeout-minutes: 15--max-turns 30、重複コメント skip。fork PR 対象外、pull_request_target 不使用。
  • モデルは sonnet。

pre-push セキュリティレビューの成果

本 PR の pre-push review が land 前に secret-exfiltration/scope 系 3 件を検出・修正した:

  1. gh api の過剰スコープ → GET エンドポイント完全一致に限定。
  2. persist-credentials による GITHUB_TOKEN の .git/config 書き込み → false 化。
  3. エージェント自身のコメント投稿による token 露出 → エージェントから投稿権限を剥奪し、非エージェント step のデータ投稿に分離(上記不変条件 2)。

指示層のみに頼らず LLM 外側で担保する設計が機能した実例。

有効化とユーザー作業

  • secret CLAUDE_CODE_OAUTH_TOKEN は登録済み。
  • pull_request トリガーは本 PR 自体で発火し初回スモークテストになる(認証・権限・読み取り専用の疎通確認)。
  • pull_request_review / issue_comment トリガーはデフォルトブランチ(master)上の定義でのみ発火するため、バックストップの本稼働はマージ後から。

変更

  • .github/workflows/pr-monitor.yml(新規)
  • docs/adr/adr-022-automation-responsibility-separation.md — 原則6「PR 監視経路の二重化と権限の非対称」追記
  • docs/harness-improvement-plan.md — WP-09 を実装済に更新

dogfood / follow-up(非ブロッキング)

  • 受け入れ基準: セッション閉鎖中の CodeRabbit レビュー完了に無人分析コメントが付き、wakeup 失効の取りこぼしゼロ。
  • least-privilege: gh pr comment が要求する write scope(pull-requests / issues)を実 run で確認し不要な方を削る。
  • gh pr checkschecks / statuses scope を要するか dogfood で確認。
  • Phase B(fix push 無人化)は WP-10(自律境界クラス)+ WP-11(injection 防御)完了が前提。

Summary by CodeRabbit

  • 新機能

    • PR を自動で監視し、必要に応じてレビュー状況や CI 結果をもとにコメントを追加する仕組みを導入しました。
    • フォーク由来の PR など、条件を満たす場合のみ動作するようになりました。
  • ドキュメント

    • PR 監視の運用方針と権限設計に関する説明を更新しました。
    • 開発計画の進捗を更新し、関連タスクの完了状況を反映しました。

.github/workflows/pr-monitor.yml を新設。セッション不在時のバックストップとして
PR のレビュー・CI 状態を分析し日本語コメントを投稿する(読み取り専用、ADR-022 原則 6)。

- トリガーはレビュアー非依存: pull_request_review(全レビュアー)+ pull_request
  (opened/ready_for_review)+ issue_comment(coderabbitai 発のみ)。CodeRabbit
  固有条件は issue_comment の 1 条件に局所化しロックインを回避。
- 読み取り専用は GITHUB_TOKEN の permissions(contents: read)で決定論的に担保。
  指示層が破られても push は 403 で失敗(ADR-043 fail-closed と同思想)。
- 暴走ガード: PR 単位 concurrency + synchronize 非対象 + max-turns 30 +
  重複コメント skip。fork PR 対象外、pull_request_target 不使用。model=sonnet。
- ローカル cli-pr-monitor は高速経路として併存。

ADR-022 に原則 6「PR 監視経路の二重化と権限の非対称」を追記。
harness-improvement-plan.md の WP-09 を実装済に更新。
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2fe1f3b7-ac6e-40ae-a958-5bdf4e1f4265

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

読み取り専用のバックストップPR監視を行う.github/workflows/pr-monitor.ymlを新規追加した。PR/レビュー/コメントイベントをトリガーに、claude-code-actionでレビューとCI状態を分析し、新情報がある場合のみコメント投稿する。ADR-022に原則6を追記し、harness改善計画のWP状態も更新した。

Changes

PR監視ワークフロー導入

Layer / File(s) Summary
トリガー・権限・実行条件の定義
.github/workflows/pr-monitor.yml
ヘッダコメントで多層防御方針を説明し、pull_request/pull_request_review/issue_commentトリガー、PR単位concurrency、最小限のpermissions、イベント種別ごとの実行可否判定(fork除外・bot除外)を定義。
チェックアウト・fork判定・分析実行
.github/workflows/pr-monitor.yml
persist-credentials: falseでトークンの平文記録を防ぐcheckout設定、issue_comment経路のfork判定用gh pr view呼び出し、claude-code-actionによるPR/CI情報の分析(allowedTools/disallowedToolsによる読み取り専用制約と重複投稿防止のSKIP判定)を追加。
分析結果の抽出とコメント投稿
.github/workflows/pr-monitor.yml
execution_fileからjqでresultテキストを抽出しSKIP判定を行い、skip=falseの場合のみgh pr comment --body-fileでPR/issueにコメントを投稿。
ADRと改善計画ドキュメントの更新
docs/adr/adr-022-automation-responsibility-separation.md, docs/harness-improvement-plan.md
ADR-022に原則6(監視経路の二重化と権限非対称、不変条件、アンチパターン)を追記し、harness改善計画のWP-05を完了・WP-09を実装済に更新して運用詳細を記載。

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubEvent
  participant AnalyzeJob
  participant ClaudeCodeAction
  participant GitHubAPI

  GitHubEvent->>AnalyzeJob: pull_request/review/issue_comment発火
  AnalyzeJob->>AnalyzeJob: 実行条件チェック(fork/bot除外)
  AnalyzeJob->>AnalyzeJob: gh pr view (is_fork判定)
  AnalyzeJob->>ClaudeCodeAction: レビュー/CI情報の分析依頼
  ClaudeCodeAction->>GitHubAPI: gh pr checks / gh api reviews / gh pr diff
  ClaudeCodeAction-->>AnalyzeJob: result (分析結果 or SKIP)
  AnalyzeJob->>AnalyzeJob: jqでresult抽出、SKIP判定
  alt skip=false
    AnalyzeJob->>GitHubAPI: gh pr comment --body-file
  else skip=true
    AnalyzeJob-->>AnalyzeJob: コメント投稿せず終了
  end
Loading

Possibly related PRs

  • aloekun/claude-code-hook-test#45: 主PRが原則6を追記した同じADR-022ファイルを、責務分離原則の導入として定義している。
  • aloekun/claude-code-hook-test#64: 同じADR-022ファイルの原則1周辺を再構成しており、主PRの原則6追加と同一ドキュメントへの変更である。
  • aloekun/claude-code-hook-test#242: 同じdocs/harness-improvement-plan.mdのWP一覧(PR監視/WP-09周辺)を追加しており、主PRの具体化・更新と直接つながっている。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 監視用の GitHub Actions バックストップを追加する変更内容と、Phase A の読み取り専用方針を的確に表しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wp-09-pr-monitor-actions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

情報収集が完了しました。CodeRabbit のレビューはまだ「Review in progress」のプレースホルダーコメントのみで、実際の指摘(findings)は投稿されていません。レビュー指摘が0件のため、指示のステップ3に従い CI 状態と diff 概要のみの軽量サマリーを作成しました。過去の「🤖 PR Monitor 分析」コメントは存在しないため重複ガードには該当しません。

以下が最終応答(分析結果)です。

🤖 PR Monitor 分析 (GitHub Actions バックストップ)

  • トリガー: pull_request (opened) / 実行 run
  • CI: analyze (本 workflow 自身) が実行中 (IN_PROGRESS)、CodeRabbit はレビュー未着 (PENDING「Review in progress」)。現時点で失敗 check なし
  • レビュー状況: CodeRabbit はレビュー進行中のプレースホルダーコメントのみ投稿済み(実際の指摘はまだ0件)。人間レビュー・他 bot レビューも未投稿 (reviews API 応答は空配列)
  • Verdict: approved (暫定 — 適用可能な指摘が現時点で0件のため .takt/facets/instructions/analyze-coderabbit.md の 3-way 基準上は approved 条件に該当するが、CodeRabbit レビュー未完了のため確定ではない点に注意)

Applicable Findings (Critical / High / Major)

該当なし(レビュー指摘自体がまだ0件)

Applicable Findings (Medium 以下)

該当なし

Filtered (not applicable)

該当なし

Diff 概要

3 ファイル変更、追加中心の PR(WP-09: PR 監視の GitHub Actions バックストップ Phase A 読み取り専用実装):

  • .github/workflows/pr-monitor.yml (新規, +225行): PR のレビュー・CI 状態を分析し日本語コメントを投稿する読み取り専用バックストップ workflow。エージェントは書き込み権限を持たず、コメント投稿は後続の非エージェント step が --body-file 経由で行う設計
  • docs/adr/adr-022-automation-responsibility-separation.md (+31行程度): 原則6「PR 監視経路の二重化と権限の非対称」を追加。責務分離・LLM 外側の2不変条件・fork 対象外化の設計根拠を記述
  • docs/harness-improvement-plan.md (+2行変更): WP-09 のステータスを「未着手」→「実装済」に更新、WP-05 のステータス文言を微修正(「実装済」→「完了」)

次のアクション

  • CodeRabbit のレビュー完了を待ってから (本 workflow は待機しないため) 実際の指摘の有無を再確認することを推奨
  • analyze check (本 job) の完走を待って CI 全体が green になることを確認
  • PR 本文の残タスク記載(claude setup-token → secrets 登録がユーザー作業として残っている旨)はマージ前に人間側で対応要否を確認

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pr-monitor.yml:
- Line 190: The `allowedTools` list in the workflow needs to permit paginated
`gh api` calls for pull request reviews and comments, since the current `gh api
repos/*/pulls/*/reviews` and `.../comments` patterns do not cover `--paginate`
or `--jq` usage and can miss later pages. Update the matching entries in the
workflow’s `allowedTools` configuration so the read-only `gh api` permissions
for reviews/comments explicitly allow full retrieval of all pages while keeping
the scope limited to the existing repo pull/review/comment endpoints.
- Around line 199-210: The PR monitor workflow’s skip detection only handles the
"SKIP: no new information" marker, so an empty analysis still falls through and
causes the later comment step to fail. Update the trimming/skip check in the
analysis processing block to treat an empty TRIMMED value as skip=true as well,
alongside the existing sentinel, so the job can safely bypass gh pr comment when
jq produces no result.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 62eaadf6-853d-46ee-85e0-70085f29eb46

📥 Commits

Reviewing files that changed from the base of the PR and between ef6780c and 161a621.

📒 Files selected for processing (3)
  • .github/workflows/pr-monitor.yml
  • docs/adr/adr-022-automation-responsibility-separation.md
  • docs/harness-improvement-plan.md

claude_args: |
--model claude-sonnet-5
--max-turns 30
--allowedTools "Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr checks:*),Bash(gh api repos/*/pulls/*/reviews),Bash(gh api repos/*/pulls/*/comments),Bash(gh api repos/*/issues/*/comments),Bash(gh run view:*),Bash(gh run list:*),Read(CLAUDE.md),Read(docs/adr/**),Read(.takt/facets/instructions/analyze-coderabbit.md)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🌐 Web query:

Claude Code allowedTools Bash pattern exact match without trailing wildcard does it block additional flags

💡 Result:

In Claude Code, using an exact-match Bash pattern in allowedTools (e.g., Bash(npm run build)) without a wildcard does indeed restrict the command to that exact string, effectively blocking additional flags or arguments [1][2]. If you provide a rule like Bash(npm run build), the tool will only permit that precise command [1]. Any attempt by the model to append flags or arguments (such as npm run build -- --watch) will fail to match the pattern [2]. To allow a command while also permitting additional flags or arguments, you must include a wildcard character, typically formatted as Bash(npm run build *) [1][2]. Key behavioral details: - Exact Matching: Without a wildcard, the pattern requires a literal string match [1]. - Wildcard Usage: Adding * at the end (with a space) effectively creates a prefix match, allowing the base command to be followed by any additional arguments [1][2]. - Caveats: - Pattern matching has historically faced reports of inconsistency or "pass-through" behavior in certain modes (such as when bypassPermissions is active) [3][4]. - Wildcards are generally expected at the end of the command; support for wildcards in the middle of commands (e.g., Bash(make docker-:* )) has been reported as unreliable or unsupported [5]. - Ensure your pattern does not conflict with rules in the permissions.ask list, as ask rules may trigger prompts even if the command is otherwise permitted by your allow rules [2].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the workflow around the cited line
git ls-files .github/workflows/pr-monitor.yml
wc -l .github/workflows/pr-monitor.yml
sed -n '1,260p' .github/workflows/pr-monitor.yml | cat -n

# Find any related design notes referenced in the comment
git ls-files | rg '(^|/)CLAUDE\.md$|(^|/)docs/adr/|(^|/)\.takt/facets/instructions/analyze-coderabbit\.md$'

Repository: aloekun/claude-code-hook-test

Length of output: 1981


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for permission patterns and gh usage in the repo to understand expected call shapes
rg -n 'allowedTools|gh api repos/.*/pulls/.*/reviews|gh api repos/.*/pulls/.*/comments|gh pr view|gh pr diff|gh pr checks|--paginate|--jq| per_page=100|pull-requests: write' .github docs .takt CLAUDE.md 2>/dev/null || true

Repository: aloekun/claude-code-hook-test

Length of output: 1981


gh api の許可パターンを見直してください。

末尾ワイルドカードがないため、--paginate--jq を付けた gh api repos/*/pulls/*/reviews / .../comments は許可されません。reviewscomments は既定で 1 ページ 30 件なので、件数が多い PR では後続ページを取りこぼします。読み取り専用のまま全件取得できる形にしてください。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pr-monitor.yml at line 190, The `allowedTools` list in the
workflow needs to permit paginated `gh api` calls for pull request reviews and
comments, since the current `gh api repos/*/pulls/*/reviews` and `.../comments`
patterns do not cover `--paginate` or `--jq` usage and can miss later pages.
Update the matching entries in the workflow’s `allowedTools` configuration so
the read-only `gh api` permissions for reviews/comments explicitly allow full
retrieval of all pages while keeping the scope limited to the existing repo
pull/review/comment endpoints.

Comment on lines +199 to +210
set -euo pipefail
ANALYSIS_FILE="$RUNNER_TEMP/pr-monitor-analysis.md"
jq -r '.[] | select(.type == "result") | .result' \
"$EXECUTION_FILE" > "$ANALYSIS_FILE"
echo "analysis_file=$ANALYSIS_FILE" >> "$GITHUB_OUTPUT"

TRIMMED=$(sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' "$ANALYSIS_FILE")
if [ "$TRIMMED" = "SKIP: no new information" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the workflow and inspect the surrounding steps around the cited lines.
wf=".github/workflows/pr-monitor.yml"
echo "== line count =="
wc -l "$wf"

echo
echo "== lines 160-260 =="
sed -n '160,260p' "$wf"

echo
echo "== search for analysis_file / skip / gh pr comment usage =="
rg -n "analysis_file|skip=true|skip=false|gh pr comment|--body-file|EXECUTION_FILE|SKIP: no new information" "$wf"

Repository: aloekun/claude-code-hook-test

Length of output: 1981


🌐 Web query:

aloekun/claude-code-hook-test .github/workflows/pr-monitor.yml gh pr comment --body-file analysis_file skip false empty analysis

💡 Result:

The query appears to reference an automated GitHub Actions workflow (pr-monitor.yml) associated with the repository aloekun/claude-code-hook-test [1], which is part of a community-developed suite for testing Claude Code hooks [2][3]. The specific command provided, gh pr comment --body-file analysis_file, is used by the GitHub CLI to post a comment on a pull request using the contents of a specified file (analysis_file) as the body [4][5][6]. The flags skip false empty analysis are likely custom arguments or shell variables defined within the context of that specific workflow script, rather than standard flags for the gh pr comment command [4][5][7]. In the context of testing Claude Code hooks: 1. gh pr comment is frequently used in CI/CD automation to post analysis or diagnostic results back to a pull request [4][8]. 2. The --body-file flag is the correct way to pipe dynamic content (like a generated analysis) from a file into a GitHub PR comment [4]. 3. Claude Code hook development often involves scripts that validate tool behavior, simulate hook triggers, and report findings [2][9][10]. The claude-code-hook-test repository is a known community effort designed to verify whether Claude Code hooks fire correctly under various conditions [3]. If you are encountering errors with this command, ensure that: - analysis_file exists and contains valid markdown or text content before the gh pr comment command runs. - The GH_TOKEN environment variable is correctly set in your workflow to allow the GitHub CLI to authenticate and post comments [11]. - The arguments skip, false, and empty are intended to be processed by your wrapper script or analysis_file generator, as they are not native gh pr comment flags [5][7].

Citations:


🌐 Web query:

"aloekun/claude-code-hook-test" "pr-monitor.yml" "analysis_file" "gh pr comment" "skip=true" "SKIP: no new information"

💡 Result:

The query refers to components of an automated Pull Request (PR) monitoring system designed for Claude Code or similar LLM-driven development workflows [1][2][3][4]. These components typically appear in scripts (e.g., pr-monitor.yml [5] or custom shell-based hooks [2]) used to check for new activity on GitHub PRs and avoid redundant processing [4][6]. Key components identified in your query include: 1. "aloekun/claude-code-hook-test": This appears to be a repository specifically used as a testbed for developing and validating custom Claude Code hooks [2]. 2. "pr-monitor.yml": A common filename for a GitHub Actions workflow or a local script used to monitor PR states, comments, or CI status [5][7]. 3. "analysis_file": This refers to a temporary JSON or Markdown file (often named prNN-analysis.md or similar) used to store the current state of a PR or the output of a previous analysis [4][8][6]. The system reads this file to determine if the state has changed since the last check [5][4]. 4. "gh pr comment": The GitHub CLI command (gh pr comment) is used to post summaries or feedback back to the PR once the script completes its analysis [4][7]. 5. "skip=true" / "SKIP: no new information": These are control flags and log messages used in the monitor's logic [4][9]. When a script compares the current PR state (fetched via gh api or gh pr view) against the cached "analysis_file" and finds no substantive changes (e.g., no new comments, no state transitions), it sets a skip flag (often skip=true) or logs a "SKIP: no new information" message to terminate the execution early, thereby saving compute cycles and API tokens [5][4][7][10]. This pattern is a standard architectural choice in LLM automation to prevent redundant re-analysis of static PR data [4][6][10].

Citations:


🌐 Web query:

gh pr comment --body-file empty file behavior

💡 Result:

When using the GitHub CLI command gh pr comment with the --body-file flag, providing an empty file will typically result in the command failing to create a comment because the GitHub API rejects empty issue or pull request comments [1][2]. Specifically, the GitHub API requires that comments contain at least some content. If you provide an empty file to --body-file, the GitHub CLI will attempt to send that empty body to the API, which will respond with an error (usually indicating that the body is missing or cannot be blank). If your goal is to automate commenting and you want to avoid errors when the content might be empty, you should add a check in your script or pipeline to verify that the file is not empty before executing the command [3][4]. For example: if [ -s "file.txt" ]; then gh pr comment <PR_NUMBER> --body-file file.txt fi This prevents the gh command from attempting to post an empty body to the pull request [1][2].

Citations:


空の分析結果も skip 扱いにする
jq の抽出結果が空だと skip=false になり、後続の gh pr comment --body-file に空本文を渡して失敗します。-z "$TRIMMED"skip=true に含めてください。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pr-monitor.yml around lines 199 - 210, The PR monitor
workflow’s skip detection only handles the "SKIP: no new information" marker, so
an empty analysis still falls through and causes the later comment step to fail.
Update the trimming/skip check in the analysis processing block to treat an
empty TRIMMED value as skip=true as well, alongside the existing sentinel, so
the job can safely bypass gh pr comment when jq produces no result.

- Extract step: 空出力 (エージェント異常終了・抽出失敗) を skip 扱いにし、空コメント
  投稿を防止 (CodeRabbit Minor #258-2)。
- prompt: 最終応答を前置きなしで見出しから開始するよう明示 + extract step で見出し行
  以降のみ採用して正規化 (初回 run で前置き混入を実観測、重複ガードの見出し検出も安定化)。
  見出し不在の異常時は原文維持で空投稿を回避。

ADR-022 原則5 に従い PR 包含 commit を amend せず child commit として分離。
@aloekun aloekun merged commit 8e5258d into master Jul 11, 2026
1 check passed
@aloekun aloekun deleted the wp-09-pr-monitor-actions branch July 11, 2026 04:29
aloekun added a commit that referenced this pull request Jul 11, 2026
WP-10: ADR-052 起票。自律 actor 限定で操作を 2 クラス(自動実行可 / ゲート必須)に
事前分類し、分類不能は fail-closed でゲート必須へ(ADR-043)。ADR-028 のゲートを除去
せず commitment 点(ready 化 / マージ)へ移設する 2 段化が本質。Rust 分類関数は呼び手
(自律実行経路)不在のため今回見送り、consumer 着手時に gate.rs の docs-only 判定を lib
切り出しで再利用実装する方針を明記。ADR-039 パターンで試験運用。

- CLAUDE.md の ADR 一覧に ADR-052 追加。
- harness-improvement-plan.md: WP-10 を実装済、WP-09 を観測中(GitHub Actions バック
  ストップが PR #258 でマージ・本稼働、secrets 登録済・スモークテスト成功を反映)に更新。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant