Skip to content

実装: SerenaMCP を AGY (Antigravity CLI) 移行後の local_asset_research provider として再導入する #1271

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1265"
goal_ref: "GeminiCLI 委譲版 delegation platform を AntigravityCLI (agy) provider へ段階移行し、機能同等性を達成する"
change_kind: code
implementation_architecture:
  selected: wrapper_side_serena_retrieval_then_agy_prompt_injection
  forbidden_without_new_issue:
    - connecting Serena MCP directly to AGY
    - running AGY from repo root
    - giving AGY direct MCP or tool access
    - passing repo path permissions to AGY
serena_tool_contract:
  source_of_truth:
    - pinned_serena_version_or_commit
    - verified_tool_manifest
  include_tools_mode: exact_match
  unknown_tool_policy: deny
  drift_check_required: true

Parent Issue

#1265

Parent Goal Ref

  • Goal: GeminiCLI 依存を段階的に縮小しつつ、AGY provider が Gemini 版と同等の delegation platform のうち、repo 内 read-only 調査を wrapper 側で安全に再導入できる状態にする。
  • Desired Destination: AGY provider でも local_asset_research 相当の repo 内調査を、安全境界を保った wrapper-side retrieval 経由で扱える child issue 群へ段階移行する。

Current Validated Scope

  • run_gemini_headless.py に provider=agy + tool_profile=local_asset_research 専用の validator / dispatch 経路を追加し、現行の agy early-dispatch が Gemini 側 validation を迂回する状態を解消する。
  • Serena read-only retrieval は wrapper 側でのみ実行し、AGY 本体には repo root、MCP 設定、direct tool access を渡さず、isolated temp cwd から prompt-only で起動する。
  • Serena tool contract は upstream 現行 tool 名、または pin した manifest と照合して drift を機械検証し、unknown tool / dangerous tool は fail-closed で拒否する。
  • provider-mapping.md、usage-contract.md、preflight_agy.py、関連 pytest を同時更新し、docs / runtime / tests の期待値を一致させる。

Remaining Parent Gaps

  • grounded_research の AGY 対応(別 child issue)
  • github_research の AGY 対応(別 child issue)
  • provider fallback / quota policy(別 child issue)
  • 認証フロー堅牢化(別 child issue)
  • AGY provider 固有の broader regression 強化(別 child issue)

Outcome

provider=agy + tool_profile=local_asset_research が、wrapper-side Serena retrieval と AGY prompt-only 実行を組み合わせた B 案固定アーキテクチャでのみ受理される。具体的には、AGY は repo root や MCP 設定を直接受け取らず、Serena tool drift・repo boundary・dangerous tool denylist を通過した bounded evidence だけが prompt に注入され、docs / runtime / tests がこの意味論で一致している状態を完了とする。

In Scope

  • run_gemini_headless.py の AGY_SUPPORTED_PROFILES / provider=agy dispatch / validator を更新し、local_asset_research を full validation 付きでのみ受理する変更
  • provider=agy + tool_profile=local_asset_research 専用の validation / preflight 経路を preflight_agy.py に実装する変更
  • Serena read-only allowlist / dangerous denylist / unknown tool drift を pinned Serena source と checked-in manifest で検証する機械チェックの実装
  • .gemini/settings.json の Serena source を commit / tag / version で pin する変更
  • checked-in Serena tool manifest を追加し、runtime / preflight が manifest と settings の pinned ref 一致を検証する変更
  • wrapper 側で SerenaMCP read-only tool を呼び、find_file / search_for_pattern / get_symbols_overview 相当の retrieval evidence を収集する変更
  • repo root 外パス、../ traversal、symlink 越境、secret-like payload、過大 evidence を fail-closed にする wrapper 側境界実装
  • provider-mapping.md / usage-contract.md の AGY profile matrix・safety mode・request contract・failure class の更新
  • test_agy_provider.py / test_preflight_agy.py / test_setup_check.py のうち本変更に対応するテスト更新

Out of Scope

  • AGY へ Serena MCP を直接接続する A 案
  • AGY を repo root から起動する設計
  • Gemini provider 側の既存 local_asset_research 実装の機能拡張
  • grounded_research / github_research の AGY 対応
  • Serena MCP 本体の upstream 実装変更

