Skip to content

fix: implementation-worker.toml と open_pr.py の legacy artifact hard gate を除去 - #1854

Merged
squne121 merged 3 commits into
mainfrom
worktree-issue-1851-legacy-artifact-hard-gate-removal
Jul 30, 2026
Merged

squne121 merged 3 commits into
mainfrom
worktree-issue-1851-legacy-artifact-hard-gate-removal

Conversation

@squne121

@squne121 squne121 commented Jul 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Issue 実装: implementation-worker.toml と open_pr.py の legacy artifact hard gate を除去する #1851 の Outcome に従い、contract_snapshot_url / CONTRACT_REVIEW_RESULT_V1 status: go / overlap preflight artifact のいずれも任意 telemetry として扱い、欠落・stale・invalid でも実装着手および PR publication を止めないよう変更する。
  • .codex/agents/implementation-worker.toml の INPUT_CONTRACT を issue_number + live Issue 取得成功のみ必須に降格。
  • .claude/skills/impl-review-loop/steps/preparation.md の Intake Gate から missing_contract_go サブ理由(専用 ensure_contract_snapshot 自動 routing・triage normalizer 一式)を完全に除去し、残り 4 サブ理由に再採番。
  • .claude/skills/open-pr/scripts/open_pr.py の overlap preflight gate(canonical repo 解決失敗・gate 判定失敗の 2 箇所)を warning-only 化(WARNING/WARNING_DETAIL kv で記録は残しつつ PR 作成は止めない)。無関係な return 2(publish 承認欠落・pr-body-file 欠落・repo/branch 解決失敗・validator 失敗・gh pr create 失敗等)は挙動を変えず EXIT_BLOCKED 定数へ置換。

Checks

  • uv run --locked pytest .claude/skills/open-pr/ .claude/skills/impl-review-loop/ -q を実行し全件成功を確認した(789 passed, 2 deselected, 2 xfailed)

受け入れ条件の達成状況

  • AC1: .codex/agents/implementation-worker.toml から contract_snapshot_url を必須とする記述を削除した。根拠: grep -n "contract_snapshot_url.*必須" .codex/agents/implementation-worker.toml → マッチなし(削除済みを確認)
  • AC2: .claude/skills/impl-review-loop/steps/preparation.md の Intake Gate から missing_contract_go サブ理由を完全に除去した。根拠: grep -c "missing_contract_go" .claude/skills/impl-review-loop/steps/preparation.md → 0
  • AC3: .claude/skills/open-pr/scripts/open_pr.py の無関係な fail-closed 経路のリテラル return 2 を EXIT_BLOCKED 定数へ置換した(overlap preflight gate 部分は warning-only 化)。根拠: grep -c "return 2" .claude/skills/open-pr/scripts/open_pr.py → 0
  • AC4: 上記変更後も既存テストが全件成功することを確認した。根拠: uv run --locked pytest .claude/skills/open-pr/ .claude/skills/impl-review-loop/ -q → 789 passed, 2 deselected, 2 xfailed

Schema Change Applicability

  • decision: not_schema_change
  • reason: INTAKE_GATE_RESULT_V1.subreason の enum 値を 1 つ削除(missing_contract_go)したが、これは skill 手順書内の列挙値であり外部公開スキーマ/JSON contract のフィールド追加・削除ではない。open_pr.py の exit code (2) はそのまま維持し、内部定数名を変更したのみ。WARNING/WARNING_DETAIL kv は既存の ERROR/ERROR_DETAIL kv と並行する追加的 stdout 出力であり、既存 consumer の破壊的変更ではない。

Schema Consumer Inventory

N/A
reason: schema を変更しないため inventory は不要

Safety Claim Matrix

# SAFETY_CLAIMS_V1
safety_claims:
  - claim: overlap preflight gate (open_pr.py) の変更は blocking を warning-only にするのみで、他の fail-closed 経路(publish 承認欠落・pr-body-file 欠落・repo/branch 解決失敗・PR body validator 失敗・Japanese content validator 失敗・gh pr create 失敗・PR URL 空)は EXIT_BLOCKED(従来と同じ exit code 2)のまま維持する
    implemented: "yes"
    evidence:
      - "grep -c \"return 2\" .claude/skills/open-pr/scripts/open_pr.py → 0(リテラル文字列は EXIT_BLOCKED 定数化により消滅、exit code 自体は 2 のまま不変)"
      - "uv run --locked pytest .claude/skills/open-pr/ -q → 294 passed(unrelated failure path は rc==2 のまま検証済み)"
  - claim: implementation-worker.toml / preparation.md の変更は着手ゲートを弱めるが、live Issue contract 取得失敗・canonical worktree identity 不一致・Allowed Paths 違反・実テスト失敗等の独立した安全境界は変更していない
    implemented: "yes"
    evidence:
      - "preparation.md 冒頭の Issue #1830 precedence(L1-17)に記載の『停止条件は live Issue の不在、明示 Issue と canonical worktree identity の不一致、root checkout、detached HEAD、dirty worktree、Allowed Paths 違反、実テスト・CI・PR review の失敗など』は本 PR で変更していない"
  - claim: overlap preflight gate が warning-only 化されても、レビュー時点で pr-review-judge が git diff から独立に Allowed Paths を再計算する(本 PR がその gate 自体ではない)
    implemented: "yes"
    evidence:
      - "docs/dev/agent-skill-boundaries.md の ALLOWED_PATHS_GATE_RESULT_V1 producer_role: review_subagent 契約は本 PR で変更していない"

Notes

  • Related issue: 実装: implementation-worker.toml と open_pr.py の legacy artifact hard gate を除去する #1851
  • Runtime Verification Applicability: not_applicable(静的検証・pytest のみで完結する Issue)
  • CI/test-lane advisory (CI_TEST_PERFORMANCE_DECISION_V1):
    CI_TEST_PERFORMANCE_DECISION_V1:
      applicable: false
      reason: "`.codex/agents/` 配下の変更だが、CI ワークフロー定義・pytest/Ruff/xdist 設定・test-lane-policy には触れていない。custom agent の INPUT_CONTRACT 文言変更のみ。"

本 PR は Issue #1851 の Outcome を満たす。Closes #1851

