Skip to content

fix: redact resolved_executable evidence field regardless of path prefix - #2485

Merged
squne121 merged 4 commits into
mainfrom
worktree-issue-2421-runtime-smoke-evidence-resolved-executab
Sep 3, 2026
Merged

squne121 merged 4 commits into
mainfrom
worktree-issue-2421-runtime-smoke-evidence-resolved-executab

Conversation

@squne121

@squne121 squne121 commented Sep 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • run_worktree_agent_runtime_smoke.py の _redact_evidence_value() に resolved_executable field-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 を使った」ことを証明する形へ更新した(raw summary.md path 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 外ファイルへの回帰なし確認)
  • 本 Issue は Python スクリプトのみの変更であり pnpm typecheck / pnpm lint / pnpm test / pnpm build(Node/フロントエンド)は対象外。上記 pytest を canonical VC として実行し、成功を確認した

Schema Change Applicability

  • decision: schema_change
  • reason: WORKTREE_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_V1

before/after 差分:

# before
# resolved_executable: string | None
#   - resolution 成功時: 絶対パスの prefix (HOME/tmp/opt/mnt 等) に応じて
#     raw absolute path のまま、または既存 HOME 判定 regex により <redacted>
#   - unresolved / SKIP 時: None

# after
# resolved_executable: string | None
#   - resolution 成功時: prefix に関わらず常に "<redacted>"
#   - unresolved / SKIP 時: None(不変)
# resolved_executable_sha256: 不変(既存の _PUBLIC_EVIDENCE_SHA_LENGTHS 登録のまま)

Consumer 列挙(rg コマンド例と結果):

rg -n "resolved_executable" --hidden -g '!.git' -g '!node_modules' .
  • Producer: scripts/agent-ops/run_worktree_agent_runtime_smoke.py(本 PR で更新済み — _redact_evidence_value() field-path special case)
  • Regression consumer(本 PR で更新済み): 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 ではない。
  • production consumer(本 schema を読み込んでビジネスロジックに使う実装)は見つからない(inventory 上なし)。

Consumer 更新状況:

Consumer ファイル 更新有無 備考
scripts/agent-ops/run_worktree_agent_runtime_smoke.py 更新済み producer 本体(field-path special case 追加)
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py 更新済み summary.md + --evidence-json 両 surface で <redacted> + sha256 一致を検証
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py 更新済み 同上(docstring の保証範囲も明確化)
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py 不要(無影響、実行のみで確認) Allowed Paths 外。既存 assertion が非破壊で PASS することを確認済み
.claude/skills/issue-refinement-loop/scripts/run_native_session_continuation_canary.py 不要(resolved_executable_sha256 のみ参照) resolved_executable 自体は未参照
.claude/skills/agent-retrospective/scripts/tests/verify_agent_retrospective_live_smoke.py 不要(独立実装の同名フィールド) 本 schema の consumer ではない
.claude/skills/agent-retrospective/scripts/tests/test_security_boundary.py 不要(独立実装の同名フィールド) 本 schema の consumer ではない

Compatibility Decision(互換性判定)

  • change_type: semantic_change
  • compatibility: backward_compatible
  • migration_required: no
  • migration_or_followup: N/A
  • reason: 既知 consumer(regression test 2件)は本 PR で更新済み。production consumer は見つからない(inventory 上なし)。key set と型(resolved_executable: string | None)は不変であり、これは意図的な value-semantics change(常時 redaction への統一)であるため migration は不要。

Visual Impact Declaration(視覚影響申告)

schema: VISUAL_IMPACT_DECLARATION_V1
surfaces: []

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
resolved_executable evidence field は resolution 成功時、絶対パスの prefix に関わらず常に <redacted> として persist される(summary.md / --evidence-json 双方) yes 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> を維持) N/A
resolved_executable_sha256 による single resolved path + content digest invariant(version capture と invocation が同一 resolved executable を使う Issue #1960 Design Decision 5 invariant)の regression は、redaction 変更後も維持される yes runtime 実行中の executable replacement / TOCTOU(resolution 後、version capture〜invocation の間に対象ファイルの inode/bytes が置換されるレース)までは保証しない。FD pinning・署名・attestation は行っていない 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_sha256 fixture-local 一致で「同一 on-disk file が使われたこと」を証明。TOCTOU 耐性そのものは検証範囲外であることを docstring に明記) Issue #2421 の明示的 Out of Scope。追加 hardening は不要
unresolved / SKIP 時は resolved_executable: None を維持する yes test_claude_bin_nonexecutable_path_is_skip_not_crash(既存 assertion、無変更) N/A

記載ルール:

  • 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 を記載すること(必須)
  • 「閉じる経路を正確に書く」原則: 主張の射程を実装済みの境界に限定すること(例: 「ACP client-side の fs/terminal proxy を提供しない」は許可、「read-only ACP transport」は禁止)

Notes

…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]>
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #2485 closed).

