Repository navigation
feat: runtime policy-domain を adapter から分離する - #1672
Merged
Merged
Conversation
Contributor
Preview URLPreview removed (PR #1672 closed). |
squne121
commented
Jul 22, 2026
squne121
left a comment
Owner
Author
There was a problem hiding this comment.
最終レビュー結果
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: "7af1714ba8540b3bd92133294b39993387803ce9"
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: github_pull_request_files_api_with_previous_filenamecurrent head の CI は全成功であり、Issue #1670 の fresh contract snapshot、Allowed Paths、
AC5 の adapter-level parity、未解決 review thread 0 を確認しました。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
この変更は runtime transport と policy evaluation の責務を分離します。
apply_patchの raw payload 解釈を adapter に閉じ、共有 policy-domain を追加しました。WORKTREE_MUTATION_INTENT_V1、WORKTREE_SCOPE_BINDING_V1、WORKTREE_POLICY_DECISION_V1を閉じた入力として検証し、unknown/ambiguous/resolution_failed を fail-closed にします。apply_patchは allow として明示しました。Checks
以下は実装 head に対して実行した検証結果です。
uv run --locked pytest tests/agent_guards/test_worktree_policy_domain.py -q: 15 passed(契約検証は成功)uv run --locked pytest tests/agent_guards/test_codex_apply_patch_adapter.py -q: 21 passed(Codex adapter は成功)uv run --locked pytest tests/agent_guards/test_worktree_scope_guard.py -q: 234 passed(Claude guard は成功)uv run --locked pytest tests/agent_guards -q: 282 passed(対象回帰試験は成功)ruff、py_compile、git diff --check: pass(静的検査は成功)AC Status(受け入れ条件の状態)
各受け入れ条件は対応する domain と adapter のテストで確認しました。
test_worktree_policy_domain.pyの closed contract 検証で pass。test_worktree_policy_domain.pyの adapter capture corpus(bound 内側/外側)で、Claude/Codex の decision と reason_code の一致を確認。Allowed Paths Compliance(許可パス適合)
変更範囲は Issue contract の許可されたファイルに限定しています。
Runtime Verification Evidence(実行時検証証跡)
証跡は secret-free のサニタイズ済み capture に限定し、未検証範囲を成功扱いしません。
96095c50a577ee07ebaf423c64fc0b35863fd8e9(実装開始時点の main)7af1714ba8540b3bd92133294b39993387803ce9(この変更の current head).claude/artifacts/issue-refinement-loop/1663/runtime-evidence/claude-write-wire.json、schemaSANITIZED_RUNTIME_WIRE_CAPTURE_V1、sanitized digestsha256:7a6792dfc33b57b2b347bee70db61e54ba37ce0b263b6e79cb1466a4a67df6e0。.claude/artifacts/issue-refinement-loop/1663/runtime-evidence/codex-apply-patch-wire.json、schemaSANITIZED_RUNTIME_WIRE_CAPTURE_V1、sanitized digestsha256:c9de2e1296733b5600d5ef9cc9c2b56d51aafae15bc51d63d295c3155f02263c。tests/agent_guardsで実行し、official capture の再取得は行っていません。未捕捉 channel の runtime parity は主張しません。Schema Change Applicability
この判断は共有 policy-domain の入出力 contract を新設するためです。
Schema Consumer Inventory
利用側一覧を日本語で補足します。
利用側を列挙し、raw vendor DTO を共有 policy に渡さない境界を確認します。
変更前(Before)
変更後(After)
scripts/agent-guards/worktree_scope_guard.pyscripts/agent-guards/codex_apply_patch_adapter.pytests/agent_guards/test_worktree_policy_domain.pySafety Claim Matrix
安全性主張一覧を日本語で補足します。
安全性に関する主張と、実装外に残る統制を分離して記録します。
CI Test Performance Decision(CI性能判断)
今回の変更は CI の選択規則や実行時間最適化を変更しません。
Notes
関連 Issue と parser boundary を明示します。