Acceptance Criteria

  • AC1: provider=agy + tool_profile=local_asset_research は AGY 専用 validator を通過した場合にのみ受理され、schema / repo-boundary / Serena tool contract validation を迂回できない。
  • AC2: Serena retrieval は wrapper 側でのみ実行され、AGY は isolated temp cwd から prompt-only で起動される。repo root、MCP config、direct tool access は AGY に渡らない。
  • AC3: Serena tool contract は checked-in manifest を SSOT とし、settings の pinned ref、exact-match read-only allowlist、dangerous tool denylist、unknown upstream tool deny を機械検証し、drift があれば fail-closed で拒否する。
  • AC4: absolute path outside repo、../ traversal、symlink traversal outside repo、secret-like or unbounded evidence payload は retrieval 前に fail-closed で拒否される。
  • AC5: provider-mapping.md、usage-contract.md、runtime constants、AGY tests が local_asset_research の意味論で一致する。
  • AC6: 本変更に対応する pytest が追加または更新され、AGY local asset path の成功系・fail-closed 系を機械検証できる。
  • AC7: wrapper は fake-injectable な SerenaMCP read-only retrieval client / transport を経由し、find_file、search_for_pattern、get_symbols_overview 相当の evidence を source_kind: serena_mcp_read_only_evidence として AGY prompt に注入できる。context_files 直接読み取りだけを primary success evidence として扱わない。
  • AC8: .gemini/settings.json と .agents/mcp_config.json の Serena source は commit / tag / version で pin され、checked-in manifest の pinned_ref と一致する。manifest mismatch / unpinned source は fail-closed で拒否される。
  • AC9: AGY prompt には repo absolute path、repo root、MCP config、direct tool access、secret-like payload が含まれず、repo-relative provenance を持つ bounded evidence envelope のみが渡る。
  • AC10: --live-serena preflight は .agents/mcp_config.json から pinned Serena MCP server を stdio で起動し、initialize、tools/list、find_file、search_for_pattern、get_symbols_overview の tools/call transcript と evidence envelope を生成する。

Verification Commands

# AC1
$ rg -n "_validate_agy_local_asset_request" .claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.py

# AC2
$ rg -n "prompt-only" .claude/skills/gemini-cli-headless-delegation/references/provider-mapping.md

# AC3
$ rg -n "load_serena_tool_manifest" .claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py

# AC4
# baseline-expect: pass
$ uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_agy_provider.py -k "local_asset_research or repo_root or symlink or traversal or dangerous"

# AC5
# baseline-expect: pass
$ uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_preflight_agy.py

# AC6
# baseline-expect: pass
$ uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_setup_check.py -k "agy"

# AC7
# baseline-expect: pass
$ uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_agy_provider.py -k "serena_mcp_read_only_evidence or live_serena or manifest"

# AC8
$ rg -n "serena_tool_manifest_v1" .claude/skills/gemini-cli-headless-delegation/references/serena-tool-manifest.json

# AC9
$ rg -n "git\+https://github.com/oraios/serena@" .gemini/settings.json
# AC10
# baseline-expect: pass
$ uv run python3 .claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py --json --local-asset-research --mcp-config .agents/mcp_config.json --live-serena

Allowed Paths

  • .gemini/settings.json
  • .agents/mcp_config.json
  • .claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.py
  • .claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py
  • .claude/skills/gemini-cli-headless-delegation/scripts/setup_check.py
  • .claude/skills/gemini-cli-headless-delegation/tests/test_agy_provider.py
  • .claude/skills/gemini-cli-headless-delegation/tests/test_preflight_agy.py
  • .claude/skills/gemini-cli-headless-delegation/tests/test_setup_check.py
  • .claude/skills/gemini-cli-headless-delegation/references/provider-mapping.md
  • .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md
  • .claude/skills/gemini-cli-headless-delegation/references/serena-tool-manifest.json

Runtime Verification Applicability

decision: immediate
reason: AGY local asset path は provider-specific validator、repo boundary、Serena drift check、docs/runtime/test alignment の相互整合を本 Issue 内で pytest と docs/runtime 更新で検証できる。
applicable_acs:
  - AC4
  - AC5
  - AC6
  - AC7
  - AC8
  - AC9