…ate を除去 (#1851)

contract_snapshot_url / CONTRACT_REVIEW_RESULT_V1 status: go / overlap
preflight artifact のいずれも任意 telemetry として扱い、欠落・stale・
invalid でも実装着手・PR publication を止めないよう変更する。

- .codex/agents/implementation-worker.toml: INPUT_CONTRACT を
  issue_number + live Issue 取得成功のみを必須とし、contract_snapshot_url
  を任意 telemetry に降格。
- .claude/skills/impl-review-loop/steps/preparation.md: Intake Gate の
  missing_contract_go サブ理由(および専用 ensure_contract_snapshot 自動
  routing・triage normalizer)を完全に除去し、ファイル冒頭の Issue #1830
  precedence と整合させる。
- .claude/skills/open-pr/scripts/open_pr.py: overlap preflight gate
  (canonical repo 解決失敗・gate 判定失敗)を warning-only 化し、PR
  作成を止めない(stderr へ WARNING kv として記録は残す)。無関係な
  return 2(publish 承認欠落・pr-body-file 欠落・repo/branch 解決失敗・
  validator 失敗・gh pr create 失敗等)は EXIT_BLOCKED 定数に置換し、
  fail-closed 挙動そのものは変更しない。
- 既存テスト(test_intake_gate.py / test_triage_contract_blockers.py /
  test_open_pr_overlap_gate.py)の期待値を新挙動に合わせて更新。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-1854/

The preview will be removed when this PR is closed.

@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

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "6a06af57679991b085c69d3d5142cb08f6e6b6eb"
  merge_ready: true
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers: []
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    schema: ALLOWED_PATHS_GATE_RESULT_V1
    producer_role: review_subagent
    worker_report_used_as_canonical: false
    status: ok
    changed_files_source: git_diff_name_status_find_renames_z
    audited_paths:
      - path: .claude/skills/impl-review-loop/steps/preparation.md
        status: modified
        in_allowed_paths: true
      - path: .claude/skills/impl-review-loop/tests/test_intake_gate.py
        status: modified
        in_allowed_paths: true
      - path: .claude/skills/impl-review-loop/tests/test_triage_contract_blockers.py
        status: modified
        in_allowed_paths: true
      - path: .claude/skills/open-pr/scripts/open_pr.py
        status: modified
        in_allowed_paths: true
      - path: .claude/skills/open-pr/scripts/tests/test_open_pr_overlap_gate.py
        status: modified
        in_allowed_paths: true
      - path: .codex/agents/implementation-worker.toml
        status: modified
        in_allowed_paths: true
    violations: []

再検証サマリ

  • AC1-4 を独立 worktree で fresh 再実行し全て PASS(grep AC1-3 マッチ期待通り、pytest 789 passed, 2 deselected, 2 xfailed)。
  • CI 16件 all_pass、mergeable: MERGEABLE、mergeStateStatus: CLEAN。
  • Allowed Paths: 変更6ファイル全て Issue #1851 の Allowed Paths 内、scope 混入なし。
  • PR body hygiene: ## 受け入れ条件の達成状況(AC1-4 各 [x] + VC + 結果)、Closes #1851、Schema Change Applicability、Safety Claim Matrix 全て存在。
  • blocker なし・required_auto_actions 空のため merge_ready: true。人間による最終マージ判断を待つ。

@squne121

Copy link
Copy Markdown
Owner Author

判定

REQUEST_CHANGES — マージブロック相当です。

PR #1854 は現在 Draft・未マージで、head は 6a06af57679991b085c69d3d5142cb08f6e6b6eb、変更は1コミット・6ファイルです。取得できた head SHA の GitHub Actions はすべて成功しています。

ただし、グリーンCIにもかかわらず、以下が残っています。


Blocker 1: artifact 不在時の実ルーターが未変更で、Step 1 に到達しない

preparation.md 冒頭には、contract snapshot の missing / stale / invalid は warning のみとし、停止しないと書かれています。しかし、直後の capsule-first 手順では、build_intake_capsule.py の next_action.route が proceed_to_step_1 の場合だけ実装へ進むことを要求しています。

その canonical producer は本PRで変更されておらず、現在も次のルーティングです。

go              -> proceed_to_step_1
missing_go      -> ensure_contract_snapshot
latest_blocked  -> run_contract_blocker_triage
stale           -> refresh_contract_snapshot
その他          -> human_review_required

さらに既存テストは、snapshot がない場合に ensure_contract_snapshot へ進むことを明示的に正解として固定しています。

したがって実際の経路は以下になります。

  1. contract_snapshot_url なしで impl-review-loop を開始する
  2. build_intake_capsule.py が normalized_status: missing_go を生成する
  3. next_action.route: ensure_contract_snapshot が返る
  4. capsule-first 契約により Step 1 implementation へ進めない

これは Issue #1851 が解消しようとしているケースそのものです。PRは preparation.md 内の missing_contract_go という文字列と説明節を削除しただけで、実際にルーティングを決める producer を更新していません。

Issue #1851 は 0-a. Intake capsule-first を live Issue のみで次ステップへ進めるよう変更することを明示しています。また、必要な変更が Allowed Paths 外に及ぶ場合は Stop Condition です。build_intake_capsule.py とそのテストは現在の Allowed Paths に含まれていません。

必須修正

Issue #1851 の Allowed Paths を少なくとも次まで拡張するか、ブロッキングな別Issueへ分割する必要があります。

.claude/skills/impl-review-loop/scripts/build_intake_capsule.py
.claude/skills/impl-review-loop/tests/test_build_intake_capsule.py
.claude/skills/impl-review-loop/SKILL.md

artifact を本当に advisory にするなら、ready tuple が正常な場合は missing_go / stale / runtime_error / incomplete evidence を warning として保持しつつ proceed_to_step_1 を返す必要があります。

なお、trusted author による最新の明示的な blocked / request_changes まで無視するかは、artifact freshness とは別の判断です。これを停止条件として残すなら、latest_blocked を「snapshot hard gate」ではなく、独立した human veto 境界として再定義し、Issue #1851 の「すべて任意 telemetry」という記述から明示的に除外すべきです。


Blocker 2: canonical repository 解決失敗の fail-open は、artifact 緩和ではなく mutation target の弱体化

resolve_canonical_repository() 自体の契約は現在も明確です。

  • GitHub Repository API で canonical full_name を取得する
  • rename / transfer 後の alias を現在のrepositoryへ解決する
  • オンライン解決に失敗した場合は静的 fallback しない
  • 呼び出し元は停止する

ところが本PRの main() は、その戻り値が None の場合に warning を出した後、raw repo へフォールバックし、その値で run_overlap_preflight_gate() と gh pr create --repo を実行します。

これは overlap artifact の欠落・stale・invalid を warning にする変更とは性質が異なります。PRをどのrepositoryへ作るかという mutation target identity の検証です。

過去の Issue #1470 は、この三者を同一 canonical repository に束縛するための専用Issueでした。

  • stored evidence
  • fresh evidence
  • gh pr create --repo

また cross-repo reuse 時には gh pr create を一度も呼ばないことを受け入れ条件にしていました。

本PR後のテストはさらに危険です。test_cross_repo_same_issue_number_is_rejected という名前と「PR作成は呼ばれない」というdocstringを維持したまま、実際のassertionを create_called is True に反転しています。テスト名・説明・期待値が互いに矛盾しています。

GitHub公式資料では、repository rename 後の旧URLは通常リダイレクトされますが、旧repository名が後に再利用されるとそのリダイレクトは機能しなくなるとされています。GitHub REST APIの公式ベストプラクティスも、301リダイレクト先へ追従して将来のURLを更新し、APIエラーを無視しないよう求めています。raw alias は canonical mutation target の代替にはなりません。 ([GitHub Docs]1)

必須修正

緩和境界を次のように分離してください。

canonical repository 解決:
  fail-closedを維持

stored/fresh overlap evidence:
  missing / invalid / drift / unsafe route をwarning-only化可能

具体的には、以下のフォールバックを撤回します。

if target_repo is None:
    emit_warning(...)
    target_repo = repo

代わりに canonical resolution failure は従来どおり EXIT_BLOCKED とし、artifact検査結果だけを advisory にしてください。


Major 1: warning が stdout にしか存在せず、Issue要件の stderr / PRコメント記録を満たしていない

Issue #1851 は、overlap preflight を warning-only にしながらも、stderr / PRコメントへの記録を残すことを In Scope にしています。

しかし emit_warning() は emit_kv() を呼ぶだけで、通常の print() による stdout 出力です。

WARNING=<code>
WARNING_DETAIL=<detail>

stderrへの出力も、PR本文への追加も、PRコメント投稿もありません。docstringには「stdout/PR body evidence」とありますが、実装はstdoutだけです。

その後の処理も create_pr() を実行して URL を出力するだけで、warningを本文へ反映したり、作成後にコメントを投稿したりしていません。

さらに次の経路では overlap check 自体が実行されません。

  • 既存PRが見つかった場合
  • --dry-run の場合

いずれも overlap preflight より前に return しています。

また canonical resolution failure と evidence failure が連続すると、同一stdoutに複数の WARNING= / WARNING_DETAIL= が出ます。単純なKEY=VALUE consumerがdictへ変換すれば、前のwarningが後のwarningに上書きされます。

必須修正

warningを構造化された配列として保持してください。

OVERLAP_PREFLIGHT_WARNINGS_V1:
  - code: E_OVERLAP_PREFLIGHT_SOURCE_FAILURE
    stage: canonical_repository_resolution
    detail: ...
  - code: E_OVERLAP_PREFLIGHT_EVIDENCE_INVALID
    stage: stored_evidence_validation
    detail: ...

PR作成後には、固定marker付きのコメントとして永続化します。

<!-- loop-protocol:overlap-preflight-warnings-v1 -->

GitHub CLI公式実装では、gh pr create は成功時にPR URLを返し、gh pr comment はPR番号・URL・branchを指定して --body-file からコメントを投稿できます。したがって、現在のCLI構成のまま実装可能です。(GitHub CLI)

GitHub Actions上でもwarningを目立たせる必要があるなら、通常の WARNING= ではなく公式workflow commandの ::warning ...::message を併記してください。これはログだけでなくActions annotationを生成します。([GitHub Docs]3)

PRコメント投稿失敗はpublicationを巻き戻さなくてよいものの、少なくとも次を返すべきです。

WARNING_PERSISTED=false
WARNING_PERSIST_ERROR=...

Major 2: 正本の設計文書・Skill・CLI help が依然 hard gate を要求している

このリポジトリではSkill文書が実行手順として消費されるため、文書不整合は単なるdocumentation debtではありません。

docs/dev/agent-skill-boundaries.md は自らを責務境界の正本とし、open-pr consumer に対して既存hard gateとunsafe-decision mutation denyを維持するよう要求しています。

一方、本PRのコードはそれをwarning-onlyに変更します。Issue #1851 は同文書を Required Design Reference に指定していますが、文書を更新していません。

ほかにも次の矛盾があります。

  • impl-review-loop/SKILL.md は現在も status: go 不在時に ensure_contract_snapshot.py を呼び、結果次第で停止すると規定している。
  • open-pr/SKILL.md は現在もセクション名を Overlap Preflight Hard Gate とし、canonical resolution failure、repository mismatch、unsafe route等で停止すると規定している。
  • open_pr.py --help は --overlap-preflight-required を「検証を必須化する」「phase/implementationなら自動的に必須」と説明している。
  • preparation.md の見出しも依然として CONTRACT_REVIEW_RESULT_V1 status: go 必須検査 であり、stale review・body snapshot mismatch・request changes後のgoを intake_gate_failed として停止させている。

LLM/agentは、冒頭の「advisory precedence」と後半の「必須・停止」のどちらを優先するかで挙動が分岐します。コードだけwarning-onlyにしても、orchestratorがSkill文書を解釈して事前停止する可能性が残ります。

必須修正

少なくとも以下を同一変更単位で同期する必要があります。

.claude/skills/impl-review-loop/SKILL.md
.claude/skills/impl-review-loop/steps/preparation.md
.claude/skills/open-pr/SKILL.md
.claude/skills/open-pr/scripts/open_pr.py
docs/dev/agent-skill-boundaries.md

gate / required / fail-closed という命名も、advisory checkへ合わせて変更すべきです。

overlap_gate_active
  -> overlap_check_active

--overlap-preflight-required
  -> --overlap-preflight-check

後方互換性が必要なら旧flagをdeprecated aliasとして残します。


Major 3: テストとSchema Change判定が、挙動ではなく文字列消去だけを検証している

PR本文の主な証跡は次です。

  • missing_contract_go のgrep件数が0
  • リテラル return 2 のgrep件数が0
  • 既存pytestが成功

しかし、この方法では次を検出できません。

  • 別producerが ensure_contract_snapshot を返す
  • return EXIT_BLOCKED に置換された停止
  • Skill側がコード実行前に停止する
  • warningがPRへ永続化されない
  • canonical targetの解決失敗をraw repoで続行する

実際、既存テストは旧ルーティングを維持したまま成功しています。また、repository mismatchを「rejectする」と説明しているテストが、PR作成成功を期待するようassertionだけ変更されています。

加えてPRは not_schema_change、Schema Consumer InventoryはN/Aとしていますが、実際には以下の機械可読contractを変更しています。

  • INTAKE_GATE_RESULT_V1.subreason のenumから値を削除
  • open_pr.py stdoutへ WARNING / WARNING_DETAIL を追加
  • 同じkeyを複数回出し得る新しい出力形を導入

INTAKE_GATE_RESULT_V1 の変更はPR差分上でも明示されています。

今回見落とされた build_intake_capsule.py、impl-review-loop/SKILL.md、open-pr/SKILL.md は、まさにSchema Consumer Inventoryを実施すれば列挙されるべきconsumerです。

必須テスト

最低限、次の振る舞いテストが必要です。

1. snapshotなし
   -> implementation workerへ到達する
   -> warningが記録される

2. stale / malformed snapshot
   -> implementation workerへ到達する
   -> warning codeが保持される

3. trusted blocked / request_changes
   -> ownerが決めた独立human-veto policyに従う

4. invalid overlap evidence
   -> PR作成成功
   -> PRコメントにwarningが存在する

5. canonical repository resolution failure
   -> PR作成されない

6. repository Aのevidenceをrepository Bで使用
   -> PR作成されない

7. warningが2件以上
   -> 両方のcode/detailが順序付きで保持される

8. existing PR経路
   -> warning commentの作成または更新が再試行可能

9. dry-run
   -> mutationせずwarning previewを出す

Issue #1851 はartifactなしのE2EをOut of Scopeにしていますが、今回のように実ルーターが別ファイルに残っている以上、少なくとも build_intake_capsule -> preparation routing -> implementation delegation の結合テストは本修正の前提です。現在のスコープ設定自体を修正する必要があります。


修正方針

修正順序は次が妥当です。

  1. canonical repository bindingを復元する
    resolve_canonical_repository() 失敗時は従来どおり停止させる。

  2. Issue 実装: implementation-worker.toml と open_pr.py の legacy artifact hard gate を除去する #1851 のスコープを更新する
    build_intake_capsule.py、両Skill、設計正本をAllowed Pathsへ追加する。追加しない場合は別Issueを起票し、#1854をその完了に依存させる。

  3. artifact stateのルーターを変更する
    missing / stale / malformed / source failureをwarningへ正規化し、live Issue ready tupleが正常ならStep 1へ進める。

  4. warningを永続化する
    structured array、stderr、Actions annotation、marker付きPRコメントを実装する。

  5. 文字列grepではなくbehavior testへ置き換える
    特に test_cross_repo_same_issue_number_is_rejected の名称・docstring・assertionを同じ意味に戻す。

  6. Schema Consumer Inventoryを作成する
    machine-readable enumとstdout contractの変更として扱い、全consumerを列挙する。


非ブロッキング評価

次の変更自体は妥当です。

  • .codex/agents/implementation-worker.toml で contract_snapshot_url を必須入力から外す方向
  • 無関係なexit code 2 を EXIT_BLOCKED 定数へ置換するリファクタリング
  • PR body validator、日本語validator、publish approval、gh pr create 自体の失敗を引き続きblockingにしている点
  • head SHAの現行CIが成功している点

ただし、これらは上記Blockerを相殺しません。

ローカル再実行については、実行環境から github.com のDNS解決ができずcloneできなかったため、固定head SHAのGitHub上の実ファイル、差分、テスト期待値、workflow readbackを用いて判定しました。今回の主要Blockerは静的に決定できる制御フロー矛盾であり、現行CI成功とも両立してしまう問題です。

squne121 and others added 2 commits July 30, 2026 20:38
…g fail-closed復元

Blocker 1: build_intake_capsule.py の _next_action_route を修正し、
missing_go/stale/runtime_error は issue_ready_status == pass の場合
無条件で proceed_to_step_1 を返すようにした(latest_blocked の human veto
境界は維持)。impl-review-loop/SKILL.md の Guardrails 記述も advisory
artifact policy と整合するよう書き換え。

Blocker 2: open_pr.py の resolve_canonical_repository() 失敗時の
fail-open フォールバックを削除し、overlap_gate_active に関わらず
常に fail-closed(EXIT_BLOCKED)に戻した。stored/fresh evidence の
repository field binding 検証も新しい
E_OVERLAP_PREFLIGHT_REPOSITORY_BINDING_INVALID で fail-closed のまま
維持し、それ以外の overlap preflight evidence 検証は advisory
(warning + PR create 継続)のまま分離した。

Major 1: overlap evidence advisory warning を stderr にも出力し、
PR 作成成功後に固定 marker 付き PR コメントとして永続化する
post_overlap_warning_comment() を追加。

Major 2: open-pr/SKILL.md の Overlap Preflight 節と
docs/dev/agent-skill-boundaries.md の open-pr consumer 行を、
fail-closed(canonical repository 解決 / repository binding)と
advisory(evidence 妥当性検証)の区分に合わせて更新。

AC5-AC9 の新規/更新テストを追加し、既存の repository-binding regression
テスト7件を実際の fail-closed 挙動に合わせて更新した。

Closes #1851

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…epository を mock

CI の python-test-core が resolve_canonical_repository() の実ネットワーク呼び出し
に依存し non-deterministic に落ちていた。main() が overlap_gate_active に関わらず
常に resolve_canonical_repository() を呼ぶよう変更された後、この既存テストのみ
monkeypatch されておらず、実 gh 呼び出しが CI サンドボックスで None を返し
EXIT_BLOCKED になっていた。

Refs #1851

@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

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "2c8b8ad4070d2b1d235bf646ca62392d5e3f1680"
  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
    producer_role: review_subagent
    worker_report_used_as_canonical: false
    diff_base_sha: "79de2b2dde1ee0c53e4747e8801f3ab52e5911d8"
    diff_head_sha: "2c8b8ad4070d2b1d235bf646ca62392d5e3f1680"
    changed_files_count: 15
    out_of_scope_files: []

再検証サマリ(iteration 3)

前回 REQUEST_CHANGES(comment)で指摘された2つのコア安全境界を実コードで再検証:

  1. build_intake_capsule.py::_next_action_route() が missing_go/stale/runtime_error を proceed_to_step_1 に統合し、latest_blocked(human veto 境界)は変更していないことを確認。
  2. open_pr.py の resolve_canonical_repository() が None を返す場合、overlap_gate_active の値に関わらず無条件で EXIT_BLOCKED となり fail-open への後退がないことを確認。cross-repo evidence 不一致も引き続き reject される(テストの名前・docstring・assertion 一致を確認)。
  3. overlap evidence(sha256/decision hash等)検証失敗は advisory 化され、stdout WARNING= に加え stderr 出力・PR コメント永続化(marker <!-- loop-protocol:overlap-preflight-warnings-v1 -->)を実装済み。

AC1-AC9 全て PASS(800 tests passed, 2 deselected, 2 xfailed)、CI 16件全 green、Allowed Paths(15ファイル)完全準拠、mergeable: MERGEABLE/CLEAN。blocker なし・required_auto_actions 空のため merge_ready: true。人間による最終マージ判断を待つ。

Minor(non-blocking): preparation.md に dead branch となった route enum 記述が残存(_next_action_route() はもうこれらを返さない)。follow-up での記述整理を推奨。

@squne121
squne121 marked this pull request as ready for review July 30, 2026 12:33
@squne121
squne121 merged commit b79ac74 into main Jul 30, 2026
25 checks passed
@squne121
squne121 deleted the worktree-issue-1851-legacy-artifact-hard-gate-removal branch July 30, 2026 12:33
squne121 added a commit that referenced this pull request Jul 31, 2026
…する (#1871)

* 実装: semantic planning・overlap・contract artifactのblocking authorityを撤去する

#1860 Owner Decision(2026-07-30)に基づき、implement-issue / create-issue /
impl-review-loop の production prose(SKILL.md・steps/*.md)から、OPEN Issue
全件収集・semantic overlap・scope-rollup marker 異常を理由にした自動停止
指示を撤去する。

調査の結果、対象スクリプト(check_implementation_overlap.py 等)は既に
route/exit code レベルで advisory(分類成功時は route を問わず exit 0)
であり、実際の blocking authority は呼び出し側 SKILL.md の「人間判断へ
停止」prose に存在していたため、そちらを advisory 表現へ書き換えた。

- implement-issue/SKILL.md: overlap preflight の全 route を warning-continue
  化し、実際に残る hard stop を実 Git conflict / target PR mergeability
  (CONFLICTING/DIRTY)のみに限定
- create-issue/SKILL.md: scope 重複・overlap preflight のいずれも起票停止
  理由にせず、exact-title dedupe のみ維持
- impl-review-loop/steps/preparation.md: Step 2.5 scope rollup preflight を
  automatic dispatch から任意 advisory diagnostic へ縮小(marker 欠落・
  malformed・runner failure は warning 化)
- impl-review-loop/steps/step-5-mergeability-handling.md: BLOCKED/UNSTABLE/
  UNKNOWN/DRAFT/HAS_HOOKS を Git conflict と区別し、DIRTY/CONFLICTING のみ
  hard stop として明記
- docs/dev/workflow.md: Scope Collision Preflight(C0-C3)の記述を advisory
  化し、hard stop を上記2条件のみに限定
- tests/agent_ops/test_implement_issue_overlap_policy.py: 旧 fail-closed
  文言を検証していた3テストを advisory 挙動の検証へ更新

issue-contract-review / open-pr の overlap gate は調査の結果、PR #1854
(#1851)で既に advisory 化済みであることを確認したため変更していない。
issue-refinement-loop の ISSUE_EXECUTION_DECISION は他 skill から一切
consume されておらず、通常の実装作業をblockしないため本Issueのスコープ外
とした(別 child issue の対象)。

Closes #1869
Part of #1860

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: PR Body/Markdown Japanese Check とssot-discovery section budgetの修正

- create-issue/SKILL.md: 既存の英語のみ見出し(Procedure/Output/Guardrails/Related等)に
  日本語訳を追加(PR Body Japanese Checkがファイル全体を検査するため)
- impl-review-loop/steps/preparation.md: Section 2.5見出しの日本語比率を閾値以上に調整
- docs/dev/workflow.md: Scope Collision Preflight節を短縮しssot-discoveryの
  4000文字budgetを再度満たすようにした(元の拡張で4040文字となり超過していた)

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: PR #1871 レビュー fix_delta — mergeable/merge_state_status分離・advisory実効性・scope-rollup manual化

#1860 Owner Decisionの実装(PR #1871)に対する人間レビュアーのREQUEST_CHANGESに対応する。

- P0-1: route_loop_verdict_v2.pyにconflict_hard_stop routeを追加し、mergeable(CONFLICTING/MERGEABLE/UNKNOWN)と
  merge_state_status(BEHIND/BLOCKED/CLEAN/DIRTY/DRAFT/HAS_HOOKS/UNKNOWN/UNSTABLE)を正しいGitHub enumとして分離。
  merge_state_status==CONFLICTINGは無効値としてschema_invalidにする。全fenced yamlブロックを列挙するCLI wrapperを追加し、
  step-5-mergeability-handling.mdのshell grep/sed抽出を廃止。
- P0-2: step-5-feedback-and-termination.mdのrequired_auto_actions契約をroute_loop_verdict_v2.pyのオブジェクト配列契約
  (kind/executor/skill/blocking_merge_ready/mechanical/expected_head_sha)に統一。
- P0-3: check_implementation_overlap.pyのruntime_error exit codeを1から0に変更し、set -euo pipefail下でも
  advisory routeとしてシェルが継続できるようにする。create-issue SKILL.mdのcanonical invocationから--fail-on-unsafeを除去。
- P0-4: build_intake_capsule.pyのerrorsをfatal_errors(live Issue不在/git status失敗)とwarnings
  (comment/snapshot fetch失敗)に分離しexit codeをfatal_errorsのみに連動。implementation-worker.mdの
  hard gate文言を除去。SKILL.md/preparation.mdのhuman_review_required即停止・product-spec snapshot停止を
  warning化。
- P1-1: scope-rollup-runnerをimpl-review-loopのautomatic dispatchから外し、manual advisory diagnosticとして
  再定義。check_impl_review_loop_codex_dispatch.pyの自動spawn note検査を反転(存在しないことを検証)。

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* chore: trigger CI re-check for PR body Japanese Check after body hygiene fix

* fix: #1856 main merge後のtest_verdict引数除去とE501修正

route_loop_verdict_v2() は #1856 で test_verdict 引数を廃止したため、
本PRが追加したfixture/CLIラッパーの呼び出し側を新シグネチャに追従させた。
test_codex_agent_bridge_contract.py の既存E501違反も併せて解消。

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
squne121 added a commit that referenced this pull request Aug 22, 2026
…8を全面改訂する

Owner敵対的レビュー(PR #2298)を反映し、Decision節をseverity/disposition・
missing/stale advisory化・model_assessment用語へ書き換え、
#1854/#428/pr-review-judge AC6との関係を明文化。status: acceptedへ遷移。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
squne121 added a commit that referenced this pull request Aug 22, 2026
…明文化する (#2298)

* 実装: Deterministic Evidence vs Model-Based Semantic Judgment 原則をADRとして明文化する

issue-refinement-loopがsemantic design findingを未解決のまま処理完了扱いにした
構造的欠陥(#2273)を踏まえ、deterministic script(事実確認)とLLM semantic
judgment(意味論的設計判断)の役割分担原則をADR 0008として明文化する。

Closes #2295

* fix: ADR 0008の#428関係記述とfinding解消provenanceを訂正

- Context節: #428のAllowed PathsがChild A(#2296)と完全一致しないため
  「上位互換として再設計される」という断定を訂正し、impl-review-loop側の
  residual scopeが別途dispositionを要することを明記する
- Decision節 規範3: 「解消済みか未解消か」フラグの生成主体(semantic review
  laneがrun id + body_sha256束縛で都度再実行)を明示し、deterministic code
  が差分やキーワード消失から自己推測してはならないことを規範1の適用範囲
  として明文化する

* fix: ADR 0008のdecision_dateをproposed状態に合わせてnullへ修正

* fix: Option D(materiality-triggered+advisory-by-default)採用に基づきADR 0008を全面改訂する

Owner敵対的レビュー(PR #2298)を反映し、Decision節をseverity/disposition・
missing/stale advisory化・model_assessment用語へ書き換え、
#1854/#428/pr-review-judge AC6との関係を明文化。status: acceptedへ遷移。

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Test <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
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.

実装: implementation-worker.toml と open_pr.py の legacy artifact hard gate を除去する

1 participant