refactor(starpuff): v17 債務列車——GameScene strangler 拆解與契約測試(行為零改變) - #807
Merged
Conversation
- 事件名唯一性與 domain:action 格式契約 - emit/on/off 對偶、跨事件隔離、多監聽者傳遞 - 魔王 FSM 階段事件:跌破 50%/25% 門檻各發恰一次、單擊跨雙門檻現行為鎖定 - waves 關卡事件序列:LEVEL_CHANGED 恰一次、GATE_OPENED 達標恰一次、 擊殺與吞下同權計配額、BOSS_DEFEATED 停推進、destroy 零殘留監聽 測試:vitest run events.test.ts 15 案全綠(總 580→595) Co-authored-by: Cursor <cursoragent@cursor.com>
- buildBoss/summonMinion/spawnBossMinion 遷至 createBossKit,hooks 閉包延遲解析 - 品種分派表、體傷常數、補給節奏與回呼接線行為零改變(never 守衛保留) - characterization 測試 13 案先行鎖定:分派表、EX 分裂、補給夾限、 召喚潮汐調整、彩蛋回呼、轟炸開關、重力直寫、保底愛心 測試:vitest 608 全綠(+13);e2e smoke+v8+v10 共 23 案全綠(魔王五品種面) Co-authored-by: Cursor <cursoragent@cursor.com>
- 規格解析(specOf/mixOf/damageOf/playerFormSpec/slamRadiusPx)與技能世界結算 (星暴/下衝擊/殼盾反擊/鏈電束/風化落地/雷鏈/凍結場/爆裂波及)遷至 createStarCombat - 距離判定改用 Math.hypot 等語意實作,模組不 value-import phaser 維持 node 可測 - resolveBossQuake(玩家彈起)留 GameScene;hooks 閉包延遲解析 - characterization 測試 20 案先行鎖定:規格優先序、buff 倍率疊乘、AoE 排除 主目標、雷鏈跳序、面向側過濾、凍結放寬帶、殼化半徑加倍 測試:vitest 628 全綠(+20);e2e smoke+v6+v9 共 27 案全綠(技能與星彈面) Co-authored-by: Cursor <cursoragent@cursor.com>
- 準星輔助/追電星導引/磁場吸偏/拖尾附掛遷至 createStarSteering - update 導向順序凍結(homing → aimAssist → magnetized)、syncTrails 獨立出口 - 轉向數學留 logic/homing 與 logic/enemyFsm;此層只鎖候選過濾與委派 - characterization 測試 8 案先行:boss 關前置條件三分岔、背向/超距排除、 homing/boomerang 不疊加、magno field 相位、拖尾附掛與停噴 測試:vitest 636 全綠(+8);typecheck/eslint 過(e2e 於後續單元合併驗證) Co-authored-by: Cursor <cursoragent@cursor.com>
- addOverlaps 全段遷至 wireCombatOverlaps;接線順序凍結不重排 - 星彈/觸碰/危險物/彈幕/隕星/平台元素結算回調原樣搬移,hooks 委派 - damagePlayer/damageBossAt 單一入口與 finished/transitioning 靜默窗語意不變 - characterization 測試 8 案先行:接線數量與順序、雙本體 +3、流星雨 +3、 危險物/魔王受擊/殼化反彈/回傷歸因/頭頂暈眩窗/隕星碎裂路徑 測試:vitest 644 全綠(+8);e2e v11+v12 共 14 案全綠(碰撞最密集面) Co-authored-by: Cursor <cursoragent@cursor.com>
- systems/eggTracker:進度鎖存/逐幀餵送/獎勵落地/crown 時間窗;存檔寫入 經 recordEggAndAward 回流 GameScene persistAndAward 單點 - systems/toasts:成就 toast 佇列(同批合併/跨批序列)、星味首遇提示、 彩蛋慶祝演出;lastAchievementToast 改 getter 轉發(__sp 觀測契約不變) - characterization 測試 6 案先行:reach-x 回頭走一次性、stand-count 上升緣 計數、crown 時間窗起算、滿血 heal fallback、twin-finish 金星彈 測試:vitest 650 全綠(+6);e2e smoke+v13+v15 共 21 案全綠(成就 toast 面) Co-authored-by: Cursor <cursoragent@cursor.com>
- root eslint config 加 apps/starpuff 範圍 override:max-lines error 1200 - levels.ts 豁免(資料驅動關卡表,行數隨內容自然成長非邏輯債) - 閾值以拆解後現況為準(GameScene 1198 行通過、降 1100 實測會咬) - 全 repo lint 驗證 0 errors;9 個既有跨 app warnings 與本規則無關 測試:pnpm lint 全 repo 過;閾值降檔 sanity check 確認閘門生效 Co-authored-by: Cursor <cursoragent@cursor.com>
- GAME_DESIGN 檔頭升 v17;新增 §106 拆解記錄與觀察項設計理由註記 - CODEX_MONSTERS 敘述訂正 24→23 隻(§104 與 gridLayout 測試標題;ceil 斷言不受影響) - e2e v6 版本號測試標題移除 nogit 舊敘述(本體 regex §99 已更新) - TitleScene 行內註解下沉 3px→5px 對齊實碼;resetLayout 補語意註解 (回傳橫持基準、直持走 defaultLayoutFor 分流) - README「翔風峽谷」與 levels.ts L5 名稱一致,驗證通過無需修改 測試:vitest gridLayout 全綠;tsc 過;prettier check 過 Co-authored-by: Cursor <cursoragent@cursor.com>
- 002 新增 reward 條目(GameScene strangler 拆解六單元收斂 2121→1198 行) - 記分鏈人工驗算:+153 + 1 = +154(reward 1、penalty 0、neutral 0) - changeset @app/starpuff patch:內部重構使用者不可感知 測試:vitest 650 全綠;Playwright 完整兩 project 92 案全綠;production build 過 Co-authored-by: Cursor <cursoragent@cursor.com>
- 補 toasts.test.ts 5 案(Grok/Sonnet 席共同缺口):佇列同批即播、跨批 序列不重疊、播畢自動接續、celebrate 座標夾限、flavor 不進成就佇列 - GAME_DESIGN §106 與檔頭行數訂正 1198→1196(Sonnet 席實測覆核) - GameScene 註記 bossKit feedEggs 回呼時序安全理由(Grok 席建構序觀察) 測試:vitest 655 全綠(+5);tsc/eslint/prettier 過 Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
三席維護性評分 5/7/8 觸發 Blocking 的債務收斂列車:GameScene 2121→1196 行(-44%),拆解為六個獨立系統模組,補齊 GameEvents 契約測試與 ESLint max-lines 守門。行為零改變——玩法、數值、視覺、事件順序、存檔語意一律不動。
拆解單元(每步 characterization 先行、獨立 commit 可 revert)
守門與文檔
驗證(行為零改變證據)
兩席獨立審查(阻塞模式,均 APPROVE)
測試:vitest 655 全綠;Playwright 92/92 全綠;production build 過
Made with Cursor