execution_environment:
  cli_tools:
    - python3
    - uv
    - pytest
  auth_required: false
  network_required: true
  notes: Ubuntu 24.04 on WSL2 の local Codex workspace で実行する。Serena pinned ref の取得と manifest 生成で upstream read-only access を使う。
skip_conditions:
  - Allowed Paths 外へ波及した場合は runtime verification 実行前に停止する
  - Serena upstream drift が pin 付き manifest でも確定できない場合は blocked とする
fallback_policy:
  fallback_success_is_pass: false
  notes: runtime verification が成立しない場合は fail-closed で human judgment に戻す
artifact_requirements:
  - pytest output for test_agy_provider.py
  - pytest output for test_preflight_agy.py
  - pytest output for test_setup_check.py
  - fake SerenaMCP retrieval evidence test output
  - checked-in serena-tool-manifest.json
  - pinned .gemini/settings.json diff
  - docs/runtime diff proving provider-mapping and usage-contract alignment

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • AGY に direct MCP / tool access / repo root cwd を与える設計変更が必要と判明した場合
  • Serena upstream tool 名の drift を pin 付き manifest でも吸収できず、別 issue での契約更新が必要になった場合
  • grounded_research / github_research まで同時に扱う必要が出た場合

Required Skills

  • Python(型ヒント・pytest)
  • gemini-cli-headless-delegation の provider abstraction 契約理解

Scope Delta(任意)

  • OWNER comment #issuecomment-4864513637 に基づき、A 案を禁止し B 案固定に狭めた。
  • setup_check.py 一般経路ではなく preflight_agy.py の profile-specific preflight を正本にした。
  • docs / runtime / tests の意味論一致と Serena tool drift 検証を同一 issue の必須成果物に引き上げた。
  • OWNER comment #issuecomment-4865776458 と human escalation #issuecomment-4866490566 に基づき、Route A として .gemini/settings.json pin、checked-in manifest、実 SerenaMCP retrieval evidence を Allowed Paths / AC / VC に追加した。Route A 修復後にさらに Allowed Paths 外の変更が必要な場合は停止する。

Delivery Rule

  • 1 Issue = 1 PR を原則とする。
  • worktree での作業とし、Draft PR で起票する。
  • PR 本文には、B 案固定を選んだ理由、Serena tool manifest の pin / drift 検証方法、AGY に direct tool access を与えていない証跡を明記する。

Notes for Reviewer

Parent: #1265

