Skip to content

fix: summarize_agent_transcript.py の GitHub token redaction を github_pat_ 対応にする - #2806

Merged
squne121 merged 2 commits into
mainfrom
worktree-issue-2736-summarize-agent-transcript-py-github-tok
Sep 27, 2026
Merged

squne121 merged 2 commits into
mainfrom
worktree-issue-2736-summarize-agent-transcript-py-github-tok

Conversation

@squne121

@squne121 squne121 commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • scripts/summarize_agent_transcript.py の REDACT_PATTERNS に、GitHub の fine-grained personal access token(github_pat_ prefix)を検出する専用 matcher github_pat_[A-Za-z0-9_]{20,} を追加した(Issue 実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる #2736、PR fix: summarize_agent_transcript.py の GitHub token redaction を新形式 ghs_ App installation token に対応させる #2735 レビュー時に列挙された follow-up gap の一つ)。
  • 既存の classic token matcher gh[opsur]_[A-Za-z0-9_]{20,} は、github_pat_ の3文字目(i)が o/p/s/u/r のいずれとも一致しないため、fine-grained PAT には一切マッチしない。この gap により fine-grained PAT は従来 redaction されず transcript summary artifact にそのまま残存する可能性があった。
  • 新 matcher は既存の classic matcher / ghs_ 専用 matcher の正規表現文字列自体を変更しておらず、単純な charset ベースの追加エントリである。GitHub 公式の exact grammar の再現ではなく、conservative な repository redaction policy として採用している(Issue 本文の In Scope 記載通り)。
  • tests/test_summarize_agent_transcript.py に、82文字 body の deterministic synthetic github_pat_ トークンを用いた完全一致 regression test(test_redact_patterns_fully_redacts_fine_grained_pat_token)を追加し、token 全体および prefix/body の断片が出力に残らないことを検証した。
  • OWNER レビュー(PR fix: summarize_agent_transcript.py の GitHub token redaction を github_pat_ 対応にする #2806 issuecomment-5856207106)の finding P2 対応として、github_pat_[A-Za-z0-9_]{20,} の recall-first ポリシーにおける下限境界(20文字 body)を固定する focused regression test(test_redact_patterns_fully_redacts_minimum_length_pat_token)を追加した。既存の82文字 body テストは変更せず残している。
  • 既存の classic token(ghp_/gho_/ghu_/ghr_/ghs_)redaction テストは全件 pass(回帰なし)。

受け入れ条件の達成状況

  • AC1: scripts/summarize_agent_transcript.py の REDACT_PATTERNS に github_pat_ prefix を検出する正規表現エントリが追加されている。
    • 根拠(fresh HEAD a5cac07aabc91a203a5488e6a07091fdb2558aab 上で再実行):
      $ grep -n "github_pat_" scripts/summarize_agent_transcript.py
      43:    # GitHub fine-grained personal access token (github_pat_ prefix).
      49:    (re.compile(r"github_pat_[A-Za-z0-9_]{20,}"), "<GITHUB_TOKEN>"),
      
  • AC2: deterministic な synthetic github_pat_ トークン(82文字 body)を用いた完全一致の behavioral pytest(test_redact_patterns_fully_redacts_fine_grained_pat_token)が追加され PASS。
    • さらに OWNER finding P2 対応として、{20,} の下限境界(20文字 body)を固定する test_redact_patterns_fully_redacts_minimum_length_pat_token を追加し PASS。
    • 根拠(fresh HEAD 上の実行結果):
      $ uv run pytest tests/test_summarize_agent_transcript.py -v -k "pat_token" -q
      tests/test_summarize_agent_transcript.py::test_redact_patterns_fully_redacts_fine_grained_pat_token PASSED
      tests/test_summarize_agent_transcript.py::test_redact_patterns_fully_redacts_minimum_length_pat_token PASSED
      2 passed
      
  • AC3: 既存の classic token(ghp_/gho_/ghu_/ghr_/ghs_)に対する redaction テストが全て pass する(既存挙動の回帰がない)。
    • aggregate self-report のみでなく、prefix ごとの individual node id を fresh HEAD 上で個別に実行して確認(OWNER 指摘対応):
      $ uv run pytest tests/test_summarize_agent_transcript.py -v -k "classic_github_token"
      tests/test_summarize_agent_transcript.py::test_redact_patterns_preserves_classic_github_token_redaction[ghp_] PASSED
      tests/test_summarize_agent_transcript.py::test_redact_patterns_preserves_classic_github_token_redaction[gho_] PASSED
      tests/test_summarize_agent_transcript.py::test_redact_patterns_preserves_classic_github_token_redaction[ghs_] PASSED
      tests/test_summarize_agent_transcript.py::test_redact_patterns_preserves_classic_github_token_redaction[ghu_] PASSED
      tests/test_summarize_agent_transcript.py::test_redact_patterns_preserves_classic_github_token_redaction[ghr_] PASSED
      5 passed
      

検証コマンド結果

Issue #2736 本文の Verification Commands を、fresh current HEAD(a5cac07aabc91a203a5488e6a07091fdb2558aab)上で実際に再実行した結果。過去の HEAD(c210f54f)の結果は再利用していない。

# AC1
$ grep -n "github_pat_" scripts/summarize_agent_transcript.py
43:    # GitHub fine-grained personal access token (github_pat_ prefix).
49:    (re.compile(r"github_pat_[A-Za-z0-9_]{20,}"), "<GITHUB_TOKEN>"),
# => exit 0

# AC2
$ uv run pytest tests/test_summarize_agent_transcript.py::test_redact_patterns_fully_redacts_fine_grained_pat_token -q
1 passed
$ uv run pytest tests/test_summarize_agent_transcript.py::test_redact_patterns_fully_redacts_minimum_length_pat_token -q
1 passed

# AC3
$ uv run pytest tests/test_summarize_agent_transcript.py -q
61 passed

Allowed Paths 遵守

Issue #2736 で許可されている変更対象パス(Allowed Paths)は次の2ファイルである:

  • scripts/summarize_agent_transcript.py
  • tests/test_summarize_agent_transcript.py

実際の changed files(git diff --name-only main...HEAD、fresh HEAD 上で再確認):

scripts/summarize_agent_transcript.py
tests/test_summarize_agent_transcript.py

2ファイルとも Allowed Paths と完全一致しており、Allowed Paths 外の変更はない。

Checks

  • pnpm typecheck
  • pnpm lint
  • pnpm test
  • pnpm build
  • 本 PR は scripts/summarize_agent_transcript.py / tests/test_summarize_agent_transcript.py(Python-only)の変更で pnpm ワークフローの対象外のため上記4コマンドは非該当。代わりに Issue 本文の Verification Commands(grep + uv run pytest)をすべて fresh HEAD 上で再実行し、全件 PASS を確認済み

Schema Change Applicability

  • decision: not_schema_change
  • reason: producer-consumer 境界をまたぐ machine-readable contract の変更ではなく、summarize_agent_transcript.py 内部の secret-like token redaction 用正規表現リストへのエントリ追加のみ

Schema Consumer Inventory

N/A(not_schema_change のため)

Safety Claim Matrix

本 PR は credential / secret-like token の redaction ロジックを直接扱う(docs/dev/secret-policy.md 関連)ため、OWNER レビュー指摘(PR #2806 issuecomment-5856207106 finding P1 Blocker 2)に従い、bounded な具体的 claim へ更新する。claim の射程は以下の2点に限定し、GitHub provider の exact token-validity grammar や repository 全体の credential protection、全 transcript surface の安全性など、より広い claim はしない。

Claim Implemented? Not controlled Evidence Follow-up
scripts/summarize_agent_transcript.py::redact_string() の matcher github_pat_[A-Za-z0-9_]{20,} が、対象文字列に含まれる github_pat_ prefix トークン全体(prefix + body の断片を含む)を単一の <GITHUB_TOKEN> へ完全に置換する yes N/A test_redact_patterns_fully_redacts_fine_grained_pat_token(82文字 body)と test_redact_patterns_fully_redacts_minimum_length_pat_token(20文字 body、{20,} 下限境界)が fresh HEAD 上で PASS。両テストとも token 全体・prefix・body 断片が出力に残らないことを個別 assertion で検証 N/A
既存の classic token 5形式(ghp_/gho_/ghu_/ghr_/ghs_)の既存 redaction behavior が本変更により regression していない yes N/A test_redact_patterns_preserves_classic_github_token_redaction[ghp_/gho_/ghs_/ghu_/ghr_] の5個の parametrize node id が fresh HEAD 上で個別に PASS(aggregate self-report のみに依存しない) N/A

Notes

IMPLEMENTATION_SCOPE_COVERAGE_V1:
  schema_version: "IMPLEMENTATION_SCOPE_COVERAGE_V1"
  issue_number: 2736
  issue_body_sha256: "sha256:62a454d6fcbcaafdf216c0a282b60a31d77bf4a9aa959a8aa0bbcfc5164971ff"
  normalized_scope_manifest_sha256: "sha256:704873c39033021fc570d0f8539ab90722522d6fa8404a75342c609032edd4a9"
  pr_head_sha: "a5cac07aabc91a203a5488e6a07091fdb2558aab"
  scope_manifest: {"acceptance_criteria": ["deterministic な synthetic github_pat_ トークン(実 secret ではなく、real-world/scanner 相当の body 長として 82 文字程度の body を持つダミートークン)を用いて、redact_string(f\"before {token} after\") == \"before <GITHUB_TOKEN> after\" に相当する完全一致の振る舞いを検証する pytest(test_redact_patterns_fully_redacts_fine_grained_pat_token)が追加されている。token 全体だけでなく prefix/body の断片が出力に残らないことも合わせて検証し、<GITHUB_TOKEN> が output に含まれるだけ または token not in output だけの弱い assertion を主たる acceptance にしない。", "scripts/summarize_agent_transcript.py の REDACT_PATTERNS に github_pat_ prefix を検出する正規表現エントリが追加されている", "既存の classic token(ghp_/gho_/ghu_/ghr_/ghs_)に対する redaction テストが全て pass する(既存挙動の回帰がない)"], "allowed_paths": ["scripts/summarize_agent_transcript.py", "tests/test_summarize_agent_transcript.py"], "change_kind": "bugfix", "goal_ref": "docs/dev/secret-policy.md", "in_scope": ["scripts/summarize_agent_transcript.py の REDACT_PATTERNS へ github_pat_[A-Za-z0-9_]{20,} 相当の専用 matcher を追加する(GitHub 公式の exact grammar 再現ではなく、conservative な repository redaction policy として採用する)", "tests/test_summarize_agent_transcript.py へ github_pat_ トークンの redaction を検証する regression test を追加する", "既存の classic (gh[opsur]_) / ghs_ トークン redaction テストが回帰しないことを確認する"], "schema_version": "IMPLEMENTATION_SCOPE_MANIFEST_V1"}

…pat_ 対応にする (#2736)

REDACT_PATTERNS に fine-grained personal access token (github_pat_ prefix)
専用の matcher (github_pat_[A-Za-z0-9_]{20,}) を追加する。既存の classic
gh[opsur]_ prefix パターンは github_pat_ の3文字目 (i) にマッチしないため
このトークンは従来 redaction されずに transcript summary artifact へ
そのまま残るおそれがあった。

tests/test_summarize_agent_transcript.py に deterministic synthetic
github_pat_ トークン (82文字 body) を用いた完全一致 regression test
(test_redact_patterns_fully_redacts_fine_grained_pat_token) を追加し、
token 全体および prefix/body の断片が出力に残らないことを検証する。
既存の classic token (ghp_/gho_/ghu_/ghr_/ghs_) redaction テストは全件 pass。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2806/

The preview will be removed when this PR is closed.

@squne121

Copy link
Copy Markdown
Owner Author

Findings

現行 HEAD c210f54fedbc686cb139a9d6775d28f0db39f1d3 を、Issue #2736、関連 PR #2735、current main、CI/JUnit、open-pr / pr-review-judge の現行契約、外部仕様まで突き合わせました。実装ロジックそのものに直ちに secret leakage を残す defect は見つかっていませんが、現状のままでは REQUEST_CHANGES が妥当です。 主因は PR evidence/workflow contract 側です。

  1. P1 / Blocker — open-pr と pr-review-judge の PR body contract が split-brain しており、fix: summarize_agent_transcript.py の GitHub token redaction を github_pat_ 対応にする #2806 が実際に false-pass しています。 docs/dev/workflow.md と pr-review-judge/references/ac-evidence-checks.md は ## 受け入れ条件の達成状況、## 検証コマンド結果、## Allowed Paths 遵守 を必須とし、各 AC に [x]/[ ] + 根拠 を要求しています。しかし fix: summarize_agent_transcript.py の GitHub token redaction を github_pat_ 対応にする #2806 には3セクションともありません。一方、open-pr/scripts/validate_pr_body.py の REQUIRED_SECTIONS / LP052 は Summary / Checks / Schema Change Applicability / Schema Consumer Inventory / Safety Claim Matrix / Notes しか要求せず、.github/pull_request_template.md も同じ構成です。そのため validator を正常通過しても reviewer contract を満たさない PR を生成できます。これは fix: summarize_agent_transcript.py の GitHub token redaction を github_pat_ 対応にする #2806 固有の authoring miss ではなく producer/consumer semantic divergence です。最小修正は、まず fix: summarize_agent_transcript.py の GitHub token redaction を github_pat_ 対応にする #2806 本文へ3セクションを追加して AC1–AC3・VC・2つの Allowed Paths を明記することです。再発防止は新しい approval layer を増やすのではなく、既存 LP052/template/reviewer が1つの required-section inventory を共有する程度に限定すべきです。既存 open Issue 実装: PR本文 canonical heading の non-prose policy を整合させる #1641 は LP052 grammar の変更を明示的に Out of Scope としており、この drift 自体の既存 follow-up は見つかりませんでした。

  2. P1 / Blocker — credential redaction の変更なのに Safety Claim Matrix を N/A にしている判定根拠が reviewer 契約と一致していません。 fix: summarize_agent_transcript.py の GitHub token redaction を github_pat_ 対応にする #2806 は fine-grained PAT、secret-like token、redaction、docs/dev/secret-policy.md を直接扱っています。current safety-claim-gate.md は changed path だけでなく、PR / diff / Issue に safety-boundary wording がある場合も safety-sensitive とします。一方 open-pr validator の _is_safety_sensitive() はほぼ path-based なので、今回の2ファイルでは N/A を許しています。ここも同じ producer/consumer drift です。大掛かりな security harness は不要で、PR本文に「redact_string() が github_pat_[A-Za-z0-9_]{20,} を <GITHUB_TOKEN> へ置換する」「classic 5形式は非回帰」の2行程度の bounded claim と current-head test evidence を書けば十分です。provider の exact grammar や「すべての transcript credential を防ぐ」といった広い安全性主張はしない方が正確です。

  3. P2 — {20,} という意図的な recall-first policy が regression test で固定されていません。 Issue 実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる #2736 は「GitHub の exact token grammar の validator ではなく、redactor として github_pat_[A-Za-z0-9_]{20,} 相当を保守的に拾う」と明示しています。しかし追加テストは body 82文字 の1ケースだけです。したがって将来 regex が github_pat_[A-Za-z0-9_]{82} に狭められても、この PR の fine-grained PAT test はそのまま PASS します。repository 内の secret_exposure_scanner.py 自体が82文字形を使っているため、detector と redactor を再び同一視する regression は現実的です。最小修正は synthetic な20文字 body を1ケース追加して exact replacement を assert するだけで十分です。19文字 negative test、新 scanner、schema、live secret は不要です。

  4. P2 / workflow evidence — impl-review-loop の完了報告と PR 上の materialized review evidence が一致していません。 Issue 実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる #2736 のコメントでは HEAD c210f54… に対して APPROVE / draft_pr_ready が報告されていますが、現在の PR conversation にあるのは preview bot のコメントだけで、review submission/thread もありません。current pr-review-judge は self-authored PR でも verdict を control-plane が通常の PR comment として投稿する契約です。修正後は current HEAD で reviewer を再実行し、その verdict comment の publication まで確認した方がよいです。formal GitHub APPROVE event を増やす必要はありません。

実装自体の評価

追加された matcher の方向性は妥当です。GitHub の現行公式ドキュメントは fine-grained PAT の識別 prefix が github_pat_ であることを明記しています。classic ghp_、OAuth gho_、App user ghu_、installation ghs_、refresh ghr_ も別 prefix として列挙されています。:chatgpt-content-reference{index="0"}

一方、GitHub の公開ドキュメントから fine-grained PAT body の厳密な length/character grammar は確認できません。したがって #2736/#2806 が「82文字を GitHub normative grammar と扱わず、repository-owned conservative redaction policy として {20,} を採る」とした整理は適切です。82文字は scanner ecosystem では使われている形ですが、GitHub 公開仕様そのものとは分けるべきです。:chatgpt-content-reference{index="1"}

CI も掘りました。main は PR base c9c8e35… から動いておらず stale-base 問題はありません。変更は Issue の Allowed Paths と完全一致する2ファイルだけです。HEAD の主要 Actions は green です。さらに python-test-junit-1 artifact を実際に展開したところ、新しい test_redact_patterns_fully_redacts_fine_grained_pat_token は PASS、classic 非回帰も ghp_ / gho_ / ghs_ / ghu_ / ghr_ の 5 testcase が個別にすべて PASS していました。したがって、PR本文の 60 passed は evidence 表現として弱いものの、Issue #2765 の enumerated-coverage rule 自体は current-head JUnit によって満たされています。

関連 PR #2735 の ghs_ specific-before-general precedentとも整合しています。また secret-pattern migration の consumer-semantics 混同・false-pass VC については既に open Issue #2769 があるため、今回そこへ新しい汎用 scanner/gate を重複追加するのは不要です。

推奨 disposition

REQUEST_CHANGES。ただし修正範囲は小さく保つべきです。 PR body の3必須セクション+bounded Safety Claim Matrix を補い、20文字 body の focused regression を1件追加し、CI 後に current pr-review-judge を fresh HEAD で再実行して PR comment まで materialize する、で十分です。

別枠の再発防止として価値があるのは open-pr LP052/template と pr-review-judge required-section/safety-sensitive 判定の contract drift を解消する narrow follow-up です。新しい永続 gate・schema・wrapper を増やす問題ではありません。

@squne121

Copy link
Copy Markdown
Owner Author

確認した時点で、PR #2806 は open / draft、HEAD は c210f54fedbc686cb139a9d6775d28f0db39f1d3、main は c9c8e35c7e461b7b8b0d272c669bb0e4a4f11d5f のままです。変更は Issue #2736 の Allowed Paths と一致する2ファイルのみで、HEAD の主要 Actions は green です。一方、PR 上には formal review/thread はなく、対象 OWNER comment の REQUEST_CHANGES が未処理です。

推奨は 新PRを作らず #2806 を resume し、対象コメントを human_context_comment_urls として current impl-review-loop に入力することです。修正は、①PR本文の evidence 3セクション+bounded Safety Claim Matrix、②{20,} policy を固定する20文字 body regression、③fresh HEAD で Verification→PR review→verdict comment materialization、に限定します。

再発防止については既存 Issue を dedupe した上で、該当する open Issue がなかったため #2808 を起票済みです。#1641/#610/#2769 とは責務を分離しています。
#2808

そのまま既存の auto mode 対話セッションへ貼るプロンプトです。

repo = squne121/loop-protocol

対象:

目的:
current repository の .claude/skills/impl-review-loop を正規手順として使い、Issue #2736 / PR #2806 の実装・修正・検証・PR review loop を、人間の iteration ごとの承認なしで 人間が merge 判断できる直前まで完遂してください。

このセッションは既に auto mode で起動済みです。現在の runtime / launcher / profile / permission mode を維持し、再起動や別 runtime への切替、permission bypass は行わないでください。

最初に必ず fresh state を取得する

過去の報告やこの prompt に書かれた SHA を authority とせず、開始時に以下を live 再取得してください。

  1. Issue 実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる #2736 の最新 body / comments / labels / contract
  2. PR fix: summarize_agent_transcript.py の GitHub token redaction を github_pat_ 対応にする #2806 の最新 body / exact HEAD / base / draft state / mergeability / changed files / comments / reviews / review threads / CI
  3. current main HEAD
  4. OWNER comment 5856207106 の全文
  5. current HEAD の以下:
    • .claude/skills/impl-review-loop/SKILL.md
    • steps/preparation.md
    • steps/step-1-implementation.md
    • steps/step-2-verification.md
    • steps/step-4-pr-review.md
    • steps/step-5-feedback-and-termination.md
    • .claude/agents/implementation-worker.md
    • .claude/agents/test-runner.md
    • .claude/agents/pr-reviewer.md
    • 必要な implement-issue / pr-review-judge / open-pr の current contract

開始前参考値:

ただし、これらは必ず live state で再bindしてください。

impl-review-loop の入力

Issue #2736 を issue_number として current impl-review-loop を root/main thread から直接実行してください。

OWNER comment

https://github.com/squne121/loop-protocol/pull/2806#issuecomment-5856207106

を human context / fix_delta authority として明示的に渡してください。current skill が human_context_comment_urls を受理する場合はその入力として binding してください。

この OWNER comment は「ここで停止せよ」という veto ではなく、今回処理すべき REQUEST_CHANGES / fix_delta です。別途 live comment に明示的な stop / do not proceed が存在しない限り、この comment を理由に human escalation して終了しないでください。

landing disposition

新しい branch / worktree / PR を無条件に作らないこと。

Issue #2736 には既存 open draft PR #2806 があるため、current canonical landing-disposition producer の fresh 判定に従い、適格なら existing_pr_resume として PR #2806 と既存 branch/worktree を再利用してください。

duplicate PR を作らないでください。

stale evidence、head drift、main drift があれば current impl-review-loop の canonical rebind / update-branch / rereview route に従って回復してください。

OWNER comment の fix_delta

OWNER comment の全 finding を current live repository と再照合したうえで処理してください。現時点で期待する最小修正は以下です。

A. PR body evidence contract を修正

PR #2806 本文に、current pr-review-judge / workflow contract が要求する以下を materialize してください。

  • ## 受け入れ条件の達成状況
  • ## 検証コマンド結果
  • ## Allowed Paths 遵守

受け入れ条件の達成状況 では Issue #2736 の AC1〜AC3 をそれぞれ [x]/[ ] + concrete evidence で列挙してください。

検証コマンド結果 では Issue #2736 の各 Verification Command を、fresh current HEAD 上の実行結果と対応させてください。単なる 60 passed の aggregate self-report だけで exhaustive claim を済ませず、classic token 5形式について current reviewer contract が要求する individual coverage evidence を使ってください。

Allowed Paths 遵守 では live Issue #2736 の Allowed Paths と actual changed files を比較し、2ファイルだけであることを evidence としてください。

PR body mutation は repository-owned open-pr の canonical update wrapper を使用してください。直接の ad-hoc gh pr edit --body ... で canonical validation を迂回しないでください。

B. Safety Claim Matrix を N/A のままにしない

今回の PR は credential redaction / secret-like token / docs/dev/secret-policy.md を直接扱っています。

current pr-review-judge/references/safety-claim-gate.md の live contract を正本として判定し、現在の Safety Claim Matrix: N/A を、bounded な具体的 claim に更新してください。

claim の射程は少なくとも以下程度に限定してください。

  1. scripts/summarize_agent_transcript.py::redact_string() の repository-owned matcher
    github_pat_[A-Za-z0-9_]{20,}
    が対象文字列全体を <GITHUB_TOKEN> へ置換すること。
  2. existing classic token 5形式
    ghp_ / gho_ / ghu_ / ghr_ / ghs_
    の既存 redaction behavior が regression していないこと。

GitHub provider の exact token-validity grammar、repository 全体の credential protection、全 transcript surface の安全性など、今回証明していない広い claim は書かないでください。

current canonical 5-column Safety Claim Matrix が必要なら、その形式を使ってください。

C. {20,} recall-first policy を regression test で固定

OWNER finding の P2 を修正してください。

現在の 82-character synthetic body test は残し、その上で 20-character body の deterministic synthetic github_pat_ input が whole-token replacement される focused regression を追加してください。

必要な observable behavior は概ね:

redact_string(f"before {token} after") == "before <GITHUB_TOKEN> after"

です。

既存 test を parameterize するか focused test を追加するかは、current sourceを読んで最小・明瞭な方を選んでください。ただし Issue #2736 AC2 の 82-character fixture coverage は失わないでください。

SubAgent execution rules

current impl-review-loop が定める既存 SubAgent を使ってください。

少なくとも依存関係に従って:

  • implementation / fix → implementation-worker
  • independent Verification → test-runner
  • PR review → pr-reviewer

を canonical contract で使ってください。

重要:
SubAgent を dispatch したことを completion とみなしてはいけません。

各 dependent step では:

  1. actual child task を dispatch
  2. child が terminal state に到達するまで待つ
  3. child の final structured result を取得する
  4. expected output schema / head binding / errors を確認する
  5. その結果を LOOP_STATE に反映する
  6. その後にのみ次の dependent step へ進む

という順序を守ってください。

child task がまだ running / pending の状態で verification、review、final report へ進まないでください。

independent な read-only investigation 等は必要なら並列化して構いませんが、implementation → current-head verification → current-head review の dependency は崩さないでください。

nested delegation を無闇に増やさず、current agent definitions / Skills の責務をそのまま使ってください。

Verification

修正後は fresh HEAD で Issue #2736 の literal Verification Commands を再実行してください。

最低限:

  • AC1 matcher evidence
  • AC2 whole-token github_pat_ behavioral test
  • AC3 existing transcript summarizer regression suite
  • OWNER finding対応として20-character body focused regression
  • classic token 5形式の individual executable coverage

を確認してください。

current-head CI が必要なら push 後の actual check runs を確認してください。

古い c210f54... の CI/JUnit evidence を、新しい HEAD の PASS として再利用しないでください。

test failure / normal CI failure / stale HEAD は人間停止理由にせず、修正可能なら自動修正→再実行してください。

PR review

Step 2 の current-head VC adjudication が nonblocking になった後にのみ pr-reviewer を起動してください。

reviewer には実値として:

を渡してください。

placeholder を child message に渡さないでください。

REQUEST_CHANGES が返った場合は、current route_loop_verdict_v2() / Step 5 contract に従って fix_delta を implementation-worker へ戻し、修正→再検証→fresh rereview を iteration 上限まで自動継続してください。

reviewed head と current head がずれたら stale verdict として捨て、fresh HEAD で再reviewしてください。

review evidence の materialization

OWNER finding 4 を解消してください。

console/session 内で APPROVE 相当を得ただけで完了扱いせず、current pr-review-judge / publication contract を確認し、要求される PR conversation 上の canonical verdict comment が実際に materialize されたことを readback してください。

self-authored PR だからという理由で review evidence を省略しないでください。

formal GitHub APPROVE review event を新しく作る必要がないなら作らず、repository contract が要求する PR comment を正本にしてください。

recurrence handling

今回確認された producer/consumer split-brain の再発防止 Issue は既に作成済みです。

したがって、この既知 failure classについて新しい duplicate Issue を作成しないでください。

また:

との責務境界を #2808 が既に記録しています。

作業中に 別の recurrent defect を新たに実証した場合だけ、repository-wide dedupe を行い、既存 open Issue があれば再利用してください。既存 Issue がなく、再発可能性が concrete evidence で確認できる場合は、#2736 の feature scopeへ混ぜず narrow follow-up Issue として起票してください。

新しい generic security gate / approval layer / wrapper を推測だけで増やさないでください。

autonomy / stop conditions

iteration ごとの人間承認は不要です。

以下は自動回復・継続対象です:

  • ordinary test failure
  • ordinary CI failure
  • REQUEST_CHANGES
  • stale reviewer evidence
  • stale PR head
  • repair可能な PR body validation failure
  • branch behind main
  • reviewer finding の deterministic fix

以下だけは停止/escalationしてください:

  • destructive operation が必要
  • secret / credential の取得・変更・公開が必要
  • force push / history rewrite が必要
  • permission/policy bypass が必要
  • actual irreconcilable Git conflict
  • current user/OWNER による明示的 stop 指示
  • scope conflict が repository contract 内で解消不能
  • evidence integrity を維持できない
  • canonical loop max_iterations 到達

--dangerously-skip-permissions や permission bypass を要求・使用しないでください。

他 task の dirty worktree、foreign branch、foreign uncommitted changes を削除・変更しないでください。

到達点

完了条件は、current impl-review-loop の canonical終了条件を満たし、少なくとも:

です。

merge、auto-merge、force push、不可逆 cleanup は実行しないでください。

最終報告

最後に簡潔に以下を報告してください。

  • final Issue / PR
  • reused branch/worktree
  • before HEAD → final HEAD
  • OWNER finding 1〜4 それぞれの処置
  • changed files
  • PR body evidence sections の更新結果
  • Verification Commands と focused 20-char regression の結果
  • current-head CI
  • pr-reviewer final verdict / reviewed_head_sha
  • PR comment として materialize された canonical verdict URL
  • recurrence Issue 再発防止: PR body authoring validator と pr-review-judge の evidence/safety contract drift を解消する #2808 の扱い
  • remaining blockers
  • merge は実行していないこと
  • IMPL_REVIEW_LOOP_RESULT_V1 の最終 status / termination_reason

調査・提案だけで終了せず、上記 terminal condition まで実作業を進めてください。

特に今回は、既存 #2806 を apply_pr_review_fix_delta 相当で修復することと、reviewer の child completion + PR comment readback まで待つことが重要です。

OWNER finding P2 (PR #2806 issuecomment-5856207106): 既存テストは
body 82文字のケースのみを検証しており、`github_pat_[A-Za-z0-9_]{20,}`
という recall-first ポリシーの下限境界 (20文字) が regression test で
固定されていなかった。deterministic synthetic body (20文字) の
fine-grained PAT token に対する focused regression test を追加する。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@squne121

Copy link
Copy Markdown
Owner Author

impl-review-loop pr-reviewer verdict(fresh head 再評価)

対象 head: a5cac07aabc91a203a5488e6a07091fdb2558aab
対象 Issue: #2736
OWNER fix_delta(issuecomment-5856207106)P1 Blocker 2件 + P2 2件はすべて fix_delta 対応済みであることを fresh head 上で独立に再検証しました(AC1〜AC3 behavioral pytest 個別実行、classic token 5形式個別実行、Allowed Paths Gate、CI required checks、PR body 3必須セクション、Safety Claim Matrix の bounded claim 化)。詳細は本コメント下部を参照してください。

検証サマリ

  • AC1: github_pat_[A-Za-z0-9_]{20,} matcher 追加 — PASS(grep 独立確認)
  • AC2: test_redact_patterns_fully_redacts_fine_grained_pat_token(82文字)/ test_redact_patterns_fully_redacts_minimum_length_pat_token(20文字、OWNER P2 対応)— 個別 PASS
  • AC3: classic token 5形式(ghp_/gho_/ghs_/ghu_/ghr_)個別 PASS、全体 61 passed
  • Allowed Paths Gate: status: ok, violations: [](2ファイルのみ、Issue 実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる #2736 と完全一致)
  • CI required checks(typecheck/lint/test/build/python-test/validate-generated-artifact): 全て SUCCESS(stale run ではなく current head 束縛で確認)
  • Mergeability: MERGEABLE / merge_state_status: CLEAN
  • PR body: ## 受け入れ条件の達成状況 / ## 検証コマンド結果 / ## Allowed Paths 遵守 すべて存在し fresh head と整合
  • Safety Claim Matrix: bounded な2 claim(matcher の完全置換動作/classic 5形式の非回帰)に更新済み、広範な claim なし
verdict: APPROVE
reviewed_head_sha: "a5cac07aabc91a203a5488e6a07091fdb2558aab"
blockers: []
warnings: []

@squne121
squne121 marked this pull request as ready for review September 27, 2026 13:53
@squne121
squne121 merged commit a3bbd85 into main Sep 27, 2026
61 of 68 checks passed
@squne121
squne121 deleted the worktree-issue-2736-summarize-agent-transcript-py-github-tok branch September 27, 2026 14:19
squne121 added a commit that referenced this pull request Sep 28, 2026
…ontract drift を解消する (#2813)

* 実装: PR body authoring validator と pr-review-judge の evidence/safety contract drift を解消する (#2808)

open-pr の validate_pr_body.py::REQUIRED_SECTIONS を唯一の canonical required-section
inventory とし、pr-review-judge が要求してきた「受け入れ条件の達成状況 / 検証コマンド結果 /
Allowed Paths 遵守」を LP052 の enforcement に追加する。PR template と
ac-evidence-checks.md はこの canonical list の materialized projection とし、focused
pytest で parity を検査する。

safety-sensitive applicability は changed_paths のみに限定していた既存 _is_safety_sensitive()
を、PR body / linked Issue body のテキストシグナル(GitHub PAT prefix、personal access
token、secret-like token、credential redaction 等の強いシグナルに限定し、bare `token` の
ような near-miss では誤検知しない)を含む deterministic minimum floor へ拡張する。
open_pr.py(create path)と update_pr.py(update path)の両方に同一の floor 入力を適用し、
PR #2806 の credential redaction 再発(scripts/summarize_agent_transcript.py はどの
safety-sensitive path pattern にも一致しない)を防ぐ。

Allowed Paths に明示された9ファイルに加え、REQUIRED_SECTIONS 拡張の直接的な結果として
既存テストスイートを green に保つために必要な test fixture / generator (Scope Delta,
PR 本文で明示):
- .claude/skills/open-pr/scripts/tests/fixtures/pr_body/{valid_not_schema_change,not_schema_change_with_na_inventory}.md
- .claude/skills/open-pr/tests/test_pr_body_hygiene.py
- .claude/skills/open-pr/scripts/generate_pr_body.py + templates/pr_body.ja.md
- .claude/skills/impl-review-loop/tests/test_handoff_pr_hygiene_regression.py

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: PR body fixture の日本語比率不足プロセスブロックを修正する

pre-existing な .claude/skills/open-pr/scripts/tests/fixtures/pr_body/{not_schema_change_with_na_inventory,valid_not_schema_change}.md の Summary/Schema Change Applicability/Notes ブロックが日本語比率0のため PR Body Japanese Check (threshold 0.1) で fail していた。parser-sensitive な `Related issue: #N` 行はそのまま保持し、sibling bullet で日本語比率を満たす。

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: PR body template の日本語比率不足プロセスブロックを修正する

pre-existing な .claude/skills/open-pr/templates/pr_body.ja.md の Summary/Checks/Schema Change Applicability/Schema Consumer Inventory/Safety Claim Matrix/Notes の各ブロックが $placeholder のみで日本語比率0のため PR Body Japanese Check (threshold 0.1) で fail していた。各 $placeholder 行の直後にセクション説明の日本語 gloss 行を追加し、既存の見出し文字列・$placeholder token 自体は変更しない。

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: safety-claim-gate.md の見出し日本語比率不足を修正する

「## Deterministic Minimum Floor(producer/reviewer 共有、Issue #2808 AC4)」見出しブロックが日本語比率0.032で PR Body Japanese Check (threshold 0.1) の fail 対象になっていた。見出し文言を日本語主体に言い換え、他ファイルからの参照がないことを確認した。

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Test <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
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.

実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる

1 participant