Skip to content

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

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: >
  worktree-agent-runtime-smoke の persisted evidence で `resolved_executable` field を、
  値の絶対パス prefix(HOME/tmp/opt/mnt 等)に関わらず常に `<redacted>` にし、
  resolved_executable_sha256 による executable identity を維持する。
change_kind: code

Parent Issue

なし(単独改善)

Parent Goal Ref

  • Goal: worktree-agent-runtime-smoke が allowlist-only evidence に resolved_executable の raw absolute path を、prefix に関わらず一切保存しない契約を守る。
  • Desired Destination: runner の persisted evidence serializer(_redact_evidence_value())と focused regression tests。

Current Validated Scope

  • scripts/agent-ops/run_worktree_agent_runtime_smoke.py の _redact_evidence_value() に、resolved_executable field-path 専用の narrow special case を追加し、resolution 成功時(文字列値)は prefix に関わらず常に <redacted> にする。HOME 判定 regex(_SECRET_LIKE_RE)の拡張ではなく field semantics ベースの special case とする。
  • unresolved / SKIP 等で既存値が None の場合の semantics は変更しない(resolved_executable: None を維持)。
  • resolved_executable_sha256 は既存の _PUBLIC_EVIDENCE_SHA_LENGTHS 登録のまま保持し、preflight・version capture・実際の invocation が同じ解決済み executable を使う既存の runtime behavior を維持する。
  • summary.md と任意の --evidence-json は同一の _redact_evidence_value() を経由するため、両出力に同じ contract を適用する。
  • 既存の raw-realpath-equality assertion(test_run_worktree_agent_runtime_smoke_claude_bin.py と test_run_worktree_agent_runtime_smoke_runtime_evidence.py)を、fake executable version marker + invocation marker + fixture-local expected resolved_executable_sha256 による identity 証明へ更新する。

Remaining Parent Gaps

なし。本 Issue は evidence hygiene defect のみを扱う。

Background

#2403 / PR #2407 の actual structured Claude-GPT smoke により、summary.md の resolved_executable が HOME 配下の absolute path を保存することが判明した。これは allowlist-only evidence が absolute path を保存しない既存契約に反する。

その後 PR #2454(54e37bff)が _redact_evidence_value() / _SECRET_LIKE_RE を導入し、/home, /root, /Users 配下の absolute path は redaction されるようになった(test_given_home_paths_in_nested_schema_fields_when_evidence_written_then_redacted で確認済み、current main で PASS)。

しかし current main (da4e00593f76d5e22a5746ac39d44501530d5e02) で baseline 再確認したところ、_SECRET_LIKE_RE は /(?:home|root|Users)/... のみを対象とし、/tmp, /opt, /mnt 等の non-HOME absolute path は対象外であることを確認した。実際、test_run_worktree_agent_runtime_smoke_claude_bin.py と test_run_worktree_agent_runtime_smoke_runtime_evidence.py には、tmp_path 配下(非HOME)の resolved_executable が raw realpath のまま summary.md に一致することを assert する既存テストが複数あり、いずれも現在 PASS している(つまり non-HOME absolute path は現在も raw のまま persist されている)。

したがって「HOME absolute path を除去する」部分は PR #2454 が既に解消済みだが、「resolved_executable の絶対パスを prefix に関わらず一切公開しない」という field-level contract は current main では未達である。本 Issue はこの field-level contract のみを対象とし、omit ではなく key-retained + <redacted> の narrow special case で実装する。新しい generic redaction framework は導入しない。

Outcome

run_worktree_agent_runtime_smoke.py の resolved_executable field が、resolution 成功時は absolute path の prefix に関わらず常に <redacted> として summary.md と --evidence-json の双方に記録され、resolved_executable_sha256 は保持され、version capture と invocation が同じ resolved executable を使う既存 runtime behavior は変わらない状態を、hermetic な focused regression(test_run_worktree_agent_runtime_smoke_claude_bin.py、test_run_worktree_agent_runtime_smoke_runtime_evidence.py、test_run_worktree_agent_runtime_smoke_claude_gpt_hermetic_matrix.py)が確認して完了する。

Runtime Verification Applicability

decision: immediate
reason: >
  persisted evidence は structured subprocess smoke の実行結果であり、serializer の
  redaction ロジックと実際の runner invocation を通した確認が必要なため。
applicable_acs:
  - AC1
  - AC2
  - AC3
  - AC4
  - AC5
execution_environment:
  cli_tools:
    - python3
    - uv
  auth_required: false
  network_required: false
  fixture: "test-owned temporary HOME、fake executable、fixture-only structured Claude-GPT adapter"
skip_conditions: []
fallback_policy:
  fallback_success_is_pass: false
  notes: "raw absolute path がいずれかの persisted evidence に残る、または SHA-256 identity が欠落する結果は FAIL"
artifact_requirements:
  - "test artifact は temporary directory のみ"
  - "credential、HOME absolute path、raw executable path、network、live GitHub mutation を commit または evidence に保存しない"

In Scope

  • _redact_evidence_value()(または _is_public_evidence_sha() と対になる field-path check)に、resolved_executable field-path 専用の narrow special case を追加し、値が文字列(resolution 成功)の場合は absolute path の prefix に関わらず常に <redacted> にする。既存の key set・None semantics(unresolved / SKIP 時)は変更しない。
  • 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 等)を、<redacted> + resolved_executable_sha256 一致による identity 証明へ更新する。
  • test_run_worktree_agent_runtime_smoke_runtime_evidence.py の test_resolved_executable_is_single_path_shared_by_version_capture_and_invocation を、raw summary.md path equality ではなく、fake executable の version marker + invocation marker + fixture-local expected resolved_executable_sha256 の一致によって「version capture と invocation が同じ resolved executable を使った」ことを証明する形へ更新する。
  • test_run_worktree_agent_runtime_smoke_claude_gpt_hermetic_matrix.py(--claude-bin の PATH native / absolute native / claude-gpt 等の combination matrix、HOME path 固有の fixture は持たない)を既存 VC のまま維持し、本 Issue の変更が --claude-bin matrix の既存 pass/reject 挙動を退行させないことを確認する(secret-free、credential/network 不使用)。

Out of Scope

