Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: parent
goal_ref: "M4 Upgrade Loop の delivery-rollup を current child state と compositional runtime evidence に同期し、false-green なしで close 判定できる親 tracker として維持する"
change_kind: workflow
parent_mode: delivery-rollup
closure_mode: child-completeSummary
M4: Upgrade Loop (v0.4.x) の delivery-rollup parent tracker。child implementation と runtime evidence を同一 current main SHA / current CI に束縛し、spec-only・catalog-only・単一最終値だけで close しない。
Goal
M3 の sortie reward resource acquisition と、#1283 の purchase → save → reload → Load Game → next-sortie projectile reflection を compositional evidence として追跡し、M4 close evidence の十分性を決定する。
Desired Destination
- milestone 2 と completed child state が current repository reality に同期している。
- resource acquisition と purchase / persistence / next-sortie reflection の evidence が、同一 current main SHA と current CI evidence に束縛される。
- 同一の end-to-end causal scenario が必要になった場合は専用 child Issue へ分離し、実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 を再拡張しない。
Current Validated Scope
- 実装: GitHub milestone 2 を Upgrade Loop へ rename し playable-roadmap の mapping_status を aligned に更新する #1169、実装: docs/product/features/upgrade.md を新規作成し Upgrade Loop の正本 spec を定義する #1170、実装: PhaseTransitionSystem を導入して LoopPhase 遷移を一元管理する #1174、実装: src/data/weapons.ts と src/data/units.ts を実体化して armament catalog を bootstrap する #1175 は closed。
- 実装: src/data/upgrades.ts に M4 最小 UpgradeDefinition catalog を追加する #1280(UpgradeDefinition)、実装: UpgradeSystem で quote / atomic purchase / snapshot save を実装する #1281(atomic purchase / save)、実装: HUD に upgrade purchase surface と player-facing state を追加する #1282(HUD surface)は closed。
- 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 は closed(2026-08-03T21:29:35Z、PR fix(e2e): repair M4 storage write-set audit false-green (#1283) #1981 マージにより)。production sentinel false-green、Node-side storage write-set audit、nested preview artifact behavioral evidence の evidence を PR fix(e2e): repair M4 storage write-set audit false-green (#1283) #1981 が保有する。
- 実装: deploy-pages/CI で production dist への E2E hook 漏洩を fail-closed 検査する #1425 は production artifact boundary checker、marker inventory、production gating、all-build-lane checker wiring を所有し、本 parent の close condition ではない。
Outcome
parent child matrix と close evidence matrix が、M3 reward evidence と #1283 M4 evidence を compositional evidence として扱う条件、current-head binding、残る gap を明示する状態。
Decisions Fixed
- M3 reward による resource acquisition と 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 の M4 purchase / persistence / next-sortie reflection は、同一因果 scenario を必須としない compositional evidence として採用する。
- 採用は各 child evidence が同一 current main SHA と、その SHA を対象にした current CI evidence に束縛される場合に限る。
- この binding が欠ける場合、または child evidence に concrete gap がある場合は parent close を許可しない。
- 70 → 30 → 100 → purchase の単一統合 scenario が product contract 上必要と判明した場合は、専用 child Issue を起票する。実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 の scope / Allowed Paths / AC へ暗黙に追加しない。
Quality Decision Record
- Status: open
- Decision Date: 2026-08-04
- Does this prove the parent goal complete?: yes(Close Evidence Matrix の M3 reward evidence 行と 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 M4 evidence 行の両方が、同一 current main SHA f66900c への binding と passing CI evidence を得た)
- Reason: 8 child issue は全て closed になり、実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 の current-head 評価は PR fix(e2e): repair M4 storage write-set audit false-green (#1283) #1981(merge commit f66900c、branch-protection required checks 全 SUCCESS)に束縛された。従来 gap として残っていた M3 reward evidence(実装: GitHub milestone 2 を Upgrade Loop へ rename し playable-roadmap の mapping_status を aligned に更新する #1169/実装: docs/product/features/upgrade.md を新規作成し Upgrade Loop の正本 spec を定義する #1170/実装: PhaseTransitionSystem を導入して LoopPhase 遷移を一元管理する #1174/実装: src/data/weapons.ts と src/data/units.ts を実体化して armament catalog を bootstrap する #1175)側の同一 current main SHA への binding も、現在の main tip 上で実行された GitHub Actions CI run(https://github.com/squne121/loop-protocol/actions/runs/30854853826、push event、同一 SHA f66900c)が tests/reward-system.test.ts と tests/sortie-system.test.ts を含む 1835 tests 全 pass を記録したことで解消した。両方の Close Evidence Matrix 行が同一 current main SHA / current CI に束縛された。
- Evidence: 実装: src/data/upgrades.ts に M4 最小 UpgradeDefinition catalog を追加する #1280/実装: UpgradeSystem で quote / atomic purchase / snapshot save を実装する #1281/実装: HUD に upgrade purchase surface と player-facing state を追加する #1282/実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 は closed(実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 closedAt 2026-08-03T21:29:35Z)。実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 は PR fix(e2e): repair M4 storage write-set audit false-green (#1283) #1981 でマージされ、head f66900c は現在の origin/main と一致する(2026-08-04 再確認、working tree clean)。required status checks(typecheck / lint / test / build / python-test / validate-generated-artifact)は全て SUCCESS。非 required の
e2eとci-verdict-summaryは FAILURE(branch protection の required contexts には含まれない)。M3 側(実装: GitHub milestone 2 を Upgrade Loop へ rename し playable-roadmap の mapping_status を aligned に更新する #1169 → PR docs: sync M4 roadmap readback with milestone 2 title #1190, 実装: docs/product/features/upgrade.md を新規作成し Upgrade Loop の正本 spec を定義する #1170 → PR docs: add upgrade loop spec (#1170) #1237, 実装: PhaseTransitionSystem を導入して LoopPhase 遷移を一元管理する #1174 → PR feat: centralize loop phase transitions (#1174) #1257, 実装: src/data/weapons.ts と src/data/units.ts を実体化して armament catalog を bootstrap する #1175 → PR feat(data): bootstrap armament catalogs #1263)の closing PR merge commit(8eea18183b95ff9167c5c1726635d1b4db01da15 / c882762 / d2be61c / 9815192)は各自のマージ時点 commit にしか自身の CI evidence を持たないが、いずれもgit merge-base --is-ancestorで現在の origin/main の祖先であることを確認済み(2026-08-04、コード unchanged)。加えて現在の main tip(f66900c72067c38f26b51e17784544cca4c6daf4)で実行された CI run 30854853826(push event、2026-08-03T21:29:37Z、実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 マージ直後に自動実行)の test job が tests/reward-system.test.ts(22 tests)と tests/sortie-system.test.ts(28 tests)を含む全 107 files / 1835 tests を pass させ、typecheck / lint / build も SUCCESS。これにより M3 reward evidence 側の同一 current-main-SHA binding が新たに確立された。 - Next Action: Close Evidence Matrix の両行が同一 current main SHA への binding と passing CI を得たため、残る gap はない。この事実確認に基づき、人間/orchestrator が本 Issue を close する判断を行った。
Parent Closure Rule
- delivery-rollup: listed child issues が close し、Close Evidence Matrix の全条件が同一 current main SHA / current CI に束縛された時だけ close する。
- quality-gate: N/A。
- current CI に unrelated SHA の run しかない場合は、green でも close evidence に採用しない。
Child Issues
- 実装: GitHub milestone 2 を Upgrade Loop へ rename し playable-roadmap の mapping_status を aligned に更新する #1169 — M4 milestone sync
- 実装: docs/product/features/upgrade.md を新規作成し Upgrade Loop の正本 spec を定義する #1170 — upgrade product spec
- 実装: PhaseTransitionSystem を導入して LoopPhase 遷移を一元管理する #1174 — phase transition centralization
- 実装: src/data/weapons.ts と src/data/units.ts を実体化して armament catalog を bootstrap する #1175 — armament catalog seed
- 実装: src/data/upgrades.ts に M4 最小 UpgradeDefinition catalog を追加する #1280 — UpgradeDefinition catalog
- 実装: UpgradeSystem で quote / atomic purchase / snapshot save を実装する #1281 — atomic purchase / snapshot save
- 実装: HUD に upgrade purchase surface と player-facing state を追加する #1282 — HUD upgrade surface
- 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 — M4 runtime storage write-set / nested preview behavioral evidence
Close Evidence Matrix
| Evidence | Owner | Required binding | Parent use |
|---|---|---|---|
| sortie reward による resource acquisition | M3 completed child evidence(#1169/#1170/#1174/#1175) | current main SHA f66900c(origin/main tip、2026-08-04 再確認)に束縛。GitHub Actions CI run https://github.com/squne121/loop-protocol/actions/runs/30854853826(workflow "ci"、push event、この merge commit 到達直後の 2026-08-03T21:29:37Z に自動実行)で test / typecheck / lint / build が全て SUCCESS。test job は 1835 tests / 107 files 全 pass で、うち tests/reward-system.test.ts(22 tests)と tests/sortie-system.test.ts(28 tests)が sortie reward resource acquisition の対象テストとして含まれ pass している(非 required の e2e / ci-verdict-summary は FAILURE だが、#1283 行と同様 branch protection required contexts には含まれない)。M3 の各 closing PR(#1169→PR #1190 head 8eea181、#1170→PR #1237 head c882762、#1174→PR #1257 head d2be61c、#1175→PR #1263 head 9815192)は各自のマージ時点 commit にしか CI evidence を持たないが、git merge-base --is-ancestor で全 4 commit が現在の origin/main の祖先であること(2026-08-04 確認、コードは unchanged で現在の main に含まれる)と、上記の現在 main tip 上での CI run が M3 対象テストを実際に実行し pass していることの組み合わせにより、AC3 が要求する同一 current main SHA / current CI binding が今回新たに確立された |
purchase 前提の資源獲得を証明 |
| purchase → save → reload → Load Game → next-sortie projectile reflection | #1283(PR #1981) | 同一 current main SHA(f66900c72067c38f26b51e17784544cca4c6daf4、origin/main と一致、2026-08-03T21:29:34Z merge)と current CI(required contexts: typecheck / lint / test / build / python-test / validate-generated-artifact は全 SUCCESS。非 required の e2e / ci-verdict-summary は FAILURE) | M4 persistence / combat reflection を証明 |
| production artifact boundary | #1425 | #1425 自身の current-head evidence | #1283 / parent close の blocker にはしない |
Remaining Parent Gaps
- 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 の open contract は解消した(2026-08-03 close、PR fix(e2e): repair M4 storage write-set audit false-green (#1283) #1981 マージ)。current-head runtime evidence は到着済み。
- M3 reward evidence の SHA / CI binding は解消した(2026-08-04、現在の main tip f66900c で実行された CI run 30854853826 が tests/reward-system.test.ts / tests/sortie-system.test.ts を含む全テストを pass させ、M3 の各 closing PR merge commit も当該 SHA の祖先であることを確認した)。
- product contract が単一因果 scenario を必須とするかは未確認。必須なら別 child Issue を作り、実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 は拡張しない。
Phase Handoff Contract
- Desired Destination: compositional evidence を採用可能な M4 close evidence matrix。
- Current Objective: 全 8 child issue が closed になった状態で、Close Evidence Matrix の binding を fresh readback に基づき更新し、M3 evidence の current-main-SHA binding gap が解消したことを確認する。
- Bounded Current Context: 実装: src/data/upgrades.ts に M4 最小 UpgradeDefinition catalog を追加する #1280/実装: UpgradeSystem で quote / atomic purchase / snapshot save を実装する #1281/実装: HUD に upgrade purchase surface と player-facing state を追加する #1282/実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 は closed。実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 の current-head evidence は PR fix(e2e): repair M4 storage write-set audit false-green (#1283) #1981(merge commit f66900c)に束縛された。
- Normative References: docs/product/features/upgrade.md, docs/product/features/resource.md, docs/product/features/sortie.md, docs/product/features/persistence.md
- Next Action: M3 evidence の current-main-SHA binding は確認済み(解消)。残る gap はなく、人間/orchestrator が本 Issue を close する判断を行った。
Product Spec Context
source_of_truth: docs/product/features/upgrade.md
product_spec_id: DOC-UPGRADE-001
source_task_id: TASK-1176
requirement_id: REQ-1176
diff_rationale: "M3 reward と #1283 M4 evidence を compositional close evidence として明示し、current-head binding と別 child issue 境界を固定する"
changed_requirement_id: DOC-M4-COMPOSITIONAL-EVIDENCE
affected_sections:
- M4 delivery-rollup close evidence
- child state matrix
- runtime evidence binding
product_spec_change_mode: parent_tracker_sync_to_product_specAcceptance Criteria
- AC1: 実装: src/data/upgrades.ts に M4 最小 UpgradeDefinition catalog を追加する #1280、実装: UpgradeSystem で quote / atomic purchase / snapshot save を実装する #1281、実装: HUD に upgrade purchase surface と player-facing state を追加する #1282、実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 が全て closed である current API readback を parent child matrix に反映する。
- AC2: M3 reward resource acquisition と 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 M4 reflection の compositional evidence を Close Evidence Matrix に記録する。
- AC3: parent close evidence は M3 / 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 の evidence ごとに同一 current main SHA と current CI を要求する。
- AC4: same causal scenario が必要な場合は新規 child Issue とし、実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 を再拡張しない。
- AC5: 実装: deploy-pages/CI で production dist への E2E hook 漏洩を fail-closed 検査する #1425 の artifact-boundary ownership を 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 または parent close の blocker にしない。
- AC6: parent close は 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 current-head runtime evidence 到着前に実行しない。
Verification Commands
# AC1
# baseline-expect: pass
$ gh issue view 1280 --repo squne121/loop-protocol --json state
# baseline-expect: pass
$ gh issue view 1281 --repo squne121/loop-protocol --json state
# baseline-expect: pass
$ gh issue view 1282 --repo squne121/loop-protocol --json state
# baseline-expect: pass
$ gh issue view 1283 --repo squne121/loop-protocol --json state
# AC2
# preflight-scope: pr_review_only
$ gh issue view 1176 --repo squne121/loop-protocol --json body -q .body
# AC3
# preflight-scope: pr_review_only
$ gh issue view 1176 --repo squne121/loop-protocol --json body -q .body
# AC4
# preflight-scope: pr_review_only
$ gh issue view 1176 --repo squne121/loop-protocol --json body -q .body
# AC5
# preflight-scope: pr_review_only
$ gh issue view 1176 --repo squne121/loop-protocol --json body -q .body
# AC6
# preflight-scope: pr_review_only
$ gh issue view 1176 --repo squne121/loop-protocol --json body -q .bodyAllowed Paths
- GitHub Issue 導入: M4 Upgrade Loop 実装 parent tracker #1176 canonical body and comments only
Runtime Verification Applicability
- decision: deferred
- reason: runtime evidence は 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 と M3 child evidence の current-head result を parent が readback して判定する。
- deferred_destination: 実装: M4 Upgrade Loop の E2E / preview evidence を追加する #1283 and M3 completed child evidence
- deferred_verification_condition: same current main SHA と current CI への binding を close 前に確認する。
Notes
M3 reward と M4 evidence の compositional adoption は parent-level evidence sufficiency の決定である。#1283 は storage fixture / Node-side write-set audit / nested preview behavioral verification の narrow scope を維持しており、closed 済み。M3 側 evidence の current-main-SHA binding は 2026-08-04 に解消済み(現在の main tip 上の CI run 30854853826 が M3 対象テストを含む全テスト pass を記録)。
Activity
squne121 commentedon Jul 1, 2026
判定
#1176 は M4 の親トラッカーとして方向性は妥当です。ただし、現時点の本文は stale かつ false-green になりやすいです。特に、#1169 / #1170 / #1174 / #1175 と関連PRがすでに進んだ後の状態を反映しておらず、親Issueとしての閉鎖条件・子Issue分解・配布物検証が弱いです。
結論として、#1176 はこのままでは閉じるべきではありません。まず contract repair を入れ、未起票の実装Issueを具体化し、M4 close を「docs/specが存在する」ではなく 実行時に sortie → resource → upgrade → next sortie 反映が再現可能な状態へ寄せるべきです。#1176 本体はまだ open で、コメントもありません。本文上は #1169 / #1170 を未完了チェックのまま残し、resource消費・apply pipeline・次sortie反映・HUD露出を未起票として保持しています。
参照した関連文脈
#1169 は GitHub milestone 2 rename と roadmap 同期の子Issueで、PR #1190 により milestone 2 のタイトルを
M4: Upgrade Loop (v0.4.x)へ rename し、docs/product/playable-roadmap.mdの M4 mapping row / YAML block / readback date を同期しています。PR本文ではgh api repos/squne121/loop-protocol/milestones/2の readback とpnpm typecheck/lint/test/buildが実行済みです。#1170 は
docs/product/features/upgrade.mdを M4 正本specとして追加する子Issueで、PR #1237 により merge 済みです。PRはstate.progress.resourcesを通貨とする upgrade contract、validate → debit → apply → snapshot、保存失敗時の no false success、storage key / HTTP origin /file://非保証を整理しています。#1174 は PhaseTransitionSystem を導入する関連実装で、PR #1257 が merge 済みです。これにより
LoopPhase遷移は pure resolver / validator に集約され、main.tsとSortieSystem.tsの phase mutation はresolvePhaseTransition経由へ寄せられています。#1175 は armament catalog bootstrap で、PR #1263 により
src/data/weapons.ts/src/data/units.tsがdefinitionIdベースの readonly catalog になりました。ただし、これは weapon / unit catalog の seed であり、M4 close condition が要求する upgrade定義そのものではありません。P0: ブロッカー
1. #1176 の子Issueリストが実態とずれている
#1176 本文では #1169 と #1170 が未完了チェックのままです。しかし #1169 は PR #1190、#1170 は PR #1237 で完了済みです。加えて #1174 / #1175 も M4実装に強く関係していますが、#1176 には反映されていません。親トラッカーが stale だと、以後のagentは「何が完了済みで、何が未起票か」を誤認します。
修正案:
2. M4 close condition と現在の
src/data実装が噛み合っていないroadmap の M4 close condition は「upgrade定義が
src/dataに存在する」ことを要求しています。M4 scope も resource 消費、最小upgrade、次sortie反映、data-driven upgrade定義を明示しています。しかし現在の
src/data/weapons.tsはplayer_weapon_basicの weapon seed だけで、currency/cost/target/operation/value/availabilityを持つ upgrade定義ではありません。upgrade.mdでは M4最小 upgrade schema としてcurrency: resources、cost: 100、target: progress.weaponPower、operation: add、availability.phase: preparationを要求しています。したがって、#1175 をもって「upgrade定義がsrc/dataに存在する」と扱うのは false green です。別Issueで
src/data/upgrades.tsまたは同等の catalog を追加する必要があります。推奨する最小形:
3. 既存 reward save flow を UpgradeSystem にコピーすると仕様違反になる
upgrade.mdは strong atomic visible success を採用しています。candidate state / candidate snapshot を先に作り、snapshot保存に成功した後にだけ livestate.progressを commit する、または save前にlive stateをmutateした場合は保存失敗時に exact rollback する、と定義しています。一方、既存の result confirm flow は
confirmResult(state)が reward claim と phase transition を先に行い、その後persistProgressionSnapshot('reward-claim')で保存します。保存に失敗しても、すでに state mutation は発生しています。これは M3 reward では許容されている弱い永続化モデルですが、M4 upgrade では resource を消費するため危険です。upgrade購入で同じ順序を採ると、「画面上はresource消費・weaponPower増加済みだが、reloadすると消えて戻る」という false success が発生します。
実装Issueでは、既存
runProgressionSave()をそのまま呼ぶのではなく、以下のような atomic purchase seam を要求すべきです。4. PhaseTransitionSystem 導入後の upgrade action 境界が未定義
#1174 / PR #1257 により phase mutation は
PhaseTransitionSystemに集約されました。しかし現在のPhaseTransitionIntentにはpurchase_upgradeやapply_upgradeが存在しません。preparationの self-transition はsave_progress/reset_sortie/start_sortieだけです。M4 upgrade は
preparation限定です。ここで設計を曖昧にすると、HUDやUpgradeSystemがstate.loopPhase === 'preparation'を各所で独自判定し、#1174 の centralization を迂回します。選択肢は2つです。
敵対的には Aを推奨します。理由は、HUD button enable policy、UpgradeSystem precondition、E2E evidence が同じ intent 名を参照できるためです。
5. HUD exposure が未実装で、AC4の手動確認が成立しない
現在の
HudActionsには upgrade purchase action がありません。HUDはResourcesを表示しますが、weaponPower、upgrade cost、purchase button、insufficient resources表示、already purchased表示のsurfaceはありません。render側も HP / Resources / Shots / Cooldown / phase buttons を更新するだけで、upgrade状態やweaponPowerを表示していません。
#1176 のAC4は「手動プレイで sortie → resource → upgrade → 次 sortie の挙動変化を確認」となっていますが、現HUDでは upgrade の入口が存在しないため、AC4はまだ成立不能です。
追加すべきHUD AC:
6. localStorage / GitHub Pages 配布物の失敗モデルをM4実装Issueへ昇格すべき
外部仕様上、
localStorageは document origin 単位で保存され、SecurityErrorが発生し得ます。file:/data:のようなschemeや、ユーザー設定で永続化が拒否される場合は特に注意が必要です。MDNもfile:URLでの localStorage 挙動は未定義で、依存すべきではないとしています。([MDN Web Docs]1)Storage.setItem()は quota不足やユーザー拒否でQuotaExceededErrorを投げ得ます。WHATWG HTML Standard も、localStorage は同一siteの複数windowで共有される状態であり、authorは locking mechanism がない前提で設計すべきとしています。([MDN Web Docs]2) ([HTML Living Standard]3)repo側はすでに storage key 分離をかなりよく実装しています。
resolveStorageKey()は runtime override、VITE_LOOP_STORAGE_NAMESPACE、default production key を分岐し、PR preview key をloop-protocol.preview.pr-<number>.mvp.saveに解決します。ただし、M4 upgrade実装ではこの既存設計を 明示的なACに入れるべきです。特に「PR preview / E2E は production key を clear しない」「same-origin path違いはstorage分離ではない」「storage.save失敗時はupgrade successを返さない」を contract 化してください。persistence spec も、GitHub Pages の
/repo/と/repo/pr-<n>/は同一originでlocalStorageを共有し得るため preview/E2Eは分離keyを使い production key を clear しない、と定義しています。7. Vite/GitHub Pages配布の品質ゲートはあるが、M4親ACに接続されていない
Vite公式ドキュメントは、GitHub Pages の
https://<USERNAME>.github.io/<REPO>/配布ではbaseを/<REPO>/に設定する必要があるとしています。また、Viteはbuild stepを要するためGitHub Actions経由の配布が必要です。([vitejs]4)repo側の
vite.config.tsはVITE_BASE_PATHを正規化し、先頭/と末尾/を強制しています。deploy workflow も main配布では
/${repo}/、PR previewでは/${repo}/pr-${number}/をVITE_BASE_PATHに設定し、dist内の asset base path と preview storage namespace を検証しています。Viteの
VITE_*env は client bundle に露出します。したがってVITE_LOOP_STORAGE_NAMESPACEは現在のようにpr-<number>程度の非秘密値に限定すべきで、API keyやtokenを入れてはいけません。([vitejs]5)#1176 のM4配布物品質としては、既存workflowを「ある」だけでなく、M4 E2E / manual runtime evidence のACに接続すべきです。
P1: 仕様品質を下げている問題
upgrade.mdは canonical と言っているがstatus: draftdocs/product/features/upgrade.mdは frontmatterでstatus: draftです。一方 #1176 / #1170 はこれを「M4正本spec」と扱っています。これは即ブロッカーではありませんが、親トラッカー上では以下のどちらかを明記すべきです。
曖昧なままだと、後続agentが「draftだから逸脱可能」と解釈します。
repeatable: falseをweaponPower > 1で判定する設計は脆いupgrade.mdは M4最小スコープでrepeatable: falseをstate.progress.weaponPower > 1で充足済みと判定するとしています。M4最小としては成立しますが、これは
weapon_power_plus_1専用の暗黙ledgerです。将来playerMaxHpや別upgradeが増えた瞬間に破綻します。M4ではpurchasedUpgradeIdsを入れない判断でもよいですが、実装Issueでは以下のテストを必須にしてください。AC1 は “includes Upgrade Loop” ではなく exact readback にするべき
#1176 のAC1は「GitHub milestone 2 title includes
Upgrade Loop」です。これは弱いです。M4: Upgrade Loop draftや別文字列でも通ります。修正版:
gh api repos/squne121/loop-protocol/milestones/2 \ --jq '.number == 2 and .title == "M4: Upgrade Loop (v0.4.x)" and .state == "open"'#1169 ではこの方向の修正が入っています。#1176 側も親ACとして exact readback を要求すべきです。
pnpm run lint:docsとpnpm test:e2eが親ACにないpackage.jsonにはlint:docs、validate:roadmap-refs、test:e2e、previewが定義されています。M4は docs/spec、runtime、localStorage、PR preview配布を横断します。親ACには最低限以下を追加すべきです。
pnpm run lint:docs pnpm typecheck pnpm lint pnpm test pnpm build pnpm test:e2e手動プレイACだけでは、storage namespace、reload、next sortie反映、projectile damage snapshot の回帰を捕まえられません。
推奨する未起票 child issue 分解
Child A:
src/data/upgrades.tsを追加する目的: roadmapの「upgrade定義がsrc/dataに存在する」を満たす。
Allowed Paths:
AC:
Child B:
UpgradeSystemを実装する目的: quote / validation / atomic purchase / snapshot save を実装する。
Allowed Paths:
AC:
特に
src/main.tsの既存 reward flowをコピーしないことを明記してください。現行reward confirmは mutate後saveなので、M4 upgradeの strong atomic visible success とは異なります。Child C: HUD upgrade surface を追加する
Allowed Paths:
AC:
CombatSystemは projectile生成時点で
state.progress.weaponPowerをdamageにsnapshotしています。したがって upgrade効果は「既存projectileに遡及しない」「次に生成されるprojectileから効く」という仕様に自然に合っています。Child D: E2E / preview evidence を追加する
AC:
deploy workflowはすでに PR preview URL コメント、preview asset live check、preview storage namespace verify を持っています。これをM4 evidenceの前提に使えます。
#1176 に貼るレビューコメント案
最終判断
#1176 は 「M4の正しい親」ではあるが、現状のままでは実装投入用の親Issueとして弱いです。修正優先度は次の順です。
src/data/upgrades.tschild を切る。UpgradeSystemchild を切り、atomic visible success を強制する。これをしない場合、#1176 は「M4 Upgrade Loopを閉じた」と見えても、実際には spec-only / metadata-only / catalog-only の false green になります。
squne121 commentedon Jul 1, 2026
anchor comment
#issuecomment-4860696890を一次ソースとして #1176 を同期しました。upgrade definitions / UpgradeSystem / HUD / E2E-manual evidenceの 4 slot に整理sortie → resource → upgrade → next sortie 反映を満たすまで spec-only / metadata-only / catalog-only を success 扱いしないよう明記ローカルでは
guard-issue-body.py、contract_readiness_check.py --mode preflight-static、check_issue_contract.py --file ... --jsonを再実行し、最終本文はapproveを確認済みです。feat: add upgrade definition catalog (#1280) (#1292)
squne121 commentedon Aug 1, 2026
OWNER decision applied
#1176 の parent close evidence は、M3 の sortie reward resource acquisition と #1283 の purchase → save → reload → Load Game → next-sortie projectile reflection を compositional evidence として採用する。
採用条件は、各 evidence が同一 current main SHA と当該 SHA の current CI evidence に束縛されること。binding または concrete evidence gap が欠ける場合、parent は close しない。
同一因果 scenario が必要と判明した場合は専用 child Issue を作成し、#1283 を再拡張しない。#1425 の artifact-boundary ownership は #1283 / parent close の blocker にしない。
fix(e2e): repair M4 storage write-set audit false-green (#1283) (#1981)
squne121 commentedon Aug 3, 2026
全 8 child issue(#1169/#1170/#1174/#1175/#1280/#1281/#1282/#1283)が closed。Close Evidence Matrix の両 evidence 行(M3 reward resource acquisition / #1283 M4 purchase-persistence-reflection)を、現在の origin/main HEAD f66900c に束縛して記録済み:
以上により Close Evidence Matrix の binding gap は解消したと判断し、クローズする。
fix: M4 closeの権限記述をOWNER指摘に沿ってissueへ集約しroadmapのdependenciesのYAML誤解釈を修正する
docs: M4→M5 phase handoffとM5〜M8 roadmapを正式化する (#2574)