Repository navigation
feat: scope-rollup registry invocation metadata - #1594
Merged
Merged
Conversation
Contributor
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-1594/ The preview will be removed when this PR is closed. |
squne121
commented
Jul 18, 2026
squne121
left a comment
Owner
Author
There was a problem hiding this comment.
owner-level evidence review
Issue #1579 の AC1〜AC3 は registry entry の exact argv と required placeholders の追加で満たされ、AC4 は対象 pytest 37件の成功で確認しました。差分は contract の Allowed Paths にある2ファイルだけであり、allowed-paths review gate は current head で ok です。
CI の required checks はすべて 95ee00544b0fa3f33a132b10d76886a8b2b28680 に対して成功しました。通常コメント、formal review、inline review thread を再取得し、actionable feedback はありません。
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: "95ee00544b0fa3f33a132b10d76886a8b2b28680"
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
allowed_paths_gate_source: review_subagent
This was referenced Jul 18, 2026
squne121
added a commit
that referenced
this pull request
Jul 19, 2026
…#1602) merge 済み PR #1594 の PR_REVIEW_PUBLISH_MARKER_V1 local marker が repo に残留し、 後続 preflight を unauthorized_write_path で fail-close 停止させていた(Issue #1593)。 remote GitHub state(merged-check endpoint + review_id primary key の exact review 一致) を独立に再検証した場合に限り、marker を repo 外 archive root(XDG_STATE_HOME authority、 no-overwrite 発行)へ退避し、dir-fd/inode-bound TOCTOU-safe な unlink で repo 側 marker を 除去する専用 executor を追加する。失敗は SOURCE_VALIDATED -> ARCHIVE_PREPARED -> ARCHIVE_DURABLE -> SOURCE_REMOVED -> SOURCE_REMOVAL_DURABLE -> COMMITTED の state machine で honest に分類し、 unlink 前は marker を必ず保持、unlink 後に postcondition を確認できない場合は indeterminate を返して「保持した」と偽らない。 post-merge-cleanup に merged PR number 限定の呼び出し手順を追加し、 POST_MERGE_CLEANUP_REPORT_V1 に pr_review_marker_archive result block を追加した。 責務境界(remote authority / archive は local cache/audit lifecycle に限定 / preflight generic allowlist は拡張しない)を agent-skill-boundaries.md に記録した。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
squne121
added a commit
that referenced
this pull request
Jul 19, 2026
…#1628) * 実装: マージ済み PR の pr_review.publish marker を限定 archive し preflight 阻害を防ぐ (#1602) merge 済み PR #1594 の PR_REVIEW_PUBLISH_MARKER_V1 local marker が repo に残留し、 後続 preflight を unauthorized_write_path で fail-close 停止させていた(Issue #1593)。 remote GitHub state(merged-check endpoint + review_id primary key の exact review 一致) を独立に再検証した場合に限り、marker を repo 外 archive root(XDG_STATE_HOME authority、 no-overwrite 発行)へ退避し、dir-fd/inode-bound TOCTOU-safe な unlink で repo 側 marker を 除去する専用 executor を追加する。失敗は SOURCE_VALIDATED -> ARCHIVE_PREPARED -> ARCHIVE_DURABLE -> SOURCE_REMOVED -> SOURCE_REMOVAL_DURABLE -> COMMITTED の state machine で honest に分類し、 unlink 前は marker を必ず保持、unlink 後に postcondition を確認できない場合は indeterminate を返して「保持した」と偽らない。 post-merge-cleanup に merged PR number 限定の呼び出し手順を追加し、 POST_MERGE_CLEANUP_REPORT_V1 に pr_review_marker_archive result block を追加した。 責務境界(remote authority / archive は local cache/audit lifecycle に限定 / preflight generic allowlist は拡張しない)を agent-skill-boundaries.md に記録した。 Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: PR #1628 review指摘の governed invocation欠落とCI test-plan未登録を修正する - post-merge-cleanup/SKILL.md のドキュメント例に uv run --locked を追加 - .github/ci/python-test-plan.json に scripts/agent-ops/tests/ を登録し test_pr_review_marker_archive_exec.py を python-test lane でカバーする * fix: harden pr_review_marker_archive_exec.py against OWNER security review P0-P2 OWNER security review (PR #1628 review comment #5014930088) identified five P0 and several P1/P2 blockers in the merged-PR marker archive executor. This addresses all of them: - P0-1: archive root resolver no longer requires ownership of pre-existing system ancestors (e.g. /home); ownership is checked only from the nearest EXISTING ancestor (e.g. $HOME) downward. The resolved root is also refused if it resolves inside the repository itself. - P0-2: gh/git are resolved ONLY from a fixed trusted PATH (/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin), never the ambient process PATH, with a sanitized subprocess environment. The worktree's origin remote is bound to a canonical https/ssh github.com URL and must match the repo the executor operates against. - P0-3: any pre-existing archive destination (fresh check or a concurrent EEXIST race) is re-opened via a parent-directory fd with O_NOFOLLOW and strictly validated (regular file, owning uid, mode 0600, nlink==1, schema-valid JSON) before being trusted. - P0-4: the marker's idempotency_key is strictly parsed and cross-checked against repo/pr_number/expected_head_sha; the review body's SHA-256 is recomputed from the pre-marker content and compared against the idempotency_key's body_sha256 component; the review author's identity is cross-checked against the authenticated gh identity. - P0-5: source presence after unlink is classified into absent/same_inode_present/different_inode_present/unknown instead of a boolean, so a different file recreated at the canonical path is never conflated with "absent". - P1-2: filesystem errors while preparing the archive (ENOSPC, EACCES, malformed pre-existing archive, ...) are converted to bounded reason_codes instead of propagating as raw exceptions; source marker file descriptors are always closed via an ExitStack-managed callback. - P2: the merged-check HTTP status line is parsed strictly (anchored regex, not substring match), the 204 branch also requires rc==0, and gh api calls send explicit Accept / X-GitHub-Api-Version headers. Extends the existing 8 tests to 38, covering the production $HOME/.local/state resolver, repo-internal/relative/symlink/other-uid/ non-private XDG_STATE_HOME rejection, fake gh/git on the ambient PATH, forged/symlinked/FIFO/directory/hardlinked archive destinations, the concurrent-writer EEXIST durability barrier, rewritten review body / review author mismatch, different-inode-after-unlink classification, and bounded filesystem-error classification. Issue #1602. PR #1628 review #1628 (comment) * fix: post-merge worker の実行ポリシーに pr_review_marker_archive_exec.py を配線する (P1-1) OWNER レビュー指摘(PR #1628 review, P1-1): post-merge-cleanup/SKILL.md が 呼び出す scripts/agent-ops/pr_review_marker_archive_exec.py が Claude Code の command allowlist に含まれておらず、自動 post-merge cleanup 経路が実行 できなかった。.claude/settings.json の permissions.allow に exact command allow エントリを追加する。 --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
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
scope_rollup.runの registry argv に--invocation-idと--requested-atを canonical 順序で追加しました。Architecture decision
scope-rollup の specialized worker、policy、guard は変更しません。registry の child argv と既存 exact executor の入力契約だけを一致させる限定変更です。
Contract ownership
責務の境界は次表のとおり維持します。
command_registry.pyskill_runtime_command_policy.pyrun_scope_rollup_preflight.pyExact changed files
変更対象は次の許可済み2ファイルだけです。
.claude/skills/issue-refinement-loop/scripts/command_registry.py.claude/skills/issue-refinement-loop/tests/test_command_registry.pyChecks
対象契約に対応する検証をすべて成功させました。
uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_command_registry.py -v— 対象単体テスト37件が成功uv run --locked ruff check .claude/skills/issue-refinement-loop/scripts/command_registry.py .claude/skills/issue-refinement-loop/tests/test_command_registry.py— 対象lintが成功git diff --check— 差分の空白エラーなしSchema Change Applicability
scope_rollup.runの registry render contract に必須 placeholder と argv token を追加する additive change のためSchema Consumer Inventory
Before
scope_rollup.runregistry entry は issue number と repository だけを render parameter として要求していました。After
同 entry は invocation identity と request timestamp を必須文字列として受け取り、
--repoの後に固定順序で child argv へ渡します。scripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/run_scope_rollup_preflight.py.claude/agents/scope-rollup-runner.md.claude/skills/issue-refinement-loop/tests/test_command_registry.pySafety Claim Matrix
安全性に関する責務と未制御範囲を次表へ明示します。
Base and head
PR作成時点の base と検証済み head は以下です。
15c3f143877bab657886e2987927431594a7fbbd95ee00544b0fa3f33a132b10d76886a8b2b28680sha256:e053279b7f870d42ab704212c1f7f43d084b358e6b4166bd77c22d8b7d0888b8Rollback plan
この1コミットを revert すれば、registry の argv と placeholder contract は直前の状態に戻ります。worker、policy、guard、結果スキーマ、repository write root は変更していません。
Notes
SCOPE_ROLLUP_RUN_RESULT_V1は変更しません。