Acceptance Criteria

  • AC1: test-owned HOME 配下の executable を使う既存の unit-level regression(test_given_home_paths_in_nested_schema_fields_when_evidence_written_then_redacted)で、resolution 成功時の resolved_executable の値が <redacted> になることを維持する(field-level special case 追加後も、この既存 HOME 判定 regex 由来の redaction が regression しないことを確認する)。
  • AC2: test-owned tmp_path 配下(HOME 以外の absolute path)の executable を使う smoke でも、同じく resolved_executable の値が <redacted> になる(HOME 判定 regex 拡張ではなく field-level special case であることを証明する)。
  • AC3: 同じ smoke で resolved_executable_sha256 は保存され、resolved executable による version capture と invocation の既存 behavior は維持される(Issue 実装: run_worktree_agent_runtime_smoke.py の Claude capability 判定を --help 非掲載フラグでなく実 runtime 挙動に基づく判定へ修正する #1960 Design Decision 5 の invariant を維持)。unresolved / SKIP 時は既存通り resolved_executable: None を維持する。
  • AC4: test_run_worktree_agent_runtime_smoke_runtime_evidence.py の test_resolved_executable_is_single_path_shared_by_version_capture_and_invocation が、raw summary.md path equality ではなく fake executable version marker + invocation marker + resolved_executable_sha256 一致によって同一 executable 使用を証明する形へ更新され、hermetic に PASS する。
  • AC5: focused regression は credential、network、live GitHub mutation を使わず PASS し、SKIP/exit 77 を返さない。

Verification Commands

# AC1
$ 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
# AC2
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py
# AC3
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py
# AC4
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py
# AC5
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_hermetic_matrix.py

Allowed Paths

  • scripts/agent-ops/run_worktree_agent_runtime_smoke.py
  • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py
  • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_hermetic_matrix.py
  • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py

Stop Conditions

Required Skills

  • Python
  • pytest subprocess fixtures

Required Design References

  • docs/dev/agent-skill-boundaries.md
  • docs/dev/secret-policy.md
  • .claude/skills/worktree-agent-runtime-smoke/SKILL.md

Scope Delta(任意)

N/A

Delivery Rule

1 Issue = 1 PR。#2403 / PR #2407 へ混在させず、別 branch と linked worktree で実装する。#2416 が runner の interactive-lane documentation を扱う間、本 Issue は evidence serialization と focused tests のみを編集する。

Scope Overlap Note

Notes for Reviewer

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    on Aug 30, 2026
  2. squne121 commented on Sep 3, 2026

    @squne121
    OwnerAuthor

    総合判定:REQUEST_CHANGES / 先に Issue を再 refinement

    Issue #2421 の設計意図自体――実行時には絶対パスを使い続けるが、persisted evidence ではローカル絶対パスを出さず、resolved_executable_sha256 を identity とする――には賛成です。

    ただし、current main (da4e00593f76d5e22a5746ac39d44501530d5e02) に対して Issue 本文が stale になっています。そのまま impl-review-loop に渡すのは推奨しません。

    敵対的レビュー結果

    Severity | Finding | 判定 -- | -- | -- P0 | #2421 作成後の PR #2454 が、summary.md と --evidence-json の双方を _redact_evidence_value(schema_summary) 経由に変更済み | baseline 再確認必須 P0 | Issue が「HOME path の除去」を求めているのか「resolved_executable のあらゆる絶対パスを除去」なのか不一致 | contract ambiguity P0 | 後者なら、Allowed Paths 外の既存 regression test が raw path 永続化を明示的に要求しており、現在の Allowed Paths では正しく直せない | 実装不能な contract P1 | omit または redact と「キー集合/型変更なら Stop」が競合 | redact に固定すべき P1 | #1960 の historical contract は resolved executable の evidence 保存を要求している | supersession 明記が必要 P2 | Claude-GPT 特化 fixture だけで serializer の一般契約を証明しようとしている | 少し過剰・焦点がずれる

    P0-1:PR #2454 によって #2421 の前提が変わっている

    #2421 は 8月30日作成ですが、9月2日に merge された PR #2454 が generic persisted-evidence redaction を変更しています。同 PR は「公開 SHA/digest だけを trusted field path として保持する」実装を導入しています。

    current runner は summary.md を書く前に schema 全体を _redact_evidence_value() へ通しています。 同じく --evidence-json も同じ redactor を経由します。

    さらに current test には既に、

    resolved_executable = "/home/someone/.local/bin/claude"

    を渡して HOME path が <redacted> になる regression が存在します。

    したがって、#2421 の真の要求が「HOME absolute path を残さない」だけなら、実装部分は既に PR #2454 が incidentally 解消している可能性が非常に高いです。

    これはまず baseline を取り直すべきケースです。追加コードを書くところから始めるべきではありません。

    P0-2:一方で「全 absolute path を消す」なら current main は未修正

    #2421 の title、goal_ref、In Scope はかなり強く、

    persisted evidence から raw resolved_executable absolute path を omit/redact

    と読めます。一方 Parent Goal / AC1 は HOME 配下に限定されています。

    current generic redactor の absolute-path pattern は実質、

    /(home|root|Users)/...

    だけです。

    つまり例えば /tmp/.../claude、/opt/.../claude、/mnt/.../launch.sh は resolved_executable に入っても field の意味だけでは redact されません。

    これは単なる edge case ではありません。既存 --claude-bin regression はまさに tmp_path / "claude-gpt-launcher" / "launch.sh" を作り、その raw realpath が summary に保存されることを要求しています。

    したがって contract は次のどちらかに確定させる必要があります。

    推奨は後者です:resolved_executable という field 自体を persisted evidence では常に redact する。 HOME 判定 regex を増強する話にしない方が明快です。

    P0-3:Allowed Paths に漏れている regression test が blocker

    さらに深刻なのが

    scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py

    です。

    この historical test は現在も、

    version capture と invocation が同じ executable であることを、summary.md の resolved_executable が実 realpath と一致することで証明する

    という assertion を持っています。

    しかし #2421 の Allowed Paths にはこのファイルがありません。Allowed Paths は runner、claude_bin.py、claude_gpt_hermetic_matrix.py の3つだけです。

    全 absolute path を field-level redact すると、この test は必ず stale になります。

    しかもこれは理論上の懸念ではありません。同じリポジトリの PR #2407 で、新 contract と衝突する古い assertion が Allowed Paths 外に残り、required CI が失敗して REQUEST_CHANGES になった事例が直近にあります。

    #2421 で同じ事故を再発させる理由はありません。

    P1:omit はやめて <redacted> に固定した方がよい

    Issue は「omit または redact」を許可しながら、

    キー集合・スキーマ・型定義の変更が必要なら Stop

    とも指定しています。

    これは曖昧です。resolved_executable を omit すると key set が変わります。

    最小互換実装は明確です。

    if field_path == ("resolved_executable",) and isinstance(value, str):
        return "<redacted>"

    つまり successful resolution では

    resolved_executable: <redacted>
    resolved_executable_sha256: <64-hex>

    unresolved / SKIP の既存 None はそのまま

    resolved_executable: None
    resolved_executable_sha256: None

    にする。

    PR #2454 が既に field-path-aware serializer を導入しているため、新しい generic framework も不要です。resolved_executable だけの narrow special case で十分です。resolved_executable_sha256 は既に public evidence SHA allowlist に明示登録されています。

    P1:#1960 を明示的に supersede すべき

    #1960 は Design Decision 5 で shutil.which() により解決した同一絶対パスを version capture と invocation に使うことを要求し、Evidence セクションでは resolved executable 自体の保存も要求しています。

    #2421 が変えたいのはこのうち persistence representation だけ です。

    Issue に次の意味の一文を入れるべきです。

    #2421 supersedes #1960 only with respect to persisted representation of resolved_executable. The invariant that version capture and runtime invocation use the same once-resolved executable remains unchanged.

    これがないと implementer/reviewer が「#1960 と #2421 のどちらが authority か」で不要な探索をします。

    Python の現行 shutil.which() も「その command を呼び出した場合に実行される executable path を返す」APIなので、一度 resolve した path を process 内部で version capture / invocation に使う現在の構造は維持してよいです。persisted evidence にその文字列を残す必要はありません。(Python documentation)

    SHA-256 identity への寄せ方は妥当

    ここは #2421 の良い部分です。

    既存 #2219 でも launcher の path/content SHA-256 binding が evidence 強化として導入されています。

    外部の provenance 設計を見ても、現行 SLSA v1.2 の ResourceDescriptor は resource identity に digest を持ち、sha256 等で内容を識別するモデルです。ローカル machine-specific absolute path を identity として必須にする設計ではありません。(SLSA)

    SLSA 準拠にする必要はありませんが、**「runtime-local locator は process 内、persisted identity は content digest」**という分離自体は良い設計です。

    なお executable を hash した後にファイルを置換される TOCTOU まで閉じようとして、FD pinning・署名・attestation を追加する必要はありません。個人趣味開発のこの Issue では明らかに過剰です。

    推奨アクション

    1. まず current main で baseline を取り直す。 特に PR feat: isolate runtime smoke Claude peer messaging #2454 が追加した HOME-path serializer regression と 実装: runtime-smoke evidence の resolved_executable を field-level で常に redact する #2421 の focused VC を実行する。HOME-only contract が既に全 PASS なら、実装: runtime-smoke evidence の resolved_executable を field-level で常に redact する #2421 は redundant implementation として close / already-fixed 扱いが第一候補です。

    2. 本当に欲しい仕様が「HOMEだけでなく resolved_executable の raw absolute path を一切 persist しない」なら Issue を reframe する。 resolved_executable を path-prefix 非依存で常に <redacted> にする、と明記します。

    3. その場合、Allowed Paths に scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py を追加します。既存 test は raw summary path ではなく、fake binary の version marker + invocation marker + expected SHA-256 で「同一 executable」を証明させるのが適切です。

    4. omit or redact を廃止して key retained + <redacted> に固定し、None の既存 semantics は維持します。実装: run_worktree_agent_runtime_smoke.py の Claude capability 判定を --help 非掲載フラグでなく実 runtime 挙動に基づく判定へ修正する #1960 の persistence requirement のみ supersede することも明記します。

    5. 検証は hermetic pytest で十分です。credential、network、live Claude、live GitHub mutation、新 schema、汎用 path-redaction framework、追加 daemon/registry/harness は不要です。

    私なら #2421 をこのまま実装には回しません。最有力は「PR #2454 後の baseline を確認 → HOME-only なら already fixed で close」。全-path-redaction が本来の目的なら、上記 P0 を直した contract に更新してから実装、です。現状はこの2つが Issue 本文内で混ざっています。

    ## 総合判定:**REQUEST_CHANGES / 先に Issue を再 refinement**

    Issue #2421 の設計意図自体――実行時には絶対パスを使い続けるが、persisted evidence ではローカル絶対パスを出さず、resolved_executable_sha256 を identity とする――には賛成です。

    ただし、current main (da4e00593f76d5e22a5746ac39d44501530d5e02) に対して Issue 本文が stale になっています。そのまま impl-review-loop に渡すのは推奨しません。

    敵対的レビュー結果

    Severity Finding 判定
    P0 #2421 作成後の PR #2454 が、summary.md と --evidence-json の双方を _redact_evidence_value(schema_summary) 経由に変更済み baseline 再確認必須
    P0 Issue が「HOME path の除去」を求めているのか「resolved_executable のあらゆる絶対パスを除去」なのか不一致 contract ambiguity
    P0 後者なら、Allowed Paths 外の既存 regression test が raw path 永続化を明示的に要求しており、現在の Allowed Paths では正しく直せない 実装不能な contract
    P1 omit または redact と「キー集合/型変更なら Stop」が競合 redact に固定すべき
    P1 #1960 の historical contract は resolved executable の evidence 保存を要求している supersession 明記が必要
    P2 Claude-GPT 特化 fixture だけで serializer の一般契約を証明しようとしている 少し過剰・焦点がずれる

    P0-1:PR #2454 によって #2421 の前提が変わっている

    #2421 は 8月30日作成ですが、9月2日に merge された PR #2454 が generic persisted-evidence redaction を変更しています。同 PR は「公開 SHA/digest だけを trusted field path として保持する」実装を導入しています。

    current runner は summary.md を書く前に schema 全体を _redact_evidence_value() へ通しています。 同じく --evidence-json も同じ redactor を経由します。

    さらに current test には既に、

    resolved_executable = "/home/someone/.local/bin/claude"

    を渡して HOME path が <redacted> になる regression が存在します。

    したがって、#2421 の真の要求が「HOME absolute path を残さない」だけなら、実装部分は既に PR #2454 が incidentally 解消している可能性が非常に高いです。

    これはまず baseline を取り直すべきケースです。追加コードを書くところから始めるべきではありません。

    P0-2:一方で「全 absolute path を消す」なら current main は未修正

    #2421 の title、goal_ref、In Scope はかなり強く、

    persisted evidence から raw resolved_executable absolute path を omit/redact

    と読めます。一方 Parent Goal / AC1 は HOME 配下に限定されています。

    current generic redactor の absolute-path pattern は実質、

    /(home|root|Users)/...

    だけです。

    つまり例えば /tmp/.../claude、/opt/.../claude、/mnt/.../launch.sh は resolved_executable に入っても field の意味だけでは redact されません。

    これは単なる edge case ではありません。既存 --claude-bin regression はまさに tmp_path / "claude-gpt-launcher" / "launch.sh" を作り、その raw realpath が summary に保存されることを要求しています。

    したがって contract は次のどちらかに確定させる必要があります。

    推奨は後者です:resolved_executable という field 自体を persisted evidence では常に redact する。 HOME 判定 regex を増強する話にしない方が明快です。

    P0-3:Allowed Paths に漏れている regression test が blocker

    さらに深刻なのが

    scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py

    です。

    この historical test は現在も、

    version capture と invocation が同じ executable であることを、summary.md の resolved_executable が実 realpath と一致することで証明する

    という assertion を持っています。

    しかし #2421 の Allowed Paths にはこのファイルがありません。Allowed Paths は runner、claude_bin.py、claude_gpt_hermetic_matrix.py の3つだけです。

    全 absolute path を field-level redact すると、この test は必ず stale になります。

    しかもこれは理論上の懸念ではありません。同じリポジトリの PR #2407 で、新 contract と衝突する古い assertion が Allowed Paths 外に残り、required CI が失敗して REQUEST_CHANGES になった事例が直近にあります。

    #2421 で同じ事故を再発させる理由はありません。

    P1:omit はやめて <redacted> に固定した方がよい

    Issue は「omit または redact」を許可しながら、

    キー集合・スキーマ・型定義の変更が必要なら Stop

    とも指定しています。

    これは曖昧です。resolved_executable を omit すると key set が変わります。

    最小互換実装は明確です。

    if field_path == ("resolved_executable",) and isinstance(value, str):
        return "<redacted>"

    つまり successful resolution では

    resolved_executable: <redacted>
    resolved_executable_sha256: <64-hex>
    

    unresolved / SKIP の既存 None はそのまま

    resolved_executable: None
    resolved_executable_sha256: None
    

    にする。

    PR #2454 が既に field-path-aware serializer を導入しているため、新しい generic framework も不要です。resolved_executable だけの narrow special case で十分です。resolved_executable_sha256 は既に public evidence SHA allowlist に明示登録されています。

    P1:#1960 を明示的に supersede すべき

    #1960 は Design Decision 5 で shutil.which() により解決した同一絶対パスを version capture と invocation に使うことを要求し、Evidence セクションでは resolved executable 自体の保存も要求しています。

    #2421 が変えたいのはこのうち persistence representation だけ です。

    Issue に次の意味の一文を入れるべきです。

    #2421 supersedes #1960 only with respect to persisted representation of resolved_executable. The invariant that version capture and runtime invocation use the same once-resolved executable remains unchanged.

    これがないと implementer/reviewer が「#1960 と #2421 のどちらが authority か」で不要な探索をします。

    Python の現行 shutil.which() も「その command を呼び出した場合に実行される executable path を返す」APIなので、一度 resolve した path を process 内部で version capture / invocation に使う現在の構造は維持してよいです。persisted evidence にその文字列を残す必要はありません。([Python documentation]1)

    SHA-256 identity への寄せ方は妥当

    ここは #2421 の良い部分です。

    既存 #2219 でも launcher の path/content SHA-256 binding が evidence 強化として導入されています。

    外部の provenance 設計を見ても、現行 SLSA v1.2 の ResourceDescriptor は resource identity に digest を持ち、sha256 等で内容を識別するモデルです。ローカル machine-specific absolute path を identity として必須にする設計ではありません。([SLSA]2)

    SLSA 準拠にする必要はありませんが、**「runtime-local locator は process 内、persisted identity は content digest」**という分離自体は良い設計です。

    なお executable を hash した後にファイルを置換される TOCTOU まで閉じようとして、FD pinning・署名・attestation を追加する必要はありません。個人趣味開発のこの Issue では明らかに過剰です。

    推奨アクション

    1. まず current main で baseline を取り直す。 特に PR feat: isolate runtime smoke Claude peer messaging #2454 が追加した HOME-path serializer regression と 実装: runtime-smoke evidence の resolved_executable を field-level で常に redact する #2421 の focused VC を実行する。HOME-only contract が既に全 PASS なら、実装: runtime-smoke evidence の resolved_executable を field-level で常に redact する #2421 は redundant implementation として close / already-fixed 扱いが第一候補です。
    2. 本当に欲しい仕様が「HOMEだけでなく resolved_executable の raw absolute path を一切 persist しない」なら Issue を reframe する。 resolved_executable を path-prefix 非依存で常に <redacted> にする、と明記します。
    3. その場合、Allowed Paths に scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py を追加します。既存 test は raw summary path ではなく、fake binary の version marker + invocation marker + expected SHA-256 で「同一 executable」を証明させるのが適切です。
    4. omit or redact を廃止して key retained + <redacted> に固定し、None の既存 semantics は維持します。実装: run_worktree_agent_runtime_smoke.py の Claude capability 判定を --help 非掲載フラグでなく実 runtime 挙動に基づく判定へ修正する #1960 の persistence requirement のみ supersede することも明記します。
    5. 検証は hermetic pytest で十分です。credential、network、live Claude、live GitHub mutation、新 schema、汎用 path-redaction framework、追加 daemon/registry/harness は不要です。

    私なら #2421 をこのまま実装には回しません。最有力は「PR #2454 後の baseline を確認 → HOME-only なら already fixed で close」。全-path-redaction が本来の目的なら、上記 P0 を直した contract に更新してから実装、です。現状はこの2つが Issue 本文内で混ざっています。

  3. squne121 commented on Sep 3, 2026

    @squne121
    OwnerAuthor

    推奨アクション

    #2421 は impl-review-loop へ送らず、先に issue-refinement-loop で再 refinement が妥当です。アンカーが指摘している通り、PR #2454 後は HOME 配下の path は generic redaction で既に処理される一方、runner の redactor は /home|/root|/Users 系を対象としており、/tmp や /opt 等まで resolved_executable の意味に基づいて隠す仕様ではありません。

    今回はアンカー中の 「推奨は後者:resolved_executable field 自体を常に redact」 を human direction として採用するのがよいです。そうすれば HOME-only / all-path の曖昧性を人間へ再質問せず解消できます。一方、#1960 由来の regression は現在も raw realpath の persistence を明示的に要求しているため、全-path 契約にするなら test_run_worktree_agent_runtime_smoke_runtime_evidence.py を Allowed Paths に加える必要があります。

    issue-refinement-loop 自体は iteration ごとの承認を既定で要求せず、direct human context 用の preflight.run.with_human_context と、その結果に基づく contract_update.run.with_human_context を備えています。したがって refinement の各 iteration や deterministic Issue 更新ごとに確認を求めない 指示で問題ありません。ただし Claude Code 自体の permission mode を弱める指示とは分離します。

    以下を Claude Code の新規セッションへ渡すのを推奨します。

    Issue #2421 に対して issue-refinement-loop を実行してください。

    対象:

    • Repository: squne121/loop-protocol
    • Issue: #2421
    • trusted human context / OWNER anchor:
      https://github.com/squne121/loop-protocol/issues/2421#issuecomment-5526016066

    目的は 実装開始ではなく、Issue #2421 を current main と現行 repository authority model に整合させ、implementation-ready または already-fixed disposition まで refinement を完了すること です。

    最重要方針

    最初に .claude/skills/issue-refinement-loop/SKILL.md をロードしてください。

    その Skill、plan_refinement_loop.py が生成する REFINEMENT_LOOP_PLAN_V1、canonical command registry、必要に応じてロードされる references/ を正本として従ってください。

    独自に workflow、routing、review policy、approval gate、mutation procedure を再実装しないでください。

    今回の comment URL は、この依頼を行っている人間 operator が明示的に指定した direct human context / OWNER anchor として扱ってください。GitHub comment metadata から human origin を推定するのではなく、canonical with_human_context lane を使用してください。

    anchor_comment_url:

    https://github.com/squne121/loop-protocol/issues/2421#issuecomment-5526016066

    人間承認について

    issue-refinement-loop の repository loop iteration approval gate は不要です。

    needs-fix → rewrite → review の iteration は、canonical policy が許す限り max_iterations まで自動継続してください。

    次のような追加確認を私へ求めないでください。

    • 「次の iteration に進んでよいですか」
    • 「Issue 本文を更新してよいですか」
    • 「deterministic repair を適用してよいですか」
    • 「レビューをもう一度実行してよいですか」
    • 「アンカーの指摘を反映してよいですか」

    canonical planner / Skill / command registry が許可する Issue refinement 上の read、deterministic repair、contract update、review、readback、label hygiene は、そのまま続行してください。

    ただし、この「承認不要」は Claude Code 自体の permission model を弱める意味ではありません。

    --dangerously-skip-permissions 等を新たに導入したり、permission mode を勝手に変更したりしないでください。repository の canonical executor / hooks / Auto mode で許可される経路を使用してください。

    canonical Skill が明示的に human_judgment_required、environment failure、またはその他の hard stop を返した場合だけ、その契約に従って停止してください。独自の human gate を追加しないでください。

    canonical entry

    canonical main root / default branch から開始し、実行開始時点の current main HEAD を取得してください。

    アンカーに記載された historical/current SHA を盲目的に固定せず、実行時の current main を authority として再確認してください。

    human-context preflight は canonical executor profile を使用してください。概念的には次の lane です。

    uv run --locked python3 scripts/agent-guards/skill_runtime_exec.py \
      --command-id preflight.run.with_human_context \
      --issue-number 2421 \
      --repo squne121/loop-protocol \
      --anchor-comment-url 'https://github.com/squne121/loop-protocol/issues/2421#issuecomment-5526016066'

    ただし、実際の argv / execution class / required branch / allowed mutation は current repository の ISSUE_REFINEMENT_COMMAND_REGISTRY_V1 を正本とし、古い手書き command を優先しないでください。

    trusted contract patch plan が生成され、canonical routing が Issue update を要求する場合は contract_update.run.with_human_context 経路を使用してください。

    SubAgent の使用を必須とする

    Step 1 Investigation では、利用可能な native SubAgent 機構を使い、少なくとも codebase-investigator 相当の read-only SubAgent を起動してください。

    SubAgent には少なくとも次を current main 基準で調査させてください。

    外部仕様に関する claim が refinement の disposition に実際に必要で、canonical planner が web research を要求する場合は web-researcher 相当の SubAgent も使用してください。

    SubAgent completion barrier

    起動した SubAgent を放置して先へ進まないでください。

    各 required SubAgent について native wait mechanism を使用し、terminal completion を確認してください。

    SubAgent がまだ running の間は、Step 2 review、Issue mutation、最終 disposition へ進まないでください。

    全 required SubAgent の最終結果を回収し、その evidence を root orchestrator が consume してから次へ進んでください。

    SubAgent 起動だけを成功扱いにしないでください。

    SubAgent failure / timeout / invalid result は canonical Skill の failure handling に従って処理し、結果が得られなかったのに得られたことにしないでください。

    child SubAgent 自身には、canonical Skill が明示的に要求しない限り nested delegation をさせないでください。

    GitHub Issue の mutation は SubAgent に直接行わせず、root control-plane の canonical mutation phase に集約してください。

    #2421 に対する今回の human direction

    anchor comment の adversarial review を単なる advisory text として捨てないでください。

    特に anchor 内の次の推奨を、今回の human-context refinement の方向性として扱ってください。

    resolved_executable は HOME 判定 regex を拡張するのではなく、persisted evidence 上では field semantics に基づいて raw absolute path を一切公開しない。

    つまり、baseline / repository evidence がこれを否定するより強い current authority を示さない限り、Issue #2421 の曖昧性は次の方向へ解消してください。

    Desired refined contract

    successful executable resolution の persisted representation は:

    resolved_executable: <redacted>
    resolved_executable_sha256: <validated 64-hex SHA-256>
    

    とします。

    resolved_executable の実値が、

    • /home/...
    • /root/...
    • /Users/...
    • /tmp/...
    • /opt/...
    • /mnt/...
    • その他 absolute path

    のどれであるかに依存してはいけません。

    field が resolved_executable であり、successful resolution の string value なら persisted output では <redacted> とする、という narrow field-level contract を優先してください。

    一方 unresolved / unavailable 等で既存値が None の場合は、既存 semantics を不要に変更せず None を維持してください。

    resolved_executable key を omit する方式は採用しない方向で refinement してください。key set を維持し、value を <redacted> にすることで既存 schema / consumer との compatibility を最大化してください。

    新しい generic redaction framework は作らない契約にしてください。

    runtime identity invariant は維持する

    persisted path を redact することと、runtime 内部で executable absolute path を使用することを混同しないでください。

    次の invariant は維持してください。

    • executable は一度だけ resolve する
    • version capture はその resolved executable を使う
    • actual invocation も同じ resolved executable を使う
    • executable identity の persisted proof は resolved_executable_sha256 を中心にする

    Issue #1960 に対しては、必要なら次の意味を current #2421 contract に明記してください。

    #2421 supersedes #1960 only with respect to the persisted representation of resolved_executable. The invariant that version capture and runtime invocation use the same once-resolved executable remains unchanged.

    つまり #1960 全体を supersede しないでください。

    baseline-first

    コード変更を前提に refinement しないでください。

    まず current main の baseline を再確認してください。

    特に、PR #2454 merge 後に:

    1. HOME absolute path が既に redaction されること
    2. resolved_executable_sha256 が保持されること
    3. /tmp 等の non-HOME absolute path が current serializer で残り得るか
    4. historical runtime-evidence regression が raw realpath persistence を現在も要求しているか
    5. summary.md と --evidence-json が同じ redaction contract を共有しているか

    を repository evidence / focused baseline verification で確定してください。

    canonical planner が verification command を生成または許可する場合、その command を正確に実行してください。

    勝手に「PR #2454 で全部直った」と推測して Issue を close しないでください。

    disposition

    baseline の結果で分岐してください。

    A. stronger all-path contract まで current main が既に満たしている場合

    追加実装を捏造しないでください。

    canonical issue-refinement-loop の already-fixed / superseded / close-not-planned 等の current termination policy が、この human anchor と repository evidence から no-code disposition を認める場合は、その canonical route を使用してください。

    認めない場合は独自に close せず、canonical result に従ってください。

    B. HOME-only は満たすが、all-path field-level redaction は未達の場合

    これを今回の主な想定ケースとして扱ってください。

    Issue #2421 を implementation-ready な all-path field-level redaction contract へ更新してください。

    少なくとも次を整合させてください。

    • title
    • goal_ref
    • Parent Goal / Current Validated Scope
    • Outcome
    • In Scope / Out of Scope
    • Acceptance Criteria
    • Verification Commands
    • Allowed Paths
    • Stop Conditions
    • Notes / historical supersession

    特に Allowed Paths には、current historical contract と衝突する:

    scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py

    を追加する必要性を検討し、repository evidence が anchor の finding を確認するなら追加してください。

    その regression は raw summary.md path equality で executable identity を証明するのではなく、たとえば:

    • fake executable version marker
    • actual invocation marker
    • fixture-local expected SHA-256
    • resolved_executable_sha256
    • raw path が persisted evidence に存在しないこと

    によって、「version capture と invocation が同じ executable を使った」ことを証明する contract へ更新する方向で refinement してください。

    summary.md と指定時の --evidence-json の双方を AC に含めてください。

    test / verification boundary

    この Issue の verification は hermetic / fixture-owned を原則としてください。

    credential、network、live Claude API、live GitHub mutation を runtime verification の成功条件に追加しないでください。

    test-owned temporary executable / HOME / output directory だけで再現可能な focused regression を優先してください。

    不要なもの:

    個人趣味開発として、今回の evidence representation defect を最小かつ有用な変更で解決する contract にしてください。

    refinement loop

    investigation が完了したら canonical root review pipeline を実行してください。

    needs-fix の場合は、max iteration 内で自動的に rewrite → fresh review を継続してください。

    deterministic safe repair を planner が示す場合は、人間確認を追加せず canonical repair path を使用してください。

    各 rewrite 後は fresh Issue body / current repository state に対して再 review してください。

    古い review output を再利用して approve にしないでください。

    default max_iterations は Skill の current canonical valueに従ってください。

    mutation boundary

    このセッションでは Issue refinement の完了まで を行ってください。

    許可対象:

    • canonical read / investigation
    • required SubAgent execution
    • baseline verification
    • Issue contract の canonical update
    • refinement に必要な label hygiene
    • canonical review / readback
    • canonical termination disposition

    この段階で行わないこと:

    Issue が implementation-ready になった時点で停止し、次 action として impl-review-loop を明示してください。

    already-fixed disposition になった場合は、その根拠を明示して終了してください。

    最終報告

    終了時には少なくとも次を報告してください。

    途中経過の確認を私へ求めず、canonical Skill が要求する terminal state まで一連で進めてください。

    この形なら、アンカーの「二択」をそのまま人間へ差し戻さず、all-path field-level redaction を OWNER direction として refinement しつつ、current main が既に満たしていれば無駄な実装を作らない動きになります。PR #2454 の HOME-path regression 自体は既に repository に存在することも確認できます。

  4. changed the title [-]実装: runtime-smoke evidence から実行ファイル絶対パスを除去する[/-] [+]実装: runtime-smoke evidence の resolved_executable を field-level で常に redact する[/+] on Sep 3, 2026
  5. squne121 commented on Sep 3, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(disposition: approved / implementation-ready)

    実行時 current main HEAD: da4e00593f76d5e22a5746ac39d44501530d5e02

    anchor: https://github.com/squne121/loop-protocol/issues/2421#issuecomment-5526016066(with_human_context lane、preflight.run.with_human_context 経由で snapshot 固定・検証済み)

    baseline(PR #2454 merge 後の current main で確認済み事実)

    1. _SECRET_LIKE_RE(run_worktree_agent_runtime_smoke.py:95-98)は /(?:home|root|Users)/... のみを対象とし、/tmp, /opt, /mnt 等の non-HOME absolute path は対象外。
    2. resolved_executable_sha256 は _PUBLIC_EVIDENCE_SHA_LENGTHS に既に登録済みで保持される。
    3. test_given_home_paths_in_nested_schema_fields_when_evidence_written_then_redacted(HOME-only redaction、unit-level)は current main で PASS(HOME-only 部分は既に解消済み)。
    4. test_run_worktree_agent_runtime_smoke_claude_bin.py と test_run_worktree_agent_runtime_smoke_runtime_evidence.py の raw-realpath-equality assertion(tmp_path 配下、非HOME)は現在も PASS(= non-HOME absolute path は raw のまま persist されている)。
    5. summary.md と --evidence-json は同一の _redact_evidence_value() を経由する(redaction contract 共有)。

    → disposition B(HOME-onlyは満たすが、all-path field-level redaction は未達)を repository evidence で確定。already-fixed close は不成立。

    Issue #2421 契約delta(主要点)

    SubAgent 実行

    最終 review verdict

    • Step 2 deterministic: VERDICT: approve(body_sha256: sha256:a1e26e57815eede85d3ee34afabd898d2c1873592ab55cf83e1aa56377532a73)
    • Step 2.5 semantic(2周目): effective_verdict: approve(low severity finding 1件、warning記録のみ)
    • canonical_step2_route: step_2_5 → Step 2.5 approve → Step 4.5 へ

    unresolved(blocker ではない)

    • Step 2.5 round 2 の low-severity finding(Outcome セクションのファイル列挙が test_run_worktree_agent_runtime_smoke.py を明示していない)は route_high_open_to_rewrite policy 上 rewrite 対象外のため、この Issue には未反映。implementation 着手時に軽微な文言 nit として認識しておくこと(AC としての検証可能性には影響しない)。

    disposition

    implementation-ready。次 action: impl-review-loop(本セッションでは明示的なユーザー指示によりここでは起動しない)。

    Allowed Paths 最終状態:

    • scripts/agent-ops/run_worktree_agent_runtime_smoke.py
    • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py
    • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_hermetic_matrix.py
    • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py
  6. squne121 commented on Sep 3, 2026

    @squne121
    OwnerAuthor

    推奨は #2421 をそのまま impl-review-loop に投入です。再 refinement は不要です。直近の issue-refinement-loop は approved / implementation-ready で終了しており、all-path field-level redaction、4つの Allowed Paths、AC1〜AC5、#1960 との supersession boundary まで確定済みです。

    また、refinement 時点の main@da4e005... から現在は main@488dae6... に進んでいるため、古い SHA を固定せず、impl-review-loop の Root-Owned Synchronous Entry Transition で live main / live Issue を再取得してから開始させる形が適切です。

    impl-review-loop 自体が Implementation → Verification → PR Review → Judgment を SubAgent に委譲し、REQUEST_CHANGES なら自動的に Step 1 に戻る設計です。終了条件も「reviewer APPROVE」だけではなく、live mergeability と blocker-free を確認して draft_pr_ready になった時点であり、merge は実行しません。

    特に今回の要望に合わせ、SubAgent の完了待ちは repository の Common Completion Protocol を明示的に強制するのがよいです。wait_agent の timeout や途中報告を完了扱いせず、final result を取得したあと list_agents で terminal completed まで確認してから次 Step に進ませます。

    以下を新規 Claude Code セッションにそのまま渡す想定です。

    Issue #2421 に対して impl-review-loop を実行してください。

    対象:

    • Repository: squne121/loop-protocol
    • Issue: #2421
    • Issue URL:
      https://github.com/squne121/loop-protocol/issues/2421

    この Issue は issue-refinement-loop 済みで、最新の refinement 終了報告では approved / implementation-ready です。

    関連 context:

    • trusted human context / OWNER anchor:
      https://github.com/squne121/loop-protocol/issues/2421#issuecomment-5526016066
    • refinement completion report / agent report:
      https://github.com/squne121/loop-protocol/issues/2421#issuecomment-5526473922

    目的は、Issue #2421 の実装・検証・PR review・REQUEST_CHANGES 修正ループを、人間の途中承認を挟まず canonical impl-review-loop に従って自律実行し、マージ直前の draft_pr_ready terminal state まで到達させることです。

    PR の merge 自体は実行しないでください。
    auto-merge も有効化しないでください。
    最終的な merge 判断だけを人間に残してください。

    1. Canonical workflow を正本にする

    最初に必ず以下をロードしてください。

    .claude/skills/impl-review-loop/SKILL.md

    その後、SKILL.md が要求する順序で少なくとも以下を読み、current repository の内容を正本として実行してください。

    • .claude/skills/impl-review-loop/steps/preparation.md
    • .claude/skills/impl-review-loop/steps/step-1-implementation.md
    • .claude/skills/impl-review-loop/steps/step-2-verification.md
    • .claude/skills/impl-review-loop/steps/step-4-pr-review.md
    • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
    • .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
    • .claude/skills/impl-review-loop/steps/conflicting-pr-escalation-runbook.md
    • .claude/skills/impl-review-loop/steps/context-protocol-and-guardrails.md

    手書きの独自 workflow を canonical Skill より優先しないでください。

    planner、router、command registry、controlled executor、verification adjudicator 等についても、current repository に canonical implementation が存在する場合はそれを使用してください。

    このプロンプトに記載したコマンド例や過去 SHA より 実行時点の repository authority を優先してください。

    2. current main / live Issue から開始する

    refinement 終了時の historical HEAD を固定しないでください。

    開始時に canonical main root で fetch/read-only preflight を行い、

    を current state から再取得してください。

    そのうえで impl-review-loop が要求する Root-Owned Synchronous Entry Transition を root/main thread 自身で一続きに実行してください。

    つまり capability preflight → live Issue fetch → current-run issue-contract-review → live readback → routing → Step 1 dispatch を canonical contract に従って同一 control flow 内で実行してください。

    古い contract snapshot や過去コメントだけを Step 1 authorization として使用しないでください。

    3. Context provenance

    context intake が必要な場合は、以下を明確に分離してください。

    human_context_comment_urls:

    • https://github.com/squne121/loop-protocol/issues/2421#issuecomment-5526016066

    agent_report_comment_urls:

    • https://github.com/squne121/loop-protocol/issues/2421#issuecomment-5526473922

    同じ URL を両方の provenance class に入れないでください。

    refinement completion report は実装 authority そのものとして盲信せず、live Issue / current repository で readback してください。

    4. Issue #2421 の実装 contract

    live Issue 本文を正本としますが、refinement 済み contract の主要 intent は以下です。

    Allowed Paths は必ず live Issue から読み直してください。
    refinement 終了時点では以下の4ファイルです。

    • scripts/agent-ops/run_worktree_agent_runtime_smoke.py
    • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_bin.py
    • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_hermetic_matrix.py
    • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_runtime_evidence.py

    Allowed Paths 外を変更する必要が見つかった場合は勝手に scope を拡大せず、canonical routing / Stop Conditions に従ってください。

    5. 人間承認を途中に追加しない

    今回の operator direction として、canonical impl-review-loop が許可する bounded operations はマージ直前まで事前承認済みとして扱ってください。

    したがって、以下について routine approval を人間へ求めないでください。

    • investigation の続行
    • worktree / branch 作成
    • Allowed Paths 内の編集
    • formatter / lint / typecheck / test / build
    • Issue Verification Commands の実行
    • commit
    • canonical publish lane による branch push
    • PR 作成
    • PR body 更新
    • CI 待機
    • failed CI の canonical bounded rerun
    • pr-reviewer 起動
    • REQUEST_CHANGES の修正
    • review iteration の継続
    • stale-head re-review
    • BEHIND 時の canonical update_branch
    • update_branch 後の verification / review 再実行
    • canonical scope-clean reconciliation
    • mechanical PR hygiene correction
    • loop iteration の継続

    「実装してよいですか」
    「commit してよいですか」
    「push してよいですか」
    「PR を作ってよいですか」
    「レビュー結果を修正してよいですか」
    「次の iteration に進めてよいですか」
    「CI を再実行してよいですか」
    といった workflow-level confirmation は不要です。

    ただし、これは repository / Claude Code の permission boundary を迂回する指示ではありません。

    --dangerously-skip-permissions の新規導入、force push、--no-verify、権限モデルの書き換え、hook bypass、guard bypass 等を独自に行わないでください。

    現在の repository-approved executor / hooks / permission mode で実行可能な canonical route を使ってください。

    6. SubAgent を必須使用する

    root/main thread が implementation / verification / review を直接肩代わりしないでください。

    canonical impl-review-loop に従い、少なくとも以下を対応する SubAgent に委譲してください。

    Step 1

    implementation-worker

    • implement-issue Skill を使う
    • worktree / branch の作成または既存 canonical worktree の利用
    • implementation
    • focused verification
    • commit
    • push
    • PR 起票または既存 PR 更新
    • canonical IMPLEMENT_RESULT_V1 の返却

    Step 2

    test-runner

    • candidate current HEAD を独立検証
    • live Issue の AC / Verification Commands に束縛する
    • hermetic verification を実行
    • canonical head-bound report を返す
    • root が canonical adjudication を実行する

    Step 4

    pr-reviewer

    • current-head gate を通過した場合のみ起動
    • current PR head に対する review を行う
    • canonical LOOP_VERDICT を返す

    必要な auxiliary SubAgent が canonical Skill から要求される場合も使用してください。

    ただし nested SubAgent delegation が Issue Stop Conditions または repository policy に反する場合は行わないでください。

    7. SubAgent completion barrier — 必ず完了を待つ

    SubAgent を起動しただけで次 Step に進んではいけません。

    すべての canonical SubAgent invocation で current repository の Common Completion Protocol を厳密に適用してください。

    各 SubAgent について:

    1. spawn_agent の返却から canonical task_name を保存する。
    2. 必要に応じて wait_agent を使う。
    3. wait_agent の timeout、steer acknowledgement、途中 mailbox update、progress message を completion とみなさない。
    4. 対象 SubAgent の final result を実際に取得・consume する。
    5. 続けて list_agents を実行し、保存した canonical task name が terminal completed になったことを確認する。
    6. final result と terminal completed の両方が揃って初めて、その Step を完了扱いにする。
    7. errored / interrupted / shutdown / not_found を成功扱いしない。
    8. lifecycle / discovery failure が canonical recovery procedure の対象なら、Skill の bounded recovery を実行する。
    9. recovery 不可能な場合のみ canonical blocker として扱う。

    特に test-runner については、
    terminal completed だけでも、
    final test report だけでも、
    Step 2 完了とはみなさないでください。

    同様に implementation-worker / pr-reviewer の結果も completion barrier を通過してから routing に使ってください。

    8. 実装→検証→レビューの自動ループ

    canonical loop:

    Step 1 Implementation
    → Step 2 Verification
    → Step 4 PR Review
    → Step 5 Judgment

    を terminal state まで継続してください。

    Verification failure

    Step 2 の authoritative verification / VC adjudication が blocking の場合、PR review を無理に実行せず canonical routing に従い Step 1 へ戻してください。

    REQUEST_CHANGES

    pr-reviewer が REQUEST_CHANGES を返した場合:

    • blockers を正規化する
    • LOOP_STATE.blockers_history に保存する
    • fix_delta として次の implementation-worker に渡す
    • 人間へ承認を求めず次 iteration を実行する
    • 修正後は current head に対して verification を再実行する
    • verification 後に current-head gate を再評価する
    • pr-review を再実行する

    これを canonical max_iterations の範囲で継続してください。

    勝手に一回のレビューで終了しないでください。

    stale head

    reviewed head と current PR head が異なる場合は、人間へ戻さず canonical route_stale_head_rereview で current head を再レビューしてください。

    branch behind / main drift

    BEHIND や scope-clean main drift が発生した場合は、canonical Step 5 routing に従って update_branch / reconciliation を行い、必要な evidence のみ再取得してください。

    head SHA が変わった場合は古い verification / review を stale として扱ってください。

    9. hard stop を勝手に増やさない

    SubAgent が単に human_review_required: true と自己申告しただけでは、canonical Skill が停止権限を与えていない限りループを止めないでください。

    scope-rollup / advisory artifact / overlap telemetry / contract snapshot telemetry 等の不足だけを理由に独自 human gate を追加しないでください。

    canonical Skill が warning として扱うものは warning として記録し、可能な限り自動継続してください。

    一方、canonical Skill が正式に hard stop とするものは尊重してください。例:

    • formal HUMAN_REVIEW_REQUIRED verdict
    • actual Git conflict / mergeable == CONFLICTING / merge_state_status == DIRTY
    • live owner comment による明示的停止
    • secret-policy の実 hard gate
    • max-iteration exhaustion
    • unrecoverable permission / publish safety failure
    • Allowed Paths を維持できない実スコープ問題
    • Issue 自身の Stop Conditions
    • canonical root entry が implementation を authorize しない場合

    hard stop に到達した場合は、迂回や scope expansion をせず、停止理由と必要な人間判断を具体的に報告してください。

    10. 品質方針

    目的は harness を増やすことではなく、#2421 の contract を最小かつ高品質に満たすことです。

    優先順位:

    1. Issue contract の正確な達成
    2. regression prevention
    3. executable identity invariant の維持
    4. focused / hermetic verification
    5. minimal diff
    6. repository consistency

    次は避けてください。

    • unnecessary abstraction
    • generic path sanitizer framework
    • 新しい evidence schema
    • unrelated refactor
    • cosmetic cleanup
    • TOCTOU / FD pinning / signature / attestation 等への scope expansion
    • Issue に要求されていないセキュリティ機構や harness
    • test を通すためだけの production behavior hardcoding

    実装に必要な repository investigation は十分に行ってください。

    外部仕様の確認が本当に必要になった場合のみ、canonical external-research policy に従って調査してください。
    今回の core contract が repository-local evidence だけで解決可能なら、外部調査を無理に追加する必要はありません。

    11. 終了条件

    次をすべて満たすまで「完了」としないでください。

    • current Issue contract に対する implementation 完了
    • Allowed Paths compliance
    • current-head Verification Commands / relevant regression PASS
    • SKIP / fallback-success を PASS と誤認していない
    • required CI が current head に対して成立
    • pr-reviewer の current-head verdict が APPROVE
    • blockers == []
    • live mergeability が canonical approvable state
    • canonical Step 5 route が approved
    • IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready

    ここまで到達したら停止してください。

    PR を merge しないでください。
    auto-merge を設定しないでください。

    最終報告では少なくとも以下を示してください。

    途中の routine approval を私へ求めず、canonical terminal state または canonical hard stop まで一連で実行してください。

    この形なら、単に「承認不要」と書くより、どの承認が不要か/何だけは hard stop なのかを分離できます。特に final result → list_agents terminal completed → routing を明文化した点が、現在の impl-review-loop の completion contract と一致します。現行 Claude の prompting guidance でも、agentic coding では実行してほしい action/tool を明示する方が安定します。 ([docs.anthropic.com]1)

  7. self-assigned this
    on Sep 3, 2026
  8. squne121 commented on Sep 3, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-09-03T13:50:31Z)

  9. squne121 commented on Sep 3, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-09-03T14:20:00Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      pr_url: "https://github.com/squne121/loop-protocol/pull/2485"
      head_sha: "d3681c5fe20e8e991d33e17d914fcd3ec49686b5"
      issue_number: 2421
      termination_reason: approved
      merge_ready: true
      iteration: 0
    
    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-09-03T14:20:00Z"
      rollup_plan_ref:
        body_sha256: null
        generated_at: null
      decision: skipped
      executed_actions: []
      skipped_reason: "advisory diagnostic not manually invoked for this run (#1860 Owner Decision: automatic dispatch removed)"
      candidates_reviewed: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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