Skip to content

spec/impl(#483): MVP sortie を敵機全滅勝利・30秒終了に変更する #542

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
goal_ref: "#483 MVP sortie 終了条件を 30秒・敵機全滅勝利に変更する"
change_kind: spec+impl
parent_issue: 483
anchor_comment: "https://github.com/squne121/loop-protocol/issues/542#issuecomment-4586254809"

Parent Issue

#483

Parent Goal Ref

Current Validated Scope

anchor comment #4586254809(人間判断)により確定:

  • MVP 戦闘時間: 30 秒(SORTIE_DURATION_MS = 30_000)
  • victory 条件: 敵機全滅(allEnemiesDefeated)
  • timer 到達: 30 秒で戦闘終了(defeat 扱い)
  • 優先順位: defeat(player.hp <= 0) > victory(全敵撃破) > timeout(30秒)

Remaining Parent Gaps

Product Spec Context

diff_rationale: "anchor comment #4586254809 による人間判断: MVP の勝利条件を 120秒生存から敵機全滅・30秒終了に変更する。120秒生存は遊びの楽しさに直接響かないパラメータのため MVP では不要。"
changed_requirement_id: REQ-SORTIE-VICTORY-M2
affected_sections:
  - docs/product/features/sortie.md#victory-conditions
  - docs/product/features/sortie.md#sortie-duration
  - docs/product/features/sortie.md#normative-transition-table

Summary

anchor comment #4586254809 の人間判断を受けて、MVP sortie の終了条件を「120秒生存勝利」から「敵機全滅勝利・30秒終了」に変更する。docs/product/features/sortie.md、SortieSystem.ts、unit test、E2E test、playtest 証跡を整合させる。

Outcome

  • SORTIE_DURATION_MS が 30_000 に変更される
  • victory 条件が「全敵撃破」(allEnemiesDefeated)に変更される
  • timer 到達(elapsedTicks >= targetTicks)は勝利ではなく defeat 扱いになる
  • 優先順位 defeat > victory > timeout が実装とコメントで明文化される
  • state.enemies.length > 0 ガードにより vacuous truth を防ぐ
  • docs/product/features/sortie.md が新しい終了条件を正本として定義する
  • docs/playtest/m2-combat-mvp.md が新しい終了条件と整合する
  • unit test が全終了条件と優先順位を検証する

Background

anchor comment #4586254809(人間判断): MVPの戦闘時間は120秒でなく30秒でよい。120秒生存は遊びの楽しさに直接響くパラメータではなく、MVPで固定化してこだわる価値が低い。勝利条件は敵機全滅、30秒で戦闘終了とする。

現行の SortieSystem.ts は SORTIE_DURATION_MS = 120_000 で elapsedTicks >= targetTicks → victory となっており、docs/product/features/sortie.md も同様。この Issue でそれらを人間判断に沿って変更する。

In Scope

  • SORTIE_DURATION_MS を 30_000 に変更
  • victory 条件を allEnemiesDefeated(state.enemies.length > 0 && state.enemies.every(e => e.defeated))に変更
  • timer guard elapsedTicks >= targetTicks を defeat 扱いに変更
  • 優先順位の明文化: defeat(player.hp <= 0) > victory(全敵撃破) > timeout(30秒)
  • docs/product/features/sortie.md の正本更新
  • docs/playtest/m2-combat-mvp.md の整合修正
  • tests/sortie-system.test.ts の更新(全終了条件カバー)
  • tests/e2e/m2-combat-mvp.spec.ts の更新(30秒対応)

Out of Scope

Acceptance Criteria

  • AC1: docs/product/features/sortie.md が「敵機全滅で victory」「30秒で戦闘終了」を MVP 正本としている
  • AC2: docs/product/features/sortie.md が「120秒生存勝利」を正としていない
  • AC3: SortieSystem.ts の SORTIE_DURATION_MS が 30_000 である
  • AC4: SortieSystem.ts の victory 判定が allEnemiesDefeated ロジックを実装している(state.enemies.length > 0 ガード含む)
  • AC5: SortieSystem.ts の timer 到達(30秒)が victory にならず defeat または終了扱いになる
  • AC6: 優先順位 defeat > victory > timeout が実装と inline comment で明文化されている
  • AC7: unit test に all enemies defeated → victory が含まれる
  • AC8: unit test に player hp <= 0 → defeat が含まれる
  • AC9: unit test に 30秒到達 → defeat/timeout が含まれる
  • AC10: unit test に優先順位(同一 tick で複数条件成立時)の検証が含まれる
  • AC11: unit test に result が一度だけ生成される が含まれる
  • AC12: unit test に durationMs は elapsedTicks * fixedDeltaMs 由来 の検証が含まれる
  • AC13: docs/playtest/m2-combat-mvp.md の Manual Checklist が新しい終了条件を反映している
  • AC14: pnpm typecheck && pnpm lint && pnpm test && pnpm build が通る

Verification Commands

# AC3
$ rg "30_000" src/systems/SortieSystem.ts

# AC4
$ rg "allEnemiesDefeated" src/systems/SortieSystem.ts

# AC4
$ rg "enemies\.length" src/systems/SortieSystem.ts

# AC1
$ rg "30_000" docs/product/features/sortie.md

# AC14
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build

Allowed Paths

  • docs/product/features/sortie.md
  • docs/playtest/m2-combat-mvp.md
  • src/systems/SortieSystem.ts
  • tests/sortie-system.test.ts
  • tests/e2e/m2-combat-mvp.spec.ts
  • src/state/GameState.ts(必要な場合のみ)

Stop Conditions

  • SC1: SortieResult 型変更(outcome の値追加/変更)が Allowed Paths 外のコンポーネントに想定外の影響を与える場合は停止する。
  • SC2: E2E fixture の変更スコープが Allowed Paths を超える場合は停止する。
  • SC3: feat(#483): CanvasRenderer と HudController に M2 combat entities と sortie 結果表示を追加する #541 の変更と競合が発生する場合は停止する。
  • SC4: VC が 3 回以上失敗する場合は停止する。
  • SC5: docs/product/features/sortie.md の変更が他の feature spec の仕様と矛盾する場合は停止する。
  • SC6: 30秒タイムアウト時の outcome(defeat vs timeout 区別)について追加の人間判断が必要になった場合は停止する。

Required Skills

  • TypeScript
  • vitest unit test
  • Playwright E2E test
  • Markdown documentation

Runtime Verification Applicability

decision: immediate
applicable_acs:
  - AC1
  - AC2
  - AC3
  - AC4
  - AC5
  - AC6
  - AC7
  - AC8
  - AC9
  - AC10
  - AC11
  - AC12
  - AC13
  - AC14
execution_environment:
  required: true
  type: local
  commands:
    - pnpm typecheck
    - pnpm lint
    - pnpm test
    - pnpm build
skip_conditions:
  - name: unavailable_local_runtime
    handling: must_record_reason_and_fallback_artifact
fallback_policy:
  required: true
  allowed_artifacts:
    - test_output_log
    - typecheck_output_log
    - manual_playtest_note
artifact_requirements:
  - command
  - exit_code
  - relevant_output_excerpt
  - timestamp

Notes

この Issue は anchor comment #542 (comment) の人間判断により、当初の「120秒生存統一 docs 修正」から「30秒MVP・敵機全滅勝利への仕様変更」に再定義された。

Activity

  1. added
    documentation
    on May 31, 2026
  2. squne121 commented on May 31, 2026

    @squne121
    OwnerAuthor

    人間コメント
    MVPの戦闘時間は30秒でいい。120秒は遊びの楽しさには響かないパラメータのため、MVPでこだわらなくてよい。
    敵機の全滅で勝利、30秒で戦闘終了にして。

  3. squne121 commented on May 31, 2026

    @squne121
    OwnerAuthor

    結論

    Issue #542 は方向性は正しいが、このままだと「文言修正だけで Product Acceptance に見える」危険があります。
    特に docs/playtest/m2-combat-mvp.md の current state は、victory 条件だけでなく、証跡ステータス、manual checklist、deferred issue の実体、Markdown/YAML 形式、120秒本番条件と fixture 検証の区別が崩れています。敵対的に見るなら、#542 は docs 修正 Issue としては妥当、ただし M2 acceptance を前進させる証跡 Issue としては不十分です。

    参照した一次情報

    #542 は docs/playtest/m2-combat-mvp.md の victory 条件を「全敵撃破」から「120秒 simulation-time 生存」に直し、accepted_with_unknowns の unknown を resolved/deferred に分ける目的です。

    親 #483 は、M2 の正規ゴールを「1画面固定で WASD 移動・マウス射撃・敵 AI 接近・当たり判定・120秒生存勝利・自機 HP ゼロ敗北」と定義し、さらに現在の Blocker 2 として docs/playtest/m2-combat-mvp.md の accepted_with_unknowns、未実施 Manual Checklist、victory 条件不一致を明示しています。

    現行 docs/playtest/m2-combat-mvp.md には、まだ status: accepted_with_unknowns、未確認 unknown、未チェック Manual Checklist、そして After all enemies in the wave are defeated という stale victory 条件が残っています。

    正本 docs/product/features/sortie.md は、M2 の victory 条件を elapsedTicks >= targetTicks のみとし、targetTicks = ceil(120_000 / fixedDeltaMs)、duration は elapsedTicks * fixedDeltaMs から導出、wall-clock / rAF は SortieResult や勝敗判定に使ってはいけない、と明記しています。

    実装側 SortieSystem.ts も SORTIE_DURATION_MS = 120_000、targetTicks = Math.ceil(SORTIE_DURATION_MS / fixedDeltaMs)、durationMs = elapsedTicks * fixedDeltaMs で、defeat 優先の terminal 判定になっています。

    敵対的レビュー

    1. spec/impl(#483): MVP sortie を敵機全滅勝利・30秒終了に変更する #542 は “Product Acceptance” を完了させる Issue ではない

    #542 の Summary は docs 修正です。しかし #483 の Product Acceptance Pending は、Blocker 1「描画/HUD 未実装」と Blocker 2「playtest 証跡不整合」の両方が残っているためです。#541 が CanvasRenderer / HudController に enemies、projectiles、victory/defeat overlay、sortie status、kills、duration、result を追加するための別 Issue として切られています。

    したがって #542 の文言は、**「M2 Combat MVP Gate の Product Acceptance を達成する」ではなく、「Blocker 2 の docs inconsistency を解消する」**に下げるべきです。今のままだと、docs の stale 記述を直しただけで M2 accepted と誤読されます。

    修正案:

    goal_ref: "#483 Blocker 2: playtest evidence doc inconsistency を解消する"
    change_kind: docs
    parent_issue: 483
    depends_on:

    1. accepted_with_unknowns を単に消すと、証跡の品質が悪化する

    現行 doc は automated E2E 10本 pass と fixture による victory/defeat 検証を記録していますが、UX feel と low-end performance は unknown のままです。
    これを「resolved または deferred issue」に変えるだけだと、未確認のまま accepted に見える危険があります。

    より安全なステータス分離はこれです。

    status: automated_evidence_passed_manual_pending
    acceptance_state:
    mechanical_e2e: accepted
    visual_manual_playtest: pending
    product_acceptance: pending

    accepted_with_unknowns を消すなら、代替ステータスは accepted ではなく manual_pending 系にするべきです。

    1. Manual Checklist を「確認済み or deferred」にする AC は危険

    #542 の AC は「Manual Checklist の各項目が『確認済み』または『deferred: #XXX』」になっています。
    これは一見よいですが、敵対的には 全項目を deferred にすれば checklist が埋まってしまうという抜け道があります。

    M2 の Product Acceptance に必須な項目、特に以下は deferred 不可にすべきです。

    M2 product-acceptance required:

    • Enemy is visible
    • Projectile is visible
    • HUD shows HP / sortie status
    • Victory or defeat overlay is visible
    • Manual tester can confirm one playable sortie path

    一方、以下は deferred 可能です。

    Deferred allowed:

    • UX feel / hit feedback polish
    • audio feedback
    • low-end hardware performance
    • balance tuning

    #483 は「人間による manual playtest 証跡が追加された後に人間判断で close」としているため、manual acceptance の中核まで deferred にするのは親 Issue の close 条件と矛盾します。

    1. victory 条件の修正は文言置換では足りない

    現行 doc の Victory Condition は「After all enemies in the wave are defeated」となっており、これは正本と実装の両方に反します。

    ただし、単に After 120 seconds に置換するとまだ弱いです。必要なのは simulation-time authority の明文化です。

    推奨文言:

    Victory Condition

    • victory: Player survives until sortie.elapsedTicks >= sortie.targetTicks.
      For production M2, targetTicks = ceil(120_000 / fixedDeltaMs).
      This is simulation time, not wall-clock time.
    • Victory screen/HUD: UI updates to reflect sortie.status === "victory" and displays sortie.result.

    E2E fixture についても、120秒そのものを検証したのではなく、targetTicks≈30 の短縮 fixture で FSM を検証した、と明示すべきです。現行 doc には短縮 fixture の記録がありますが、最後の Note では「full cycle requires manual playtesting」と古い記述も残っており、内部矛盾があります。

    1. raw Markdown の形式が怪しい

    docs/playtest/m2-combat-mvp.md の raw 表示では、frontmatter、heading、本文が極端に長い少数行に圧縮されており、--- doc_id: ... --- # M2 Combat MVP Playtest のように見えます。
    これが実ファイル通りなら、YAML frontmatter と Markdown としてかなり脆いです。GitHub rendering はできても、将来の parser、grep、doc lint、frontmatter reader で壊れやすい。

    #542 の Scope に format normalization を入れるべきです。


    doc_id: playtest-m2-combat-mvp
    issue: "#490"
    parent_issue: "#483"
    tested_commit: "..."
    evidence_mode: playwright+manual
    status: automated_evidence_passed_manual_pending
    date: "2026-05-31"

    M2 Combat MVP Playtest

    1. Allowed Paths は docs だけでよいが、Verification Commands は過剰

    #542 は docs/playtest/m2-combat-mvp.md のみを Allowed Path にしています。
    これはよい制約です。ただし docs-only 変更に対して pnpm typecheck && pnpm lint && pnpm test && pnpm build を必須にするのはコストが重い。品質ゲートとしては可ですが、docs の正しさを検証するコマンドが足りません。

    追加すべき検証:

    rg "After all enemies|all enemies in the wave|全敵撃破" docs/playtest/m2-combat-mvp.md && exit 1 || true
    rg "elapsedTicks|targetTicks|120_000|simulation time" docs/playtest/m2-combat-mvp.md
    rg "accepted_with_unknowns" docs/playtest/m2-combat-mvp.md && exit 1 || true
    rg "deferred: #[0-9]+" docs/playtest/m2-combat-mvp.md

    1. feat(#483): CanvasRenderer と HudController に M2 combat entities と sortie 結果表示を追加する #541 との依存関係を明示しないと、manual checklist が嘘になる

    #541 の背景では、CanvasRenderer は背景・プレイヤー・照準線・経過秒しか描いておらず、敵、弾、勝敗 overlay がないため、内部状態で戦闘が進んでもプレイヤーには見えない、とされています。

    その状態で #542 が Manual Checklist を「人間確認済み」に変える余地を残すのは危険です。#542 では、#541 が閉じるまでは visual/manual 項目を blocked_by: #541 にすべきです。

    例:

    manual_checklist:
    enemy_visible:
    status: blocked
    blocked_by: "#541"
    projectile_visible:
    status: blocked
    blocked_by: "#541"
    victory_overlay:
    status: blocked
    blocked_by: "#541"

    WEB調査に基づく高品質化ポイント

    Playwright は auto-retrying assertions を備えており、条件が満たされるまで待つことで flakiness を下げられます。E2E を改善するなら、固定 sleep より expect.poll や web-first assertion を使うべきです。

    CI failure のデバッグ証跡としては、Playwright Trace Viewer が DOM snapshot、timeline、network request などを確認できるため、manual playtest 証跡の補助として trace: on-first-retry または failure 時 trace を保存する設計が妥当です。

    Vite の import.meta.env は build 時に静的置換され、tree-shaking を有効化する設計です。PR #535 の VITE_E2E_MODE gating は方向性として妥当ですが、production build に LOOP_E2E が残らない grep は #542 ではなく E2E hook 側の証跡として維持すべきです。

    requestAnimationFrame() は多くのブラウザで background tab や hidden iframe では停止されます。したがって Sortie victory を wall-clock / rAF 時間で決めず、elapsedTicks で決める設計は正しいです。

    Canvas 2D の fillRect() や fillText() は最小 HUD / overlay 実装に十分です。#541 の最小実装方針「高品質アセット不要」は妥当ですが、#542 側では描画可否の checklist を #541 に依存させるべきです。

    修正後の #542 Acceptance Criteria 案

    Acceptance Criteria

    • docs/playtest/m2-combat-mvp.md の victory 条件が
      elapsedTicks >= targetTicks / targetTicks = ceil(120_000 / fixedDeltaMs) に統一されている
    • After all enemies in the wave are defeated / all enemies destroyed / 全敵撃破で victory
      と読める記述が M2 victory 条件から削除されている
    • victory の時間 authority が wall-clock / rAF / Date.now / performance.now ではなく
      fixed timestep の executed ticks であることが明記されている
    • E2E fixture の victory は「120秒本番検証」ではなく
      targetTicks 短縮による FSM transition 検証であると明記されている
    • status: accepted_with_unknowns を廃止し、
      automated_evidence_passed_manual_pending 等の Product Acceptance と混同しない状態に変更されている
    • Manual Checklist の未確認項目は checked_by, checked_at, evidence, status
      を持つ構造に整理されている
    • M2 Product Acceptance 必須の visual/manual 項目は feat(#483): CanvasRenderer と HudController に M2 combat entities と sortie 結果表示を追加する #541 が完了するまで
      blocked_by: #541 と明記され、安易に deferred されていない
    • deferred 項目には具体的な Issue 番号があり、#XXX が残っていない
    • Markdown / YAML frontmatter が通常の複数行形式に正規化されている
    • pnpm typecheck && pnpm lint && pnpm test && pnpm build が通る

    判定

    REQUEST_CHANGES 相当。

    理由は、#542 の狙い自体は妥当だが、現在の Issue 定義では docs 修正、manual acceptance、Product Acceptance、deferred 管理が混線しています。最小修正は「#542 は #483 Blocker 2 の docs consistency 解消に限定する」「manual playtest は #541 完了後に別 Issue または #541 後続で扱う」「M2 必須 visual 項目を deferred 可能にしない」の3点です。

  4. squne121 commented on May 31, 2026

    @squne121
    OwnerAuthor

    #542 (comment)

    結論

    #542 はこのまま進めるべきではありません。
    現在の #542 は **「120秒生存勝利へ統一」**する Issue ですが、人間判断は逆で、MVPでは120秒にこだわらず、30秒で戦闘を終える。勝利条件は敵機全滅です。

    つまり、#542 は「docs 修正 Issue」ではなく、MVP戦闘終了条件の仕様変更 Issueとして書き換えるべきです。

    #542 の本文は、Summary / Outcome / AC で 120秒 simulation-time 生存 を正にしており、Allowed Paths も docs/playtest/m2-combat-mvp.md だけに閉じています。これは今回の人間コメントと矛盾します。
    現行の SortieSystem も SORTIE_DURATION_MS = 120_000 を持ち、elapsedTicks >= targetTicks で victory にしています。
    docs/product/features/sortie.md も「elapsedTicks >= targetTicks が M2 唯一の victory 条件」「all-enemy-destroyed victory は M2 スコープ外」と明記しているため、正本側も修正対象です。

    敵対的レビュー

    Blocker 1: #542 の目的が人間判断と逆

    現在の #542 は「全敵撃破」を削除し、「120秒生存」を正にする Issue です。
    しかし人間判断は「120秒はMVPでこだわらない」「敵機全滅で勝利」「30秒で戦闘終了」です。

    したがって、#542 のまま実装すると MVP判断を上書きして、不要な120秒耐久ゲームを固定化する危険があります。

    Blocker 2: Allowed Paths が狭すぎる

    docs/playtest/m2-combat-mvp.md だけを変えても不整合は解消しません。
    少なくとも以下が変更対象です。

    docs/product/features/sortie.md

    docs/playtest/m2-combat-mvp.md

    src/systems/SortieSystem.ts

    tests/sortie-system.test.ts

    tests/e2e/m2-combat-mvp.spec.ts

    必要なら src/state/GameState.ts の SortieResult 型

    現行テストも SORTIE_DURATION_MS と「120秒 victory」を前提にしています。
    E2E も「120秒の full cycle は時間制約上やらない」という注記を持っており、30秒化すれば実機相当のE2E検証が現実的になります。

    Blocker 3: 「30秒で戦闘終了」の結果が未定義

    ここは曖昧にしてはいけません。

    仕様として最低限、次を決める必要があります。

    敵機全滅前に30秒へ到達した場合、結果は何か

    defeat

    timeout

    ended without victory

    既存 SortieResult.outcome は "victory" | "defeat" だけで足りるか

    timeout を区別するなら endReason: "all_enemies_defeated" | "timeout" | "player_destroyed" を追加するか

    MVPとして雑に進めるなら、私はこう切るのがよいです。

    outcome:

    • victory: all enemies defeated
    • defeat: player hp <= 0
    • defeat: elapsedTicks >= 30s and enemies remain

    ただし将来のUIやリザルト分析を考えるなら、outcome と endReason は分けた方が安全です。

    outcome: "victory" | "defeat"
    endReason: "all_enemies_defeated" | "player_destroyed" | "timeout"

    #542 に貼るコメント案

    人間判断として、#542 の前提を変更したいです。

    MVPの戦闘時間は 120 秒でなく 30 秒でよいです。
    120 秒生存は遊びの楽しさに直接響くパラメータではなく、MVPで固定化してこだわる価値が低いです。

    したがって、この Issue は「120秒 simulation-time 生存に統一する」ではなく、以下に差し替えてください。

    新しいMVP終了条件

    • victory: 敵機を全滅させたら勝利
    • defeat: player HP が 0 になったら敗北
    • time limit: 30秒で戦闘を終了する
    • 30秒到達時に敵が残っている場合は、少なくとも victory ではない扱いにする
      • 既存 SortieResult.outcome を維持するなら defeat
      • 可能なら endReason: "timeout" を追加して、HP0敗北と時間切れを区別する

    修正対象

    現在の Allowed Paths は docs/playtest/m2-combat-mvp.md のみですが、この変更は docs だけでは不十分です。
    少なくとも以下を変更対象にしてください。

    • docs/product/features/sortie.md
    • docs/playtest/m2-combat-mvp.md
    • src/systems/SortieSystem.ts
    • tests/sortie-system.test.ts
    • tests/e2e/m2-combat-mvp.spec.ts
    • 必要なら src/state/GameState.ts

    期待する仕様

    • SORTIE_DURATION_MS は 30_000 に変更する
    • victory guard は all enemies defeated に変更する
    • timer guard は elapsedTicks >= targetTicks で「戦闘終了」とする
    • defeat / timeout / victory の優先順位を明記する
      • 推奨:
        1. player.hp <= 0 -> defeat
        2. all spawned/required enemies defeated -> victory
        3. elapsedTicks >= targetTicks -> timeout または defeat
    • durationMs は引き続き wall clock ではなく elapsedTicks * fixedDeltaMs から導出する
    • 30秒なら通常のE2Eでも終了条件を検証可能なので、短縮 fixture 前提を減らす

    受け入れ条件

    • docs/product/features/sortie.md が「120秒生存勝利」を正としていない
    • docs/product/features/sortie.md が「敵機全滅勝利」「30秒終了」をMVP正本としている
    • docs/playtest/m2-combat-mvp.md の Manual Checklist が以下に更新されている
      • 敵機全滅で victory になる
      • 30秒で戦闘が終了する
      • HP0で defeat になる
      • 30秒到達時に敵が残っている場合の結果が仕様通りになる
    • SortieSystem の実装が 30秒 cap と敵機全滅勝利に一致している
    • unit test が以下を含む
      • all enemies defeated -> victory
      • player hp <= 0 -> defeat
      • 30秒到達 -> timeout/defeat
      • 同一tickで複数条件が成立した場合の優先順位
      • result が一度だけ生成される
      • durationMs は fixed tick 由来
    • pnpm typecheck && pnpm lint && pnpm test && pnpm build が通る

    推奨する Issue タイトル

    spec/impl(#483): MVP sortie を敵機全滅勝利・30秒終了に変更する

    実装方針

    現行の elapsedTicks >= targetTicks -> victory は削除対象です。
    新しい判定は概ねこうです。

    const allEnemiesDefeated =
    state.enemies.length > 0 &&
    state.enemies.every((enemy) => enemy.defeated)

    const isDefeat = state.player.hp <= 0
    const isVictory = allEnemiesDefeated
    const isTimeout = elapsedTicks >= targetTicks

    優先順位はこの順が妥当です。

    if (isDefeat) outcome = "defeat"
    else if (isVictory) outcome = "victory"
    else if (isTimeout) outcome = "defeat" // or timeout
    else return

    注意点は state.enemies.length > 0 です。
    これを入れないと、開始直後に敵がまだ spawn していない tick で every() が vacuous truth になり、即 victory になる危険があります。

    判断

    #542 は そのまま実装不可。
    人間コメントを受けて、120秒生存勝利を正にする Issue から、30秒MVP・敵機全滅勝利へ仕様変更する Issue に再定義してください。

  5. changed the title [-]docs(#483): playtest 証跡の仕様不一致を修正し victory 条件を 120秒生存に統一する[/-] [+]spec/impl(#483): MVP sortie を敵機全滅勝利・30秒終了に変更する[/+] on May 31, 2026
  6. squne121 commented on Jun 1, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-06-01T12:05:00Z)

    • Outcome: SORTIE_DURATION_MS を 30_000 に変更し、victory 条件を allEnemiesDefeated に変更し、docs/product/features/sortie.md・SortieSystem.ts・tests を整合させる
    • Acceptance Criteria: AC1–AC14(docs/product/features/sortie.md 更新 / SortieSystem.ts 実装 / unit test / E2E test / pnpm typecheck+lint+test+build)
    • Verification Commands: rg "30_000" src/systems/SortieSystem.ts / rg "allEnemiesDefeated" src/systems/SortieSystem.ts / rg "enemies.length" src/systems/SortieSystem.ts / rg "30_000" docs/product/features/sortie.md / pnpm typecheck+lint+test+build
    • Allowed Paths: docs/product/features/sortie.md / docs/playtest/m2-combat-mvp.md / src/systems/SortieSystem.ts / tests/sortie-system.test.ts / tests/e2e/m2-combat-mvp.spec.ts / src/state/GameState.ts(任意)
    • Worktree: .claude/worktrees/issue-542-spec-impl-483-mvp-sortie
    • Branch: worktree-issue-542-spec-impl-483-mvp-sortie
    • VC preflight: baseline fail = 4, 想定外 pass = 0, 実行不可 = 0, regression_gate pass = 4

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-01T12:05:00Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/542
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 4
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 4
          vc_skipped: 0
          classifications:
            - ac: AC3
              command: "rg \"30_000\" src/systems/SortieSystem.ts"
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC4
              command: "rg \"allEnemiesDefeated\" src/systems/SortieSystem.ts"
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC4
              command: "rg \"enemies\\.length\" src/systems/SortieSystem.ts"
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC1
              command: "rg \"30_000\" docs/product/features/sortie.md"
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC14
              command: "pnpm typecheck"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
            - ac: AC14
              command: "pnpm lint"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
            - ac: AC14
              command: "pnpm test"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
            - ac: AC14
              command: "pnpm build"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
        ac_verifiability: pass
        product_spec_check:
          applicability: applicable
          decision: pass
          triggers:
            docs_product_allowed_paths: true
            tasks_md_mentioned: false
            specify_artifact_mentioned: false
            generated_task_mentioned: false
            product_spec_context_present: true
          conditions:
            docs_product_requires_spec_evidence:
              status: pass
            diff_first_rationale_present:
              status: pass
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings: []
  7. squne121 commented on Jun 1, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-06-01T12:23:59Z)

  8. added 2 commits that reference this issue on Jun 1, 2026
  9. squne121 commented on Jun 1, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: APPROVE 確定 (2026-06-01T12:52:47Z)

  10. added a commit that references this issue on Jun 1, 2026
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

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions