Skip to content

実装: .gemini/settings.json に Serena MCP excludeTools denylist を追加し local_asset_research preflight を通過させる #140

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: ".gemini/settings.json の mcpServers.serena に excludeTools denylist を追加し、local_asset_research preflight を通過させる"
change_kind: config

Parent Issue

なし(単独改善)

Parent Goal Ref

  • Goal: gemini-cli-headless-delegation の local_asset_research プロファイルが preflight を通過し、codebase-investigator SubAgent が Gemini に委譲できる状態を実現する
  • Desired Destination: .gemini/settings.json に excludeTools が追加され、preflight_gemini_headless.py の dangerous tool denylist チェックが PASS する

Current Validated Scope

  • .gemini/settings.json の mcpServers.serena に excludeTools 配列を追加する(SERENA_DANGEROUS_TOOLS 21 ツールを列挙)

Remaining Parent Gaps

Outcome

.gemini/settings.json が更新され、mcpServers.serena.excludeTools に SERENA_DANGEROUS_TOOLS(21 ツール)が列挙された状態で、preflight_gemini_headless.py の local_asset_research dangerous tool denylist チェックが PASS する。

Runtime Verification Applicability

  • decision: immediate
  • reason: .gemini/settings.json に excludeTools を追加した後、preflight_gemini_headless.py を実行することで denylist チェックの PASS/FAIL を本 Issue スコープ内で即時検証できる。
  • if immediate: AC2 が runtime-verification AC となる。VC に SKIP exit 77 / fallback FAIL を含める。証跡(preflight 実行ログ)を PR に添付する。

Background

preflight_gemini_headless.py L154-156 は .gemini/settings.json の mcpServers.serena.excludeTools が SERENA_DANGEROUS_TOOLS(21 ツール)をすべて含むことを検証する。

現在の .gemini/settings.json には includeTools(read-only 許可リスト: 6 ツール)は存在するが、excludeTools フィールドが存在しない。このため local_asset_research プロファイルを使うすべての呼び出しが preflight fail となり、codebase-investigator SubAgent は常に委譲不可で fail-close される。