Activity

  1. added
    enhancement
    phase/implementation
    triage-required
    agent/implementer
    on Jul 1, 2026
  2. squne121 commented on Jul 2, 2026

    @squne121
    OwnerAuthor

    判定: REQUEST_CHANGES

    #1271 の方向性自体は妥当です。Gemini CLI 依存縮小後も local_asset_research 相当の repo 内調査能力を残すには、Serena MCP を何らかの形で再導入する必要があります。ただし、現在の #1271 は「provider=agy に local_asset_research を追加する」という実装タスクとしては安全条件がまだ弱く、実装者が AGY_SUPPORTED_PROFILES に 1 要素を足すだけで AC1 を満たしたように見せられる危険があります。#1271 は open で、Issue コメントは 0 件なので、本文以外に補足決定は存在しません。

    現在のリポジトリ実装では、AGY_SUPPORTED_PROFILES は {"no_tools", "proposal_only"} だけで、local_asset_research は明示的に unsupported です。初期導入 PR #1132 も AGY provider を “prompt-only degraded wrapper” と明記しており、Gemini CLI との完全な feature parity ではないと説明しています。


    Blocker 1: #1271 は B案固定 にしないと危険

    #1265 の親コメントは、#1271 について B案: wrapper 側で Serena read-only retrieval を実行し、取得結果だけを AGY prompt に注入する 方針を優先すべきだと明記しています。理由は、AGY に直接 repo/MCP 権限を渡すと、Antigravity CLI 側の編集・コマンド実行能力と衝突するためです。

    外部実装のリスクモデルとも一致します。Antigravity CLI 公式 README は、AGY がコードベース理解、編集、コマンド実行、tool calling を扱う CLI であり、autonomous code execution、data exfiltration、prompt injection、supply-chain risks を明示的に警告しています。([GitHub]1)

    したがって #1271 の本文は、次を明文化しないと merge gate として弱いです。

    implementation_architecture:
      selected: wrapper_side_serena_retrieval_then_agy_prompt_injection
      forbidden_without_new_issue:
        - connecting Serena MCP directly to AGY
        - running AGY from repo root
        - giving AGY direct MCP/tool access
        - passing repo path permissions to AGY

    現状の #1271 は「setup_check.py 拡張または独立 preflight」の選択は実装者に委ねていますが、AGY へ MCP を直接接続する A案を禁止していない点が最大の欠陥です。


    Blocker 2: 現在の AGY dispatch は full validation を通らない

    run_gemini_headless.py の provider=agy 経路は、Gemini 用の validate_request() より前に early dispatch されます。_validate_agy_request() は tool_profile、post_to_issue_url、model、prompt だけを見ており、schema、context_files、instructions、output_sections、repo root 境界、Serena 設定は検証していません。

    一方、Gemini 側の local_asset_research は _validate_local_asset_research_settings() と context_files の Path.resolve() 後の repo root 境界チェックを通します。

    つまり、#1271 の AC3「repo root 外パス・symlink 越境を fail-closed」は、単に AGY_SUPPORTED_PROFILES に local_asset_research を追加しても満たされません。むしろ AGY 専用 minimal validation path が先に通るため、安全境界を bypass する実装になりやすいです。

    必要な修正は、新規に以下のような provider-specific validator を置くことです。

    def _validate_agy_local_asset_request(
        request: Mapping[str, Any],
        request_path: Path | None,
        repo_root: Path,
    ) -> list[str]:
        # schema == delegation_request_v1 を必須化
        # tool_profile == local_asset_research を検証
        # context_files / asset_queries の型と空値を検証
        # Path.resolve() 後に repo_root 配下であることを検証
        # symlink 越境を fail-closed
        # Serena tool contract を検証
        # AGY に渡す prompt payload のサイズ・secret・path 表示を制限

    Blocker 3: Serena tool 名の SSOT がすでに drift している

    #1271 は Serena MCP の includeTools allowlist / dangerous tool denylist を機械検証する前提ですが、関連 Issue #256 がまだ open で、SERENA_DANGEROUS_TOOLS と Serena upstream 公式ツール名の乖離を既知問題として扱っています。特に read_file_content vs read_file、replace_regex vs replace_content の乖離が明記されています。

    現在の repo 定数も、read-only allowlist は find_file、find_referencing_symbols、find_symbol、get_symbols_overview、list_dir、search_for_pattern で、dangerous denylist には read_file_content、replace_regex、execute_shell_command、write_file などが含まれています。

    しかし Serena 公式 docs の tool list では、read/edit/file/memory/shell 系の現行ツールとして read_file、replace_content、replace_lines、execute_shell_command、write_memory などが示されています。([Oraios]2) Serena 自体も semantic code retrieval だけでなく editing / refactoring / debugging を提供する MCP toolkit です。([GitHub]3)

    この状態で #1271 を実装すると、denylist が古い tool 名を検査して「安全」と誤判定する可能性があります。#1271 は #256 を blocker にするか、少なくとも同 PR 内で Serena upstream tool 名の drift verification を追加すべきです。

    修正要求:

    serena_tool_contract:
      source_of_truth:
        - pinned_serena_version_or_commit
        - generated_or_verified_tool_list
      include_tools:
        mode: exact_match
        unknown_tool_policy: deny
      dangerous_tools:
        must_include_current_upstream_names:
          - execute_shell_command
          - write_file
          - create_text_file
          - replace_content
          - replace_lines
          - insert_at_line
          - insert_before_symbol
          - insert_after_symbol
          - replace_symbol_body
          - write_memory
          - read_memory
      drift_check:
        required: true

    Blocker 4: setup_check.py 拡張案はそのままだと不適切

    #1271 は setup_check.py の provider-aware Serena checks 拡張を候補にしていますが、現在の setup_check.py --provider agy は意図的に Gemini / Serena / .gemini/settings.json / trusted folders / auth を skip します。PR #1262 も、provider=agy では node・gemini・uvx・.gemini 設定・Serena・Gemini 認証を要求しないよう整理したと説明しています。

    実装コードでも AGY_REQUIRED_TOOLS = ["agy", "python3", "uv"] で、AGY provider checks は check_agy_preflight() を呼ぶだけです。

    さらに、check_gemini_settings() は .gemini/settings.json の存在確認またはテンプレート作成だけで、既存ファイルの includeTools / excludeTools の中身を検証しません。テンプレートにも includeTools はありますが、excludeTools がありません。

    したがって、#1271 の preflight は setup_check.py --provider agy に混ぜるべきではありません。推奨は次です。

    uv run python3 .claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py \
      --profile local_asset_research \
      --repo-root "$PWD" \
      --json

    または独立ファイル:

    scripts/preflight_agy_local_asset.py
    

    この preflight は provider=agy 全体の前提ではなく、provider=agy + tool_profile=local_asset_research 専用にすべきです。関連 Issue #101 が扱っているように、local_asset_research の Serena 不備で他 profile の preflight 全体を落とす設計は過去に問題化しています。


    Blocker 5: docs / matrix / runtime が衝突する

    provider-mapping.md は現在、AGY で local_asset_research を unsupported_provider_profile とし、AGY は repo root を使わず isolated temp cwd で動く、と記述しています。

    usage-contract.md も provider=agy variant では tool_profile を no_tools または proposal_only のみに制限し、grounded_research / local_asset_research / github_research は禁止と書いています。

    #1271 の実装 PR が AGY_SUPPORTED_PROFILES に local_asset_research を足すなら、少なくとも以下を同時に更新しなければなりません。

    • provider-mapping.md の AGY profile matrix
    • usage-contract.md の provider=agy request variant
    • AGY local asset の safety mode
    • AGY が repo root を 使わないのか、Serena wrapper だけが repo root を使うのか
    • context_files / asset_queries / retrieved evidence payload の contract
    • fail-closed failure classes

    ここを更新しない PR は、runtime と docs の整合性を破壊します。


    Blocker 6: 現在の AGY security tests では #1271 の安全性を証明できない

    _run_agy() は isolated temp cwd、minimal env、shell=False で agy -p <prompt> を実行しています。これは良い制約です。

    ただし #1271 で local_asset_research を入れると、リスクは「AGY wrapper が shell=False か」ではなく、「Serena retrieval の結果を AGY prompt に入れる際に repo 外・secret・prompt injection・過大 context をどう防ぐか」に移ります。現在の preflight_agy.py は redaction-before-truncate を持っていますが、unexpected capability keywords は chat と --output-format だけで、permission bypass 系 flag の検出はまだ十分ではありません。

    追加すべき regression tests:

    • AGY invocation が -p 以外の permission bypass flag を渡さない
    • AGY_BIN override は basename だけを result に出し、実行時 override は test-only / human-approved として文書化する
    • AGY の cwd は引き続き isolated temp cwd で、repo root にならない
    • Serena retrieval は wrapper 側でのみ repo root を使う
    • Serena output に secret-like token があれば redaction-before-truncate
    • Serena output の path provenance は repo 相対 path に正規化
    • prompt に「この証跡外の repo を読むな」と入れるだけでなく、AGY に repo への filesystem access を与えない

    Blocker 7: テストの差し替えが不足している

    既存 test_agy_provider.py は、provider=agy + local_asset_research を unsupported_provider_profile として reject することを期待しています。#1271 実装ではこの前提を変える必要があります。

    また、既存テストは empty stdout の failure_reason / failure_class は見ていますが、warnings[0] の leading token 一致までは固定していません。実装側では non-CI empty stdout 時に failure_class = "agy_empty_stdout" なのに warning は "agy_output_missing: ..." のままです。

    #1271 のテストは最低限これを含めるべきです。

    tests/test_agy_provider.py
    - provider=agy + local_asset_research succeeds only through wrapper-side retrieval
    - provider=agy + local_asset_research never runs AGY in repo root
    - unsupported/dangerous Serena tool in includeTools is rejected
    - missing dangerous tool in excludeTools is rejected
    - unknown upstream Serena tool name is rejected
    - symlink pointing outside repo is rejected
    - ../ traversal is rejected
    - absolute path outside repo is rejected
    - AGY prompt receives bounded retrieved evidence, not raw unbounded repo dump
    - warnings[0], failure_reason, failure_class leading token match on all AGY fail-closed paths
    
    tests/test_preflight_agy.py or tests/test_preflight_agy_local_asset.py
    - preflight no_tools/proposal_only does not require Serena
    - preflight local_asset_research requires Serena contract
    - setup_check --provider agy still skips Gemini/Serena unless profile-specific local asset preflight is requested
    

    推奨実装方針

    #1271 は、次の形に書き換えてから実装するのが安全です。

    selected_design: B
    summary: >
      Run Serena read-only retrieval in the wrapper, serialize bounded evidence,
      then call AGY with prompt-only input from isolated temp cwd.
      AGY itself receives no MCP config, no repo root cwd, and no direct filesystem permission.
    
    runtime_changes:
      - add local_asset_research to AGY_SUPPORTED_PROFILES only after validator exists
      - add _validate_agy_local_asset_request()
      - add _collect_serena_read_only_evidence()
      - add _build_agy_local_asset_prompt()
      - keep _run_agy() isolated temp cwd + minimal env + shell=False
      - never pass .gemini/settings.json to AGY as an MCP config
    
    preflight_changes:
      - add profile-specific AGY local asset preflight
      - verify Serena upstream tool names or pinned tool manifest
      - verify includeTools exact read-only allowlist
      - verify dangerous denylist as defense-in-depth
      - verify repo boundary and symlink behavior
    
    docs_changes:
      - update provider-mapping.md matrix
      - update usage-contract.md provider=agy variant
      - document safety_mode as wrapper_retrieval_then_degraded_agy_prompt
      - document that AGY still has no direct tool access

    最小 acceptance criteria の差し替え案

    現在の AC は弱いので、次に差し替えるべきです。

    acceptance_criteria:
      - AC1_profile_enabled_after_validation:
          description: >
            provider=agy + tool_profile=local_asset_research is accepted only after
            AGY-specific local asset validation passes. It must not bypass schema,
            repo-boundary, or Serena tool contract validation.
    
      - AC2_wrapper_side_retrieval_only:
          description: >
            Serena MCP is invoked only by the wrapper-side retrieval step.
            AGY is never launched from repo root and receives no MCP configuration.
    
      - AC3_serena_tool_contract:
          description: >
            includeTools is exact-match read-only allowlist; unknown tools are denied;
            dangerous tools use current upstream names or a pinned verified manifest.
    
      - AC4_repo_boundary:
          description: >
            absolute paths, ../ traversal, and symlink traversal outside repo root
            are rejected before retrieval.
    
      - AC5_failure_surface:
          description: >
            warnings[0], failure_reason, and failure_class share the same leading token
            for every fail-closed path.
    
      - AC6_docs_runtime_matrix:
          description: >
            provider-mapping.md, usage-contract.md, tests, and runtime constants agree
            on provider=agy local_asset_research semantics.

    結論

    #1271 はこのまま実装に入ると、local_asset_research を AGY に「対応済み」と見せながら、実際には安全境界を証明できない PR が出やすいです。特に危険なのは、AGY の prompt-only early dispatch が full request validation を通らない点、Serena tool 名の SSOT が既に drift している点、そして setup_check.py --provider agy が意図的に Serena を skip する点です。

    採用可能な実装は B案固定です。AGY に Serena MCP や repo root を直接渡さず、wrapper が Serena read-only retrieval を行い、境界検証済み・サイズ制限済み・redaction 済みの evidence だけを AGY prompt に注入してください。その設計に #1271 本文、AC、tests、provider docs を揃えるまで、判定は REQUEST_CHANGES です。

  3. squne121 commented on Jul 2, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

  4. squne121 commented on Jul 2, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-02T11:14:55Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1271
      body_sha256: "sha256:f011382ff83b439556717e7c20848f83aebce5fe52f10262893ce0d1a737e6c8"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        vc_preflight: pass
      source: ensure_contract_snapshot_auto
  5. squne121 commented on Jul 2, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-07-02T12:15:00Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      termination_reason: approved
      merge_ready: true
      pr_url: "https://github.com/squne121/loop-protocol/pull/1290"
      head_sha: "c5e92343d27f616ab63dac9f51bd5296155dfc60"
      issue_number: 1271
      iteration: 1
      required_auto_actions: []
      draft_pr_ready: true
      github_merge_ready: false
      human_next_action: "mark_ready_for_review_or_merge"
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations: []
    ISSUE_SCOPE_ROLLUP_DECISION_V2:
      schema_version: 2
      recorded_at: "2026-07-02T12:15:00Z"
      decision: skipped
      executed_actions: []
      skipped_reason: "scope rollup の実施対象なし(PR スコープ内で解決)"
      candidates_reviewed:
        - kind: pr
          number: 1290
          confidence: high
          suggested_action: close_directly
          final_decision: accepted
          rejection_reason: null
  6. squne121 commented on Jul 2, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 人間判断要請 (2026-07-02T13:52:00Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: human_escalation
      termination_reason: human_escalation
      merge_ready: false
      pr_url: "https://github.com/squne121/loop-protocol/pull/1290"
      head_sha: "b31ee9471bfa31edd8b5fef56e40e0cc246c2415"
      issue_number: 1271
      iteration: 2
      required_auto_actions: []
      blockers:
        - "SerenaMCP の実検索結果を wrapper が収集して AGY prompt に渡す経路が未実装"
        - "pinned_serena_version_or_commit / checked-in manifest の完全対応には Allowed Paths 外の変更が必要"
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations:
        - dedupe_key: "issue-1271-serena-mcp-live-retrieval-manifest-pin"
          source_url: "https://github.com/squne121/loop-protocol/pull/1290#issuecomment-4865776458"
          source_note_id: "owner-adversarial-review"
          summary: "AGY local_asset_research の close には SerenaMCP 実検索 evidence と pinned manifest/settings pin が必要"
    ISSUE_SCOPE_ROLLUP_DECISION_V2:
      schema_version: 2
      recorded_at: "2026-07-02T13:52:00Z"
      decision: human_review_required
      executed_actions: []
      skipped_reason: null
      candidates_reviewed:
        - kind: pr
          number: 1290
          confidence: high
          suggested_action: "split remaining SerenaMCP live retrieval / manifest pin work"
          final_decision: human_review_required
          rejection_reason: "Allowed Paths 外の変更が必要"
  7. squne121 commented on Jul 2, 2026

    @squne121
    OwnerAuthor

    contract repair: Route A 採用

    OWNER 指示に基づき、#1271 を Route A として修復しました。

    • .gemini/settings.json を Allowed Paths に追加
    • checked-in serena-tool-manifest.json を Allowed Paths に追加
    • AC7-AC9 と対応 VC を追加
    • SerenaMCP 実検索 evidence / pinned manifest / settings pin を close 条件に昇格
    • guard-issue-body: pass
    • contract_readiness_check: go

    次は PR #1290 の branch で、修復済み contract に沿って実装を継続します。

  8. squne121 commented on Jul 2, 2026

    @squne121
    OwnerAuthor

    contract repair: live Serena MCP probe scope追加

    OWNER review #1290 (comment) に基づき、#1271 の Allowed Paths に .agents/mcp_config.json を追加し、live Serena MCP stdio probe を AC10 / VC に追加しました。AGY へ direct MCP / repo root 権限を渡さず、wrapper 側だけが Serena MCP を起動する前提は維持します。

  9. squne121 commented on Jul 2, 2026

    @squne121
    OwnerAuthor

    CONTRACT_REPAIR_NOTE_V1

  10. squne121 commented on Jul 2, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup: 完了 (2026-07-02T23:05:00Z)

    POST_MERGE_CLEANUP_REPORT_V1:
      status: ok
      generated_at: "2026-07-02T23:05:00Z"
      generated_by: post-merge-cleanup
      human_review_required: false
      cleaned_branches:
        - "worktree-issue-1271-serenamcp-agy-local-asset"
      cleaned_worktrees:
        - "/home/squne/projects/LOOP_PROTOCOL/.claude/worktrees/issue-1271-serenamcp-agy-local-asset"
      unresolved_cleanup_items:
        - kind: unrelated_untracked_file
          path: ".claude/factcheck_context_1289.md"
          action: kept
          reason: "PR #1290 とは無関係のため cleanup 対象外"
      parent_issue_status:
        parent_issue_number: 1265
        all_children_closed: false
        recommended_action: keep_open
      superseded_prs: []
      follow_up_issue_requests: []
      cleanup_exec:
        status: ok
        actions_taken:
          - worktree_remove
          - branch_delete
        verified:
          pr_merged: true
          linked_issue_match: true
          worktree_clean: true
          root_default: true
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: post-merge-cleanup
      follow_up_issues: []
      note_only_observations: []
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/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions