Skip to content

実装: GitHub Milestone #3 の title・description を M3 Result Persistence 境界に再同期する #913

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: GitHub Milestone #3 の title と description を正本 docs(playable-roadmap.md / requirements.md)の M3 Result Persistence 境界に一致させる
change_kind: workflow

Parent Issue

none(単独改善)

Parent Goal Ref

  • Goal: Milestone metadata が正本 docs と一致し、M3/M4 境界が明確であること
  • Desired Destination: Milestone AI運用憲法と最小仕様正本を整備する #3 の title が "M3: Result Persistence (v0.3.x)"、description が M4 除外境界を簡潔に記述した状態

Current Validated Scope

Remaining Parent Gaps

なし(単独 Issue のため)

Outcome

gh issue list --repo squne121/loop-protocol --milestone 3 の readback で #740 / #733 が milestone 3 に紐づいていることが確認できた状態。かつ Milestone #3 の title が M3: Result Persistence (v0.3.x)、description が指定文になっている状態。

In Scope

  • gh api PATCH repos/squne121/loop-protocol/milestones/3 で title を M3: Result Persistence (v0.3.x) に更新する
  • 同 PATCH で description を下記指定文に更新する:
    M3: Result Persistence (v0.3.x)。sortie 結果から reward を算出し、resources に反映し、browser-local の localStorage progression snapshot として保存し、同一 HTTP origin の reload 後に復元する。weapon upgrade / resource consumption は M4 scope(正本: docs/product/playable-roadmap.md)。
    
  • readback で title / description / issue 紐づきを確認してレポートする

Out of Scope

Acceptance Criteria

Verification Commands

# AC1
# preflight-scope: pr_review_only
$ gh api repos/squne121/loop-protocol/milestones --jq '.[] | select(.number==3) | .title'
# AC2
# preflight-scope: pr_review_only
$ gh api repos/squne121/loop-protocol/milestones --jq '.[] | select(.number==3) | .description'
# AC3
# preflight-scope: pr_review_only
$ gh api repos/squne121/loop-protocol/milestones --jq '.[] | select(.number==3) | {number,state,open_issues,closed_issues,due_on}'
# AC4
# baseline-expect: pass
$ gh issue list --repo squne121/loop-protocol --milestone 3 --state open --limit 200 --json number --jq '[.[].number] | contains([733, 740])'
# AC5
# baseline-expect: pass
$ gh issue list --repo squne121/loop-protocol --milestone "M3: Result Persistence (v0.3.x)" --state open --limit 200 --json number --jq '[.[].number] | contains([733, 740])'
# AC6
# preflight-scope: pr_review_only
$ gh api --paginate --slurp "repos/squne121/loop-protocol/issues?milestone=3&state=all&per_page=100" --jq '[.[][] | select(.pull_request != null)] | length == 0'
# AC7
# preflight-scope: pr_review_only
$ gh api repos/squne121/loop-protocol/issues/913 --jq '.state == "closed"'

Allowed Paths

N/A(repo ファイル変更なし / GitHub API milestone metadata のみ)

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

なし

Scope Delta(任意)

N/A

Runtime Verification Applicability

decision: immediate
applicable_acs:
  - AC1
  - AC2
  - AC3
  - AC4
  - AC5
  - AC6
  - AC7
execution_environment:
  cli_tools:
    - gh
  auth_required: true
  network_required: true
  baseline_preflight_note: "gh api は preflight allowlist 外のため baseline_vc_preflight blocked は expected_failure(#913 固有 issue-local 許可)"
skip_conditions:
  - "gh CLI が未インストールの場合は全 AC を environment_blocked として扱う"
  - "gh auth status が失敗する場合は全 AC を environment_blocked として扱う"
  - "squne121/loop-protocol への write 権限がない場合は AC1〜AC7 を environment_blocked として扱う"
  - "GitHub API 障害時は全 AC を environment_blocked として扱う"
fallback_policy:
  fallback_success_is_pass: false
  notes: "GitHub UI 目視や stale cache を PASS にしない。gh api / gh issue list の CLI readback のみを PASS とする"
artifact_requirements:
  - "before / after milestone JSON(title, description, state, number, open_issues, closed_issues, due_on)"
  - "AC4/AC5 の gh issue list で [733, 740] contains 結果"
  - "AC6 の direct PR 混入チェック結果"
  - "#913 readback comment URL"
  - "close 後の gh api .state == 'closed' 確認結果"

Delivery Rule

mutation は 1 PATCH のみ。readback / comment / close は複数操作許容。repo ファイル変更がないため PR 不要。gh api PATCH コマンドを直接実行し、readback レポートを Issue comment に残して close する。

