Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "controlled_skill_mutation_exec の postcondition checker を、mutation 前後の実際の変更(内容改変を含む)を正しく検出する metadata-snapshot 方式へ置き換え、生成元不明のグローバル untracked artifact(.claude/.investigation-context.md 等)の扱いを明確化する"
change_kind: codeParent Issue
none
Parent Goal Ref
- Goal: N/A(単独改善)
- Desired Destination: N/A(単独改善)
Current Validated Scope
scripts/agent-guards/controlled_skill_mutation_exec.pyの_check_no_tracked_changes(postcondition checker、863行目付近)を、git status行の集合差分方式から、mutation 前後の filesystem metadata snapshot(scripts/agent-guards/skill_runtime_exec.pyの_snapshot_repo_paths/_find_unauthorized_repo_changesに準ずる mtime/size 比較)方式へ置き換える.claude/.investigation-context.mdの生成元不明問題(Issue 実装: controlled_skill_mutation_exec の postcondition が事前存在 untracked ファイルを誤検知する不具合を修正する #2163 anchor review Blocker 4)への対処を In Scope に含める- remote mutation 成功後の local postcondition failure と mutation 未実行(precondition reject)を区別する recovery contract の明記を In Scope に含める
Remaining Parent Gaps
なし
Outcome
scripts/agent-guards/controlled_skill_mutation_exec.py の _check_no_tracked_changes が、git status --porcelain=v1 --untracked-files=all 出力行の単純な集合差分ではなく、mutation 実行前後の filesystem metadata snapshot(skill_runtime_exec.py の _snapshot_repo_paths に準ずる path → (kind, mtime_ns, size) 比較)に基づいて実際の変更を検出するようになり、以下がすべて成立している状態:
- mutation 実行前から存在し、mutation 中に内容が変化しなかった untracked / modified ファイルは violation として誤検知されない(false positive 修正)。
- mutation 実行前から存在するが、mutation 中に内容が上書き・追加改変された untracked / modified ファイルは、引き続き violation として検出される(現行の集合差分方式が見逃す false negative の修正)。
- mutation によって新規に発生した tracked/staged/unstaged/untracked 変更(
allowed_prefix配下を除く)は引き続き violation として検出される(既存 fail-closed 挙動の non-regression)。 .claude/.investigation-context.mdのようなグローバル untracked runtime artifact について、生成元の調査結果と、本 repo が制御可能な artifact か否かに応じた扱い(namespace 化された artifact 領域への移行、または明示的な exemption の設計文書化)が記録されている。issue_body.update/issue_comment.publish相当の呼び出し箇所(1152行目・1416行目付近)が、remote mutation 成功後に postcondition が fail した場合のmutation_outcome相当のフィールドを、既存のissue_content.update(1237行目付近)と同等に返すようになっている。
対応する回帰テストが scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py に追加されて green になっている。
In Scope
_check_no_tracked_changes(scripts/agent-guards/controlled_skill_mutation_exec.py:863)の実装を、mutation 前後のgit status行の集合差分ではなく、mutation 前後で取得した filesystem metadata snapshot(path → (kind, mtime_ns, size) の dict。scripts/agent-guards/skill_runtime_exec.py:592の_snapshot_repo_pathsと同種の方式)の比較に置き換える。既存の呼び出し全 9 箇所(scripts/agent-guards/controlled_skill_mutation_exec.py:1055,1152,1237,1416,2058,2113,2396,3087,3775)で、mutation 前 snapshot と mutation 後 snapshot を一貫して比較する形に修正する。- 明確化:
scripts/agent-guards/controlled_skill_mutation_exec.py:2956と:3663に既存するpre_mutation_changedは、mutation 前の clean/dirty 状態を一度だけ確認する binary precondition gate(precondition_tracked_changes_detectedの判定にのみ使う)であり、本 Issue で新設する postcondition 用の pre/post snapshot 比較機構とは別物である。この変数の意味論・呼び出し方は変更しない。
- 明確化:
- mutation 実行前から存在した untracked ファイル(例:
.claude/.investigation-context.md相当の固定パス)で、mutation 中に内容が変化しなかったケースが violation として誤検知されないことを確認する回帰テストを追加する(false positive 修正の検証)。 - mutation 実行前から存在した untracked / modified ファイルの内容が mutation 中にさらに上書き・追加改変されたケースが violation として検出されることを確認する回帰テストを追加する(現行の集合差分方式の false negative 修正の検証)。
- mutation によって新規に発生した tracked/staged/unstaged/untracked 変更(
allowed_prefix配下を除く)が引き続き violation として検出されることを確認する回帰テスト(既存の意図した fail-closed 挙動の non-regression)を追加する。 .claude/.investigation-context.mdの生成元を調査する。本 Issue の起票前調査で repo 内rg -n "investigation-context"はゼロ件(producer/consumer の記述なし)、.gitignoreにも未定義であることを確認済み。実装時に以下を判定し、結果を Notes for Reviewer またはコミットメッセージに記録する:- 生成元が本 repo 内のスクリプトである場合: 書き込み先を既存の namespace 化された artifact 領域(
artifacts/{issue_number}/issue-metadata/{command_id}/等)へ変更する PR、または追加の是正 Issue の起票が必要かを判断する。 - 生成元が本 repo 外(Claude Code 本体等の外部ツール)であり、本 repo 側で書き込み先を制御できないと判明した場合:
skill_runtime_exec.pyの_race_tolerant_unattributable_roots(実装参考: 同ファイル内の peer-root 除外パターン)に準ずる明示的な exemption として postcondition checker 側で扱い、その判断根拠をdocs/dev/agent-skill-boundaries.md等の既存設計文書へ追記する。 - いずれの場合も、
.gitignoreへの追加のみで済ませて根本原因の記録を省略しない。
- 生成元が本 repo 内のスクリプトである場合: 書き込み先を既存の namespace 化された artifact 領域(
scripts/agent-guards/controlled_skill_mutation_exec.py:1152(issue_body.update相当)および:1416(issue_comment.publish相当)の postcondition failure(postcondition_tracked_changes_detected)に、remote mutation 成功後の failure であることを示すextra={"mutation_outcome": "applied"}相当のフィールドを追加し、mutation 未実行(precondition reject)との区別を明示する recovery contract を明記する。既存のissue_content.update(1237行目付近の_finalize_remote_success)が既にこのパターンを実装していることを設計参考とする。
Out of Scope
.claude/.investigation-context.mdを生成している具体的な外部プロセス(Claude Code 本体の内部実装等)そのものの改修(本 repo の管理外であるため)。In Scope 5 は調査・判定・repo 側での扱いの決定までを対象とし、repo 外プロセスの改修は対象外。issue_scope_snapshot.materialize(1055行目)、issue_relationship.update(3087行目)、test_verdict.publish(2058, 2113行目)、contract_snapshot.publish(2396行目)の postcondition failure へのmutation_outcomeフィールド追加(In Scope 6 はissue_body.update/issue_comment.publishの2箇所に限定する。他コマンドへの拡張は別 Issue とする)。- postcondition チェック・
.claude/.investigation-context.mdの扱い・recovery contract 以外のcontrolled_skill_mutation_exec.pyの挙動変更。
Acceptance Criteria
- AC1:
_check_no_tracked_changesが mutation 実行前後の filesystem metadata snapshot(path → (kind, mtime_ns, size))を比較する実装になっている(git status行の単純な集合差分ではない)。 - AC2: mutation 実行前から存在し内容が変化しなかった untracked ファイルがある状態で controlled mutation を実行しても、そのファイルが原因で
postcondition_tracked_changes_detectedが発生しないことを確認する単体テストが追加されている。 - AC3: mutation 実行前から存在した untracked / modified ファイルの内容が mutation 中に上書き・追加改変された場合、
postcondition_tracked_changes_detectedとして検出されることを確認する単体テストが追加されている(false negative 修正の検証)。 - AC4: mutation 実行中に新規の tracked/untracked 変更(
allowed_prefix配下を除く)が発生した場合は、引き続きpostcondition_tracked_changes_detectedとして検出されることを確認する単体テスト(既存挙動の non-regression)が追加されている。 - AC5:
issue_body.update(1152行目付近)とissue_comment.publish(1416行目付近)の postcondition failure がmutation_outcomeを含む extra を返すことを確認する単体テストが追加されている。 - AC6:
.claude/.investigation-context.mdの生成元調査結果と、本 repo 側での扱い(namespace 化 or 明示的 exemption + 設計文書追記)が Notes for Reviewer またはコミットメッセージに記録されている。 - AC7: 既存の
scripts/agent-guards/tests/test_controlled_skill_mutation_exec.pyの全テストが green のまま維持されている。
Verification Commands
# AC1
# baseline-expect: pass
$ rg -n "_check_no_tracked_changes" scripts/agent-guards/controlled_skill_mutation_exec.py
# AC2
# baseline-expect: fail
$ rg -n "test_postcondition_ignores_preexisting_untracked_file_no_content_change" scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py
# AC3
# baseline-expect: fail
$ rg -n "test_postcondition_detects_content_change_to_preexisting_file" scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py
# AC4
# baseline-expect: fail
$ rg -n "test_postcondition_detects_new_untracked_or_tracked_change" scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py
# AC5
# baseline-expect: fail
$ rg -n "test_issue_body_update_postcondition_failure_reports_mutation_outcome" scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py
# baseline-expect: fail
$ rg -n "test_issue_comment_publish_postcondition_failure_reports_mutation_outcome" scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py
# AC6
# baseline-expect: fail
$ rg -n "investigation-context" scripts/agent-guards/controlled_skill_mutation_exec.py docs/dev/agent-skill-boundaries.md
# AC7
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py -vAllowed Paths
- scripts/agent-guards/controlled_skill_mutation_exec.py
- scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py
- docs/dev/agent-skill-boundaries.md
- .gitignore
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
.claude/.investigation-context.mdの生成元調査の結果、repo 外の広範な改修(Claude Code 本体側の変更等)が必要と判明した場合- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- Python(filesystem stat / snapshot比較 / subprocess)
- pytest(既存テストスイートへの追加)
Required Design References
- docs/dev/agent-skill-boundaries.md(
controlled_skill_mutation_exec.pyの executor 契約・postcondition 設計の正本) - scripts/agent-guards/skill_runtime_exec.py(
_snapshot_repo_paths:592行目、_find_unauthorized_repo_changes:1261行目付近。metadata-snapshot 方式の設計参考) - scripts/agent-guards/controlled_skill_mutation_exec.py(該当関数の docstring: "Uses git status --porcelain=v1 --untracked-files=all."。本 Issue で置き換える対象)
Runtime Verification Applicability
- decision: not_applicable
- reason: 本 Issue は
controlled_skill_mutation_exec.pyの postcondition checker ロジックとscripts/agent-guards/tests/test_controlled_skill_mutation_exec.pyへの単体テスト追加のみを対象とし、プロセス起動・外部通信・GitHub API 呼び出し等の実環境 I/O を伴う統合的な動作検証を必要としない。pytest によるユニットテスト(AC2-AC5, AC7)と rg による静的検査(AC1, AC6)で完結する。
Scope Delta(任意)
N/A
Notes for Reviewer
- 本 Issue は 調査: web-researcher の AGY→native fallback 分岐を E2E で実証するテスト設計を調査する #2157(issue-refinement-loop 自律実行)の作業中に、
edit_issue_txn.py(issue_content.update)とpublish_termination_report.py(issue_comment.publish)が、GitHub 側の mutation 自体は成功しているにもかかわらずpostcondition_tracked_changes_detectedでfailed_after_mutationを計 4 回誤報告した事象の再発防止として起票した。 - 原因特定済み:
_check_no_tracked_changes(scripts/agent-guards/controlled_skill_mutation_exec.py:863-897)は mutation 後のgit status --porcelain=v1 --untracked-files=allを 1 回実行するだけで、allowed_prefix(artifacts/{issue_number}/)配下を除く全ての staged/unstaged/untracked エントリを violation として扱う。mutation 実行前から repo に存在していた untracked ファイル(.claude/.investigation-context.md等)は mutation と無関係だが、pre-mutation baseline との比較を行っていないため区別できず誤検知する。 - OWNER anchor review(issue 実装: controlled_skill_mutation_exec の postcondition が事前存在 untracked ファイルを誤検知する不具合を修正する #2163 comment 5299549274,
recommended_route: reframe_in_place)を反映し、以下の点を明確化・訂正した:- 単純な
git status行の集合差分方式は、既存 untracked/modified ファイルの内容上書きを見逃す false negative を生む。skill_runtime_exec.pyの既存 metadata-snapshot 方式(_snapshot_repo_paths: 592行目、_find_unauthorized_repo_changes: 1261行目付近)を設計参考として採用する。 scripts/agent-guards/controlled_skill_mutation_exec.py:2956,3663のpre_mutation_changedは mutation 前の binary precondition gate であり、postcondition の pre-snapshot 基準としては使われていない(旧本文の誤読を訂正)。.claude/.investigation-context.mdは repo 内に producer/consumer の記述が一切なく(rg -n "investigation-context"ゼロ件)、.gitignoreにも未定義のグローバル singleton パスである。Issue 実装: preflight.run.with_human_context に gh fixture 対応を追加し AC3 positive route の real subprocess E2E を完成する #2136 / PR feat(refinement): fixture human-context runtime profile #2143 の--investigation-evidence-transport-pathや.claude/artifacts/issue-refinement-loop/<issue_number>/、および Issue 実装: 契約実行ラッパーの unauthorized_write_path 誤検知が repo root artifacts/ 配下でも発生する問題を修正する #1409 の先例(artifacts/全体の race-tolerant 除外は却下されartifacts/<issue>/issue-metadata/{command-id}/の namespace 化が採用された)に倣い、本 Issue では生成元調査と repo 側での扱いの決定までを In Scope に含める。issue_content.update(1237行目付近)は postcondition failure 時にmutation_outcome: "applied"を extra に付与済みだが、issue_body.update(1152行目)・issue_comment.publish(1416行目)は未対応であることを確認し、この2箇所への同等対応を In Scope に追加した。
- 単純な
- 優先度: 緊急性は低い(回避策として control-plane 側の独立 readback 検証が既に有効)が、将来 control-plane がこの検証を怠った場合に偽の human escalation を誘発するリスクがあるため修正を推奨する。
- Scope Collision (C1, advisory): overlap preflight により
scripts/agent-guards/controlled_skill_mutation_exec.py/scripts/agent-guards/tests/test_controlled_skill_mutation_exec.pyが OPEN Issue 実装: edit-issue の native relationship pagination reader を controlled executor に一本化し totalCount 検証を追加する #1916(edit-issue の native relationship pagination reader を controlled executor に一本化する Issue)と重複した。non_conflict_reason: 実装: edit-issue の native relationship pagination reader を controlled executor に一本化し totalCount 検証を追加する #1916 は pagination/totalCount 検証ロジックの一本化が対象であり、本 Issue の対象(postcondition の pre/post metadata snapshot 比較への置き換え)とは扱う関数・懸念が異なるため直接のコード競合は想定していない。ただし同一ファイルへの並行実装となるため、着手順序(どちらかを先にマージしてから他方を rebase する)に注意すること(導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 Owner Decision により advisory・起票停止理由にしない)。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Aug 14, 2026
[create-issue] post-create ready tuple validation FAILED: title prefix or phase/implementation label missing. Manual fix required.
squne121 commentedon Aug 14, 2026
そもそも「.claude/.investigation-context.md」って何。何のために必要なファイルですか?AIエージェントが出力するファイルとしては、複数並列作業が想定されていないファイルに見えます。また、ファイルの出力場所もフォルダの運用として適切とは思えません。添付フォルダ配下に出力した方が適切ではないですか。
そもそも運用が想定されていないuntrackedファイルが出力されるワークフローの設計が間違っているのではないですか。ワークフローの見直しも併せて行ってください。
squne121 commentedon Aug 15, 2026
判定
REQUEST_CHANGES — 現状の契約では実装着手不可。
reframe_in_placeが必要です。指定 OWNER コメントは、
.claude/.investigation-context.mdの正体・必要性・生成元・並列安全性・配置・ワークフロー全体の見直しを要求しています。一方、Issue #2163 はその調査と呼び出し元変更を明示的に Out of Scope にし、postcondition checker だけを修正しようとしています。AC をすべて満たしても OWNER 要求は未達のままです。Blocker 1 — OWNER 要求と Issue のスコープが正面から矛盾している
現在の Issue は、次を Out of Scope にしています。
.claude/.investigation-context.mdの生成元・用途の調査.gitignoreや配置の是正edit_issue_txn.py、publish_termination_report.pyなど呼び出し元の変更しかし OWNER コメントは、そのすべてを調査・是正するよう要求しています。これは軽微な scope delta ではなく、Issue の問題定義そのものが OWNER 判断後も更新されていない状態です。
現行 AC は、次の危険な状態でも green になります。
.claude/.investigation-context.mdは残存する。したがって、現在の Out of Scope は削除または反転しなければなりません。
Blocker 2 —
after_status - before_statusは書き込み検出ではなく、重大な false-negative を導入するIssue が要求する「mutation 前後の
git status行の集合差分」は、ファイルの変更を検出する仕組みではありません。Git status という状態の射影結果が新たに現れたかだけを判定します。例えば、次はすべて見逃します。
つまり AC1 の「新規に増えた violation のみ」という不変条件は、既存 dirty path への任意の上書きを許可する fail-open 条件です。
現行 checker も、
splitlines()とline[3:]で non--zporcelain を直接解釈し、path.startswith(allowed_prefix)で許可判定しています。Git の公式仕様では、non-
-zの rename はorig-path -> pathという複合フィールドで、特殊文字を含む pathname は C-style quoting されます。機械処理には-zが推奨され、rename 時には二つの pathname を個別に処理する必要があります。(Git)したがって、現在の prefix 判定には次の問題もあります。
この文字列は
artifacts/2163/から始まるため、移動先が許可範囲外でも許可される可能性があります。逆方向の rename は false-positive になります。改行、タブ、引用符、バックスラッシュを含む pathname も正しく扱えません。修正要求: status 行の集合差分を AC から削除してください。dirty baseline を本当に許容する必要がある場合は、少なくとも path kind・inode/metadata・内容 digest を含む before/after transition を扱う必要があります。通常の remote mutation では、後述する clean precondition の方が適切です。
Blocker 3 —
pre_mutation_changedを「pre-snapshot」と解釈しているのは事実誤認Issue は、一部呼び出し箇所に
pre_mutation_changedがあり、「pre-snapshot を取る設計思想が部分的に存在する」と説明しています。実装上の
pre_mutation_changedはスナップショットではありません。これは remote mutation 前に dirty worktree を全面拒否するprecondition gateです。その値を postcondition と比較していません。
この誤読は実装方針に直接影響します。共通 checker を「既存 dirty entry は許容する」意味へ変更すると、現在 clean worktree を要求している relationship mutation の precondition まで弱体化する可能性があります。
必要なのは、次の二つの概念の分離です。
collect_worktree_violations()現時点の違反を列挙する純粋な状態検査
RepoMutationTransactionまたは明示的な before-state tokenmutation 前後の transition を扱う処理
同じ
_check_no_tracked_changes()に両方の意味を持たせてはいけません。Blocker 4 —
.claude/.investigation-context.mdは未所有のグローバル runtime state今回の tracked tree、Issue、PR 検索では、このファイル名を生成・消費する tracked producer/consumer は特定できませんでした。したがって、内容や生成主体を推測で断定すべきではありません。
一方で、少なくともこれは Claude Code の標準ファイルではありません。公式ドキュメントが project
.claude配下の共有機構として説明しているのは、CLAUDE.md、settings、hooks、skills、commands、subagents、rules などです。Claude Code の auto memory は~/.claude/projects/<project>/memory/に保存されます。(Claude)リポジトリ自身の folder policy でも、一時的な新規書き込み先は
tmp/が canonical、.claude/tmp/は deprecated とされています。.claude/.investigation-context.mdは承認済み一時領域でも、tracked configuration surface でもありません。.gitignoreにもこのファイルの定義はありません。さらにリポジトリには、既に正式な investigation evidence transport があります。
--investigation-evidence-transport-pathこれは Issue #2136/PR #2143 で実装済みです。
run_refinement_preflight.pyも canonical artifact として、次を.claude/artifacts/issue-refinement-loop/<issue_number>/に出力します。refinement_preflight_result_v1.jsonraw_issue_snapshot.jsonplanner_input.jsonしたがって
.claude/.investigation-context.mdを checker で無視するのではなく、用途に応じて次へ移すべきです。tmp/issue-refinement-loop/<issue>/<run-id>/.claude/artifacts/issue-refinement-loop/<issue>/<run-id>/artifacts/<issue>/issue-metadata/<command-id>/同一 Issue を並行実行する可能性があるため、Issue 番号だけでなく
run-idまたは content-addressed filename が必要です。Claude Code 公式仕様でも、並列セッションのファイル衝突回避は worktree isolation が基本です。単一 checkout を複数セッションで共有し、その直下に singleton state を置く設計は、このモデルと整合しません。(Claude)
Blocker 5 — 現在の障害は「偽 escalation」だけでなく、remote 適用後の回復不能状態を作る
issue_body.updateは、次の順序で動作します。_check_no_tracked_changesつまり postcondition が false-positive になると、remote mutation は適用済みなのに marker が書かれません。
再試行時の
already_applied判定は、local marker が存在する場合にしか実行されません。marker がない場合は、remote body が既に新しい hash であってもprevious_body_sha256との比較へ進み、stale precondition failure になります。これは次の状態を意味します。
Issue #2163 はこれを「緊急性は低い」と分類していますが、少なくとも
issue_body.updateでは、単なる表示上の偽陽性ではありません。transaction recovery contract の欠陥です。他の command も挙動が統一されていません。
issue_comment.publishは remote POST 後に checker を実行する一方、既存 remote marker が見つかった retry path では同じ checker を実行せず成功します。issue_content.updateは postcondition failure にmutation_outcome: appliedを付けますが、他 command は一貫していません。修正要求:
failedと区別する。issue_body.updateは local marker がなくても、remote body がnew_body_sha256と一致すれば idempotent recovery できるようにする。Major findings
P1 — リポジトリ内の先行実装を無視し、より弱い checker を再実装しようとしている
skill_runtime_exec.pyには既に、次を組み合わせた repo-state guard があります。git status --porcelain=v1 ... -z特に
_find_unauthorized_repo_changes()は、単なる status set difference だけでなく、作成・削除と既存 path の metadata 変化を統合して判定しています。これは完全な syscall attribution ではありませんが、#2163 の提案より明確に強い実装です。
Issue #2163 の Required Design References が、自ファイルの docstring 一件だけなのは不十分です。少なくとも次を normative reference に追加すべきです。
scripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.pydocs/dev/agent-skill-boundaries.mddocs/dev/repository-folder-policy.md共通 helper 抽出や folder policy 更新が必要になれば、現在の Allowed Paths 外です。これは現行 Stop Condition に該当するため、なおさら先に Issue の reframe が必要です。
P1 — 過去の OWNER 判断と逆方向
Issue #1343 では、並列 session の書き込みを正確に process attribution できないことを既知制約として明示し、限定された race-tolerant root を採用しています。
さらに Issue #1409/PR #1426 では、repo-root
artifacts/全体を broadly ignore する案が OWNER により却下されました。採用されたのは、writer の出力先を専用 subtreeartifacts/session-manifest-runtime/へ移し、その subtree だけを限定的に扱う方式です。cold start、ignored-directory folding、symlink/file parent substitution、独立 process による並列 writer まで検証されています。#2163 の「既存 status entry は一律に差し引く」は、この先例と逆です。
正しい方向は次です。
P1 —
git statusが並列実行向けになっていない現在の checker は通常の
git statusを実行しています。Git は、background process が
GIT_OPTIONAL_LOCKS=0またはgit --no-optional-locks statusを使用すると、status 実行時の optional index refresh を抑止し、他の Git operation との lock contention を避けられると公式に説明しています。(Git)複数 herdr session/複数 agent が同一 repository を扱う前提なら、machine parser は少なくとも次で固定すべきです。
git --no-optional-locks \ -C "$repo" \ status \ --porcelain=v1 \ --untracked-files=all \ -zただし、これだけで attribution 問題が解決するわけではありません。canonical main root で実行する privileged remote mutation は、transaction lock または明示的な single-writer policy も必要です。
P1 — Verification Commands が実装存在確認にとどまり、反証能力がない
AC1~AC3 の Verification Commands は、関数名やテスト名を
rgするだけです。これはテスト実装の存在を確認するだけで、安全性を検証しません。最低限、次の adversarial tests が必要です。
-zparser で処理する。推奨する修正設計
1. まず
.claude/.investigation-context.mdの producer/consumer inventory を作る少なくとも次を特定します。
producer が tracked code ではなく agent prompt 行動である場合も、該当 skill/agent definition を変更対象に含めます。
2. global singleton を撤去する
既存の
--investigation-evidence-transport-pathを使用し、consumer が暗黙の固定 path を読まないようにします。3. remote mutation は clean precondition を既定にする
precondition failure は次のようにします。
これにより、不正な
.claude/.investigation-context.mdが存在すれば remote side effect の前に停止し、workflow defect を隠しません。4. dirty baseline 対応は例外モードに限定する
本当に pre-existing dirty state を許容する command がある場合だけ、明示的な transaction mode を設けます。
単なる status string set difference は使用しません。
改訂後の Acceptance Criteria 案
.claude/.investigation-context.mdの producer、全 consumer、内容形式、lifecycle、cleanup owner が特定されている。.claude/.investigation-context.mdを作成・参照しない。precondition_rejectedとなる。-zを使用し、rename の双方と特殊文字 pathname を正しく処理する。mutation_outcome: appliedと remote receipt を返し、通常の未適用 failure と区別される。issue_body.updateは local marker が欠落していても remote readback により既適用状態から回復できる。skill_runtime_exec.pyの既存 guard に回帰がない。最終評価
問題の発端である false-positive 自体は実在します。しかし、Issue #2163 の提案は症状を消す代わりに、既存 dirty path への上書きを検出不能にする安全性退行を導入します。
OWNER コメントに対する正しい対応は、checker を寛容にすることではありません。
.claude/.investigation-context.mdの生成経路を特定する。skill_runtime_exec.py相当の transition guard を再利用する。現行 Issue はこの設計へ reframe されるまで、実装を開始すべきではありません。
squne121 commentedon Aug 15, 2026
issue-refinement-loop 終了報告(Issue #2163)
経緯
STATUS: warn/proceed_with_notes(scope_delta_decision.status: not_applicable、ANCHOR_SCOPE_REFRAME_V1payload なしのため freeform lane で継続)。codebase-investigatorにより OWNER anchor comment の5つの技術的 blocker(scope 矛盾/git status 集合差分の false-negative/pre_mutation_changedの誤読/所有者不明のグローバル untracked artifact/remote mutation recovery contract gap)をコードベース(controlled_skill_mutation_exec.py/skill_runtime_exec.py)と照合し、いずれも technical evidence で概ね妥当と確認。VERDICT: needs-fix(BLOCKERS: 3 — Required Design References 欠落 RDR001、Runtime Verification Applicability セクション欠落 C9、VC unexpected-pass baseline 注釈不備)。issue-editorへ委譲し、OWNER の5 blocker と review checker の3 blocker を全て反映した全面改訂を実施。BODY_HASHを独立 readback で確認。VERDICT: approve(BLOCKERS: 0、C9_runtime_applicability_present: pass含む全 deterministic checks pass)。contract_review.gate_result: missing_goの理由: 本 refinement loop ではissue-contract-review(実装着手直前の preflight)を実行していないため、impl-review-loopへの handoff 前にissue-contract-reviewを別途実行する必要がある。squne121 commentedon Aug 15, 2026
implement-issue: 実装完了 (2026-08-15T01:20:43Z)
.claude/worktrees/issue-2163-controlled-skill-mutation-exec-postcondiworktree-issue-2163-controlled-skill-mutation-exec-postcondifix: agent-skill-boundaries.md の新規見出しの日本語比率不足を解消する (#2163)
fix: controlled_skill_mutation_exec の postcondition を porcelain=v2 -z…
fix: controlled_skill_mutation_exec の postcondition を metadata-snapsh…