Skip to content

実装: linked issue worktree の verified fast-forward を RTK guard で許可する #1589

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "#1540 の linked issue worktree を、active branch の live-verified origin head へ単一 trusted transaction 内の rtk git merge --ff-only だけで安全に同期できるようにする"
change_kind: workflow

Parent Issue

なし(#1540 を unblock する単独 follow-up)

Parent Goal Ref

Current Validated Scope

  • scripts/agent-guards/git_mutation_command_policy.py の classify_rtk_git_mutation は rtk git add、commit、push だけを bounded に判定し、merge は unknown に倒している。
  • 同ファイルには既に execute_initial_branch_create_transaction(Issue 実装: publish laneに新規branch初回publish用のatomicなbranch作成laneを追加する #1449 / PR 実装: publish laneに新規branch初回publish用のatomicなbranch作成laneを追加する #1479 OWNER review 由来)という前例パターンが実装されている: classify_rtk_git_mutation 自身が、verify(HEAD/branch/origin binding 確認)→ probe(live git ls-remote --refs --exit-code readback)→ 実際の remote write → 事後 readback、を単一 trusted execution boundary 内で完結させ、常に元の raw shell command を "deny" として返す(呼び出し元コマンドを別途再実行させない)。merge lane もこの既存パターンに従う必要がある。
  • .claude/hooks/worktree_scope_guard.py の _decide_bash は shared policy が返した結果を、active Issue の linked worktree 内に限って反映する。
  • scripts/agent-guards/local_main_branch_guard.py の evaluate は Codex wrapper からも利用され、local root context で RTK Git mutation を許可しない。
  • .codex/rules/default.rules は現在 rtk git merge を他の破壊的 git 操作(checkout/rebase/reset/cherry-pick 等)と同じ generic prompt bucket(line 122-130 付近)に分類しており、exact --ff-only 形状の専用 allow rule は存在しない。一方 rtk git push origin は既に専用の prefix allow rule を持つ(initial_branch_create lane 用)。
  • .claude/settings.json には rtk git 系コマンドの exact allow エントリはない(Claude 側の許可判断は permissionDecision を返す hook 自体が担う。push origin lane も settings.json 変更なしで成立している)。
  • 実装: pr_review_only VC の current-head adjudication を修正する #1540 の clean linked worktree は PR fix: pr_review_only VC の current-head 判定を修正する #1544 branch の verified remote SHA 885087598eac7453544f08e468bc9b8ff6c29cf4 への fast-forward が RTK/guard allowlist 不在で停止している。

Remaining Parent Gaps

Background

根本原因は shared RTK Git mutation policy が merge を未認識として fail-closed にすることにある。当初案は「guard が状態を検証してから、別プロセスで元の raw rtk git merge --ff-only を許可する」設計だったが、これは検証した状態と実際に mutation される状態を原子的に結び付けられず、TOCTOU window(検証後に branch/HEAD/tracking ref が変化しうる)を閉じられない。また refs/remotes/origin/<branch> はローカル tracking ref であり、live remote head と一致する保証がない。

リポジトリには既にこの種の問題を解決した前例(execute_initial_branch_create_transaction、Issue #1449 / PR #1479)があり、classify_rtk_git_mutation 自身が verify・live remote probe・実際の mutation・事後 readback を単一 trusted execution boundary 内で完結させ、元の raw shell command は常に deny する構造を採用している。merge lane もこの既存パターンを踏襲し、prompt 注記や raw Git への迂回、root checkout・reset・force push・任意 commit への merge を許可する workaround は採用しない。

さらに、OWNER による敵対的レビュー(PR #1609 https://github.com/squne121/loop-protocol/pull/1609#issuecomment-5011054192)を受け、`classify_rtk_git_mutation` が merge の副作用を持つ設計は、worktree_scope_guard 側の認可(active Issue解決・matching worktree一意・cwd一致・branch番号一致・linked worktree判定)より前に実際の merge を実行してしまう P0 欠陥を含むと判明した。この修正のため、classify_rtk_git_mutation の merge 分岐は副作用なしの pure shape classifier へ変更し、認可判断と transaction 実行の責務を .claude/hooks/worktree_scope_guard.py 側に一本化した。また Codex execpolicy は「先勝ち」ではなく forbidden > prompt > allow の最も厳しい decision を採用するため、rtk git merge --ff-only の allow rule は既存の generic rtk git merge -> prompt に飲み込まれ実質 prompt のままだった。これを解消するため、専用の Codex-allowlist executor script(scripts/agent-ops/verified_ff_merge_exec.py)を新設し、Codex の allow rule はこの exact executor コマンドのみを対象とする。

Outcome

classify_rtk_git_mutation(scripts/agent-guards/git_mutation_command_policy.py)が、linked issue worktree の attached non-default active branch から呼ばれた exact rtk git merge --ff-only <40-hex-target-sha> を認識した場合、副作用のない pure shape classifier として allow(authorization pending)を返す。実際の merge 実行は .claude/hooks/worktree_scope_guard.py が active Issue 解決・matching worktree 一意性・cwd binding・linked worktree 判定を全て認可した後にのみ、既存の execute_initial_branch_create_transaction と同じ単一 trusted execution boundary パターンに従う新規 execute_verified_ff_merge_transaction を呼び出す形で行う。この transaction は以下を全て満たす場合のみ git merge --ff-only <target_sha> を実行する:

  • clean worktree/index/submodule であり、進行中の git operation(MERGE_HEAD、CHERRY_PICK_HEAD、rebase state 等、per-worktree git rev-parse --git-path で解決)が存在しない
  • attached HEAD が active non-default issue branch である
  • origin の effective fetch URL(push URL ではない)が canonical repo と一致する
  • 対象 remote に対する live git ls-remote --refs --exit-code origin refs/heads/<active-branch> の結果が target SHA と一致する(absent/mismatch/probe error は fail-closed で deny)
  • target が local commit object であり、local HEAD が target の ancestor である
  • merge 実行直前に branch/HEAD が変化していないことを再確認する(race window を狭める)

merge 実行後は、active branch 不変・HEAD == target_sha・worktree/index clean・operation residue なし(post-merge hook による副作用が発生した場合は成功扱いにしない)を確認する。timeout/transport exception が発生した場合は、spawn前の OSError(execution_not_started)、timeout後に target HEAD・clean・branch不変(transport_error_but_merged_and_verified)、timeout後にold HEAD・clean(transport_error_no_merge_observed)、その他(transport_error_state_ambiguous)の4分類に区別し、いずれの場合も無条件で postcondition readback を行う。SHA は大文字小文字を区別せず lowercase 変換前の raw 入力で shape 検証し、uppercase SHA は shape 不一致として deny する。classify_rtk_git_mutation は常にこの transaction の結果を理由に元の raw rtk git merge 呼び出しを "deny" として返し(reason_code に transaction outcome を格納)、呼び出し元コマンドを別途再実行させない。

.codex/rules/default.rules は、専用の Codex-allowlist executor script scripts/agent-ops/verified_ff_merge_exec.py --target-sha <sha> の exact invocation のみを allow とする。この executor は自身の authorization(active Issue / matching worktree / cwd binding)を独立に行った上で、共有 Python guard の trusted transaction を呼ぶ。generic rtk git merge(--ff-only を伴う/伴わないに関わらず)は既存の generic prompt bucket のままとし、shadowing を避ける。root checkout・reset・force push・他の merge 形状は引き続き拒否される。

In Scope

  • git_mutation_command_policy.py に execute_verified_ff_merge_transaction を追加する(execute_initial_branch_create_transaction と同じ構造: validate → probe(live ls-remote、canonical fetch URL に対して実行)→ head 再確認 → git merge --ff-only 実行(argv list, shell=False)→ readback)。
  • classify_rtk_git_mutation(_classify_rtk_git_merge)は exact rtk git merge --ff-only <40-hex-sha> を認識する副作用のない pure shape classifier とし、merge 実行や cwd/branch/remote 検査は一切行わない。
  • .claude/hooks/worktree_scope_guard.py に、active Issue 解決・matching worktree 一意性・cwd binding・linked worktree(非 root)判定を全て認可した後にのみ execute_verified_ff_merge_transaction を呼び出す専用関数(_decide_rtk_git_merge 等)を追加する。transaction には認可済みの expected_worktree_realpath・Issue 番号・expected branch を渡して再検証する。
  • target SHA が active non-default issue branch の live remote head(git ls-remote --refs --exit-code origin refs/heads/<active-branch> against canonical fetch URL)と一致し、current local HEAD が target の ancestor であることを、transaction 内で決定論的に確認する。
  • 新規 scripts/agent-ops/verified_ff_merge_exec.py(Codex 専用 executor)を追加する。この executor は独自の authorization(active Issue / matching linked worktree / cwd binding)を行った上で execute_verified_ff_merge_transaction を呼ぶ。
  • .codex/rules/default.rules に、上記 executor の exact invocation のみを allow する専用 rule を追加する。generic rtk git merge(--ff-only の有無を問わず)は既存の prompt bucket に残し、shadowing を避ける。
  • local root/Codex shared guard(local_main_branch_guard.py 系)が root default branch でこの command class を許可しないことを維持する。
  • isolated repository + 実際の git worktree add linked-worktree fixture + bare origin fixture を使い、以下を回帰テストで固定する: 正常な fast-forward、non-fast-forward、stale/mismatched remote-tracking ref、live remote SHA mismatch、短縮/非hex SHA、uppercase SHA、flag順序変更、追加 option、raw git、他の merge 形状、detached HEAD、default branch、dirty tracked/untracked/submodule、進行中 operation残留(per-worktree git-path 解決)、branch/HEAD の検証後変更、root context、reset、force push、canonical fetch URL と push URL の不一致、timeout/transport exception の4分類、codex execpolicy check による executor allow / generic merge prompt の検証、hook-level authorization-ordering(HEAD 不変性)。
  • 既存 scripts/agent-guards/tests/test_git_mutation_command_policy.py、.claude/hooks/tests/test_worktree_scope_guard.py、.claude/hooks/tests/test_local_main_branch_guard.py、tests/codex/test_local_main_branch_guard.py を、新規 command class 追加によるディスパッチ順序・fail-closed fallback の意味論変更に合わせて更新する。
  • docs/dev/hook-boundaries.md に trusted transaction の内容、exact allow 条件、Codex allow rule、deny 境界、authorization-ordering の設計原則を記録する。

Out of Scope

  • 実装: pr_review_only VC の current-head adjudication を修正する #1540 の VC adjudication、fix: pr_review_only VC の current-head 判定を修正する #1544 のコード・PR本文・conflict resolution・review・merge。
  • root checkout または default branch での merge 許可。
  • raw git merge、rtk proxy、shell wrapper、--no-ff、rebase、reset、force push、--ff-only を伴わない他の merge 形状の許可。
  • remote fetch(live ls-remote readback のみで完結し、fetch 自体は行わない)、remote branch update、GitHub branch protection、RTK 本体の一般的な subcommand 許可拡張。
  • 既存 execute_initial_branch_create_transaction / push origin lane 自体の変更。
  • .claude/settings.json の変更(Claude 側の許可判断は hook の permissionDecision で完結し、既存 push origin lane も settings.json 変更なしで成立しているため)。

Acceptance Criteria

  • AC1: 新規 execute_verified_ff_merge_transaction は、attached non-default active branch・clean worktree/index/submodule・canonical origin fetch URL binding・live git ls-remote が target SHA と一致・local HEAD が target の ancestor、を全て満たす場合のみ git merge --ff-only <target_sha> を実行し、成功後に branch 不変・HEAD == target_sha・clean・no operation residue を確認して transaction 成功を返す。
  • AC2: classify_rtk_git_mutation は exact rtk git merge --ff-only <40-hex-sha> を認識すると副作用のない pure shape classifier として allow(authorization pending)を返し、実際の merge 実行と常時 deny 応答は .claude/hooks/worktree_scope_guard.py の認可済み transaction 呼び出しでのみ行われる。
  • AC3: short/non-hex SHA、uppercase SHA、ローカル tracking ref 不一致、live remote SHA mismatch(absent/probe error 含む)、active branch 不一致、non-fast-forward、flag順序変更、追加 option、raw git、他の merge 形状は transaction 実行前に fail-closed で deny される。
  • AC4: worktree scope guard は resolved active Issue の clean linked worktree でのみ、active Issue解決・matching worktree一意・cwd一致・linked worktree判定をすべて認可した後にのみ transaction を呼び、dirty worktree・root context・unresolved/ambiguous worktree・進行中 git operation残留(per-worktree git-path 解決)を deny する。
  • AC5: local main/Codex shared guard は root default branch でこの command class を許可せず、reset と force push の既存 deny を維持する。.codex/rules/default.rules は専用 executor script の exact invocation のみを allow とし、generic rtk git merge(--ff-only の有無を問わず)は shadowing を避けて既存の prompt bucket のままとする。
  • AC6: Hook 境界 SSOT(docs/dev/hook-boundaries.md)に trusted transaction の内容・exact allow 条件・Codex allow rule・deny 境界・authorization-ordering の設計原則が記録され、実装: pr_review_only VC の current-head adjudication を修正する #1540 / PR fix: pr_review_only VC の current-head 判定を修正する #1544 の実装内容を変更しない。

Runtime Verification Applicability

runtime_verification_applicability:
  decision: immediate
  reason: "実際の git merge 実行、live git ls-remote 呼び出し、post-merge hook 副作用、実 Claude/Codex hook wrapper 経由の subprocess 実行、codex execpolicy check を伴うため、一時 git repository + 実際の git worktree add fixture + bare origin を使った統合テストで正常系・異常系・race 条件・authorization-ordering を決定論的に検証する必要があり、静的 parser テストだけでは検証できない。"
  applicable_acs: [AC1, AC2, AC3, AC4, AC5]
  execution_environment: "一時ローカル git repository + 実際の git worktree add linked worktree + bare origin remote(`tmp_path` fixture)。ネットワークアクセス・外部サービス・実 GitHub API 呼び出しは不要。codex execpolicy check は codex CLI が存在する場合のみ実行し、存在しない環境では該当テストを SKIP する。"
  skip_conditions: "git バイナリ、pytest tmp_path fixture、または codex CLI が実行環境に存在しない場合のみ該当部分を SKIP とし、SKIP は PASS として扱わない。"
  fallback_policy: "runtime verification が環境要因で実行不能な場合は human_judgment として停止し、static-only 判定へのフォールバックは行わない。"
  artifact_requirements: "pytest 実行ログ(transaction の allow/deny 理由コード、live ls-remote 呼び出し結果、postcondition 検証結果、codex execpolicy check の decision を含む)をテスト assertion メッセージまたは CI ログに残す。"

Verification Commands

# AC1
$ uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_transaction_allows_live_verified_ancestor_target

# AC2
$ uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_classify_always_denies_raw_command_after_transaction

# AC3
$ uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_rejects_noncanonical_merge_shapes_and_unverified_targets

# AC4
$ uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_worktree_guard_rejects_dirty_root_and_unresolved_contexts

# AC5
$ uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_local_main_and_codex_flavors_keep_root_and_destructive_denies

# AC6
$ rg -n "rtk git merge --ff-only" docs/dev/hook-boundaries.md

Allowed Paths

  • scripts/agent-guards/git_mutation_command_policy.py
  • .claude/hooks/worktree_scope_guard.py
  • scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py(新規)
  • scripts/agent-guards/tests/test_git_mutation_command_policy.py(既存、ディスパッチ順序更新)
  • .claude/hooks/tests/test_worktree_scope_guard.py(既存、command class 追加に伴う更新)
  • .claude/hooks/tests/test_local_main_branch_guard.py(既存、root/Codex deny 維持の回帰確認)
  • tests/codex/test_local_main_branch_guard.py(既存、Codex flavor の回帰確認)
  • .codex/rules/default.rules(既存、専用 executor の exact invocation 用 allow rule 追加)
  • docs/dev/hook-boundaries.md
  • scripts/agent-ops/verified_ff_merge_exec.py(新規、Codex 専用 executor。PR 実装: linked issue worktree の verified fast-forward を RTK guard で許可する #1609 への OWNER 敵対的レビューで P1 blocker 対応として追加)

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • active branch の live remote head と full target SHA の同一性、または HEAD ancestry を local guard 内で決定論的に確認できない場合
  • clean linked worktree の判定に root checkout、PR fix: pr_review_only VC の current-head 判定を修正する #1544、または 実装: pr_review_only VC の current-head adjudication を修正する #1540 の実装変更が必要になる場合
  • execute_initial_branch_create_transaction 自体の変更が必要になる場合

Required Skills

  • Python
  • pytest
  • Git fast-forward / ref safety / live remote readback

Required Design References

Scope Delta(任意)

OWNER レビュー(https://github.com/squne121/loop-protocol/issues/1589#issuecomment-5010752989)を受け、設計を「guard が raw rtk git merge を許可する」方式から「classify_rtk_git_mutation 自身が単一 trusted transaction 内で merge を実行し常に raw command を deny する」既存 execute_initial_branch_create_transaction パターンへ転換した。Allowed Paths に .codex/rules/default.rules と既存4テストファイルを追加し、Runtime Verification Applicability を not_applicable から immediate に変更した。.claude/settings.json は既存 push origin lane と同様に変更不要と判断した。

2回目の Scope Delta(2026-07-19): PR #1609(本 Issue の実装 PR)に対する OWNER の敵対的レビュー(https://github.com/squne121/loop-protocol/pull/1609#issuecomment-5011054192)で、以下の P0/P1/P2 blocker が指摘され修正した。

  • P0: classify_rtk_git_mutation の merge 分岐が merge実行の副作用を持ち、worktree_scope_guard の認可より前に実際の merge を実行していた。副作用なしの pure shape classifier へ変更し、認可判断と transaction 実行の責務を worktree_scope_guard 側に一本化した。
  • P1: Codex allow rule が既存の generic rtk git merge -> prompt に shadowing され実質 prompt のままだった。専用 executor script scripts/agent-ops/verified_ff_merge_exec.py(Allowed Paths に追加)を新設し、Codex の allow rule はこの exact executor コマンドのみを対象とした。
  • P1: operation state 検査が git rev-parse --git-common-dir を使い linked worktree の operation pseudo-ref を誤検出していた。git rev-parse --git-path ベースに修正。
  • P1: canonical remote 検証が push URL のみ確認し、live probe は fetch URL(remote名)を使うため不一致ですり抜け可能だった。fetch URL を一意に解決し検証・probe の両方に使うよう統一。
  • P1: timeout/transport exception 時に常に DENIED を返し、実際の merge完了の可能性を無視していた。4分類の timeout 判定 + 無条件 readback を追加。
  • P2: uppercase SHA を .lower() してから regex 検査していたため受理してしまっていた。raw 入力に対する shape 検証へ修正。

この Scope Delta により Allowed Paths に scripts/agent-ops/verified_ff_merge_exec.py を追加した。Outcome / In Scope / AC1・AC2・AC5 / Runtime Verification Applicability も上記修正内容を反映するよう更新した。#1540 / PR #1544 側の scope の変更は行っていない。

Scope Collision Preflight

ISSUE_OVERLAP_PREFLIGHT_RESULT_V1 は decision: overlap_requires_comment、policy_class: C1、GitHub search/read-back ともに ok。

Delivery Rule

  • 1 Issue = 1 PR とし、dedicated linked worktree で実装して Draft PR を作成する。
  • 実装前に issue-contract-review で fresh CONTRACT_REVIEW_RESULT_V1 status: go を取得する。
  • normal commit / push のみを使用し、force push、guard bypass、hook disable を行わない。

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Jul 18, 2026
  2. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    判定

    status: REQUEST_CHANGES
    summary_1line: 現行契約は「状態を検証してから別プロセスで raw merge を許可する」構造であり、検証した状態と実際に変更される状態を原子的に結び付けられていない。
    next_action: 実装開始前に trusted executor 方式へ Issue 契約を改訂する
    risk_flags:
      - TOCTOU
      - stale_remote_tracking_ref
      - outer_permission_gap
      - RTK_raw_passthrough
      - merge_hook_side_effect
      - runtime_verification_missing
    confidence: high

    Issue #1589 は現在オープンで、Issue コメントはありません。実装PRもリポジトリ検索では確認できませんでした。問題意識自体は妥当ですが、現状の契約のまま実装すると「検証済み fast-forward」という安全性主張が実装より強くなります。

    重大な指摘

    P0 — 検証と merge 実行が分離しており、TOCTOU を閉じていない

    Issue は classify_rtk_git_mutation と worktree_scope_guard で HEAD、branch、cleanliness、tracking SHA、ancestor 関係を確認してから、元の rtk git merge --ff-only <sha> を許可する設計です。

    しかし現行の worktree_scope_guard は shared policy が allow を返した後、単に hook を exit 0 にしており、実際のコマンドはその後に別境界で実行されます。その間に別エージェントやプロセスが次を変更できます。

    • 現在の branch
    • HEAD
    • index / working tree
    • refs/remotes/origin/<branch>
    • operation state

    一方、既存の initial-branch push lane は、この問題を明示的に認識し、probe・write・readback を同一 trusted transaction 内で実施し、呼び出し元の raw command を再実行させない設計です。merge lane だけ旧式の classify-then-allow に戻すのは、リポジトリ内の既存安全基準に反します。

    必須修正: raw rtk git merge の許可ではなく、例えば次の exact executor を唯一の経路にしてください。

    uv run --locked --no-sync python3 \
      scripts/agent-ops/verified_ff_merge_exec.py \
      --target-sha <40-hex-sha> \
      --issue-number <N>

    executor 内で検証、git merge --ff-only <sha>、事後検証まで完了させます。raw git merge と汎用的な rtk git merge は引き続き拒否または prompt のままにすべきです。

    P1 — 「verified」がローカル tracking ref の検証なのか、現在の remote の検証なのか曖昧

    Issue は refs/remotes/origin/<active-branch> との一致を要求しながら、remote fetch を Out of Scope にしています。remote-tracking ref は fetch 等によって更新されるローカルキャッシュであり、現在の GitHub 上の branch head と一致する保証はありません。Git の upstream も常に origin・同名branchとは限らず、branch.<name>.remote と branch.<name>.merge で構成されます。 (Git)

    さらに、現行の publish policy はこの違いを認識しており、remote の現況を主張する場合はローカル tracking ref ではなく、live git ls-remote だけを信頼済み readback source としています。

    契約は次のどちらかに固定する必要があります。

    • cached tracking sync: ローカル tracking ref への同期に限定し、remote freshness は主張しない。
    • live remote verified sync: canonical origin に git ls-remote --refs --exit-code を実行し、live SHA と target SHA の一致も要求する。

    後者でも、live SHA がローカルに存在しない場合は deny すればよいため、fetch 自体を本Issueに含める必要はありません。

    P1 — Codex の配布ルールが変更対象外で、実際には prompt が残る

    現行の .codex/rules/default.rules は rtk git add/commit/push だけを allow し、rtk git merge を明示的に prompt に分類しています。Issue #1589 の Allowed Paths にはこのファイルが含まれていません。したがって hook が許可しても、Codex 側で「承認不要の branch 同期」が成立しません。

    Claude 側も .claude/settings.json に exact rtk git merge 許可はありません。PreToolUse hook で明示的に auto-approve する場合は permissionDecision: "allow" が定義されていますが、deny・ask rules はそれより優先されます。現状の plain exit 0 だけで対象環境すべてが無人実行できることは、契約・テストのどちらでも証明されていません。 ([Claude]2)

    必須修正: 少なくとも次を Allowed Paths と検証対象に追加してください。

    • .codex/rules/default.rules
    • 必要なら .claude/settings.json
    • codex execpolicy check の実行結果
    • Claude / Codex の実 hook wrapper subprocess tests

    ただし、汎用 rtk git merge の静的 allow ではなく、exact executor invocation だけを allow するべきです。

    P1 — RTK はこの操作の安全性境界ではない

    RTK は主として外部CLIの出力を圧縮する proxy です。upstream 実装では専用処理のない Git サブコマンドを external-subcommand 経路へ渡すため、rtk git merge は実質的に raw git merge の passthrough です。RTK 自体が target SHA、branch identity、cleanliness、ancestor 関係を保証するわけではありません。 ([GitHub]3)

    そのため、検証すべき配布物は RTK の表示結果ではなく、以下です。

    • 実環境の rtk --version
    • exact argv が raw Git に渡されること
    • exit code が保存されること
    • target SHA の改変や shell 再解釈がないこと
    • RTK の更新で passthrough 挙動が変わった場合にテストが落ちること

    P1 — merge の副作用モデルが不足している

    --ff-only は non-fast-forward を拒否しますが、成功時には branch、index、working tree を更新します。また Git は成功した merge 後に post-merge hook を実行し、hook directory は core.hooksPath で差し替え可能です。 ([Git]4)

    最低限、executor は次を確認すべきです。

    • attached HEAD である
    • active branch が non-default issue branch である
    • upstream remote/ref が期待値と完全一致する
    • target が commit object である
    • tracked、untracked、submodule を含めて clean である
    • MERGE_HEAD、CHERRY_PICK_HEAD、rebase state 等が存在しない
    • merge 直前に branch / HEAD / target ref を再読する
    • merge 後に branch 不変、HEAD == target_sha、clean を確認する
    • post-merge hook による変更が発生した場合は成功扱いにしない

    P1 — Runtime Verification を N/A にしてはいけない

    これは parser の静的テストだけでは検証できない runtime mutationです。Issue の Runtime Verification を immediate に変更し、temporary repository と bare origin を使った隔離テストを必須にすべきです。

    必要なケースは以下です。

    • 正常な fast-forward
    • non-fast-forward
    • stale remote-tracking ref
    • live remote SHA mismatch
    • detached HEAD
    • default branch
    • upstream mismatch
    • dirty tracked / untracked / submodule
    • branch または HEAD の検証後変更
    • tracking ref の検証後変更
    • post-merge hook がファイルを変更するケース
    • Claude / Codex の実 hook wrapper
    • codex execpolicy check
    • 実 RTK binary 経由

    P2 — #1542 と同一関数を変更するため、C1扱いだけでは弱い

    Issue #1542 も git_mutation_command_policy.py と既存 classifier tests を変更します。現時点で必ずしも機能衝突しているとは限りませんが、両Issueが同時実装されると merge conflictだけでなく、subcommand dispatch順序や fail-closed fallback の意味論が変わる可能性があります。

    実装開始時とPR作成直前に #1542 のheadを再取得し、同時進行なら直列化してください。また新規テストファイルだけでなく、既存の以下も更新対象です。

    • scripts/agent-guards/tests/test_git_mutation_command_policy.py
    • .claude/hooks/tests/test_worktree_scope_guard.py
    • .claude/hooks/tests/test_local_main_branch_guard.py
    • tests/codex/test_local_main_branch_guard.py

    推奨する契約

    command_class: verified_ff_merge_executor
    input:
      target_sha: exact lowercase 40-hex
    preconditions:
      - resolved active issue
      - exact linked issue worktree cwd
      - attached non-default active branch
      - canonical origin/upstream binding
      - clean worktree/index/submodules
      - no in-progress git operation
      - target is a local commit object
      - target matches configured tracking ref
      - optional live ls-remote matches target
      - HEAD is ancestor of target
    execution:
      - verification and git merge --ff-only run in one trusted executor
      - argv list with shell=false
      - original raw command is never re-executed
    postconditions:
      - active branch unchanged
      - HEAD equals target_sha
      - worktree/index clean
      - no operation residue
    permissions:
      - only exact executor allowed
      - raw git merge denied
      - generic rtk git merge denied or prompted

    GitHubコメント案

    Verdict: REQUEST_CHANGES

    目的は妥当ですが、現行契約のままでは verified fast-forward を保証できません。

    Blockers

    1. TOCTOU

      • shared policy が状態を検証した後、hook は元の rtk git merge を別実行として許可します。
      • 検証後に branch、HEAD、worktree、tracking ref が変化できます。
      • 既存 initial-branch push lane と同様、検証・mutation・readback を一つの trusted executor 内で完了させ、元コマンドを再実行させない構造が必要です。
    2. remote freshness の意味が不明確

      • refs/remotes/origin/<branch> はローカル tracking ref であり、live remote head ではありません。
      • cached tracking ref への同期だけを保証するのか、git ls-remote による current remote verification まで行うのかを契約に明記してください。
    3. Codex permission scope が不足

      • 現行 .codex/rules/default.rules は rtk git merge を prompt に分類しています。
      • Allowed Paths に同ファイルがなく、承認不要の branch 同期という Outcome を満たせません。
      • generic merge ではなく exact executor invocation だけを allow してください。
    4. Runtime Verification が必要

      • temporary repository + bare origin を使用し、正常系、non-FF、stale tracking ref、remote drift、dirty state、detached/default branch、branch/HEAD race、post-merge hook、Claude/Codex wrapper、実 RTK binary を検証してください。
      • Runtime Verification Applicability を N/A ではなく immediate に変更してください。

    Required design

    rtk git merge の raw allow ではなく、例えば verified_ff_merge_exec.py --target-sha <sha> を canonical command とし、同executor内で precondition確認、git merge --ff-only <sha>、postcondition確認まで完了させてください。

    raw git merge と汎用 rtk git merge は引き続き deny/prompt とする必要があります。

    Issue #1589 に契約更新または実装PRが追加された時点で再レビューする監視も設定可能です。

  3. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

  4. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-18T10:07:34Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1589
      body_sha256: "sha256:ea9bf49593e37c0d7591bb32c2ceaa287592cfa2bc73ea41a99bce3638c80854"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:ea9bf49593e37c0d7591bb32c2ceaa287592cfa2bc73ea41a99bce3638c80854","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_transaction_allows_live_verified_ancestor_target","command_hash":"sha256:11cb3dcb1b97d0b1dc0754e67d8864a1c6e5645c460dfff68d8c7d1bd7cb39e1","execution_key_hash":"sha256:662afb280e0add272352ddfe295e1e95b36b88561980d9381c00f7fda9774a97","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collected 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":9,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_transaction_allows_live_verified_ancestor_target"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":210,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":5,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_classify_always_denies_raw_command_after_transaction","command_hash":"sha256:8d8f2ac6129fc909b140686bf2b306634fee0b79f38ceeabf77ed1f076a48d7c","execution_key_hash":"sha256:efac94af4309e0397d18a7a605dbbd5460327a795dc096a1b4582a9caf53d4f6","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collected 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":9,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_classify_always_denies_raw_command_after_transaction"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":200,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":8,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_rejects_noncanonical_merge_shapes_and_unverified_targets","command_hash":"sha256:1ebca250098776feeb0d32da812041256355e10c0e568bec13da889ae14e8b0b","execution_key_hash":"sha256:4687ad4a7d12be63ad3f44ceb88523b843a85c58ebd4860a0b9d7454cf826951","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collected 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":9,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_rejects_noncanonical_merge_shapes_and_unverified_targets"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":182,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC4","line":11,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_worktree_guard_rejects_dirty_root_and_unresolved_contexts","command_hash":"sha256:2afa2e5953fd8855da61689ebb5ee8a83a0afcc688be8ef64bd51a30e132439e","execution_key_hash":"sha256:ff4793e80eb5000bbf893fc2df8cbd42e0ae44c0bf54fc00622ca265a12d4316","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collected 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":9,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_worktree_guard_rejects_dirty_root_and_unresolved_contexts"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":172,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC5","line":14,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_local_main_and_codex_flavors_keep_root_and_destructive_denies","command_hash":"sha256:88e5393bf421d652605fb3df69252df85f454aa24e33a24040b2930813c1e0c9","execution_key_hash":"sha256:efa86d1d84a8b44577c9fdb223c6dc7fe1ef9b350add92d8a2f201b4fd3404ed","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collected 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":9,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_local_main_and_codex_flavors_keep_root_and_destructive_denies"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":196,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":17,"raw_command":"rg -n \"rtk git merge --ff-only\" docs/dev/hook-boundaries.md","command_hash":"sha256:b540b3959505b54dac397d2fb9a5954c789662ed79c8ea0ad148fc4473e8b30c","execution_key_hash":"sha256:e4b9401e12f64afff2f49d6d254f05240e4b0ca857a11f417081f1636c6727de","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":3,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null}]
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1589,"contract_source_kind":"issue_comment","contract_source_id":"5010861220","contract_body_sha256":"sha256:ea9bf49593e37c0d7591bb32c2ceaa287592cfa2bc73ea41a99bce3638c80854","allowed_paths_normalized_sha256":"c197907903865ed58e91c9e49b97679b79e0e277f946d9391c383e0446a2250e","base_ref":"main","base_sha_at_snapshot":"8e842c1e46a5e0b76621b6373a09357347eaa08e"}
  5. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-18T15:21:34Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1589
      body_sha256: "sha256:bf26464ac427a17dcd28f7f3c6add8001bad34138f5699af3cc4e227cd67f4e6"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:bf26464ac427a17dcd28f7f3c6add8001bad34138f5699af3cc4e227cd67f4e6","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_transaction_allows_live_verified_ancestor_target","command_hash":"sha256:11cb3dcb1b97d0b1dc0754e67d8864a1c6e5645c460dfff68d8c7d1bd7cb39e1","execution_key_hash":"sha256:662afb280e0add272352ddfe295e1e95b36b88561980d9381c00f7fda9774a97","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collected 0 items","============================ no tests ran in 0.00s ============================="],"stdout_truncated":false,"stdout_original_line_count":9,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_transaction_allows_live_verified_ancestor_target"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":170,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":5,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_classify_always_denies_raw_command_after_transaction","command_hash":"sha256:8d8f2ac6129fc909b140686bf2b306634fee0b79f38ceeabf77ed1f076a48d7c","execution_key_hash":"sha256:efac94af4309e0397d18a7a605dbbd5460327a795dc096a1b4582a9caf53d4f6","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collected 0 items","============================ no tests ran in 0.00s ============================="],"stdout_truncated":false,"stdout_original_line_count":9,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_classify_always_denies_raw_command_after_transaction"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":159,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":8,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_rejects_noncanonical_merge_shapes_and_unverified_targets","command_hash":"sha256:1ebca250098776feeb0d32da812041256355e10c0e568bec13da889ae14e8b0b","execution_key_hash":"sha256:4687ad4a7d12be63ad3f44ceb88523b843a85c58ebd4860a0b9d7454cf826951","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collected 0 items","============================ no tests ran in 0.00s ============================="],"stdout_truncated":false,"stdout_original_line_count":9,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_rejects_noncanonical_merge_shapes_and_unverified_targets"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":174,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC4","line":11,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_worktree_guard_rejects_dirty_root_and_unresolved_contexts","command_hash":"sha256:2afa2e5953fd8855da61689ebb5ee8a83a0afcc688be8ef64bd51a30e132439e","execution_key_hash":"sha256:ff4793e80eb5000bbf893fc2df8cbd42e0ae44c0bf54fc00622ca265a12d4316","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collected 0 items","============================ no tests ran in 0.00s ============================="],"stdout_truncated":false,"stdout_original_line_count":9,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_worktree_guard_rejects_dirty_root_and_unresolved_contexts"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":178,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC5","line":14,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_local_main_and_codex_flavors_keep_root_and_destructive_denies","command_hash":"sha256:88e5393bf421d652605fb3df69252df85f454aa24e33a24040b2930813c1e0c9","execution_key_hash":"sha256:efa86d1d84a8b44577c9fdb223c6dc7fe1ef9b350add92d8a2f201b4fd3404ed","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collected 0 items","============================ no tests ran in 0.00s ============================="],"stdout_truncated":false,"stdout_original_line_count":9,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_rtk_ff_only_merge_policy.py::test_local_main_and_codex_flavors_keep_root_and_destructive_denies"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":181,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":17,"raw_command":"rg -n \"rtk git merge --ff-only\" docs/dev/hook-boundaries.md","command_hash":"sha256:b540b3959505b54dac397d2fb9a5954c789662ed79c8ea0ad148fc4473e8b30c","execution_key_hash":"sha256:e4b9401e12f64afff2f49d6d254f05240e4b0ca857a11f417081f1636c6727de","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null}]
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1589,"contract_source_kind":"issue_comment","contract_source_id":"5011793237","contract_body_sha256":"sha256:bf26464ac427a17dcd28f7f3c6add8001bad34138f5699af3cc4e227cd67f4e6","allowed_paths_normalized_sha256":"2c03b168af26f1d28df98824115698a60aa34499c7cf651579de8cfdcdb72cc2","base_ref":"main","base_sha_at_snapshot":"5992b2a028354c5463c1b11742143185f36c0a28"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions