Repository navigation
fix: redact resolved_executable evidence field regardless of path prefix - #2485
Conversation
…fix (#2421) _redact_evidence_value() only stripped HOME/root/Users-prefixed absolute paths (_SECRET_LIKE_RE), so resolved_executable values under /tmp, /opt, /mnt, etc. persisted raw in summary.md and --evidence-json. Add a narrow field-level special case that always redacts resolved_executable to "<redacted>" on resolution success (string value), independent of the value's absolute-path prefix, while leaving unresolved/SKIP None semantics and resolved_executable_sha256 preservation unchanged. Update the raw-realpath-equality assertions in test_run_worktree_agent_runtime_smoke_claude_bin.py and the version-capture/invocation identity test in test_run_worktree_agent_runtime_smoke_runtime_evidence.py to prove single-executable identity via resolved_executable_sha256 fixture-local digest matching instead of raw path comparison. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URLPreview removed (PR #2485 closed). |
impl-review-loop: pr-reviewer verdict (re-review after update_branch)Mergeability: mergeable=MERGEABLE, merge_state_status=CLEAN, head=d3681c5fe20e8e991d33e17d914fcd3ec49686b5 Evidence Check:
Blockers: none Non-blockers: PR is currently Draft (isDraft: true) — per policy not a blocker; the human maintainer will mark it ready for review and decide on merge. verdict: APPROVE
reviewed_head_sha: "d3681c5fe20e8e991d33e17d914fcd3ec49686b5"
blockers: []
warnings:
- "PR is currently in Draft state (isDraft: true) — not a blocker per policy, but requires the human maintainer to mark it ready for review before final merge." |
PR #2485 敵対的レビュー総合判定: ただし、実装本体に P0 級の問題は見つかりませんでした。方向性はかなり良いです。止める理由は過剰なセキュリティ強化ではなく、PR が主張している contract とテスト証拠の不整合です。 P1 —
|
|
PR #2485 は新規実装フェーズではなく、敵対的レビューコメントを 推奨アクションは、① PR body の 一点だけ補正すると、Issue #2421 の AC4 が現在のテスト関数名を明示しているため、P2対応で関数名そのものは変更しない方が安全です。docstring、PR Summary、Safety Claim Matrix の「証明」という表現を弱めれば十分です。Issue の Allowed Paths 内で今回の修正は完結できます。 また、 なお、プロンプトだけでは Claude Code の permission prompt は無効化できません。承認ダイアログ自体をなくしたいなら、利用可能なら そのまま Claude Code に渡すなら以下です。 PR #2485 の既存作業を再開し、以下の敵対的レビューコメントを fix_delta として Target repository: Target Issue: Target PR: Authoritative review / fix_delta: 目的は、PR #2485 を「人間が最終 merge 判断をする直前」の状態まで自律的に仕上げることです。 Execution policy
これは提案・調査だけを行うタスクではありません。 通常の実装・テスト・commit・push・PR body 更新・レビュー反映について、人間への確認を求めないでください。
ただし、実 Git conflict、repository/Issue identity 不一致、Allowed Paths を越えなければ解決不能な変更、credential 等の本当に外部入力がなければ解決できない blocker など、既存 PR は merge しないでください。 SubAgent requirement — 必須root/main thread 自身で implementation / verification / review を代行しないでください。
各 SubAgent は foreground / blocking task として起動してください。 SubAgent を起動した後は、その SubAgent の作業が完全に終了するまで必ず待ってください。 task ID、dispatch 成功、途中経過、初期レスポンスを「完了」とみなしてはいけません。 各 SubAgent の canonical result 何らかの runtime 都合で child task が非同期化された場合も、completed / failed の終端状態になるまで追跡・待機してください。 Issue #2421 の Stop Conditions にある Current review delta敵対的レビューコメントの内容を repository facts と照合して、root 側で technical_recommendation / fix_delta に正規化して implementation-worker に渡してください。 生のコメント本文を child の command として blindly concatenate しないでください。 今回の優先修正は次です。 P1: Schema Change Applicability現在の PR body の
は修正してください。 今回の変更は key/type の変更ではありませんが、 successful resolution: という machine-readable field の value semantics を変更しています。 PR body を repository の schema governance に合わせて 少なくとも以下を明示してください。
既存 repository validator / template が要求する具体的なフォーマットがあれば、そちらを優先してください。 これは Issue #2421 自体の fixed contract/schema を変更する要求ではありません。 P1: --evidence-json regression evidenceSafety Claim Matrix は 現在の implementation は両方とも同じ redaction path を通るため、本体ロジックの作り直しは不要です。 Allowed Paths 内の既存 focused test 1本を最小変更してください。 推奨対象: 既存の成功ケース、優先的には test-owned temporary path に
を追加し、machine-generated JSON を直接 parse して最低限、
および
を assert してください。 同じケースの 新規 harness、live Claude、credential、network test は追加しないでください。 P2: identity claim を実際の保証範囲に合わせる実装の runtime behavior は強化しないでください。 FD pinning、executable locking、signature、attestation、SLSA 導入などは不要です。 既存 test 代わりに docstring、PR Summary、Safety Claim Matrix の表現を修正してください。 保証している内容は、
です。 runtime 実行中に executable の inode/bytes が置換されないことまでは保証していません。 Safety Claim Matrix の
相当を明記してください。 Follow-up 欄が repository validator 上必須なら、 Scope disciplineIssue #2421 の Allowed Paths を厳守してください。 コード変更は原則として既存 Allowed Paths 内だけに限定します。 PR body の metadata / description 更新は行って構いません。 新しい generic redaction framework、 敵対的レビューの blocker を解消するために不要な refactor はしないでください。 Loop修正後、implementation-worker の作業完了を待って結果を取得してください。 その後 test-runner SubAgent を起動し、完了まで待ってください。 linked Issue #2421 の Verification Commands を current head で独立再実行してください。 必要に応じて repository の canonical PR-body validation / Allowed Paths gate も実行してください。 test-runner の current-head verification が PASS した場合だけ Step 4 へ進んでください。 その後 pr-reviewer SubAgent を起動し、LOOP_VERDICT が返るまで必ず待ってください。 pr-reviewer には stale な
base が BEHIND になった場合: CI が pending の場合: CI failure が出た場合: SubAgent の一時的な discovery failure は skill の bounded recovery procedure を使い、人間確認を最初の fallback にしないでください。 Completion condition以下をすべて満たすまで root session を終了しないでください。
上記を満たしたら、PR #2485 を merge-ready としてください。 Draft → Ready for review の変更が現在の repository policy で許可されており、残る操作を「merge のみ」にできる場合は、追加の人間承認を求めず Ready for review に変更してください。 現在の PR の merge 自体は絶対に実行しないでください。 最終報告は簡潔に、
を提示してください。 途中で「次に進めてよいですか」「commit してよいですか」「push してよいですか」「レビューを開始してよいですか」と確認しないでください。 可能な範囲はすべて現在の session 内で実行し、SubAgent の完了を待ちながら このケースでは、敵対的レビューの内容がかなり限定されているため、通常は 1回の fix iteration で APPROVE に戻せる内容です。特に |
…#2421) PR review fix-delta: - test_claude_bin_absolute_path_bypasses_path_resolution now also parses a machine-generated --evidence-json file directly and asserts resolved_executable == "<redacted>" and resolved_executable_sha256 match there, in addition to the existing summary.md assertions. - test_resolved_executable_is_single_path_shared_by_version_capture_and_invocation docstring now explicitly states it proves the once-resolved-path / content-digest invariant regression, not runtime TOCTOU replacement resistance.
impl-review-loop 判定(fix_delta 反映後、current head 独立再検証)総合判定: 対象 head: 前回敵対的レビュー(#issuecomment-5527411066)blocker 解消状況
独立検証結果
verdict: APPROVE
reviewed_head_sha: "65f945157fa4fb5790a492f7f7ee5f628e190b0f"
blockers: []
warnings:
- "Safety Claim Matrix の TOCTOU Not-controlled 行の Follow-up は新規 Issue 番号ではなく「Issue #2421 の明示的 Out of Scope」を根拠に記載。前回レビューP2の推奨(過剰な hardening 不要)と一致するため非ブロッキング" |
Summary
run_worktree_agent_runtime_smoke.pyの_redact_evidence_value()にresolved_executablefield-path 専用の narrow special case を追加し、resolution 成功時(文字列値)は絶対パスの prefix(HOME/tmp/opt/mnt 等)に関わらず常に<redacted>にする。既存の HOME 判定 regex(_SECRET_LIKE_RE)は拡張しない field-semantics-based special case。resolved_executable: None(unresolved/SKIP)の semantics は不変。resolved_executable_sha256は既存の_PUBLIC_EVIDENCE_SHA_LENGTHS登録のまま保持し、preflight・version capture・invocation が同一 resolved executable を使う既存 runtime behavior(Issue 実装: run_worktree_agent_runtime_smoke.py の Claude capability 判定を --help 非掲載フラグでなく実 runtime 挙動に基づく判定へ修正する #1960 Design Decision 5)は変更しない。test_run_worktree_agent_runtime_smoke_claude_bin.pyの raw-realpath-equality assertion(test_claude_bin_absolute_path_bypasses_path_resolution、test_claude_bin_unspecified_default_behavior_is_unchanged)をresolved_executable == "<redacted>"+resolved_executable_sha256の fixture-local 期待値一致による identity 証明へ更新した。test_claude_bin_absolute_path_bypasses_path_resolutionはさらに--evidence-jsonの machine-generated JSON を直接 parse し、同一 assertion をsummary.mdと JSON 双方の surface で検証する(レビュー fix-delta)。test_run_worktree_agent_runtime_smoke_runtime_evidence.pyのtest_resolved_executable_is_single_path_shared_by_version_capture_and_invocationを、fake executable の version marker + invocation marker +resolved_executable_sha256一致で「version capture と invocation が同じ resolved executable を使った」ことを証明する形へ更新した(rawsummary.mdpath equality は廃止)。docstring を、保証範囲(once-resolved path の regression)と非保証範囲(runtime 中の TOCTOU 置換耐性は対象外)を明示する形に更新した(レビュー fix-delta)。test_run_worktree_agent_runtime_smoke_claude_gpt_hermetic_matrix.pyは HOME 固有の fixture を持たず、resolved_executableの raw path assertion も存在しなかったため無変更。--claude-binの PATH-native / absolute-native / claude-gpt combination matrix の既存挙動が退行しないことを再実行して確認した。Checks
uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py -k test_given_home_paths_in_nested_schema_fields_when_evidence_written_then_redacted(AC1、PASS)uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py(AC2/AC3、18 passed)uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py(AC4、2 passed)uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_hermetic_matrix.py(AC5、7 passed、regression なし)uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py(フルスイート 82 passed、Allowed Paths 外ファイルへの回帰なし確認)pnpm typecheck/pnpm lint/pnpm test/pnpm build(Node/フロントエンド)は対象外。上記 pytest を canonical VC として実行し、成功を確認したSchema Change Applicability
schema_changeWORKTREE_AGENT_RUNTIME_SMOKE_RESULT_V1のresolved_executableフィールドの値 semanticsを変更する。resolution 成功時、従来は絶対パスの prefix(HOME/tmp/opt/mnt 等)によって raw absolute path のまま持続する場合と<redacted>になる場合があったが、本 PR で resolution 成功時は常に<redacted>に固定する。resolved_executable_sha256は不変。キー集合(WORKTREE_AGENT_RUNTIME_SMOKE_RESULT_V1のキー集合)とresolved_executableの型(string | None)も不変。Schema Consumer Inventory
変更対象 schema:
WORKTREE_AGENT_RUNTIME_SMOKE_RESULT_V1before/after 差分:
Consumer 列挙(rg コマンド例と結果):
scripts/agent-ops/run_worktree_agent_runtime_smoke.py(本 PR で更新済み —_redact_evidence_value()field-path special case)scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py,scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py(summary.md +--evidence-json双方の surface を検証)scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py(Allowed Paths 外・無変更):resolved_executableに HOME path 付き値を与える既存 fixture テスト。field-level 常時 redaction でも既存 assertion(<redacted>を含む)は非破壊で通過することを実行のみで確認済み(PASS)。.claude/skills/issue-refinement-loop/scripts/run_native_session_continuation_canary.py:resolved_executable_sha256のみ参照(extract_claude_resolved_executable_sha256経由の re-export)。resolved_executable自体は未参照のため影響なし。.claude/skills/agent-retrospective/scripts/tests/verify_agent_retrospective_live_smoke.py,.claude/skills/agent-retrospective/scripts/tests/test_security_boundary.py: 同名resolved_executable/resolved_executable_digestフィールドを持つが、WORKTREE_AGENT_RUNTIME_SMOKE_RESULT_V1とは独立した自前の evidence dict 構築ロジックであり、本 schema の consumer ではない。Consumer 更新状況:
scripts/agent-ops/run_worktree_agent_runtime_smoke.pyscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py--evidence-json両 surface で<redacted>+ sha256 一致を検証scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.pyscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py.claude/skills/issue-refinement-loop/scripts/run_native_session_continuation_canary.pyresolved_executable_sha256のみ参照)resolved_executable自体は未参照.claude/skills/agent-retrospective/scripts/tests/verify_agent_retrospective_live_smoke.py.claude/skills/agent-retrospective/scripts/tests/test_security_boundary.pyCompatibility Decision(互換性判定)
semantic_changebackward_compatiblenoN/Aresolved_executable: string | None)は不変であり、これは意図的な value-semantics change(常時 redaction への統一)であるため migration は不要。Visual Impact Declaration(視覚影響申告)
Safety Claim Matrix
resolved_executableevidence field は resolution 成功時、絶対パスの prefix に関わらず常に<redacted>として persist される(summary.md/--evidence-json双方)test_run_worktree_agent_runtime_smoke_claude_bin.py(tmp_path 配下の非 HOME executable でも<redacted>を確認。--evidence-jsonの machine-generated JSON も同一テストで直接 parse して検証)、test_run_worktree_agent_runtime_smoke.py::test_given_home_paths_in_nested_schema_fields_when_evidence_written_then_redacted(HOME 配下でも<redacted>を維持)resolved_executable_sha256による single resolved path + content digest invariant(version capture と invocation が同一 resolved executable を使う Issue #1960 Design Decision 5 invariant)の regression は、redaction 変更後も維持されるtest_run_worktree_agent_runtime_smoke_runtime_evidence.py::test_resolved_executable_is_single_path_shared_by_version_capture_and_invocation(version marker + invocation marker +resolved_executable_sha256fixture-local 一致で「同一 on-disk file が使われたこと」を証明。TOCTOU 耐性そのものは検証範囲外であることを docstring に明記)resolved_executable: Noneを維持するtest_claude_bin_nonexecutable_path_is_skip_not_crash(既存 assertion、無変更)記載ルール:
Not controlledが非空の場合、PR title / summary / docs で無限定のsafe/read-only/sandboxed/isolated/completeを使わないこと(APPROVE 禁止条件)Evidenceは本 PR の検証コマンド結果または linked issue の Verification Commands と対応させることNot controlledが非空の場合、Follow-upに open な後続 Issue を記載すること(必須)Notes
resolved_executablefield-level redaction のみ。runtime invocation・launcher authentication・Issue 実装: preflight.run の GH_CONFIG_DIR を command-scoped に伝播する #2403 / PR fix: preserve GH_CONFIG_DIR for bare preflight.run #2407 とは独立implement-issueskill 手順、および PR レビュー fix-delta 適用)test_run_worktree_agent_runtime_smoke.py(test_given_home_paths_in_nested_schema_fields_when_evidence_written_then_redacted)は Issue 本文の指示通り編集せず、AC1 として実行のみ確認した