Skip to content

実装: 契約実行ラッパーの unauthorized_write_path 誤検知を修正する #1343

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "契約実行ラッパー(scripts/agent-guards配下)の before/after repo-wide スナップショット比較が、並行稼働する他セッション/他エージェントの書き込みを実行コマンド自身の副作用と誤認し unauthorized_write_path で fail-close するバグを修正する"
change_kind: code

Parent Issue

なし(単独改善)

Parent Goal Ref

  • Goal: N/A(parent なし)
  • Desired Destination: N/A

Current Validated Scope

  • scripts/agent-guards/skill_runtime_exec.py の unauthorized write 検出ロジックを、実行コマンド自身のプロセスによる書き込みのみに限定するよう修正する
  • 対応するユニットテストの追加

Remaining Parent Gaps

なし

Outcome

scripts/agent-guards/skill_runtime_exec.py が、同一リポジトリ内で他セッション/他エージェントが並行して .claude/worktrees/** や .claude/artifacts/** 等へ書き込みを行っていても、それらを自プロセスの副作用と誤認せず、unauthorized_write_path で誤って fail-close しない状態になり、対応するユニットテストが追加されて全件 PASS している状態。

In Scope

  • scripts/agent-guards/skill_runtime_exec.py の before/after スナップショット比較ロジックを調査し、無関係な同時書き込みを diff に混入させている原因箇所を特定する
  • 対象コマンドが実際に書き込んだパスのみを diff 対象にする(プロセス単位の書き込み追跡、対象パスの allowed_write_roots 配下への事前スコープ限定、または同時書き込みが疑われる無関係パスの除外のいずれか、実装時に選定する)
  • 上記修正に対応するユニットテスト(複数プロセスが並行して無関係パスに書き込む状況を模したテスト)を追加する
  • volatile peer-session root(.claude/worktrees/** / .claude/artifacts/issue-refinement-loop/**)への実行コマンド自身の書き込みは、本Issueのrace-tolerant hotfixのスコープでは検出対象外(既知の制限)であることを、AC・テスト・PR本文・Safety Claim Matrixに明示する

Out of Scope

  • allowed_write_roots の値そのものの変更(各コマンド定義は command_registry.py の既存契約を維持する)
  • issue-refinement-loop や他 skill 側の呼び出しフローの変更
  • local_main_branch_guard 等、他の hook / guard スクリプトの変更
  • child process による volatile peer-session root(.claude/worktrees/** / .claude/artifacts/issue-refinement-loop/**)への自プロセス書き込みの厳密な追跡(process-level file write attribution、strace等によるsyscallトレース等)。stdlibのみによるrace-tolerant hotfixの範囲外とし、必要であれば別Issueで扱う

Acceptance Criteria

  • AC1: 単一コマンド実行中に、無関係な別プロセスが .claude/worktrees/** 配下(実行コマンドの allowed_write_roots 外)へファイルを書き込んでも、skill_runtime_exec.py が unauthorized_write_path で fail しない
  • AC2: 単一コマンド実行中に、無関係な別プロセスが .claude/artifacts/issue-refinement-loop/<別issue番号>/**(実行コマンドが対象とする issue 番号とは異なるディレクトリ)へファイルを書き込んでも、skill_runtime_exec.py が unauthorized_write_path で fail しない
  • AC3: 実行コマンド自身が allowed_write_roots 外(ただし .claude/worktrees/** および .claude/artifacts/issue-refinement-loop/** 等の volatile peer-session root を除く)へ実際に書き込んだ場合は、従来どおり unauthorized_write_path で fail-close する(回帰なし)
  • AC4: 実行コマンド自身が allowed_write_roots 内へ正当に書き込んだ場合は、従来どおり成功する(回帰なし)
  • AC5: 実行コマンド自身が volatile peer-session root(.claude/worktrees/** / .claude/artifacts/issue-refinement-loop/**)へ allowed_write_roots 外の書き込みを行った場合、本Issueのrace-tolerant hotfixの範囲では検出されないことが既知の制限としてテストで明示されている(strict attributionは別Issueのスコープ)

Verification Commands

# AC1
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py -k test_unrelated_process_write_to_worktrees_does_not_fail

# AC2
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py -k test_unrelated_process_write_to_other_issue_artifacts_does_not_fail

# AC3
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py -k test_self_write_outside_allowed_roots_still_fails

# AC4
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py -k test_self_write_inside_allowed_roots_still_succeeds

# AC5
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py -k test_self_write_to_worktrees_is_known_unsupported_in_stdlib_mode
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py -k test_self_write_to_other_issue_artifacts_is_known_unsupported_in_stdlib_mode

Allowed Paths

  • scripts/agent-guards/skill_runtime_exec.py
  • scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 本 Issue の Acceptance Criteria は全て uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py 配下のユニットテストで検証され、プロセス起動・ネットワーク I/O・実行時 runtime 動作検証は不要なため(静的検証: unit test のみで完結する)。

Stop Conditions

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

Required Skills

なし

Scope Delta(任意)

N/A

Notes for Reviewer

  • 発端: Issue 実装: issue-contract-review の VC preflight に同一command dedup/replay と bounded parallel execution を追加する #1338 の issue-refinement-loop Step 0f 実行中に、uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number 1338 --repo squne121/loop-protocol を3回連続実行し、全て unauthorized_write_path で失敗した。報告された unauthorized path は毎回異なり、かつ issue 1338 とは無関係(別セッションの private agent session manifest、別エージェントの pr-review-judge worktree fixture、issue 1337 の refinement artifact)だった。target_issue は毎回 1338 と正しく認識されていたため、原因は本コマンドの読み取り対象や引数ではなく、before/after スナップショット比較の対象範囲がリポジトリ全体(または .claude/worktrees/** / .claude/artifacts/** 全体)に及んでいることだと推測される。

  • 実装方針は「プロセス単位の書き込み追跡(例: 起動した子プロセスの working directory やコマンドの allowed_write_roots に限定して diff を取る)」を優先候補とするが、具体的な実装は担当者の調査結果に委ねる。

  • 本 Issue が解消するまでの間、issue-refinement-loop 等 skill_runtime_exec.py 経由のコマンドは、他セッションが同時に稼働している状況下で断続的に誤ブロックされ得る。

  • 2026-07-06: PR fix: 契約実行ラッパーの unauthorized_write_path 誤検知を修正する #1349 に対する人間レビュー(REQUEST_CHANGES, https://github.com/squne121/loop-protocol/pull/1349#issuecomment-4891683548)を受け、AC3 の保証範囲を volatile peer-session root 除外で明示的に狭めた(Option B)。strict attribution(Option A)は不採用、必要なら別Issueで扱う。

Activity

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

    @squne121
    OwnerAuthor

    you asked

    message time: 2026-07-06 01:23:28

    #1343
    内容について関連Issue、PR、リポジトリ資産、コメントを参照した上で敵対的レビューして。
    取り扱う技術や配布物の実装をWEB検索し高品質化してほしい。


    chatgpt response

    対象Issueと周辺文脈を確認し、リポジトリ内の実装・ドキュメント・関連PR/Issueまで横断してから、外部実装の調査結果と照合してレビューします。まずGitHub側の一次情報を取りに行きます。

    Issue #1343 自体はコメントなしでした。現行実装を見ると、skill_runtime_exec.py はコマンド実行の前後で repo-wide snapshot と git status を比較しており、Issue本文の推測どおり、他プロセスの同時書き込みを自コマンドの副作用として拾う構造です。

    判定

    要修正。#1343 の問題認識は正しいが、このまま実装に渡すと「誤検知は減るが guardrail が抜ける」実装が入り得ます。

    Issue #1343 は open で、Issue 自体にはコメントがありません。観測事象は、skill_runtime_exec.py の before/after repo-wide snapshot 比較が、他セッションの .claude/worktrees/** や別 issue の .claude/artifacts/** 書き込みを、自コマンドの副作用として誤認して unauthorized_write_path にしている、というものです。これは現行コードと整合します。

    P0: 現行実装は「プロセス起因」ではなく「時間窓の repo drift」を見ている

    _git_status_paths() は repo 全体に対して git status --porcelain=v1 --untracked-files=all --ignored=matching -z を実行しています。つまり ignored/untracked も含めて、同時に増えた path を拾います。

    _snapshot_repo_paths() も repo root から os.walk() し、.git と target issue の allowed artifact root 以外を広く snapshot しています。 その後、child 実行前の snapshot/status と child 実行後の snapshot/status を比較し、差分があれば unauthorized_write_path として fail-close しています。

    この方式では、child process が書いたのか、別エージェントが同じ repo 内に書いたのかを区別できません。Python の os.walk() 自体も、walk 中に file が追加・削除された場合に list に含まれるかは unspecified としているため、並行書き込み下の snapshot は監査証跡として弱いです。(Python documentation)

    P0: 「無関係 path を除外するだけ」の実装は AC3 を破る

    #1343 の AC1/AC2 だけを見ると、.claude/worktrees/** や .claude/artifacts/issue-refinement-loop/<other issue>/** を無視すれば通ります。しかし、それを blanket exclusion にすると、child が意図的に同じ path へ書いた場合も見逃します。これは AC3「自プロセスが allowed_write_roots 外へ書いたら従来通り fail-close」と衝突します。

    この guard の契約上、preflight.run の allowed write root は .claude/artifacts/issue-refinement-loop/{active_issue}/ だけです。policy 側も registry 側も同じ root を正本化しています。

    さらに #1228 は root からの preflight.run を許可した代わりに、artifact-only write postcondition を維持する契約です。#1236 も unauthorized write path postcondition を二次防波堤として維持すると明記しています。 既存テストにも、child が .cache/outside.txt を書くと unauthorized_write_path で落ちる regression が存在します。

    P0: 「プロセス単位の書き込み追跡」は標準 subprocess だけでは成立しない

    Python の subprocess.run() / Popen は child process の起動、stdout/stderr、return code、cwd/env の制御を提供しますが、child process tree が書いた file path の一覧は返しません。(Python documentation)

    inotify も primary solution には不適です。Linux man page は、inotify event にはその event を起こした user/process 情報がなく、自プロセス由来か他プロセス由来かを区別する簡単な方法がないと明記しています。さらに recursive ではなく、queue overflow で event loss も起こり得ます。(man7.org)

    本当に「child process tree が実際に触った path だけ」を検出するなら、Linux では strace -f のような syscall tracing が候補になります。strace -f は fork/vfork/clone で作られた child process を追跡でき、%file は filename を引数に取る syscall 群を trace できます。(man7.org) (man7.org) ただしこれは新しい runtime dependency / Linux 前提 / trace parser / secret-safe log handling を導入するため、現在の Allowed Paths と stop condition のまま暗黙採用するべきではありません。

    P0: #1343 は実装モードを二択で固定すべき

    現契約の「プロセス単位の書き込み追跡、対象パスの allowed_write_roots 配下への事前スコープ限定、または同時書き込みが疑われる無関係パスの除外のいずれか」は危険です。これらは安全性が同等ではありません。

    採るべき方針はどちらかです。

    1. strict attribution mode
      strace 等で child process tree の file syscall を追跡し、AC3 を .claude/worktrees/** や他 issue artifact への self-write まで含めて保証する。採用するなら、Issue に Linux/strace 依存、trace parser、fallback 時の fail-closed、secret-safe artifact 方針を明記する。

    2. race-tolerant stdlib mode
      標準ライブラリだけで実装し、既知の peer-session volatile roots の誤検知を避ける。ただしこの場合、AC3 は「一般の repo path、例: .cache/** や source tree への self-write は fail-close」のように狭める必要があります。.claude/worktrees/** や他 issue artifact への self-write を検出できるとは主張しない。

    現状の #1343 は、1 の保証を言いながら 2 の簡易実装を許す形になっています。ここが最大のリスクです。

    P1: 既存 regression を必ず巻き込むべき

    新規テストファイルだけで AC1/AC2 を満たすと、#1228/#1236 の安全回帰を見落とします。既存の test_skill_runtime_preflight_no_worktree.py には、fixture child が target artifact に正常書き込みする経路、.cache/ へ不正書き込みする経路、stale worktree env、outside artifact projection を再現する harness が既にあります。

    最低限、#1343 の Verification Commands に次を追加した方がよいです。

    uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py
    
    uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.py \
      -k "artifact_only_write_postcondition or stale_worktree or artifact_projection"

    Allowed Paths は、既存 harness を直接修正・再利用するなら scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.py も追加してください。新規ファイルだけで完結させるなら、既存 helper を雑に duplicate せず、self-write bypass ケースを必ず入れるべきです。

    追加すべき Acceptance Criteria

    #1343 の AC3 は粗すぎます。少なくとも以下を追加してください。

    AC3a: child が .cache/outside.txt へ書いた場合、従来通り unauthorized_write_path で fail-close する。
    
    AC3b: child が .claude/worktrees/<任意>/tmp/self-write.txt へ書いた場合、AC1 の unrelated process write 除外に巻き込まれて pass してはならない。
          stdlib-only race-tolerant mode を採る場合は、この AC は unsupported と明記し、AC3 の保証範囲を狭める。
    
    AC3c: child が .claude/artifacts/issue-refinement-loop/<別issue番号>/self-write.json へ書いた場合、AC2 の unrelated process write 除外に巻き込まれて pass してはならない。
          stdlib-only race-tolerant mode を採る場合は、この AC は unsupported と明記する。
    
    AC5: #1236 の stale_worktree_runtime_state precheck と stdout ARTIFACT projection fail-closed が回帰しない。
    
    AC6: _git_status_paths / _snapshot_repo_paths の検出範囲を変更する場合、target issue の allowed artifact root 以外への self-write を少なくとも 1 件の fixture child で実証する。
    

    実装レビュー観点での結論

    #1343 は採用すべきですが、実装前に契約を硬くしてください。

    特に禁止すべき実装は次です。

    - .claude/worktrees/** を丸ごと unauthorized check から除外する
    - .claude/artifacts/issue-refinement-loop/<target以外>/** を丸ごと除外する
    - after_snapshot から allowed_write_roots 外を見ないようにする
    - 「inotify で監視したから process attribution 済み」と主張する
    - self-write into volatile roots の negative test なしで AC3 達成とする
    

    推奨する issue 本文の追記はこれです。

    ## Implementation Mode
    
    本 Issue は以下のどちらか一方を実装前に選択する。
    
    ### Option A: strict process-attributed mode
    - child process tree の file write attribution を OS-level tracing 等で取得する。
    - child が `.claude/worktrees/**` または別 issue artifact root へ書いた場合も unauthorized_write_path として fail-close する。
    - tracer が利用不能な場合は fail-closed または explicit skip とし、silent pass にしない。
    - 新規 dependency / Linux 前提 / trace artifact sanitization が必要な場合は Stop Conditions とする。
    
    ### Option B: stdlib race-tolerant mode
    - 標準ライブラリのみで peer-session false positive を抑制する。
    - この場合、`.claude/worktrees/**` / other issue artifact root への child self-write を完全に識別できるとは主張しない。
    - AC3 の保証範囲を `.cache/**` 等の non-volatile outside path に限定し、volatile roots への strict attribution は follow-up Issue に分離する。

    この追記なしで実装に進めると、最もあり得る失敗は「#1343 の誤検知は消えたが、root preflight.run の artifact-only write boundary が弱くなった」というものです。今回の guard は安全境界なので、false positive 修正よりも false negative を作らない契約設計を優先すべきです。


    you asked

    message time: 2026-07-06 02:01:21

    このGitHub Issueを起表することになった要因としては、エージェントスキルの作成時において、ローカルでAIエージェントが複数並列で作業するという設計思想が反映されていなかったことが要因だと思います。
    再発防止のため、エージェントスキルの変更を行うときに、参照するべき運用設計書をAIエージェントにトークン消費を少なく読み込ませるような動線の確保が必要だと思いました。
    人間からの提案としては、GitHub Issueに参照するべきドキュメントのファイルパスやマークダウンであれば、セクション名を明示することが効果的なのではないかと思いました。
    また、AIエージェント運用設計に同じ環境で複数並列でも作業が破綻しないことが要件として書かれているか確認してほしいです。


    chatgpt response

    設計要因の仮説は妥当そうです。リポジトリ内の運用設計書・Skill境界ドキュメントに「同一環境で複数エージェントが並列稼働する前提」が明文化されているか、まず文書側を検索します。

    現時点の検索では、「worktree」「artifact root」「stale state」は文書化されていますが、「同一ローカル環境で複数AIエージェントが並列稼働すること」を正面から要求化した記述はまだ見えていません。関連しそうな設計文書を数本、狙って確認します。

    確認結果としては、あなたの仮説はかなり妥当です。

    現在の文書体系には、worktree 分離・Allowed Paths・root/main 保護・stale runtime state・CWD 誤認の設計はあります。しかし、今回の #1343 の直接原因である 「同一ローカル環境で複数 AI エージェント/複数セッションが同時に repo 内へ書き込む」前提は、運用要件として十分に明文化されていません。

    確認したこと

    docs/dev/workflow.md は SSOT を最上位に置き、Skill / SubAgent は正本ではなく「AI 向け実行コンテキスト」層だと定義しています。また、Skill に長文 SSOT を重複保持せず、必要な section / script / reference を段階的に読む progressive disclosure を優先すると明記しています。これは、あなたの「Issue に参照すべき doc path と section を明示する」提案と方向性が一致します。

    同じく workflow.md には、AI エージェントは実装着手前に対象トピックの SSOT を SSOT Routing Table から確認する、とあります。ただし現在の routing table は「SubAgent / Skill 責務境界」「workflow」「runtime-verification」などの大分類であり、並列エージェント運用・共有 repo 内の race 耐性を明示的に引けるトピックがありません。

    docs/dev/agent-skill-boundaries.md は、Skill / SubAgent 定義に詳細を埋めるとコンテクスト汚染になるため、この文書を正本にする、と書いています。さらに、SubAgent は隔離されたコンテクストで動く実行者、Skill は再現可能な手順書であり、共通説明は references または本ドキュメントに置くべきだとしています。

    一方で、#1343 に直接関係する Privileged Skill Runtime Command Boundary は、preflight.run の root allow、allowed write root、filesystem snapshot/postcondition、repo tree outside allowed artifact root への変更検出を定義していますが、snapshot 取得中に他セッションが同じ repo tree に書くという並行実行モデルまでは扱っていません。

    implement-issue skill には worktree 作成、.claude/worktrees/ 配置、worktree 内の絶対パス指定、Allowed Paths 重複チェックがあります。ただしこれは主に「自分の実装作業をどこで行うか」「Allowed Paths が他 Issue と競合するか」の話であり、別セッションの書き込みを runtime guard が自分の副作用と誤認しないことまでは要件化していません。

    docs/dev/agent-runtime-ops.md は Codex runtime、permission profile、sandbox、write guard を扱っています。CODEX_ALLOWED_PATHS_MODE には CI/自動化は strict、interactive は workspace、shadow は観測用という整理がありますが、これも「同一 repo で複数 agent が同時稼働する場合の race-safe 要件」ではありません。

    context-mode-cwd-quarantine.md には、wrong-tree 実行が read-only でも証跡を誤らせる、という重要な考え方があります。これは #1343 と近い設計思想ですが、対象は CWD / MCP execution-like tools の quarantine であり、複数 agent の同時書き込みによる repo snapshot drift ではありません。

    結論

    現状の設計書には、次の要素はあります。

    観点 現状
    Skill / SubAgent / SSOT の責務分離 ある
    token 節約のための progressive disclosure ある
    worktree 配置規約 ある
    Allowed Paths / scope collision ある
    root preflight.run の privileged boundary ある
    stale worktree / wrong CWD の問題意識 ある
    同一ローカル repo で複数 AI agent が並列稼働する前提 弱い / 明文化不足
    parallel agent safe / race-safe guard の要件 不足

    したがって、#1343 の根本要因は「実装者が見落とした」というより、Skill runtime / guardrail 設計時に “single agent が唯一の writer” に近い暗黙前提が残っていたことだと見てよいです。

    再発防止として入れるべき動線

    人間提案の「Issue に参照すべきドキュメント path と Markdown section 名を明示する」は有効です。むしろ既存 SSOT 方針と整合しています。workflow.md は、SSOT を編集したら prompt 層・guardrail 層も同 PR で更新すること、できない場合は follow-up と未反映リスクを記録することを求めています。

    ただし、単なる任意記述だと忘れられます。Issue テンプレートまたは contract schema に、以下のような section を追加するのがよいです。

    ## Required Design References
    
    実装前に以下の SSOT / design section を読むこと。
    
    - `docs/dev/workflow.md`
      - `## 全体像(3 階層構造)`
      - `## Worktree 配置規約`
      - `## SSOT Routing Table`
    - `docs/dev/agent-skill-boundaries.md`
      - `## Privileged Skill Runtime Command Boundary`
    - `docs/dev/agent-runtime-ops.md`
      - `## CODEX_ALLOWED_PATHS_MODE`
    - `docs/dev/agent-ops/context-mode-cwd-quarantine.md`
      - `## build / test / git / repo grep / log summary の移送禁止方針`
    
    ## Parallel Agent Safety Applicability
    
    - decision: applicable | not_applicable
    - reason:
    - shared_repo_writes_considered: yes | no
    - peer_session_write_drift_handling:
    - required_negative_tests:

    追加すべき SSOT

    既存文書に追記するなら、第一候補は docs/dev/agent-skill-boundaries.md です。理由は、Skill / SubAgent 定義に共通説明を埋めず、この文書を正本にする方針がすでにあります。

    追加する section 名は、例えばこれがよいです。

    ## Parallel Agent Runtime Safety(並列エージェント実行安全性)

    入れるべき要件は短くてよいです。

    - AI agent / SubAgent / Skill runtime は、同一ローカル repo 内で複数セッションが並列稼働しうる前提で設計する。
    - repo-wide before/after snapshot を「自プロセスの副作用」とみなしてはならない。
    - allowed_write_roots 外 write の検出を行う場合、peer-session write drift と self-write を混同しない設計・テストを要求する。
    - `.claude/worktrees/**`、`.claude/artifacts/**`、`.guard_shadow_log.jsonl`、context/runtime artifact など、他セッションが合法的に更新しうる volatile roots を列挙し、guard の扱いを明示する。
    - false positive を避けるために volatile root を除外する場合、self-write bypass を作らない negative test を必須にする。
    

    さらに docs/dev/ssot-registry.md に、この新 section を discovery できる keyword を足すべきです。現在の registry は agent-skill-boundaries に agent, skill, subagent, control-plane, data-plane などはありますが、parallel, concurrent, race, same repo, shared environment 相当の keyword がありません。

    #1343 に追記するなら

    #1343 には、次を Required Design References として追記するのが最小です。

    ## Required Design References
    
    - `docs/dev/workflow.md`
      - `## 全体像(3 階層構造)`
      - `## Worktree 配置規約`
      - `## SSOT Routing Table`
    - `docs/dev/agent-skill-boundaries.md`
      - `## Privileged Skill Runtime Command Boundary`
    - `docs/dev/agent-runtime-ops.md`
      - `## CODEX_ALLOWED_PATHS_MODE`
    - `docs/dev/agent-ops/context-mode-cwd-quarantine.md`
      - `## build / test / git / repo grep / log summary の移送禁止方針`
    
    ## Design Assumption
    
    同一ローカル repo では、main/root session、worktree session、review/test session、別 agent の artifact writer が同時に稼働しうる。  
    `skill_runtime_exec.py` の unauthorized write detection は、この peer-session write drift を自プロセスの副作用として扱ってはならない。

    別 Issue として起こすなら

    起票するなら、タイトルはこれがよいです。

    実装/Docs: 並列エージェント実行安全性を SSOT 化し、Issue contract に Required Design References を追加する
    

    Allowed Paths は最低限これです。

    - docs/dev/agent-skill-boundaries.md
    - docs/dev/ssot-registry.md
    - docs/dev/workflow.md
    - .github/ISSUE_TEMPLATE/implementation.yml
    - .claude/skills/create-issue/references/body-authoring.md
    - .claude/skills/issue-contract-review/scripts/contract_readiness_check.py
    

    contract_readiness_check.py まで入れる理由は、Required Design References を「書いてあるとよい」ではなく、implementation issue の readiness / contract review で検出できるようにするためです。自然言語の注意だけだと再発防止として弱いです。

  3. squne121 commented on Jul 5, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-05T17:33:25Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1343
      body_sha256: "sha256:d2c754582e4f08e5060c0ead46d7f3d94b7dc4cfd18b0263d199e683268218dd"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        vc_preflight: pass
      source: ensure_contract_snapshot_auto
  4. squne121 commented on Jul 5, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

    LOOP_HANDOFF_RESULT_V1:
      status: impl_ready
      routing_action: run_impl_review_loop
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: https://github.com/squne121/loop-protocol/issues/1343#issuecomment-4886983919
        generated_at: '2026-07-05T17:33:39.887366+00:00'
        body_sha256: sha256:d2c754582e4f08e5060c0ead46d7f3d94b7dc4cfd18b0263d199e683268218dd
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: '2026-07-05T17:33:39.887366+00:00'
      checked_body_sha256: sha256:d2c754582e4f08e5060c0ead46d7f3d94b7dc4cfd18b0263d199e683268218dd
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  5. squne121 commented on Jul 5, 2026

    @squne121
    OwnerAuthor

    並列エージェント実行安全性の SSOT 化 follow-up を起票しました: #1346

  6. squne121 commented on Jul 5, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-07-05T18:47:00Z)

    • PR: fix: 契約実行ラッパーの unauthorized_write_path 誤検知を修正する #1349
    • Worktree: .claude/worktrees/issue-1343-fix-unauthorized-write-path
    • Branch: worktree-issue-1343-fix-unauthorized-write-path
    • Verification: AC1〜AC4 対応の新規テスト 4/4 PASS、既存回帰テスト(test_skill_runtime_preflight_no_worktree.py)20/20 PASS、scripts/agent-guards/tests/ 全473件 PASS
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  7. squne121 commented on Jul 6, 2026

    @squne121
    OwnerAuthor

    Contract Review Result (refresh — supersedes issuecomment-4886983919)

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-06T10:50:33Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1343
      body_sha256: "sha256:9a2f2a3b4cbd4a08231cefc80cdf0d57e156eb1d4d8e192ef1a0c1ff4f8d0169"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        vc_preflight: pass
      source: run_contract_review_once_manual_refresh
      supersedes: https://github.com/squne121/loop-protocol/issues/1343#issuecomment-4886983919
      refresh_reason: "PR #1349 への人間 REQUEST_CHANGES を受け AC3/AC5/Out of Scope を狭めたため (Option B)"
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