Repository navigation
feat: add root temporary residue advisory (#1404) - #1407
Conversation
Preview URLPreview removed (PR #1407 closed). |
|
TEST_VERDICT_MACHINE: |
TEST_VERDICT_MACHINETEST_VERDICT_MACHINE:
schema: TEST_VERDICT_MACHINE_V1
result: PASS
pr_number: 1407
head_sha: "6a2d9d3c4919285b985375907c44a7b3856ce24b"
mergeable: MERGEABLE
merge_state_status: BLOCKED
baseline_only: false
verification_commands_pass: 9
verification_commands_fail: 0
verification_skipped_count: 0
skipped_count: 0
evidence:
- command: "rg -n \"root_temporary_residue_advisory\" .claude/settings.json .codex/hooks.json"
result: pass
- command: "rg -n \"approved_replacement\" scripts/agent-guards/root_temporary_residue_policy.py schemas/repo_temp_folder_advice_v1.schema.json"
result: pass
- command: "rg -n \"classification: blocker\" docs/dev/hook-boundaries.md"
result: pass
- command: "rg -n \"REPOSITORY_FOLDER_POLICY_V1\" .gitignore"
result: pass
- command: "rg -n \"TEMP_CLEANUP_SAFETY_RULES_V1\" .claude/skills/post-merge-cleanup/SKILL.md"
result: pass
- command: "rg -n \"root temporary residue\" .claude/skills/post-merge-cleanup/SKILL.md"
result: pass
- command: "rg -n \"REPO_TEMP_FOLDER_ADVICE_V1\" .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py"
result: pass
- command: "rg -n \"repo-approved local temporary workspace\" .gitignore"
result: pass
- command: "uv run --locked pytest scripts/agent-guards/tests/test_root_temporary_residue_policy.py .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py"
result: pass
produced_by: test-runner
note: "test-runner returned ok for this head; comment posting was recovered by orchestrator because the read-only profile skipped PR mutation." |
TEST_VERDICT_MACHINE v1TEST_VERDICT_MACHINE:
schema: TEST_VERDICT_MACHINE/v1
issue_number: 1404
pr_number: 1407
reviewed_head_sha: cf8314d95bebc9bc713e543454e35b93feefc840
head_sha_match: true
status: pass
fallback_used: false
skip_used: false
summary:
verification_commands_total: 12
verification_commands_pass: 12
verification_commands_fail: 0
verification_commands_skip: 0
checks:
- id: AC1
result: PASS
command: rg -n "root_temporary_residue_advisory" .claude/settings.json .codex/hooks.json
- id: AC2
result: PASS
command: rg -n "approved_replacement" scripts/agent-guards/root_temporary_residue_policy.py schemas/repo_temp_folder_advice_v1.schema.json
- id: AC3
result: PASS
command: rg -n "classification: blocker" docs/dev/hook-boundaries.md
- id: AC4
result: PASS
command: rg -n "REPOSITORY_FOLDER_POLICY_V1" .gitignore
- id: AC5
result: PASS
command: rg -n "TEMP_CLEANUP_SAFETY_RULES_V1" .claude/skills/post-merge-cleanup/SKILL.md
- id: AC6
result: PASS
command: rg -n "root temporary residue" .claude/skills/post-merge-cleanup/SKILL.md
- id: AC7
result: PASS
command: rg -n "REPO_TEMP_FOLDER_ADVICE_V1" .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py
- id: AC8
result: PASS
command: rg -n "repo-approved local temporary workspace" .gitignore
- id: PR1
result: PASS
command: uv run --locked pytest scripts/agent-guards/tests/test_root_temporary_residue_policy.py .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py
- id: PR2
result: PASS
command: python3 -m py_compile scripts/agent-guards/root_temporary_residue_policy.py scripts/agent-guards/tests/test_root_temporary_residue_policy.py .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py
- id: PR3
result: PASS
command: uv run --locked pytest scripts/agent-guards/tests/test_local_main_branch_guard.py::TestAC7HookBoundariesManifest::test_check_hook_boundaries_passes scripts/agent-guards/tests/test_pretool_fastpath_classifier.py::TestMajorCodexHooksTopologyCheck::test_current_topology_matches_frozen_expectation
- id: PR4
result: PASS
command: uv run --locked python3 scripts/check_hook_boundaries.py |
検証結果レポートIssue #1404 / PR #1407
Issue contract VC
PR body supplemental verification
TEST_VERDICT:
head_sha: "0b33877d7c2d0292f4437b97c07bd7af33f82bb9"
result: PASS
mergeable: MERGEABLE
merge_state_status: CLEAN
branch_behind_main: false
baseline_only: false
verification_commands_pass: 8
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results:
- ac: AC1
command: "rg -n \"root_temporary_residue_advisory\" .claude/settings.json .codex/hooks.json"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "advisory hook registration を確認"
- ac: AC2
command: "rg -n \"approved_replacement\" scripts/agent-guards/root_temporary_residue_policy.py schemas/repo_temp_folder_advice_v1.schema.json"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "advisory payload schema / producer を確認"
- ac: AC3
command: "rg -n \"classification: blocker\" docs/dev/hook-boundaries.md"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "local_main_branch_guard の blocker 維持を確認"
- ac: AC4
command: "rg -n \"REPOSITORY_FOLDER_POLICY_V1\" .gitignore"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "repo-approved temporary workspace の明示を確認"
- ac: AC5
command: "rg -n \"TEMP_CLEANUP_SAFETY_RULES_V1\" .claude/skills/post-merge-cleanup/SKILL.md"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "cleanup safety rules を確認"
- ac: AC6
command: "rg -n \"root temporary residue\" .claude/skills/post-merge-cleanup/SKILL.md"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "root temporary residue 分類を確認"
- ac: AC7
command: "rg -n \"REPO_TEMP_FOLDER_ADVICE_V1\" .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "Claude / Codex parity tests を確認"
- ac: AC8
command: "rg -n \"repo-approved local temporary workspace\" .gitignore"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: ".claude/tmp/ の扱いを確認" |
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "0b33877d7c2d0292f4437b97c07bd7af33f82bb9"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
changed_files_source: git_diff_name_status_find_renames_z
changed_files:
- .claude/hooks/root_temporary_residue_advisory.sh
- .claude/hooks/tests/test_root_temporary_residue_advisory.py
- .claude/settings.json
- .claude/skills/post-merge-cleanup/SKILL.md
- .codex/hooks.json
- .codex/hooks/root_temporary_residue_advisory.sh
- .github/ci/python-test-plan.json
- .gitignore
- AGENTS.md
- docs/dev/agent-skill-boundaries.md
- docs/dev/hook-boundaries.md
- docs/dev/repository-folder-policy.md
- schemas/repo_temp_folder_advice_v1.schema.json
- scripts/agent-guards/root_temporary_residue_policy.py
- scripts/agent-guards/tests/test_root_temporary_residue_policy.py
- scripts/check-codex-agents.mjs
- scripts/check_codex_agent_config.py
- scripts/check_hook_boundaries.py
- scripts/session-recording/validate-codex-hooks.mjs
- tests/codex/test_root_temporary_residue_advisory.py
allowed_paths_gate_source: review_subagent
判定: REQUEST_CHANGESPRの方向性は妥当です。特に、既存の 1. |
| 入力 | 現在の結果 | 正しい結果 |
|---|---|---|
| cwd=/repo/src, mkdir .tmp | root aliasとして警告 | src/.tmpなので対象外 |
| cwd=/repo/src, mkdir ../.tmp | 無出力 | /repo/.tmpなので警告 |
| mkdir /repo/.tmp | 無出力 | 警告 |
| mkdir "$PWD/.tmp" | 無出力 | cwd=/repoなら警告 |
| mkdir "$(git rev-parse --show-toplevel)/.tmp" | 無出力 | 警告 |
| printf x >./.tmp/out | 無出力 | 警告 |
| mkdir foo/../.tmp | 無出力 | 警告 |
評価できる点
blocker hookとadvisory hookの責務分離は正しい。
additionalContextによる非ブロッキング案内はClaude/Codex双方の公式仕様に合っている。wrapperのfail-openとraw command非出力方針は妥当。
current Pages pipelineは
dist/だけを配布しており、root.tmp/の直接配布は確認されない。Codex hook topology validatorとpython test planを同期した点は、設定drift防止として有効です。し、PRコメントにあるpreview成功やTEST_VERDICTは、相対パスfixtureとpresence checkを中心とした証跡です。公式wire contract、
cwd、path resolution、ownership marker、ignored path、配布境界の反例を検証していません。 最終判断
現時点ではmerge不可です。
特に次の4点はapproval blockerです。
Claudeの絶対
file_pathを破棄している。cwdを無視し、repo root判定が成立していない。.gitignoreのtmp/がroot限定ではなく、folder policy SSOTと不整合。deterministic cleanup/ownership markerが手順書にしか存在しない。
これらを修正せずにmergeすると、#1404は「再発防止を実装した」のではなく、誤検知と見逃しを含むadvisoryを追加し、未実装のcleanup保証をドキュメントで宣言した状態になります。
## 判定: **REQUEST_CHANGES**PRの方向性は妥当です。特に、既存のlocal_main_branch_guardへdeny処理を混在させず、exit 0とhookSpecificOutput.ad:contentReference[oaicite:0]{index=0}iCodeとCodexの両方が、この形式でモデルへ非ブロッキングの文脈を追加できます。:contentReference[oaicite:3]{index=3}し現状は、**「hookが登録されている」ことは検証できても、「実際のhook入力でrepo rootのtemporary aliasを正しく検出する」「cleanupをdeterministicに分類する」ことは保証できていません**。#1404は#1395/PR #1399後に残った.tmp/` residueの再発防止を目的とし、現行契約ではnon-blocking advisoryだけでなくownership markerに基づくcleanup境界までOutcomeに含めています。headのCIは成功していますが、テストfixture自体が公式の実入力契約とずれているため、green CIは以下の問題を検出できません。-
1. [P1 / BLOCKER] ClaudeのWrite / Editでは通常advisoryが発火しない
対象: scripts/agent-guards/root_temporary_residue_policy.py:32-41
実装は先頭が/の候補を即座にNoneとして破棄しています。
if not candidate or candidate.startswith("/"):
return None一方、Claude Codeの公式hook仕様では、Write.tool_input.file_pathとEdit.tool_input.file_pathは絶対パスです。したがって、通常のClaude入力である次のpayloadは無出力になります。
{
"cwd": "/repo",
"tool_name": "Write",
"tool_input": {
"file_path": "/repo/.tmp/output.json"
}
}これは例外的ケースではなく、公式wire contractそのものとの不整合です。([Claude Platform Docs]1)aude側テストは、.tmp/result.jsonのような相対パスを人工的に渡しているため、この不具合を隠しています。# 必須修正
wrapperが既に把握しているrepo rootをproducerへ明示的に渡し、payloadのcwdと合わせて絶対正規化してください。
def repo_relative_path(
raw_path: str,
*,
cwd: Path,
repo_root: Path,
) -> Path | None:
candidate = Path(raw_path)
absolute = candidate if candidate.is_absolute() else cwd / candidate
resolved_root = repo_root.resolve(strict=True)
resolved_candidate = absolute.resolve(strict=False)
try:
return resolved_candidate.relative_to(resolved_root)
except ValueError:
return NonePath.resolve()は..とsymlinkを解決するため、現在の文字列先頭判定より適切です。([Python documentation]2)-
2. [P1 / BLOCKER] 「repo root」の判定がcwdを無視した字句判定になっている
現在の実装は、shlex.split()した各tokenの最初のsegmentだけを見ています。payloadのcwdも、wrapperが解決済みのrepo rootも使っていません。ため、ソース分岐上、次の誤判定が発生します。
| 入力 | 現在の結果 | 正しい結果 |
|---|---|---|
cwd=/repo/src, mkdir .tmp |
root aliasとして警告 | src/.tmpなので対象外 |
cwd=/repo/src, mkdir ../.tmp |
無出力 | /repo/.tmpなので警告 |
mkdir /repo/.tmp |
無出力 | 警告 |
mkdir "$PWD/.tmp" |
無出力 | cwd=/repoなら警告 |
mkdir "$(git rev-parse --show-toplevel)/.tmp" |
無出力 | 警告 |
printf x >./.tmp/out |
無出力 | 警告 |
mkdir foo/../.tmp |
無出力 | 警告 |
ClaudeとCodexのhook入力はいずれもcwdを提供します。Codexはsessionがsubdirectoryから開始される可能性も公式に明記しています。([Claude Platform Docs]1)に、このリポジトリ自身がIssue #1236で、path containmentにはrealpath/commonpath系の実体パス比較を使い、..、symlink、絶対パス混在を文字列prefix判定で処理しないという先例を定義しています。今回の実装はその設計原則に逆行しています。# 必須修正
file_pathやapply_patchの明示パスはrepo_root + cwd + resolve()で確定的に判定してください。
Bashについては、任意のshell展開をPreToolUseで完全に解釈することはできません。高品質な実装は次の二層構成です。
- PreToolUseでは単純かつ確実な作成・出力ケースだけをbest-effortで案内する。
- PostToolUseまたはStopでrepo root直下を実際にscanし、
.tmp、.temp、.tmp-*が生成された事実を検出する。
advisory-onlyである以上、実行後の実体検査を追加しても安全性要件とは衝突しません。
3. [P1 / BLOCKER] tmp/のSSOT宣言と.gitignoreの実際の意味が一致していない
新しいfolder policyはtmp/をrepo-approved temporary workspaceとして定義し、repo直下のフォルダ運用の正本だとしています。し.gitignoreには、root anchorのない次のpatternが残っています。
tmp/今回のPRはこのpatternに「repo-approved」というコメントを付けていますが、Git公式仕様上、tmp/はrepo直下だけではなく、任意階層のtmpディレクトリに一致します。root限定にするには/tmp/が必要です。(Git)
つまり現在は、少なくとも次もGitから隠れます。
src/tmp/
docs/tmp/
public/tmp/
これはAC4/AC8の「folder policyと.gitignoreを一致させる」を満たしていません。
配布面への影響
現行Pages workflowが実際に配布するのはdist/だけであり、repo rootの.tmp/がそのまま公開される経路は確認できません。mainではdist/をrsyncし、PR previewでもpublish_dir: ./distを使用しています。、Viteはpublic/以下をdist/へそのままコピーします。このため、unanchoredなtmp/によってGitから不可視になったpublic/tmp/がbuild前に生成されれば、ignored local temporary contentがdistへ混入する潜在経路になります。現在のCIで実際に発生している証拠はありませんが、publication_rule: never_publishは現状ドキュメント宣言だけです。([vitejs]4)# 必須修正
- tmp/
+ /tmp/併せてfixture repositoryで以下を固定してください。
git check-ignore -q tmp/file # ignored
! git check-ignore -q src/tmp/file # not ignored
git check-ignore -q .claude/tmp/file # ignored
! git check-ignore -q .tmp/file # not ignored加えて、build後に少なくともtemporary root名を検査するartifact guardを置くべきです。
4. [P1 / BLOCKER] cleanupのdeterministic classificationとownership markerは実装されていない
Issue #1404のOutcomeは、post-merge-cleanupがroot residueをdeterministicに分類し、所有markerが一致するsession subdirectoryだけを削除可能にすることを要求しています。はTEMP_CLEANUP_SAFETY_RULES_V1を手順書へ追加していますが、実行コードは更新していません。手順書はPath.resolve()、git ls-files、ownership markerを要求しています。ろが実際のclassify-git-state.pyは、以下を収集するだけです。
git status --shortgit stash listgit branch -vvgit worktree list --porcelain
root temporary residueの種類、ownership marker、symlink、tracked/ignored状態、削除可能性を判定するコードはありません。契約にもtemporary_residues、ownership_status、cleanup_actionなどの専用fieldはなく、汎用のunresolved_cleanup_itemsしかありません。にgit status --shortはignored fileを表示しません。tmp/と.claude/tmp/はignoreされているため、終了時削除または報告というfolder policyをこのclassifierでは検証できません。ignored fileを表示するには明示的に--ignoredが必要です。([Git]5)# 必須修正
次のどちらかが必要です。
A. 契約どおり実装する
read-only classifierを追加し、最低限次を構造化出力します。
TEMP_RESIDUE_CLASSIFICATION_V1:
path: ".tmp-agent/"
folder_class: root_temporary_alias
file_type: directory | symlink | other
tracked: false
ignored: false
ownership_marker:
status: valid | missing | malformed | mismatch
session_id: "..."
action: delete_owned_subdirectory | report_only | approved_residue
reason_code: "..."削除executorでは次を必須とします。
- root自体は絶対に削除しない
lstatでsymlinkを拒否する- 実行直前に
resolve()とcontainmentを再検証する - markerのschema、配置場所、session ID、対象relative pathを固定する
- marker mismatch/tracked file混在時はfail-closed
- path文字列を組み立ててbare
rm -rfしない
B. PRとIssueの主張を縮小する
このPRを「advisoryとpolicy documentationのみ」に限定し、deterministic cleanup/ownership markerは未制御としてSafety Claim Matrixへ明記し、follow-up Issueへ分離します。
現状の「Implemented: yes / Not controlled: none」は成立しません。
5. [P2] Codex parity testに存在しないwire formatが混入している
Codex公式仕様では、file editのcanonical tool nameはapply_patchであり、Edit/Writeはmatcher aliasにすぎません。hook入力自体はtool_name: "apply_patch"、内容はtool_input.commandで渡されます。([OpenAI Developers]6)にはcanonicalなapply_patchテストもありますが、同時に次の架空payloadをCodex parity evidenceとして使用しています。
{
"tool_name": "Write",
"tool_input": {
"file_path": ".tmp/out.json"
}
}テストは共有producerのunit testとしては使えますが、Codex runtime parityの証拠にはなりません。
またCodex公式仕様は、PreToolUse/PostToolUseによるshell interceptionが完全なenforcement boundaryではなく、simple shell以外や別tool pathを取りこぼすと明記しています。Safety Claim MatrixのNot controlled: noneは修正が必要です。([OpenAI Developers]6)限、未制御面として以下を明示してください。
- 非simple shell/
unified_exec側の未捕捉経路 - dynamic shell expansion
- Bash以外の同等書込みtool
- pre-existing residue
- session
cwdとsymlink ambiguity
6. [P2] 「作成しようとした」ではなく「文字列が現れた」だけで警告する
現在の_match_command()はshell commandの全tokenを走査し、見つからなければraw regexを適用します。操作verbやredirectの意味は判定していません。がって、次のような作成を伴わない操作でも同じreplacement advisoryが出ます。
cat .tmp/report.json
ls .tmp
grep foo .tmp/log
rm -rf .tmp特にrm -rf .tmpはcleanup操作なのに、「tmp/へ移行してください」という逆方向の案内になります。
次の分類が必要です。
create_or_writeread_or_inspectcleanup_or_deleteunknown_reference
少なくともrm、rmdir、読み取り専用commandにはreplacement messageを返さないでください。任意shell構文を正確に解析しない方針なら、PreToolUseは確実な作成commandだけに絞り、実体検査をPostToolUseへ寄せる方が堅牢です。
7. [P2] .tmp-*のsuffixをそのままadditionalContextへ反映している
_match_observed_path()は最初のsegment全体をobserved_pathとして返します。
return RootTemporaryResidueMatch(
observed_path=f"{first_segment}/"
)そのため、例えば.tmp-secret-value/のような名前が入力されると、suffixをそのままmodel-visible contextへ載せます。、hook boundaryにはno_raw_secret_like_value: trueが宣言されています。bserved_path`は次のように正規化すべきです。
observed_alias_kind: ".tmp-*"
observed_path_redacted: ".tmp-*/"診断上suffixが必要なら、長さ制限付きの非可逆digestにしてください。
8. [P2] JSON Schemaが実行可能な契約になっていない
追加されたJSON SchemaはadditionalProperties: falseやconstを使った厳密な定義になっています。しproducer/hook testsはfieldを個別にassertしているだけで、実際に生成したpayloadをこのschemaへ通していません。状態では、例えばproducerに余分なfieldが追加されても、必須fieldの型が変わっても、manual assertion対象外ならschema driftを検出できません。
最低限、次をCIへ追加してください。
schema = json.loads(SCHEMA_PATH.read_text())
Draft202012Validator.check_schema(schema)
advice = build_temp_folder_advice(realistic_payload)
Draft202012Validator(schema).validate(advice)併せて、activeなschema governance SSOTへ新schemaを登録してください。現行governanceは、新規schema追加をschema_changeとして扱い、consumer inventoryを要求しています。-
9. [P3] no-match fast pathの実測値がない
ClaudeのPreToolUseはagent loop内の各tool callで発火します。また公式仕様は、handler-levelのifを使えば条件不一致時にprocess spawn自体を回避できると説明しています。([Claude Platform Docs]1)のhookは、各Bash|Write|Edit|MultiEditでshell wrapperとPython interpreterを起動します。PR本文のperformance decisionではbaselineが利用不可、run countが0のままです。に性能障害だとは断定できませんが、以下は測定すべきです。
- no-match 1,000回のp50/p95
- ClaudeとCodexそれぞれのprocess spawn数
- 既存hook chain全体の累積latency
- handler-level
ifまたは既存composite統合後との差
承認前に必要な最小regression matrix
| ケース | 期待結果 |
|---|---|
Claude Write /repo/.tmp/a、cwd=/repo |
advisory |
Claude Write /repo/src/.tmp/a |
silent |
Claude Write /outside/.tmp/a |
silent |
Bash cwd=/repo/src, mkdir ../.tmp |
advisory |
Bash cwd=/repo/src, mkdir .tmp |
silent |
Bash rm -rf .tmp |
replacement advisoryを出さない |
Codex canonical apply_patchで.tmp/a追加 |
advisory |
git check-ignore src/tmp/a |
not ignored |
| producer出力 | JSON Schema validation pass |
.tmpがsymlink |
report-only、削除不可 |
| marker不一致 | report-only、削除不可 |
| malformed JSON/Python欠落 | exit 0、stdout silent |
評価できる点
- blocker hookとadvisory hookの責務分離は正しい。
additionalContextによる非ブロッキング案内はClaude/Codex双方の公式仕様に合っている。- wrapperのfail-openとraw command非出力方針は妥当。
- current Pages pipelineは
dist/だけを配布しており、root.tmp/の直接配布は確認されない。 - Codex hook topology validatorとpython test planを同期した点は、設定drift防止として有効です。し、PRコメントにあるpreview成功やTEST_VERDICTは、相対パスfixtureとpresence checkを中心とした証跡です。公式wire contract、
cwd、path resolution、ownership marker、ignored path、配布境界の反例を検証していません。 最終判断
現時点ではmerge不可です。
特に次の4点はapproval blockerです。
- Claudeの絶対
file_pathを破棄している。 cwdを無視し、repo root判定が成立していない。.gitignoreのtmp/がroot限定ではなく、folder policy SSOTと不整合。- deterministic cleanup/ownership markerが手順書にしか存在しない。
これらを修正せずにmergeすると、#1404は「再発防止を実装した」のではなく、誤検知と見逃しを含むadvisoryを追加し、未実装のcleanup保証をドキュメントで宣言した状態になります。
TEST_VERDICT_MACHINE v1TEST_VERDICT_MACHINE:
schema: TEST_VERDICT_MACHINE_V1
status: PASS
issue_number: 1404
pr_number: 1407
pr_url: "https://github.com/squne121/loop-protocol/pull/1407"
issue_url: "https://github.com/squne121/loop-protocol/issues/1404"
contract_snapshot_url: "https://github.com/squne121/loop-protocol/issues/1404#issuecomment-4934832124"
owner_request_changes_url: "https://github.com/squne121/loop-protocol/pull/1407#issuecomment-4934714794"
head_sha_expected: "478e564fc5225d15f43af3d727d3d9c82f32c898"
head_sha_observed: "478e564fc5225d15f43af3d727d3d9c82f32c898"
head_sha_match: true
verification_commands_pass: 8
verification_commands_fail: 0
verification_commands_skip: 0
ci_required_status: passed
ci_required_checks:
- "ci / typecheck"
- "ci / build"
- "ci / python-test"
- "agent-session-manifest / validate-generated-artifact"
- "ci / test"
- "ci / lint"
command_results:
- id: 1
command: 'rg -n "root_temporary_residue_advisory" .claude/settings.json .codex/hooks.json'
status: PASS
- id: 2
command: 'rg -n "approved_replacement" scripts/agent-guards/root_temporary_residue_policy.py schemas/repo_temp_folder_advice_v1.schema.json'
status: PASS
- id: 3
command: 'rg -n "classification: blocker" docs/dev/hook-boundaries.md'
status: PASS
- id: 4
command: 'rg -n "REPOSITORY_FOLDER_POLICY_V1" .gitignore'
status: PASS
- id: 5
command: 'rg -n "TEMP_CLEANUP_SAFETY_RULES_V1" .claude/skills/post-merge-cleanup/SKILL.md'
status: PASS
- id: 6
command: 'rg -n "root temporary residue" .claude/skills/post-merge-cleanup/SKILL.md'
status: PASS
- id: 7
command: 'rg -n "REPO_TEMP_FOLDER_ADVICE_V1" .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py'
status: PASS
- id: 8
command: 'rg -n "repo-approved local temporary workspace" .gitignore'
status: PASS
produced_by: impl-review-loop orchestrator using test-runner result
notes:
- "test-runner SubAgent の検証結果を転記"
- "worktree head は PR current head と一致" |
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN
Evidence Check
- TEST_VERDICT_MACHINE: head
478e564fc5225d15f43af3d727d3d9c82f32c898で PASS、verification skip/fallback なし - CI_CHECK_RUN_SCOPED:
ci_verdict_summary.pyで current head の required checks all_pass を確認 - Allowed Paths: fresh contract snapshot
issuecomment-4934832124とallowed_paths_review_gate.pyの再計算でstatus: ok - Schema Consumer Inventory:
schema_change宣言と consumer inventory が PR body に存在し、変更ファイルと整合 - Safety Claim Matrix: cleanup classifier 未実装は #1417、schema catalog registration は #1418 として
Not controlled/ follow-up が明記され、current diff と整合
Blockers
- なし
Non-blockers
- Draft PR だが mergeability / evidence / contract gates は merge-ready 条件を満たす
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "478e564fc5225d15f43af3d727d3d9c82f32c898"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
changed_files_source: git_diff_name_status_find_renames_z
changed_files:
- .claude/hooks/root_temporary_residue_advisory.sh
- .claude/hooks/tests/test_root_temporary_residue_advisory.py
- .claude/settings.json
- .claude/skills/post-merge-cleanup/SKILL.md
- .codex/hooks.json
- .codex/hooks/root_temporary_residue_advisory.sh
- .github/ci/python-test-plan.json
- .gitignore
- AGENTS.md
- docs/dev/agent-skill-boundaries.md
- docs/dev/hook-boundaries.md
- docs/dev/repository-folder-policy.md
- schemas/repo_temp_folder_advice_v1.schema.json
- scripts/agent-guards/root_temporary_residue_policy.py
- scripts/agent-guards/tests/test_root_temporary_residue_policy.py
- scripts/check-codex-agents.mjs
- scripts/check_codex_agent_config.py
- scripts/check_hook_boundaries.py
- scripts/session-recording/validate-codex-hooks.mjs
- tests/codex/test_root_temporary_residue_advisory.py
allowed_paths_gate_source: review_subagent
Summary
.tmp//.temp//.tmp-*を検出する非ブロッキング hook を Claude / Codex 両方へ追加し、REPO_TEMP_FOLDER_ADVICE_V1をhookSpecificOutput.additionalContextで返すようにしたcwd/ repo root を使った path resolution、Claude absolutefile_path、Codex canonicalapply_patch、read/delete command 抑制、.tmp-*suffix redaction、JSON Schema validation を追加したdocs/dev/repository-folder-policy.md、.gitignore、post-merge-cleanupskill、boundary docs を更新し、許可済み temporary workspace と report-only cleanup boundary を正本化した受け入れ条件の達成状況
root_temporary_residue_advisoryを Claude / Codex の PreToolUse hook に登録し、tests で exit code 0 / advisory-only を確認したscripts/agent-guards/root_temporary_residue_policy.pyとschemas/repo_temp_folder_advice_v1.schema.jsonにapproved_replacement: "tmp/"、approved_temporary_roots、cleanup_required: true、policy_docを実装したdocs/dev/hook-boundaries.mdにlocal_main_branch_guardのclassification: blocker維持を明記し、deny logic を混在させていないdocs/dev/repository-folder-policy.mdでtmp/、.claude/tmp/、.claude/worktrees/、.tmp/、.temp/、.tmp-*/の folder class / cleanup authority / publication rule を定義したTEMP_CLEANUP_SAFETY_RULES_V1をpost-merge-cleanupskill に追加し、approved root 全体削除を自動実行対象から外し、ownership marker に基づく deterministic cleanup classifier は 実装: root temporary residue cleanup classifier を構造化する #1417 に分離したpost-merge-cleanupskill に root temporary residue の report-only 分類を追加し、marker 不明の.tmp/**を自動削除しない境界を明記した.claude/hooks/tests/test_root_temporary_residue_advisory.pyとtests/codex/test_root_temporary_residue_advisory.pyで advisory-only / additionalContext / no-match silent behavior を検証し、scripts/check_hook_boundaries.pyと Codex hook validator 群の frozen PreToolUse topology に新 hook を反映した.gitignore、AGENTS.md、folder policy doc を更新し、.claude/tmp/を repo-approved local temporary workspace として明記したChecks
uv run --locked pytest scripts/agent-guards/tests/test_root_temporary_residue_policy.py .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py: PASS(22件成功)python3 -m py_compile scripts/agent-guards/root_temporary_residue_policy.py scripts/agent-guards/tests/test_root_temporary_residue_policy.py .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py: PASSuv run --locked pytest scripts/agent-guards/tests/test_local_main_branch_guard.py::TestAC7HookBoundariesManifest::test_check_hook_boundaries_passes scripts/agent-guards/tests/test_pretool_fastpath_classifier.py::TestMajorCodexHooksTopologyCheck::test_current_topology_matches_frozen_expectation: PASSuv run --locked pytest tests/codex/test_codex_hook_surface_guard.py::test_hooks_json_extra_handler_field_rejected_by_hooks_validator tests/test_codex_agent_bridge_contract.py::test_python_cli_passes_on_fixture_repo tests/test_codex_agent_bridge_contract.py::test_js_cli_passes_on_fixture_repo: PASSuv run --locked python3 scripts/check_hook_boundaries.py: PASSuv run --locked python3 scripts/ci/python_test_plan.py --emit scope-argv --format json: PASSpython3 -m py_compile scripts/agent-guards/root_temporary_residue_policy.py scripts/agent-guards/tests/test_root_temporary_residue_policy.py .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py: PASSuv run --locked pytest scripts/agent-guards/tests/test_root_temporary_residue_policy.py .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py: PASS(33件成功)rg -n "root_temporary_residue_advisory" .claude/settings.json .codex/hooks.json: PASSrg -n "approved_replacement" scripts/agent-guards/root_temporary_residue_policy.py schemas/repo_temp_folder_advice_v1.schema.json: PASSrg -n "classification: blocker" docs/dev/hook-boundaries.md: PASSrg -n "REPOSITORY_FOLDER_POLICY_V1" .gitignore: PASSrg -n "TEMP_CLEANUP_SAFETY_RULES_V1" .claude/skills/post-merge-cleanup/SKILL.md: PASSrg -n "root temporary residue" .claude/skills/post-merge-cleanup/SKILL.md: PASSrg -n "REPO_TEMP_FOLDER_ADVICE_V1" .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py: PASSrg -n "repo-approved local temporary workspace" .gitignore: PASS検証コマンド結果
rg -n "root_temporary_residue_advisory" .claude/settings.json .codex/hooks.json: PASSrg -n "approved_replacement" scripts/agent-guards/root_temporary_residue_policy.py schemas/repo_temp_folder_advice_v1.schema.json: PASSrg -n "classification: blocker" docs/dev/hook-boundaries.md: PASSrg -n "REPOSITORY_FOLDER_POLICY_V1" .gitignore: PASSrg -n "TEMP_CLEANUP_SAFETY_RULES_V1" .claude/skills/post-merge-cleanup/SKILL.md: PASSrg -n "root temporary residue" .claude/skills/post-merge-cleanup/SKILL.md: PASSrg -n "REPO_TEMP_FOLDER_ADVICE_V1" .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py: PASSrg -n "repo-approved local temporary workspace" .gitignore: PASSuv run --locked pytest scripts/agent-guards/tests/test_root_temporary_residue_policy.py .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py: PASSuv run --locked pytest scripts/agent-guards/tests/test_local_main_branch_guard.py::TestAC7HookBoundariesManifest::test_check_hook_boundaries_passes scripts/agent-guards/tests/test_pretool_fastpath_classifier.py::TestMajorCodexHooksTopologyCheck::test_current_topology_matches_frozen_expectation: PASSuv run --locked pytest tests/codex/test_codex_hook_surface_guard.py::test_hooks_json_extra_handler_field_rejected_by_hooks_validator tests/test_codex_agent_bridge_contract.py::test_python_cli_passes_on_fixture_repo tests/test_codex_agent_bridge_contract.py::test_js_cli_passes_on_fixture_repo: PASSuv run --locked pytest scripts/agent-guards/tests/test_root_temporary_residue_policy.py .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py: PASS(33件成功)python3 -m py_compile ...: PASSuv run --locked python3 scripts/check_hook_boundaries.py: PASSuv run --locked python3 scripts/ci/python_test_plan.py --emit scope-argv --format json: PASSSchema Change Applicability
schemas/repo_temp_folder_advice_v1.schema.jsonを新規追加し、hook producer / tests / docs / hook topology validators / python-test plan がそれを前提に更新されたSchema Consumer Inventory
変更対象 schema:
repo_temp_folder_advice/v1before/after 差分:
Consumer 更新状況:
repo_temp_folder_advice/v1schemas/repo_temp_folder_advice_v1.schema.json,scripts/agent-guards/root_temporary_residue_policy.py,.claude/hooks/root_temporary_residue_advisory.sh,.codex/hooks/root_temporary_residue_advisory.sh,.claude/hooks/tests/test_root_temporary_residue_advisory.py,tests/codex/test_root_temporary_residue_advisory.py,.claude/settings.json,.codex/hooks.json,scripts/check_hook_boundaries.py,scripts/check-codex-agents.mjs,scripts/check_codex_agent_config.py,scripts/session-recording/validate-codex-hooks.mjs,.github/ci/python-test-plan.json,docs/dev/hook-boundaries.md,docs/dev/repository-folder-policy.md,.claude/skills/post-merge-cleanup/SKILL.md,docs/dev/agent-skill-boundaries.md,.gitignore,AGENTS.mdroot_temp_folder_advice_schema,root_temp_folder_policy_producer,root_temp_folder_advisory_claude_hook,root_temp_folder_advisory_codex_hook,codex_hook_topology_validators,python_test_plan,root_temp_folder_policy_docsSafety Claim Matrix
block: falseschema invariantdocs/dev/repository-folder-policy.md、.gitignore、TEMP_CLEANUP_SAFETY_RULES_V1、report-only wordingdocs/dev/hook-boundaries.mdのclassification: blockerと deny 非混在の記述scripts/check_hook_boundaries.py、Codex hook validator 群、focused topology testsrepo_temp_folder_advice/v1schema は producer/tests と同期しているAllowed Paths 遵守
scripts/check_hook_boundaries.pyは契約更新後の freshCONTRACT_REVIEW_RESULT_V1 status: goに基づいて変更したscripts/check-codex-agents.mjs、scripts/check_codex_agent_config.py、scripts/session-recording/validate-codex-hooks.mjs、.github/ci/python-test-plan.jsonは CI failure 後の契約更新と freshCONTRACT_REVIEW_RESULT_V1 status: goに基づいて変更したCONTRACT_REVIEW_RESULT_V1 status: go実装: agent の root temporary residue を hook と docs で防止する #1404 (comment) に基づいているtmp/pr1407_body_updated.mdとtmp/pr1407_changed_paths.txtのみを repo-approved temporary workspace に作成したCI_TEST_PERFORMANCE_DECISION_V1
Notes