Closed
Labels
enhancementNew feature or requestfollow-up後続 Issue として切り出された follow-upphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "PR #2693(Issue #2686 close)の pr-reviewer 指摘(P2/非blocking follow-up)に基づき、_SECRET_LIKE_PATTERNS の新形式 GitHub App installation token 対応を検討する"
change_kind: codeParent Issue
なし(単独改善)
Parent Goal Ref
- Goal: PR fix: redact GraphQL call diagnostics #2693(Issue 実装: issue_relationship.update GraphQL error diagnostics に既存 redactor を通す #2686 close)の pr-reviewer 指摘(P2/非blocking follow-up)に基づき、
_SECRET_LIKE_PATTERNSの新形式 GitHub App installation token 対応を検討する - Desired Destination: N/A(単独 Issue のため parent なし)
Current Validated Scope
scripts/agent-guards/controlled_skill_mutation_exec.pyの_SECRET_LIKE_PATTERNS(_redact_secret_like_tokens()が使用)はgh[oprsu]_[A-Za-z0-9]{20,}のみを認識し、2026年に GitHub が移行した新形式 GitHub App installation tokenghs_<APP_ID>_<JWT>を認識できない(gh[oprsu]_の直後に_を含む APP_ID セグメントが続くため、正規表現全体が一切マッチしない)- 本 Issue のオペレーター選定 anchor コメント(issuecomment-5769769089)の技術的指摘は、現在の main(commit 336325b)で
codebase-investigatorによる独立 fact-check 済み: (1) 新形式トークンは現行パターンで完全に unmatched(部分一致ですらない)、(2)test_controlled_skill_mutation_exec.pyにghs_プレフィックスの regression テストは0件(ghp_のみ)、(3) 現行 AC1 の Verification Command(_SECRET_LIKE_PATTERNSという文字列自体へのrg)は実装前 baseline で既に exit 0 になる(trivially-pass) - GitHub 公式仕様(
web-researcherによる一次資料 fact-check 済み。出典: https://github.blog/changelog/2026-04-24-notice-about-upcoming-new-format-for-github-app-installation-tokens/ ):ghs_プレフィックス自体は変更されない。新形式はghs_<APP_ID>_<JWT>(JWTはドット区切り3セグメント、base64url文字集合[A-Za-z0-9._-]を含む)、長さは約520文字。GitHub Actions のGITHUB_TOKENも対象に含まれる。GitHub は token を opaque string として扱うことを推奨しており、本 Issue でも JWT 内部構造(header/payload/signature の意味論)に依存しない charset ベースの拡張のみを行う
Remaining Parent Gaps
なし
Outcome
_SECRET_LIKE_PATTERNS(および _redact_secret_like_tokens())が新形式 ghs_<APP_ID>_<JWT> トークンを、APPID・JWTのheader/payload/signatureの断片を一切残さず単一の [REDACTED] へ完全に redact できる状態になっており、既存の classic gh[oprsu]_... 形式トークン(classic ghs_ 短縮形を含む)の redaction 挙動が回帰していないことを直接検証する pytest が scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py に追加されて PASS している。
Runtime Verification Applicability
- decision: not_applicable
- reason: 正規表現ロジックの拡張と pytest による静的検証のみで完結するため
In Scope
_SECRET_LIKE_PATTERNSへの新形式ghs_<APP_ID>_<JWT>トークン対応パターンの追加(GitHub公式仕様の charset[A-Za-z0-9._-]に基づく拡張。JWT内部構造へ依存する独自解析は行わない)_redact_secret_like_tokens()が新形式トークン全体(APPID + JWTの3セグメント)を単一の[REDACTED]に完全置換すること(部分置換・断片残存の禁止)- 新形式トークンの完全redactionを直接検証する pytest、および classic
ghs_トークンの backward-compatibility を直接検証する pytest の追加
Out of Scope
_graphql_call()や他の diagnostic 生成箇所の呼び出しロジック変更(呼び出し側は変更しない)- new security subsystem や generic secret scanner の新設
- live GitHub mutation test や credential canary の追加
scripts/summarize_agent_transcript.py、.claude/skills/agent-retrospective/scripts/persist_retrospective_run.py、.claude/skills/issue-refinement-loop/scripts/compact_author_result.py、.claude/skills/impl-review-loop/scripts/get_ci_failed_log.py等、他の redactor/detector に存在しうる同種ghs_gap の調査・修正(repository-wide の横展開は本 Issue のスコープ外。必要であれば別 follow-up Issue で扱う)
Acceptance Criteria
- AC1:
_SECRET_LIKE_PATTERNSに、GitHub公式仕様に基づく新形式ghs_<APP_ID>_<JWT>トークン(ghs_プレフィックス + base64url 文字集合[A-Za-z0-9._-]を含む十分な長さ)を検出する新しい正規表現エントリが追加されている - AC2:
_redact_secret_like_tokens()にbefore <新形式トークン> afterという文字列(新形式トークンは APPID セグメントと、ドットで区切られた JWT header/payload/signature の3セグメントを含む)を渡すと、結果が exactlybefore [REDACTED] afterになる(トークンの断片が一切残らない) - AC3: 既存の classic
gh[oprsu]_[A-Za-z0-9]{20,}形式トークン(ghp_/gho_/ghu_/ghr_、および classic 短縮形のghs_)に対する redaction 挙動が変更されておらず、classicghs_トークンに対する直接の regression テストが新規に追加されて PASS している(既存テスト全件も PASS を維持する) - AC4:
_graphql_call()の例外パス経由で新形式トークンを含むエラーメッセージが渡された場合でも_redact_secret_like_tokens()を通して完全に redact されることを、既存のTestGraphqlCallDiagnosticRedactionと同じ呼び出し経路(本番コードパス)で検証する pytest が新規に追加されて PASS している
Verification Commands
# AC1
$ rg -n "ghs_" scripts/agent-guards/controlled_skill_mutation_exec.py
# AC2
# baseline-expect: fail
$ uv run pytest scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py::test_redact_secret_like_tokens_fully_redacts_new_installation_token -q
# AC3
# baseline-expect: pass
$ uv run pytest scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py -q
# AC3
# baseline-expect: fail
$ uv run pytest scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py::test_redact_secret_like_tokens_preserves_classic_ghs_token_redaction -q
# AC4
# baseline-expect: fail
$ uv run pytest scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py::test_graphql_call_exception_redacts_new_installation_token -qAllowed Paths
- scripts/agent-guards/controlled_skill_mutation_exec.py
- scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Required Design References
docs/dev/secret-policy.md(Secret Inventory / no-secret 運用境界の SSOT。本 Issue の redaction 拡張は同文書が定める secret 取り扱い方針の範囲内で行う)scripts/agent-guards/controlled_skill_mutation_exec.py内の既存_SECRET_LIKE_PATTERNS/_redact_secret_like_tokens()実装(実装時の直接参照点)
Scope Delta(任意)
N/A
Notes for Reviewer
- 優先度:
optional_follow_up(低優先度)。実在の credential 漏洩インシデントは確認されておらず、プロアクティブな gap 解消目的の改善である。緊急対応は不要。 - 新形式トークンの正確な文字集合・長さ仕様は GitHub 公式 Changelog(2026-04-24付)で確認済み(
ghs_プレフィックス継続、ghs_<APP_ID>_<JWT>、約520文字、base64url文字集合)。この一次資料が確認できる範囲を超えて token 内部構造(JWTの意味論)へ依存する独自解析は行わない。 - 本 Issue の anchor コメント(issuecomment-5769769089)の技術的指摘(P1: 完全redaction未固定、P1: classic
ghs_regression fixture不在、P2: AC1 VCのtrivially-pass)は、codebase-investigatorによる独立 fact-check の上で本 Issue の AC1〜AC4 / Verification Commands に反映済み。anchor コメントが例示した Verification Command 案(未作成テスト名を-kで指定する形)はそのまま採用せず、docs/dev/dor.mdの VC baseline 差分性ルールおよびexisting_file_missing_node_id_declared_fail(Issue 実装: baseline_vc_preflight.py の existing_file_missing_node_id_noncanonical 分類に baseline-expect: fail escape hatch を追加する #2515)の canonical escape hatch(# baseline-expect: failを付与した<既存test file>::<新規test名>ノードID形式)に従って書き換えている。 - anchor コメントが指摘する「他の redactor/detector にも存在しうる同種
ghs_gap」は本 Issue のスコープ外とし、上記 Out of Scope に列挙のうえ follow-up 候補として別途記録する(本 Issue には押し込まない)。 - Scope Overlap Preflight(
check_issue_overlap.py)の結果:decision=overlap_requires_comment(policy_class C1, reason_code allowed_paths_overlap)。scripts/agent-guards/controlled_skill_mutation_exec.pyを Allowed Paths に含む他の Implementation Issue(実装: edit-issue の native relationship pagination reader を controlled executor に一本化し totalCount 検証を追加する #1916, 実装: playtest-log の JSON Schema / validator の追加 #420, 実装: .claude/skills 配下スクリプトの executable bit を監査し CI guard を追加する #205)と allowed_paths が重複するが、いずれも本 Issue とは編集意図が異なる(実装: edit-issue の native relationship pagination reader を controlled executor に一本化し totalCount 検証を追加する #1916: relationship pagination reader 一本化、実装: playtest-log の JSON Schema / validator の追加 #420: playtest-log schema、実装: .claude/skills 配下スクリプトの executable bit を監査し CI guard を追加する #205: executable bit 監査)ため non-conflict と判断し、そのまま起票する。本 refinement loop 実行時点(2026-09-22)で3件とも OPEN だが、controlled_skill_mutation_exec.pyに対する open PR は存在せず、実際の編集競合は確認されていない。同時並行実装時はマージコンフリクトの可能性があるため、実装着手時に1 PR = 1 Issueの直列化を確認すること。
Source
- dedupe_key: follow-up:squne121/loop-protocol:pr/2693:1
- 起票元: post-merge-cleanup(post-merge-cleanup-worker follow_up_issue_requests, PR fix: redact GraphQL call diagnostics #2693 cleanup)
- 参照PR: fix: redact GraphQL call diagnostics #2693
- 参照Issue: 実装: issue_relationship.update GraphQL error diagnostics に既存 redactor を通す #2686
- operator-selected anchor comment: 実装: 既存 redactor が新形式 GitHub App installation token (ghs_APPID_JWT) を認識しない #2718 (comment)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestfollow-up後続 Issue として切り出された follow-upphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Sep 22, 2026
判定
REQUEST_CHANGES 相当 / needs-fix です。
Issue #2718 の方向性自体は正しいです。起票元の PR #2693 のレビューコメント で指摘された gap は現在も
mainに存在し、GitHub 公式情報とも一致しています。GitHub は 2026年4月から installation token をghs_APPID_JWT形式へ段階移行し、新形式は約520文字・JWT由来の2つの.を含みます。GitHub が新旧双方を扱うため案内している regex はghs_[A-Za-z0-9\.\-_]{36,}です。Actions のGITHUB_TOKENも対象に含まれます。(GitHub Blog)ただし、現 Issue 契約のまま実装すると、「新形式を一応検出したが JWT の一部が残る」実装をテストが通してしまう余地があります。ここは実装前に直す価値があります。
Findings
優先度 | Finding | 対応 -- | -- | -- P1 | AC2/AC4 が「token 全体が1個の [REDACTED] に置換された」ことを十分固定していない | Issue修正推奨 P1 | AC3 の backward compatibility が実テストで担保されていない。現 test file に ghs_ fixture が0件 | Issue修正推奨 P2 | AC1 の Verification Command が実装前から PASS する | VC修正推奨 P2 | 同じ新形式を取りこぼす別 redactor / secret gate がリポジトリ内に存在 | 別 follow-up。#2718 は膨らませないP1 — 「完全 redaction」を明示的に固定すべき
現在の production code は以下です。
一方、新形式は概念的に、
です。GitHub 自身も token の内部構造へ依存せず opaque string として扱うよう求めています。(GitHub Blog)
ここで新規テストが例えば、
だけだと不十分です。
実際、このリポジトリの
scripts/summarize_agent_transcript.pyにある現行 regex:は典型的な新形式 token に対して、JWT の最初の
.までを<GITHUB_TOKEN>に変え、残りの payload/signature を残せます。つまり「元の完全な token は存在しない」「redaction marker は存在する」の両方を満たしながら情報を漏らせます。#2718 の AC2 は次のように強化するのが適切です。
テストも exact equality にすれば十分です。新しい harness や live credential test は不要です。
P1 — classic
ghs_regression が現在はテストされていないcurrent test file を確認したところ、現時点で
ghs_literal は0件です。#2693 で追加された redaction tests はghp_fixture です。したがって現 AC3 の、
は証明になっていません。suite 全件 PASS でも、classic
ghs_を壊していれば検出できません。最低限、この2ケースだけ直接固定すれば十分です。
実装としては GitHub 推奨の新旧共通 pattern を既存 generic GitHub-token pattern より前に置くのが素直です。
後段の既存 pattern を残せば、従来の広めな defense-in-depth behavior も失いません。
P2 — AC1 Verification Command は現在の main でも PASS する
現在は、
ですが、
SECRET_LIKE_PATTERNSは当然すでに存在します。つまりコードを1行も変更しなくても AC1 の verification が成功します。
source-text regex をさらに増やすより、AC1/AC2/AC4 は focused behavioral test へ統合する方が堅いです。例えば:
全 suite の AC3:
はそのままでよいです。
P2 — #2718 外にも同じ format migration gap がある
Repository search では少なくとも次が見つかりました。
scripts/summarize_agent_transcript.pygh[opsur][A-Za-z0-9]{20,}新 JWT の後半を残す partial redaction が起こり得る
.claude/skills/agent-retrospective/scripts/persist_retrospective_run.py\bghs_[A-Za-z0-9]{20,}\bshort APPID +
の新形式を検知しない可能性が高い.claude/skills/issue-refinement-loop/scripts/compact_author_result.pyghs[A-Za-z0-9]{36}raw
ghs_APPID_JWTdetector として stale.claude/skills/impl-review-loop/scripts/get_ci_failed_log.pyghs_[A-Za-z0-9]{36,}自体は staleただし別の JWT pattern も持つため、上2件ほど明確な漏洩経路ではありません
GitHub が推奨 regex を明示している以上、これらも技術的負債です。(GitHub Blog)
ただし、#2718 の Allowed Paths を拡張して一括修正するのは勧めません。今回の起票目的は #2693 の
SECRET_LIKE_PATTERNSfollow-up で明確です。趣味開発のワークフローを重くしないなら、と分ける方が適切です。
関連状態
PR #2693 は既に merged で、#2718 の起票根拠になった P2 follow-up と整合しています。Issue #2686 では redactor regex 自体が明示的に Out of Scope だったため、別 Issue 化も正しいです。
#2718 自体には現時点でコメントはなく、関連する open PR も見つかりませんでした。Issue 本文が挙げている #1916 / #420 / #205 は open ですが、それぞれの番号に紐づく open PR は現在見つかっていないため、現時点で actual edit conflict を理由に着手を止める必要はありません。実装直前の再確認だけで十分です。
最小修正案
Issue を大きく書き換える必要はありません。次の3点を契約へ追加すれば実装へ進める品質になります。
AC2を「新形式 token 全体が単一
[REDACTED]に置換され、JWT fragment が残らない」に強化する。AC3に classic
ghsの直接 regression fixture を要求する。AC1 の
rg "SECRET_LIKE_PATTERNS"を削除し、新旧ghsの focused pytest に置き換える。generic secret scanner、credential canary、live GitHub mutation、E2E security harness は #2718 には不要です。今回必要なのは regex 1行程度と、exact-output の小さな unit test 2ケースです。
## 判定REQUEST_CHANGES 相当 / needs-fix です。
Issue #2718 の方向性自体は正しいです。起票元の [PR #2693 のレビューコメント](#2693 (comment)) で指摘された gap は現在も
mainに存在し、GitHub 公式情報とも一致しています。GitHub は 2026年4月から installation token をghs_APPID_JWT形式へ段階移行し、新形式は約520文字・JWT由来の2つの.を含みます。GitHub が新旧双方を扱うため案内している regex はghs_[A-Za-z0-9\.\-_]{36,}です。Actions のGITHUB_TOKENも対象に含まれます。([GitHub Blog]1)ただし、現 Issue 契約のまま実装すると、「新形式を一応検出したが JWT の一部が残る」実装をテストが通してしまう余地があります。ここは実装前に直す価値があります。
Findings
[REDACTED]に置換された」ことを十分固定していないghs_fixture が0件P1 — 「完全 redaction」を明示的に固定すべき
現在の production code は以下です。
一方、新形式は概念的に、
です。GitHub 自身も token の内部構造へ依存せず opaque string として扱うよう求めています。([GitHub Blog]1)
ここで新規テストが例えば、
だけだと不十分です。
実際、このリポジトリの
scripts/summarize_agent_transcript.pyにある現行 regex:は典型的な新形式 token に対して、JWT の最初の
.までを<GITHUB_TOKEN>に変え、残りの payload/signature を残せます。つまり「元の完全な token は存在しない」「redaction marker は存在する」の両方を満たしながら情報を漏らせます。#2718 の AC2 は次のように強化するのが適切です。
テストも exact equality にすれば十分です。新しい harness や live credential test は不要です。
P1 — classic
ghs_regression が現在はテストされていない[current test file](https://github.com/squne121/loop-protocol/blob/main/scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py) を確認したところ、現時点で
ghs_literal は0件です。#2693 で追加された redaction tests はghp_fixture です。したがって現 AC3 の、
は証明になっていません。suite 全件 PASS でも、classic
ghs_を壊していれば検出できません。最低限、この2ケースだけ直接固定すれば十分です。
実装としては GitHub 推奨の新旧共通 pattern を既存 generic GitHub-token pattern より前に置くのが素直です。
後段の既存 pattern を残せば、従来の広めな defense-in-depth behavior も失いません。
P2 — AC1 Verification Command は現在の main でも PASS する
現在は、
rg -n "_SECRET_LIKE_PATTERNS" scripts/agent-guards/controlled_skill_mutation_exec.pyですが、
_SECRET_LIKE_PATTERNSは当然すでに存在します。つまりコードを1行も変更しなくても AC1 の verification が成功します。
source-text regex をさらに増やすより、AC1/AC2/AC4 は focused behavioral test へ統合する方が堅いです。例えば:
uv run pytest scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py \ -k 'redact_new_installation_token or redact_legacy_installation_token' -q全 suite の AC3:
はそのままでよいです。
P2 — #2718 外にも同じ format migration gap がある
Repository search では少なくとも次が見つかりました。
scripts/summarize_agent_transcript.pygh[opsur]_[A-Za-z0-9_]{20,}.claude/skills/agent-retrospective/scripts/persist_retrospective_run.py\bghs_[A-Za-z0-9]{20,}\b_の新形式を検知しない可能性が高い.claude/skills/issue-refinement-loop/scripts/compact_author_result.pyghs_[A-Za-z0-9]{36}ghs_APPID_JWTdetector として stale.claude/skills/impl-review-loop/scripts/get_ci_failed_log.pyghs_[A-Za-z0-9]{36,}自体は staleGitHub が推奨 regex を明示している以上、これらも技術的負債です。([GitHub Blog]2)
ただし、#2718 の Allowed Paths を拡張して一括修正するのは勧めません。今回の起票目的は #2693 の
_SECRET_LIKE_PATTERNSfollow-up で明確です。趣味開発のワークフローを重くしないなら、と分ける方が適切です。
関連状態
[PR #2693](#2693) は既に merged で、#2718 の起票根拠になった P2 follow-up と整合しています。[Issue #2686](#2686) では redactor regex 自体が明示的に Out of Scope だったため、別 Issue 化も正しいです。
#2718 自体には現時点でコメントはなく、関連する open PR も見つかりませんでした。Issue 本文が挙げている #1916 / #420 / #205 は open ですが、それぞれの番号に紐づく open PR は現在見つかっていないため、現時点で actual edit conflict を理由に着手を止める必要はありません。実装直前の再確認だけで十分です。
最小修正案
Issue を大きく書き換える必要はありません。次の3点を契約へ追加すれば実装へ進める品質になります。
[REDACTED]に置換され、JWT fragment が残らない」に強化する。ghs_の直接 regression fixture を要求する。rg "_SECRET_LIKE_PATTERNS"を削除し、新旧ghs_の focused pytest に置き換える。generic secret scanner、credential canary、live GitHub mutation、E2E security harness は #2718 には不要です。今回必要なのは regex 1行程度と、exact-output の小さな unit test 2ケースです。
squne121 commentedon Sep 22, 2026
推奨は、対象コメントを operator-selected human context として扱い、
issue-refinement-loopの canonical contract-update lane にそのまま投入することです。Allowed Paths は広げず、#2718 は controlled executor の focused fix のまま維持します。GitHub の現行案内でもghs_APPID_JWT、約520文字、.を含む stateless token、および新旧両対応 regexghs_[A-Za-z0-9\.\-_]{36,}は確認できます。([GitHub Blog]1)特に、レビューコメントの「新規 test 名を
-kで指定」という VC 案はそのまま採用させない方がよいです。現在の repo 契約では、未作成テストを-kで選んで pytest exit 5 になる形は baseline failure として不適切です。fresh なbody-authoring.mdと VC compiler に従って canonical VC shape へ修正させます。対象リポジトリは
squne121/loop-protocolです。Issue #2718 と、以下のコメントを対象に、現在の
mainに存在する最新版のissue-refinement-loopを実行してください。Issue:
#2718
operator-selected anchor comment:
#2718 (comment)
すでに ClaudeCode は auto mode で起動済みです。この作業中の routine な承認確認は不要です。Issue 本文の refinement、deterministic repair、canonical contract update、調査、レビュー再実行、必要な controlled GitHub mutation、終了コメントまで、現在の repository contract が自動継続を許可する範囲では人間確認を挟まず進めてください。
Claude Code の permission mode 自体を変更したり、guards / controlled executor / Allowed Paths を迂回したりしないでください。
--dangerously-skip-permissions等を追加する必要もありません。既存 auto mode と repository-owned workflow をそのまま使ってください。最初に fresh state を読む
作業開始時点の
main/ default branch を fresh に確認し、少なくとも以下を最新版から読み直してください。CLAUDE.md.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/issue-refinement-loop/references/semantic-design-review.md.claude/skills/issue-refinement-loop/references/follow-up-materialization.md.claude/skills/issue-refinement-loop/references/termination-policy.mddocs/dev/dor.md必要になった reference は progressive disclosure で追加読込してください。過去セッションの skill 内容やこのプロンプトに書かれた手順が current skill と衝突する場合、fresh に読んだ repository contract を正本としてください。
Issue #2718 の current body、全コメント、関連 PR #2693、Issue #2686、現在の対象ファイル・テスト、open PR / overlap 状態も fresh readback してください。
既に得た過去のレビュー結果や body SHA を fresh evidence の代用にしないでください。
anchor comment の扱い
指定コメントは、この実行では operator が明示的に選択した human-context anchor として扱ってください。
したがって origin lane は unlabeled
with_anchorやwith_agent_reportではなく、current skill が定義するpreflight.run.with_human_context相当の canonical profile を使用してください。これは「物理的に人間が書いたことが証明済み」という意味ではありません。repository の Accepted Trust Model に従い、
operator_asserted_human_contextとして扱ってください。URL、repo、issue number の binding を検証し、raw anchor body を planner input や issue-editor 入力へ直接流さず、current canonical normalization / artifact boundary を守ってください。
この anchor の内容を理由に「確認してよいですか」と再度人間へ戻さないでください。コメント自体が今回選択された refinement directive です。
SubAgent の使用と completion join
root/main control-plane から、current skill が要求または許可する sibling SubAgent を使用してください。
少なくとも anchor comment の fact-check / current-main 調査では
codebase-investigatorを使用し、Issue #2718 の現状、対象 production code、対象 test、PR #2693 / Issue #2686 の起票経緯、Allowed Paths overlap、関連 open PR、anchor findings の事実性を read-only で確認してください。SubAgent を起動したら、必ずその作業完了を待ち、実際の出力を受け取ってから次の routing に進んでください。spawn しただけで完了扱いしないでください。
外部仕様の確認が planner / web-research routing 上 applicable なら
web-researcherを sibling SubAgent として使用してください。GitHub App installation token の現行仕様は GitHub 公式 Docs / Changelog を優先し、2026年の最新状態を確認してください。その SubAgent の完了も必ず join してください。Step 2.5 semantic design review が applicable なら、current
semantic-design-review.mdに従ってissue-design-reviewerを fresh sibling SubAgent として起動し、pinned body のみをレビューさせ、completion join barrier を満たしてから record/join してください。一方、canonical Step 2 は current skill の root-owned pipeline を使用してください。
issue-reviewerSubAgent を古い方式で起動しないでください。Step 2 のrun_root_review_pipeline.py produceが current contract で background launch + mandatory completion join を要求している場合、その通り実行し、background task の完了 JSON を取得してからcanonical_step2_routeを consume してください。SubAgent 自身にさらに SubAgent を spawn させる nested delegation は行わせないでください。必要な delegation は root/main control-plane から sibling として行ってください。
anchor finding の fact-check
anchor comment の指摘を blind copy しないでください。current main と外部一次資料で fresh に検証してください。
特に確認する対象は、現在の
_SECRET_LIKE_PATTERNSが新形式ghs_APPID_JWTを完全には扱えないこと、新形式 token 全体を単一[REDACTED]に置換しない partial-redaction failure が成立し得ること、現在の対象 test file に classicghs_regression fixture が十分存在するか、現在の AC1 Verification Command が baseline から trivially pass していないか、です。GitHub 公式仕様を確認するときは、token 内部構造へ不要に依存する独自 regex を考案せず、GitHub が現在公開している形式・推奨事項を根拠にしてください。
refinement の期待方向
#2718 自体の目的は維持してください。repository-wide secret scanner 化や security subsystem 新設へ scope expansion しないでください。
Allowed Paths は原則として現在の2ファイルのまま維持してください。
scripts/agent-guards/controlled_skill_mutation_exec.pyscripts/agent-guards/tests/test_controlled_skill_mutation_exec.pyanchor の P1 findings は Issue contract に反映してください。
AC2 は、「新形式 token を含む
before <token> afterを_redact_secret_like_tokens()に渡した結果が exactlybefore [REDACTED] afterになる」ことを contractually 固定する方向で改善してください。元 token 全体が消えただけでは不十分で、APPID、JWT header / payload / signature 等の fragment を残す partial redaction も不合格になるようにしてください。AC3 は、classic / legacy
ghs_token の直接 regression coverage を要求し、単に既存 suite 全件 PASS だけで backward compatibility を主張しないよう改善してください。AC1 / AC4 は、新形式 support とそれを直接検証する pytest coverage が対応する形にしてください。
ただし、anchor comment に書かれた Verification Command の例を無条件に転記してはいけません。
Verification Commands の重要条件
fresh
docs/dev/dor.md、create-issue の body-authoring guidance、vc_baseline_shape_compiler.py、baseline_vc_preflight.pyの current contract に従って、実装前 baseline と実装後 verification の双方で canonical な VC にしてください。特に、まだ存在しない test function を既存 test fileに対する
pytest -k <new-test-name>だけで選択する形は避けてください。baseline で「all deselected / no tests collected」になり exit 5 を返す形をexpected_baseline_failと誤認してはいけません。新しい test node-id を VC に使う場合は、current repository が許可している canonical missing-test / missing-node-id shape と必要な
# baseline-expect:annotation を fresh guidance から判断してください。既存 Allowed Path test file に test を追加する今回のケースに適用可能な escape hatch が current main に存在するなら、それを正確に使用してください。既存 suite / regression gate のように baseline でも PASS すべき command は、必要なら current semantics に従って
# baseline-expect: passを使用してください。rg -n "_SECRET_LIKE_PATTERNS" ...のように実装前から成功する command を、新規挙動の baseline-fail VC として残さないでください。AC と VC の番号・意味対応を崩さないでください。
contract update
preflight.run.with_human_contextの fresh result が trusted contract patch /contract_update_requiredを返した場合、人間へ確認せず current canonicalcontract_update.run.with_human_contextlane へ進めてください。read-only investigation evidence transport が必要になった場合は、current anchor handling contract に従い、preflight で使用した同一 transport manifest を mutation phase に引き継いでください。勝手に別 manifest を再生成しないでください。
section-bound patch では表現できず
NEXT_ACTION: issue_editor_requiredになった場合も、人間に Issue 本文の手書き修正を依頼せず、current Step 4issue-editor/ controllededit-issueroute へ進めてください。Issue body mutation 後は必ず fresh body/title readback、fresh preflight、fresh Step 2、必要なら fresh Step 2.5 semantic review、fresh readiness を実行してください。mutation 前の approval / body SHA / review result を再利用しないでください。
loop policy
max_iterationsは current skill の既定値 3 を使用してください。独自に増やさないでください。needs-fixで iteration の余裕がある場合は routine approval を求めず自動継続してください。deterministic repair / deterministic structural repair が canonical router から返った場合も、人間確認なしで repository-owned consumer を使用してください。
SubAgent が advisory な
human_review_requiredを自己申告しただけで停止権限を持たない場合は、current contract に従って warning/evidence として保持し、勝手に hard stop へ昇格させないでください。逆に、current canonical router が genuine
human_judgment_required、operator/runtime intervention、integrity failure、max-iterations、destructive / permission / external-service / issue-split boundary 等の hard stop を返した場合は、それを隠して approve 扱いしないでください。#2718 外で見つかる ghs migration gap
anchor comment が指摘している他 redactor / detector の
ghs_APPID_JWTgap は調査対象には含めて構いませんが、#2718 の Allowed Paths に押し込まないでください。scripts/summarize_agent_transcript.py.claude/skills/agent-retrospective/scripts/persist_retrospective_run.py.claude/skills/issue-refinement-loop/scripts/compact_author_result.py.claude/skills/impl-review-loop/scripts/get_ci_failed_log.pyその他 fresh search で判明した同種箇所
これらは #2718 の focused contract とは分離してください。
current
follow-up-materialization.mdが follow-up request の materialization を要求する場合は、dedupe_key ベースで既存 open Issue を fresh search してから canonical create/reuse/skip route を使用してください。単なる title similarity で dedupe しないでください。current policy 上 materialize 対象でなければ
note_only_observationsとして残してください。この repository-wide observation を理由に #2718 の refinement 自体を不必要に肥大化させないでください。
scope overlap
#2718 本文に記録されている #1916 / #420 / #205 との Allowed Paths overlap と、現在の open PR を fresh に再確認してください。
単に Allowed Paths が重なるという過去の metadata だけで自動停止せず、current skill の overlap routing に従ってください。
actual edit conflict や現在進行中の同一ファイル変更が無ければ、古い overlap note だけを理由に routine human escalation しないでください。
実装への越境
このタスクの主目的は
issue-refinement-loopです。refinement Step の途中で #2718 の production implementation を独自に開始しないでください。最終的に current skill が
implementation_ready/ approved termination に到達した場合は、currentissue-refinement-loopの Step 5 / root-owned synchronous transition contract を fresh に確認してください。current skill が approved implementation Issue から
impl-review-loopを同一 turn で起動することを必須としている場合だけ、その canonical transition に従ってください。このプロンプト独自の判断で handoff を抑止したり、逆に current skill が要求していない implementation を開始したりしないでください。禁止事項
raw
gh issue edit/ raw ad-hoc mutation で controlled transaction を迂回しないでください。anchor comment 本文をそのまま issue-editor prompt にコピーしないでください。
issue-reviewerlegacy SubAgent を canonical Step 2 に復活させないでください。新規 security harness、credential canary、live real-token test、live GitHub mutation test を #2718 に追加しないでください。
実 credential を生成・表示・ログ出力しないでください。テストは明確な fake token fixture のみ使用してください。
force push、履歴破壊、無関係ファイル変更、guards の無効化は行わないでください。
routine iteration ごとに人間へ承認を求めないでください。
完了条件
Issue body が anchor findings を反映した focused contract になり、current canonical deterministic review が approve、必要な semantic review が clear/approved、fresh
CONTRACT_REVIEW_RESULT_V1.status == go、freshness gate が成立するところまで refinement loop を継続してください。終了コメントや handoff result も current skill の canonical publisher / schema を使用してください。
作業終了時は最低限、以下を簡潔に報告してください。
canonical hard stop に到達した場合も「人間が確認してください」だけで終わらせず、何が自動解決不能だったか、current body SHA、完了済み phase、SubAgent completion 状態、fresh review/readiness evidence、残 blocker、canonical termination cause を残してください。
まず fresh
mainの readback、currentissue-refinement-loopの読込、指定 anchor の context binding から開始してください。この版は、コメントの3点を反映するだけでなく、pytest
-kの baseline exit-5 問題まで refinement loop 自身に解決させる構成にしています。squne121 commentedon Sep 22, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 22, 2026
issue-refinement-loop: approved
Issue #2718 の refinement loop が完了しました。
codebase-investigator/web-researcherによる fact-check 済み)VERDICT: approve(blocking_issues 0件)semantic_review_applicable: false)CONTRACT_REVIEW_RESULT_V1.status == "go"(readiness: go / blockers: pass / product_spec: pass / vc_preflight: pass、body_sha256 一致確認済み)反映した anchor findings
ghs_<APP_ID>_<JWT>トークンが既存_SECRET_LIKE_PATTERNSで完全に unmatched(fact-check済み) → AC1/AC2 を新設し、完全redactionを直接検証する pytest を要求ghs_トークンの regression fixture が0件(fact-check済み) → AC3 に classicghs_専用の直接regressionテストを追加要求_SECRET_LIKE_PATTERNS名ではなくghs_リテラル存在チェックへ変更し差分性を確保root-owned synchronous entry transition
root_entry_router.py::run_root_transition()の結果:route: invoke_impl_review_loop(reason: fresh_review_go_live_equality、reviewed/observed body sha256 一致・base sha 一致)。同一 turn 内でimpl-review-loopを起動します。squne121 commentedon Sep 22, 2026
implement-issue: 実装完了 (2026-09-22T01:39:58Z)
.claude/worktrees/issue-2718-ghs-installation-token-redactworktree-issue-2718-ghs-installation-token-redactsqune121 commentedon Sep 22, 2026
impl-review-loop: 完了 (2026-09-22T02:05:00Z)
fix: PR #2722 review指摘を反映し新形式ghs_トークンpattern説明と閾値を修正 (#2718)
fix: 新形式GitHub App installation token(ghs_APPID_JWT)を完全redactする (#2722)
fix: PR #2751 review指摘を反映しfixture/precedent attribution/用語を修正する (#2727)
fix: persist_retrospective_run.py の _TOKEN_PATTERNS を新形式 ghs_ App ins…