2026-05-21 の issue-refinement-loop(Issue #100 対象)実行中に codebase-investigator SubAgent が preflight 失敗で起動できず、main session が直接ファイル調査を行わざるを得なかった。

Issue #101 は preflight_gemini_headless.py の per-profile 検証化を扱っているが、.gemini/settings.json の変更は明示的に Out of Scope・Stop Condition に設定されている。本 Issue がその gap を埋める。

関連:

Precondition

  • .gemini/settings.json が本リポジトリの repository-tracked ファイルとして存在すること
  • mcpServers.serena キーが存在していること(現在 command / args / trust / includeTools の 4 フィールドを確認済み)

In Scope

  • .gemini/settings.json の mcpServers.serena に excludeTools 配列を追加し、以下の 21 ツールを列挙する:
    • activate_project, create_text_file, delete_lines, execute_shell_command
    • insert_after_symbol, insert_at_line, insert_before_symbol, prepare_for_new_conversation
    • read_file_content, read_memory, remove_project, replace_lines
    • replace_regex, replace_symbol_body, restart_language_server, switch_modes
    • think_about_collected_information, think_about_task_adherence, think_about_whether_you_are_done
    • write_file, write_memory

Out of Scope

Known Risk

  • SERENA_DANGEROUS_TOOLS(21 ツール)のツール名は本リポジトリの preflight_gemini_headless.py L49-71 に定義されたものであり、Serena upstream の最新ツール集合とは一部乖離している可能性がある(例: denylist 内 read_file_content と公式 read_file の乖離)。この denylist はあくまで本リポジトリの preflight 契約に対するものであり、Serena upstream の公式ツール定義の網羅的な excludeTools ではない。

Acceptance Criteria

  • AC1: .gemini/settings.json の mcpServers.serena に excludeTools フィールドが存在し、SERENA_DANGEROUS_TOOLS 21 ツールをすべて含む
  • AC2: preflight_gemini_headless.py の dangerous tool denylist チェック(L154-156)が、更新後の .gemini/settings.json に対して denylist / excludeTools 系エラーを出力しない
  • AC3: .gemini/settings.json の mcpServers.serena.trust が false であること(既存値が変更されていない)
  • AC4: .gemini/settings.json の mcpServers.serena.includeTools が read-only 6 ツールのみであること(既存値が変更されていない)
  • AC5: 残余エラー(denylist / excludeTools 系以外)がある場合は、PR 本文の Known remaining preflight errors セクションに明示する

Verification Commands

# AC1: excludeTools の存在と21ツール全含有確認
$ python3 -c "
import json
s = json.load(open('.gemini/settings.json'))
exclude = set(s['mcpServers']['serena'].get('excludeTools', []))
required = {'activate_project','create_text_file','delete_lines','execute_shell_command',
  'insert_after_symbol','insert_at_line','insert_before_symbol','prepare_for_new_conversation',
  'read_file_content','read_memory','remove_project','replace_lines','replace_regex',
  'replace_symbol_body','restart_language_server','switch_modes',
  'think_about_collected_information','think_about_task_adherence',
  'think_about_whether_you_are_done','write_file','write_memory'}
missing = required - exclude
print('PASS: AC1' if not missing else f'FAIL: missing={sorted(missing)}')
"

# AC2: preflight の denylist チェックがエラーなしで通過
$ uv run python3 .claude/skills/gemini-cli-headless-delegation/scripts/preflight_gemini_headless.py \
  --output-file /tmp/preflight_ac2_result.json 2>&1 | head -5
$ python3 -c "
import json
r = json.load(open('/tmp/preflight_ac2_result.json'))
errs = [e for e in r.get('errors', []) if 'denylist' in e or 'excludeTools' in e]
print('PASS: AC2' if not errs else f'FAIL: {errs}')
"

# AC3: trust が false であること(既存値保持確認)
$ python3 -c "
import json
s = json.load(open('.gemini/settings.json'))
trust = s['mcpServers']['serena'].get('trust')
print('PASS: AC3' if trust is False else f'FAIL: trust={trust!r}')
"

# AC4: includeTools が read-only 6 ツールのみであること(既存値保持確認)
$ python3 -c "
import json
s = json.load(open('.gemini/settings.json'))
include = set(s['mcpServers']['serena'].get('includeTools', []))
expected = {'find_file','find_referencing_symbols','find_symbol',
  'get_symbols_overview','list_dir','search_for_pattern'}
print('PASS: AC4' if include == expected else f'FAIL: actual={sorted(include)} expected={sorted(expected)}')
"

# AC5: 残余エラーが PR 本文に明示されているか(VC コマンドなし、PR 本文確認)
# → 実装者が PR 本文の「Known remaining preflight errors」セクションに記載することで満たす。自動検証不要。

Allowed Paths

  • .gemini/settings.json

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

なし

Scope Delta(任意)

N/A

Delivery Rule

  • 1 Issue = 1 PR
  • worktree: git worktree add による独立 worktree で実装する
  • Draft PR 既定: PR は Draft で作成し、AC / VC 全通過後に Ready にする

Activity

  1. added
    enhancement
    phase/implementation
    state/queued
    agent/implementer
    on May 21, 2026
  2. squne121 commented on May 21, 2026

    @squne121
    OwnerAuthor

    create-issue transaction partial-failure

    Issue: #140
    Failure stage: label-readback
    Message: label read-back mismatch

    Requested:

    • labels: enhancement,phase/implementation,state/queued,agent/implementer
    • parent: (none)
    • dependencies: (none)
      Completed steps: create, label

    Failure context:
    matching_issue_numbers=[140]
    issue_number=140

    Recovery hint: label-readback failed for #140.
    Manual re-apply command (idempotent: yes):
    gh issue edit 140 --repo squne121/loop-protocol --add-label
    Verify:
    gh issue view 140 --repo squne121/loop-protocol --json labels

    Please recover deterministically before re-running the create issue transaction.

  3. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    結論

    Issue #140 は 「Serena MCP の dangerous tool denylist 欠落を埋める最小修正」としては妥当です。ただし、類似Issueをまとめて実装するなら、#140 と #101 を同じPRに混ぜるのは原則非推奨です。#140 は .gemini/settings.json の設定配布物、#101 は preflight_gemini_headless.py の制御ロジック変更、#100 は PR #143 で既にマージ済みです。#71 起点の障害連鎖としては関連していますが、変更対象・検証粒度・失敗時のblast radiusが違います。

    最大の懸念は、私が確認できた main 上では .gemini/settings.json が GitHub 上で取得できず、リポジトリ検索にも掛からなかった点です。Issue #140 は「現在の .gemini/settings.json には includeTools はあるが excludeTools がない」という前提で書かれていますが、ファイルがリポジトリ管理されていないなら、Allowed Paths: .gemini/settings.json は PRで完了できない可能性があります。ここは実装着手前に必ず確認すべきです。

    敵対的レビュー

    Blocker: .gemini/settings.json の所在が契約上あいまい

    Issue #140 は .gemini/settings.json だけを Allowed Path にしていますが、対象ファイルがリポジトリに存在しない/ローカル専用である場合、実装PRは「新規作成」になります。これは既存設定に excludeTools を足すだけのIssue本文と意味が変わります。さらに Gemini CLI の設定は、ユーザー設定 ~/.gemini/settings.json、プロジェクト設定 .gemini/settings.json、システム設定など複数階層で解決され、プロジェクト設定はプロジェクト内だけに適用されます。つまり、どの層に配布する設定なのかを明示しないと、PRで直した設定が実運用に効く保証がありません。([Gemini CLI]1)

    修正提案: #140 の Precondition に次を追加してください。

    Precondition:
    - `.gemini/settings.json` が repository-tracked file として存在すること。
    - 存在しない場合は、本Issueでは新規作成可否を人間判断へ戻す。
    - user-level `~/.gemini/settings.json` ではなく、project-level `.gemini/settings.json` を正本として扱う。

    High: excludeTools 追加は正しいが、過信すると危険

    Gemini CLI の MCP 設定には includeTools と excludeTools があり、excludeTools は includeTools より優先されるため、read-only allowlist に加えて dangerous tool denylist を置くのは防御層として正しいです。MCPサーバー単位の mcp.allowed / mcp.excluded もあり、サーバー名 serena を明示許可する設計自体も筋は通っています。([Gemini CLI]2)

    ただし、Issue #140 が列挙する21ツールは、現在の preflight_gemini_headless.py の SERENA_DANGEROUS_TOOLS に合わせた リポジトリ内契約です。Serena 側の公開ドキュメントでは read_file、replace_content、delete_memory、edit_memory などが見え、Issue/コード側の read_file_content、replace_regex、switch_modes、think_about_* と完全には一致しません。これは「preflight を通すための固定denylist」と「実際にSerenaが現在公開しているツール集合」が乖離し得ることを示します。 ([OraiOS]3)

    修正提案: #140 は固定denylist追加だけでなく、最低限この注記をPR本文に要求すべきです。

    Known Risk:
    - `SERENA_DANGEROUS_TOOLS` は本リポジトリの preflight 契約に対する denylist であり、
      Serena upstream の最新ツール集合そのものを完全に表すものではない。
    - Serena upstream の tool naming drift は別Issueで検出・更新する。

    High: #140 だけでは “Gemini委譲が動く” とは言えない

    現在の run_preflight() は、_validate_local_asset_research_settings() を無条件に実行し、local_asset の設定エラーがあると failure_reason を設定して即 return します。つまり #101 が未解決のままだと、github_research / grounded_research / no_tools まで local_asset の設定不備に巻き込まれる構造が残ります。

    #140 は local_asset の denylist欠落だけを直します。一方 #101 は「local_asset の不備で preflight 全体を落とさない」ためのロジック変更です。この2つは関連していますが、同じPRにすると「設定変更で直ったのか」「preflight制御変更で隠れただけなのか」が検証で分離できなくなります。

    Medium: #100 / PR #143 は再実装不要。ただし未解決リスクは残る

    #100 は PR #143 でマージ済みです。内容は、context_files のファイルパス限定、wrapper失敗後の直接Read/Grep/Glob/Bash禁止、Serena MCP失敗時の setup_check.py --json 切り分け、GEMINI_API_KEY 未設定を単独の委譲不可理由にしないことの明文化です。

    ただし PR #143 自身が follow-up として、#101未解決、Bash tool の技術的ガード未実装、VCのgrep alternation問題を残しています。したがって #140 実装時に #100 系のドキュメントを再修正するより、#101 と Bash hook guard を別Issue群として扱う方がよいです。

    類似Issueをまとめるなら、この分け方が安全

    推奨PR構成

    PR A: #140 — Serena MCP settings materialization

    対象:

    • .gemini/settings.json
    • 可能なら settings template / README / fixture も含める。ただし Allowed Paths を拡張する必要あり。

    目的:

    • mcp.allowed == ["serena"]
    • mcpServers.serena.trust == false
    • includeTools が read-only 6ツールのみ
    • excludeTools が SERENA_DANGEROUS_TOOLS 21件を全包含
    • denylist関連preflight errorが消える

    PR B: #101 — preflight per-profile化

    対象:

    • .claude/skills/gemini-cli-headless-delegation/scripts/preflight_gemini_headless.py
    • .claude/skills/gemini-cli-headless-delegation/tests/test_preflight_gemini_headless.py

    目的:

    • local_asset の設定不備を warning に降格
    • github_research / grounded_research / no_tools を巻き込まない
    • gh_cli と同様の profile-specific health にする

    PR C: PR #143 follow-up — direct investigation 技術ガード

    対象候補:

    • .claude/hooks/
    • agent permission/hook 設定
    • codebase-investigator の Bash直接使用を wrapper呼び出しだけに制限

    これは #140 とは混ぜない方がよいです。設定denylistの話ではなく、SubAgent逸脱防止のランタイムガードです。

    #140 のIssue本文を高品質化するなら追加すべきAC

    現在の AC2 は「denylist / excludeTools を含む errors がない」だけを見ます。これは狭すぎます。command、trust、includeTools、prompt stdin など別の local_asset エラーが残っても、Issueタイトルの「preflight を通過」に対して曖昧です。

    置き換え案:

    Acceptance Criteria
    
    - [ ] AC1: project-level `.gemini/settings.json` が repository-tracked file として存在する。
    - [ ] AC2: `.gemini/settings.json.mcp.allowed` が `["serena"]` である。
    - [ ] AC3: `mcpServers.serena.trust` が `false` である。
    - [ ] AC4: `mcpServers.serena.includeTools` が `SERENA_READ_ONLY_TOOLS` 6件を全包含し、dangerous tool を含まない。
    - [ ] AC5: `mcpServers.serena.excludeTools` が `SERENA_DANGEROUS_TOOLS` 21件を全包含する。
    - [ ] AC6: `preflight_gemini_headless.py` 実行結果の `local_asset_research.errors` に `denylist` / `excludeTools` 系エラーが存在しない。
    - [ ] AC7: denylist以外の local_asset エラーが残る場合、PR本文に `Known remaining preflight errors` として明示し、#101または別Issueへ参照する。

    実装判断

    私なら、#140単体は実装してよいが、PR名と説明を「preflight完全復旧」ではなく「Serena MCP denylist設定追加」に限定します。#101 と同時にやるなら、Issue #140 を直接拡張するのではなく、上位Issueまたは統合PR契約を作り、Allowed Paths とACを明示的に統合します。

    最も危険なのは、#140 + #101 + PR #143 follow-up を「Gemini委譲をまとめて直す」として一括実装することです。その場合、設定、preflight制御、SubAgent逸脱防止、Serena upstream drift が一つのPRに混ざり、レビュー不能になります。
    今回の適切な統合単位は #140 + .gemini/settings.json の配布・検証整備までです。#101 は次PRに分けるべきです。

  4. removed
    state/queued
    on May 23, 2026
  5. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    Issue 本文更新 — issue-reviewer フィードバック反映

    issue-reviewer からの reviewer_feedback_text に基づき、以下の変更を本文に反映しました。

    blocking 対応

    C9: Runtime Verification Applicability セクション追加

    • Outcome と Background の間に ## Runtime Verification Applicability セクションを追加
    • decision: immediate、理由: preflight_gemini_headless.py を実行することで denylist チェックの PASS/FAIL を本 Issue スコープ内で即時検証できる
    • AC2 が runtime-verification AC となる旨、SKIP exit 77 / fallback FAIL の要件、証跡の PR 添付義務を明記

    non-blocking 改善

    Precondition セクション追加

    • Background の後、In Scope の前に ## Precondition セクションを追加
    • .gemini/settings.json が repository-tracked ファイルとして存在すること、mcpServers.serena キー(command / args / trust / includeTools の 4 フィールド)が存在することを前提条件として明示

    AC2 の明確化

    • 「error を出力しない」から「denylist / excludeTools 系エラーを出力しない」に限定

    AC 拡充(AC3 / AC4 / AC5 追加)

    • AC3: trust が false であること(既存値の保持確認)
    • AC4: includeTools が read-only 6 ツールのみであること(既存値の保持確認)
    • AC5: 残余エラーは PR 本文の Known remaining preflight errors に明示すること
    • AC2 に <!-- runtime-verification: true --> マーカーを追加

    Known Risk セクション追加

    • Out of Scope の後に ## Known Risk セクションを追加
    • SERENA_DANGEROUS_TOOLS のツール名と Serena upstream 公式ツール名の乖離リスク(例: read_file_content vs read_file)を注記
  6. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    VC 追補: AC3 / AC4 / AC5 対応コマンドを追加

    変更経緯

    レビューフィードバック(blocking issue C5)により、## Verification Commands セクションに AC3〜AC5 の検証コマンドが欠落していることが指摘された。

    • AC3(trust フィールドの既存値保持)
    • AC4(includeTools の既存値保持)
    • AC5(残余エラーの PR 本文明示)

    変更内容

    • AC1 / AC2 の既存 VC はそのまま保持
    • AC3: trust が false であることを python3 -c で確認するコマンドを追加
    • AC4: includeTools が find_file, find_referencing_symbols, find_symbol, get_symbols_overview, list_dir, search_for_pattern の 6 ツールのみであることを確認するコマンドを追加
    • AC5: 自動検証不要であることをコメントで明示(実装者が PR 本文の「Known remaining preflight errors」セクションに記載することで満たす)
  7. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: 完了 (2026-05-23T05:02:40Z)

    • iteration: 3(0, 1, 2)
    • verdict: approve
    • termination_reason: approved
    • removed_state_labels: ["state/queued"]

    改善履歴

    iter 0 → 1(anchor_comment feedback_update_required 反映)

    • ## Runtime Verification Applicability セクション追加(decision: immediate)
    • ## Precondition セクション追加(.gemini/settings.json が repository-tracked で存在すること)
    • AC を 2 件から 5 件に拡充(AC3: trust=false 保持 / AC4: includeTools 保持 / AC5: 残余エラー PR 記載)
    • AC2 の明確化(「error を出力しない」→「denylist / excludeTools 系エラーを出力しない」)
    • ## Known Risk セクション追加(SERENA_DANGEROUS_TOOLS のツール名 upstream drift リスク)

    iter 1 → 2(C5: AC3/AC4/AC5 の VC 追加)

    • AC3 の python3 VC コマンド追加(trust フィールドが false であること確認)
    • AC4 の python3 VC コマンド追加(includeTools 6 ツール確認)
    • AC5 は PR 本文確認項目として VC コメントで明示(自動検証不要)

    次アクション

    issue-contract-review で着手 preflight を実行してから実装に進んでください。

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues:
        - request_dedupe_key: "serena-dangerous-tools-upstream-drift-verification"
          issue_number: 256
          issue_url: "https://github.com/squne121/loop-protocol/issues/256"
          status: created
    
      note_only_observations:
        - dedupe_key: "issue-101-preflight-per-profile-open"
          source_url: "https://github.com/squne121/loop-protocol/issues/101"
          summary: "#101 は OPEN のため起票不要。#140 実装後も preflight per-profile 化が未解決のまま残る。"
  8. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    派生観察 (from Issue #254 refinement loop, 2026-05-23)

    Issue #254 の issue-refinement-loop iter 1 で codebase-investigator SubAgent を起動した際、本 Issue で扱っている local_asset_research profile denylist 不備により以下のように fail-close しました。

    preflight setup_check.py:
      - auth.ok: false
      - status: failed
    
    local_asset_research tool profile の denylist が不完全:
      - 不足: activate_project, create_text_file, delete_lines, execute_shell_command,
        insert_after_symbol, insert_at_line, insert_before_symbol, prepare_for_new_conversation,
        read_file_content, read_memory, remove_project, replace_lines, replace_regex,
        replace_symbol_body, restart_language_server, switch_modes,
        think_about_collected_information, think_about_task_adherence,
        think_about_whether_you_are_done, write_file, write_memory
    

    retry 後も同じエラーで再現。main thread からの直接 gh / ls fallback で当該 refinement は完了させましたが、SDD ツール採否を扱う Issue #257(C254-1 ADR)の作業時に local asset 調査が頻発する見込みのため、本 Issue (#140) の修正は #257 着手前に優先したい です。

    参考 SubAgent agentId: a23211fe8f86f9cbf / abc3f763a8f8c39ca(本 refinement loop で記録)

    関連: #71, #101

  9. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-05-23T06:00:00Z)

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-05-23T06:00:00Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/140
      checks:
        template_compliance: pass
        state_label: "warning(non-blocking): state/queued 不在"
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 2
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          classifications:
            - ac: AC1
              command: "python3 -c 'import json; s=json.load(open(\".gemini/settings.json\")); exclude=set(s[\"mcpServers\"][\"serena\"].get(\"excludeTools\",[])); ...'"
              exit_code: 0
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "FAIL: missing=['activate_project', 'create_text_file', ...]"
                stderr_excerpt: ""
              decision: go
            - ac: AC2
              command: "uv run python3 .claude/skills/gemini-cli-headless-delegation/scripts/preflight_gemini_headless.py --output-file /tmp/preflight_ac2_result.json"
              exit_code: 0
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "[gemini-preflight] error: local_asset_research dangerous tool denylist is incomplete: activate_project, create_text_file, ..."
                stderr_excerpt: ""
              decision: go
            - ac: AC3
              command: "python3 -c 'trust=...; print(\"PASS: AC3\" if trust is False else f\"FAIL: trust={trust!r}\")'"
              exit_code: 0
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "PASS: AC3"
                stderr_excerpt: ""
              decision: go
              note: "既存値保持確認AC。実装前後ともPASSが正常(破壊検知用)。"
            - ac: AC4
              command: "python3 -c 'include=...; print(\"PASS: AC4\" if include == expected else f\"FAIL: ...\")'"
              exit_code: 0
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "PASS: AC4"
                stderr_excerpt: ""
              decision: go
              note: "既存値保持確認AC。実装前後ともPASSが正常(破壊検知用)。"
        ac_verifiability: pass
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings:
        - "AC2 の VC step2 が preflight JSON の 'errors' フィールドを参照しているが、実際のスキーマは 'failure_reason' に格納されている。baseline では実質的に fail しているため GO 判定。実装後も VC step2 は常に PASS になる可能性があり、PR 本文の Known remaining preflight errors セクションで証跡を明示すること(AC5)。"
    • Outcome: .gemini/settings.json が更新され、mcpServers.serena.excludeTools に SERENA_DANGEROUS_TOOLS(21 ツール)が列挙された状態で、preflight_gemini_headless.py の local_asset_research dangerous tool denylist チェックが PASS する
    • Acceptance Criteria:
      1. excludeTools フィールドが存在し、21 ツールをすべて含む
      2. preflight_gemini_headless.py の denylist チェックがエラーなし(runtime-verification)
      3. trust が false(既存値保持)
      4. includeTools が read-only 6 ツールのみ(既存値保持)
      5. 残余エラーを PR 本文の Known remaining preflight errors に明示
    • Verification Commands: AC1〜AC4 の python3 コマンド(AC5 は PR 本文確認)
    • Allowed Paths: .gemini/settings.json
    • Worktree: .claude/worktrees/issue-140-gemini-settings-json-serena-mcp-excludet
    • Branch: worktree-issue-140-gemini-settings-json-serena-mcp-excludet
    • VC preflight: baseline fail = 2(AC1/AC2), 想定外 pass = 0, 実行不可 = 0
  10. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-05-23T14:10:00Z)

    • PR: feat: .gemini/settings.json に Serena MCP excludeTools denylist を追加 (#140) #261
    • Worktree: .claude/worktrees/issue-140-gemini-settings-json-serena-mcp-excludet
    • Branch: worktree-issue-140-gemini-settings-json-serena-mcp-excludet
    • Verification: AC1 PASS / AC2 PASS / AC3 PASS / AC4 PASS / AC5 残余エラーなし
    • 標準品質ゲート: typecheck / lint / test (5/5) / build / pytest (21/21) 全PASS
    • preflight: ok: true, failure_reason: null, local_asset_research.ok: true, 全5プロファイル検証済み
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  11. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-05-23T06:30:00Z)

    ループ履歴

    iter 0: 実装 → 検証 PASS → PR レビュー REQUEST_CHANGES

    • ブロッカー: PR 本文に Safety Claim Matrix セクションが欠落(safety-sensitive: trust/MCP/tool キーワード)

    iter 1: PR 本文更新(Safety Claim Matrix 追加)→ PR レビュー APPROVE

    作業中の改善観察事項

    1. VC 設計ミス(Issue 実装: .gemini/settings.json に Serena MCP excludeTools denylist を追加し local_asset_research preflight を通過させる #140 本文): AC2 の VC step2 が preflight JSON の errors フィールドを参照しているが、実際のスキーマは failure_reason に格納されている。実装では修正版コマンドを使用し PASS 確認済み。今後の Issue 起票時は preflight スクリプトの実際の JSON スキーマを VC に反映すること。
    2. Safety Claim Matrix の運用: MCP tool access control 設定変更 PR は Safety Claim Matrix が必須。implement-issue skill または PR テンプレートに Safety Claim Matrix セクションの雛形を含める運用を検討すること(non-blocking 改善提案)。
    3. Safety Claim Matrix の列名: pr-review-judge の SKILL.md 規定列名(Implemented?/Not controlled/Evidence/Follow-up)と PR 本文の列名(種別/根拠/証跡)が一致していない。規定列名を PR テンプレートに含めることを推奨。
    4. .gemini/settings.json の git 追跡: 本 PR 以前、.gemini/settings.json は git 未追跡状態だった。今後、.gemini/ 配下の設定ファイルは明示的に git add して repository-tracked にする運用を徹底すること。
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues:
        - request_dedupe_key: "serena-dangerous-tools-upstream-drift-verification"
          issue_number: 256
          issue_url: "https://github.com/squne121/loop-protocol/issues/256"
          status: reused_open
    
      note_only_observations:
        - dedupe_key: "safety-claim-matrix-in-pr-template"
          summary: "MCP tool access control 変更 PR では Safety Claim Matrix が必須。implement-issue skill または PR テンプレートに雛形を含める運用を検討(non-blocking 改善提案)。"
        - dedupe_key: "safety-claim-matrix-column-names"
          summary: "pr-review-judge SKILL.md 規定列名と PR 本文の列名が不一致。規定列名を PR テンプレートに含めることを推奨(non-blocking)。"
        - dedupe_key: "vc-preflight-json-schema-mismatch"
          summary: "Issue #140 の AC2 VC が preflight JSON の errors フィールドを参照しているが実際は failure_reason に格納。今後の preflight 系 Issue 起票時は JSON スキーマを正確に反映すること。"
  12. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup: 完了 (2026-05-23T05:45:00Z)

    cleanup 結果

    項目 内容
    worktree 削除済み(.claude/worktrees/issue-140-gemini-settings-json-serena-mcp-excludet)
    branch 削除済み(git branch -D、remote は fetch --prune で削除確認)
    parent Issue なし(単独改善)
    superseded PR なし
    stash なし
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues:
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/261:safety-claim-matrix-template"
          issue_number: 263
          issue_url: "https://github.com/squne121/loop-protocol/issues/263"
          status: created
    
      note_only_observations:
        - dedupe_key: "vc-preflight-json-schema-mismatch"
          source_url: "https://github.com/squne121/loop-protocol/issues/140"
          summary: "AC2 の VC が preflight JSON の errors フィールドを参照しているが実際は failure_reason に格納。今後の preflight 系 Issue 起票時は JSON スキーマを正確に反映すること(Issue レベルでの追跡は不要、ノートのみ)。"
        - dedupe_key: "safety-claim-matrix-column-names"
          source_url: "https://github.com/squne121/loop-protocol/pull/261"
          summary: "Safety Claim Matrix の列名が pr-review-judge SKILL.md 規定列名と不一致。Issue #263 で implement-issue SKILL.md への雛形追記として対処予定。"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions