Skip to content

実装: M2 playable-roadmap の close_conditions を sortie.md の正本定義と整合させる #1171

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "M2 playable-roadmap の close_conditions を sortie.md の正本定義に整合させ、close gate の false-green を防ぐ"
change_kind: docs
diff_rationale: M2 close_conditions が sortie.md の正本定義を直接閉じておらず、全文 grep AC/VC では false-green を起こしうるため、M2 fenced YAML block に閉じた docs SSOT 同期と traceability 更新を同一 issue で固定する
changed_requirement_id: DOC-ROADMAP-001
affected_sections: "docs/product/playable-roadmap.md::frontmatter last_updated_by_issue; docs/product/playable-roadmap.md::Conceptual Milestones > M2: Gameplay Core (v0.2.x) > close_conditions"

Parent Issue

none(単独改善)

Parent Goal Ref

  • Goal: docs/product/playable-roadmap.md の M2 close_conditions を docs/product/features/sortie.md の正本定義と一致させる
  • Desired Destination: N/A(単独改善 Issue のため)

Current Validated Scope

  • docs/product/playable-roadmap.md の M2 fenced YAML block にある close_conditions を、docs/product/features/sortie.md の正本定義(全敵撃破 victory / 30秒 timeout / HP0 defeat / terminal priority defeat > victory > timeout)と整合させる
  • frontmatter の last_updated_by_issue を 1171 に更新し、この修正の traceability を残す
  • docs-only 修正として pnpm run lint:docs を含む静的検証を contract に明記する

Remaining Parent Gaps

なし(単独改善 Issue のため)

Outcome

docs/product/playable-roadmap.md の M2 close_conditions が docs/product/features/sortie.md の正本定義と整合し、M2 block に閉じた検証で false-green を起こさず、pnpm run lint:docs / pnpm typecheck / pnpm lint / pnpm test / pnpm build が PASS した PR がマージされた状態。

In Scope

  • docs/product/playable-roadmap.md の M2 close_conditions に、enemy-elimination victory / 30秒 timeout / HP0 defeat / terminal priority defeat > victory > timeout を明記する
  • M2 close_conditions から 120秒生存勝利を正本扱いする読みを排除する
  • docs/product/playable-roadmap.md の frontmatter last_updated_by_issue を 1171 に更新する
  • docs-only 修正に必要な contract 記述として Runtime Verification Applicability と pnpm run lint:docs を追加する

Out of Scope

  • docs/product/features/sortie.md 自体の修正
  • GitHub milestone description の readback / 更新
  • docs/product/playable-roadmap.md の M3〜M5 close_conditions 変更
  • playable-roadmap 専用 validator の新規実装や既存 checker 拡張

Acceptance Criteria

  • AC1: docs/product/playable-roadmap.md の M2 fenced YAML block の close_conditions に、スポーン済み敵機をすべて撃破した場合の victory が明記されている
  • AC2: docs/product/playable-roadmap.md の M2 fenced YAML block の close_conditions に、30秒 timeout が neutral terminal として明記されている
  • AC3: docs/product/playable-roadmap.md の M2 fenced YAML block の close_conditions に、HP0 defeat と defeat が victory より優先され、victory が timeout より優先されることが明記されている
  • AC4: docs/product/playable-roadmap.md の M2 fenced YAML block の close_conditions で、120秒生存勝利を正本扱いしていない
  • AC5: docs/product/playable-roadmap.md の frontmatter last_updated_by_issue が 1171 である
  • AC6: pnpm run lint:docs が PASS する
  • AC7: pnpm typecheck が PASS する
  • AC8: pnpm lint が PASS する
  • AC9: pnpm test が PASS する
  • AC10: pnpm build が PASS する

Verification Commands

# AC1
$ rg -nU 'milestone_id: M2[\s\S]*close_conditions:[\s\S]*victory:[\s\S]*spec_destination:' docs/product/playable-roadmap.md

# AC2
$ rg -nU 'milestone_id: M2[\s\S]*close_conditions:[\s\S]*timeout:[\s\S]*neutral terminal[\s\S]*spec_destination:' docs/product/playable-roadmap.md

# AC3
$ rg -nU 'milestone_id: M2[\s\S]*close_conditions:[\s\S]*defeat:[\s\S]*defeat が victory より優先[\s\S]*victory が timeout より優先[\s\S]*spec_destination:' docs/product/playable-roadmap.md

# AC4
$ rg -nL '120秒生存' docs/product/playable-roadmap.md

# AC5
$ rg -n '^last_updated_by_issue: 1171$' docs/product/playable-roadmap.md

# AC6
# preflight-scope: pr_review_only
$ pnpm run lint:docs

# AC7
$ pnpm typecheck

# AC8
$ pnpm lint

# AC9
$ pnpm test

# AC10
$ pnpm build

Allowed Paths

  • docs/product/playable-roadmap.md

Product Spec Context

source_of_truth: docs/product/playable-roadmap.md
supporting_spec: docs/product/features/sortie.md
change_type: update
target_paths:
  - docs/product/playable-roadmap.md
diff_rationale: M2 conceptual milestone の close_conditions を sortie 正本に同期し、M2 block 外の語句ヒットで AC/VC が通る false-green を防ぐ
changed_requirement_id: DOC-ROADMAP-001
affected_sections:
  - frontmatter last_updated_by_issue
  - Conceptual Milestones > M2: Gameplay Core (v0.2.x) > close_conditions
product_spec_change_mode: docs_ssot_sync_only
spec_delta_type: docs_alignment

Runtime Verification Applicability

decision: not_applicable
reason: docs/product/playable-roadmap.md の docs-only close_conditions 整合修正であり、runtime 挙動は既存の SortieSystem / GameState / sortie.md に追従済み。静的検証と docs lint で十分。
applicable_acs: []
evidence: []

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • docs/product/features/sortie.md 自体の修正が同時に必要だと判明した場合
  • GitHub milestone metadata の readback / 更新を同一 Issue に混ぜないと解決できないと判明した場合
  • 新規 Issue 起票または owner 判断がなければ scope を確定できない場合
  • nested SubAgent delegation、権限昇格、外部サービス利用が必要になった場合
  • playable-roadmap 専用 validator 実装や checker 拡張を同一 Issue に混ぜないと false-green を防げないと判明した場合