@squne121

squne121 commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

impl-review-loop: pr-reviewer verdict (re-review after update_branch)

Mergeability: mergeable=MERGEABLE, merge_state_status=CLEAN, head=d3681c5fe20e8e991d33e17d914fcd3ec49686b5

Evidence Check:

  • Allowed Paths compliance: PASS (allowed_paths_review_gate.py, live linked Issue 実装: runtime-smoke evidence の resolved_executable を field-level で常に redact する #2421 body, violations: [])
  • AC1-AC5: all PASS (independently re-run at this head; canonical VC commands)
  • Required CI: all 6 required contexts SUCCESS (typecheck, lint, test, build, python-test, validate-generated-artifact) via wait_ci_checks.py
  • Code correctness: _ALWAYS_REDACT_FIELD_PATHS special-cases only the ("resolved_executable",) field path, applied before the existing _SECRET_LIKE_RE fallback; None/SKIP semantics unchanged; resolved_executable_sha256 preservation confirmed unaffected.
  • Test updates genuinely prove identity via version-capture marker + invocation marker + SHA-256 match (not raw path equality) — non-vacuous.
  • Stop Conditions: none triggered.

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."

@squne121

squne121 commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

PR #2485 敵対的レビュー

総合判定: REQUEST_CHANGES
対象 head は d3681c5fe20e8e991d33e17d914fcd3ec49686b5、base は current main の d9f5e98d...。PR は mergeable ですが draft です。既存 reviewer は APPROVE、現在の check runs に failure は確認できません。

ただし、実装本体に P0 級の問題は見つかりませんでした。方向性はかなり良いです。止める理由は過剰なセキュリティ強化ではなく、PR が主張している contract とテスト証拠の不整合です。

P1 — not_schema_change は repository の schema governance と矛盾する

PR 本文は「キー集合・型が変わらないので not_schema_change」「consumer 境界の contract 変更はない」としています。ところが今回まさに、

resolved_executable: "/tmp/.../claude"
↓
resolved_executable: "<redacted>"

という machine-readable field の値 contract を変更しています。しかも既存の raw-path equality test を2本変更しなければならなかったこと自体、consumer-visible semantics が変わった証拠です。PR 本文自身もその変更を明記しています。

repo の governance は schema を「producer / consumer 境界を越えて parse / serialize される machine-readable contract」と定義し、schema_change を「schema 境界に影響する変更」、not_schema_change を「consumer 変更なし」としています。schema_change|uncertain なら Consumer Inventory も必須です。

推奨修正は PR 本文だけで十分です。

  • decision: schema_change
  • before: resolution 成功時に raw path または <redacted>
  • after: resolution 成功時は常に <redacted>
  • resolved_executable_sha256 は不変
  • in-repo の raw-path consumer は更新済み
  • production consumer は inventory 上なし
  • migration_required: false
  • compatibility は「intentional value-semantics change」と明記

新しい validator や schema version bump は不要です。


P1 — summary.md / --evidence-json 双方という主張を、追加テストが片方しか証明していない

Safety Claim Matrix は、

summary.md / --evidence-json 双方で resolved_executable が <redacted>

と明示的に claim しています。

ところが PR で変更された2系列の regression は、summary.md を _summary_field() で再パースして確認する形です。さらに repo 自身が --evidence-json を「regression tests 等が summary.md の str() 表現を再パースしなくて済む machine-generated JSON」として用意しています。

実装は現在、summary 側も JSON 側も同じ _redact_evidence_value() を経由する設計なので、現状のコードが evidence-json を漏らすというバグではありません。summary writer も redacted schema を使っています。

問題は regression の証明範囲です。

最小修正は、新規ハーネスを足さず既存 test 1 本で、

--evidence-json <tmp>/evidence.json

を渡して、

evidence["resolved_executable"] == "<redacted>"
evidence["resolved_executable_sha256"] == expected_sha256

まで assert することです。

そのうえで summary.md assertion を1本だけ残せば十分です。むしろ今回追加された _summary_field() helper の重複を減らせます。


P2 — 「同一 executable を証明」という表現が、テストが実際に証明する範囲より強い

Issue #1960 の重要な invariant、つまり 一度 resolve した絶対パスを version capture と structured invocation の双方に渡す実装は現在も維持されています。これは壊れていません。

今回の version marker + invocation marker + SHA-256 は良い regression test です。ただし厳密には、

  • version branch が fixture で実行された
  • invocation branch も fixture 相当の挙動をした
  • persisted SHA-256 が fixture の内容と一致した

ことを証明するのであって、「version → hash → invocation 間で同一 inode/bytes が絶対に保持された」という TOCTOU 耐性までは証明しません。

ここは実装を強化すべきではありません。 FD pinning、署名、attestation、実行ファイル locking はこの個人開発用途には過剰です。Safety Claim Matrix の Not controlled に「runtime 中の executable replacement / TOCTOU」を1行書き、テスト名・説明を「single resolved path + content digest invariant の regression」に弱めるだけで十分です。


外部実装との照合

今回の設計方針自体は適切です。

Python の現行 shutil.which() は実際に実行対象となる path を返し、Windows では PATHEXT や current-directory rules まで絡みます。したがって /home|/root|/Users|/tmp|... を延々 regex に追加するより、resolved_executable という field semantics に基づいて常時 redact する現在案の方が堅牢です。 ([Python documentation]1)

また SLSA v1.2 の provenance model でも ResourceDescriptor は location (uri) と content identity (digest, including SHA-256) を別概念として扱っています。場所を公開せず digest を残す今回の「<redacted> + SHA-256」は、その考え方とも整合します。SLSA 化や attestation 導入までは不要です。 ([SLSA]2)

マージ前の推奨アクション

  1. Schema Change Applicability を schema_change に修正し、最小 Consumer Inventory を記載する。
  2. 既存 test 1 本で --evidence-json の <redacted> + SHA を直接 assert する。
  3. identity claim を少し狭め、TOCTOU は Not controlled と明記するだけにする。
  4. その後は既存 focused pytest + required CI が green なら merge-ready としてよいです。

新規 live Claude 実行、credential test、新しい redaction framework、FD pinning、追加 security harness は不要です。今回の目的に対しては作業完走率を下げるだけだと判断します。

@squne121

squne121 commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

PR #2485 は新規実装フェーズではなく、敵対的レビューコメントを fix_delta として既存 impl-review-loop に戻すのが適切です。現 head は d3681c5... のまま Draft で、敵対的レビュー後の修正はまだ入っていません。

推奨アクションは、① PR body の Schema Change Applicability を schema_change に訂正して Consumer Inventory を追加、② Allowed Paths 内の既存テスト1本に --evidence-json の直接 assertion を追加、③ TOCTOU を「非保証」と明記して identity claim を狭める、の3点です。新規 validator、live Claude 実行、FD pinning、attestation 等は不要です。敵対的レビュー自身もこの最小修正を推奨しています。 Schema governance 上も schema_change なら Consumer Inventory が必要です。

一点だけ補正すると、Issue #2421 の AC4 が現在のテスト関数名を明示しているため、P2対応で関数名そのものは変更しない方が安全です。docstring、PR Summary、Safety Claim Matrix の「証明」という表現を弱めれば十分です。Issue の Allowed Paths 内で今回の修正は完結できます。

また、impl-review-loop 自体が implementation-worker → test-runner → pr-reviewer を SubAgent に委譲し、REQUEST_CHANGES なら Step 1 に戻る設計です。 implementation-worker には review blocker を fix_delta として渡す契約も既にあります。 「サブエージェントを起動しただけで終了する」事故を避けるため、下のプロンプトでは foreground 実行と完了待機を明示しています。Claude Code 公式にも foreground subagent は親を完了までブロックするとされています。([Claude]1)

なお、プロンプトだけでは Claude Code の permission prompt は無効化できません。承認ダイアログ自体をなくしたいなら、利用可能なら claude --permission-mode auto が第一候補です。完全無確認の bypassPermissions はサブエージェントにも継承されるため、使うなら disposable container/VM 等に限定するのが公式仕様上の前提です。([Claude]2)

そのまま Claude Code に渡すなら以下です。

PR #2485 の既存作業を再開し、以下の敵対的レビューコメントを fix_delta として impl-review-loop を実行してください。

Target repository:
https://github.com/squne121/loop-protocol

Target Issue:
#2421

Target PR:
#2485

Authoritative review / fix_delta:
#2485 (comment)

目的は、PR #2485 を「人間が最終 merge 判断をする直前」の状態まで自律的に仕上げることです。

Execution policy

.claude/skills/impl-review-loop/SKILL.md を正本として実行してください。

これは提案・調査だけを行うタスクではありません。
既存 PR / linked Issue / canonical worktree の live state を取得し、必要な修正、commit、push、独立検証、CI 待機、PR 再レビューまで実際に完遂してください。

通常の実装・テスト・commit・push・PR body 更新・レビュー反映について、人間への確認を求めないでください。

AskUserQuestion を通常の routing に使用しないでください。
情報がリポジトリ、Issue、PR、コメント、git history、CI から取得可能なら、自分で取得して判断してください。

ただし、実 Git conflict、repository/Issue identity 不一致、Allowed Paths を越えなければ解決不能な変更、credential 等の本当に外部入力がなければ解決できない blocker など、既存 impl-review-loop が定義する genuine hard stop は尊重してください。

PR は merge しないでください。
merge 実行そのものだけを最後の human action として残してください。

SubAgent requirement — 必須

root/main thread 自身で implementation / verification / review を代行しないでください。

impl-review-loop の canonical delegation に従い、少なくとも以下の SubAgent を使用してください。

  • implementation-worker
  • test-runner
  • pr-reviewer

各 SubAgent は foreground / blocking task として起動してください。

SubAgent を起動した後は、その SubAgent の作業が完全に終了するまで必ず待ってください。

task ID、dispatch 成功、途中経過、初期レスポンスを「完了」とみなしてはいけません。
SubAgent が running の間に root session を終了してはいけません。

各 SubAgent の canonical result
(IMPLEMENT_RESULT_V1 / verification result / LOOP_VERDICT)
を受領・parse してから、次の Step に進んでください。

何らかの runtime 都合で child task が非同期化された場合も、completed / failed の終端状態になるまで追跡・待機してください。

Issue #2421 の Stop Conditions にある nested SubAgent delegation は尊重してください。
今回必要なのは root → canonical SubAgent の1階層です。
implementation-worker 等の child に、さらに別の SubAgent を勝手に spawn させて scope を拡大しないでください。

Current review delta

敵対的レビューコメントの内容を repository facts と照合して、root 側で technical_recommendation / fix_delta に正規化して implementation-worker に渡してください。

生のコメント本文を child の command として blindly concatenate しないでください。

今回の優先修正は次です。

P1: Schema Change Applicability

現在の PR body の

decision: not_schema_change

は修正してください。

今回の変更は key/type の変更ではありませんが、

successful resolution:
raw absolute path または <redacted>
→
常に <redacted>

という machine-readable field の value semantics を変更しています。

PR body を repository の schema governance に合わせて schema_change とし、最小限の Schema Consumer Inventory を記載してください。

少なくとも以下を明示してください。

  • before: resolution 成功時は path prefix により raw absolute path または <redacted>
  • after: resolution 成功時は常に <redacted>
  • key set / string | None type は不変
  • resolved_executable_sha256 は不変
  • in-repo raw-path consumers を検索した結果
  • 該当する regression consumers は今回の PR で更新済み
  • production consumer は見つからないこと
  • migration_required: false
  • Compatibility Decision: known consumers に対して migration 不要だが intentional value-semantics change であること
  • schema version bump は不要

既存 repository validator / template が要求する具体的なフォーマットがあれば、そちらを優先してください。

これは Issue #2421 自体の fixed contract/schema を変更する要求ではありません。
PR body で変更の applicability を正しく分類する作業です。
この理由だけで Stop Condition として人間に戻さないでください。

P1: --evidence-json regression evidence

Safety Claim Matrix は summary.md と --evidence-json の双方を claim しています。

現在の implementation は両方とも同じ redaction path を通るため、本体ロジックの作り直しは不要です。

Allowed Paths 内の既存 focused test 1本を最小変更してください。

推奨対象:
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py

既存の成功ケース、優先的には
test_claude_bin_absolute_path_bypasses_path_resolution
を拡張して構いません。

test-owned temporary path に

--evidence-json <tmp>/evidence.json

を追加し、machine-generated JSON を直接 parse して最低限、

evidence["resolved_executable"] == "<redacted>"

および

evidence["resolved_executable_sha256"] == expected_sha256

を assert してください。

同じケースの summary.md assertion も最低1本残し、
「summary と evidence-json の両 surface」を regression で直接確認してください。

新規 harness、live Claude、credential、network test は追加しないでください。

P2: identity claim を実際の保証範囲に合わせる

実装の runtime behavior は強化しないでください。

FD pinning、executable locking、signature、attestation、SLSA 導入などは不要です。

既存 test
test_resolved_executable_is_single_path_shared_by_version_capture_and_invocation
は Issue #2421 AC4 が名称を明示しているため、原則として関数名を維持してください。

代わりに docstring、PR Summary、Safety Claim Matrix の表現を修正してください。

保証している内容は、

  • once-resolved path を version capture / invocation に使う既存 invariant の regression
  • version marker
  • invocation marker
  • fixture-local executable content digest と persisted SHA-256 の一致

です。

runtime 実行中に executable の inode/bytes が置換されないことまでは保証していません。

Safety Claim Matrix の Not controlled に、

runtime 中の executable replacement / TOCTOU

相当を明記してください。

Follow-up 欄が repository validator 上必須なら、
「Issue #2421 の明示的 Out of Scope。追加 hardening は不要」
という意味を明示してください。

Scope discipline

Issue #2421 の Allowed Paths を厳守してください。

コード変更は原則として既存 Allowed Paths 内だけに限定します。

PR body の metadata / description 更新は行って構いません。

新しい generic redaction framework、
新 validator、
新 schema version、
credential test、
live Claude test、
permission canary、
FD pinning、
attestation、
新規 Issue
を今回の修正として追加しないでください。

敵対的レビューの blocker を解消するために不要な refactor はしないでください。

Loop

修正後、implementation-worker の作業完了を待って結果を取得してください。

その後 test-runner SubAgent を起動し、完了まで待ってください。

linked Issue #2421 の Verification Commands を current head で独立再実行してください。
今回変更する claude-bin focused suite に追加した --evidence-json assertion も当然その実行に含めてください。

必要に応じて repository の canonical PR-body validation / Allowed Paths gate も実行してください。

test-runner の current-head verification が PASS した場合だけ Step 4 へ進んでください。

その後 pr-reviewer SubAgent を起動し、LOOP_VERDICT が返るまで必ず待ってください。

pr-reviewer には stale な d3681c5fe20e8e991d33e17d914fcd3ec49686b5 ではなく、修正後の live PR head SHA をレビューさせてください。

verdict: REQUEST_CHANGES の場合:
人間に確認せず blocker を新しい fix_delta として Step 1 に戻し、
implementation-worker → test-runner → pr-reviewer
を再実行してください。

reviewed_head_sha が stale の場合:
current head で再レビューしてください。

base が BEHIND になった場合:
canonical update_branch routing を使って更新し、
その新 head に対して verification と review を再実行してください。

CI が pending の場合:
失敗扱いにも人間 escalation にもせず、repository の canonical wait_ci_checks.py 等を使って終端結果まで待ってください。

CI failure が出た場合:
ログを取得して原因を修正可能なら同じ loop 内で修正してください。

SubAgent の一時的な discovery failure は skill の bounded recovery procedure を使い、人間確認を最初の fallback にしないでください。

Completion condition

以下をすべて満たすまで root session を終了しないでください。

  • 敵対的レビューコメント 5527411066 の P1 blockers が解消済み
  • P2 の claim wording / Not controlled が反映済み
  • Allowed Paths compliance PASS
  • Issue 実装: runtime-smoke evidence の resolved_executable を field-level で常に redact する #2421 の canonical Verification Commands PASS
  • --evidence-json regression PASS
  • required CI green
  • current live head に対する pr-reviewer verdict = APPROVE
  • blockers = []
  • current head と reviewed_head_sha が一致
  • mergeability が CLEAN または repository policy 上 equivalent な merge-ready state
  • unresolved blocker がない

上記を満たしたら、PR #2485 を merge-ready としてください。

Draft → Ready for review の変更が現在の repository policy で許可されており、残る操作を「merge のみ」にできる場合は、追加の人間承認を求めず Ready for review に変更してください。

現在の impl-review-loop policy が Draft 維持を normative に要求している場合だけ Draft のままにし、その事実を最終報告で明示してください。

PR の merge 自体は絶対に実行しないでください。

最終報告は簡潔に、

  • final head SHA
  • 実施した修正
  • verification 結果
  • required CI 結果
  • final pr-reviewer verdict
  • mergeability
  • Draft / Ready 状態
  • 人間が行う残りの操作(原則 Merge のみ)

を提示してください。

途中で「次に進めてよいですか」「commit してよいですか」「push してよいですか」「レビューを開始してよいですか」と確認しないでください。

可能な範囲はすべて現在の session 内で実行し、SubAgent の完了を待ちながら impl-review-loop を最後まで完走してください。

このケースでは、敵対的レビューの内容がかなり限定されているため、通常は 1回の fix iteration で APPROVE に戻せる内容です。特に schema_change を理由に Issue の再 refinement や新規 schema 実装へ逸脱させないことが、完走率を上げるポイントです。

…#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.
@squne121

squne121 commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

impl-review-loop 判定(fix_delta 反映後、current head 独立再検証)

総合判定: APPROVE

対象 head: 65f945157fa4fb5790a492f7f7ee5f628e190b0f(前回敵対的レビュー時の stale head d3681c5f... から更新済み)

前回敵対的レビュー(#issuecomment-5527411066)blocker 解消状況

  • P1 (Schema Change Applicability): PR body decision を not_schema_change → schema_change に修正。before/after value-semantics、key set/type 不変、resolved_executable_sha256 不変、in-repo raw-path consumer 検索結果(production consumer なし)、migration_required: false、Compatibility Decision を明記した Consumer Inventory を追記。repository の pr_body_validator.py で status: pass を確認。
  • P1 (--evidence-json regression): test_run_worktree_agent_runtime_smoke_claude_bin.py::test_claude_bin_absolute_path_bypasses_path_resolution を拡張し、--evidence-json の machine-generated JSON を直接 parse して resolved_executable == "<redacted>" / resolved_executable_sha256 一致を assert。同テスト内に summary.md 側 assertion も維持し、両 surface を同一 regression で確認。
  • P2 (identity claim wording): test_resolved_executable_is_single_path_shared_by_version_capture_and_invocation は関数名を維持しつつ docstring を「once-resolved path + content digest invariant の regression」に限定し、TOCTOU(runtime 中の executable replacement)耐性までは保証しないことを明記。PR body Safety Claim Matrix も同様に claim を弱め、Not controlled に TOCTOU を追記。実装ロジック(FD pinning 等)の追加変更なし。

独立検証結果

verdict: APPROVE
reviewed_head_sha: "65f945157fa4fb5790a492f7f7ee5f628e190b0f"
blockers: []
warnings:
  - "Safety Claim Matrix の TOCTOU Not-controlled 行の Follow-up は新規 Issue 番号ではなく「Issue #2421 の明示的 Out of Scope」を根拠に記載。前回レビューP2の推奨(過剰な hardening 不要)と一致するため非ブロッキング"

@squne121
squne121 marked this pull request as ready for review September 3, 2026 19:43
@squne121
squne121 merged commit 0b0d8f8 into main Sep 3, 2026
25 checks passed
@squne121
squne121 deleted the worktree-issue-2421-runtime-smoke-evidence-resolved-executab branch September 3, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: runtime-smoke evidence の resolved_executable を field-level で常に redact する

1 participant