Skip to content

feat: add root temporary residue advisory (#1404) - #1407

Merged
squne121 merged 8 commits into
mainfrom
worktree-issue-1404-agent-root-temporary-residue-hook-docs
Jul 10, 2026
Merged

squne121 merged 8 commits into
mainfrom
worktree-issue-1404-agent-root-temporary-residue-hook-docs

Conversation

@squne121

@squne121 squne121 commented Jul 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • repo root の .tmp/ / .temp/ / .tmp-* を検出する非ブロッキング hook を Claude / Codex 両方へ追加し、REPO_TEMP_FOLDER_ADVICE_V1 を hookSpecificOutput.additionalContext で返すようにした
  • cwd / repo root を使った path resolution、Claude absolute file_path、Codex canonical apply_patch、read/delete command 抑制、.tmp-* suffix redaction、JSON Schema validation を追加した
  • docs/dev/repository-folder-policy.md、.gitignore、post-merge-cleanup skill、boundary docs を更新し、許可済み temporary workspace と report-only cleanup boundary を正本化した
  • root temporary residue 向け producer、schema、parity tests、Codex hook topology validators、python-test plan を追加更新して advisory payload と fail-open 動作を固定した

受け入れ条件の達成状況

  • AC1: root_temporary_residue_advisory を Claude / Codex の PreToolUse hook に登録し、tests で exit code 0 / advisory-only を確認した
  • AC2: 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 を実装した
  • AC3: docs/dev/hook-boundaries.md に local_main_branch_guard の classification: blocker 維持を明記し、deny logic を混在させていない
  • AC4: docs/dev/repository-folder-policy.md で tmp/、.claude/tmp/、.claude/worktrees/、.tmp/、.temp/、.tmp-*/ の folder class / cleanup authority / publication rule を定義した
  • AC5: TEMP_CLEANUP_SAFETY_RULES_V1 を post-merge-cleanup skill に追加し、approved root 全体削除を自動実行対象から外し、ownership marker に基づく deterministic cleanup classifier は 実装: root temporary residue cleanup classifier を構造化する #1417 に分離した
  • AC6: post-merge-cleanup skill に root temporary residue の report-only 分類を追加し、marker 不明の .tmp/** を自動削除しない境界を明記した
  • AC7: .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 を反映した
  • AC8: .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 : PASS
  • 実行コマンド: 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 : PASS
  • 実行コマンド: uv 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 : PASS
  • 実行コマンド: uv run --locked python3 scripts/check_hook_boundaries.py : PASS
  • 実行コマンド: uv run --locked python3 scripts/ci/python_test_plan.py --emit scope-argv --format json : PASS
  • 実行コマンド: 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 : PASS
  • 実行コマンド: 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(33件成功)
  • 実行コマンド: rg -n "root_temporary_residue_advisory" .claude/settings.json .codex/hooks.json : PASS
  • 実行コマンド: rg -n "approved_replacement" scripts/agent-guards/root_temporary_residue_policy.py schemas/repo_temp_folder_advice_v1.schema.json : PASS
  • 実行コマンド: rg -n "classification: blocker" docs/dev/hook-boundaries.md : PASS
  • 実行コマンド: rg -n "REPOSITORY_FOLDER_POLICY_V1" .gitignore : PASS
  • 実行コマンド: rg -n "TEMP_CLEANUP_SAFETY_RULES_V1" .claude/skills/post-merge-cleanup/SKILL.md : PASS
  • 実行コマンド: rg -n "root temporary residue" .claude/skills/post-merge-cleanup/SKILL.md : PASS
  • 実行コマンド: rg -n "REPO_TEMP_FOLDER_ADVICE_V1" .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py : PASS
  • 実行コマンド: rg -n "repo-approved local temporary workspace" .gitignore : PASS

検証コマンド結果

    1. rg -n "root_temporary_residue_advisory" .claude/settings.json .codex/hooks.json : PASS
    1. rg -n "approved_replacement" scripts/agent-guards/root_temporary_residue_policy.py schemas/repo_temp_folder_advice_v1.schema.json : PASS
    1. rg -n "classification: blocker" docs/dev/hook-boundaries.md : PASS
    1. rg -n "REPOSITORY_FOLDER_POLICY_V1" .gitignore : PASS
    1. rg -n "TEMP_CLEANUP_SAFETY_RULES_V1" .claude/skills/post-merge-cleanup/SKILL.md : PASS
    1. rg -n "root temporary residue" .claude/skills/post-merge-cleanup/SKILL.md : PASS
    1. rg -n "REPO_TEMP_FOLDER_ADVICE_V1" .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py : PASS
    1. rg -n "repo-approved local temporary workspace" .gitignore : PASS
  • 追加テスト: 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
  • 追加テスト: 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 : PASS
  • 追加テスト: uv 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 : PASS
  • 追加テスト: 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(33件成功)
  • 補助検証: python3 -m py_compile ... : PASS
  • 補助検証: uv run --locked python3 scripts/check_hook_boundaries.py : PASS
  • 補助検証: uv run --locked python3 scripts/ci/python_test_plan.py --emit scope-argv --format json : PASS

Schema Change Applicability

  • decision: schema_change
  • reason: 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/v1

before/after 差分:

# before
status: schema_absent

# after
added_fields:
  - schema
  - block
  - reason_code
  - observed_path
  - observed_alias_kind
  - approved_replacement
  - approved_temporary_roots
  - cleanup_required
  - policy_doc
  - message_ja
invariants:
  - block is always false
  - approved_replacement is always tmp/
  - policy_doc is always docs/dev/repository-folder-policy.md
  - .tmp-* suffix is redacted as .tmp-*/

Consumer 更新状況:

Schema ID 変更概要 Consumer ファイル 更新有無 備考 PR Declared Consumers
repo_temp_folder_advice/v1 root temporary alias 向け advisory payload を新規追加 schemas/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.md 更新済み producer / hook / topology validators / CI test plan / docs / tests を同時更新 root_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_docs

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
root temporary alias 検出は advisory-only であり tool call を block しない yes dynamic shell expansion / non-simple shell の完全解釈は制御しない Claude/Codex hook tests、absolute path / cwd tests、schema validation、block: false schema invariant #1417 で cleanup 実体分類を補強
approved temporary roots と cleanup-safe boundary は docs / skill で明文化した partial ownership marker に基づく delete-owned-subdirectory classifier は未実装 docs/dev/repository-folder-policy.md、.gitignore、TEMP_CLEANUP_SAFETY_RULES_V1、report-only wording #1417
local main branch blocker の責務は temp-folder advisory と分離したまま維持した yes none docs/dev/hook-boundaries.md の classification: blocker と deny 非混在の記述 N/A
Codex hook topology の frozen expectation は新 hook 登録と同期している yes none scripts/check_hook_boundaries.py、Codex hook validator 群、focused topology tests N/A
repo_temp_folder_advice/v1 schema は producer/tests と同期している partial schema catalog / governance SSOT への登録は本 PR の Allowed Paths 外 producer schema validation tests、Schema Consumer Inventory #1418

Allowed Paths 遵守

  • 変更は Issue 1404 の Allowed Paths に限定した
  • scripts/check_hook_boundaries.py は契約更新後の fresh CONTRACT_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 後の契約更新と fresh CONTRACT_REVIEW_RESULT_V1 status: go に基づいて変更した
  • owner REQUEST_CHANGES 後の path-resolution / claim narrowing は fresh CONTRACT_REVIEW_RESULT_V1 status: go 実装: agent の root temporary residue を hook と docs で防止する #1404 (comment) に基づいている
  • root checkout の既存差分には触れていない
  • 一時ファイルは tmp/pr1407_body_updated.md と tmp/pr1407_changed_paths.txt のみを repo-approved temporary workspace に作成した

CI_TEST_PERFORMANCE_DECISION_V1

CI_TEST_PERFORMANCE_DECISION_V1:
  schema: CI_TEST_PERFORMANCE_DECISION_V1
  issue_number: 1404
  pr_number: 1407
  decision_scope: hook_policy_and_docs
  changed_paths:
    - .claude/settings.json
    - .codex/hooks.json
    - .claude/hooks/root_temporary_residue_advisory.sh
    - .codex/hooks/root_temporary_residue_advisory.sh
    - scripts/agent-guards/root_temporary_residue_policy.py
    - scripts/agent-guards/tests/test_root_temporary_residue_policy.py
    - 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
    - .claude/hooks/tests/test_root_temporary_residue_advisory.py
    - tests/codex/test_root_temporary_residue_advisory.py
    - schemas/repo_temp_folder_advice_v1.schema.json
    - docs/dev/repository-folder-policy.md
    - .claude/skills/post-merge-cleanup/SKILL.md
    - docs/dev/hook-boundaries.md
    - docs/dev/agent-skill-boundaries.md
    - .gitignore
    - AGENTS.md
  lane_classification:
    fast_static:
      applicable: true
      evidence:
        - Codex hook topology expectation を更新した
      required_commands:
        - uv run --locked python3 scripts/check_hook_boundaries.py
        - uv run --locked python3 scripts/ci/python_test_plan.py --emit scope-argv --format json
    python_unit:
      applicable: true
      evidence:
        - scripts/agent-guards/tests と hook/codex tests を追加変更した
        - schemas/** 変更により python_unit applicable
      required_commands:
        - 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
        - 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
        - uv 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
    contract_artifact:
      applicable: true
      evidence:
        - schemas/** と skill/docs/hook policy artifact を変更した
      required_commands:
        - rg -n "root_temporary_residue_advisory" .claude/settings.json .codex/hooks.json
        - rg -n "approved_replacement" scripts/agent-guards/root_temporary_residue_policy.py schemas/repo_temp_folder_advice_v1.schema.json
    integration:
      applicable: false
      evidence:
        - build/deploy/runtime workflow 変更なし
      required_commands: []
  baseline_inputs:
    ci_runtime_baseline_v1_available: false
    run_count: 0
    p50_p95_ready: false
  artifact_consistency:
    ci_test_selection_v1_checked: true
    missing_pytest_args: []
  risk_flags: []
  reviewer_gate:
    approve_allowed: true
    required_evidence:
      - TEST_VERDICT_MACHINE
      - CI_CHECK_RUN_SCOPED
  follow_up_required:
    - "#1417: root temporary residue cleanup classifier / ownership marker"
    - "#1418: repo_temp_folder_advice/v1 schema catalog registration"

Notes

@github-actions

github-actions Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #1407 closed).

@squne121

squne121 commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

TEST_VERDICT_MACHINE:
schema: TEST_VERDICT_MACHINE_V1
status: ok
pr_number: 1407
head_sha: "1621c835425a8957e946ecb97e581e0ee06bf6ad"
verification_commands_pass: 8
verification_commands_fail: 0
skipped_count: 0
notes: []
errors: []
command_results:
- command_id: 1
status: pass
- command_id: 2
status: pass
- command_id: 3
status: pass
- command_id: 4
status: pass
- command_id: 5
status: pass
- command_id: 6
status: pass
- command_id: 7
status: pass
- command_id: 8
status: pass
- command_id: 9
status: pass
focused_pytest:
status: pass
collected: 22
passed: 22

@squne121

squne121 commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

TEST_VERDICT_MACHINE

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

@squne121

squne121 commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

TEST_VERDICT_MACHINE v1

TEST_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

@squne121

squne121 commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

検証結果レポート

Issue #1404 / PR #1407

  • current head: 0b33877d7c2d0292f4437b97c07bd7af33f82bb9
  • mergeable: MERGEABLE
  • merge_state_status: CLEAN
  • GitHub checks: required jobs pass, workflow-skipped jobs are present by design
  • supplemental PR-body verification: 6/6 PASS

Issue contract VC

AC 確認コマンド 実行結果(要約) exit code 判定
AC1 rg -n "root_temporary_residue_advisory" .claude/settings.json .codex/hooks.json advisory hook registration を確認 0 PASS
AC2 rg -n "approved_replacement" scripts/agent-guards/root_temporary_residue_policy.py schemas/repo_temp_folder_advice_v1.schema.json advisory payload schema / producer を確認 0 PASS
AC3 rg -n "classification: blocker" docs/dev/hook-boundaries.md local_main_branch_guard の blocker 維持を確認 0 PASS
AC4 rg -n "REPOSITORY_FOLDER_POLICY_V1" .gitignore repo-approved temporary workspace の明示を確認 0 PASS
AC5 rg -n "TEMP_CLEANUP_SAFETY_RULES_V1" .claude/skills/post-merge-cleanup/SKILL.md cleanup safety rules を確認 0 PASS
AC6 rg -n "root temporary residue" .claude/skills/post-merge-cleanup/SKILL.md root temporary residue 分類を確認 0 PASS
AC7 rg -n "REPO_TEMP_FOLDER_ADVICE_V1" .claude/hooks/tests/test_root_temporary_residue_advisory.py tests/codex/test_root_temporary_residue_advisory.py Claude / Codex parity tests を確認 0 PASS
AC8 rg -n "repo-approved local temporary workspace" .gitignore .claude/tmp/ の扱いを確認 0 PASS

PR body supplemental verification

check 実行結果(要約) exit code 判定
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 22 passed 0 PASS
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 2 passed 0 PASS
uv 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 3 passed 0 PASS
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 compile OK 0 PASS
uv run --locked python3 scripts/check_hook_boundaries.py drift なし 0 PASS
uv run --locked python3 scripts/ci/python_test_plan.py --emit scope-argv --format json plan emit OK 0 PASS
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 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@squne121

Copy link
Copy Markdown
Owner Author

判定: 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)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 None

Path.resolve()は..とsymlinkを解決するため、現在の文字列先頭判定より適切です。(Python documentation)-

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 無出力 警告

評価できる点

  • 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です。

  1. Claudeの絶対file_pathを破棄している。

  2. cwdを無視し、repo root判定が成立していない。

  3. .gitignoreのtmp/がroot限定ではなく、folder policy SSOTと不整合。

  4. 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 None

Path.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で完全に解釈することはできません。高品質な実装は次の二層構成です。

  1. PreToolUseでは単純かつ確実な作成・出力ケースだけをbest-effortで案内する。
  2. 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 --short
  • git stash list
  • git branch -vv
  • git 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_write
  • read_or_inspect
  • cleanup_or_delete
  • unknown_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です。

  1. Claudeの絶対file_pathを破棄している。
  2. cwdを無視し、repo root判定が成立していない。
  3. .gitignoreのtmp/がroot限定ではなく、folder policy SSOTと不整合。
  4. deterministic cleanup/ownership markerが手順書にしか存在しない。

これらを修正せずにmergeすると、#1404は「再発防止を実装した」のではなく、誤検知と見逃しを含むadvisoryを追加し、未実装のcleanup保証をドキュメントで宣言した状態になります。

@squne121

Copy link
Copy Markdown
Owner Author

TEST_VERDICT_MACHINE v1

TEST_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 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@squne121
squne121 marked this pull request as ready for review July 10, 2026 11:44
@squne121
squne121 merged commit 82e0c1b into main Jul 10, 2026
22 checks passed
@squne121
squne121 deleted the worktree-issue-1404-agent-root-temporary-residue-hook-docs branch July 10, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: agent の root temporary residue を hook と docs で防止する

1 participant