Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "edit-issue の既存 Issue 更新で、title と body を同一の固定 REST PATCH で安全に更新できる closed request を提供する"
change_kind: workflowParent Issue
なし(単独改善)。
Parent Goal Ref
- Goal: 既存 Issue の title/body が scope reframe 後に不整合にならない controlled mutation 契約を提供する。
- Desired Destination: なし。
Remaining Parent Gaps
- なし。
Current Validated Scope
issue_title.updateは controlled policy の registry/schema/dispatch に存在せず、title 更新を別 mutation として追加しても title/body の一体性を保証できない。controlled_skill_mutation_policy.pyは command ID と入力 schema の正本であり、controlled_skill_mutation_exec.pyはその registry に登録済みの command ID だけを dispatch する。- local-main と worktree の guard は共有 classifier を使うため、新 command ID 専用の guard allowlist は追加しない。
- GitHub Issue 更新は title と body を単一 PATCH に含められる。pre-readback と post-readback は best-effort の競合検出であり、厳密な CAS や rollback を保証しない。
Outcome
edit_issue_txn.py が issue_content.update の closed request を使い、title/body を固定 endpoint への単一 PATCH と両フィールドの post-readback で更新し、曖昧な失敗は自動再試行せず分類して返す。CI verdict summary も同一契約・同一PRで、実行対象の current HEAD に束縛された required checks/evidence を生成し、node-backed-hook-tests を決定論的な classification として扱う。
In Scope
issue_content.updatecommand ID、closed input schema、policy registry、executor dispatch を同時に追加する。- title-only、body-only、title+body の更新を、旧 title・旧 body hash・旧 updatedAt を束縛した pre-readback、単一 PATCH、post-readback で扱う。
- 空白のみ・NUL・制御文字を含む title、unknown key、repo/Issue 不一致を mutation 前に拒否する。変更なしは
no_change、timeout 等の曖昧な失敗は自動再試行せず remote readback でalready_appliedまたは不明として分類する。 edit_issue_txn.pyをtitle_updateの no-mutation 分岐からissue_content.updaterequest 生成・結果分類へ移行し、comment publish は content update 後の独立 operation としてfailed_after_mutationを維持する。- shared classifier を用いた local-main/worktree guard parity と raw
gh issue edit --titleの拒否を回帰テストで確認する。local_main_branch_guard.pyの command-ID 固有 allowlist 実装は変更しない。 - policy/schema/dispatch parity、既存 command ID の非回帰、正常系・失敗系を fake
ghの決定論的テストで追加する。 docs/dev/agent-skill-boundaries.mdとedit-issueskill を新契約へ同期する。ci_verdict_summary_v2.pyと.github/workflows/ci.ymlの evidence 生成経路を、workflow run/PR head SHA/check identity に束縛し、required checks の実在・結論・head SHA を欠落なく収集する。node-backed-hook-testsは required evidence として明示分類し、unknown/gh_error や null head SHA を merge-ready evidence として受理しない。- generator と workflow の deterministic test fixture で stale head、missing required evidence、null/mismatched check head、
node-backed-hook-testsclassification を検証する。
Out of Scope
local_main_branch_guard.pyまたは worktree guard に command-ID 固有の allowlist を実装する変更。- title/body 更新の厳密な atomic transaction、rollback、CAS、または timeout 後の自動 PATCH 再試行。
- label、assignee、milestone、dependency 等の metadata mutation。
create_issue_txn.pyの新規 Issue title 決定。
Acceptance Criteria
- AC1:
issue_content.updateの command ID、closed schema、policy registry、executor dispatch が同時に登録され、既存 command ID の registry/schema/dispatch が不変である。 - AC2: title-only、body-only、title+body の各 request は固定 repo/Issue endpoint への単一 PATCH を使用し、post-readback で title と body の両方を照合する。
- AC3: invalid title、unknown key、stale title/body/updatedAt、pre-readback/PATCH/post-readback failure、timeout 後の already-applied または不明を、余分な PATCH を行わず closed status で分類する。
- AC4:
edit_issue_txn.pyは content update 成功後だけ comment publish に進み、comment publish 失敗時は content mutation を rollback せずfailed_after_mutationを返す。 - AC5: canonical executor invocation は shared classifier により local-main/worktree の両 guard で許可され、raw
gh issue edit --titleは引き続き拒否される。 - AC6:
ci_verdict_summary_v2artifact はexpected_head_shaと実 check run/job のhead_sha、workflow run/attempt、check identity を current PR HEAD に束縛し、stale/mismatch/null binding をstale_head_shaまたは blocked として分類する。 - AC7: required checks/evidence は全件が実在し、結論・head SHA・provenance を持つ場合だけ merge-ready とし、
node-backed-hook-testsを required set/classification に含め、unknown/gh_error/missing evidence を成功扱いしない。
Runtime Verification Applicability
decision: immediate
reason: policy、executor、transaction helper、guard classifier の契約は fake gh を使う決定論的 pytest でのみ検証できる。
applicable_acs: [AC1, AC2, AC3, AC4, AC5, AC6, AC7]
execution_environment:
os: WSL2 Ubuntu 24.04
commands: [python3, uv, pytest]
network_required: false
skip_conditions:
- uv または pytest が利用できない場合は exit 77 で停止し、検証成功として扱わない
fallback_policy: 静的な文字列検査、dry-run 単独、または fake gh を介さない GitHub mutation を成功証跡として扱わない。
artifact_requirements:
- artifacts/1660/issue-content-update-test-results/Verification Commands
# AC1
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-guards/tests/test_issue_content_update_exec.py -v
# AC2
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-guards/tests/test_issue_content_update_exec.py -v
# AC3
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-guards/tests/test_issue_content_update_exec.py -v
# AC4
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/edit-issue/tests/test_issue_content_update_txn.py -v
# AC5
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-guards/tests/test_issue_content_update_guard_parity.py -v
# AC6
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary_v2.py -v
# AC7
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary_v2.py -vAllowed Paths
- scripts/agent-guards/controlled_skill_mutation_policy.py
- scripts/agent-guards/controlled_skill_mutation_exec.py
- scripts/agent-guards/tests/test_issue_content_update_exec.py
- scripts/agent-guards/tests/test_issue_content_update_guard_parity.py
- scripts/agent-guards/tests/test_controlled_skill_mutation_policy.py
- .claude/skills/edit-issue/scripts/edit_issue_txn.py
- .claude/skills/edit-issue/SKILL.md
- .claude/skills/edit-issue/tests/test_issue_content_update_txn.py
- .claude/skills/edit-issue/tests/test_edit_issue_txn.py
- .claude/hooks/tests/test_local_main_branch_guard.py
- docs/dev/agent-skill-boundaries.md
- .claude/skills/pr-review-judge/scripts/ci_verdict_summary_v2.py
- .claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary_v2.py
- .github/workflows/ci.yml
PR Body Evidence Requirements
- PR 本文は current PR HEAD SHA、
ci_verdict_summary_v2artifact の artifact URL/digest、各 required check の name/conclusion/head SHA/workflow run identity、node-backed-hook-testsclassification を同一 snapshot で提示する。 - stale/missing/null evidence または artifact と PR HEAD の不一致がある間は
merge_ready: falseとし、LOOP_VERDICT_V2の reviewed head SHA を更新して再レビューする。
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 実装開始、push 前、merge 前に 実装: HEAD-bound TEST_VERDICT publisher transaction を追加する #1647 と 実装: GitHub native dependency 解除の controlled executor を追加する #1632、および同一 policy/schema/dispatch surface の関連 PR を live readback し、未マージ変更が存在する場合は着手を停止する。マージ済みの場合は最新 origin/main に rebase 後、既存 command ID の compatibility test を実行する。
Required Skills
- Python 3(subprocess、JSON schema、pytest)
- GitHub REST API の固定 endpoint 呼び出し
Required Design References
docs/dev/agent-skill-boundaries.md#Issue metadata mutation executor lanedocs/dev/workflow.md
Scope Collision
- decision: keep_separate_with_reason
- related_issue: 実装: HEAD-bound TEST_VERDICT publisher transaction を追加する #1647, 実装: GitHub native dependency 解除の controlled executor を追加する #1632
- overlapping_paths:
scripts/agent-guards/controlled_skill_mutation_policy.py,scripts/agent-guards/controlled_skill_mutation_exec.py - non_conflict_reason: command ID は異なるが同一 registry/schema/dispatch surface を共有するため、実装開始・push・merge の各時点で live readback と compatibility test により直列化する。
- edit_intent: owner anchor comment の承認済み scope delta に従い、title/body 一体更新を
issue_content.updateに再構成する。 - dependency_ordering: 実装: HEAD-bound TEST_VERDICT publisher transaction を追加する #1647/実装: GitHub native dependency 解除の controlled executor を追加する #1632 または同一 surface の関連 PR に未マージ変更があれば開始しない。マージ済みなら最新 origin/main を基準にする。
overlap_readback_waiver:
repository: squne121/loop-protocol
linked_issue: 1660
candidates:
- issue_number: 1429
updated_at: "2026-07-20T02:46:14Z"
reason: readback_incomplete_missing_outcome_or_in_scope
expires_on: "2026-08-05"
approved_by: userDelivery Rule
- 1 Issue = 1 PR
- dedicated linked worktree で実装し、Draft PR を既定とする
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Jul 20, 2026
結論
判定:
NEEDS_MAJOR_REVISION。現状のまま実装開始すべきではありません。Issue が解決しようとしている「rescoping 後もタイトルだけ旧スコープのまま残る」という問題は実在します。しかし、現在の契約には次の重大な欠陥があります。
重大指摘
Blocker 1 — Allowed Paths のままでは command ID を正規登録できない
現行 executor は、
controlled_skill_mutation_policy.pyのINPUT_SCHEMA_BY_COMMANDとALL_COMMAND_IDSを正本として command ID を認識します。未登録の command ID は executor の dispatch 前に拒否されます。ところが #1660 の Allowed Paths には、以下が含まれていません。
scripts/agent-guards/controlled_skill_mutation_policy.pyscripts/agent-guards/tests/test_controlled_skill_mutation_policy.pyscripts/agent-guards/tests/test_controlled_skill_mutation_exec.pyまたは専用 executor testしたがって、AC1を正規の設計で満たすには Allowed Paths 違反が必要です。逆に executor 側だけへ独自登録すると、policy・executor・guard間で command ID が分裂します。
必要な修正
controlled_skill_mutation_policy.pyを In Scope / Allowed Paths に追加するBlocker 2 —
local_main_branch_guard.pyへの個別allowlist追加は設計違反#1660 は、新しい
issue_title.updateの exact command shape をlocal_main_branch_guard.pyに追加するよう要求しています。しかし、現行設計は反対です。local_main_branch_guard.pyは、共有 policy のis_controlled_skill_mutation_exec_command()をimportしています。各guardが独自allowlistを持たないことが、明示的なanti-split-brain要件です。さらに現行SSOTには、共有classifierは executor のパスとargv形状を検査し、
--command-idの値そのものには依存しないため、新command IDごとのguard entryは不要だと明記されています。必要な修正
local_main_branch_guard.pyの実装変更をIn Scopeから削除するAC3を次の意味へ変更する
gh issue edit --titleは引き続き拒否されるguard側は回帰テストだけ追加し、command ID固有のallowlistを作らない
これにより、#1595・#1601との不要なpath collisionも減らせます。
Blocker 3 — 「同一transaction」というOutcomeを現在の設計では満たせない
現行
edit_issue_txn.pyは、本文更新、読み戻し、コメント投稿を順番に実行するオーケストレーターです。コメント投稿に失敗しても本文は更新済みで、failed_after_mutationを返します。rollbackは常にfalseです。ここへ別の
issue_title.update呼び出しを追加すると、次の状態が発生します。これらの順序、結果status、再実行時の扱い、補償処理が一切定義されていません。
GitHubのIssue更新REST endpointは、同じPATCHリクエストで
titleとbodyを送れます。タイトルと本文の整合が目的なら、別々のremote mutationよりも、固定endpointへの単一PATCHへ統合する方が適切です。 ([GitHub Docs]1)推奨設計
issue_title.updateではなく、次のようなissue_content.updateを導入します。executorはタイトルと本文を一度のPATCHで更新し、その後に両方をreadbackします。
別command IDを維持する場合は、「transaction」ではなく部分成功を許容するsagaであることを明記し、全失敗組合せの契約が必要です。
High — stale precondition の保証範囲が不正確
現在の本文更新は、body hashと
updatedAtをmutation直前に確認しています。しかし #1660 の
title_update入力には、次がありません。expected_previous_titleまた、GitHubの一般的なREST運用指針では、PATCHのようなunsafe methodに対するconditional requestは、endpointが個別に対応を明記していない限り利用できません。したがって「readbackとPATCHの間に別更新が絶対に入らない」という厳密なCAS保証はできません。 ([GitHub Docs]2)
Issue本文は、保証を次の範囲へ弱める必要があります。
「stale precondition付きなので競合更新を完全に防止する」とは表現できません。
High —
title_updateの入力契約が未定義に近い現在のvalidatorが確認しているのは、ほぼ
requiredがboolかどうかだけです。required: trueでも、proposed_titleやreasonの欠落・null・空文字を拒否しません。最低限、次を固定する必要があります。
required: trueproposed_title: non-empty stringreason: bounded non-empty stringrequired: falseproposed_titleとreasonをnullに限定するか、省略可能にするかを明示unknown key拒否
NUL・制御文字・空白だけのtitleを拒否
同一titleの場合は
no_changetitle-only、body-only、title+bodyの扱いを明示
result statusを閉じたenumとして定義
推奨resultは次のような形です。
High — Verification Commands が実装を検証していない
現在のAC1は、単に次の
rgで通過できます。rg -n "issue_title.update" controlled_skill_mutation_exec.pyコメントやdead codeへ文字列を置くだけでも成功します。
AC2も「fixture / dry-runでよい」とされていますが、dry-runでは次を証明できません。
現行テストには、title requestを拒否するテストしかありません。
必要な専用テスト
fake
ghを使った決定論的subprocess testを主とし、文字列検査は補助に留めるべきです。High — 関連Issueとのsequencingを「不要」とする根拠が弱い
#1647と#1632は、どちらも同じcontrolled mutation policy/executorへcommand ID、schema、dispatch、テストを追加する未完了Issueです。特に#1647は正しく
controlled_skill_mutation_policy.pyをAllowed Pathsへ含めています。「command IDが別だから依存順序不要」では不十分です。同じregistry・import list・dispatch chain・テストfixtureを並行編集するため、semantic conflictや既存commandの脱落が起き得ます。
必須のmechanical start gateは次です。
origin/mainへrebase後に開始Issue間の正式な
Depends Onまでは不要でも、同一surfaceの直列化条件は必要です。Medium —
gh issue edit --title 相当では権限境界が広すぎるgh issue editはタイトルだけでなく、本文、assignee、label、milestone、project等も扱い、複数Issue番号も受け取れる汎用CLIです。 ([GitHub CLI]3)現行body executorは、汎用
gh issue editを使用せず、固定REST endpointへのPATCHをargv-list・shell=Falseで実行しています。したがって、新executorも次へ限定すべきです。
ghbinarytitle/bodyfieldだけ推奨するIssueの再構成
最も安全なのは、Outcomeを次へ変更することです。
あわせて、以下を変更してください。
issue_title.update→issue_content.updatelocal_main_branch_guard.pyの実装変更を削除controlled_skill_mutation_policy.pyをAllowed Pathsへ追加scripts/agent-guards/tests/をAllowed Pathsへ追加この修正後であれば、既存のcontrolled executor設計と整合し、タイトルと本文が別々に更新されることによる新たな不整合も最小化できます。
なお、本レビューはGitHub上のIssue、current repository assets、関連Issueおよび公式GitHub仕様を用いた静的レビューです。pytest等のruntime verificationは実行していません。
squne121 commentedon Jul 20, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
squne121 commentedon Jul 20, 2026
以下の scope delta を承認し、アンカーコメント #issuecomment-5021194871 の重大指摘に沿って Issue #1660 を in-place で再構成する。
squne121 commentedon Jul 20, 2026
Contract Review Result
squne121 commentedon Jul 20, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jul 21, 2026
impl-review-loop: 人間判断要請(2026-07-21T22:06:17Z)
IMPLEMENT_SCOPE_COLLISION_PREFLIGHT_V1.route=human_review_requiredsha256:db71e092eb89511aa9c050ee83ec5ac629661e9d6feafb12bfb2b818d8d66d9bsqune121 commentedon Jul 21, 2026
impl-review-loop: 実装優先順序の人間判断(2026-07-21T22:20:58Z)
ユーザー指示により、同一 controlled mutation policy/executor surface の C1 競合については #1660 を #1647 より先に実装する。この判断は #1647 との順序にのみ適用し、Allowed Paths、固定契約、外部スコープ、#1665/#1667 の live readback 要件を緩和しない。
squne121 commentedon Jul 21, 2026
impl-review-loop: 追加 overlap 候補の優先順序判断(2026-07-21T22:26:40Z)
ユーザーの #1660 優先指示に基づき、preflight が検出した候補を以下のように直列化する。これは列挙された候補にのみ適用する実行順序の判断であり、Allowed Paths、固定契約、検証、current-HEAD review のゲートを緩和しない。
docs/dev/agent-skill-boundaries.mdの docs-only overlap。実装: edit-issue skill の controlled executor に Issue title mutation を追加する #1660 を先行させ、実装: edit-issue skill の controlled executor に Issue title mutation を追加する #1660 が当該ファイルを変更する場合はその最終内容を正本として各 Issue が再 intake する。.claude/settings.jsonのみで 実装: edit-issue skill の controlled executor に Issue title mutation を追加する #1660 との実質的な変更面重複はない。実装: edit-issue skill の controlled executor に Issue title mutation を追加する #1660 を停止させない。squne121 commentedon Jul 21, 2026
impl-review-loop: 人間判断要請(#1429 overlap preflight、2026-07-21T22:29:28Z)
#1660 優先の直列化判断(#1647/#56/#63/#82/#197)を適用して再試行したが、overlap preflight が追加候補 #1429 の readback を
Outcome/In Scope不足として incomplete と判定した。.claude/hooks/tests/test_local_main_branch_guard.pyのみが交差する候補で、現在の live 表示では同一 executor/policy C1 とは確認できない。sha256:8d73be464187e3808ac609b18308afe5ec7f7d2ef0ff2e7c6da672367967f66bsqune121 commentedon Jul 22, 2026
impl-review-loop: #1429 overlap の人間判断(2026-07-22T09:35:22Z)
ユーザー判断により、#1429 との交差は #1660 の実装を停止させない 非ブロッキングとして扱う。
squne121 commentedon Jul 22, 2026
impl-review-loop: 人間判断要請(Allowed Paths、2026-07-22T09:48:00Z)
#1660 の実装・typecheck・lint は通過したが、必須互換テストが Allowed Paths 外のファイル更新を要求したため、契約を広げず停止した。
scripts/agent-guards/tests/test_controlled_skill_mutation_policy.py::TestRegistryScope::test_only_known_command_ids。新しい command idissue_content.updateを既知 registry 一覧に加える必要がある。squne121 commentedon Jul 22, 2026
Allowed Paths 契約更新: VC scope preflight 停止(2026-07-22T09:35:22Z)
ユーザー承認済みの
scripts/agent-guards/tests/test_controlled_skill_mutation_policy.py追加だけを含む候補本文を作成したが、本文更新前の必須 preflight で停止した。ライブ本文は未変更。::test_*suffix を除去し、テストファイル単位で実行する形式へ変更する。候補を非破壊検証した結果、scope checker はPASS。1 remaining item
squne121 commentedon Jul 22, 2026
Contract Review Result
squne121 commentedon Jul 22, 2026
impl-review-loop: overlap waiver 証跡不足による停止(2026-07-22T10:39:23Z)
実装ブランチは push 済みで、実装検証・PR本文 preflight は通過している。しかし open-pr は本文の SHA-bound
overlap_readback_waiverを必須とし、waiver の各候補に freshupdated_atとreasonを完全束縛する。source_complete=false/saturated=trueで候補一覧を返さず、limit=1000 は完了した構造化stdoutを取得できなかった。9d6999ec595e2ebbfa0ae28843ef9b0b2baa4a3c(branch:worktree-issue-1660-issue-content-update)。squne121 commentedon Jul 22, 2026
overlap waiver 証跡の補足(2026-07-22T10:44:12Z)
追加の正本形式照合により、#1429 の incomplete readback に対する exact waiver input は取得できた。完了候補 #1647/#56/#82/#197 や non-blocking #63 は generic waiver の候補集合に入れられず、既存の限定直列化判断のまま扱う。
expires_onは必須であり、ユーザーが期限を指定するまで本文 mutation と fresh snapshot は行わない。squne121 commentedon Jul 22, 2026
Contract Review Result
squne121 commentedon Jul 22, 2026
implement-issue: 実装完了
.claude/worktrees/issue-1660-issue-content-updateworktree-issue-1660-issue-content-updatefix: Ruff E501 を解消 (#1660)
squne121 commentedon Jul 22, 2026
impl-review-loop: CI legacy transaction test の Allowed Paths 停止(2026-07-22T11:15:53Z)
新HEADの
python-testCI は.claude/skills/edit-issue/tests/test_edit_issue_txn.pyの4件で失敗した。これらは旧issue_body.update/ title拒否を期待しており、#1660 で導入したissue_content.updateの title/body content update 契約と矛盾する。python-testrun29915654936/ job88908779434。squne121 commentedon Jul 22, 2026
Contract Review Result
test: content update契約へlegacy期待を同期 (#1660)
fix: title JSON transportを保持 (#1660)
fix: issue content update replay safety (#1660)
squne121 commentedon Jul 22, 2026
Contract Review Result
squne121 commentedon Jul 22, 2026
impl-review-loop: 完了
Issue #1660 の scope 拡張後 contract snapshot、AC1--AC7、current HEAD CI、および PR review を照合しました。
次アクション: 人間レビュー後にマージ判断。マージ・Issue close・cleanup は未実行です。
feat:issue-content-update (#1669)