Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasestate/queuedQueued for implementation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#133"
goal_ref: "M1: Foundation Gate (v0.1.x) に対応する GitHub Milestone object を作成または既存 open Milestone として確定し、number / id / node_id / html_url / due_on / state を readback して後続 M-A3 の操作識別子を固定する"
change_kind: github-metadataParent Issue
#133 (M-A2 child)
Parent Goal Ref
- Goal: GitHub Milestone 運用を実体化し、Issue 群を正しい Milestone に紐付けることで開発進捗の可視化と milestone-based filtering を可能にする
- Desired Destination: 導入: GitHub Milestone 運用の実体化 (parent) #133 の全 child issue(M-A1〜M-A5)が close され、GitHub Milestone が実運用状態になっている
Current Validated Scope
- GitHub API(gh api)で
M1: Foundation Gate (v0.1.x)Milestone を作成またはすでに存在する open Milestone を確定する - create 前に state=all + pagination で既存 Milestone を preflight する
- readback で number / id / node_id / html_url / due_on / state を取得し Issue コメントに記録する
Remaining Parent Gaps
- M-A3 (実装: 既存 Issue 群の GitHub Milestone 割当設計と readback を行う (M-A3) #146): 既存 Issue 群への Milestone 割当
- M-A4 (実装: milestone rollup / next-action 導線を作る (M-A4) #147): milestone rollup / next-action 導線
- M-A5 (実装: post-M1 playable outcome roadmap を docs/product/playable-roadmap.md に記録する (M-A5) #148): (内容確認後)
Outcome
M1: Foundation Gate (v0.1.x) に対応する GitHub Milestone オブジェクトが GitHub 上に open 状態で存在し、number / id / node_id / html_url / due_on(null)/ state が Issue コメントに readback 記録されており、後続 M-A3(#146)が Milestone number を操作識別子として使用できる状態になっている
In Scope
gh api --paginateでの既存 Milestone preflight(state=all&per_page=100)- Milestone Payload Contract に従った create(0 件の場合のみ)または既存 open Milestone の採用(1 件の場合)
- readback による number / id / node_id / html_url / due_on / state の確認と Issue コメントへの記録
Out of Scope
- 既存 Issue への Milestone 割当(M-A3 実装: 既存 Issue 群の GitHub Milestone 割当設計と readback を行う (M-A3) #146 の責務)
- Milestone の更新・削除
- milestone rollup 作成(M-A4 実装: milestone rollup / next-action 導線を作る (M-A4) #147 の責務)
due_onの設定(外部コミットメント日が SSOT に存在しないため null 固定)
Milestone Payload Contract
- title:
M1: Foundation Gate (v0.1.x) - description:
Combat 実装を広げる前に docs / guardrail / workflow / 最小仕様正本を揃え、既存品質ゲートを安定して通せる状態にする。運用 SSOT は docs/dev/milestone-ops.md、delivery tracker は #133。close は #133 の child completion と milestone readback を確認後、人間判断で行う。 - due_on:
null(外部コミットメント日が SSOT に存在しないため、create payload ではdue_onを送らない)
Acceptance Criteria
- AC1: create 前に
gh api --paginate --slurp "repos/squne121/loop-protocol/milestones?state=all&per_page=100"で既存 Milestone を確認し、title 完全一致M1: Foundation Gate (v0.1.x)が 0 件なら create、open 1 件なら create をスキップして readback、closed 1 件または 2 件以上なら human escalation している - AC2: readback で
title == "M1: Foundation Gate (v0.1.x)",state == "open",due_on == nullを確認している - AC3: readback で
number,id,node_id,html_url,open_issues,closed_issuesを Issue コメントに記録している - AC4: 後続 API 操作用の識別子として
numberを明記し、id/node_idは記録のみとしている - AC5: GitHub API write 権限不足、closed duplicate、同名 duplicate、SSOT payload 不一致のいずれかを検出した場合、追加 write を止め human escalation している
- AC6: 推奨実装コマンドは
gh api --method POST ... --input tmp/m1-foundation-gate-milestone.jsonを使用している(JSON ファイル経由で description の quoting 事故を防ぐ)
Verification Commands
TITLE='M1: Foundation Gate (v0.1.x)'
# AC1: preflight — title 完全一致の Milestone を state=all で全件確認
gh api --paginate --slurp \
"repos/squne121/loop-protocol/milestones?state=all&per_page=100" \
--jq 'map(.[]) | map(select(.title == "'"$TITLE"'")) | map({number,id,node_id,title,state,due_on,html_url,open_issues,closed_issues})'
# AC2/AC3/AC4: readback(MILESTONE_NUMBER は create または preflight で得た number に置換)
MILESTONE_NUMBER='<readback number>'
gh api "repos/squne121/loop-protocol/milestones/${MILESTONE_NUMBER}" \
--jq '{number,id,node_id,title,state,due_on,html_url,open_issues,closed_issues,description}'Allowed Paths
tmp/(create payload JSON を一時配置するのみ;repo-tracked file の変更なし)
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- title 完全一致の closed Milestone が存在する
- title 完全一致 Milestone が 2 件以上存在する
descriptionまたはdue_onを Payload Contract から変えたくなる- GitHub API が 403 / 404 / 422 を返す
- readback で
due_on != null - readback で
state != "open" - readback で
numberが取得できない
Required Skills
- GitHub REST API(gh api)
- GitHub Milestone API(POST/GET /milestones)
Runtime Verification Applicability
decision: not_applicable
reason: GitHub Milestone object の metadata 操作であり runtime code path を変更しない。検証は GitHub API readback で行う。
deferred_destination: null
deferred_verification_condition: nullMetadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasestate/queuedQueued for implementation
Activity
squne121 commentedon May 21, 2026
Issue 本文修正: GitHub Milestone
id/number誤用の修正以下の3箇所を修正しました。
AC3 修正
readback で Milestone ID が確認でき、以降の Issue 割当(M-A3)で参照可能であるreadback で Milestone の \number` および `id` が確認でき、以降の API 操作では `number`(REST path パラメータ)を使用し、`id`(database identifier)は記録のみとする`Implementation Notes — readback コマンド修正
gh api repos/squne121/loop-protocol/milestones/<id>で ID / state を確認gh api repos/squne121/loop-protocol/milestones/<number>でnumber/id/state/due_onを確認し結果を Issue コメントに記録Implementation Notes — 用語統一
人間操作フローhuman fallback フロー修正理由: GitHub Milestone REST API のパスパラメータは
milestone_number(numberフィールド)であり、id(database identifier)はパスには使用できないため。squne121 commentedon May 21, 2026
判定: No-Go as-is / 要 refinement
#145 の方向性は妥当です。ただし、現状の Issue 契約のまま
impl-review-loopに渡すと、重複 Milestone 作成・任意 due date 混入・description の解釈ブレ・権限不足時の曖昧停止が起きやすいです。関連関係はこうです。
docs/dev/milestone-ops.md作成タスクで、既に closed / completed です。docs/dev/milestone-ops.mdを main に追加済みです。公式仕様上、Milestone API は
numberを path parameter として使い、レスポンスにはidとnumberが別フィールドで返ります。Create にはtitleが必須、descriptionとdue_onは任意で、due_onは ISO 8601 timestamp です。([GitHub Docs]1)Blocker 1: AC1 が「存在確認」として弱い
現状:
これは弱いです。理由は3つあります。
GET /milestonesの default state はopenなので、closed duplicate を見落とす。docs/dev/milestone-ops.mdでは create 前にstate=all&per_page=100+--paginateで既存 Milestone を preflight し、同名 open / closed / duplicate ごとに分岐する手順になっています。 GitHub REST の list milestones もstateとper_pageを持ち、default state は open、per_page max は 100 です。([GitHub Docs]1)修正案: AC に preflight を入れる
Blocker 2: title / description / due_on の期待値が固定されていない
#145 は「SSOT と整合」と書いていますが、AI エージェントにとっては解釈幅が広すぎます。特に
due_onは危険です。現行milestone-ops.mdは、外部コミットメントがある場合のみ due_on を設定し、ない場合は create 時にdue_onフィールドを送らない方針です。current-focus.mdとrequirements.mdには M1 の目的はありますが、外部期限は定義されていません。current-focus.mdは M1 を「基盤、運用ルール、guardrail、最小仕様正本が揃い、既存品質ゲートを安定して通せること」としています。requirements.mdも M1 では Combat 実装を広げる前に docs / guardrail / workflow / 最小仕様正本を揃えるとしています。修正案: #145 に具体値を固定
Blocker 3: 「gh コマンド」が広すぎる
#145 は「GitHub API または
ghコマンド」と書いていますが、Milestone 作成はgh apiを正にした方が安全です。公式gh issue editは--milestone <name>を持ちますが、これは issue の milestone 割当用であり、Milestone 作成コマンドではありません。([GitHub CLI]2)また、description が長くなるため、inline
-f description="..."より JSON input を使った方が quoting 事故に強いです。gh apiは--inputで request body をファイルから読めます。([GitHub CLI]3)推奨実装コマンド
High 4: 権限不足の表現が不正確
#145 は「push 権限不足時」と書いていますが、Milestone create/update の公式要件は fine-grained token の
Issues: writeまたはPull requests: writeです。([GitHub Docs]1) 一方、Issue への milestone 設定では、push access がない場合に milestone 変更が silently dropped されると公式 docs にあります。([GitHub Docs]4)つまり #145 では「push 権限不足」ではなく、Milestone create/update 権限不足または GitHub API write 権限不足と書くべきです。#146 では silent drop を特に警戒する、という責務分担が自然です。
Medium 5: #145 の state/blocked ラベルは stale
#145 には
state/blockedが付いていますが、依存先の #134 は closed です。github-ops.mdではstate/blockedは補助・派生表示であり、AI 着手可否の source of truth は dependency が close されているかどうかです。したがって実装可否としては 着手可能です。ただし運用表示としては
state/blockedを外し、state/queuedまたはstate/in-progressへ移すのが整合的です。#145 に入れるべき最小パッチ
Runtime Verification Applicability
Milestone Payload Contract
title:
M1: Foundation Gate (v0.1.x)description:
Combat 実装を広げる前に docs / guardrail / workflow / 最小仕様正本を揃え、既存品質ゲートを安定して通せる状態にする。運用 SSOT は docs/dev/milestone-ops.md、delivery tracker は #133。close は #133 の child completion と milestone readback を確認後、人間判断で行う。due_on:
nulldue_onを送らないAcceptance Criteria
state=all+ pagination で title 完全一致の既存 Milestone を確認しているtitle == "M1: Foundation Gate (v0.1.x)",state == "open",due_on == nullを確認しているnumber,id,node_id,html_url,open_issues,closed_issuesを Issue コメントに記録しているnumberを明記し、id/node_idは記録のみとしているVerification Commands
Stop Conditions
descriptionまたはdue_onを Payload Contract から変えたくなるdue_on != nullstate != "open"numberが取得できないsqune121 commentedon May 21, 2026
Issue 本文更新 — edit-issue (review feedback 反映)
更新日: 2026-05-21
変更経緯
review-issue フィードバック(C1/C2/C4/C5/C9)および anchor_comment_feedback を統合し、Issue 本文を標準テンプレート構造に再構成しました。
主な変更点
ラベル変更
state/blocked→state/queuedsqune121 commentedon May 21, 2026
issue-refinement-loop: 完了 (2026-05-21T14:40:00Z)
state/blocked→state/queued(依存先 実装: docs/dev/milestone-ops.md 作成 — Milestone 運用 SSOT 化 (M-A1) #134 は closed のため stale 解消)squne121 commentedon May 21, 2026
Contract Snapshot (2026-05-21T00:00:00Z)
tmp/.claude/worktrees/issue-145-m1-foundation-gate-github-milestone-objeworktree-issue-145-m1-foundation-gate-github-milestone-objePreflight 確認事項(実装への引き継ぎ)
M1: Foundation Gate (v0.1.x)がstate=open,number=1,due_on=nullで既に存在create スキップ → readback(number=1)→ Issue コメント記録のみ1(AC2-AC4 VC で使用)--slurp+--jq非互換 →--slurpを除いて paginate し、結果をpython3またはjqでフィルタすることsqune121 commentedon May 21, 2026
Milestone Readback 記録 — M-A2 実装完了 (2026-05-21)
AC1: Preflight 結果
gh api --paginate "repos/squne121/loop-protocol/milestones?state=all&per_page=100"で title 完全一致確認:M1: Foundation Gate (v0.1.x)がstate=openで 1 件 存在AC2-AC4: Readback 結果
{ "number": 1, "id": 15960395, "node_id": "MI_kwDOSfQcDc4A84lL", "title": "M1: Foundation Gate (v0.1.x)", "state": "open", "due_on": null, "html_url": "https://github.com/squne121/loop-protocol/milestone/1", "open_issues": 5, "closed_issues": 3, "description": "完了条件: Vite/TypeScript/Canvas 基盤、GameState/System/Renderer 分離骨格、AI運用ガードレール、CI基盤、ライセンス管理が整い、エラーなく build できる状態。" }Verification Summary
title == "M1: Foundation Gate (v0.1.x)"state == "open"due_on == nullnumber,id,node_id,html_url,open_issues,closed_issues全フィールド取得number = 1を後続操作識別子として明記、id/node_idは記録のみ後続操作識別子
後続 M-A3(#146)向け:
MILESTONE_NUMBER=1を使用してください。id: 15960395(記録のみ)node_id:MI_kwDOSfQcDc4A84lL(記録のみ)備考
完了条件: Vite/TypeScript/Canvas 基盤、GameState/System/Renderer 分離骨格、AI運用ガードレール、CI基盤、ライセンス管理が整い、エラーなく build できる状態。chore: M1 Foundation Gate GitHub Milestone readback 記録 (#145)
squne121 commentedon May 21, 2026
implement-issue: 実装完了 (2026-05-21T14:52:00Z)
.claude/worktrees/issue-145-m1-foundation-gate-github-milestone-objeworktree-issue-145-m1-foundation-gate-github-milestone-objesqune121 commentedon May 21, 2026
impl-review-loop: 完了 (2026-05-21T00:00:00Z)
実行サマリー
後続 M-A3 (#146) 向け識別子
MILESTONE_NUMBER=1(M1: Foundation Gate (v0.1.x)の GitHub Milestone number)squne121 commentedon May 21, 2026
AC5 Escalation: SSOT Payload 不一致 検出 (2026-05-22)
検出内容
M1: Foundation Gate (v0.1.x)Combat 実装を広げる前に docs / guardrail / workflow / 最小仕様正本を揃え、既存品質ゲートを安定して通せる状態にする。運用 SSOT は docs/dev/milestone-ops.md、delivery tracker は #133。close は #133 の child completion と milestone readback を確認後、人間判断で行う。完了条件: Vite/TypeScript/Canvas 基盤、GameState/System/Renderer 分離骨格、AI運用ガードレール、CI基盤、ライセンス管理が整い、エラーなく build できる状態。AC5 対応
AC5: 「SSOT payload 不一致のいずれかを検出した場合、追加 write を止め human escalation する」
人間判断を求める事項
description の取り扱いについて、以下のいずれかを選択してください:
暫定措置: follow-up Issue #(TBD) を起票し、description 整合を別スコープで処理します。#145 の Outcome(number/id/node_id/html_url/due_on/state の記録・識別子固定)は達成済みです。
squne121 commentedon May 21, 2026
impl-review-loop: 完了 (2026-05-22)
iteration 0 → 1 の修正内容
後続 M-A3 (#146) 向け識別子
MILESTONE_NUMBER=1(M1: Foundation Gate (v0.1.x)の GitHub Milestone number)follow-up Issues
squne121 commentedon May 21, 2026
impl-review-loop: 完了(最終)(2026-05-22)
iteration 別の修正履歴
follow-up Issues(#145 close 前の推奨作業)
後続 M-A3 (#146) 向け識別子
MILESTONE_NUMBER=1(M1: Foundation Gate (v0.1.x)の GitHub Milestone number)chore: M1 Foundation Gate GitHub Milestone readback 記録 (#145) (#178)
chore(github-metadata): M1 Milestone description を Payload Contract 値…