Repository navigation
Description
Machine-Readable Contract
contract_schema_version: "v1"
issue_kind: implementation
parent_issue: "none"
goal_ref: "docs/dev/repository-folder-policy.md#承認済み一時作業ディレクトリ"
change_kind: schema-migrationParent Issue
なし(単独改善)
Parent Goal Ref
N/A(親 Issue なし。関連: Refs #2004, absorbs #1418)
Current Validated Scope
N/A(親 Issue なし)。背景: Issue #2004(実装: source-bound eligibility/readiness の固定 private location を tmp/session-recording/ へ同時移行する)の issue-refinement-loop 中、OWNER 敵対的レビュー(https://github.com/squne121/loop-protocol/issues/2004#issuecomment-5204465943)で schemas/repo_temp_folder_advice_v1.schema.json の enum 1 値化を「V2 migration」として本 Issue へ分離することが明示された。
2026-09-08 の refinement iteration で、OWNER anchor comment(https://github.com/squne121/loop-protocol/issues/2007#issuecomment-5584305323)により本 Issue のスコープが拡張された: schemas/catalog.yaml / docs/dev/schema-governance.md を Allowed Paths に含む OPEN Issue #1418(実装: repo_temp_folder_advice schema を catalog に登録する、repo_temp_folder_advice/v1 の catalog/governance 登録、未実装)を本 Issue に吸収する。V1/V2 双方の catalog 登録を単一の migration scope・単一 PR として扱う(2 PR に分割しない)。#1418 は本 Issue の PR マージ後、canonical superseded decision(issue-refinement-loop の follow-up materialization / scope-rollup 経路)で superseded として処理する。
Remaining Parent Gaps
N/A(親 Issue なし)
Outcome
schemas/repo_temp_folder_advice_v1.schema.json(REPO_TEMP_FOLDER_ADVICE_V1)を temporary root 1 値化に対応させるため、新規 schemas/repo_temp_folder_advice_v2.schema.json(REPO_TEMP_FOLDER_ADVICE_V2)を追加し、approved_write_roots: ["tmp/"] と deprecated_legacy_roots: [".claude/tmp/"] を分離した schema・producer(root_temporary_residue_policy.py)・hook(root_temporary_residue_advisory.sh)・テスト(.claude/hooks/tests/test_root_temporary_residue_advisory.py / scripts/agent-guards/tests/test_root_temporary_residue_policy.py)を追加する。V1 は breaking change を避けるため残し、producer の無指定 / --schema-version v1 明示時の挙動は既存 V1 payload と完全に同一であることを contract test で確認する。live Claude Code hook(.claude/hooks/root_temporary_residue_advisory.sh)は明示的に V2 を選択する。
schemas/catalog.yaml に repo_temp_folder_advice/v1(#1418 吸収分)と repo_temp_folder_advice/v2 の両エントリを同一 PR で登録し、schemas/tests/test_catalog.py の EXPECTED_ENTRY_COUNT を実エントリ数に合わせて更新する(false-green を残さない)。V2 live mode では .claude/tmp/** への write を deprecated_legacy_root_write として advisory 対象に追加する一方、read/scan/report/delete は従来どおり妨げない。live hook の outer envelope が Claude Code の permission flow(permissionDecision)を変更しないことを runtime test で確認した状態を完了とする。
In Scope
schemas/repo_temp_folder_advice_v2.schema.jsonを新規追加する。schemaプロパティはREPO_TEMP_FOLDER_ADVICE_V2の const。approved_write_rootsはtype: array+const: ["tmp/"](instance 全体を固定。enum: ["tmp/"]のような array instance と string を取り違える記述は使わない)。deprecated_legacy_rootsはtype: array+const: [".claude/tmp/"]。minItems/maxItemsはconstと重複するため追加しない(constのみで単一許容値を表現する)scripts/agent-guards/root_temporary_residue_policy.pyに--schema-version {v1,v2}を追加する。フラグ無指定時と--schema-version v1明示時は既存 V1 payload と bit-for-bit 同一の出力を維持する(V1 emit 経路は削除しない)。--schema-version v2指定時のみ V2 payload(REPO_TEMP_FOLDER_ADVICE_V2schema 準拠)を emit する.claude/hooks/root_temporary_residue_advisory.shを更新し、live hook 実行時は明示的に--schema-version v2を指定して producer を呼び出す(hook 自体は non-blocking / fail-open のまま維持する)。V2 live mode では.tmp/**/.temp/**/.tmp-*/**に加えて.claude/tmp/**への Write/Edit、および明確に write と判定できる Bash operation を advisory 対象に追加し、deprecated_legacy_root_write等の reason code で通常の root-alias advisory と区別する。read / scan / report / delete 操作(.claude/tmp/**を含む)は advisory を発火させない.claude/hooks/tests/test_root_temporary_residue_advisory.pyに以下を追加する:- V2 payload(
REPO_TEMP_FOLDER_ADVICE_V2schema 準拠・approved_write_roots/deprecated_legacy_rootsの値)を検証するテストケース .claude/tmp/**への write 操作で advisory が発火しdeprecated_legacy_root_write相当の reason code が付与されることを検証するテストケース.claude/tmp/**への read / scan / delete 操作で advisory が発火しないことを検証するテストケース- live hook process の
returncode == 0、hookSpecificOutput.permissionDecisionが出力 JSON に存在しないこと、additionalContextの prefix が V2 schema identifier であり inner JSON のschemaフィールドと一致することを検証するテストケース
- V2 payload(
scripts/agent-guards/tests/test_root_temporary_residue_policy.pyに--schema-version v2指定時の V2 schema 準拠を検証するテストケースと、無指定 /--schema-version v1明示時に既存 V1 出力が変化しないことを検証する回帰テストケースを追加する(既存 V1 テストは維持する)schemas/catalog.yamlにrepo_temp_folder_advice/v1(実装: repo_temp_folder_advice schema を catalog に登録する #1418 吸収: producerscripts/agent-guards/root_temporary_residue_policy.py、definitionschemas/repo_temp_folder_advice_v1.schema.json、既存のtemp_residue_classification/v1等と同等の構造・producer/consumer 記載に揃える)とrepo_temp_folder_advice/v2の schema_id エントリを両方追加するschemas/tests/test_catalog.pyのEXPECTED_ENTRY_COUNTを、実装時点のschemas/catalog.yamlの実エントリ数(本 Issue 起票時点のベースラインは 25、V1+V2 の 2 エントリ追加後の期待値は実装時にschemas/catalog.yamlを実測して算出する。anchor 由来の数値を盲目的に転記しない)に更新するdocs/dev/schema-governance.mdにrepo_temp_folder_advice/v1(実装: repo_temp_folder_advice schema を catalog に登録する #1418 吸収分)とrepo_temp_folder_advice/v2の両方の追加を記録するdocs/dev/hook-boundaries.mdのschemas/repo_temp_folder_advice_v1.schema.jsonに関する既存記載(Issue 実装: repo-approved local temporary workspace を tmp/ へ一本化し .claude/tmp/ を非推奨化する #1995 で「1 値化は schema v2 migration の follow-up Issue で扱う」と明記した箇所)を更新し、本 Issue で V1 catalog 登録・V2 追加・.claude/tmp/**write advisory 拡張が行われたことを反映するdocs/dev/repository-folder-policy.mdの該当箇所(.claude/tmp/の説明が「本 Issue のスコープでは変更しない」としている旧記載)を更新し、V2 導入後の書込先/legacy 認識先の区別と.claude/tmp/**write advisory 拡張を反映するtemp_residue_marker.py/temp_residue_classifier.py(scripts/agent-ops/)は.claude/tmp/を legacy residue root として引き続き認識し、read/scan/report を維持することを明記する(本 Issue ではこの 2 スクリプトのロジック自体は変更しない。挙動が変わらないことをテストで確認する)
Out of Scope
- V1 schema(
schemas/repo_temp_folder_advice_v1.schema.json)の削除・deprecation マーキング(別 Issue) - V1 → V2 への consumer 全面切替、または V1 emit 経路の廃止(breaking change のため別 Issue)
.claude/tmp/**(および他の一時ディレクトリ)への新規書き込みを禁止する enforcement(block: true、permissiondeny/askへの拡張)。inner payload のblock: falseは維持し、outer envelope のpermissionDecisionは出力しないtemp_residue_marker.py/temp_residue_classifier.pyの legacy residue 認識ロジック自体の変更- Issue 実装: source-bound eligibility/readiness の固定 private location を tmp/session-recording/ へ同時移行する #2004 が扱う
tmp/session-recording/への private location 移行そのもの - typed downstream consumer 向けの dual-reader migration infrastructure の新規構築(current repo で
approved_temporary_rootsを参照する program consumer は schema/producer/docs/tests 以外に確認されていないため、V1 emitter compatibility + live hook V2 選択で十分とする)
Acceptance Criteria
- AC1:
schemas/repo_temp_folder_advice_v2.schema.jsonが存在し、schemaプロパティがREPO_TEMP_FOLDER_ADVICE_V2の const、approved_write_rootsがtype: array+const: ["tmp/"]、deprecated_legacy_rootsがtype: array+const: [".claude/tmp/"]として定義されている - AC2:
scripts/agent-guards/root_temporary_residue_policy.pyが--schema-version {v1,v2}を受け付ける。フラグ無指定時と--schema-version v1明示時は既存 V1 payload と同一の出力を維持し、--schema-version v2指定時のみ V2 payload(REPO_TEMP_FOLDER_ADVICE_V2schema 準拠)を emit する - AC3:
.claude/hooks/root_temporary_residue_advisory.sh(live hook)が producer を--schema-version v2で明示的に呼び出す - AC4:
.claude/hooks/tests/test_root_temporary_residue_advisory.pyに V2 payload 検証テスト、.claude/tmp/**write advisory 発火テスト(deprecated_legacy_root_write相当 reason code 検証を含む)、.claude/tmp/**read/scan/delete 非発火テストが追加され、pytestで pass する - AC5:
scripts/agent-guards/tests/test_root_temporary_residue_policy.pyに--schema-version v2の V2 schema 準拠検証テストと、無指定 / v1 明示時の既存 V1 出力不変を検証する回帰テストが追加され、既存 V1 テストとあわせてpytestで pass する - AC6:
schemas/catalog.yamlにrepo_temp_folder_advice/v1(実装: repo_temp_folder_advice schema を catalog に登録する #1418 吸収分)とrepo_temp_folder_advice/v2の両方の schema_id エントリが追加されている - AC7:
schemas/tests/test_catalog.pyのEXPECTED_ENTRY_COUNTが更新後のschemas/catalog.yamlの実エントリ数と一致し、pytestで pass する(catalog エントリ数変更を静かに見逃す false-green を残さない) - AC8:
docs/dev/schema-governance.md・docs/dev/hook-boundaries.md・docs/dev/repository-folder-policy.mdに V1 catalog 登録・V2 schema・approved_write_roots/deprecated_legacy_roots分離・.claude/tmp/**write advisory 拡張の説明が追記されている - AC9:
temp_residue_marker.py/temp_residue_classifier.pyの既存挙動(.claude/tmp/の read/scan/report を legacy residue として引き続き認識する)が本 Issue の変更後も無変更であることを既存テストで確認する - AC10:
scripts/agent-guards/root_temporary_residue_policy.pyと.claude/hooks/root_temporary_residue_advisory.shにblock: true・permissiondeny/ask相当のロジックが追加されていない(grep で不在を確認する) - AC11 (動作検証,
<!-- runtime-verification: true -->): live Claude Code PreToolUse hook(.claude/hooks/root_temporary_residue_advisory.sh)を実プロセスとして起動し、.claude/tmp/**への write 操作で advisory(additionalContextに V2 schema identifier prefix、inner JSONschemaフィールドと一致)が出力されること、.claude/tmp/**への read/scan/delete 操作では advisory が出力されないこと、いずれの場合も processreturncode == 0かつ出力 JSON にhookSpecificOutput.permissionDecisionフィールドが存在しない(通常の permission flow を変更しない)ことを実行環境で確認する
Verification Commands
# AC1
# baseline-expect: fail
$ rg -n "\"const\": \"REPO_TEMP_FOLDER_ADVICE_V2\"" schemas/repo_temp_folder_advice_v2.schema.json
# baseline-expect: fail
$ rg -n "\"approved_write_roots\"" schemas/repo_temp_folder_advice_v2.schema.json
# baseline-expect: fail
$ rg -n "\"deprecated_legacy_roots\"" schemas/repo_temp_folder_advice_v2.schema.json# AC2
$ rg -n "schema-version" scripts/agent-guards/root_temporary_residue_policy.py
$ rg -n "REPO_TEMP_FOLDER_ADVICE_V2" scripts/agent-guards/root_temporary_residue_policy.py# AC3
$ rg -n "schema-version v2" .claude/hooks/root_temporary_residue_advisory.sh# AC4
$ uv run --locked pytest .claude/hooks/tests/test_root_temporary_residue_advisory.py -v# AC5
$ uv run --locked pytest scripts/agent-guards/tests/test_root_temporary_residue_policy.py -v# AC6
$ rg -n "repo_temp_folder_advice/v1" schemas/catalog.yaml
$ rg -n "repo_temp_folder_advice/v2" schemas/catalog.yaml# AC7
$ uv run --locked pytest schemas/tests/test_catalog.py -v# AC8
$ rg -n "REPO_TEMP_FOLDER_ADVICE_V2" docs/dev/schema-governance.md docs/dev/hook-boundaries.md docs/dev/repository-folder-policy.md
$ rg -n "repo_temp_folder_advice/v1" docs/dev/schema-governance.md# AC9
$ uv run --locked pytest tests/agent_ops/test_temp_residue_classifier.py -v# AC10
$ rg -c "\"block\": true" scripts/agent-guards/root_temporary_residue_policy.py .claude/hooks/root_temporary_residue_advisory.sh
$ rg -c "permissionDecision" scripts/agent-guards/root_temporary_residue_policy.py .claude/hooks/root_temporary_residue_advisory.sh
# 期待値: いずれも 0 件(matched line 数 0、grep exit 1)。1 件以上ヒットした場合は enforcement 拡張とみなし FAIL。# AC11
# runtime-verification: true
# 動作検証。実装者は以下 2 ファイルを新規作成すること(既存の scripts/agent-ops/tests/run_runtime_verification_ac18.py と同じ「非 pytest-collected な exit-code 変換 wrapper が pytest suite を subprocess で束ねる」構成に揃える):
# (1) scripts/agent-guards/tests/test_root_temporary_residue_advisory_runtime_smoke.py — pytest suite 本体。claude CLI バイナリまたは hook 実行環境が存在しない場合は各テストが pytest.skip("SKIP: ...") する。.claude/tmp/** write / read / scan / delete の各 case で hook プロセスを実起動し、returncode / hookSpecificOutput.permissionDecision 不在 / additionalContext prefix と inner JSON schema 一致を assert で検証する。fallback 経由の成功(`_*_fallback: true` 相当)を検出した場合は assert で FAIL させる。
# (2) scripts/agent-guards/tests/run_runtime_verification_ac11.py — (1) を subprocess で実行し集計する non-pytest-collected wrapper。対象 suite が全件 skip の場合は stdout 先頭に "SKIP: ..." を出力し exit 77、genuine failure があれば exit 1、genuine pass があれば exit 0 を返す。docs/dev/runtime-verification-policy.md セクション4 の必須フィールド形式で artifacts/runtime-verification-AC11-<timestamp>.log を書き出す。
# preflight-scope: runtime_only
$ uv run --locked python3 scripts/agent-guards/tests/run_runtime_verification_ac11.pyAllowed Paths
schemas/repo_temp_folder_advice_v2.schema.jsonschemas/catalog.yamlschemas/tests/test_catalog.pyscripts/agent-guards/root_temporary_residue_policy.pyscripts/agent-guards/tests/test_root_temporary_residue_policy.pyscripts/agent-guards/tests/test_root_temporary_residue_advisory_runtime_smoke.pyscripts/agent-guards/tests/run_runtime_verification_ac11.py.claude/hooks/root_temporary_residue_advisory.sh.claude/hooks/tests/test_root_temporary_residue_advisory.pydocs/dev/schema-governance.mddocs/dev/hook-boundaries.mddocs/dev/repository-folder-policy.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- V1 emit 経路の削除や
.claude/tmp/への新規書き込み禁止(block: true 化)が必要と判断した場合 - AC11 の動作検証実行環境(Claude Code CLI / hook 実行環境)が用意できず SKIP (exit 77) が発生した場合は、その旨を PR に明記し人間レビューを仰ぐ
Required Skills
なし
Required Design References
- docs/dev/repository-folder-policy.md
- docs/dev/hook-boundaries.md
- docs/dev/schema-governance.md
- docs/dev/runtime-verification-policy.md
Runtime Verification Applicability
decision: immediate
reason: >-
本 Issue は `.claude/hooks/root_temporary_residue_advisory.sh`(hook_configuration /
hook handler logic)を変更する。`docs/dev/extension-surface-runtime-policy.yaml` の
risk-trigger rule `hook-lifecycle-matcher-or-handler-change`(`.claude/hooks/**` の
handler logic 変更、`default_decision: immediate`)に該当するため、動作検証を本 Issue の
実装範囲内で成立させる。
applicable_acs:
- AC11
execution_environment:
cli_tools:
- python3
- uv
- claude
auth_required: false
network_required: false
skip_conditions:
- "claude CLI バイナリまたは hook 実行環境が存在しない場合は SKIP(exit 77)として扱う"
fallback_policy:
fallback_success_is_pass: false
notes: "fallback 経由の成功を PASS に変換しない。additionalContext prefix と inner JSON schema の実一致を確認する"
artifact_requirements:
- "artifacts/runtime-verification-AC11-<timestamp>.log(docs/dev/runtime-verification-policy.md セクション4形式)"
- "PR の ## Runtime Verification Evidence セクションへの inline 引用"Scope Delta(任意)
N/A(Allowed Paths への schemas/tests/test_catalog.py および新規 runtime verification VC script の追加は、本 refinement iteration の OWNER anchor comment(https://github.com/squne121/loop-protocol/issues/2007#issuecomment-5584305323)で要求された trusted scope reframe に基づく)
Notes for Reviewer
- V1 emit 経路の削除タイミング・consumer 全面移行手順は本 Issue のスコープ外とし、別 Issue で扱う(AC2 は「V1 を壊さないこと」を明示的に要求する)
root_temporary_residue_policy.pyは--schema-version {v1,v2}の明示 selector 方式を採用する(無指定時は V1 互換を維持し、live hook のみ明示的に--schema-version v2を選択する)- Scope Absorption(実装: repo_temp_folder_advice schema を catalog に登録する #1418): OWNER anchor comment により、OPEN Issue 実装: repo_temp_folder_advice schema を catalog に登録する #1418(
実装: repo_temp_folder_advice schema を catalog に登録する、repo_temp_folder_advice/v1の catalog/governance 登録、未着手)を本 Issue に吸収した。本 Issue はrepo_temp_folder_advice/v1とrepo_temp_folder_advice/v2両方の catalog/governance 登録を単一 PR で行う(title 類似のみでの安易な 実装: repo_temp_folder_advice schema を catalog に登録する #1418 クローズは行わない)。実装: repo_temp_folder_advice schema を catalog に登録する #1418 は本 Issue の PR マージ後、canonical superseded decision(issue-refinement-loop の follow-up materialization / scope-rollup 経路、GitHub readback 確認込み)で superseded として処理する - Refs 実装: source-bound eligibility/readiness の固定 private location を tmp/session-recording/ へ同時移行する #2004, absorbs 実装: repo_temp_folder_advice schema を catalog に登録する #1418
Activity
squne121 commentedon Sep 8, 2026
結論
#2007 は方向性自体は妥当ですが、現状のまま実装開始するのは
REQUEST_CHANGES / reframe_in_placeが適切です。特に「schema V2 を追加したのに live hook の有用性が変わらない」「catalog を追加すると既存 catalog test が必ず壊れる」の2点が大きいです。
#1995 で
tmp/を canonical write destination、.claude/tmp/を deprecated legacy root とする方針はすでに決まり、#2004/PR #2008 で残っていた session-recording の production writer/consumer もtmp/session-recording/に移行済みです。したがって V2への移行タイミングそのものは適切です。主要 Findings
[BLOCKER]
schemas/catalog.yamlを変更すると現状の Allowed Paths ではテストを green にできません。実装: REPO_TEMP_FOLDER_ADVICE_V2 schema と write-root/legacy-root 分離を導入する #2007 は
repo_temp_folder_advice/v2を catalog に追加する AC5 を持ちますが、schemas/tests/test_catalog.pyは現在EXPECTED_ENTRY_COUNT = 25として entry 数を厳密に固定しています。V2 を1件追加すれば26件になるため、そのテストも更新が必要です。しかしschemas/tests/test_catalog.pyは 実装: REPO_TEMP_FOLDER_ADVICE_V2 schema と write-root/legacy-root 分離を導入する #2007 の Allowed Paths にありません。しかも AC5 の VC はrgだけなので、壊れた catalog を PASS と誤認できます。これは過去の 実装: source-bound eligibility/readiness の固定 private location を tmp/session-recording/ へ同時移行する #2008 でも、新規テストが実 CI lane に登録されていなかったことが OWNER review の blocker になったのと同種です。
修正: Allowed Paths に
schemas/tests/test_catalog.pyを追加し、少なくともuv run --locked pytest schemas/tests/test_catalog.py .claude/skills/open-pr/scripts/tests/test_validate_schema_catalog.py -qを VC に含めるべきです。[BLOCKER] V2 schema の
enum記述が曖昧で、文字どおり実装すると充足不能 schema になります。Issue は
approved_write_rootsを「1要素 array、enum: ["tmp/"]」と記述しています。JSON Schema ではenumはその schema が適用された instance 全体と列挙値を比較します。したがって array property に直接enum: ["tmp/"]を置くと、array["tmp/"]は string"tmp/"と等しくないため valid になりません。constは単一値 enum と同等なので、固定 array ならconst: ["tmp/"]が最も簡潔です。(JSON Schema)推奨は以下です。
[HIGH] 「V2をemitできる」だけでは live behavior がV1のまま残れます。
現在の producer は global
ADVICE_SCHEMA = "REPO_TEMP_FOLDER_ADVICE_V1"を使い、wrapper も schema version を指定せず producer を呼んでいます。ところが 実装: REPO_TEMP_FOLDER_ADVICE_V2 schema と write-root/legacy-root 分離を導入する #2007 は「V2を既定にするか
--schema-versionで切り替えるか実装時に決めてよい」としているため、実装者が V2 の optional mode を追加しただけでも AC2 を満たせます。これでは migration Issue として弱いです。推奨:
root_temporary_residue_policy.pyは--schema-version {v1,v2}を持ち、CLI/API の無指定はV1のままにして後方互換性を維持する一方、.claude/hooks/root_temporary_residue_advisory.shは明示的に--schema-version v2を渡す。この形なら「旧 emitter は壊さない」「実利用はV2へ移る」の両方を簡潔に満たせます。[HIGH] 現状の設計では
.claude/tmp/**に書いた当人に、V2でも何も案内されない可能性があります。現 producer は first segment が
tmpまたは.claudeの場合に即Noneを返します。既存テストも.claude/tmp/...は non-trigger と明示的に固定しています。一方、folder policy は「新規書き込みは
tmp/のみ」と既に定義しています。現 hook は.tmp/.temp/.tmp-*からtmp/または.claude/tmp/を案内するため、そこも現行 policy と矛盾しています。V2を有用にするなら、V2 live mode のみ
.claude/tmp/**への Write/Edit/明確な Bash write をdeprecated_legacy_root_writeとして advisory すべきです。read/scan/delete は黙ったままにし、block はしない。この程度ならユーザーの方針どおりワークフローを邪魔しません。[HIGH]
block: falseをテストしても、Claude Code上で non-blocking である保証にはなっていません。blockは inner advice payload 内の独自 field にすぎません。Claude Code の現在の公式仕様では、additionalContextは Claude の context に追加される文字列で、PreToolUse の実際の制御はhookSpecificOutput.permissionDecisionが担います。(Claude)したがって重要なのは「inner JSON に
block:falseがある」ことより、outer envelope にpermissionDecision: deny/askが存在しないことです。公式仕様でも exit 0 + decisionなしは通常の permission flow を継続します。(Claude)V2 hook test では
returncode == 0、permissionDecision不在、additionalContextの schema prefix と innerschemaが一致、を固定するのが適切です。[MEDIUM] 「V1/V2 両方を read/consume」は実態より大げさで、不要な互換ハーネスを誘発します。
現 repo で
approved_temporary_rootsを参照しているのは schema・producer・docs・tests で、下流のプログラム consumer は確認できません。Claude Code側も
additionalContextを typed protocol として consumeするのではなく、Claudeの context に文字列として注入します。(Claude)したがって「dual-reader migration infrastructure」を作る必要はありません。V1 emitter が明示指定で従来出力を再現できること + live hook はV2を出すことで十分です。
#1418 の扱い
ここは別Issueを順番待ちさせるより、#1418 のV1 catalog登録を #2007 に吸収し、#1418 は superseded として閉じるのを推奨します。
#1418 は依然 open で、V1 の
schemas/catalog.yaml/schema-governance.md登録を扱っています。#2007 は同じ2ファイルへ V2 を追加するため、分けると小さな migration のために2 PR・2 review loop・rebase競合が発生します。個人趣味開発としては、1本の #2007 PR で、
項目 | 推奨状態 -- | -- V1 schema | ファイル・emitterを完全保持 V1 catalog | #1418から吸収して登録 V2 schema | 新規登録 Python API default | V1互換 Claude live hook | V2を明示指定 .tmp/.temp/.tmp-* | V2 advisory .claude/tmp/** write | V2 advisory、非blocking .claude/tmp/** read/scan/delete | 従来通り妨げない classifier / marker | 無変更 enforcement | 導入しないとするのが最も整っています。
Issue #2007 に追加すべき完了条件
最低限、ACを「V2 schema が存在する」から一段強くして、live hook がV2を使うこと、
.claude/tmpwrite に非blocking advisory が出ること、V1互換 emitter が同一出力を維持すること、catalog tests が実際に通ることまで固定すべきです。Verification は巨大な full-suite harness を増やす必要はありません。今回なら targeted に以下で十分です。
最終判定は
## 結論REQUEST_CHANGES。ただし scope split は不要で、#2007 をその場で refine すればよいです。セキュリティ強化や block enforcement を足す必要はなく、むしろ「deprecated write を軽く誘導する」「schema/catalog の false-green を防ぐ」「live path を明示する」の3点に集中するのが、このリポジトリの用途には最も実用的です。#2007 は方向性自体は妥当ですが、現状のまま実装開始するのは
REQUEST_CHANGES / reframe_in_placeが適切です。特に「schema V2 を追加したのに live hook の有用性が変わらない」「catalog を追加すると既存 catalog test が必ず壊れる」の2点が大きいです。
#1995 で
tmp/を canonical write destination、.claude/tmp/を deprecated legacy root とする方針はすでに決まり、#2004/PR #2008 で残っていた session-recording の production writer/consumer もtmp/session-recording/に移行済みです。したがって V2への移行タイミングそのものは適切です。主要 Findings
[BLOCKER]
schemas/catalog.yamlを変更すると現状の Allowed Paths ではテストを green にできません。実装: REPO_TEMP_FOLDER_ADVICE_V2 schema と write-root/legacy-root 分離を導入する #2007 は
repo_temp_folder_advice/v2を catalog に追加する AC5 を持ちますが、schemas/tests/test_catalog.pyは現在EXPECTED_ENTRY_COUNT = 25として entry 数を厳密に固定しています。V2 を1件追加すれば26件になるため、そのテストも更新が必要です。しかしschemas/tests/test_catalog.pyは 実装: REPO_TEMP_FOLDER_ADVICE_V2 schema と write-root/legacy-root 分離を導入する #2007 の Allowed Paths にありません。しかも AC5 の VC はrgだけなので、壊れた catalog を PASS と誤認できます。これは過去の 実装: source-bound eligibility/readiness の固定 private location を tmp/session-recording/ へ同時移行する #2008 でも、新規テストが実 CI lane に登録されていなかったことが OWNER review の blocker になったのと同種です。
修正: Allowed Paths に
schemas/tests/test_catalog.pyを追加し、少なくともuv run --locked pytest schemas/tests/test_catalog.py .claude/skills/open-pr/scripts/tests/test_validate_schema_catalog.py -qを VC に含めるべきです。[BLOCKER] V2 schema の
enum記述が曖昧で、文字どおり実装すると充足不能 schema になります。Issue は
approved_write_rootsを「1要素 array、enum: ["tmp/"]」と記述しています。JSON Schema ではenumはその schema が適用された instance 全体と列挙値を比較します。したがって array property に直接enum: ["tmp/"]を置くと、array["tmp/"]は string"tmp/"と等しくないため valid になりません。constは単一値 enum と同等なので、固定 array ならconst: ["tmp/"]が最も簡潔です。([JSON Schema]1)推奨は以下です。
[HIGH] 「V2をemitできる」だけでは live behavior がV1のまま残れます。
現在の producer は global
ADVICE_SCHEMA = "REPO_TEMP_FOLDER_ADVICE_V1"を使い、wrapper も schema version を指定せず producer を呼んでいます。ところが 実装: REPO_TEMP_FOLDER_ADVICE_V2 schema と write-root/legacy-root 分離を導入する #2007 は「V2を既定にするか
--schema-versionで切り替えるか実装時に決めてよい」としているため、実装者が V2 の optional mode を追加しただけでも AC2 を満たせます。これでは migration Issue として弱いです。推奨:
root_temporary_residue_policy.pyは--schema-version {v1,v2}を持ち、CLI/API の無指定はV1のままにして後方互換性を維持する一方、.claude/hooks/root_temporary_residue_advisory.shは明示的に--schema-version v2を渡す。この形なら「旧 emitter は壊さない」「実利用はV2へ移る」の両方を簡潔に満たせます。[HIGH] 現状の設計では
.claude/tmp/**に書いた当人に、V2でも何も案内されない可能性があります。現 producer は first segment が
tmpまたは.claudeの場合に即Noneを返します。既存テストも.claude/tmp/...は non-trigger と明示的に固定しています。一方、folder policy は「新規書き込みは
tmp/のみ」と既に定義しています。現 hook は.tmp/.temp/.tmp-*からtmp/または.claude/tmp/を案内するため、そこも現行 policy と矛盾しています。V2を有用にするなら、V2 live mode のみ
.claude/tmp/**への Write/Edit/明確な Bash write をdeprecated_legacy_root_writeとして advisory すべきです。read/scan/delete は黙ったままにし、block はしない。この程度ならユーザーの方針どおりワークフローを邪魔しません。[HIGH]
block: falseをテストしても、Claude Code上で non-blocking である保証にはなっていません。blockは inner advice payload 内の独自 field にすぎません。Claude Code の現在の公式仕様では、additionalContextは Claude の context に追加される文字列で、PreToolUse の実際の制御はhookSpecificOutput.permissionDecisionが担います。(Claude)したがって重要なのは「inner JSON に
block:falseがある」ことより、outer envelope にpermissionDecision: deny/askが存在しないことです。公式仕様でも exit 0 + decisionなしは通常の permission flow を継続します。([Claude]2)V2 hook test では
returncode == 0、permissionDecision不在、additionalContextの schema prefix と innerschemaが一致、を固定するのが適切です。[MEDIUM] 「V1/V2 両方を read/consume」は実態より大げさで、不要な互換ハーネスを誘発します。
現 repo で
approved_temporary_rootsを参照しているのは schema・producer・docs・tests で、下流のプログラム consumer は確認できません。Claude Code側も
additionalContextを typed protocol として consumeするのではなく、Claudeの context に文字列として注入します。(Claude)したがって「dual-reader migration infrastructure」を作る必要はありません。V1 emitter が明示指定で従来出力を再現できること + live hook はV2を出すことで十分です。
#1418 の扱い
ここは別Issueを順番待ちさせるより、#1418 のV1 catalog登録を #2007 に吸収し、#1418 は superseded として閉じるのを推奨します。
#1418 は依然 open で、V1 の
schemas/catalog.yaml/schema-governance.md登録を扱っています。#2007 は同じ2ファイルへ V2 を追加するため、分けると小さな migration のために2 PR・2 review loop・rebase競合が発生します。個人趣味開発としては、1本の #2007 PR で、
.tmp/.temp/.tmp-*.claude/tmp/**write.claude/tmp/**read/scan/deleteとするのが最も整っています。
Issue #2007 に追加すべき完了条件
最低限、ACを「V2 schema が存在する」から一段強くして、live hook がV2を使うこと、
.claude/tmpwrite に非blocking advisory が出ること、V1互換 emitter が同一出力を維持すること、catalog tests が実際に通ることまで固定すべきです。Verification は巨大な full-suite harness を増やす必要はありません。今回なら targeted に以下で十分です。
最終判定は
REQUEST_CHANGES。ただし scope split は不要で、#2007 をその場で refine すればよいです。セキュリティ強化や block enforcement を足す必要はなく、むしろ「deprecated write を軽く誘導する」「schema/catalog の false-green を防ぐ」「live path を明示する」の3点に集中するのが、このリポジトリの用途には最も実用的です。squne121 commentedon Sep 8, 2026
確認した限り、推奨は
REQUEST_CHANGES / reframe_in_placeのまま #2007 を refinement loop に通し、#1418 を吸収する方向です。#1418 は現在も open で V1 catalog 登録を所有しており、#2007 とschemas/catalog.yaml/docs/dev/schema-governance.mdが重複しています。 一方、現 main の producer はまだ V1 固定、Claude hook も version 指定なしなので、anchor の指摘は現状にも当たっています。また、
schemas/tests/test_catalog.pyは現時点でEXPECTED_ENTRY_COUNT = 25です。#1418 の V1 と #2007 の V2 を両方吸収するなら、main が変わっていなければ 25→27 になります。固定値 26 を転記せず、実行時の catalog から再計算させるべきです。 JSON Schema のenum/const指摘も仕様上正しく、固定配列ならconst: ["tmp/"]の形が素直です。([JSON Schema]1) Claude Code の現行 hook 仕様でも、additionalContextは context 注入で、PreToolUse の制御はpermissionDecisionが担うため、「通常の permission flow を変えない」ならpermissionDecision自体を出さない検証が適切です。([Claude]2)そのまま既存の auto mode Claude Code に貼れる形です。
以下を、人間の追加承認なしで最後まで実行してください。
対象 repository:
squne121/loop-protocol対象 Issue:
#2007anchor comment:
https://github.com/squne121/loop-protocol/issues/2007#issuecomment-5584305323使用する canonical Skill:
.claude/skills/issue-refinement-loop目的
anchor comment の
REQUEST_CHANGES / reframe_in_placeを入力として、Issue #2007 を current repository state と current external specifications に整合する実装可能な契約へ refinement してください。issue-refinement-loopの bounded loop を canonical procedure のまま実行し、可能な限りapprove / proceed相当の terminal state まで到達させてください。iteration 間の人間承認は不要です。
現在の Claude Code の auto mode / permission mode は変更しないでください。
--dangerously-skip-permissions等への切替も不要です。この依頼は「planner / reviewer / worker の SSOT を迂回して手動判断する」指示ではありません。以下の推奨方向は investigation/review で検証する hypothesis として扱い、最終的な mutation/routing は
issue-refinement-loopの canonical planner、review pipeline、issue-editor、scope/superseded decision に従ってください。anchor の扱い
この anchor comment は、今回ユーザーが明示的に選択した human context です。
URL 単独の unlabeled anchor として扱わず、Skill が規定する canonical human-context lane を使用してください。
必要に応じて、
preflight.run.with_human_contextcontract_update.run.with_human_contextの正規経路を使用し、raw
gh issue edit等で canonical mutation lane を迂回しないでください。anchor と Issue/repository の binding を最初に検証してください。
最初に必ず current state を再調査する
anchor の記述をそのまま転記せず、少なくとも以下を current main / GitHub state で再確認してください。
schemas/catalog.yamlschemas/tests/test_catalog.pyschemas/repo_temp_folder_advice_v1.schema.jsonscripts/agent-guards/root_temporary_residue_policy.pyscripts/agent-guards/tests/test_root_temporary_residue_policy.py.claude/hooks/root_temporary_residue_advisory.sh.claude/hooks/tests/test_root_temporary_residue_advisory.py.claude/skills/open-pr/scripts/tests/test_validate_schema_catalog.pydocs/dev/schema-governance.mddocs/dev/hook-boundaries.mddocs/dev/repository-folder-policy.md既存 PR / branch / worktree が #2007 または #1418 を既に実装中でないことも確認してください。
サブエージェント
Skill contract に従って read-only SubAgent を使用してください。
特に repository fact の確認には
codebase-investigatorを使用してください。外部仕様の fact-check が planner 上 required になった場合は
web-researcherを使用してください。今回の anchor には少なくとも以下の external/spec claim があるため、web research が必要と判定された場合は一次資料を優先してください。
enum/constsemanticsadditionalContexthookSpecificOutput.permissionDecision複数 SubAgent を起動した場合、全 SubAgent の作業完了を待って結果を join してから次の review step に進んでください。
SubAgent に mutation をさせないでください。
SubAgent から別 SubAgent への nested delegation は行わせないでください。
なお canonical Step 2 では、現行 Skill の契約どおり
issue-reviewerSubAgent を新たに起動しないでください。root-owned review pipeline の結果を canonical routing authority として consumeしてください。#2007 の推奨 reframe
current evidence が反証しない限り、以下の方向へ #2007 を reframe してください。
1. #1418 を #2007 に吸収する
#1418 が依然 open で未実装なら、
repo_temp_folder_advice/v1の catalog/governance 登録repo_temp_folder_advice/v2の catalog/governance 登録を #2007 の1本の migration scope に統合する方向を採用してください。
#2007 本文に V1 catalog registration の ownership を明示してから、canonical scope-rollup / superseded decision が許可する場合に限り #1418 を superseded として処理してください。
単なる title 類似だけで #1418 を閉じないこと。
canonical superseded decision と GitHub readback を確認してください。
別々に2 PRを作る前提にはしないでください。
2. catalog test の false-green を除去する
schemas/tests/test_catalog.pyを #2007 の Allowed Paths に追加する必要性を検証し、必要なら trusted scope reframe として反映してください。現 main では
EXPECTED_ENTRY_COUNT = 25ですが、#1418 の V1 と #2007 の V2 を双方新規登録するなら単純計算では +2 です。ただし 26 や 27 を anchor から盲目的に hard-code せず、current
schemas/catalog.yamlの実 entry 数から期待値を再計算してください。.claude/skills/open-pr/scripts/tests/test_validate_schema_catalog.pyは、変更が本当に必要なら Allowed Paths 追加を検討し、既存 validator を実行するだけでよいなら mutation scope には追加せず VC として実行してください。3. V2 schema の固定配列契約を曖昧にしない
array property へ
enum: ["tmp/"]のような意味的に誤った記述を要求しないでください。
固定 array を要求するなら、例えば:
approved_write_roots["tmp/"]deprecated_legacy_roots[".claude/tmp/"]のように instance 全体を固定する契約として明文化してください。
必要なら
minItems/maxItemsは redundancy を理解した上で採否を決めてください。4. V1 backward compatibility と live V2 adoption を分離する
推奨契約:
--schema-version {v1,v2}相当の explicit selector「V2 を emit できる」だけで AC を満たさず、実 live Claude hook が V2 を選択していることを acceptance criteria にしてください。
不要な dual-reader migration infrastructure は作らないでください。
現実に typed downstream consumer が存在するかを investigation で確認し、存在しないなら「V1 emitter compatibility + live hook V2」で十分としてください。
5.
.claude/tmp/**write を V2 advisory 対象にするcurrent repository policy と整合するなら、V2 live mode では:
.tmp/**.temp/**.tmp-*/**に加えて、
.claude/tmp/**への Write/Editを non-blocking advisory 対象にしてください。
.claude/tmp/**の write はdeprecated_legacy_root_write等の明確な reason code で区別する方向を検討してください。一方、
は legacy residue compatibility のため妨げない契約を維持してください。
temp_residue_marker.pytemp_residue_classifier.pyの legacy recognition logic は変更しないでください。
6. enforcement を追加しない
本 Issue の目的は guidance/migration です。
block: trueへ拡張しないでください。
inner payload に
block: falseを残すかどうかとは独立に、Claude Code hook の outer envelope が permission flow を変更しないことを runtime test で確認してください。望ましい検証は少なくとも:
returncode == 0hookSpecificOutput.permissionDecisionが存在しないadditionalContextprefix が V2 schema identifierschemaが一致.claude/tmp/**write では advisory が出る.claude/tmp/**read/scan/delete では advisory が出ないです。
permissionDecision: allowも通常 permission flow を変えるので、この advisory hook では出さない方向を優先してください。Acceptance Criteria / Verification の強化
Issue body を「V2 schema file が存在する」だけの静的 AC にしないでください。
最低限、以下を contract として検証可能にしてください。
.claude/tmp/**write advisory.claude/tmp/**read/scan/delete non-triggertargeted verification の最低ラインは current repo state に合わせて、以下を含めてください。
必要なら既存の relevant regression tests を追加してください。ただし巨大な新規 harness や security framework を作らないでください。
loop 実行
max_iterationsは canonical default を使用してください。review が
needs-fix / request_changesなら、人間確認を挟まず次 iteration へ進めてください。各 iteration で:
を行ってください。
planner/reviewer の machine-readable result を prose で勝手に再判定しないでください。
停止条件
通常の「続けますか?」という確認では停止しないでください。
ただし canonical Skill が以下を返した場合は、捏造した approval で突破せず fail-closed にしてください。
human_judgment_requiredmax_iterations_exceededその場合は canonical termination report を投稿して終了してください。
完了条件
最終的に以下を満たしてください。
approve/proceed相当最後に簡潔に、
を報告してください。
このプロンプトでは、anchor の修正案を単なる「レビューコメント対応」ではなく、trusted human-context reframe → fresh review → semantic approval の流れに載せています。現行
issue-refinement-loopは iteration approval gate が既定で不要で、必要なcodebase-investigator/web-researcherは Step 2 前に結果を合流させる契約なので、この運用と整合します。squne121 commentedon Sep 8, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 8, 2026
issue-refinement-loop 終了報告(#2007)
Final Verdict:
approved(deterministic review: approve / semantic design review: approve, low-severity warning 1件)Iteration 概要(3回)
const化・V1/V2 selector 分離・.claude/tmp/**advisory 拡張・Runtime Verification Applicability(decision: immediate)を含む全面書き換えを実施。deterministic review:needs-fix(AC11 VC が preflight allowlist 違反)uv run --locked pytest ... -v、SKIP はpytest.skip())へ修正。deterministic review:approve。Step 2.5 semantic design review で blocker 検出(AC11 の SKIP 表現がdocs/dev/runtime-verification-policy.mdの exit code 77 SKIP 規約を満たさず、実行環境欠如時に test-runner から PASS と誤分類されうる)scripts/agent-ops/tests/run_runtime_verification_ac18.pyと同一パターン)」の2ファイル構成へ再設計し、# preflight-scope: runtime_onlyannotation で VC preflight allowlist の対象外とした。deterministic review:approve。Step 2.5 semantic design review(再実行):approve(low-severity warning 1件: AC11 対象ファイルが## In Scopeに明示列挙されていない — non-blocking、実装をブロックしない)Issue Body の主要 semantic delta
repo_temp_folder_advice/v1catalog/governance 登録、未着手)を 実装: REPO_TEMP_FOLDER_ADVICE_V2 schema と write-root/legacy-root 分離を導入する #2007 に吸収。単一 PR で V1+V2 両方の catalog/governance 登録を行う設計に変更。実装: repo_temp_folder_advice schema を catalog に登録する #1418 は本 Issue の PR マージ後、canonical superseded decision(scope-rollup / post-merge-cleanup 経路)で処理する方針を明記(現時点では 実装: repo_temp_folder_advice schema を catalog に登録する #1418 は close していない — 実装前の superseded 確定は時期尚早と判断)schemas/tests/test_catalog.pyを Allowed Paths に追加。EXPECTED_ENTRY_COUNT(現状 25、実測確認済み)を実装時点の実エントリ数で更新する契約に変更(anchor 由来の数値を盲目的に転記しない旨を明記)approved_write_roots/deprecated_legacy_rootsをenumではなくtype: array+const: [...]で instance 全体を固定する設計に修正--schema-version {v1,v2}を producer に追加。無指定/明示v1は既存出力を維持、live hookのみ明示的にv2を選択.claude/tmp/**advisory 拡張: V2 live mode でのみ write をdeprecated_legacy_root_writeとして advisory 対象化。read/scan/report/delete は非対象のまま維持。enforcement(block: true / permission deny・ask)は追加しない契約を明記decision: immediate(.claude/hooks/**handler logic 変更が extension-surface risk-trigger rulehook-lifecycle-matcher-or-handler-changeに該当)。live hookのSKIP/PASS/FAIL・permissionDecision不在・additionalContext一致を実プロセスで検証する契約とし、exit code 77 SKIP 規約に準拠する2ファイル構成(pytest suite + wrapper)を明記Verification Evidence
contract_readiness_check.py --mode preflight-static: 各 iteration でSTATUS: goを確認してから rewrite を確定run_root_review_pipeline.py produce(deterministic review): 最終 iteration でverdict: approve/canonical_step2_route: step_2_5/blocking_issues: []issue-design-reviewerSubAgent、2回実行): 最終assessment: findings(severity: low、requires_owner_choice: false)→join_review_results.pyでeffective_verdict: approvebody_sha256: sha256:c8537efa0a0c7a93d90b90008e812fc5c35056027ed2c565c4ca5a284e4f0ad5を live fetch で確認済みroot_entry_router.py(Root-Owned Synchronous Entry Transition)実行結果:route: invoke_impl_review_loop(reason: fresh_review_go_live_equality、reviewed_body_sha256 == observed_live_body_sha256、reviewed_base_sha == observed_base_sha)。注記: 本 session はissue-refinement-loopの完了までを依頼範囲と判断し、impl-review-loopの実起動(branch/worktree 作成・実装・PR 作成を伴う)はこの turn では実行していない。実装着手を希望する場合は改めて指示してください。Residual Uncertainty
## In Scope明示列挙欠落)は non-blocking として残置。次回 Issue 編集時に追記を推奨するが、実装をブロックしないHuman Escalation
なし。fail-closed 停止条件(
human_judgment_required/max_iterations_exceeded/ environment 障害 / 未解決 architecture scope / secret 要求 / destructive operation 要求)はいずれも発生しなかった。squne121 commentedon Sep 8, 2026
推奨は、#2007 を再refineせず、そのまま
impl-review-loopに投入です。直近の refinement は deterministic / semantic とも approve まで到達し、root router もinvoke_impl_review_loopを返しています。残件は low warning 1件のみで non-blocking、#1418 の superseded close は #2007 のPRマージ後です。また、
impl-review-loopは implementation-worker に実装・worktree・PR作成まで委譲し、その後 verification と PR review を回し、最終的にdraft_pr_readyで停止してマージ判断そのものは人間に残す設計です。今回の希望と一致します。そのまま Claude Code に貼ってください。
以下を、人間の追加承認なしで最後まで実行してください。
対象 repository:
squne121/loop-protocol対象 Issue:
#2007#2007
使用する canonical Skill:
.claude/skills/impl-review-loop目的:
Issue #2007 の current live contract を正本として、実装 → verification → PR review → 必要な修正 → 再verification → 再review の bounded loop を自律実行し、canonical
IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready、すなわち PR がマージ可能な直前状態に到達させてください。実際の merge は行わないでください。
auto-merge も有効化しないでください。
Issue #2007 / #1418 の手動 close もこの turn では行わないでください。
実行権限
現在すでに Claude Code は auto mode で起動しています。
通常の実装、編集、テスト、worktree/branch 操作、commit、push、PR作成、PR body 更新、review finding 対応、CI確認、branch update、再reviewについて、iteration ごとの人間承認は求めず継続してください。
permission mode は変更しないでください。
--dangerously-skip-permissions等へ切り替えないでください。ただし canonical Skill が定義する genuine hard stop、たとえば秘密情報・protected boundary、解消不能な実 Git conflict、max-iteration 到達、実権限不足などは迂回しないでください。
Entry は必ず current live state から開始する
過去の refinement report や router comment を implementation authorization packet として再利用しないでください。
.claude/skills/impl-review-loopの現行 Root-Owned Synchronous Entry Transition を正本として、issue-contract-reviewroute: invoke_impl_review_loopの場合のみ、そのまま同じ control flow で Step 1 起動まで実行してください。
Issue body drift / base drift が検出された場合も、過去の approved comment を根拠に強行せず、canonical rerun/reconciliation route に従って fresh review してください。
一方、古い snapshot、ledger、artifact、過去 comment の freshness 不足だけを理由に不要な human escalation を発生させないでください。
現在までの context
直近の
issue-refinement-loopは #2007 について approved で終了しています。termination report:
#2007 (comment)
これは必要なら
agent_report_comment_url相当の structured agent report として参照してください。human-context と誤分類しないでください。その report 時点では、
invoke_impl_review_loopという状態です。
ただし、これらは current-run live review を省略する authorization ではありません。
実装方針
Issue #2007 の 現在の live body にある In Scope / Out of Scope / Acceptance Criteria / Verification Commands / Allowed Paths / Runtime Verification Applicability を literal contract として使用してください。
特に以下を落とさないでください。
REPO_TEMP_FOLDER_ADVICE_V2schema を追加するapproved_write_rootsは固定 array["tmp/"]deprecated_legacy_rootsは固定 array[".claude/tmp/"]constで固定する--schema-version v1は既存 V1 output compatibility を維持する.claude/tmp/**への write は V2 non-blocking advisory 対象にする.claude/tmp/**の read / scan / report / delete は妨げないblock: true、permissionDecision: deny/ask等の enforcement を追加しないrepo_temp_folder_advice/v1と、新規repo_temp_folder_advice/v2の両方を catalog/governance に登録するschemas/tests/test_catalog.pyの expected count は Issue 起票時の数値を盲目的に使わず、implementation 時点の live catalog entry 数から算出する.claude/tmp/read/scan recognition は壊さない個人趣味開発であるため、品質・実用性を優先しつつ、Issue の AC を超える過剰な security/harness machinery は追加しないでください。
外部仕様
実装判断に外部仕様が関係する箇所は、必要に応じて SubAgent / web research lane を使って current official specification を確認してください。
特に、
additionalContexthookSpecificOutput.permissionDecisionconst/enumについて current official docs と矛盾しないことを確認してください。
ただし外部調査自体を大規模な別プロジェクトにせず、#2007 の implementation decision に必要な範囲に限定してください。
SubAgent delegation
canonical
impl-review-loopの責務分離を維持してください。Step 1
implementation-workerSubAgent を起動し、.claude/skills/implement-issueを使用して implementation、worktree、branch、commit、push、PR作成まで委譲してください。
Step 2
test-runnerSubAgent に current candidate HEAD の verification を委譲してください。Issue に記載された literal Verification Commands を実行し、AC単位の evidence を取得してください。
runtime verification AC11 の PASS / FAIL / SKIP semantics、特に canonical exit 77 SKIP 規約を維持してください。
Step 4
current-head gate を通過した場合のみ
pr-reviewerSubAgent を起動し、canonical PR review を実施してください。Completion synchronization
起動した SubAgent は必ず作業完了まで待ってください。
Agent/Task の launch 成功だけを completion とみなして次の Step に進まないでください。
各 Step で、
という順序を守ってください。
同一 iteration で未完了 SubAgent を残したまま Step 5 や最終報告へ進まないでください。
最終終了時には、今回起動した全 SubAgent / Task が completed または canonical terminal state になっており、未回収 task が 0 件であることを確認してください。
Review loop
pr-reviewer が
REQUEST_CHANGESを返した場合、人間へ確認せず、その blockers を canonicalfix_deltaとして次の implementation iteration に渡してください。修正後は current HEAD に対して verification と PR review を必要な範囲で再実行してください。
以下も canonical routing に従って自動処理してください。
update_branchworker action → verification → re-reviewreviewer の自己申告だけで human escalation しないでください。
canonical routing function と live GitHub state を正本にしてください。
max_iterationsは canonical default の 3 を使用してください。3 iteration 内で収束できる限り、人間承認を求めず継続してください。
PR
既存PRが current live state で見つかった場合は、duplicate PR を作らず canonical ownership / worktree identity を確認して再利用してください。
存在しない場合は canonical
implement-issue→open-prlane で1本だけ作成してください。PR body は Issue #2007 を正しくリンクし、canonical closing-keyword policy が要求する場合は
Closes #2007を含めてください。#1418 は #2007 に吸収された scope ですが、実際の superseded close は post-merge cleanup 側の責務なので、このPRから先行して手動 close しないでください。必要なら
Refs #1418等、canonical policy に沿った non-closing reference にしてください。終了条件
以下すべてが成立するまで継続してください。
APPROVEIMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_readyここまで到達したら 停止してください。
git merge/ GitHub merge API / auto-merge は実行しないでください。最終報告
最後に簡潔に以下を報告してください。
IMPL_REVIEW_LOOP_RESULT_V1通常の loop で解決可能な finding がある限り、途中経過を人間への質問で止めず、自律的に処理してください。
特に重要なのは、過去の
invoke_impl_review_loopコメントを認可証として使わず、現在の Skill が要求する fresh synchronous entry transition を実行させる点です。現行 Skill は SubAgent への実装委譲と完了回収を前提にしているので、明示的な「全SubAgent完了待ち」も上乗せしています。squne121 commentedon Sep 8, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 8, 2026
implement-issue: 実装完了 (2026-09-08T12:33:59Z)
.claude/worktrees/issue-2007-repo-temp-folder-advice-v2worktree-issue-2007-repo-temp-folder-advice-v2fix: catalog.yamlのrequired_test_commandsを許可済みidに揃える (#2007)
squne121 commentedon Sep 8, 2026
impl-review-loop: 完了 (2026-09-08T13:10:00Z)
fix: .claude/tmp/** legacy-write Bash分類器を宛先認識型に修正し(#2007)
squne121 commentedon Sep 8, 2026
impl-review-loop: 完了 (2026-09-08T14:05:00Z)
4e25fbeba1caefad5ae4d35e1536772bc5e72d56, blockers: [])merge_state_status=UNSTABLE, defer to CI evaluator) — resolved by control-plane:gh pr checks --requiredreports 6/6 required checks PASS, 0 FAIL; sole failing checkci-verdict-summaryis a known pre-existing false-red (overall_status='gh_error'driven solely byclose-evidence-publicationlegitimately reportingskipped), not a real regression, and is NOT in this repo's branch-protection required contexts (typecheck,lint,test,build,python-test,validate-generated-artifact)指定レビューコメントの Finding 対応
.claude/tmp/**Bash-write classifier を destination-aware narrow helper(_detect_bash_legacy_root_write系)に置き換え、V1_match_command()は無変更。false-negative(cat >,sed -i, compound&&)と false-positive(cpsource-only,echo/printf/git status)を両方修正。10 fixture(positive 5 / negative 5)で境界を固定。claudeCLI 存在チェックを削除し、実態(hook process 起動のみ、Claude CLI 自体は起動しない)に即した wording へ修正。AC11 は genuine PASS(6 passed, 0 skipped)。feat: REPO_TEMP_FOLDER_ADVICE_V2 schema と write-root/legacy-root 分離を導…