Activity

  1. added
    enhancement
    phase/implementation
    on Jun 14, 2026
  2. squne121 commented on Jun 14, 2026

    @squne121
    OwnerAuthor

    判定

    #913 は目的自体は妥当。ただし、そのまま実行して close するのは BLOCK 寄りです。
    M3 の正本はすでに M3: Result Persistence (v0.3.x) で、M4 は resource 消費・upgrade 側という境界になっているため、Milestone #3 の title/description を再同期する方向は正しいです。playable-roadmap.md は M3 を Result Persistence、M4 を Upgrade Loop と定義し、M3 non-goals に upgrade/resource 消費を置いています。requirements.md も M3 を「報酬 → resource → localStorage 永続化 → reload 復元」とし、武器強化は M4 としています。

    ただし #913 の現在の契約は、readback と close 判定が甘いです。Milestone metadata 変更は repo ファイル変更なしで扱うのは正しい一方、GitHub Milestone object の操作は roadmap 上も別 Issue として分離する運用になっているため、API readback の精度を落とすと SSOT 再同期 Issue として意味がありません。

    主な敵対的指摘

    1. 「open_issues に 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740 / 導入: M3 Loop MVP Gate を報酬→resource→localStorage 永続化まで接続する #733 が含まれる」は概念として誤りです。
      GitHub Milestone の open_issues は件数であり、Issue number の配列ではありません。実装: GitHub Milestone #3 の title・description を M3 Result Persistence 境界に再同期する #913 の AC3/AC4 は gh issue list --milestone 3 で確認する形になっていますが、Outcome 文では milestone readback 自体で 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740/導入: M3 Loop MVP Gate を報酬→resource→localStorage 永続化まで接続する #733 を含むように読めます。これは修正すべきです。現在、検索上は旧 milestone title M3: Loop MVP Gate (v0.3.x) に open 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740 と 導入: M3 Loop MVP Gate を報酬→resource→localStorage 永続化まで接続する #733 が紐づいています。

    2. 検証コマンドに --repo と --limit / --paginate が足りません。
      gh issue list --milestone は number または title を受け取れますが、既定では current repo 前提かつ取得件数にも制限があります。実行ディレクトリが違う、または milestone 内 issue が増えた場合に誤判定します。gh issue list の --milestone は number/title filter であることは CLI manual 上確認できます。([GitHub CLI]1)

    3. Delivery Rule の「1 Issue = 1 gh api 実行」は危険です。
      正しくは「mutation は 1 PATCH のみ。readback は複数回可」です。GitHub の Update milestone API は PATCH /repos/{owner}/{repo}/milestones/{milestone_number} で、title と description を更新できます。([GitHub Docs]2) readback、PR 混入確認、Issue comment 投稿、Issue close は別操作として許容しないと、証跡不足になります。

    4. Milestone title rename の副作用を見ていません。
      repo の milestone-ops は、REST API では milestone number、gh CLI の issue 割当では milestone title/name を使うと明記しています。title を変えると、今後 --milestone "M3: Loop MVP Gate (v0.3.x)" に依存した運用が壊れます。最低限、rename 後に --milestone 3 と --milestone "M3: Result Persistence (v0.3.x)" の両方で 導入: M3 Loop MVP Gate を報酬→resource→localStorage 永続化まで接続する #733/実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740 を読めることを確認すべきです。

    5. Milestone 直紐づけ PR の混入チェックがありません。
      milestone-ops は PR を Milestone に直接紐づけない運用を定義し、rollup では PR 混入チェックを行うとしています。実装: GitHub Milestone #3 の title・description を M3 Result Persistence 境界に再同期する #913 は metadata 修正だけですが、readback レポートに PR 混入 0 を含めると品質が上がります。

    6. description は localStorage を強く言いすぎないほうがよいです。
      localStorage は origin 単位で、private browsing では最後の private tab を閉じると消え、file: URL の挙動は未定義です。また setItem() は QuotaExceededError を投げ得て、値は string 保存です。M3 description は「永続化」ではなく「browser-local / same-origin reload 復元」程度の表現に寄せるほうが安全です。([MDNウェブドキュメント]3) ([MDNウェブドキュメント]4)

    修正版の受け入れ条件案

    ## Acceptance Criteria
    
    - [ ] AC1: Milestone #3 の `number` が 3、`state` が `open` のまま、title が `M3: Result Persistence (v0.3.x)` になっている
    - [ ] AC2: Milestone #3 の description が M3 Result Persistence 境界を示し、weapon upgrade / resource consumption を M4 scope と明記している
    - [ ] AC3: Milestone #3 の due_on / state / issue assignment を意図せず変更していない
    - [ ] AC4: `gh issue list --repo squne121/loop-protocol --milestone 3 --state open --limit 200` で #733 と #740 が含まれる
    - [ ] AC5: `gh issue list --repo squne121/loop-protocol --milestone "M3: Result Persistence (v0.3.x)" --state open --limit 200` でも #733 と #740 が含まれる
    - [ ] AC6: Milestone #3 に直接紐づいた PR が 0 件である
    - [ ] AC7: readback 結果を #913 に comment し、#913 だけを close する。Milestone #3 は close しない
    

    推奨コマンド草案

    set -euo pipefail
    
    REPO="squne121/loop-protocol"
    MILESTONE_NUMBER=3
    TITLE="M3: Result Persistence (v0.3.x)"
    DESC="M3: Result Persistence (v0.3.x)。sortie 結果から reward を算出し、resources に反映し、browser-local の localStorage progression snapshot として保存し、同一 HTTP origin の reload 後に復元する。weapon upgrade / resource consumption は M4 scope(正本: docs/product/playable-roadmap.md)。"
    
    before="$(mktemp)"
    after="$(mktemp)"
    payload="$(mktemp)"
    
    gh api "repos/${REPO}/milestones/${MILESTONE_NUMBER}" \
      --jq '{number,state,title,description,open_issues,closed_issues,due_on,html_url,updated_at}' \
      > "$before"
    
    jq -n --arg title "$TITLE" --arg description "$DESC" \
      '{title:$title, description:$description}' > "$payload"
    
    gh api --method PATCH "repos/${REPO}/milestones/${MILESTONE_NUMBER}" \
      --input "$payload" \
      --jq '{number,state,title,description,open_issues,closed_issues,due_on,html_url,updated_at}' \
      > "$after"
    
    open_numbers="$(
      gh issue list \
        --repo "$REPO" \
        --milestone "$MILESTONE_NUMBER" \
        --state open \
        --limit 200 \
        --json number,title,url \
        --jq '[.[].number]'
    )"
    
    title_numbers="$(
      gh issue list \
        --repo "$REPO" \
        --milestone "$TITLE" \
        --state open \
        --limit 200 \
        --json number,title,url \
        --jq '[.[].number]'
    )"
    
    direct_prs="$(
      gh api --paginate --slurp \
        "repos/${REPO}/issues?milestone=${MILESTONE_NUMBER}&state=all&per_page=100" \
        --jq '[.[][] | select(.pull_request != null) | {number,title,state,html_url}]'
    )"
    
    jq -n \
      --argjson before "$(cat "$before")" \
      --argjson after "$(cat "$after")" \
      --argjson open_numbers "$open_numbers" \
      --argjson title_numbers "$title_numbers" \
      --argjson direct_prs "$direct_prs" \
      '{
        before:$before,
        after:$after,
        milestone_number_filter_open_issue_numbers:$open_numbers,
        milestone_title_filter_open_issue_numbers:$title_numbers,
        has_733_by_number: ($open_numbers | contains([733])),
        has_740_by_number: ($open_numbers | contains([740])),
        has_733_by_title: ($title_numbers | contains([733])),
        has_740_by_title: ($title_numbers | contains([740])),
        direct_prs_on_milestone:$direct_prs
      }'
    

    実行可否

    #913 は修正後なら GO。
    ただし、今のままなら「PATCH は成功したが、#733/#740 の紐づけ・title rename の副作用・PR 混入・HTML/API 乖離を見ないまま close」できてしまいます。Milestone metadata issue は変更範囲が小さいぶん、readback 証跡を厳密にするべきです。

  3. squne121 commented on Jun 14, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Human Escalation Required

    The loop has terminated and requires human review. Cause: human judgment required

    Blockers

    "gh api コマンドが VC allowlist 外(AC1/AC2/AC3/AC6/AC7): Milestone REST API は gh api 経由でしか操作できず、この Issue 固有の例外許可または allowlist 拡張が必要"
    
    "AC4/AC5 の VC に # baseline-expect: pass アノテーションが不足(現時点では含まれていない)"
    
    "## Runtime Verification Applicability セクションが不足(reviewer が C9 として検出)"
    
  4. squne121 commented on Jun 14, 2026

    @squne121
    OwnerAuthor

    Readback Report — #913 実行結果

    Milestone #3 変更内容

    フィールド before after
    title M3: Loop MVP Gate (v0.3.x) M3: Result Persistence (v0.3.x)
    description 完了条件: 戦闘後の報酬獲得…武器1種のパラメータ強化(resource 消費)は M4: Upgrade Loop のスコープ… M3: Result Persistence (v0.3.x)。…browser-local の localStorage…weapon upgrade / resource consumption は M4 scope…
    state open open(変更なし)
    number 3 3(変更なし)
    open_issues 2 2(変更なし)
    closed_issues 12 12(変更なし)
    due_on null null(変更なし)

    mutation: PATCH /repos/squne121/loop-protocol/milestones/3 1 回のみ実行


    AC 検証結果

    AC 結果 コマンド / 確認内容
    AC1: title が M3: Result Persistence (v0.3.x) ✅ PASS `gh api …milestones --jq '…
    AC2: description が指定文で始まる ✅ PASS `gh api …milestones --jq '…
    AC3: number=3、state=open、due_on / closed_issues 不変 ✅ PASS {number:3,state:"open",open_issues:2,closed_issues:12,due_on:null}
    AC4: milestone 3 に #733 と #740 が含まれる(number filter) ✅ PASS gh issue list --milestone 3 …--jq '…contains([733, 740])' → true
    AC5: milestone title filter でも #733 と #740 が含まれる ✅ PASS gh issue list --milestone "M3: Result Persistence (v0.3.x)" … → true
    AC6: milestone 3 に直接紐づいた PR が 0 件 ✅ PASS gh api --paginate …issues?milestone=3… --jq '…length' → 0
    AC7: このコメント投稿後に #913 のみ close 実行中

    確認事項

    全 AC PASS のため、このコメント投稿後に #913 を close します。

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

    enhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions