Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "secret-pattern migration Issue の authoring/refinement で consumer semantics 混同と false-pass Verification Commands を検査する regression/gate を設計し、後続 implementation Issue が起票可能な状態にする"
change_kind: research-onlyParent Issue
none(単独調査。Issue #2733 の OWNER review で観測した系統的パターンへの follow-up)
Outcome
Issue #2733(ghs_ App installation token 対応)の issue-refinement-loop 実行中に OWNER review(https://github.com/squne121/loop-protocol/issues/2733#issuecomment-5834140768)で実証された 4 種類の系統的な事実誤認・混同パターン(consumer semantics 混同、false-pass Verification Commands、外部仕様の未検証断定)を整理し、同種の secret-pattern migration Issue(precedent 丸写しのリスクを持つ Issue/PR 群)の authoring/refinement 時にこれらを検査する具体的な regression/gate 案(issue-refinement-loop の Step 2 deterministic checker 拡張、または review-issue checklist 拡張のいずれか、もしくは両方)を決定し、その gate を実装する implementation Issue が起票可能な状態にする。
In Scope
- Issue 実装: secret_exposure_scanner.py の GitHub token detector パターンを新形式 ghs_ App installation token に対応させる #2733 の OWNER review コメントで指摘された 4 パターンの構造的原因を整理する:
- redactor(
.sub()順次適用、specific-before-general 前提)向けの pattern 配置設計を detector(finditer()全 rule 評価、(rule_id, sha256_prefix)dedup key)へ無検証で転用したことによる二重 finding リスク - Verification Commands が baseline(現行 main、実装差分なし)で既に成功する false-pass VC になっていたこと
[A-Za-z0-9._-]を base64url charset と誤記述していたこと(RFC 4648 base64url alphabet は[A-Za-z0-9-_]のみで.は含まれず、RFC 7515 JWS の segment delimiter である)- GitHub 推奨 regex
ghs_[A-Za-z0-9._-]{36,}を「新形式専用 matcher」と誤断定していたこと(実際は新旧ghs_共通の broad matcher)
- redactor(
- sibling Issue/PR(実装: 既存 redactor が新形式 GitHub App installation token (ghs_APPID_JWT) を認識しない #2718, fix: 新形式GitHub App installation token(ghs_APPID_JWT)を完全redactする #2722, 実装: summarize_agent_transcript.py の GitHub token redaction パターンを新形式 ghs_ App installation token に対応させる #2725, 実装: compact_author_result.py の GitHub token 検出パターンを新形式 ghs_ App installation token に対応させる #2726, 実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727, 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728, fix: summarize_agent_transcript.py の GitHub token redaction を新形式 ghs_ App installation token に対応させる #2735, fix: compact_author_result.pyのghs_パターンを新形式GitHubトークンに対応させる #2746, fix: persist_retrospective_run.py の _TOKEN_PATTERNS を新形式 ghs_ App installation token に対応させる #2751)を対象に、同種パターンが再流入していないかの sample 確認を行う(全数走査は必須としない)
- 上記を防ぐための regression/gate 案を最低 1 つ具体化する(例: issue-refinement-loop Step 2 deterministic checker への consumer-semantics-precedence チェック追加、review-issue checklist への「baseline VC 事前実行」項目追加、外部仕様主張の一次資料リンク必須化など)
- 採用する gate 案を実装する implementation Issue を起票し、本 Issue からリンクする
Out of Scope
- Issue 実装: secret_exposure_scanner.py の GitHub token detector パターンを新形式 ghs_ App installation token に対応させる #2733 自体の implementation scope への変更・再介入(実装: secret_exposure_scanner.py の GitHub token detector パターンを新形式 ghs_ App installation token に対応させる #2733 は既に契約修正済みで別軸)
- 既存 secret detector(
secret_exposure_scanner.py等)・redactor(_SECRET_LIKE_PATTERNS等)の実装変更そのもの - 新規 secret scanner サブシステムの新設
- sibling Issue/PR 群(実装: 既存 redactor が新形式 GitHub App installation token (ghs_APPID_JWT) を認識しない #2718 等)の個別の contract 修正作業(本 Issue はパターン整理と gate 設計のみ)
Acceptance Criteria
- Issue 実装: secret_exposure_scanner.py の GitHub token detector パターンを新形式 ghs_ App installation token に対応させる #2733 の OWNER review で観測された 4 パターンそれぞれについて、構造的原因(redactor/detector の consumer semantics 差異、false-pass VC、外部仕様未検証断定)が本 Issue 本文に整理されている
- regression/gate 案が最低 1 つ具体化され、issue-refinement-loop の Step 2 deterministic checker 拡張か review-issue checklist 拡張のいずれかとして本 Issue 本文に記載されている
- 採用した gate 案を実装する implementation Issue が起票され、本 Issue がそれを link している
- 本 Issue は close 可能、もしくは追加調査要件が明示されている
Verification Commands
AC1(regression/gate 実装用の後続 implementation Issue が起票され本文が存在することを確認する):
gh issue view <new-implementation-issue-number> --repo squne121/loop-protocolAC2(本 Issue 本文に整理結果が記載されていることを確認する):
gh issue view <this-issue-number> --repo squne121/loop-protocol --json body --jq '.body | test("consumer semantics")'Allowed Paths
- 読み取り専用。リポジトリ変更なし(既定)
Stop Conditions
- Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
- Allowed Paths 外への書き込みを試みた場合は即停止
- 権限不足(permission denied)により操作が完了できない場合は即停止
- 成果物の書き込みに失敗した場合(I/O エラー等)は即停止
Handoff Contract
Current Objective: secret-pattern migration Issue authoring/refinement 向けの consumer-semantics/false-pass-VC regression gate 案を確定するBounded Current Context: Issue 実装: secret_exposure_scanner.py の GitHub token detector パターンを新形式 ghs_ App installation token に対応させる #2733 OWNER review(comment ID 5834140768)で観測された 4 パターン、sibling Issue 群(実装: 既存 redactor が新形式 GitHub App installation token (ghs_APPID_JWT) を認識しない #2718, fix: 新形式GitHub App installation token(ghs_APPID_JWT)を完全redactする #2722, 実装: summarize_agent_transcript.py の GitHub token redaction パターンを新形式 ghs_ App installation token に対応させる #2725-2728, fix: summarize_agent_transcript.py の GitHub token redaction を新形式 ghs_ App installation token に対応させる #2735, fix: compact_author_result.pyのghs_パターンを新形式GitHubトークンに対応させる #2746, fix: persist_retrospective_run.py の _TOKEN_PATTERNS を新形式 ghs_ App installation token に対応させる #2751)Open Questions: gate を issue-refinement-loop Step 2 checker と review-issue checklist のどちらに実装するか(両方の可能性を含む)Next Action: 採用案を実装する implementation Issue の起票Artifact Refs: 実装: secret_exposure_scanner.py の GitHub token detector パターンを新形式 ghs_ App installation token に対応させる #2733 (comment)
Activity