Repository navigation
Closed
Labels
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#776"
goal_ref: "Issue #781 body の AC5 negation VC を false positive のない単一コマンド検証へ置き換え、GitHub Issue body maintenance として監査可能にする"
change_kind: workflowParent Issue
Parent Goal Ref
- Goal: 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 に残っている AC5 negation VC の部分一致バグを解消し、Issue body を成果物とする follow-up contract を監査可能にする
- Desired Destination: 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 body の AC5 が
uv run python3 ...を誤検出しない単一コマンド VC に置き換わり、実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 に before/after 証跡が残っている
Current Validated Scope
- GitHub Issue 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 本文の AC5
## Verification Commandsを、旧! rg -q -F "python3 ..."形式から、barepython3 ...だけを command token として検出できる単一コマンド VC に更新する - GitHub Issue 実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 に、実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 body の before/after hash・更新した AC5 行・検証結果を記録する完了コメントを追加する
Remaining Parent Gaps
- 調査: Claude/Codex agent skill surface の shared-body policy を ADR 化する #779 は引き続き open のため、shared-surface ADR 化は別途残る
- 実装: .codex/agents の check-codex-agents.mjs 既存 failure を解消する #780 は引き続き open のため、thin runtime contract lint は別途残る
- 実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 は 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 AC5 follow-up のみを扱い、実装: Codex custom agent の repo-local skill surface を .agents/skills に統一する #776 全体の close-ready 判定は行わない
Outcome
#781 body の AC5 Verification Commands が旧 literal negation から false positive のない単一コマンド検証へ置き換わり、#789 に before/after hash・変更行・検証結果を残した完了コメントが投稿されている状態。
In Scope
- 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 body の AC5 review-only sanity check 行を、single-command / no-shell-control-operator の検証へ置き換える
- 新しい AC5 VC が
uv run python3 ...を誤検出しない anchored pattern を使うことを Issue contract 上で明示する - 実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 完了時の監査証跡として、実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 body の before/after hash と更新行、検証結果を 実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 comment に残す
Out of Scope
.claude/skills/**の実装内容変更- 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 の AC1〜AC4 の VC 変更
- 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 以外の Issue body 変更
validate_issue_body.py/contract_readiness_check.py/ validator rule 追加- 実装: Codex custom agent の repo-local skill surface を .agents/skills に統一する #776 / 調査: Claude/Codex agent skill surface の shared-body policy を ADR 化する #779 / 実装: .codex/agents の check-codex-agents.mjs 既存 failure を解消する #780 の state 変更や close 判定
- リポジトリ差分を伴う PR 作成
Acceptance Criteria
- AC1: 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 body の AC5 Verification Commands から、旧
! rg -q -F "python3 ..."形式の 4 行が削除されている - AC2: 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 body の AC5 Verification Commands に、single-command / no-shell-control-operator の review-only VC が 4 行追加されている
- AC3: 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 body の AC5 に追加される 4 行は、anchored regex
^\s*\$?\s*python3\s+...$を使い、uv run python3 ...を検出対象に含めない - AC4: 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 body の AC5 に追加される 4 行は、各 script path を
\.py$まで固定し、barepython3 .../$ python3 ...を command token として検出する - AC5: 実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 の完了コメントに、実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 body の before/after hash、更新した AC5 行、各検証結果が記録されている
- AC6: 実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 の完了コメントに、実装: Codex custom agent の repo-local skill surface を .agents/skills に統一する #776 は 調査: Claude/Codex agent skill surface の shared-body policy を ADR 化する #779/実装: .codex/agents の check-codex-agents.mjs 既存 failure を解消する #780 が open のため未完了である旨が記録されている
Verification Commands
# AC1
# preflight-scope: runtime_only
$ gh issue view 781 --repo squne121/loop-protocol --json body --jq 'if ((.body | contains("$ ! rg -q -F \"python3 .claude/skills/issue-refinement-loop/scripts/publish_termination_report.py\" .claude/skills/issue-refinement-loop/SKILL.md")) or (.body | contains("$ ! rg -q -F \"python3 .claude/skills/issue-contract-review/scripts/check_product_spec_contract.py\" .claude/skills/issue-contract-review/SKILL.md")) or (.body | contains("$ ! rg -q -F \"python3 .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py\" .claude/skills/issue-contract-review/SKILL.md")) or (.body | contains("$ ! rg -q -F \"python3 .claude/skills/review-issue/scripts/check_issue_contract.py\" .claude/skills/review-issue/SKILL.md"))) then error("old AC5 literal-negation lines still remain") else "old_ac5_removed" end'
# AC2
# preflight-scope: runtime_only
$ gh issue view 781 --repo squne121/loop-protocol --json body --jq 'if ((.body | contains("$ rg --files-without-match \"^\\s*\\$?\\s*python3\\s+\\.claude/skills/issue-refinement-loop/scripts/publish_termination_report\\.py$\" .claude/skills/issue-refinement-loop/SKILL.md")) and (.body | contains("$ rg --files-without-match \"^\\s*\\$?\\s*python3\\s+\\.claude/skills/issue-contract-review/scripts/check_product_spec_contract\\.py$\" .claude/skills/issue-contract-review/SKILL.md")) and (.body | contains("$ rg --files-without-match \"^\\s*\\$?\\s*python3\\s+\\.claude/skills/issue-contract-review/scripts/baseline_vc_preflight\\.py$\" .claude/skills/issue-contract-review/SKILL.md")) and (.body | contains("$ rg --files-without-match \"^\\s*\\$?\\s*python3\\s+\\.claude/skills/review-issue/scripts/check_issue_contract\\.py$\" .claude/skills/review-issue/SKILL.md"))) then "single_command_ac5_lines_present" else error("expected AC5 replacement lines are missing") end'
# AC3
# preflight-scope: runtime_only
$ gh issue view 781 --repo squne121/loop-protocol --json body --jq 'if ((.body | contains("^\\s*\\$?\\s*python3\\s+\\.claude/skills/issue-refinement-loop/scripts/publish_termination_report\\.py$")) and (.body | contains("^\\s*\\$?\\s*python3\\s+\\.claude/skills/issue-contract-review/scripts/check_product_spec_contract\\.py$")) and (.body | contains("^\\s*\\$?\\s*python3\\s+\\.claude/skills/issue-contract-review/scripts/baseline_vc_preflight\\.py$")) and (.body | contains("^\\s*\\$?\\s*python3\\s+\\.claude/skills/review-issue/scripts/check_issue_contract\\.py$"))) then "anchored_regex_present" else error("anchored regex pattern is missing from one or more AC5 lines") end'
# AC4
# preflight-scope: runtime_only
$ gh issue view 781 --repo squne121/loop-protocol --json body --jq 'if ((.body | contains("publish_termination_report\\.py$\" .claude/skills/issue-refinement-loop/SKILL.md")) and (.body | contains("check_product_spec_contract\\.py$\" .claude/skills/issue-contract-review/SKILL.md")) and (.body | contains("baseline_vc_preflight\\.py$\" .claude/skills/issue-contract-review/SKILL.md")) and (.body | contains("check_issue_contract\\.py$\" .claude/skills/review-issue/SKILL.md"))) then "script_path_anchoring_present" else error("one or more script paths are not anchored to .py$") end'
# AC5
# preflight-scope: runtime_only
$ gh issue view 789 --repo squne121/loop-protocol --json comments --jq 'if any(.comments[]; (.body | contains("<!-- ISSUE_789_COMPLETION_AUDIT_V1 -->")) and (.body | contains("before_hash")) and (.body | contains("after_hash")) and (.body | contains("updated_ac5_lines")) and (.body | contains("verification_results"))) then "completion_audit_present" else error("completion audit comment is missing required evidence fields") end'
# AC6
# preflight-scope: runtime_only
$ gh issue view 789 --repo squne121/loop-protocol --json comments --jq 'if any(.comments[]; (.body | contains("<!-- ISSUE_789_COMPLETION_AUDIT_V1 -->")) and (.body | contains("#776 remains open because #779 and #780 are still open")) and (.body | contains("#779: OPEN")) and (.body | contains("#780: OPEN"))) then "parent_gap_note_present" else error("completion audit comment is missing the parent-gap note") end'Runtime Verification Applicability
decision: not_applicable
reason: "#781 / #789 の GitHub Issue body・comment を更新する運用契約のみを扱い、repo runtime 挙動や実行環境の変更は伴わないため"Allowed Paths
- GitHub Issue 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781 本文(
gh issue edit 781経由) - GitHub Issue 実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 の comment thread(完了コメント追加のみ)
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Scope Delta(任意)
| 項目 | 旧契約 | 新契約 |
|---|---|---|
| 検証対象 | .claude/skills/*.md を直接 rg |
gh issue view 781 --json body で #781 body を成果物として検証 |
| parent gap 記述 | #776 完了扱い | #779 / #780 open を明示し、#789 は close-ready を主張しない |
| Delivery Rule | 1 Issue = 1 PR と記載 | Issue body maintenance として PR 不要、#789 comment に監査証跡を残す |
Delivery Rule
- PR は作成しない(Issue body maintenance として扱う)
gh issue edit 781後、実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 に before/after hash・更新した AC5 行・検証結果を comment として残す- worktree 不要(repo 差分を伴わないため)
Source
- dedupe_key: follow-up:squne121/loop-protocol:pr/787:1
- origin_pr: docs: SKILL.md の Python 実行例を uv run python3 に統一 (#781) #787
- origin_issue: 実装: agent skill / validator の Python 実行例を uv run python3 に統一する #781
- anchor_comment: 実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 (comment)
- detection: PR docs: SKILL.md の Python 実行例を uv run python3 に統一 (#781) #787 review で発見された AC5 negation VC の部分一致バグを、成果物一致・single-command・監査証跡つき契約へ修正する
Activity
squne121 commentedon Jun 11, 2026
判定: REQUEST CHANGES
#789 は、問題意識自体は正しいです。PR #787 で
.claude/skills/*.mdの barepython3はuv run python3に置換済みで、レビューでも「#781 の AC5 negation VC がrg -F "python3 ..."の部分一致でuv run python3 ...まで誤検出する」と明示されています。これは修正対象として妥当です。([GitHub]1)ただし、#789 の Issue 設計は現状のまま実装させると危険です。主因は、修正対象が「#781 の Issue body」なのに、検証コマンドが
.claude/skills/*.mdを見ていることです。#789 自身は in-scope を「Issue #781 body の AC5 verification commands 修正」、allowed path もgh issue edit 781としていますが、Verification Commands はリポジトリ内 SKILL.md をrgしています。つまり、#781 本文が未修正でも、PR #787 後の SKILL.md 状態だけで検証が進んだように見える構造です。([GitHub]2)ブロッカー
1. 検証対象が成果物と一致していない
#789 の成果物は
.claude/skills/.../SKILL.mdではなく、GitHub Issue #781 の本文です。にもかかわらず VC は.claude/skills/issue-refinement-loop/SKILL.mdなどを直接検索しています。これは「既に PR #787 で直ったファイルが今も直っている」ことしか検証しておらず、#789 の変更であるgh issue edit 781の結果を検証していません。([GitHub]2)修正方針は、最低限こうです。
gh issue view 781 --json body --jq '.body'を入力ソースにして、#781 body 内の AC5 VC が旧
-F "python3 ..."から新しい anchored regex / equivalent に置き換わったことを検査する必要があります。2.
rg -c "^python3 "は「0件なら成功」ではない#789 の AC2 は「
uv run python3 ...には 0 hits」としていますが、VC にあるrg -c "^python3 " fileは、0件を表示するだけでは十分ではありません。rgは検索ツールであり、-c/--countは「一致行数を報告する」オプションです。-Fは regex ではなく literal string として扱うため、旧 VC の部分一致バグの説明には合っていますが、-cをそのまま negation assertion として使うのは不適切です。([GitHub]3)「0件で PASS」をやるなら、次のどちらかに寄せるべきです。
または、より確実に、
uv run python3 -c "..."で
gh issue view 781 --json bodyの結果を読み、期待文字列・禁止文字列を明示的に判定してsys.exit(0/1)してください。3.
^python3だけでは markdown 内コマンド例を十分に扱えない#789 は
^python3を候補にしていますが、Issue body や SKILL.md のコマンド例は、行頭に$、インデント、箇条書き、コードブロック内の空白を持つことがあります。Rust regex の^は行頭アンカーとして使えますが、今回検出したいのは「行頭そのもの」ではなく、コマンドトークンとして barepython3が現れることです。([Docs.rs]4)推奨パターンはこれです。
これは
python3 ...や$ python3 ...には一致し、uv run python3 ...には一致しません。4. 「#789 完了で #776 のスコープは閉じる」は事実と衝突している
#789 は Remaining Parent Gaps を「なし」としていますが、親 Issue #776 には #779・#780・#781 が remaining gaps として列挙されており、#779 と #780 は別 Issue として残っています。したがって、#789 の完了をもって #776 全体が閉じる、という契約は危険です。([GitHub]2)
書き換えるならこうです。
5. Delivery Rule が曖昧
#789 は「1 Issue = 1 PR」と書きつつ、実際の allowed path は
gh issue edit 781です。Issue body の編集はリポジトリ差分ではないため、PR に載りません。現状のままだと、エージェントが「空 PR」を作るか、逆に GitHub Issue を直接編集して監査証跡が弱くなる可能性があります。(GitHub)この Issue は、どちらかに明確化してください。
gh issue edit 781後、実装: #781 AC5 negation VC の rg -F 部分マッチ問題を修正する #789 に before/after body hash と検証結果をコメントする。今回の目的なら前者で十分です。
#789 の修正版 AC 案
以下のように置き換えるのが安全です。
推奨実装
Issue body を直接検証する単一コマンド型に寄せるなら、
rgだけで頑張るより Python でgh issue viewを呼ぶ方が堅いです。shell control operator を避けたいという #789 の guardrail とも整合します。概念的にはこうです。
uv run python3 -c "import json,subprocess,sys,re; body=json.loads(subprocess.check_output(['gh','issue','view','781','--json','body']))['body']; forbidden='! rg -q -F \"python3 '; required=[r'^\s*\$?\s*python3\s+\.claude/skills/issue-refinement-loop/scripts/publish_termination_report\.py', r'^\s*\$?\s*python3\s+\.claude/skills/issue-contract-review/scripts/check_product_spec_contract\.py', r'^\s*\$?\s*python3\s+\.claude/skills/review-issue/scripts/baseline_vc_preflight\.py', r'^\s*\$?\s*python3\s+\.claude/skills/review-issue/scripts/check_issue_contract\.py']; sys.exit(0 if forbidden not in body and all(p in body for p in required) else 1)"ただし実際には、body 内では regex 文字列がクォートやエスケープを含むため、最終実装では「期待する完成形の VC 行」を exact string として検査する方がさらに安全です。
Web 調査からの補強
OpenAI Codex の現行 docs では、repo-scoped skill は
.agents/skills、custom agent は.codex/agentsが基本です。Skill はSKILL.mdを持つディレクトリで、再利用配布単位としては plugin が説明されています。したがって、#776 全体では.claude/skillsから Codex 用 skill surface への整理が論点ですが、#789 自体は配布物設計を広げる Issue ではなく、#781 body の誤った VC を直すだけに絞るべきです。([OpenAI Developer]5)結論として、#789 は「根本原因の認識」は正しい一方で、Issue 契約・検証対象・親 Issue 状態・Delivery Rule がズレています。このまま実装させると、#781 本文が直っていないのに作業完了扱いになるリスクがあります。まず #789 の body を上記の形に修正してから実装に入るべきです。
squne121 commentedon Jun 11, 2026
Contract Snapshot (2026-06-11T12:05:36Z)
.py$まで固定 / AC5 完了監査コメント / AC6 parent gap 注記# preflight-scope: runtime_onlyのgh issue view ... --jq ...単一コマンドsqune121 commentedon Jun 11, 2026
issue-refinement-loop を
approvedで終了します。anchor comment の REQUEST CHANGES に合わせて、成果物を#781 bodyと#789 の監査コメントに揃え、VC は allowlist 準拠のgh issue view ... --jq ...単一コマンドへ更新しました。squne121 commentedon Jun 11, 2026
CodexCLI作業ログ
squne121 commentedon Jun 11, 2026
before_hash: "sha256:99090e784cae1ec15ca0558461a2f99ec7083bda28ab5bdbec47125d4236d9e9"
after_hash: "sha256:97f9b828e2267a7f89af63b9f1f8df98fe4003a766abf4ac9853400fc63b5abf"
updated_ac5_lines:
verification_results:
AC1: "pass: old_ac5_removed"
AC2: "pass: single_command_ac5_lines_present"
AC3: "pass: anchored_regex_present"
AC4: "pass: script_path_anchoring_present"
AC5: "pending before comment; this comment provides the required evidence fields"
AC6: "pending before comment; this comment provides the required parent-gap note"
実装: Codex custom agent の repo-local skill surface を .agents/skills に統一する #776 remains open because 調査: Claude/Codex agent skill surface の shared-body policy を ADR 化する #779 and 実装: .codex/agents の check-codex-agents.mjs 既存 failure を解消する #780 are still open
調査: Claude/Codex agent skill surface の shared-body policy を ADR 化する #779: OPEN
実装: .codex/agents の check-codex-agents.mjs 既存 failure を解消する #780: OPEN
squne121 commentedon Jun 11, 2026
実装対象の issue-body maintenance は完了しました。#781 の AC5 Verification Commands 修正と #789 監査証跡コメント追加を反映済みのため、本 issue をクローズします。#776 全体は #779 / #780 が引き続き OPEN のため未完了です。