Notes for Reviewer

  • docs/product/features/sortie.md には Intent の「30秒タイムアウトによる敗北」や Timeout guard の表現ゆれが残っているが、本 Issue の Allowed Paths 外なので別 follow-up として扱う
  • GitHub milestone 4 description の stale readback / cleanup は docs-only 範囲外のため、本 Issue に混ぜない
  • playable-roadmap の fenced YAML block 専用 validator 強化は既存の follow-up(実装: playable-roadmap の fenced YAML block / path existence validator を追加する #1183)で扱う前提とし、本 Issue では M2 block に閉じた rg -nU 検証で false-green を抑止する

Required Skills

なし

Scope Delta(任意)

anchor comment #issuecomment-4838015682 を反映し、M2 block scoped AC/VC、Runtime Verification Applicability、docs lint、traceability を追加。

Activity

  1. added
    enhancement
    phase/implementation
    triage-required
    agent/implementer
    docs
    area/docs
    on Jun 25, 2026
  2. squne121 commented on Jun 29, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST CHANGES。#1171 は方向性は正しいが、このまま実装に渡すと close gate の false-green を再発させる可能性が高いです。

    Issue #1171 の狙いは、docs/product/playable-roadmap.md の M2 close_conditions を sortie.md の正本定義、つまり「全敵撃破 victory / 30秒 timeout / HP0 defeat」に合わせる docs-only 修正です。Issue コメントは空で、まだ議論・補強コメントはありません。

    実装・仕様の現状を見る限り、runtime 側はすでに #1171 の意図に合っています。SORTIE_DURATION_MS は 30_000、terminal priority は defeat > victory > timeout、timeout は outcome: 'timeout' / endReason: 'timeout' として生成されています。

    一方で、playable-roadmap.md の M2 close_conditions は現在「1 sortie を開始→操作→戦闘結果まで通せる」「system tests と pnpm build が通る」などの抽象条件だけで、victory / timeout / defeat の意味を直接閉じていません。ここが #1171 の本丸です。


    敵対的レビュー

    P0: AC1/AC2 が弱すぎる

    現在の AC は rg -n "victory" docs/product/playable-roadmap.md と rg -n "timeout" docs/product/playable-roadmap.md です。これは M2 の close_conditions に正しい語が入ったことを保証しません。ファイル内の別セクション、コメント、M3/M4/M5、将来の説明文に語が出るだけで pass します。

    このリポジトリでは、同じ種の false-green 問題が PR #1180 後に指摘され、playable-roadmap の fenced YAML block / path existence validator を追加する #1183 が既に open です。#1183 の Background でも「全文 grep では false-green」「fenced YAML を parse していない」「参照パスの実在チェックがない」と明記されています。

    修正方針: AC は「ファイル全体に victory がある」ではなく、M2 fenced YAML block の close_conditions 内に、3 条件と優先順位があることを検証対象にしてください。


    P0: Runtime Verification Applicability がない

    #1171 は docs-only なので runtime verification は不要でよいですが、implement-issue skill は ## Runtime Verification Applicability セクションが存在しない場合、not_applicable と推定せず停止する運用です。

    追加すべきです。

    ## Runtime Verification Applicability
    
    decision: not_applicable
    reason: docs/product/playable-roadmap.md の docs-only close_conditions 整合修正であり、runtime 挙動は既存の SortieSystem / GameState / sortie.md に追従済み。静的検証と docs lint で十分。

    P1: docs-only なのに pnpm run lint:docs が AC にない

    package.json では lint は eslint .、lint:docs は markdownlint-cli2 と textlint の合成です。docs-only 修正で pnpm lint だけを品質ゲートにするのは弱いです。

    PR #1180 の owner review でも、pnpm lint と pnpm run lint:docs は別物であり、Markdown 変更の証跡として lint:docs が必要だと指摘されています。

    AC に追加してください。

    # AC: docs lint
    $ pnpm run lint:docs

    P1: sortie.md 側にも内部矛盾が残っている

    sortie.md は M2 における enemy-elimination victory / timer-based timeout を game-logic.md より優先する正本として定義しています。

    ただし、同じ sortie.md の Intent にはまだ「30秒タイムアウトによる敗北」という表現が残っています。また Timeout セクション内に playerHp <= 0 が Guard 1 として残っており、HP0 defeat と timeout の分離という #725 / PR #732 の意図と文書上は衝突します。

    #1171 の Allowed Paths は docs/product/playable-roadmap.md のみなので、この Issue で sortie.md を直すべきではありません。ただし、レビュー上は 「sortie.md に残る内部矛盾は別 follow-up」 と明記しないと、実装者が Stop Condition に入る可能性があります。


    P1: GitHub milestone description の stale 状態が未検証

    #1171 は「GitHub milestone description の victory 条件が sortie.md と衝突」と書いていますが、Issue 本文では milestone 4 description に「120秒生存勝利」がある可能性として扱っています。

    GitHub REST API では milestone の description は update 対象フィールドであり、PATCH /repos/{owner}/{repo}/milestones/{milestone_number} で更新できます。([GitHub Docs]1) gh api は GitHub API への認証済み HTTP request を行う CLI で、method や field 指定も可能です。([GitHub CLI]2)

    ただし、#1171 の Allowed Paths は docs-only なので、milestone metadata の変更を混ぜるべきではありません。このリポジトリの issue-contract-review skill には、GitHub milestone description の安全な readback 用に github_metadata_assert <contains|not_contains> description <literal> repos/<owner>/<repo>/milestones/<number> が定義されています。raw gh api を VC に書くより、こちらを別 Issue で使う方が安全です。


    P2: last_updated_by_issue を #1171 に更新する AC がない

    現在の playable-roadmap.md frontmatter は last_updated_by_issue: 1167 です。#1171 で同じファイルを変更するなら、traceability のため 1171 に更新すべきです。

    これは #1167 が path-level reference integrity を修正した履歴と、#1171 が close_conditions を整合する履歴を分ける意味でも必要です。#1167 は movement.md / projectile.md の非実在参照を movement-projectile.md に正規化するだけの Issue でした。


    #1171 の強化後 close_conditions 案

    docs/product/playable-roadmap.md の M2 close_conditions は、最低限この粒度にしてください。

    close_conditions:
      - 1 sortie を開始→操作→戦闘結果まで通せる
      - victory: スポーン済み敵機をすべて撃破した場合に成立する(allEnemiesDefeated、空配列 every() の vacuous truth は不可)
      - timeout: 30秒の time limit 到達時に成立する neutral terminal であり、victory / HP0 defeat とは区別する
      - defeat: player HP <= 0 の場合に成立し、同一 tick では victory / timeout より優先する
      - terminal priority は defeat > victory > timeout とする
      - SortieResult の outcome / endReason は docs/product/features/sortie.md の正本定義に従う
      - system tests と pnpm build が通る
      - src/systems から DOM / Canvas API を直接触っていない(MVP-001 遵守)
      - 固定タイムステップ 60Hz を維持(MVP-002 遵守)
      - DOM / Canvas 分離が維持されている(dom_canvas_separation invariant 遵守)

    sortie.md 側の正本は、全敵撃破 victory、HP0 defeat、30秒 timeout、優先順位 defeat > victory > timeout を明確に持っています。


    #1171 の AC / VC 修正版

    最低限、以下へ差し替えるべきです。

    ## Acceptance Criteria
    
    - [ ] AC1: M2 fenced YAML block の close_conditions に enemy-elimination victory が明記されている
    - [ ] AC2: M2 fenced YAML block の close_conditions に 30秒 timeout が neutral terminal として明記されている
    - [ ] AC3: M2 fenced YAML block の close_conditions に HP0 defeat と terminal priority defeat > victory > timeout が明記されている
    - [ ] AC4: M2 fenced YAML block の close_conditions に 120秒生存 victory / survival_timer を正本扱いする記述がない
    - [ ] AC5: frontmatter の last_updated_by_issue が 1171 である
    - [ ] AC6: pnpm run lint:docs が PASS する
    - [ ] AC7: pnpm typecheck が PASS する
    - [ ] AC8: pnpm lint が PASS する
    - [ ] AC9: pnpm test が PASS する
    - [ ] AC10: pnpm build が PASS する
    # AC1-AC3
    $ rg -nU 'milestone_id: M2[\s\S]*close_conditions:[\s\S]*victory[\s\S]*timeout[\s\S]*defeat[\s\S]*defeat > victory > timeout[\s\S]*spec_destination:' docs/product/playable-roadmap.md
    
    # AC4
    $ rg --files-without-match -U 'milestone_id: M2[\s\S]*close_conditions:[\s\S]*(120秒生存|生存時間 victory|survival_timer)[\s\S]*spec_destination:' docs/product/playable-roadmap.md
    
    # AC5
    $ rg -n '^last_updated_by_issue: 1171$' docs/product/playable-roadmap.md
    
    # AC6
    $ pnpm run lint:docs
    
    # AC7
    $ pnpm typecheck
    
    # AC8
    $ pnpm lint
    
    # AC9
    $ pnpm test
    
    # AC10
    $ pnpm build

    issue-contract-review は AC 番号と VC 番号の一致、決定論的な検証、fenced bash の canonical VC format を見る運用なので、AC/VC をこの程度まで機械検証可能に寄せる必要があります。


    別 Issue に分けるべき follow-up

    1. GitHub milestone 4 description の readback / cleanup
      実装: M2 playable-roadmap の close_conditions を sortie.md の正本定義と整合させる #1171 本体ではなく、change_kind: github-metadata の別 Issue にするべきです。VC は raw gh api ではなく、まず github_metadata_assert not_contains description "120秒生存勝利" repos/squne121/loop-protocol/milestones/4 を使う形が安全です。

    2. sortie.md の内部矛盾修正
      Intent の「30秒タイムアウトによる敗北」と Timeout セクションの playerHp <= 0 Guard を、実装: sortie の 30秒タイムアウトを defeat と区別し中立な「戦闘終了」表示にする #725 / PR fix(systems): sortie timeout as neutral terminal #732 後の neutral timeout 定義に合わせる docs Issue を分離してください。

    3. 実装: playable-roadmap の fenced YAML block / path existence validator を追加する #1183 の validator を先に実装するか、実装: M2 playable-roadmap の close_conditions を sortie.md の正本定義と整合させる #1171 の VC を block-scoped にする
      実装: playable-roadmap の fenced YAML block / path existence validator を追加する #1183 はまさに playable-roadmap の fenced YAML block を parse して false-green を潰すための Issue です。実装: M2 playable-roadmap の close_conditions を sortie.md の正本定義と整合させる #1171 を先にやるなら、少なくとも rg -nU で M2 block に閉じた検証へ変えるべきです。


    Codex CLI / Claude Code へ渡すなら

    Issue: https://github.com/squne121/loop-protocol/issues/1171
    
    作業前に Issue #1171 をそのまま実装しない。まず Issue contract を敵対的に補強する。
    
    目的:
    docs/product/playable-roadmap.md の M2 close_conditions を docs/product/features/sortie.md の正本定義に整合させる。
    正本定義は以下:
    - victory: spawned enemies all defeated / allEnemiesDefeated / enemies.length > 0 guard
    - defeat: player.hp <= 0
    - timeout: elapsedTicks >= targetTicks / 30秒 neutral terminal
    - priority: defeat > victory > timeout
    - survival_timer / 120秒生存 victory は M2 正本ではない
    
    必須:
    1. Runtime Verification Applicability を追加する。
    2. AC/VC を M2 fenced YAML block の close_conditions に閉じた検証へ強化する。
    3. pnpm run lint:docs を AC/VC に追加する。
    4. docs/product/playable-roadmap.md の frontmatter last_updated_by_issue を 1171 に更新する。
    5. Allowed Paths は docs/product/playable-roadmap.md のみ。
    6. sortie.md の内部矛盾、GitHub milestone 4 description 更新、validator #1183 は別 Issue / follow-up として扱い、#1171 に混ぜない。
    
    実装後:
    - pnpm run lint:docs
    - pnpm typecheck
    - pnpm lint
    - pnpm test
    - pnpm build
    を実行し、PR 本文に AC1〜AC10 の結果を個別に記録する。
    Closes #1171 を PR 本文に含める。
    破壊的操作、秘密情報、外部課金、権限不足、Allowed Paths 外変更が必要な場合のみ停止する。
    
  3. squne121 commented on Jun 29, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 完了レポート(termination_reason: approved)

    anchor comment(OWNER, #issuecomment-4838015682)を一次ソースとして #1171 の live body を更新し、review / contract gate まで再実行しました。現在の issue body は anchor が要求した M2 block-scoped AC/VC、Runtime Verification Applicability、docs-only の product spec evidence、follow-up 分離方針を含んでいます。

    anchor 指摘の反映結果

    • false-green になっていた keyword-only AC/VC を、docs/product/playable-roadmap.md の M2 fenced YAML block に閉じた AC1〜AC5 へ更新
    • Runtime Verification Applicability を decision: not_applicable で追加
    • docs-only quality gate として pnpm run lint:docs を contract に残しつつ、repo allowlist に合わせて preflight-scope: pr_review_only へ委譲
    • last_updated_by_issue: 1171 の traceability 要件を AC/VC に追加
    • sortie.md の内部矛盾、GitHub milestone description 更新、validator 強化は本 Issue に混ぜず follow-up 扱いに固定

    検証結果

    • check_issue_contract.py --file tmp/issue_1171_refined.md: verdict: approve
    • contract_readiness_check.py --mode preflight-static --body-file tmp/issue_1171_refined.md: status: go
    • issue-reviewer compact result: VERDICT: approve
    • run_contract_review_once.py --issue-number 1171 --repo squne121/loop-protocol --mode static: status: go
      • AC1〜AC5: baseline fail expected として go
      • AC6: pr_review_only として defer
      • AC7〜AC10: pnpm typecheck / pnpm lint / pnpm test / pnpm build exit 0
    LOOP_HANDOFF_RESULT_V1:
      status: impl_ready
      routing_action: run_impl_review_loop
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: null
        generated_at: "2026-06-29T23:01:38Z"
        body_sha256: "sha256:66bb2180723bd574720c1899fbfe229ccd8ac32d31a550e35ce0c7b0f8b2298a"
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: auto_fixed
        required: []
        skipped:
          - kind: contract_snapshot_materialization
            executor: implementation-worker
            result: skipped
            evidence:
              before: "run_contract_review_once.py は go を返したが snapshot comment は生成しない"
              after: "termination comment に handoff を記録し、impl-review-loop 側で必要なら snapshot materialization を再実行する"
              comment_url: null
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-06-29T23:01:38Z"
      checked_body_sha256: "sha256:66bb2180723bd574720c1899fbfe229ccd8ac32d31a550e35ce0c7b0f8b2298a"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations:
        - "#1183 が playable-roadmap fenced YAML validator 強化の既存 follow-up として本文に記録済み"
        - "sortie.md 内部矛盾と GitHub milestone description cleanup は本 Issue の Allowed Paths 外であり、今回の refinement では note-only とした"
  4. squne121 commented on Jun 30, 2026

    @squne121
    OwnerAuthor

    impl-review-loop handoff update (2026-06-30T10:40:00Z)

    #1171 の impl-review-loop は current main の unrelated baseline blocker により継続停止です。

    ❯ tests/agent-run-report-check-command.test.ts (5 tests | 1 failed) 10756ms
    × GIVEN default target override that matches 0 files in CI WHEN check command is run THEN exits 1 9280ms

    Test Files 1 failed | 81 passed (82)
    Tests 1 failed | 1205 passed (1206)
    Start at 19:39:55
    Duration 15.99s (transform 41.69s, setup 0ms, import 63.48s, tests 150.89s, environment 14.15s)

    [ELIFECYCLE] Test failed. See above for more details. failure で を返した

    次アクション:

    Refs #1246

  5. squne121 commented on Jun 30, 2026

    @squne121
    OwnerAuthor

    impl-review-loop handoff update (2026-06-30T10:40:00Z)

    #1171 の impl-review-loop は current main の unrelated baseline blocker により継続停止です。

    次アクション:

    Refs #1246

  6. squne121 commented on Jun 30, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-30T11:43:59Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1171
      body_sha256: "sha256:66bb2180723bd574720c1899fbfe229ccd8ac32d31a550e35ce0c7b0f8b2298a"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        vc_preflight: pass
      source: ensure_contract_snapshot_auto
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

    agent/implementerarea/docsdocsenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions