Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "hook-chain-runtime-smoke policy が要求する all_matching_hooks_observed と sibling_side_effect_inventory_complete を、raw transcript を保存せず current HEAD に束縛した bounded allowlist-only evidence で、handler identity 単位・post-condition 単位に独立に判定可能にする"
change_kind: workflow
dedupe_key: "worktree-agent-runtime-smoke:generic-hook-chain-evidence:v1"Parent Issue
なし(単独改善。新規 Issue は #1573 の hard predecessor として dependency を登録する。)
Parent Goal Ref
- Goal:
hook-chain-runtime-smokeが要求する2 assertionを、genericなruntime evidence capabilityでfail-closedに判定できるようにする。 - Desired Destination: consumerがcurrent HEADの実行からboundedなallowlist-only summaryを取得し、特定のconsumer Issueに依存しないhook-chain assertionを検証できる状態。
Current Validated Scope
scripts/agent-ops/run_worktree_agent_runtime_smoke.pyの structured Claude lane は--include-hook-eventsと invocation-local additive--settingsoverlay を使用し、current project settingsを変更せず追加hookを併走させる。- 同runnerは
summary.mdだけをoutput directoryに永続化し、tested_head、runtime metadata、redacted schema summaryを記録する。raw prompt、raw stream transcript、credential、HOME absolute pathは保存しない。 - current
.claude/settings.jsonのPreToolUse(Bash matcher)には secret boundary guard・Japanese prose guard・CI performance advisory・temporary residue advisory の4つの異なる command hook handlerが一致し、runner自身もSubagentStart/SubagentStopに観測用hookを追加する。Claude Codeのhookはproject settingsだけで完結せず、user/local/managed/plugin/skill等からも合成されうるため、settings配列の要素数だけでは runtime全体の実行期待数を証明できない。 - 既存
.claude/hooks/tests/hookchain_harness.pyは、実.claude/settings.jsonを読み込み matcher に一致する command hook を subprocess として実行し、hook単位の decision(deny/defer/ask/allow/no_decision/hook_error)を収集する、read-onlyな settings-driven observation の既存手法である。本Issueの bounded verification cohort(下記 In Scope 参照)は、この既存手法が扱う「current project settingsの、選択したhook eventに一致するcommand hook」を基準とする。 .claude/hooks/session_manifest_coordinator.shは、内部guard stepが失敗した場合(内部 exit code != 0 の場合)にも、また producer stepが失敗コードを返した場合にも、最終的には exit 0 で終了する既存hookである。hookの正常終了(exit 0)と、そのhookが意図した副作用(session manifest生成等)を完了させたことは、現状のrunner設計では独立に確認できない。- Claude Code公式ドキュメント(hooks reference)は、同一event/matcherにマッチする複数hookの並列実行や、hookのstart/completionを別lifecycle phaseとして区別できる公開フィールドの有無を明記していない。実装はこれらを保証された仕様として前提にせず、実際のruntime evidenceから判定する必要がある。
Remaining Parent Gaps
- 実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 のsettings path anchoringと既存validator/test更新は本Issueのscope外であり、本capability merge後に#1573がcurrent HEADでruntime verificationを実行する。
- 実装: worktree-agent-runtime-smoke に generic hook-chain evidence capability を追加する #2663 のmergeそのものは 実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 のconsumer AC7 達成を意味しない。実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 側の既存 AC7 コマンドには現時点で
--require-hook-chain-evidenceフラグがなく、停止報告で存在しないとされた固定worktree pathが残っている。実装: worktree-agent-runtime-smoke に generic hook-chain evidence capability を追加する #2663 merge後、実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 の既存Issue内でAC7を次の条件に沿って更新し、再実行することをhandoffの条件とする。- 新設のopt-inフラグ(
--require-hook-chain-evidence)を実際に使用するinvocationへ更新する - 実在するcanonical linked worktree(placeholderや存在しないabsolute worktree pathを使わない)を指定する
- commit済みのcurrent HEADに対する最終runtime verificationとして再実行する
- runner側(実装: worktree-agent-runtime-smoke に generic hook-chain evidence capability を追加する #2663)のmergeのみをもって#1573のAC7 PASSとはしない
- 新設のopt-inフラグ(
- Task Context、Claude-GPT、Herdr cold-restart、又はgeneric runnerの他のOPEN Issueと競合する変更は本Issueに含めない。対象3ファイルを触るOPEN Issueとはmerge orderを直列化する。
Outcome
更新された worktree-agent-runtime-smoke runner、skill contract、既存runner testsが、current HEADを示すallowlist-only summary.md 内で all_matching_hooks_observed と sibling_side_effect_inventory_complete の各判定結果を、実際のhook-chain evidenceから独立に、かつ handler identity 単位 / post-condition 単位で記録する状態。各assertionは pass | fail | unverified の3値ステータスで記録され、boolean field は status == pass の場合にのみ true となる(cohortの完全性を識別できない場合や副作用の観測可能性が不足する場合に、件数一致や観測用hookの成功だけを根拠に true へ昇格しない)。hook-chain evidence PASSは、両assertionが共に status: pass の場合にのみ成立する。
Runtime Verification Applicability
runtime_verification_applicability:
decision: immediate
reason: "成果物がClaude structured runtimeのhook-chain execution evidence capabilityであり、fixture-only testはlive hook delivery/concurrencyを代替しない。"
applicable_acs: [AC5]
verification_profile: hook-chain-runtime-smoke
execution_environment: "linked worktree、existing worktree-agent-runtime-smoke、native Claude structured lane。"
skip_conditions: "Claude CLI又はrequired isolated runtimeが利用不能ならstdoutをSKIP:で開始しexit 77とする。SKIPはruntime PASSではない。"
fallback_policy: "prompt self-report、marker text、raw transcript、既存sequential hookchain_harness、又はassertion/inventoryの片方だけをPASSの代替にしない。"
artifact_requirements: "runner-owned bounded summary.mdのtested_head、2 assertionのstatus(pass/fail/unverified)、eventとcount-only inventoryをreviewする。raw prompt/transcript、credential、HOME absolute path、hook command/output bodyを保存又は引用しない。"In Scope
- structured native Claude laneにopt-inのgeneric hook-chain evidence capabilityを追加し、対象eventとinventory targetをbounded closed allowlistからのみ受理する。caller-supplied shell command、hook command、任意path、任意marker、又はarbitrary configをevidence sourceとして受理しない。
all_matching_hooks_observedのexpected cohortを、「current project settings(.claude/settings.json)内の、選択したhook eventに一致するcommand hook」に限定して定義する。runnerが追加する観測用hookはこのcohortから明示的に除外し、別扱いとする。expected cohortの各要素と実際の実行証拠を、handler identity(event + matcher + command文字列の組、又はruntimeが実際に提供する同等の識別子)単位で照合する。件数が一致しても、いずれかのhandlerの実行証拠が欠落・重複・未知entryである場合はfailとする。user/local/managed/plugin/skill等、project settingsから独立に合成されるhook sourceは初期cohortの対象外とし、その存在をもって「runtime全体の全hookを証明した」とは主張しない(識別不能な場合はunverifiedとする)。観測用hook自身の実行成功を、既存sibling command hookすべての実行証拠へ昇格させない。sibling_side_effect_inventory_completeをhookの実行完了(exit code等)とは独立したassertionとして扱う。初期allowlistで検証対象とする各副作用について、少なくとも(1) 対象handler、(2) 期待する変化、(3) 実際に読むpost-condition(例:.claude/hooks/session_manifest_coordinator.shが書くsession manifestファイルの実状態)、(4) 正常な無変更の条件、(5) observation timing(対象sibling hook群の実行完了後に post-condition を読む join point)、(6) bounded location/resource、を実装が明示する。denyを返すhookがあってもsiblingのallowlisted side effectを実行事実からinventoryし、expected/observed mismatch、missing、unknown、duplicate、overflow、又は未観測の全caseをfailとする。既存hookのexit code semantics自体は変更しない(session_manifest_coordinator.shの内部guard/producer失敗時exit 0挙動を含む既存hookの動作は変更しない)。- 2 assertionとaggregate verdictを、
summary.md/ optional existing--evidence-jsonschema summaryにcount/status(pass|fail|unverified)/boolean(status==passのときのみtrue)で記録する。existingtested_headを保持し、headがevidence reviewの対象と比較できない場合、consumerはPASSを主張できない。開発中のtrial実行はAllowed Paths内の未commit candidateに対して許可し、失敗時は診断として修正・再実行できるものとする。ただし最終acceptance evidenceは対象変更をcommitしたHEADに対してのみ成立させ、(a)tested_head(commit SHA)、(b) 検証対象tracked inputsがそのHEADと一致していること、(c) 実行前後で対象worktreeに意図しないdriftがないこと、の3点を記録する。before/after fingerprint一致だけを「開始時点でHEADと一致していた」の意味として扱わない。 - existing hook/configurationを変更・disable・replaceせず、invocation-local additive observationのみを使う。existing
.claude/hooks/tests/hookchain_harness.pyのsequential subprocess実行手法を、runtime evidence producerとしてそのまま再利用しない(本capabilityは native structured Claude lane上の実行証拠を対象とする)。 - canonical live invocationに、無害な入力による再現可能な positive scenario(選択したallowlisted hook eventを1回以上実際に発生させ、対応するsibling command hook群の実行証拠とallowlisted side-effect post-conditionをidentity単位で確認する)と deny scenario(PreToolUse guard系hookが実際にdenyを返す状況を発生させ、deny後もsiblingの実行証拠・post-conditionを照合する)を定義する。空のexpected setと空のobserved setが一致しただけのPASSは禁止する。hook lifecycleの複数レコード(開始・進捗・完了等が別々に届く場合を含む)や、別のtool callに対する正当な同一handler再実行を、根拠なく「重複」と誤認しない。
--max-turnsは品質条件ではなく実行上限として扱い、上限到達をcapability不足に分類しない。 - existing runner unit/integration testsを拡張し、both assertionのindependent PASS/FAIL、各failure mode(handler欠落・count一致だが実行証拠不一致・副作用欠落・空集合false green・lifecycle複数レコードの誤判定防止)、deny-with-sibling-side-effect、concurrent/out-of-order delivery、raw-evidence hygiene、pre-existing caller backward compatibilityをdeterministicに検証する。Skillにcanonical live invocationとexit semanticsを記載する。
Out of Scope
- #1573固有のmarker、prompt、settings mutation、validator/test mutation、又はIssue-specific evidence format。#1573のAC7 command自体の更新は#1573側で行う。
.claude/settings.json、.claude/hooks/**、scripts/claude-gpt/**、Task Context、Herdr configurationの変更。既存hookのexit code semantics(例: 常にexit 0を返す既存advisory hookの挙動)を変更すること。- raw stream-json、raw hook stdin/stdout、prompt、transcript、hook command/output body、credential、token、HOME absolute pathの永続化。
- model self-report、prompt text、fake marker、又はsequential test harness(
.claude/hooks/tests/hookchain_harness.py等)の成功をassertion PASSの代替とすること。 - generic runnerにhook policyのsemantic authorization verdictを実装すること。
- user/local/managed/plugin/skill等、project settings外から合成されるhook sourceまで含めた完全なruntime全体のhook母集団を解決する汎用engineを実装すること(初期capabilityはproject settings由来のcommand hookとrunner観測hookの区別に限定する)。
- Claude Codeの並列実行semanticsやhook lifecycle実装そのものを変更・新設すること(新しい監視基盤、SDK全面移行、又は新しいhook identityフィールドをClaude Code本体側に追加すること)。
Acceptance Criteria
- AC1: opt-in capabilityはbounded closed allowlistのevent/inventory inputsだけを受理し、caller-supplied command/path/marker/configによるevidence injectionをusage errorとして拒否する。
- AC2:
all_matching_hooks_observedのexpected cohortを「current project settingsの、選択したhook eventに一致するcommand hook」に限定し、runner自身が追加する観測用hookをこのcohortから明示的に除外して個別に扱う。expected cohortの各要素と実際の実行証拠をhandler identity(event + matcher + command文字列の組、又はruntimeが実際に提供する同等の識別子)単位で照合し、件数一致だけではpassとしない。照合結果はpass | fail | unverifiedの3値ステータスで記録し、boolean fieldはstatus == passの場合にのみtrueとする。project settings外から合成されるhook sourceの存在によって「runtime全体の完全性を証明した」と主張せず、識別不能な場合はunverifiedとする。観測用hook自身の実行成功を、他のsibling command hook全体の実行証拠として昇格させない。 - AC3:
sibling_side_effect_inventory_completeをhookの実行完了(exit code等)とは独立したassertionとして判定する。初期allowlistで検証対象とする各副作用について、対象handler・期待する変化・実際に読むpost-condition・正常な無変更の条件・observation timing(対象sibling hook群の実行完了後に post-condition を読む join point)・bounded location/resourceを実装及びSkill契約で明示する。denyが起きてもsiblingのallowlisted side effect inventoryを実行事実(post-condition読み取り)から照合し、欠落・重複・未知・overflow・未観測の全caseをfailとする。session_manifest_coordinator.shのように内部guard/producer失敗時にもexit 0を返す既存hookがある前提で、hookのexit code正常終了だけを根拠にpassとしない。既存hookのexit code semanticsは変更しない。 - AC4: aggregate hook-chain PASSは、AC2とAC3が共に
status: pass(boolean true)の場合にのみ成立し、いずれかがfail又はunverifiedの場合は成立しない。summary/evidence JSONはexistingtested_headと、AC2/AC3それぞれのcount/status(pass|fail|unverified)/boolean assertion resultを残す。raw evidence、prompt self-report、又はhook lifecycleの複数レコードからPASSに昇格しない。 - AC5: 開発中のtrial実行はAllowed Paths内の未commit candidateに対して許可し、失敗時は診断として修正・再実行できる。最終acceptance evidenceは対象変更をcommitしたHEADに対してのみ成立させ、evidenceに (a)
tested_head(commit SHA)、(b) 検証対象tracked inputsがそのHEADと一致していること、(c) runtime実行前後で対象worktreeに意図しないdriftがないこと、の3点を記録する。before == afterのfingerprint一致だけを「HEADと一致している」の意味として扱わない。current HEADのlinked-worktree native structured runをSkillのcanonical invocationで実行し、次の再現可能なbounded scenarioを使う: (1) positive scenario — 無害な入力で選択したallowlisted hook eventを1回以上実際に発生させ、対応するsibling command hook群の実行証拠とallowlisted side-effect post-conditionをidentity単位で確認する。(2) deny scenario — 無害な入力でPreToolUse guard系hookが実際にdenyを返す状況を発生させ、deny後もsiblingの実行証拠・post-conditionを照合する。空のexpected setと空のobserved setが一致しただけのPASSは禁止する。hook lifecycleの複数レコード(開始・進捗・完了等)や、別の正当なtool callに対する同一handlerの再実行を、根拠のない「重複」と誤認しない(公式ドキュメントはhookの並列実行やstart/completionの分離記録を保証として明記していないため、実装はこれらを既知の保証として前提にせず、実際のruntime evidenceから判定する)。--max-turnsは品質条件ではなく実行上限として扱い、上限到達をcapability failureに分類しない。runtime availableなら両assertion PASSのbounded summaryを、runtime unavailableならSKIP:+ exit 77を返す。SKIP、fallback、missing assertion、unverifiedinventoryはPASSではない。 - AC6: existing testsは少なくとも次を含めてAC1–AC5のindependent PASS/FAIL、deny-with-sibling、concurrent/順序前後のsibling delivery、raw-evidence hygiene、legacy caller compatibilityをcoverする: (a) 件数は同じだがexpected handlerが1つ欠けているケースで AC2 が
passにならないこと、(b) hookの開始・進捗・完了の複数レコードや兄弟hookの完了順逆転を重複実行と誤判定しないこと、(c) hookは全て呼ばれたがproducerの副作用が欠けるケースでAC2とAC3が独立に判定されること、(d) 正常仕様として副作用が発生しないケースを「無変更だから失敗」と決めつけないこと、(e) deny後にsibling side effectが完了するケースで、siblingの完了を待ってから実状態を確認すること、(f) 対象イベントがゼロ回、又はdeny系なのにdenyがゼロ回の空集合ケースでPASSにならないこと、(g) 未commit変更又は前回実行のartifactが存在する状態でcurrent HEADの証拠に取り違えないこと、(h) 新フラグなし・runtime利用不能・証拠破損の各ケースで既存callerが維持され、未検証・実行失敗・検証失敗が区別されること。current existing hooks/configurationは変更されない。
Verification Commands
# AC1
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py
# AC2
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py
# AC3
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py
# AC4
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py
# AC5
# preflight-scope: runtime_only
$ uv run --locked python3 scripts/agent-ops/run_worktree_agent_runtime_smoke.py --runtime claude --mode structured --worktree /absolute/linked-worktree --prompt-file /absolute/nontracked-hook-chain-prompt.md --output-dir artifacts/runtime-smoke/hook-chain-current-head --timeout-seconds 180 --max-turns 4 --require-clean-postcondition --require-hook-chain-evidence
# AC6
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.pyAC5 is the post-implementation canonical live command (preflight-scope: runtime_only; a mechanical baseline preflight must not execute this command before implementation exists). The implementation must document its fixed allowlist selection and the concrete positive/deny scenarios it uses; it must not add a marker, raw-evidence, arbitrary command, path, or config option.
Allowed Paths
scripts/agent-ops/run_worktree_agent_runtime_smoke.pyscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py.claude/skills/worktree-agent-runtime-smoke/SKILL.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- existing hooks/configurationのedit、disable、replace、又はcaller-supplied arbitrary shell/config inputが必要になった場合
- raw transcript/prompt/hook bodyを保存するか、prompt self-report/fake marker/sequential harnessをPASS根拠にする必要が生じた場合
- 意図しない破壊的操作、secret/credentialの利用又は提示、permission/security boundaryのbypassが必要になった場合
- current HEADとevidenceの
tested_headを照合できない場合(tracked inputsの改ざん・想定外drift等、SKIP/unverified以外の異常)
Allowed Paths内の実装不足によるassertion失敗(例: AC2/AC3のいずれかが最初の実行で fail を返す)は、原因を修正して再実行する通常の実装・レビューループとして扱い、上記停止条件には該当しない。意図したnegative test(deny scenario等)のassertion失敗も同様にテストの期待結果であり停止理由にしない。runtime又は必要な観測capabilityが利用不能な場合は SKIP: / unverified として記録し、静的検証やDraft PR作成は継続してよい。ただしその場合、最終AC5 acceptanceはPASSを主張できない。
Required Skills
なし
Required Design References
docs/dev/extension-surface-runtime-policy.yamldocs/dev/runtime-verification-policy.mddocs/dev/agent-skill-boundaries.md.claude/skills/worktree-agent-runtime-smoke/SKILL.mdscripts/agent-ops/run_worktree_agent_runtime_smoke.pyscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py.claude/hooks/tests/hookchain_harness.py.claude/hooks/session_manifest_coordinator.sh- https://code.claude.com/docs/en/hooks
- https://code.claude.com/docs/en/cli-reference
Scope Delta(任意)
- source: OWNER REQUEST_CHANGES anchor review, https://github.com/squne121/loop-protocol/issues/2663#issuecomment-5736277277(確認時点main: af702b0)。current
hook-chain-runtime-smokepolicy and current runner/skill implementation。 - dedupe_key:
worktree-agent-runtime-smoke:generic-hook-chain-evidence:v1 - validated_scope_delta: 実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 requires runtime assertions that current runner cannot persist or prove; this Issue adds only generic runner capability and leaves 実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 settings behavior unchanged. Anchor reviewが指摘した、all_matching_hooks_observedのcohort/identity未定義、hook正常終了と副作用完了の混同、tested_headとdirty trialの混同、実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 handoffの未具体化、AC5 live scenarioのplaceholder化、assertion failureとworkflow stopの一体化、の6点を反映して契約を境界内で精緻化した。
- deterministic_fix: add bounded allowlist-only actual hook-chain evidence with explicit handler-identity cohort mapping, independent execution-completeness/side-effect-completeness assertion semantics with pass/fail/unverified status, dirty-trial vs. committed-HEAD acceptance evidence separation, reproducible positive/deny live scenarios, and existing-runner tests covering the counter-examples identified in review.
- rejected_alternative: prompt self-report/fake markers, raw transcript storage, and
.claude/hooks/tests/hookchain_harness.pyの既存sequential subprocess実行手法をそのまま、genericなlive runtime laneでのconcurrent sibling hook execution/inventoryの証拠として再利用すること。
Source
- dedupe_key:
worktree-agent-runtime-smoke:generic-hook-chain-evidence:v1 - consumer: 実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 (hard predecessor only; this Issue is generic and independently implementable)
- overlap preflight: Scope Collision (C1): related_issue=実装: GPT-5.3-Codex-Spark delegation を Claude-GPT / Claude Code 経路から退役させる #2651, 調査: native Claude Code / Claude-GPT の auto mode 過剰ブロックを実効ポリシー・分類基準を揃えて比較し、最小修正先を確定する #2647, 実装: Herdr cold restartでTask BindingとNative/Claude-GPT runtime flavorを自動復元する #2569, 実装: worktree-agent-runtime-smokeにrun-scoped isolated Task Context検証を追加する #2568, 実装: playtest-log の JSON Schema / validator の追加 #420, 実装: .claude/skills 配下スクリプトの executable bit を監査し CI guard を追加する #205; overlapping_paths=.claude/skills/worktree-agent-runtime-smoke/SKILL.md, scripts/agent-ops/run_worktree_agent_runtime_smoke.py, scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py. 実装: worktree-agent-runtime-smokeにrun-scoped isolated Task Context検証を追加する #2568/実装: Herdr cold restartでTask BindingとNative/Claude-GPT runtime flavorを自動復元する #2569/#2651は本refinement時点でも全てOPENであることを確認済み。Non-conflict intent: this Issue changes only generic hook-chain evidence; serialize merge/rebase with those OPEN issues and retain their contracts.
Delivery Rule
- 1 Issue = 1 PR とし、dedicated linked worktreeで実装する。
- #1573をblockするnative dependencyを作成する。実装: worktree-agent-runtime-smokeにrun-scoped isolated Task Context検証を追加する #2568、実装: Herdr cold restartでTask BindingとNative/Claude-GPT runtime flavorを自動復元する #2569、#2651と同じfilesのconcurrent implementationは行わず、merge orderを明示してcurrent headにrebaseする。
- normal commit/pushのみを使用し、force push、guard bypass、hook disableを行わない。
Activity
squne121 commentedon Sep 18, 2026
結論:REQUEST_CHANGES
2つのassertionを追加する方向性には賛成ですが、現在のIssueは「何を、どの証拠で確認するか」が未確定な一方、確認できない場合の停止条件だけが厳密です。 このまま実装に渡すと、実際には証明できていないのにPASSするか、正常な利用環境でも止まり続けるか、どちらかに寄る危険があります。特に、hookの実行確認と、副作用の確認を別物として実装できる契約に直す必要があります。
確認した基準は、取得時の
mainaf702b06e29e797a6ae180af4f86c730568a8e74です。Issue #2663、consumerの #1573 と停止報告、関連する #2568・#2651、既存の証拠判定を扱ったPR #2220・#2500、runner・Skill・テスト・settings・runtime policy・実際のhook処理を参照しました。以下はコードと契約のレビューであり、この環境でClaude実機のsmokeやpytestを実行した結果ではありません。1. P1:「全hook」の母集団と、設定エントリへの対応付けが未定義
対象:AC2、
all_matching_hooks_observed、In Scopeのcomplete expected set。現在の
.claude/settings.jsonでは、BashのPreToolUseに対して、secret boundary、Japanese prose guard、CI performance advisory、temporary residue advisoryという4つの異なるhandlerが一致します。さらに、runner自身もSubagentStart/SubagentStopに観測用のcathookを追加しています。一方、Claude Codeのhookはproject settingsだけで完結しません。user・local・managed・pluginなどから合成され、同じhandlerの重複排除もあるため、settingsの配列要素数を数えれば実行期待数になる、とは限りません。(Claude)
ここで必要なのは、件数の一致ではなく、期待するhandlerそれぞれと実行証拠との対応です。
例えば、次は私が作った単純な反例です。
hook_event == PreToolUseというイベント種別だけでは、この違いを識別できません。実行ごとのhook_idを使う場合も、そのIDが設定内のどのhandlerに対応するかをどう取得するかが必要です。推奨修正
Issueに「観測対象の範囲」と「対応付けの方法」を追加してください。最初からあらゆる設定元を解釈する汎用エンジンを作る必要はありません。
初期実装は、例えば「current project settingsの、今回選んだイベントに一致する対応済みcommand hook」と「runnerが追加した観測hook」を区別して扱う範囲で十分です。ただし、その場合は「runtime全体の全hookを証明した」とは表示しません。
対象外と確実に識別できる追加hookは対象外として扱い、識別できないため完全性を保証できない場合は、そのassertionを未判定にします。観測用hookが動いた事実を、既存の兄弟hookすべてが動いた証拠へ昇格させないことが重要です。
実装着手前に、対象Claudeバージョンの実イベントでこの対応付けが可能かを、小さな実行で確認するのがよいです。これは新しい承認ゲートではなく、採用する方式が成立するかの確認です。
2. P1:hookの正常終了では、副作用の完了を証明できない
対象:AC3、
sibling_side_effect_inventory_complete。これは抽象的な懸念ではなく、現在のリポジトリに具体的な反例があります。
.claude/hooks/session_manifest_coordinator.shは、内部のguardが失敗した場合にもexit 0で終了します。また、producerの失敗コードを取得しても、最終的にはexit 0を返します。つまり、このhookが呼ばれて正常終了したことと、manifest生成などの内部処理が成功したことは一致しません。公式Python SDKの公開実装でも、hookの開始と完了は別のlifecycle phaseで扱われ、完了イベントにはoutput・exit code・outcomeなどが載ります。しかし、それ自体がファイル書き込みなどの完了を検証する仕組みではありません。
したがって、次の実装ではAC3を満たせません。
既存policyが要求するのは、denyがあっても兄弟hookのファイル書き込み・外部呼び出しなどが、意図した結果になったかというinventoryです。単にhookが終了したかというAC2とは、証明対象が異なります。
推奨修正
AC3のallowlistを「後で実装者が決めるもの」にせず、対象の副作用と確認方法まで列挙してください。最低限、各対象について、期待する変化、確認する実状態、正常な無変更の条件、確認するタイミングが必要です。
例えば、対象となるhook群の完了を待ってから、限定された出力先の実状態を確認する方式です。観測用hook自身も兄弟として並行実行されるため、そのhook内で確認しただけでは、他のhookの処理後を観測したことになりません。(Claude)
ここで既存hookを全部「失敗時は非ゼロ終了」に変える必要はありません。 advisoryとして通常作業を妨げない設計を維持し、検証側で「hookは実行された」「期待した副作用は確認できなかった」を分ける方が、今回の用途に合っています。
Task ContextのDBなどをinventory対象にする場合は、#2568が所有するrun-scoped state rootの隔離との関係も明記すべきです。単に同じファイルを変更するという競合と、副作用を安全・正確に検証するための実際の前提条件は、区別してください。
3. P1:
tested_headと「実際にそのHEADのコードを検証したこと」が混同されやすい対象:AC4・AC5、current HEADへの証拠の紐付け。
現在のrunnerの
repo_fingerprint()とdiff_fingerprints()は、変更済みファイルの状態・内容も含めて前後比較します。これは「smoke実行中にworktreeを変えなかったか」を確認する仕組みとして有用ですが、前後で同じだったことと、開始時点でHEADと一致していたことは別です。例えば、次の状態では、前後比較だけなら変更なしになります。
この結果を「commit Aを検証した証拠」として扱うのは誤りです。#1573の停止報告でも、未commit candidateでの実行がcurrent-head evidenceにならないことが問題になっています。
推奨修正
用途を二段階に分けてください。
開発中の試行は未commit状態でも実行可能にし、候補変更の確認として扱います。そこで不具合が分かったら、Allowed Paths内で修正を続けられるようにします。
最終的な受入証拠は、対象変更をcommitした後に取得し、検証対象のtracked inputsがそのHEADと一致していること、および実行前後で変化していないことを確認します。
新しい署名・証明台帳・多段のdigest制度は不要です。既存のHEAD・fingerprintを正しく使い、「候補変更の試行」と「受入証拠」を混ぜない契約にするだけで十分です。
4. P1:opt-in capabilityを追加しても、#1573の現在のコマンドは有効化しない
対象:Remaining Parent Gaps、Delivery Rule、consumerへの引き渡し。
#2663は
--require-hook-chain-evidenceによるopt-inを追加する契約です。しかし、今回取得した #1573 のAC7コマンドには、このフラグがありません。さらに、停止報告で存在しないとされた固定worktree pathが、そのまま記載されています。したがって、#2663をmergeするだけでは、#1573の現在の検証手順は修復されません。
これは#2663のPRに#1573固有の実装を混ぜるべき、という意味ではありません。既存のPR #2500も、generic runnerの能力追加と、そのconsumerである #2194 のVerification Command更新を別の責務として扱っています。今回も、この分離自体は妥当です。
ただし、引き渡し条件を具体化してください。
また、#1573のimmediate判断は、hookの実変更があるからではなく、Allowed Pathsベースの保守的な検出を受けたOWNER choiceとして明記されています。個人開発の効率を優先するなら、permissionsのanchor変更にgeneric hook-chain機能の完成を必須依存させ続けるべきかは、改めて見直す価値があります。 その見直しは既存契約を無視するのではなく、#1573のOWNER判断とAC7を明示的に更新して行うべきです。
5. P2:canonical live invocationに、再現可能な検証シナリオがない
対象:AC5、fixed allowlist selection、Verification Commands。
現在のAC5は、次のようなplaceholderを含むコマンドです。
しかし、本文では「何をさせて、どのイベントを何回発生させ、どのdenyと副作用を観測するか」が定義されていません。固定allowlistも、実装側で文書化するという指定に留まっています。
この状態では、CLIが利用可能でも、モデルが必要なtool callを行わない、denyが一度も起きない、選択したイベントが発生しない、といった理由で受入条件を満たせません。例えば公式仕様上、
StopFailureはAPIエラーでturnが終了した場合のイベントであり、通常成功するシナリオで当然に発生するものではありません。(Claude)さらに、「duplicateはすべてFAIL」も、その単位が必要です。公式SDKの実装では同じhookの開始と完了は異なるphaseです。開始・進捗・完了の複数レコードや、別tool callに対する正当な再実行を、重複実行と取り違えてはいけません。
推奨修正
初期版では、小さな、明示された正常系とdeny系に絞るのがよいです。実credentialや破壊的操作を使わず、検証対象のhookが扱う無害な入力で、必要なイベントを発生させます。
成功条件には、少なくとも「対象イベントが実際に1回以上発生した」「deny系ではdenyが実際に観測された」「その発生回に対応する兄弟hookと副作用を確認した」を含めます。空のexpected setと空のobserved setが一致しただけのPASSは認めません。
--max-turns 4は品質条件ではなく実行上限です。上限到達をcapability不足に分類したり、必要なシナリオを満たせることを未確認のまま4に固定したりしない方がよいです。CLIの公式説明でも、max-turns到達はエラー終了です。(Claude)また、AC5は実装後専用という説明と、機械的なpreflightの扱いを揃えるべきです。#1573にある
preflight-scope: runtime_onlyの既存方式を確認し、まだ存在しない新フラグをbaselineで実行して停止する構成を避けてください。6. P2:「証拠をPASSにしない」と「開発作業を止める」が一体化している
対象:Stop Conditions、runtime unavailable、missing assertion、inventory incomplete。
#2663は、live runがSKIP・missing assertion・incomplete inventoryなどを返した場合に停止する契約です。このままでは、新機能を初めて実機で動かして、自分の実装の不足を見つけた時点で、その修正にも人間判断が必要という運用になりかねません。#1573では、実際に証拠不足を理由としてcommit・push・PR作成前に停止した報告があります。
ここは分離した方がよいです。
PR #2220はmarkerだけの証拠から実際の因果関係の確認へ進めた先例です。一方、PR #2500のOWNERレビューでは、入力echoや最終応答の再掲を証拠として数える誤判定が指摘されています。今回も、証拠フィールドを追加することより、その値がどの実行事実から導かれるかを先に固定することが重要です。
推奨アクションは、実装開始前に #2663 の契約を精緻化し、「対象hook集合」「副作用の実観測方法」「再現可能なシナリオ」「最終HEADへの紐付け」「#1573のコマンド更新」「失敗時も修正を続けられる条件」を確定することです。厳しい停止条件を追加するのではなく、証明できる範囲を明確にして、通常の作業を止めずに正しい証拠を出せる設計に直すのがよいです。
## 結論:REQUEST_CHANGES2つのassertionを追加する方向性には賛成ですが、現在のIssueは「何を、どの証拠で確認するか」が未確定な一方、確認できない場合の停止条件だけが厳密です。 このまま実装に渡すと、実際には証明できていないのにPASSするか、正常な利用環境でも止まり続けるか、どちらかに寄る危険があります。特に、hookの実行確認と、副作用の確認を別物として実装できる契約に直す必要があります。
確認した基準は、取得時の
mainaf702b06e29e797a6ae180af4f86c730568a8e74です。Issue #2663、consumerの #1573 と停止報告、関連する #2568・#2651、既存の証拠判定を扱ったPR #2220・#2500、runner・Skill・テスト・settings・runtime policy・実際のhook処理を参照しました。以下はコードと契約のレビューであり、この環境でClaude実機のsmokeやpytestを実行した結果ではありません。1. P1:「全hook」の母集団と、設定エントリへの対応付けが未定義
対象:AC2、
all_matching_hooks_observed、In Scopeのcomplete expected set。現在の
.claude/settings.jsonでは、BashのPreToolUseに対して、secret boundary、Japanese prose guard、CI performance advisory、temporary residue advisoryという4つの異なるhandlerが一致します。さらに、runner自身もSubagentStart/SubagentStopに観測用のcathookを追加しています。一方、Claude Codeのhookはproject settingsだけで完結しません。user・local・managed・pluginなどから合成され、同じhandlerの重複排除もあるため、settingsの配列要素数を数えれば実行期待数になる、とは限りません。([Claude]1)
ここで必要なのは、件数の一致ではなく、期待するhandlerそれぞれと実行証拠との対応です。
例えば、次は私が作った単純な反例です。
hook_event == PreToolUseというイベント種別だけでは、この違いを識別できません。実行ごとのhook_idを使う場合も、そのIDが設定内のどのhandlerに対応するかをどう取得するかが必要です。推奨修正
Issueに「観測対象の範囲」と「対応付けの方法」を追加してください。最初からあらゆる設定元を解釈する汎用エンジンを作る必要はありません。
初期実装は、例えば「current project settingsの、今回選んだイベントに一致する対応済みcommand hook」と「runnerが追加した観測hook」を区別して扱う範囲で十分です。ただし、その場合は「runtime全体の全hookを証明した」とは表示しません。
対象外と確実に識別できる追加hookは対象外として扱い、識別できないため完全性を保証できない場合は、そのassertionを未判定にします。観測用hookが動いた事実を、既存の兄弟hookすべてが動いた証拠へ昇格させないことが重要です。
実装着手前に、対象Claudeバージョンの実イベントでこの対応付けが可能かを、小さな実行で確認するのがよいです。これは新しい承認ゲートではなく、採用する方式が成立するかの確認です。
2. P1:hookの正常終了では、副作用の完了を証明できない
対象:AC3、
sibling_side_effect_inventory_complete。これは抽象的な懸念ではなく、現在のリポジトリに具体的な反例があります。
.claude/hooks/session_manifest_coordinator.shは、内部のguardが失敗した場合にもexit 0で終了します。また、producerの失敗コードを取得しても、最終的にはexit 0を返します。つまり、このhookが呼ばれて正常終了したことと、manifest生成などの内部処理が成功したことは一致しません。公式Python SDKの公開実装でも、hookの開始と完了は別のlifecycle phaseで扱われ、完了イベントにはoutput・exit code・outcomeなどが載ります。しかし、それ自体がファイル書き込みなどの完了を検証する仕組みではありません。
したがって、次の実装ではAC3を満たせません。
既存policyが要求するのは、denyがあっても兄弟hookのファイル書き込み・外部呼び出しなどが、意図した結果になったかというinventoryです。単にhookが終了したかというAC2とは、証明対象が異なります。
推奨修正
AC3のallowlistを「後で実装者が決めるもの」にせず、対象の副作用と確認方法まで列挙してください。最低限、各対象について、期待する変化、確認する実状態、正常な無変更の条件、確認するタイミングが必要です。
例えば、対象となるhook群の完了を待ってから、限定された出力先の実状態を確認する方式です。観測用hook自身も兄弟として並行実行されるため、そのhook内で確認しただけでは、他のhookの処理後を観測したことになりません。([Claude]1)
ここで既存hookを全部「失敗時は非ゼロ終了」に変える必要はありません。 advisoryとして通常作業を妨げない設計を維持し、検証側で「hookは実行された」「期待した副作用は確認できなかった」を分ける方が、今回の用途に合っています。
Task ContextのDBなどをinventory対象にする場合は、#2568が所有するrun-scoped state rootの隔離との関係も明記すべきです。単に同じファイルを変更するという競合と、副作用を安全・正確に検証するための実際の前提条件は、区別してください。
3. P1:
tested_headと「実際にそのHEADのコードを検証したこと」が混同されやすい対象:AC4・AC5、current HEADへの証拠の紐付け。
現在のrunnerの
repo_fingerprint()とdiff_fingerprints()は、変更済みファイルの状態・内容も含めて前後比較します。これは「smoke実行中にworktreeを変えなかったか」を確認する仕組みとして有用ですが、前後で同じだったことと、開始時点でHEADと一致していたことは別です。例えば、次の状態では、前後比較だけなら変更なしになります。
この結果を「commit Aを検証した証拠」として扱うのは誤りです。#1573の停止報告でも、未commit candidateでの実行がcurrent-head evidenceにならないことが問題になっています。
推奨修正
用途を二段階に分けてください。
開発中の試行は未commit状態でも実行可能にし、候補変更の確認として扱います。そこで不具合が分かったら、Allowed Paths内で修正を続けられるようにします。
最終的な受入証拠は、対象変更をcommitした後に取得し、検証対象のtracked inputsがそのHEADと一致していること、および実行前後で変化していないことを確認します。
新しい署名・証明台帳・多段のdigest制度は不要です。既存のHEAD・fingerprintを正しく使い、「候補変更の試行」と「受入証拠」を混ぜない契約にするだけで十分です。
4. P1:opt-in capabilityを追加しても、#1573の現在のコマンドは有効化しない
対象:Remaining Parent Gaps、Delivery Rule、consumerへの引き渡し。
#2663は
--require-hook-chain-evidenceによるopt-inを追加する契約です。しかし、今回取得した #1573 のAC7コマンドには、このフラグがありません。さらに、停止報告で存在しないとされた固定worktree pathが、そのまま記載されています。したがって、#2663をmergeするだけでは、#1573の現在の検証手順は修復されません。
これは#2663のPRに#1573固有の実装を混ぜるべき、という意味ではありません。既存のPR #2500も、generic runnerの能力追加と、そのconsumerである #2194 のVerification Command更新を別の責務として扱っています。今回も、この分離自体は妥当です。
ただし、引き渡し条件を具体化してください。
また、#1573のimmediate判断は、hookの実変更があるからではなく、Allowed Pathsベースの保守的な検出を受けたOWNER choiceとして明記されています。個人開発の効率を優先するなら、permissionsのanchor変更にgeneric hook-chain機能の完成を必須依存させ続けるべきかは、改めて見直す価値があります。 その見直しは既存契約を無視するのではなく、#1573のOWNER判断とAC7を明示的に更新して行うべきです。
5. P2:canonical live invocationに、再現可能な検証シナリオがない
対象:AC5、fixed allowlist selection、Verification Commands。
現在のAC5は、次のようなplaceholderを含むコマンドです。
しかし、本文では「何をさせて、どのイベントを何回発生させ、どのdenyと副作用を観測するか」が定義されていません。固定allowlistも、実装側で文書化するという指定に留まっています。
この状態では、CLIが利用可能でも、モデルが必要なtool callを行わない、denyが一度も起きない、選択したイベントが発生しない、といった理由で受入条件を満たせません。例えば公式仕様上、
StopFailureはAPIエラーでturnが終了した場合のイベントであり、通常成功するシナリオで当然に発生するものではありません。([Claude]1)さらに、「duplicateはすべてFAIL」も、その単位が必要です。公式SDKの実装では同じhookの開始と完了は異なるphaseです。開始・進捗・完了の複数レコードや、別tool callに対する正当な再実行を、重複実行と取り違えてはいけません。
推奨修正
初期版では、小さな、明示された正常系とdeny系に絞るのがよいです。実credentialや破壊的操作を使わず、検証対象のhookが扱う無害な入力で、必要なイベントを発生させます。
成功条件には、少なくとも「対象イベントが実際に1回以上発生した」「deny系ではdenyが実際に観測された」「その発生回に対応する兄弟hookと副作用を確認した」を含めます。空のexpected setと空のobserved setが一致しただけのPASSは認めません。
--max-turns 4は品質条件ではなく実行上限です。上限到達をcapability不足に分類したり、必要なシナリオを満たせることを未確認のまま4に固定したりしない方がよいです。CLIの公式説明でも、max-turns到達はエラー終了です。([Claude]2)また、AC5は実装後専用という説明と、機械的なpreflightの扱いを揃えるべきです。#1573にある
preflight-scope: runtime_onlyの既存方式を確認し、まだ存在しない新フラグをbaselineで実行して停止する構成を避けてください。6. P2:「証拠をPASSにしない」と「開発作業を止める」が一体化している
対象:Stop Conditions、runtime unavailable、missing assertion、inventory incomplete。
#2663は、live runがSKIP・missing assertion・incomplete inventoryなどを返した場合に停止する契約です。このままでは、新機能を初めて実機で動かして、自分の実装の不足を見つけた時点で、その修正にも人間判断が必要という運用になりかねません。#1573では、実際に証拠不足を理由としてcommit・push・PR作成前に停止した報告があります。
ここは分離した方がよいです。
fail-closedにすべきなのは、証拠に基づくPASS判定です。すべての失敗を人間への停止要請にする必要はありません。
同じ考え方は出力制限にも当てはまります。「rawを保存しない」は、まずこの新機能が生成・公開する証拠の境界として定義すべきです。既存の
session_manifest_coordinator.shは、一時ディレクトリにhook stdinや各処理のstdout/stderrを書き、終了時に削除します。既存hookを変更しない契約のまま、プロセス全体で一切rawがディスクに載らないという保証まで拡張すると、別の矛盾になります。summaryにはraw本文を残さなくても、固定のreason code、イベント名、安全なhandler識別子、expected/observedの件数があれば、原因をかなり絞れます。booleanだけを増やして、失敗のたびに再調査が必要になる形は避けたいです。
推奨する実装の着地点
**「任意のhook環境について全副作用を証明する機能」ではなく、「明示した対象について、実行の完全性と副作用の完全性を別々に検証する、小さなopt-in機能」**が適切です。
新しい監視基盤や承認レイヤーは不要です。既存runnerのnative structured経路、イベント解析、fingerprint、summary出力を拡張し、対象を増やす必要が生じた時点でallowlistを広げればよいです。既存のnative経路はすでに
--include-hook-eventsとinvocation-local overlayを使用しており、新たにSDKへ全面移行する理由はありません。また、#2651のrunner変更はSpark関連helperの撤去という別の目的です。共有ファイルを触ることによるmerge調整は必要でも、同じファイルを触る全Issueの完成待ちを、無条件の機能依存にしない方がよいです。Task Contextの実状態を観測する場合の #2568 のように、実際の前提となるものだけを依存として扱ってください。
最低限、追加したい回帰テスト
既存テストには、fake executableと一時的なlinked worktreeを作る基盤があります。これを拡張することで、別のharnessを新設せずに主要な反例を検証できます。
PR #2220はmarkerだけの証拠から実際の因果関係の確認へ進めた先例です。一方、PR #2500のOWNERレビューでは、入力echoや最終応答の再掲を証拠として数える誤判定が指摘されています。今回も、証拠フィールドを追加することより、その値がどの実行事実から導かれるかを先に固定することが重要です。
推奨アクションは、実装開始前に #2663 の契約を精緻化し、「対象hook集合」「副作用の実観測方法」「再現可能なシナリオ」「最終HEADへの紐付け」「#1573のコマンド更新」「失敗時も修正を続けられる条件」を確定することです。厳しい停止条件を追加するのではなく、証明できる範囲を明確にして、通常の作業を止めずに正しい証拠を出せる設計に直すのがよいです。
squne121 commentedon Sep 18, 2026
確認した限り、推奨アクションは #2663 の実装へ進むことではなく、指定の OWNER
REQUEST_CHANGESを direct human context としてissue-refinement-loopに投入し、Issue 契約を再精緻化することです。確認時点の
mainはaf702b06e29e797a6ae180af4f86c730568a8e74で、レビューコメントが基準にした SHA と一致しています。また #2568 / #2569 / #2651 は現在も open なので、#2663 の collision/merge-order 記述は消さず、再確認させるのが適切です。レビューの技術的な前提も妥当です。現行 Claude Code 公式仕様では、hook は user/project/local/managed/plugin 等から合成され、同一 handler の重複は一度だけ実行される一方、plugin/skill 側の同一 handler は別扱いです。また、matching hook はすべて並列実行されます。したがって単純な「settings entry 数 = 実行数」では完全性を証明できません。([Claude]1)
--max-turnsも「品質条件」ではなく、到達するとエラー終了する実行上限です。([Claude]2)今回の refinement では、次の6点を Issue に固定させるのが中心です。
all_matching_hooks_observedの対象を runtime 全体ではなく、識別可能な bounded verification cohort として定義し、件数ではなく handler identity 単位で expected/observed を照合する。sibling_side_effect_inventory_completeを hook 実行完了とは分離し、対象副作用・期待状態・正常な無変更・post-condition の観測時点を明示する。issue-refinement-loop自身はloop_iteration_approval_gate.default_required: falseで、通常のneeds-fixは反復上限まで自動継続する契約です。今回の OWNER コメントはpreflight.run.with_human_context→contract_update.run.with_human_contextの正規 lane に乗せるのが重要です。以下を、すでに auto mode で起動済みの対話的 ClaudeCode にそのまま渡す想定です。
Issue #2663 を、指定の OWNER review comment を anchor として
issue-refinement-loopで再精緻化してください。対象 Issue:
#2663
今回の authoritative review / anchor comment:
#2663 (comment)
使用する skill:
https://github.com/squne121/loop-protocol/tree/main/.claude/skills/issue-refinement-loop
目的
上記 OWNER
REQUEST_CHANGESを direct human context として扱い、Issue #2663 の契約を実装着手可能な状態まで精緻化する。今回のタスクは
issue-refinement-loopによる Issue 契約の修正・レビュー完了までを対象とする。コード実装そのものは行わない。既に ClaudeCode は auto mode で起動済みである。repository の refinement loop iteration ごとの人間承認は要求せず、skill の canonical loop policy に従って自動継続すること。
ただし Claude Code 自体の permission model を変更する指示ではない。
--dangerously-skip-permissions、hook disable、guard bypass、force push 等を追加してはならない。anchor の扱い
この anchor comment は今回 operator が明示的に指定した direct human context であり、OWNER の
REQUEST_CHANGESとして処理する。canonical main root / default branch の root control-plane から、必ず human-context lane を使用すること。
すなわち、URL だけを渡す unlabeled
preflight.run.with_anchorやwith_agent_reportとして扱わず、skill の現行契約に従って:preflight.run.with_human_contextcontract_update.run.with_human_contextNEXT_ACTION: issue_editor_requiredなら既存issue-editorcontrolled rewrite laneを使用すること。
同じ anchor URL を reviewer feedback provenance として保持し、raw snapshot 本文を ad-hoc に別 lane へコピーしないこと。
最初に確認するもの
作業開始時点で current
main、Issue 本文、anchor comment、関連 Issue / PR / repository assets を fresh に読み直すこと。最低限、以下を調査対象に含めること。
.claude/settings.json.claude/hooks/**の今回の assertion / side-effect に関係する実 hookscripts/agent-ops/run_worktree_agent_runtime_smoke.pyscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py.claude/skills/worktree-agent-runtime-smoke/SKILL.mddocs/dev/extension-surface-runtime-policy.yamldocs/dev/runtime-verification-policy.mddocs/dev/agent-skill-boundaries.md.claude/skills/issue-refinement-loop/SKILL.mdと、その planner / anchor / semantic-review / termination の normative references現在の branch / Issue / comments が anchor review 時点から drift している場合は、古い前提をそのまま適用せず fresh evidence を優先すること。
SubAgent 必須方針
この作業では canonical skill が許可する SubAgent lane を実際に使用すること。
planner の
investigation_policyが required の場合、codebase-investigatorを起動し、少なくとも以下を調べさせること。session_manifest_coordinator.shのように exit 0 と side-effect 成功が一致しない既存例tested_head/ repo fingerprint / dirty worktree semanticsplanner の
web_research_policyが required の場合、web-researcherを sibling SubAgent として起動し、Claude Code の現行公式一次資料を調べさせること。特に Hooks reference / CLI reference について:--max-turnsの意味を確認すること。
Step 1 / Step 1b の両方が required なら sibling SubAgent として並列起動してよい。
重要: SubAgent を起動しただけで次へ進まないこと。全 SubAgent の完了を必ず待ち、結果を join してから Step 2 へ進むこと。
Step 2.5 semantic design review が applicable の場合も
issue-design-reviewerを canonical contract に従って起動し、必ず completion join barrier を満たしてから結果を consume すること。SubAgent に Issue mutation をさせないこと。mutation authority は root/main control-plane に保持する。
nested SubAgent delegation を SubAgent 自身に行わせないこと。
今回の refinement で必ず解消する OWNER findings
anchor comment の6項目を単なる prose コメントではなく、Issue の Goal / In Scope / AC / Verification / Stop Conditions / Delivery Rule 等へ反映すること。
1.
all_matching_hooks_observedの母集団と identity「runtime 全体の全 hook」を証明する契約にしない。
初期 capability が実際に証明できる bounded verification cohort を明示すること。
repository と Claude Code runtime の fresh investigation に基づき、例えば current project settings 内の対応可能な command hooks、runner-owned observation hooks 等、実際に expected member と runtime evidence を identity 単位で対応付け可能な範囲を定義する。
単なる:
expected_count == observed_countを PASS 根拠にしてはならない。
A,B,C,D expected に対して A,A,C,D observed のようなケースを必ず FAIL / unverified とできる契約にする。
Claude Code が複数 settings source の同一 handler を deduplicate する場合や、plugin/skill 等が別 handler として追加される場合も考慮する。
対象外 hook を確実に識別できるなら cohort 外としてよいが、complete set を識別できないなら runtime 全体の完全性を主張しないこと。
観測用 hook が実行された事実を「既存 sibling hook が全部動いた」という証明へ昇格させないこと。
既存 boolean field を維持する場合でも、
pass / fail / unverified等の status semantics を別途明確化し、unverified を boolean true に変換しないこと。2. hook execution と side-effect completion の分離
all_matching_hooks_observedとsibling_side_effect_inventory_completeは別の証明対象として設計すること。hook finished && exit_code == 0を side-effect completion の証拠として扱わない。repository の実 hook を調べ、初期 allowlist で検証対象とする side effect ごとに最低限:
を Issue 契約で特定すること。
実 hook の完了を待った後に post-condition を読む必要がある場合、その join point を契約化すること。
並列 sibling の一つである observation hook 自身が早く終了しただけの時点で他 sibling の side effect 完了を主張しないこと。
既存 advisory hooks を non-zero exit 化する等、今回不要な production behavior change を要求しないこと。検証側で「execution observed」と「side effect verified」を分離する。
3. dirty trial と current-HEAD acceptance evidence の分離
開発中は Allowed Paths 内の未commit candidate に対する trial runtime を許可してよい。
その trial が失敗した場合は実装不足の diagnostic として修正→再実行できる契約にする。
ただし最終 AC acceptance evidence は対象変更を commit した HEAD に対してのみ成立させる。
最終 evidence では少なくとも:
tested_headことを確認する。
before == afterだけを「HEAD と一致している」の意味にしてはならない。新しい大掛かりな署名台帳等は導入せず、既存 HEAD / fingerprint primitives を利用する方向を優先する。
4. #1573 consumer handoff
#2663 の merge 自体を #1573 AC7 の達成として扱わないこと。
#2663 の generic capability と #1573 consumer contract は分離したままにする。
ただし Delivery Rule / Remaining Parent Gaps 等で、#2663 merge 後に #1573 側で何を更新するかを明確にする。
最低限:
ことを handoff contract として記載する。
#1573 固有コードを #2663 の Allowed Paths に混ぜないこと。
5. reproducible live scenarios
AC5 の live verification を単なる placeholder prompt にしない。
初期版で実行可能な bounded scenario を明示する。
少なくとも harmless な:
を定義し、必要な対象 event が実際に発火する入力を使う。
PASS 条件に:
を含める。
expected=0 / observed=0 の空集合一致を PASS にしない。
hook lifecycle の start/progress/completion 等を duplicate handler execution と誤認しないよう invocation identity / phase semantics を定義する。
複数 tool call に対する正当な同一 handler 再実行も duplicate failure と混同しない。
--max-turnsは quality assertion ではなく execution bound として扱い、上限到達を capability failure と誤分類しない。baseline でまだ存在しない post-implementation CLI flag を機械的 preflight が実行して停止する設計にしない。
6. evidence failure と workflow stop の分離
現在の Stop Conditions を修正し、以下を区別する。
Allowed Paths 内の candidate implementation 不足による assertion fail:
→ 原因を直して trial を再実行。通常の implementation/review loop 継続可能。
意図した negative test の assertion fail:
→ expected test result。human stop にしない。
runtime / observation capability unavailable:
→
SKIP/ unverified として記録。static test・コード修正・必要なら Draft/通常の作業は継続可能。ただし final runtime AC は未達のまま。最終 acceptance で assertion が未検証:
→ AC PASS を主張しない。
scope 外の破壊的変更、secret/credential の利用、permission-boundary bypass、既存 hook/config の不当な disable/replace、解決不能な semantic ambiguity:
→ canonical human/operator stop。
「正しい evidence が得られなかった」と「開発作業全体を停止する」を同一条件にしない。
collision / dependency
#2568 / #2569 / #2651 その他 overlapping work が現在も open か fresh に確認すること。
実際に同一ファイルを変更する implementation が競合する場合は #2663 の Delivery Rule に merge/rebase serialization を残す。
ただし単なるファイル重複と、#2663 の assertion semantics が本当に依存する prerequisite は区別する。
不要な hard dependency を追加しない。
新しい Issue が本当に必要と canonical planner が判断した場合のみ、skill の materialization policy に従う。安易な scope split は行わない。
refinement loop の実行
.claude/skills/issue-refinement-loop/SKILL.mdと normative references を SSOT とし、独自の簡易フローに置き換えないこと。通常の
needs-fix/request_changesは human approval を要求せず bounded loop を継続する。Step 2 の
root_review_pipeline.produceは現行契約どおり background launch し、完了 task notification / JSON を必ず join してからcanonical_step2_routeを consumeすること。canonical routing authority を prose で再判定しない。
Step 2.5 semantic review が applicable なら実行し、SubAgent 完了を待つ。
Step 4 rewrite が必要なら
issue-editorを使用し、fresh readback → fresh Step 2 review を行う。OWNER findings が残っているのに iteration を終了しないこと。
loop 内の通常修正について「続けてよいですか」「Issueを書き換えてよいですか」等の確認をユーザーへ求めないこと。
人間停止について
今回の「人間承認不要」は canonical safety / integrity hard stop を無視する意味ではない。
以下は勝手に bypass しない。
human_judgment_requiredとして扱う、技術 evidence だけでは一意に決定不能な選択それ以外の routine needs-fix、contract rewrite、deterministic repair、read-only investigation、fresh review、retry は人間承認なしで最後まで進める。
hard stop に到達した場合も、まず skill が許す deterministic recovery / bounded retry / read-only investigation を使い切ること。
単に「assertion が FAIL した」「runtime が SKIP した」「max-turns に達した」「reviewer が needs-fix を返した」というだけで user escalation しない。
完了条件
Issue #2663 の本文が anchor comment の全 finding を反映し、fresh review で実装契約として approve / impl-ready 相当まで到達すること。
特に最終 Issue 本文について:
ことを確認する。
最終 fresh review が approve するまで、許可された bounded iteration 内で自動修正を続けること。
本依頼の境界は Issue refinement まで。
impl-review-loopによるコード実装は開始せず、implementation handoff が可能になった時点で refinement の最終結果を報告して終了する。最終報告
完了時は簡潔に以下を報告すること。
この形なら、「人間承認不要」を permission bypass ではなく、
needs-fix → rewrite → fresh reviewを自動で完走させる意味に限定できます。今回のコメントは単なる agent report ではなく指定された OWNER human context なので、特にwith_human_contextを明示するのが重要です。squne121 commentedon Sep 18, 2026
issue-refinement-loop 終了報告(approved)
OWNER の REQUEST_CHANGES anchor review(https://github.com/squne121/loop-protocol/issues/2663#issuecomment-5736277277、確認時点 main:
af702b06e29e797a6ae180af4f86c730568a8e74)を direct human context としてpreflight.run.with_human_contextlane に投入し、issue-refinement-loopで本 Issue を再精緻化した。anchor の6 findingsの契約反映
all_matching_hooks_observedの母集団/identity: expected cohort を「current project settingsの、選択したhook eventに一致するcommand hook」に限定し、runner観測hookを除外。handler identity(event+matcher+command文字列の組)単位の照合と、pass|fail|unverifiedの3値ステータスを導入し、件数一致だけではPASSにならない契約にした(AC2)。sibling_side_effect_inventory_completeをhook実行完了とは独立なassertionとし、対象handler・期待変化・実post-condition・無変更条件・observation timing(join point)・bounded locationの明示を要求。session_manifest_coordinator.shの具体的counter-example(内部guard/producer失敗時もexit 0)を明記した(AC3)。--require-hook-chain-evidence実使用・実在canonical worktree・commit済みHEAD再実行の4点を実行可能なchecklistとしてRemaining Parent Gapsに記載した。--max-turnsを実行上限として扱う旨を明記した。また、deterministic checkerが検出した2件のblocking issue(
C11_decision_tag_consistency: fail= AC5への<!-- runtime-verification: true -->タグ欠落、AC5 VCのcommand_not_allowed=uv run python3がpreflight allowlist外)を、それぞれタグ追加と# preflight-scope: runtime_onlyマーカー追加で解消した。Iteration 概要
preflight.run.with_human_context(Step 0f)→codebase-investigator+web-researcher並列実行 → Step 2 review(needs-fix,canonical_step2_route: step_4)→issue-editorによる本文更新(anchor 6 findings + 2 deterministic blocker 解消)approve)→ Step 2.5 semantic design review(issue-design-reviewer)→ medium severity 1件(Stop Conditions内の自己矛盾)検出 →join_review_resultsはeffective_verdict: approve(medium はブロックしない)だが、品質改善としてissue-editorで追加修正approve)→ Step 2.5 再検証(assessment: clear)→join_review_results:effective_verdict: approve(warnings なし)run_contract_review_once.py --mode static→CONTRACT_REVIEW_RESULT_V1.status: go(fresh, 現在のIssue body sha256と一致)使用した SubAgent(全て完了 join 済み)
codebase-investigator(read-onlyでの hook/settings/session_manifest_coordinator.sh/実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573/実装: worktree-agent-runtime-smokeにrun-scoped isolated Task Context検証を追加する #2568/実装: Herdr cold restartでTask BindingとNative/Claude-GPT runtime flavorを自動復元する #2569/実装: GPT-5.3-Codex-Spark delegation を Claude-GPT / Claude Code 経路から退役させる #2651/PR feat: worktree-agent-runtime-smoke に hook ID ベースの SubAgent causal evidence 判定を追加する #2220/feat: run_worktree_agent_runtime_smoke.py に skill-invocation-runtime-smoke profile を実装 (#2498) #2500 の実地調査)web-researcher(Claude Code Hooks/CLI公式ドキュメントのfact-check。並列実行の保証・lifecycle分離記録は公式に未明記であることを確認、--max-turnsが実行上限であることは確認済み)issue-editor(本文更新、3回。うち1回目は絶対パス/必須フィールド欠落でfailed_no_mutationとなり修正の上再実行)issue-design-reviewer(semantic design review、2回。1回目medium finding 1件、2回目assessment: clear)native dependency
#2663は既存の GitHub nativeblocking: [#1573]を維持(本サイクルで新規変更なし。dependency materialization gate は該当なし)。#1573 への handoff 条件
本 Issue merge後、#1573 側で以下を満たすまで #1573 AC7 は未達扱いとする(Issue本文の Remaining Parent Gaps に明記済み):
--require-hook-chain-evidenceを実際に使用するinvocationへAC7コマンドを更新する未解決 blocker
なし。
implementation について
本依頼のスコープは Issue refinement までであり、
impl-review-loopによるコード実装は開始していない。以下は Final Gate 確認結果の記録であり、canonical routing action(run_impl_review_loop)はこの turn では実行しない。注記: 本依頼(issue-refinement-loop 単体実行)の境界により、
routing_action: run_impl_review_loopは telemetry として記録するのみで、この turn 内では実行しない。impl-review-loopの起動は別途の明示的な依頼を待つ。squne121 commentedon Sep 18, 2026
確認した現状では、#2663 は open / 実装未着手 / 関連PRなしで、最新の
issue-refinement-loop終了報告はapproved、LOOP_HANDOFF_RESULT_V1.status: impl_ready/routing_action: run_impl_review_loop/ blockerなしです。競合候補では #2651 は closed、#2568/#2569 は open ですが、GitHub 上では関連する open PR や issue番号付き branch は確認できませんでした。したがって推奨は、#2663 を dedicated linked worktree で今から
impl-review-loopに投入です。ただし開始直前にローカル worktree/branch まで確認し、#2568/#2569 が同じ3ファイルで実作業中なら並行編集せず直列化します。通常の実装失敗・テスト失敗・レビューREQUEST_CHANGESは人間確認なしで修正ループを続け、最終的に PRが current HEAD でレビュー承認され、マージ可能な「マージ直前」状態になったところで停止させるのが現行 skill と一致します。そのまま ClaudeCode に貼れる形です。
Issue #2663 を対象に、repository canonical skill
.claude/skills/impl-review-loopを使って、実装・検証・PRレビュー・修正ループを実行してください。対象 Issue:
#2663
使用する skill:
https://github.com/squne121/loop-protocol/tree/main/.claude/skills/impl-review-loop
既にこの ClaudeCode セッションは auto mode で対話的に起動済みです。
permission mode の変更や ClaudeCode の再起動は不要です。
最終目標
Issue #2663 の current live contract を満たす実装を完成させ、1 Issue = 1 PR としてPRを作成し、
impl-review-loopの canonical implementation → verification → PR review → fix loop を、人間の逐次承認なしで実行してください。最終到達点は「マージ直前」です。
具体的には、current PR headについて:
状態まで進めてください。
PRそのものはマージしないでください。
merge, auto-merge enable 等は行わず、マージ直前で終了してください。authoritative state
開始時に必ず fresh な GitHub / repository state を読み直してください。
少なくとも確認するもの:
Issue 実装: worktree-agent-runtime-smoke に generic hook-chain evidence capability を追加する #2663 本文
Issue 実装: worktree-agent-runtime-smoke に generic hook-chain evidence capability を追加する #2663 の全コメント
最新
issue-refinement-loopapproved 終了報告current
main.claude/skills/impl-review-loop/SKILL.mdimpl-review-loop/steps/の normative step documents.claude/agents/implementation-worker.md.claude/agents/test-runner.md.claude/agents/pr-reviewer.mdIssue 実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573
Issue 実装: worktree-agent-runtime-smokeにrun-scoped isolated Task Context検証を追加する #2568
Issue 実装: Herdr cold restartでTask BindingとNative/Claude-GPT runtime flavorを自動復元する #2569
Issue 実装: GPT-5.3-Codex-Spark delegation を Claude-GPT / Claude Code 経路から退役させる #2651
対象3ファイルの current HEAD:
scripts/agent-ops/run_worktree_agent_runtime_smoke.pyscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py.claude/skills/worktree-agent-runtime-smoke/SKILL.md古い snapshot やこのプロンプト中の状態よりも、実行時点の live Issue / main / PR / CI を優先してください。
現時点での開始方針
Issue #2663 の refinement は既に approved /
impl_readyです。再度
issue-refinement-loopを最初から実行する必要はありません。ただし preparation で live contract drift を確認し、canonical
impl-review-loopが要求する contract snapshot / intake処理は通常どおり実施してください。Issue #2663 の Delivery Rule に従い、dedicated linked worktree を使用してください。
#2568 / #2569 / #2651 との直列化
Issue #2663 は対象3ファイルについて concurrent implementation を禁止しています。
開始前に GitHub 上の PR/branch だけでなく、ローカルの linked worktree / branch / unmerged commit も確認してください。
特に:
について、#2663 の Allowed Paths と重なる実作業が現在進行中か確認してください。
現時点の外部確認では:
ですが、この情報を固定前提にせず fresh state を使ってください。
同一ファイルを編集する active implementation が本当に存在する場合は同時編集しないこと。
merge order を決定し、current main を基準に直列化してください。
単に Issue が open であるだけでは「active concurrent implementation」と決めつけないでください。
実 branch / worktree / PR / unmerged delta を根拠に判定してください。
SubAgent 実行方針 — 必須
このタスクは root orchestrator が control-plane を担当し、canonical SubAgent を実際に使用してください。
最低限:
implementation-workertest-runnerpr-reviewerを canonical skill の指示に従って起動してください。
completion join barrier
SubAgent を起動しただけで次の Step に進んではいけません。
各 SubAgent について:
という join barrier を必須にしてください。
複数SubAgentを並列起動することが canonical skill 上許可される局面でも、必要な全SubAgentが完了するまで次の routing decision を行わないこと。
SubAgent がまだ running / pending の状態で、その結果を推測して先へ進まないでください。
nested delegation
SubAgent自身に新たなSubAgentを勝手にspawnさせないでください。
root orchestrator が必要な canonical SubAgent を直接管理してください。
Issue #2663 の Stop Conditions にある nested SubAgent delegation 境界を維持してください。
Step 1 — implementation
implementation-workerに Issue #2663 の live contract を渡し、Allowed Paths 内だけで実装してください。Allowed Paths:
scripts/agent-ops/run_worktree_agent_runtime_smoke.pyscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py.claude/skills/worktree-agent-runtime-smoke/SKILL.mdこれ以外のファイルを変更しないでください。
実装の中心は Issue 本文を正本とし、少なくとも以下を満たしてください。
bounded hook-chain evidence
structured native Claude lane に opt-in capability を追加する。
新 capability は bounded closed allowlist のみを扱い、caller supplied の:
を evidence source として受け付けないこと。
Issue contract の canonical option
--require-hook-chain-evidenceを実装すること。all_matching_hooks_observedexpected cohort を、Issue contract が定義する:
「current project
.claude/settings.jsonに存在し、選択eventに一致する command hook」に限定する。
runner-owned observation hook は cohort から分離する。
単なる count equality を evidence にしない。
handler identity 単位で expected / observed を対応させ:
を正しく扱うこと。
status:
passfailunverifiedを保持し、boolean true は
status == passの場合だけにする。runtime全hookの完全性を証明したかのような過剰主張をしない。
sibling_side_effect_inventory_completehook execution completion / exit code と side-effect post-condition を別assertionとして扱う。
少なくとも fixed allowlist の各side effectについて:
を明示する。
session_manifest_coordinator.shのように exit 0 でも内部 producer 成功を意味しないケースを正しく扱う。sibling hook の完了を待った後に post-condition を確認すること。
missing / duplicate / unknown / overflow / unobserved はIssue契約どおり扱う。
aggregate
hook-chain aggregate PASS は:
all_matching_hooks_observed.status == passsibling_side_effect_inventory_complete.status == passの両方を満たす場合のみ成立させる。
failまたはunverifiedを true に昇格させない。evidence hygiene
保存してよいのは Issue が認める bounded summary/evidence のみ。
保存・引用してはいけないもの:
既存 sequential
hookchain_harness.pyの成功を live runtime evidence の代替にしない。HEAD binding
開発途中の未commit candidateに対する trial runtime は許可する。
ただし最終acceptance evidenceは commit済み current HEAD のみを対象とする。
最終 evidence では最低限:
tested_headことを確認する。
before fingerprint == after fingerprintだけで「開始時点からHEADと一致」とみなさない。tests
Issue AC6 に書かれたケースを deterministic tests として実装する。
特に:
をカバーする。
既存callerのbackward compatibilityを壊さない。
実装途中の trial runtime
Allowed Paths内の candidate implementation に対して、必要なら runtime trial を行ってください。
ここで assertion が fail した場合は、人間確認を求めず:
を行ってください。
Issue本文にも明記されている通り、Allowed Paths内の通常の実装不足や expected negative scenario のfailは human stop ではありません。
commit / PR
実装と必要な検証を行い、通常の commit / push をしてください。
force pushは禁止です。
1 Issue = 1 PR とし、PR本文には Issueを閉じる closing keyword:
Closes #2663を canonical repository rule に従って含めてください。
PR作成後はそのPRを
impl-review-loopの対象として継続してください。Step 2 — verification
test-runnerSubAgent を起動し、完了を待ってから結果を取得してください。Issue #2663 の Verification Commands を live contract から読み、canonical adjudicationで実行してください。
最低限 static/unit側では:
uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.pyを含む Issue 指定 command を検証してください。
AC5 の canonical live runtime verification は Issue本文の current commandを使用してください。
placeholder
/absolute/linked-worktreeや/absolute/nontracked-hook-chain-prompt.mdを文字どおり使わず、実在する dedicated linked worktree と、このrun用の適切な nontracked bounded prompt file に解決してください。実行時は Issue が指定する:
--runtime claude--mode structured--require-clean-postcondition--require-hook-chain-evidenceを満たしてください。
runtime unavailable
required runtime が本当に利用不能なら Issue契約どおり:
SKIP:unverifiedとして扱って構いません。
ただし:
draft_pr_ready/ merge-ready を捏造しないこと。
Step 4 — PR review
Step 2 の canonical current-head gateを満たした後だけ、
pr-reviewerSubAgent を起動してください。pr-reviewer の完了を必ず待ってから Step 5 routing を行ってください。
review対象は必ず current PR head SHA とすること。
レビューでは少なくとも:
Closes #2663を確認してください。
Step 5 — automatic feedback loop
impl-review-loopの canonicalroute_loop_verdict_v2()等を正本として routing してください。REQUEST_CHANGES
REQUEST_CHANGESなら、人間承認を求めず Step 1 に戻してください。blockersを
fix_deltaとして implementation-worker に渡し:まで自動継続してください。
stale reviewed head
reviewed head と current PR head がずれていた場合、人間確認を求めず current head を再reviewしてください。
BEHIND
canonical route が update_branch を要求する場合、skillどおり workerへ委譲し、更新後に verification と review をやり直してください。
force pushは禁止です。
BLOCKED / UNSTABLE / UNKNOWN
skill が current-head CI / branch-protection evaluator に委譲する種類の状態は、それだけを理由に人間確認へ逃げないでください。
canonical bounded retry / evaluator / rereviewを実行してください。
loop iteration
各 iteration ごとの人間承認は要求しないでください。
canonical
max_iterationsまで自動で継続してください。human stop を限定する
「慎重を期すため」「判断が難しいため」だけで停止しないでください。
以下のような canonical hard boundary の場合だけ停止してください。
tested_headを信頼可能に照合できない異常Step 1〜4 SubAgentが単に
human_review_required: trueと自己申告しただけでは即停止しないでください。現行
impl-review-loopの routing policy を適用してください。禁止事項
以下は行わないこと:
--dangerously-skip-permissionsの追加.claude/settings.jsonの変更.claude/hooks/**の変更#1573 handoff
#2663 の実装/PRが完成しても、このrunでは #1573 のAC7を達成済みとして扱わないでください。
#2663 merge後に #1573 側で別途:
--require-hook-chain-evidenceを使用するAC7 invocationへの更新というhandoffが必要です。
今回は #1573 の本文・コードを変更しないでください。
終了条件
次のいずれかで終了してください。
成功
canonical
impl-review-loopがapprovedroute に到達し、current PR headについて merge直前状態になった場合。その時点で停止し、マージは実行しない。
canonical hard stop
上記 human stop 条件、actual conflict escalation、max_iterations 等の canonical termination に到達した場合。
最終報告
終了時は簡潔に、機械可読情報を維持したまま以下を報告してください。
Issue 実装: worktree-agent-runtime-smoke に generic hook-chain evidence capability を追加する #2663
worktree / branch
PR URL / number
current PR head SHA
iteration数
実装概要
変更ファイル
Verification Commands結果
AC1〜AC6 の状態
AC5 live runtime evidence:
tested_headall_matching_hooks_observed.statussibling_side_effect_inventory_complete.statusCI / mergeability
pr-reviewer verdict
unresolved blockers
termination_reason
mergeは未実行であること
実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 handoffが未実施であること
途中経過の説明だけで作業を終了せず、canonical termination condition に到達するまで実際に
impl-review-loopを遂行してください。このプロンプトでは、#2663 特有の重要点である 「runtime failure は通常の修正ループ」「SKIP はPASSにしない」「最終 evidence は commit 済み HEAD」「#1573 は別handoff」 を明示してあります。
squne121 commentedon Sep 18, 2026
implement-issue: 実装完了 (2026-09-19)
.claude/worktrees/issue-2663-hook-chain-evidenceworktree-issue-2663-hook-chain-evidenceuv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py109 passed(既存82件維持+新規27件)、uv run ruff check scripts/agent-ops/エラーなし--require-hook-chain-evidence --require-clean-postcondition): 終了コード0、hook_chain_evidence.status: pass。ただし対象HEADは実装コミット前のbase commitであり、commit済みHEADに対する最終acceptance evidenceはtest-runnerが別途取得する。fix: hook-chain evidence の PreToolUse response を window 境界に依らず hook_i…
fix: hook-chain evidence の P1-2/P1-3/P2-1 反例を解消し P1-1 の識別限界を文書化する (#2663
squne121 commentedon Sep 19, 2026
impl-review-loop: 完了 (2026-09-19T01:05:00Z)
anchor review (#2668 (comment)) 4件の対応状況
_partition_shared_stream_index_span()で自己echoのtool_use_id値により各Bash呼び出しへ正しく対応付け。反例の回帰テスト追加済みactor.session_idを現在runと照合stop_hook_activeで対象coordinator未確認のままPASSSESSION_MANIFEST_COORDINATOR_RESULT_V1)との両方確認を要求unverified化hook_id(実行単位の相関ID)・hook_name(event+matcher共有ラベル)以外にどのsibling command hookが実行されたかを示す公式フィールドは存在しない。件数一致をidentity evidenceと再定義せず、順序ヒューリスティックも導入せず、.claude/settings.json/hooksの変更もIssue契約(AC2)の変更も行わずに、正確な境界説明への文書修正(--setting-sources projectの誤記修正含む)のみに留めた。AC2の残り部分(hook_idペアリング・orphan検出・unattributable-extra-hookのunverified化・P1-2の window対応)は引き続き機能しており「件数のみ」への後退はない検証結果
tested_head= 現HEAD一致):hook_chain_evidence.status: pass(positive window 1件 + deny window 1件、両方PASS)、sibling_side_effect_inventory_complete.status: passscripts/agent-ops/run_worktree_agent_runtime_smoke.py/scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py/.claude/skills/worktree-agent-runtime-smoke/SKILL.mdのみ変更)マージは未実施です。
feat: worktree-agent-runtime-smoke に generic hook-chain evidence capa…