Repository navigation
fix: 契約実行ラッパーの unauthorized_write_path 誤検知を修正する - #1349
Conversation
skill_runtime_exec.py の before/after repo-wide snapshot 比較が、 .claude/worktrees/** や他 issue の .claude/artifacts/issue-refinement-loop/<他issue>/** への 並行稼働セッション由来の書き込みを実行コマンド自身の副作用と誤認し、 unauthorized_write_path で誤って fail-close していた問題を修正する。 _snapshot_repo_paths / _find_unauthorized_repo_changes において、 これら volatile な peer-session root を diff 対象から除外することで、 無関係な同時書き込みを誤検知しないようにする。allowed_write_roots 外 への自プロセスの書き込み検出(.cache/outside.txt 等)は従来通り fail-close する。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URLPreview removed (PR #1349 closed). |
TEST_VERDICT:
result: PASS
mergeable: MERGEABLE
merge_state_status: BEHIND
branch_behind_main: true
baseline_only: false
verification_commands_pass: 4
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results: []検証結果レポートIssue #1343: 実装: 契約実行ラッパーの unauthorized_write_path 誤検知を修正する
総合判定
|
squne121
left a comment
There was a problem hiding this comment.
PR Review: #1349 (Closes #1343)
判定根拠
- Linked issue:
Closes #1343(PR本文に明記) - TEST_VERDICT_MACHINE(test-runner, PR #1349コメント済み): AC1〜AC4 全 PASS、
verification_skipped_count=0、mergeable=MERGEABLE、merge_state_status=BEHIND wait_ci_checks.sh --required: build/typecheck/lint/test/python-test/validate-generated-artifact の6 required checks 全 SUCCESSdeploy-prの失敗は GitHub Pages preview の asset liveness check 404 timeout であり、本PRの Allowed Paths(scripts/agent-guards/**のみ)とは無関係。required check 対象外、他PR(#1274)でも同種の散発失敗を確認。regression ではなく infra flake と判断(follow-up として記録、blocker としない)- Allowed Paths gate(review_subagent 独立再計算):
scripts/agent-guards/skill_runtime_exec.py(modified)/scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py(added)の2件のみで Issue #1343 Allowed Paths と完全一致 →status: ok - Safety Claim Matrix: 記載あり。safety-sensitive(fail-closed guard)。Not controlled 行に follow-up #1346 明記済みで bounded
- PR本文 hygiene: required section 見出し(
## 受け入れ条件の達成状況等)が不足 →update_pr_body_hygiene対象 mergeStateStatus: BEHIND+mergeable: MERGEABLE→update_branch対象
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: "a52ea8f6efbf2cbd947b37303dfae2e0008ffeac"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "BEHIND"
blockers: []
required_auto_actions:
- kind: update_branch
executor: implementation-worker
skill: implement-issue.update_branch
blocking_merge_ready: true
mechanical: true
expected_head_sha: "a52ea8f6efbf2cbd947b37303dfae2e0008ffeac"
- kind: update_pr_body_hygiene
executor: implementation-worker
skill: open-pr.update_pr
blocking_merge_ready: true
mechanical: true
auto_fix_applied: []
follow_up_issue_requests:
- summary: "deploy-pr(GitHub Pages preview asset liveness check)が本PRのdiffと無関係に180sタイムアウト404で断続的に失敗する(他PRでも散発観測)。原因調査とflaky対策のfollow-up。"
blocking_merge_ready: false
allowed_paths_gate:
status: ok
changed_files_source: git_diff_name_status_find_renames_z
changed_files:
- scripts/agent-guards/skill_runtime_exec.py
- scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py
changed_file_records:
- path: scripts/agent-guards/skill_runtime_exec.py
status: modified
previous_path: null
source: git_diff_name_status_find_renames_z
provenance_complete: true
- path: scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py
status: added
previous_path: null
source: git_diff_name_status_find_renames_z
provenance_complete: true
audited_paths:
- path: scripts/agent-guards/skill_runtime_exec.py
path_role: filename
source_record_index: 0
- path: scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py
path_role: filename
source_record_index: 1
violations: []
allowed_paths_gate_source: review_subagent
TEST_VERDICT:
result: PASS
mergeable: MERGEABLE
merge_state_status: CLEAN
branch_behind_main: false
baseline_only: false
verification_commands_pass: 4
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results: []検証結果レポート(update_branch 後の再検証, head_sha: f459ce1)Issue #1343: 実装: 契約実行ラッパーの unauthorized_write_path 誤検知を修正する
総合判定
|
squne121
left a comment
There was a problem hiding this comment.
PR Review: #1349 (Closes #1343) — re-review at head f459ce1
すべての findings は独立検証済み(worker 自己申告ではない):
- Linked issue:
Closes #1343が PR 本文に明記 - Head sha 一致:
gh pr view --json headRefOid/git fetch origin pull/1349/headともにf459ce156e442bdbbca81e3407699868d6219936 - Allowed Paths gate(review_subagent 独立再計算):
origin/mainfetch 済み最新tip(72352c84ea963fa911b5dc27145057296c4a8257)とgit merge-base origin/main <head>が完全一致(drift なし)。git diff --name-status -Mで差分はscripts/agent-guards/skill_runtime_exec.py(modified)/scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py(added)の2件のみ。Issue #1343 Allowed Paths と完全一致 →status: ok - PR本文 hygiene:
## 受け入れ条件の達成状況/## 検証コマンド結果/## Allowed Paths 遵守セクション全て存在・記入済み - TEST_VERDICT_MACHINE(head f459ce1, update_branch 後): AC1〜AC4 全 PASS、
verification_skipped_count=0、mergeable=MERGEABLE、merge_state_status=CLEAN - CI:
wait_ci_checks.sh --requiredで6 required checks(build/typecheck/lint/test/python-test/validate-generated-artifact)全 SUCCESS - Safety Claim Matrix: 記載あり。safety-sensitive(fail-closed guard)。follow-up #1346 で bounded
- Schema Change Applicability:
not_schema_change(妥当)
前回要求された required_auto_actions(update_branch, update_pr_body_hygiene)は両方解消済み。blocker なし。
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: "f459ce156e442bdbbca81e3407699868d6219936"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests:
- summary: "deploy-pr(GitHub Pages preview asset liveness check)が本PRのdiffと無関係に断続的に失敗する事象(#1349前回レビューで記録済み)。原因調査とflaky対策のfollow-up。"
blocking_merge_ready: false
allowed_paths_gate:
status: ok
changed_files_source: git_diff_name_status_find_renames_z
changed_files:
- scripts/agent-guards/skill_runtime_exec.py
- scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py
changed_file_records:
- path: scripts/agent-guards/skill_runtime_exec.py
status: modified
previous_path: null
source: git_diff_name_status_find_renames_z
provenance_complete: true
- path: scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py
status: added
previous_path: null
source: git_diff_name_status_find_renames_z
provenance_complete: true
audited_paths:
- path: scripts/agent-guards/skill_runtime_exec.py
path_role: filename
source_record_index: 0
- path: scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py
path_role: filename
source_record_index: 1
violations: []
producer_role: review_subagent
worker_report_used_as_canonical: false
allowed_paths_gate_source: review_subagent
判定REQUEST_CHANGES。 確認範囲確認したのは、PR #1349 の本文・差分・コメント・レビュー、関連Issue #1343 / #1228 / #1236 / #1346 / #1338、リポジトリ内SSOT文書、CI状況、Python / Linux の外部仕様です。PRは open / draft、head は P0: volatile root の blanket exclusion が AC3 を破っている今回の実装は これは AC1/AC2 の「他プロセスの同時書き込みを誤検知しない」は満たします。しかし、#1343 の AC3 は「実行コマンド自身が 現実には、child が P0: テストは AC3 の弱いケースしか見ていない新規テストは peer write を再現して success を確認していますが、peer writer は別プロセスではなく Python thread です。ファイルシステム drift の再現としては有効ですが、AC文言の「別プロセス」そのものではありません。 より重大なのは self-write の negative test が このPRの Safety Claim Matrix は「volatile peer-session root への self-write は検出されない」と正直に認めていますが、テスト名とAC3の表示は「outside allowed roots は従来どおり fail-close」という印象を残しています。現契約のままなら、ここは過剰主張です。 P0: #1228 / #1236 の artifact-only boundary と緊張している
#1228 / PR #1231 でも、root no-worktree preflight を許可する代わりに exact argv / repo binding / direct preflight block / artifact root 外 write fail-close を維持した、と整理されています。 #1236 / PR #1242 も したがって、今回の「 外部仕様との照合Python の また Python の inotify も安易な解ではありません。directory monitoring は再帰的ではなく、新規subdirectoryには追加watchが必要で、race window や event loss を考慮する必要があります。([man7.org]3) ([man7.org]3) strict attribution を本当にやるなら、Linuxでは 修正方針このPRは二択で整理するべきです。 Option A: strict attribution として直す#1343 の AC3 を文字通り守るなら、child process tree の file write attribution を導入してください。最低限、以下が必要です。 この場合、PRの実装は大きく変わるので #1349 の Allowed Paths だけで足りるか再確認が必要です。 Option B: race-tolerant hotfix として契約を狭める標準ライブラリだけで誤検知を止める暫定策としてこのPRを入れるなら、#1343 / PR本文 / レビュー判定を次のように変更してください。 #1346 は良いfollow-upですが、現時点の#1346はSSOT・Issue template・Required Design Referencesの整備であり、 追加すべきテスト最低限、次を追加してください。 # strict mode なら fail を期待
test_self_write_to_worktrees_still_fails
test_self_write_to_other_issue_artifacts_still_fails
# race-tolerant hotfix なら xfail / known limitation として明示
test_self_write_to_worktrees_is_known_unsupported_in_stdlib_mode
test_self_write_to_other_issue_artifacts_is_known_unsupported_in_stdlib_mode
# AC文言に合わせるなら thread ではなく subprocess peer writer
test_unrelated_subprocess_write_to_worktrees_does_not_fail
test_unrelated_subprocess_write_to_other_issue_artifacts_does_not_fail既存の GitHubレビュー文面案REQUEST_CHANGES
#1349 は #1343 の false positive を減らす方向としては妥当ですが、現契約のままでは merge 不可です。
Blocker:
- `_VOLATILE_PEER_SESSION_ROOT_RELS` が `.claude/worktrees` と `.claude/artifacts/issue-refinement-loop` を repo drift 検出から丸ごと除外しているため、child 自身がそれらの root へ `allowed_write_roots` 外 self-write した場合も `unauthorized_write_path` になりません。
- #1343 AC3 は「実行コマンド自身が `allowed_write_roots` 外へ書いた場合は従来どおり fail-close」と読めるため、現実装は AC3 の一般保証を満たしていません。
- 新規AC3テストは `.cache/outside.txt` のみで、今回除外した volatile roots への child self-write negative test がありません。
- PR本文の Safety Claim Matrix はこの gap を Not controlled と認めていますが、その場合は Issue/PR/テストの主張を “stdlib race-tolerant hotfix” に狭める必要があります。
Required:
1. strict attribution を実装して volatile roots への child self-write も fail-close する。
または
2. #1343 の契約とPR本文を明示的に狭め、volatile-root child self-write は unsupported / follow-up として扱う。
少なくとも、`test_self_write_to_worktrees_still_fails` と `test_self_write_to_other_issue_artifacts_still_fails`(または known limitation の明示テスト)を追加してください。結論として、人間が「false positive を減らす実用ホットフィックスとして、volatile root への self-write blind spot を許容する」と明示判断するならマージ可能です。そうでないなら、現PRは |
…制限を明示する (#1343) PR #1349への人間レビュー(REQUEST_CHANGES)を受け、Option Bを採用した。 strict attributionは実装せず、代わりにvolatile peer-session root (.claude/worktrees/** / .claude/artifacts/issue-refinement-loop/**)への 自プロセスの書き込みが検出されないことを既知の制限としてテストで明示する。 - test_self_write_to_worktrees_is_known_unsupported_in_stdlib_mode - test_self_write_to_other_issue_artifacts_is_known_unsupported_in_stdlib_mode - 既存4テスト(AC1-AC4)は変更なし Co-Authored-By: Claude Sonnet 5 <[email protected]>
TEST_VERDICT:
result: PASS
mergeable: MERGEABLE
merge_state_status: CLEAN
branch_behind_main: false
baseline_only: false
verification_commands_pass: 6
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results: []検証結果レポート(iteration 2, head_sha: f03fabf)Issue #1343: 実装: 契約実行ラッパーの unauthorized_write_path 誤検知を修正する(Option B 契約狭め後)
総合判定
|
squne121
left a comment
There was a problem hiding this comment.
PR Review: #1349 (Closes #1343) — iteration 3 (Option B 契約狭め後の再レビュー)
iteration 3 APPROVE。Option B(契約狭め)で Issue #1343 の AC3/AC5 と PR #1349 実装・テスト・Safety Claim Matrix が整合していることを独立に確認した。
- Issue #1343 の現行 body(
sha256:9a2f2a3b4cbd4a08231cefc80cdf0d57e156eb1d4d8e192ef1a0c1ff4f8d0169)と fresh contract-review go の body_sha256 が独立再計算で完全一致。narrowed AC3・新規AC5・Out of Scope 追記を確認。 - 新規2テスト(
test_self_write_to_worktrees_is_known_unsupported_in_stdlib_mode/test_self_write_to_other_issue_artifacts_is_known_unsupported_in_stdlib_mode)を実コードで読み、self-write into volatile root が returncode 0(検出されない)ことを assert しており、実装(_VOLATILE_PEER_SESSION_ROOT_RELSによる snapshot/status からの丸ごと除外、iteration 1 から不変)と整合。矛盾や逆方向の fail-close 要求はない。6テスト全て head f03fabf 上でローカル再実行し PASS 確認済み。 - Safety Claim Matrix の bounded-claim 宣言(「無限定の safe / 完全な attribution は主張していない」)を確認、過剰主張なし。
ci_verdict_summary.py --expected-head-sha f03fabfe...→all_pass(required checks 全 green、stale/pending/failed なし)。- Allowed Paths gate を独立再計算(
git diff --name-status -M -zベース、worker self-report 不使用)→status: ok、変更2ファイルとも Allowed Paths と完全一致、rename なし。
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: "f03fabfe02a5c32d2bd37f375393fa847d268122"
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"
produced_by: "allowed_paths_review_gate.py"
producer_role: "review_subagent"
worker_report_used_as_canonical: false
pr_number: 1349
base_ref: "main"
diff_base_sha: "4f2c330a3cefeab1a683a086c402504a0362acd3"
base_sha: "4f2c330a3cefeab1a683a086c402504a0362acd3"
head_sha: "f03fabfe02a5c32d2bd37f375393fa847d268122"
reviewed_head_sha: "f03fabfe02a5c32d2bd37f375393fa847d268122"
changed_files_source: "git_diff_name_status_find_renames_z"
changed_files_count: 2
changed_files:
- "scripts/agent-guards/skill_runtime_exec.py"
- "scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py"
violations: []
contract_fingerprint:
issue_number: 1343
contract_source_kind: "github_issue"
contract_source_id: "squne121/loop-protocol#1343"
contract_body_sha256: "sha256:9a2f2a3b4cbd4a08231cefc80cdf0d57e156eb1d4d8e192ef1a0c1ff4f8d0169"
base_ref: "main"
base_sha_at_snapshot: "4f2c330a3cefeab1a683a086c402504a0362acd3"
reason: "All changed files are within allowed paths"CI log investigation (run 28757862903 / PR #1352, 28751177802 / PR #1349, 28749187051 / PR #1345) shows the index preview URL returning a sustained 404 for the entire previous 180s per-URL budget with no intervening 200 response, while the same repository's deploy-main job (same GitHub Pages Settings/Source) never exhibits this failure. This is consistent with GitHub Pages CDN propagation lag for freshly published pr-<n>/ subdirectories exceeding 180s on occasion, rather than a Pages Settings/Source misconfiguration (tracked separately in #1315). Bump the shared overall_deadline from 240s to 300s to give the index + asset checks more headroom within the new shared-budget model. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…1346) - AC9 (P0): validate_issue_body.py の _load_required_section_labels に implementation kind 専用の Required Design References 必須化を追加し、 create_issue_txn.py 経由の authoring 経路で欠落時に needs_fix を返すようにした。 ISSUE_TEMPLATE 側の validations.required: false(AC7 の scope_signal_guard 回帰対応) には影響しない。 - AC10: contract_readiness_check.py の RDR001 セクション抽出を prose_boundary_policy.HEADING_POLICY の accepted_forms(日本語見出し含む)から 動的に構築し、両者の heading 集合を共有した。 - AC11: RDR001 の design-doc path 判定を docs/**/*.md|yml, .claude/skills/**/SKILL.md, .claude/skills/**/references/**/*.md に絞り、 Path.exists() による実在チェックを追加。autofixable を False に変更した。 - AC12 (P1): agent-skill-boundaries.md の Parallel Agent Runtime Safety を Strict attribution mode(将来課題)と Race-tolerant stdlib mode(PR #1349 Option B の既知の制限を明記)の二段階に分けて書き直し、矛盾を解消した。 - AC13: ssot-registry.md の diff を agent-skill-boundaries エントリのみに限定し、 無関係な title/description 変更を revert した。
* docs: 並列エージェント実行安全性を SSOT 化し Required Design References を追加する (#1346) - docs/dev/agent-skill-boundaries.md に「## Parallel Agent Runtime Safety」セクションを 追加し、repo-wide snapshot を自プロセス副作用とみなさない旨・volatile roots の扱い・ self-write bypass を作らない negative test 要求を明文化した。 - docs/dev/ssot-registry.md の agent-skill-boundaries エントリに parallel/concurrent/race の discovery keyword とセクション参照を追加した。 - docs/dev/workflow.md の SSOT Routing Table に参照動線を追加した。 - .github/ISSUE_TEMPLATE/implementation.yml に Required Design References セクションの ひな形を追加した。 - .claude/skills/create-issue/references/body-authoring.md に Required Design References セクションの執筆指針を追加した。 - .claude/skills/issue-contract-review/scripts/contract_readiness_check.py に Required Design References の静的検査(RDR001)を追加した。implementation issue で 同セクションが空 / N/A / none のみ / repo-relative design-doc path なしの場合に needs_fix を返す。セクション自体が存在しない場合は RVA の前例に倣い既存 fixture の 意味を変えない(AC6)。 - .claude/skills/issue-contract-review/scripts/tests/test_required_design_references.py を新規追加し、AC4/AC6 の挙動をテストで固定した。 Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: body-authoring.md の新規見出しの日本語比率不足を解消する PR Body Japanese Check が per-block 判定で `## Required Design References Authoring Guidance` 見出し(heading_policy 未登録のため prose 扱い)の日本語比率 0.068 で fail していたため、見出しの日本語 併記を増補して閾値 0.1 を満たすようにした。 * fix: ssot-registry.md の既存 prose block の日本語比率不足を解消する PR Body Japanese Check は変更 .md ファイル全体を per-block で判定するため、 Issue #1346 の変更点だけでなく既存の英語主体 prose block も日本語比率 0.1 以上が必要。 7 件の該当 block(title/description/heading)に日本語併記を追加し、 既存の技術的内容・YAML キー構造は変更しない。 * fix: docs/dev/workflow.md への任意の参照動線追加を revert する PR Body Japanese Check が workflow.md 内の既存英語主体 prose block により FAILURE していたため、Issue #1346 の AC1-AC6 に必須でない任意変更(SSOT Routing Table への参照行追加)を取り消す。AC1-AC6 の Verification Commands は本ファイルに依存しないため、revert 後も全て PASS することを 確認済み。 Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: parallel_exclude 登録に伴い test_python_test_plan.py の debounce 固定表明を更新する (#1346) Scope Delta 2回目対応。.github/ci/python-test-plan.json の parallel_exclude に test_required_design_references.py を登録したことで test_real_plan_serial_lane_has_debounce の「parallel_exclude は空である」 という固定表明が破壊されるため、既知の1件のみを許容する形に更新する。 * Revert "fix: parallel_exclude 登録に伴い test_python_test_plan.py の debounce 固定表明を更新する (#1346)" This reverts commit 04309a7. * fix: Required Design References セクションを GitHub Issue Form 必須化しない Issue Form 側の validations.required: true が、Required Design References セクションを持たない既存 issue body fixture との組み合わせで plan_refinement_loop.py の必須セクション欠落チェックを早期 return させ、 scope_signal_guard_decision_v2 計算前に fail_closed_reasons を積んでいた。 これにより test_scope_signal_guard_lane_split.py の全件が KeyError: 'scope_signal_guard_decision_v2' で失敗していた(xdist/並列実行は無関係)。 実質的な必須性チェックは AC4 で追加した contract_readiness_check.py の check_required_design_references() が既に担っているため、 Issue Form 側は required: false に変更する。 あわせて誤った仮説(AC4 テスト追加による xdist worker バケット変化)に 基づき追加していた .github/ci/python-test-plan.json の parallel_exclude エントリと scripts/ci/tests/test_python_test_plan.py の debounce 固定表明変更を revert する。 Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: HEADING_POLICY に Required Design References 見出しを登録する (#1346) Scope Delta 3回目対応。.github/ISSUE_TEMPLATE/implementation.yml の required-design-references を required: false に修正した結果、 test_scope_signal_guard_lane_split.py の回帰は解消したが、新たに test_heading_policy.py::TestInventoryCoversTemplateHeadings が "Required Design References" 見出しの HEADING_POLICY 未登録を検出したため、 prose_boundary_policy.py の HEADING_POLICY インベントリに同見出しを 既存エントリと同形式で登録する(AC8)。 * fix: Required Design References の authoring 必須化と SSOT 記述の敵対的レビュー対応 (#1346) - AC9 (P0): validate_issue_body.py の _load_required_section_labels に implementation kind 専用の Required Design References 必須化を追加し、 create_issue_txn.py 経由の authoring 経路で欠落時に needs_fix を返すようにした。 ISSUE_TEMPLATE 側の validations.required: false(AC7 の scope_signal_guard 回帰対応) には影響しない。 - AC10: contract_readiness_check.py の RDR001 セクション抽出を prose_boundary_policy.HEADING_POLICY の accepted_forms(日本語見出し含む)から 動的に構築し、両者の heading 集合を共有した。 - AC11: RDR001 の design-doc path 判定を docs/**/*.md|yml, .claude/skills/**/SKILL.md, .claude/skills/**/references/**/*.md に絞り、 Path.exists() による実在チェックを追加。autofixable を False に変更した。 - AC12 (P1): agent-skill-boundaries.md の Parallel Agent Runtime Safety を Strict attribution mode(将来課題)と Race-tolerant stdlib mode(PR #1349 Option B の既知の制限を明記)の二段階に分けて書き直し、矛盾を解消した。 - AC13: ssot-registry.md の diff を agent-skill-boundaries エントリのみに限定し、 無関係な title/description 変更を revert した。 * fix: AC9 regression修正とssot-registry.md Japanese Check再発対応 (#1346) - materialize_child_issues.py の required_section_labels() を validate_issue_body.py の _load_required_section_labels() と揃え、 implementation kind に Required Design References を必須追加する 特例を適用する(生成 body の必須セクション乖離を解消)。 - test_guard_issue_body.py の make_implementation_body() fixture に Required Design References セクションを追加し、AC9 regression (assert False is True)を解消する。 - ssot-registry.md の7つの prose block(agent-skill-boundaries 以外の 既存エントリ)に、スコープ・情報量を変えない最小限の日本語訳併記を 追加し、Japanese Content Check(threshold 0.1)を再度満たす。 --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
* fix: deploy-pr preview asset liveness check retry/backoff/deadline (#1357) The `Verify preview assets are live` step in deploy-pages.yml failed intermittently with 404 timeouts unrelated to PR diff content (observed during PR #1349 review, also seen on PR #1274). This tunes the fetch_pages_url_with_bounded_retry polling logic: - Replace the fixed `sleep 5` retry interval with an exponential bounded backoff (initial_delay=2s, max_delay=20s, doubling per attempt). - Introduce a single overall_deadline shared across the index page and every asset URL, instead of each URL getting its own independent 180s budget that stacks with the number of assets checked. - Extend the retriable HTTP status set with 409 (Pages deployment conflict during a concurrent publish) and 425 (too early / origin not yet ready), with an inline comment documenting why each status is treated as transient. - Emit structured retry logs (label=preview-index|preview-asset, attempt=, elapsed=, next_sleep=) to make future flake investigation from CI logs tractable. deploy-main job logic and the gh-pages commit message string are untouched; only the deploy-pr job's live asset check step changed. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: bump deploy-pr preview overall_deadline to 300s (#1357) CI log investigation (run 28757862903 / PR #1352, 28751177802 / PR #1349, 28749187051 / PR #1345) shows the index preview URL returning a sustained 404 for the entire previous 180s per-URL budget with no intervening 200 response, while the same repository's deploy-main job (same GitHub Pages Settings/Source) never exhibits this failure. This is consistent with GitHub Pages CDN propagation lag for freshly published pr-<n>/ subdirectories exceeding 180s on occasion, rather than a Pages Settings/Source misconfiguration (tracked separately in #1315). Bump the shared overall_deadline from 240s to 300s to give the index + asset checks more headroom within the new shared-budget model. Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: address REQUEST_CHANGES on deploy-pages.yml live check fix (#1357) - Blocker: overall_deadline を実際にhard deadlineにする。curl --max-time を 残り時間でcap(attempt_max_time)し、curl実行前に残り時間<=0ならエラーで 抜ける。retryのsleep前にも残り時間を再計算しnext_sleepをcapする。 - Major: retry対象statusのコメントをobserved/defensiveの区別に修正。 今回実観測されたのは404のみ。403/409/425等は今回未観測のdefensive retryと 明記(425文字列自体はAC7維持のため残す)。 - Minor: asset URL fetchにも ?cache_bust=${GITHUB_SHA} を追加し index/asset で診断の一貫性を揃える。 Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: address low-risk items from adversarial review on #1358 - add timeout-minutes: 7 to the "Verify preview assets are live" step as a defense-in-depth guard against holding the shared deploy-pages concurrency group indefinitely - clear stale "${output}.tmp" before each curl attempt in fetch_pages_url_with_bounded_retry so a prior attempt's tmp content cannot leak into a later attempt's deadline-exceeded diagnostics - soften the retry-eligible status comment: it no longer implies a documented GitHub Pages/CDN transient-behavior contract; the non-404 codes are described as defensive-only and unobserved for #1357 Live-preview head-SHA verification is intentionally out of scope here and tracked as a separate follow-up issue per the review feedback. Closes #1357 --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
Summary
scripts/agent-guards/skill_runtime_exec.pyの before/after repo-wide スナップショット比較が、.claude/worktrees/**や他 issue の.claude/artifacts/issue-refinement-loop/<他issue>/**への並行稼働セッション由来の書き込みを、実行コマンド自身の副作用と誤認してunauthorized_write_pathで fail-close していたバグを修正した。_snapshot_repo_paths/_find_unauthorized_repo_changesにおいて、これら volatile な peer-session root を diff 対象から除外するようにした。allowed_write_roots外への自プロセスの書き込み検出(.cache/outside.txt等)は従来通り fail-close する(回帰なし)。受け入れ条件の達成状況
.claude/worktrees/**配下(実行コマンドのallowed_write_roots外)へファイルを書き込んでも、skill_runtime_exec.pyがunauthorized_write_pathで fail しない(根拠:test_unrelated_process_write_to_worktrees_does_not_failPASS).claude/artifacts/issue-refinement-loop/<別issue番号>/**(実行コマンドが対象とする issue 番号とは異なるディレクトリ)へファイルを書き込んでも、skill_runtime_exec.pyがunauthorized_write_pathで fail しない(根拠:test_unrelated_process_write_to_other_issue_artifacts_does_not_failPASS)allowed_write_roots外(ただし.claude/worktrees/**および.claude/artifacts/issue-refinement-loop/**等の volatile peer-session root を除く)へ実際に書き込んだ場合は、従来どおりunauthorized_write_pathで fail-close する(回帰なし)(根拠:test_self_write_outside_allowed_roots_still_failsPASS)allowed_write_roots内へ正当に書き込んだ場合は、従来どおり成功する(回帰なし)(根拠:test_self_write_inside_allowed_roots_still_succeedsPASS).claude/worktrees/**/.claude/artifacts/issue-refinement-loop/**)へallowed_write_roots外の書き込みを行った場合、本 Issue の race-tolerant hotfix の範囲では検出されないことが既知の制限としてテストで明示されている(根拠:test_self_write_to_worktrees_is_known_unsupported_in_stdlib_modePASS、test_self_write_to_other_issue_artifacts_is_known_unsupported_in_stdlib_modePASS。strict attribution は別Issueのスコープ)検証コマンド結果
uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py(6件 PASS、AC1〜AC5 対応。iteration 2 で AC5 用の新規2件を追加)uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.py(既存20件 PASS、回帰なし)uv run --locked pytest scripts/agent-guards/tests/(既存 + 新規 全475件 PASS)ruff check --ignore E402(プロジェクト CI 方針と同一設定で警告なし)pnpm typecheck/pnpm lint/pnpm test/pnpm build(TypeScript ソース非該当のため未実行。Python スクリプトのみの変更)Allowed Paths 遵守
scripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.pyChecks
uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py(6件 PASS)uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.py(既存20件 PASS、回帰なし)uv run --locked pytest scripts/agent-guards/tests/(既存 + 新規 全475件 PASS)ruff check --ignore E402(プロジェクト CI 方針と同一設定で警告なし)pnpm typecheck/pnpm lint/pnpm test/pnpm build(TypeScript ソース非該当のため未実行。Python スクリプトのみの変更)Schema Change Applicability
not_schema_changeskill_runtime_exec.py内部の repo-wide diff 判定ロジックの挙動修正のみ。Schema Consumer Inventory
N/A(
not_schema_changeのため)Compatibility Decision(互換性判断)
本 PR は schema 変更を含まないため、以下は全て該当なしとする。
N/AN/AN/AN/ASafety Claim Matrix
allowed_write_roots外(.claude/worktrees/**以外の一般 repo path、例.cache/**)へ書き込んだ場合、従来どおりunauthorized_write_pathで fail-close するtest_self_write_outside_allowed_roots_still_failsPASS(AC3)allowed_write_roots内へ正当に書き込んだ場合、従来どおり成功するtest_self_write_inside_allowed_roots_still_succeedsPASS(AC4).claude/worktrees/**へ書き込んでも誤って fail しないtest_unrelated_process_write_to_worktrees_does_not_failPASS(AC1).claude/artifacts/issue-refinement-loop/**へ書き込んでも誤って fail しないtest_unrelated_process_write_to_other_issue_artifacts_does_not_failPASS(AC2).claude/worktrees/**や他 issue の.claude/artifacts/issue-refinement-loop/**へ意図的にallowed_write_roots外の書き込みを行った場合、その自己書き込みは検出されず成功してしまうtest_self_write_to_worktrees_is_known_unsupported_in_stdlib_modePASS、test_self_write_to_other_issue_artifacts_is_known_unsupported_in_stdlib_modePASS(AC5。2026-07-06 人間レビュー REQUEST_CHANGES を受け Option B として契約に明記)記載ルール確認: 「無限定の safe / 完全な attribution」は主張していない。保証範囲は AC1〜AC5 の VC で検証された範囲(一般 repo path への self-write 検出は維持、volatile peer-session root への self-write 検出は既知の制限として本 PR の対象外)に限定している。
Notes
補足情報は以下のとおり。
Notes for Reviewer(レビュアー向け補足)
_VOLATILE_PEER_SESSION_ROOT_RELS(.claude/worktreesと.claude/artifacts/issue-refinement-loop)を before/after スナップショット比較の監査対象から完全除外したことで、AC1/AC2(他プロセスの誤検知解消)は満たすが、実行コマンド自身がこれらの volatile root へallowed_write_roots外の書き込みをした場合も検出できなくなるという副作用が生じる。scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.pyに AC5 対応の新規テスト2件を追加(test_self_write_to_worktrees_is_known_unsupported_in_stdlib_mode/test_self_write_to_other_issue_artifacts_is_known_unsupported_in_stdlib_mode)。既存4テスト(AC1〜AC4)は変更していない。skill_runtime_exec.pyの_VOLATILE_PEER_SESSION_ROOT_RELS除外ロジック)は変更していない(iteration 1 の実装が Option B の契約に既に合致していたため)。