最後更新:2026-09-14(U01-A — E2E Database Isolation & Fast Test Foundation 關門;M01-O 真人 smoke 補跑完成;P4-A 開工前置維持完成)
本檔是當前進度、Roadmap、下一步與文件索引的單一事實來源,供新的 AI Session 或實作者接手。產品行為以 規格企劃.md 為準;實作契約與歷史驗收證據請依下方索引查閱,不在本檔重述。
Adventure Table 是朋友間私人使用的輕量、桌上跑團優先 D&D 5e 2014 Web VTT。真人 DM 主要靠口頭敘事,網站負責共享、同步、計算、保存、權限與外部 AI 接入;不做 CRPG 或包山包海的平台。
/rooms/{roomId}/characters),舊的 global /characters//api/characters 已於 P2-B 收口。Room 另可建立 Campaign 與 Party Roster(/rooms/{roomId}/campaigns):Campaign lifecycle 為 Owner-only,Roster 由 Owner/DM 管理,且只 reference 同 Room Character、不複製 Current State。Room 目前選中的 active Campaign 可再進 Lobby(/rooms/{roomId}/campaigns/{campaignId}/lobby):建立 DM/Player/Spectator Seat、指派 Human controller、為 Player Seat 選本場角色,presence 沿用 P2-A heartbeat 顯示 Connected/Offline。DM Seat 的 controller 指派為 Owner-only。Lobby 之後可由 Owner 事前 assign 的 DM Seat controller Start Session(/rooms/{roomId}/campaigns/{campaignId}/sessions/{sessionId}):本場 DM Controller 與每個 Player Seat 的 Active Character 在 Start 當下固定,支援 Late Join、End、Abandon 與 Resume;同一 Character 不得同時在兩場 active Session,由 DB lease 保證。zh-TW/en。Enabled pack 清單以程式中的 Settings.enabled_content_packs 為準。after_seq cursor 增量補齊,long-poll 等待期間不佔 DB connection,斷線自動重連並沿用同一 cursor,server restart 後順序與 revision 不倒退。/action、/search、/whisper、/ooc 只是同一條 typed input 的語法捷徑,/search 不會自動選 Skill 或建立 RollRequest。current DM 可代理任意 Player Seat 行動,event 同時保存 acting DM 與 subject Seat/Character且不改 Seat Controller。Whisper 由 Server 過濾,第三方連 payload 都拿不到。Stage 與訊息都是 canonical row,reload 與 server restart 後仍在。/check 建立 Request Check,支援單人/多人/Party target、Ability/Skill/Saving Throw/其他、optional DC、Normal/Advantage/Disadvantage、optional ±N 與 public/roller+DM/dm-only 三種 visibility;多個 request 由同一 RollGroup 管理。RNG 一律在 Server,raw die、採用 die、modifier、total 與 source 全部保存;實體骰只能提交 raw die,total 由 Server 重算。同一個 RollRequest 只會有一個 result,重送或雙擊不會重擲。Player 的 /check 只建立 Check intent,不能自訂 secret DC;secret DC 與 dm-only result 由 Server 過濾,Player 端連 payload 都拿不到。current DM 可代理任意 Player Seat 擲骰,計算用的是 subject Character 的規則資料。Quick Dice 是獨立的便利骰,不會完成任何 pending formal request。PendingAction 有 pending/processing/waiting_for_roll/resolved/cancelled 五個狀態,transition 由 Server 驗證。Roll 之後的合法 Character Current State 變更走同一條 actor-neutral table action service,Human 自己操作與 DM 代理都會保留 acting 與 subject 身分。AI + Offline 是合法狀態。AI 用 Adventure Table 自己的 scoped credential 進場:token 只在建立/rotate 時顯示一次,DB 只留 hash,scope 固定 Room/Campaign/Seat/Role/generation。Human Player 可對自己控制的 Seat Let AI Control,可附一句只屬於這次交接的 Temporary Handoff Instruction;Take Back Control 只認當初交出去的那個仍有效 Room access session,換裝置或原 session 失效時改由 Owner/DM 做 administrative reassignment,並在同一 transaction 內撤銷舊 grant。每個 Seat 有單調遞增的 controller epoch 當唯一真值,grant 只保存 mint 當下的 generation snapshot,每次授權都要同時對上「Seat 目前綁這張 grant」與「epoch 等於 generation」。Owner 可在 Lobby 事前把 DM Seat 配成 AI 並產生有限期限的開場憑證,AI 用它只能讀自己 DM Seat 的最小開場資訊與 Start,Start 成功後才變成該場固定 DM credential;DM controller 一場之內固定,不支援中途交接。Session End/Abandon 會在同一 transaction 內撤銷該場所有 AI grant。POST /mcp,以 MCP 2026-07-28 stateless Streamable HTTP 為唯一契約(每個 request 帶 MCP-Protocol-Version/Mcp-Method/_meta,不需 initialize,拒 Mcp-Session-Id)。外部 AI 以 P3-D 的 AI Join Token 當 Bearer 進場,每個 request 重新 resolve current grant/epoch;tool catalog 依 Player/DM/pre-session DM 三種 scope 產生,涵蓋 context、own Character、Dialogue/Action/OOC/Whisper/Narration、Stage text、Request Check、formal/physical/quick roll、Current State、get_pending_events/wait_for_event,沒有 resolve_action 或任何 raw-state escape hatch。Human UI 與 MCP 共用同一組 application service;standalone 不掛 /mcp。真實 external client E1 已於 2026-09-11 P3-F closeout 期間由 Claude Code 2.1.260 經 Tailscale HTTPS 入口跑完整 journey(context → action → formal roll → Take Back → 舊 token 401 → End),wire 全程 2026-07-28 契約、每個 tools/call 帶 Mcp-Name。GET /mcp/guide 無需認證提供與 tool catalog 同源的完整指引;get_session_context.briefing 是強制逐步迴圈;wait_for_event 上限 120 秒。產品硬原則包含 Server authoritative、Human/AI 共用 backend logic、秘密由 Server 過濾、敘事輔助資料 optional 不變 mandatory。網站本身不接 LLM API;未來 AI 能力來自使用者外部 AI Session。完整行為與明確不做項目見產品規格,不以本段取代。
P0、P1、P2、P3、M02、M03 已完成並關門;M01-A~M01-O 已逐項關門,M01 仍是長期保持 open 的 Character Content Expansion / Maintenance track;M04-A~M04-C 已於 2026-09-12 關門。P4 開工前置已於 2026-09-13 完成,產品主線下一步仍是 P4-A — Monster & Combatant Foundation。工程優化軌 U01 已建立,U01-A — E2E Database Isolation & Fast Test Foundation 於 2026-09-14 在 branch u01-a-e2e-isolation 關門(docs/U01/U01-A.md §14):E2E 改走獨立 adventure_table_e2e + server-e2e 8001 / web-e2e 5174,reset 有 current_database() hard guard,本機 npm run test:e2e:docker 不再碰 daily adventure_table 也不再重啟 daily server / web;同機 Playwright 主套件 10.1m → 10.1m 無倒退,wrapper 總 wall-clock 10.6 分成為後續 U01 加速 baseline。U01 整體維持 open,不改寫 P Roadmap,可與 P4 並行。M01 track 下一個未使用字母為 M01-P,尚無已拍板 scope。
P2 已交付並必須繼續維持的核心方向:
unstable格式並 normalize。P3 已拍板並寫入正式文件的核心方向:
TableActorContext/等價 actor abstraction:Human以access_session_id識別,AI以grant_id + generation識別;AI不偽造RoomAccessAuthority。P3-C新service先保持actor-neutral,P3-D正式把P2 Human-only Session / live Character authorization入口演進成Human/AI共用。controller_epoch為current SSOT:Seat current AI binding保存grant id + 單調epoch;ai_controller_grants.generation只保存mint時的immutable epoch snapshot,Session fixed DM / Participant join generation也只是歷史snapshot。每次AI授權必須同時驗current grant id與seat.controller_epoch == grant.generation,不能只看grantstatus。session_id=NULL 時必須有有限TTL,只能讀自己DM Seat/Campaign的最小Start context與呼Start;Seat controller變更/rotate/archive/delete、Campaign離開Start-eligible active、Room active Campaign切離、Owner revoke或TTL到期都使未綁grant失效。Start成功後才轉為該Session固定DM credential。Take Back Control只認原handoff Human access session:Let AI Control會保存handoff_return_access_session_id;其他Room member、相同display name或重新進Room得到的新access session都不能self-service Take Back。P2目前沒有跨裝置持久Human identity;原access session遺失/revoked時,改走Owner/DM既有Player Seat administrative reassignment,並原子revoke AI grant + 前進Seat epoch + audit。controller_epoch,Session fixed DM snapshot、Participant join snapshot加入AI grant + generation,並drop/re-add ck_campaign_seats_controller_binding、ck_sessions_dm_controller_binding、ck_session_participants_controller_binding;不得回頭改歷史0013 / 0014。M04 已拍板的核心方向:
client_id 不是 Seat 授權識別,revoke 只作用在該 authorization 的 family;一張 grant 同時只有一個 active family;refresh 每次重驗 P3-D grant authority(grant 有效、Seat current binding、epoch、TTL/Session),refresh token 未過期不構成授權。tools/call 的 server 端 role 檢查永遠是唯一真值。GET /mcp/guide、tool description、briefing 與 tool catalog 同源。P4 已拍板並寫入正式文件的核心方向:
5e-bits/5e-database@ce47a18dfeb3e41a1b2a2dfe00a25761c3c3a4f1 的 src/2014/en/5e-SRD-Monsters.json,共 334 筆 Monster records,其中 type=beast 共 87 筆;manifest 必須對兩個 count 做 gate。P4-A 至少同步交付 Monster name 與 Trait / Action / Bonus Action / Reaction / Legendary Action 等命名欄位的 en / zh-TW;long-form description 可延後到首次 user-visible exposure,但 English fallback 不算 supported-locale completeness。data/srd5.1/ / standalone ContentRegistry;Monster Instance、Combat persistence tables、routes / services 不進 Standalone,也不能用名稱含 monster 的 blanket regex 把 Template content 一起擋掉。ResolvedCombatSpell.casting_source 同時接受 Character spellcasting source 與 Monster stat-block source;Monster 的 spellcasting ability、spell attack bonus、save DC、usage / slots 由 resolved stat block 提供,不偽造 Character class source。下一步依序為:
docs/U01/U01-A.md §8 與 10.6 分 baseline 續編,不阻塞 P4。P2 的正式契約:
P3 的正式契約:
M04 的正式契約:
P4 的正式契約:
U01 的正式契約採單檔格式:
M01 不再有「必須 final closeout 後才能開始 P2」的 gate。 A~O 是目前已完成的角色內容 baseline;下一個未使用字母是 M01-P,尚無已拍板 scope。 M01 可以在 P2/P3/P4 等正常產品 Roadmap 繼續前進時保持 open,不要求先建立一個假的「全部 D&D 內容已完成」里程碑。
新的 M01 Subphase若只補 content / presentation,依當時既有 regression contract驗證;若碰到 Character Build/State/Version/StableKey/Builder provenance/Character JSON schema 或其他共享角色核心,除了 M01 自身驗證外,還必須同步做當時已存在的後續 P Phase compatibility review與 M03 standalone compatibility review。P2-A 起 shared Character migration 必須落在 character Alembic track,不得讓 maintenance 工作反向依賴多人層。
| 項目 | 當前狀態與影響 | 證據/後續入口 |
|---|---|---|
| Builder Draft 存檔/重取競態 | P2-D 解掉一半(character-builder 是等待條件寫太弱的測試缺陷,已改用 draft revision 等待)。m01e/m01m 未解:這兩支本來就用 revision 等待,失敗是單次 poll 真的等滿 5 秒,根因仍未確認,且目前沒有活躍的重現案例。2026-09-09 曾把兩支 M01-K 誤登記為重現,查明後為 Playwright 30 秒單測預算不足,已排除並修復 |
已知問題.md KI-P1D-001 |
| E2E 單測時間預算的安全邊際 | M01-K 兩支重測試在 GitHub runner 上需 32~34 秒,先前撞上 Playwright 預設的 30 秒上限。已把 playwright.config.ts 的 timeout 設為 60 秒。這只是把邊際拉開,沒有讓測試變快:fillEmptyComboboxes 每填一個選項就重跑整輪掃描(含全頁 collectUsedLabels),chooseFirstEnabled 又逐一 innerText() 每個 option,是 O(n²) 的 round trip。選項基數再長就會再次逼近上限 |
P3-A closeout「Verification evidence」的全套 E2E 段 |
| P2-A Room 層取捨 | Throttle 為 process-local(多 worker 會稀釋);POST /api/rooms 無 throttle 無授權;Room access token 以明文存 localStorage 且無到期機制 |
P2-A closeout「已知限制」;P3-D因此明確不把新access session / display name視為原handoff Human |
| Journey 2(多 Room 隔離)只有後端證據 | HTTP 層由 test_p2b_room_character_api.py::test_room_a_cannot_use_room_b_character_or_draft_ids 完整覆蓋,但測試指南 §13 描述的「把 Room B 的 UUID 貼進 Room A route 會看到什麼」沒有 browser 斷言。隔離本身有保證,缺的是使用者視角證據 |
P2-F closeout「已知限制」 |
| 雙語 browser crawl 未涵蓋 P2 新畫面 | m02h-bilingual-site-smoke.spec.ts 只跑三條 character 路由,沒有 /campaigns、/lobby、/sessions/{id}。目前靠 hardcodedUiCopy.test.ts 掃描與各 *Copy.ts locale parity 單元測試把關,缺整頁 overflow / raw key 的視覺層 crawl |
P2-F closeout「已知限制」;P3-F要求把Session桌面納入完整crawl |
| Restart 整合測試跑在 SQLite | test_p2f_restart_integration.py 用 metadata.create_all 建 SQLite,dataset 完整但不是 Alembic 遷移後的 PostgreSQL。migration 面另有真 PostgreSQL 覆蓋,兩者合起來無未驗組合 |
P2-F closeout「已知限制」;P3-F要求至少一條真PostgreSQL restart整合證據 |
test:e2e:docker 只 rebuild web |
P3-B 已收斂。 apps/web/scripts/e2e-docker.mjs 改成 docker compose up -d --build server web,e2eDockerScript.test.ts 釘住這個行為,stale backend image 不再是操作者責任 |
P3-B closeout「Verification evidence」 |
| Lobby 的 per-Seat N+1 查詢 | P3-A 解掉 Resume 那一半。 SessionResumeRepository.load_character_summaries() 把 Active Character summary 改成單次批次查詢,且整份 Resume 已從 Session 頁的 heartbeat 移除。Lobby 側未動:SeatService.lobby() 仍對每個 Human-controlled Seat 各查一次 access session,而 Session 頁仍以 heartbeat 週期輪詢 Lobby。P3-A 沒有放大它(輪詢頻率不變、淨查詢量下降),P3-B 也沒有提高 Session 頁對 Lobby 的依賴或輪詢頻率,屬「未惡化」而非「已修復」 |
P3-B closeout「已知限制」;P3-A closeout「已知限制」 |
| P3-A 的呈現層與測試替身取捨 | P3-B 解掉兩項呈現層問題:致命錯誤不再同時出現兩則 banner(onFatal 不另設 generic error banner),重連中改用 .notice-banner + role="status",fatal 才是 error-banner + role="alert"。waiter starvation 測試替身未動:仍借真實 wait_after 但 stub list_after,真實 endpoint 路徑未合成單一端到端資源斷言,留給 P3-F 的資源安全整合 |
P3-B closeout「關門過程中修正的問題」第 3 項與「已知限制」 |
| 座位變動的即時同步仍是顯示層權宜 | P3-D 解掉授權面與初次載入面:Session Resume 現在帶 caller-specific 的 seats 與 self_take_back_seat_ids,Session 頁不再拿進場當下的 join snapshot 當 controller 真值。未做的是 event-driven 更新:controller.changed 已是 canonical event,但前端只把它當 log 列,沒有 Lobby 讀取權的 caller 在別人交接後仍要 reload 才會看到新 controller |
P3-D closeout「已知限制」;P3-B closeout「已知限制」 |
| AI grant token 在 DB 留了 6 個字元的 secret 前綴 | ai_controller_grants.secret_prefix 存 at_ai_<grant hex>_<secret 前 6 碼>… 供 UI 辨識是哪張 grant。測試指南 token 案例 2 的字面要求是「DB row 不含 plaintext」,這是刻意取捨:剩餘 entropy 約 37 個 urlsafe 字元,無實務爆破風險。要收乾淨就改成只存 grant id 前綴 |
P3-D closeout「已知限制」 |
| P3-D 的 AI 授權證據全在 domain 層,新 UI 無 browser 證據 | P3-E 已補 HTTP 入口與 real-backend MCP journey,P3-F E1 已補真 external client(Claude Code 2.1.260 經 HTTPS)證據;LobbyAIDMGrantPanel / PlayerAIControlPanel 仍只有 vitest 覆蓋,handoff/Take Back/admin recovery/AI DM Start 的 browser journey 未做,見 P3-F closeout「Known limitations」 |
P3-D closeout「已知限制」 |
| handoff 不改 participant snapshot 只有結構性保證 | 三條 controller mutation 確實沒有寫 session_participants 的語句,但沒有測試在 handoff/Take Back/admin reassignment 前後比對 participant row 與 active_character_id;日後有人在這三條路徑加寫入,現有測試不會擋。P3-F 的 D1/D1b journey 應補上前後比對 |
P3-D closeout「已知限制」 |
| 桌上訊息只保留最後 200 筆,且長場次 reload 仍是完整 replay | P3-B handoff 要求 P3-C 正面處理「提高上限或改成分頁載入」。P3-C 試過改用 Resume 的 bounded cursor 取代 replay,但那會讓 50 筆視窗之前的可見歷史消失,已回退成「Resume 能自證覆蓋完整歷史才沿用其 cursor,否則 durable replay」。correctness 無誤,但 reload 成本仍隨 event 數線性成長,畫面也只留最後 200 筆,真正的回捲 UX 未做 | P3-C closeout「已知限制」與「關門過程中修正的問題」第 1 項 |
全套 E2E 只有 workflow_dispatch CI |
p3-e2e.yml 已涵蓋全部 Playwright spec(含 C1 p3c-roll-check-pending-action.spec.ts),但刻意只允許手動 dispatch,不隨 push / PR 自動跑;日常仍靠本機 npm run test:e2e:docker。整體 E2E 時間預算(10.6m)要不要進 push gate 未決 |
P3-F closeout「P3 Full-Stack E2E」 |
| Group Check 沒有群組彙總視圖 | roll_group_id 只在資料層成立,前端是逐條 request 的清單;「這一組共 4 人、2 人已擲」的彙總呈現沒有做 |
P3-C closeout「已知限制」 |
| Campaign status 仍無 transition 規則 | active 已累積「可開 Lobby」與「可開 Session」兩層語意,但 Campaign 仍可從 completed 退回 draft;delete_draft_without_session_history() 因此得同時檢查 status 與 Session history 才安全 |
P2-E closeout「已知限制」;P3-D pre-session AI DM grant只要Campaign離開Start-eligible active就revoke,不依賴status transition單向性 |
| draft Campaign hard delete 會 cascade 掉整份 Roster | 符合契約,且 P2-E 已把「無 Session history」從恆真變成真的檢查(delete_draft_without_session_history())。剩下的問題只在 UI:確認流程未顯示會連帶移除幾筆 roster。P2 未處理 |
P2-C closeout「已知限制」;P2-F closeout「已知限制」 |
| Room Hard Delete 是目前最容易造成不可逆資料遺失的入口 | 確認 modal 只要求輸入 Room 名稱,未顯示會連帶刪除幾個 Character/Draft/Campaign/Session,也未提示先匯出。行為符合契約,human smoke 期間實際造成兩隻角色永久遺失。P2 未處理 | P2-B closeout「已知限制」;P2-F closeout「已知限制」 |
display_name 只在 Lobby 有去處 |
P2-D 起 Lobby 的 controller 下拉與 Seat 卡片會顯示它,P2-B 記錄的「填了零反饋」部分解除;Room landing 與 Character workspace 仍不呈現 | P2-D closeout「已知限制」 |
E2E destructive reset 只作用於 adventure_table_e2e |
U01-A 已收斂。 reset 抽成 e2e-reset-db.mjs,同一 psql --single-transaction 內先檢查 current_database() == 'adventure_table_e2e' 再 truncate,guard 名稱是常數、無 env override;本機仍需 ADVENTURE_TABLE_E2E_ALLOW_DESTRUCTIVE_RESET=1 opt-in,但不再需要因 E2E 備份 daily DB。殘留:--database 值經 shell: true 直接拼進命令(Node DEP0190 warning),只供操作者使用 |
U01-A §14.5 / §14.7 |
| M04-C 真實 AI 進桌只驗了目標平台 | C.8 的 Bearer MCP client 與純 HTTP 兩條路徑、C.9 非目標平台/Codex 相容記錄,2026-09-12 由使用者拍板延後;kit 的 Bearer 段與最小 HTTP client 範例只有單元/E2E 對契約的斷言,沒有真實 AI 憑 kit 走這兩條路的證據 | M04-C closeout「延後項目」 |
| M01-J 直創/逐級升等等價 E2E | 測試目前 fixme,瀏覽器層證據仍有缺口;後端已有相關整合覆蓋 |
已知問題.md KI-M01J-001 |
| Windows Vite E2E 環境 | 使用既有 Docker Linux dev server 路徑驗證;不要走 Windows Playwright 託管 Vite 的整套路徑 | 已知問題.md KI-ENV-001;README.md |
| M01-N 匯出 HTML 缺行為測試 | createCharacterSheetHtmlExport() 對真實產出的 HTML 沒有斷言,目前由投影單元測試、原始碼字串斷言與 E2E 下載斷言間接把關;prepared_limit 改寫路徑因 fixture 為 null 而不在 CI 覆蓋內(已人工驗證) |
M01-N closeout「已知限制」 |
| M01-O 15 個 deferred Feats | 10.12 Human smoke 已於 2026-09-14 由真人執行通過;Bountiful Luck、Dragon Fear、Elven Accuracy、Poisoner 等 15 個 Feats 的 Combat / Reaction / Roll / Rest / Inventory 效果為 structured + deferred,等 P4+ 對應 substrate,UI 只列出不自動套用 | M01-O closeout「Closeout Evidence」 |
| M03 測試/開發工具遺留 | Settings() import-time 快照的測試污染與 dev seed engine 入口未收斂,詳細限制及建議留在 closeout |
M03-G closeout「M03 已知限制」與「留給後續 Phase 的建議」 |
以上為接手時須注意的現況索引;問題詳情與歷史測試數字以連結文件為準,不代表本檔每次更新都重跑驗收。
先建立角色與規則基礎,再把角色帶進桌內。M Phase 為插入式維護/擴充,不改寫 P0 → P8 的產品 Roadmap;M Phase 可以長期保持 open,而正常 P Roadmap 繼續前進。U Phase 為 Test / Development Efficiency 長期優化軌,同樣不改寫產品 Roadmap,可與 P / M 並行。
| Phase | 主題 | 交付範圍/狀態 |
|---|---|---|
| P0 | Character Core + SRD / Rules Foundation | 角色資料、角色卡、角色相關規則基礎;已關門 |
| P1 | Character Builder Complete | 完整創角、Progression、Level Up、Character Version;已關門 |
| M01 | Multi-Source Character Content Expansion | 長期角色內容/角色系統維護 track;A~O 已關門,整體保持 open,下一個未使用字母為 P,不阻塞 P2+ |
| M02 | Traditional Chinese / English Localization | 插於 M01-C 與 M01-D 間;雙語呈現、翻譯流程與完整性 gate;已關門 |
| M03 | Standalone Character Builder Distribution | P2 前插入;Windows 單機版、Character JSON exchange、standalone boundary;已關門,E.9 乾淨 Windows 11 冷啟動已於 2026-09-06 補驗完成 |
| P2 | Room / Campaign / Session / Seat | Room-first Web、Room Character Workspace、Campaign / Roster、Seat / Controller / Lobby、Session lifecycle;A~F 全數關門,Phase 已關門 |
| P3 | Exploration + Roll + AI | Exploration、Chat/Action/Check、正式骰子、PendingAction、Human/AI 共桌;A~F 全數關門,Phase 已關門並合併回 main |
| M04 | Web Chat MCP Integration & AI Join Kit | P3 關門後、P4 前插入;網頁版 chat preflight(ChatGPT Plus → Claude chat 個人方案)→ OAuth integration → AI Join Kit 與 server-hosted 指引;M04-A、M04-B、M04-C 皆已於 2026-09-12 關門,目標平台判定為 ChatGPT Web Plus;M04 Phase 同日以 0465788 合併回 main,merge-gate E2E run 34704122623 全綠 |
| U01 | Test / Development Efficiency Optimization | 長期測試/開發效率與可靠性優化軌;U01-A 已於 2026-09-14 關門,整體保持 open,不阻塞 P4 |
| P4 | Quick Combat | 第一個完整可玩的 Combat MVP;A~F 已完成拆分與三份正式文件,P4-A preflight source/count/locale/standalone/spell-source 契約已同步,code 尚未開始;下一步 P4-A |
| P5 | Tactical Combat | 同一 Combat Engine 上增加 Grid、Battle Map、Movement、Range、AoE 與空間系統 |
| P6 | Adventure + AI DM Runtime | Adventure Definition/Importer、Campaign Runtime、世界資料、AI DM context/write-back |
| P7 | Snapshot / Export | Timeline、Snapshot/Restore、broader Archive/Import/Export;角色 JSON exchange 已由 M03 先行,不做 Undo |
| P8 | QA / Polish | 全流程整合、權限、AI reconnect、效能、Responsive UI 與第一版收尾 |
以下每個 Subphase 各列一項;✅ 代表該項已關門,🟡 代表實作與自動化 gate 完成但仍有明確延期的驗收項,⬜ 代表正式規格已存在但尚未實作。未結清的驗收限制仍以上方索引為準。詳細規格、設計與證據由各 Phase 文件承擔。
| Subphase | 狀態 | 重點 |
|---|---|---|
| P0-A — Project Foundation | ✅ | Project / DB / tests / CI baseline |
| P0-B — Character-Relevant SRD Foundation | ✅ | Character-relevant SRD / ContentRegistry / validation |
| P0-C — Character Core & Persistence | ✅ | Build Version / Current State / persistence / fixture |
| P0-D — Character Rules & Backend API | ✅ | Character rules / DTO / APIs / overrides |
| P0-E — Character Sheet & State UI | ✅ | 三頁 Character Sheet / state UI / E2E |
| P0-F — Full P0 Integration & Closeout | ✅ | Full regression / persistence / smoke / closeout |
| Subphase | 狀態 | 重點 |
|---|---|---|
| P1-A — Builder Domain & Draft Foundation | ✅ | Builder Draft、choice model、compiler / validation、draft persistence;不完整 Draft 不污染正式 Character |
| P1-B — Character Creation Basics | ✅ | Character Workshop、Wizard basics、Race/Subrace、Background、Standard Array / Point Buy / Manual、starting skills/proficiencies |
| P1-C — Class Progression & Multiclass | ✅ | Level-by-level rail、starting class、multiclass prerequisites / grants、Subclass timing、HP progression |
| P1-D — ASI, Feat & Structural Choices | ✅ | ASI / Feat timing、prerequisites、generic structural choice resolver、Numeric Override boundary |
| P1-E — Spellcasting Progression | ✅ | Known / Spellbook / Prepared / Always Prepared、multiclass slots、Pact Magic、source profiles |
| P1-F — Equipment, Review & Character Creation | ✅ | Starting Equipment nested choices、Review、atomic Create Confirm、Version 1 + initial State |
| P1-G — Level Up & Character Versions | ✅ | Level Up Draft、immutable Version N+1、Version History、stale base guard、State reconciliation、correction/build edit |
| P1-H — Full P1 Integration & Closeout | ✅ | P1 full regression、Create / high-level / multiclass / caster / Level Up E2E、P0 regression、migration / restart persistence / smoke closeout |
| Subphase | 狀態 | 重點 |
|---|---|---|
| M01-A — Multi-Source Content Pack Foundation | ✅ | 泛化 Content Pack / StableKey / registry / cross-reference / content_sources,維持 SRD compatibility |
| M01-B — PHB Character Origins & Background Expansion | ✅ | PHB Background、PHB 非 SRD subrace、Variant Human;真人創角 Gate 已執行並關門 |
| M01-C — SCAG / GoS Background Expansion | ✅ | 13 SCAG + 4 GoS Background、source collision、roleplay-only table reuse / background variant、equipment / E2E regression |
| M01-D — VGM Race Expansion | ✅ | Goblin / Hobgoblin / Aasimar、level-gated racial features / resource metadata;雙語與 E2E 已驗收 |
| M01-E — SCAG Half-Elf Variant & Grant Replacement | ✅ | Half-Elf ancestry variants、最小通用 Grant Replacement、stale branch isolation、movement modes、Drow Magic resources;雙語與 E2E 已驗收 |
| M01-F — VRGR Lineage & Dhampir | ✅ | lineage StableKind、vrgr pack、Dhampir、Ancestral Legacy whitelist、既有角色 versioned transformation;雙語與 E2E 已驗收 |
| M01-G — TCE Artificer Core | ✅ | Artificer progression / spellcasting / subclass;multiclass half-caster ceil rounding;雙語與 E2E 已驗收 |
| M01-H — TCE Artificer Advanced Features & Infusions | ✅ | Infusion known vs active state、feature resources、attunement capacity、advanced feature boundary;同步雙語與 E2E 已驗收 |
| M01-I — TCE Optional Class Features & Fighting Styles | ✅ | addition / expanded option pool / replacement / retraining,並補 TCE Fighting Styles;同步雙語與 E2E 已驗收 |
| M01-J — 2014 Class Subclass Expansion | ✅ | PHB / SCAG / XGE / TCE 112 個 subclass identity、xge pack、內容 materialize 進 data/、class-level gate、reprint canonicalization;雙語與 12 職業 E2E 已驗收 |
| M01-K — PHB Feat & Spell Catalog Expansion | ✅ | PHB non-SRD Feats 41/41、Spells 42/42;Feat structural mechanics / prerequisite / nested choices、Spell catalog/access、既有 M01-I/J spell reconcile、跨來源 provenance、雙語與 focused E2E 已驗收 |
| M01-L — VGM & SCAG Remaining Race Expansion / Generic Race Mechanics | ✅ | VGM remaining 10 races + SCAG remaining 2 subraces;generic Race/Subrace movement grant、signed racial modifier compatibility、Natural Armor Rules Layer primitive、racial spell canonical multi-rest recharge、typed runtime automation classification、no-docs runtime gate;雙語與 FC-E2E-21 已驗收 |
| M01-M — MTF Planar Race Expansion & Tiefling Bloodline / Variant System | ✅ | mtf pack、7 個 MTF planar race、Tiefling 9/9 血脈(Asmodeus canonical map + 8 new variants)、SCAG 保守相容、replacement group persistence、Winged conditional movement、Eladrin season State ownership、feature mode default-deny;雙語與 M-E2E-01~05 已驗收 |
| M01-N — Character Sheet HTML Export | ✅ | 角色卡輸出成單向、只給人看的自足 HTML;使用者自選「角色配置」/「當前快照」,含 A4 列印樣式與匯出專屬物品閱讀順序;client-side、不新增 endpoint、永不可 Import |
| M01-O — XGE & TCE Feat Expansion | ✅ | XGE 15 個 Racial Feats + TCE 15 個 Feats;沿用 M01-K Feat acquisition / prerequisite / nested-choice 地基,補 ancestry/size prerequisite、canonical Fighting Style / Invocation / Metamagic option-pool reuse、Feat-granted spells、retraining、Metamagic Adept restricted Sorcery Points、雙語與 focused E2E;Combat/Reaction/Roll 效果不偷跑 P4 |
M01 保持 open。 A~O 是目前已交付的 baseline。下一個未使用字母是 M01-P,沒有預留給「Full M01 Closeout」的字母。
| Subphase | 狀態 | 重點 |
|---|---|---|
| M02-A — Locale Foundation & Runtime Switch | ✅ | 全站單一 locale state、一鍵切換、browser 記憶、不動 Draft / Character domain state |
| M02-B — Full UI Copy Localization | ✅ | 既有 frontend UI copy 全部進 localization resources,含 accessibility text;Builder 七個具名 step 全覆蓋 |
| M02-C — Localized Content Model & Terminology Contract | ✅ | canonical / overlay 邊界、localized resolver、field-level localizable policy、roleplay suggestion identity、glossary 定稿 |
| M02-D — SRD 5.1 Names & Structured Text | ✅ | 依 policy 完成目前 user-visible SRD names / labels / structured text 雙語覆蓋 |
| M02-E — SRD 5.1 User-Visible Descriptions | ✅ | SRD spell / feature / condition data.desc.* zh-TW authoring;canonical-driven coverage / leakage / mechanics / Markdown gates;item / background hidden long-form 延後 |
| M02-F — PHB / SCAG / GoS Localization | ✅ | 依 policy 完成 M01-B / M01-C current-surface non-SRD content;既有繁中 reference 作 priority input |
| M02-G — Localized Search, Errors & Completeness Gates | ✅ | localized search / alias / sort、error code + localized message、policy-driven completeness / orphan guard |
| M02-H — Full M02 Integration & Closeout | ✅ | structured disabled-reason / issue params、全站雙語 crawl + overflow gate、Draft / Character state integrity、translation evidence彙整、doc-sync / CC BY NOTICE |
| Subphase | 狀態 | 重點 |
|---|---|---|
| M03-A — Content Root Path Abstraction & Enabled-Pack SSOT | ✅ | Content / Rules / Localization / DB path resolver、frozen/repo fallback、Settings.enabled_content_packs SSOT、consumer 接線、legacy path static guard、subset unresolved 語意收窄 |
| M03-B — Character JSON Schema, Export & Builder Provenance | ✅ | Character export envelope、完整 version chain / current state、builder_provenance migration 與 versioned draft seed SSOT |
| M03-C — Character JSON Import via Builder Draft | ✅ | JSON preview / validation、StableKey unresolved 分析、new identity import、draft / draft_with_history_loss landing mode |
| M03-D — SQLite Migration Chain Gate & FK PRAGMA | ✅ | SQLite migration chain、foreign key enforcement、standalone DB lifecycle 與 migration compatibility gate |
| M03-E — Standalone Packaging & Launcher | ✅ | app.standalone entry、capability endpoint、SPA fallback、PyInstaller、browser launcher、SQLite beside executable |
| M03-F — Windows CI Build, Release & Import Boundary Test | ✅ | Windows frozen build、artifact flow(本機發版,CI 不建 GitHub Release)、standalone import boundary 與未來 P2 dependency leakage gate |
| M03-G — Full M03 Integration & Closeout | ✅ | web ↔ standalone ↔ standalone JSON round-trip、frozen runtime smoke、雙語 / persistence / migration / capability 全整合 closeout;E.9 乾淨 Windows 11 冷啟動已於 2026-09-06 後續補驗完成 |
| Subphase | 狀態 | 重點 |
|---|---|---|
| P2-A — Room Foundation & Web Entry | ✅ | Room access / Room-first Web landing、Character JSON v1 lock、Alembic shared-vs-web branch split、standalone boundary |
| P2-B — Room Character Workspace | ✅ | Character / Draft Room scope、atomic workspace association、legacy global data claim、Web global Character route收口、Standalone維持 Room-less |
| P2-C — Campaign & Party Roster | ✅ | Campaign lifecycle Owner-only、Room active_campaign_id 與 campaign status 分離、same-Room Roster(idempotent add)、same Character multi-Campaign 共用同一份 Current State、Roster reference 擋 Character permanent delete |
| P2-D — Seat, Controller & Lobby | ✅ | Room authority vs Seat Role vs Controller、DM Seat assignment Owner-only、Human / None controller、Lobby 綁 Room 目前 active Campaign、Player Seat 選角只收 active / inactive Roster、選角收斂只發生在寫入路徑、presence 沿用 P2-A heartbeat;AI shape only,不提前接 P3 |
| P2-E — Session Lifecycle & Late Join | ✅ | Start / End / Abandon、Owner-assigned DM Seat controller 才能 Start、fixed DM Controller(Owner 只能 Abandon 不能接管)、immutable Active Character、Late Join、active_character_session_leases 全域併發保證、active Session 期間的 Character / Builder write scope、Seat / Campaign / Character 的 Session history guard、Resume 只組合既有 truth 不建第二份 snapshot |
| P2-F — Full P2 Integration & Closeout | ✅ | Journey 5/6/7/8 browser 證據、Seat 選角併發的真 PostgreSQL 測試、完整 dataset restart 整合、P2 Non-E2E 補上 windows-standalone 與 test_m03c_migration.py;修掉 Web 從未宣告 session capability 而讓 Session 頁全數被 boundary 擋死的缺陷 |
| Subphase | 狀態 | 重點 |
|---|---|---|
| P3-A — Session Table Runtime & Event Stream | ✅ | durable per-Session runtime、ordered event cursor、Server-side audience filter、initial Resume + incremental sync、restart persistence、async/no-DB-hold event wait與waiter starvation gate、避免P2 Resume N+1變高頻同步 |
| P3-B — Exploration, Chat & Actions | ✅ | Main Stage text/image、最小Room-scoped Stage upload、Dialogue / Action / OOC / Whisper DM / Narration、slash command 收斂成同一 typed input、DM proxy 保存 acting/subject、Whisper Server 過濾、Stage與Chat分離、不建立Scene/Asset Library |
| P3-C — Roll, Check & PendingAction | ✅ | RollGroup / RollRequest / Result、Server RNG、Group / Secret / physical / quick roll、PendingAction、formal roll idempotency、actor-neutral Character State + event atomic boundary;AI resolver留P3-D接線 |
| P3-D — AI Controller, Scoped Token & Handoff | ✅ | typed TableActorContext、P2 Human-only Session/live-write授權入口migration、hashed scoped AI Join Token、Seat current grant + controller_epoch SSOT、Session/Participant grant-generation snapshots與三條CHECK migration、finite-TTL pre-session AI DM grant、origin-only Take Back + Owner/DM admin recovery、Player Human ↔ AI handoff、AI DM可作新Session固定DM Controller |
| P3-E — AI Tool Surface & Event Delivery | ✅ | MCP 2026-07-28 stateless Streamable HTTP入口、shared application services、structured tools/errors、get_pending_events / wait_for_event沿用P3-A async wait、standalone 不掛 /mcp;真 external MCP client HTTPS E1 於 P3-F closeout 由 Claude Code 2.1.260 經 Tailscale HTTPS 執行通過 |
| P3-F — Full P3 Integration & Closeout | ✅ | Human/AI Exploration journeys、secret/group roll、Late Join、AI handoff、AI DM、grant TTL/epoch/Take Back authorization、restart、cross-scope matrix、PostgreSQL concurrency、waiter resource safety、P2 caller regression、standalone / bilingual / full regression closeout;P3 Full-Stack E2E CI run 34587347309 全綠 |
| Subphase | 狀態 | 重點 |
|---|---|---|
| M04-A — Web Chat MCP Preflight | ✅ | 獨立極小 HTTPS 測試 server(tools/m04a-webchat-preflight/,管理 endpoint 只監聽 loopback、request/response 同等遮罩);2026-09-12 以真實 ChatGPT Web Plus 經 Tailscale Funnel 實測 OAuth/DCR、2026-07-28 server/discover → tools/list → tools/call、read/write、role-scoped catalog、Refresh + 新對話的 catalog 更新規則、revoke/reconnect、120 秒 long-poll;目標平台判定 ChatGPT Web Plus,Claude chat 階梯未觸發;結論見 M04-A_PREFLIGHT.md A.7;Closeout CI run 34663200995,Merge Gate E2E 34663806640 |
| M04-B — Adventure Table Web Chat Integration | ✅ | web migration 0021_m04b_ai_oauth(四張 ai_oauth_* 表,standalone 不建);/.well-known/oauth-*、/mcp/oauth/{register,authorize,token,revoke};authorize 頁雙語、只貼 AI Join Token;一張 grant 一個 active family,client_id 非授權識別;access/refresh 都重驗 P3-D authority,grant revoke/Take Back/Session End/Abandon 同 transaction 撤 family;ADVENTURE_TABLE_MCP_PUBLIC_ORIGIN 供 TLS 入口廣播公網 origin;不需相容層、catalog 沿用 P3 role-scoped、wait_for_event 上限維持 60s;2026-09-12 真實 ChatGPT Web Plus 經 Tailscale Funnel 完成 DM 場(narration → wait → Human action → AI 回應 → Abandon → 401 + refresh 400)與 Player 場(handoff → reconnect 同 client_id 新 family → dialogue → request_check → roll_pending → Take Back → 401 + refresh 400);證據見 M04-B_CLOSEOUT.md;CI M04-B Non-E2E Regression run 34673796557 |
| M04-C — AI Join Kit, Server-hosted Guide & Other Client Compatibility | ✅ | GET /mcp/guide(雙語、無需認證、不碰 DB、standalone 不掛);tool description 由 catalog 同源產生且寫明何時被接受,DM catalog 在 start_session 前後相同;get_session_context.briefing 改為強制逐步迴圈(stage → narration → wait_for_event 120 秒 × 最多 5 次)並帶 MCP 呼叫判定規則,stage_unset/next_required_action 機器可讀提示;server/discover.instructions 指向 guide;Lobby/Session 面板產出本機/公網雙 URL 的可複製/下載 AI Join Kit,GET /api/mcp/public-origin;wait_for_event 上限 60 → 120 秒;2026-09-12 真實 ChatGPT Web Plus 憑 kit 進桌(使用者人工),同日回填 request_check 友善 ref normalize(0bbb9fa)、擲骰提示進 Chat(6890811)、E2E reset 改 TRUNCATE CASCADE(e9c310b);Bearer/純 HTTP 路徑與 C.9 相容記錄依使用者拍板延後;證據見 M04-C_CLOSEOUT.md;CI M04-C Non-E2E Regression run 34701747258,P3 Full-Stack E2E run 34703269124 |
| Subphase | 狀態 | 重點 |
|---|---|---|
| U01-A — E2E Database Isolation & Fast Test Foundation | ✅ | 2026-09-14 關門:adventure_table_e2e、server-e2e 8001 / web-e2e 5174、wrong-DB hard guard、p3-e2e.yml 改走同一支 test:e2e:docker(CI 補上 xge-less 第二輪)、歷史 E2E workflow deprecated;CI run 34800987506 全綠,同機主套件 10.1m → 10.1m |
U01 保持 open。 U 類是 Test / Development Efficiency Optimization 長期優化軌,不改寫 P Roadmap;每個 Subphase 使用
docs/Uxx/單檔格式,各自關門並留下證據。
| Subphase | 狀態 | 重點 |
|---|---|---|
| P4-A — Monster & Combatant Foundation | ⬜ | pinned SRD 5.1 Monster corpus 334 / Beast 87、Monster Template / Instance / Combatant、Quick Enemy、locale completeness、enemy secrecy projection、Standalone Template content / multiplayer Instance boundary |
| P4-B — Combat Lifecycle, Initiative & Action Economy | ⬜ | Campaign-scoped durable Combat、initiative / round / turn、Action / Bonus / Reaction、跨 Session resume、Combat End cleanup |
| P4-C — Attack, Damage & Core Action Resolution | ⬜ | P3 formal-roll reuse、Attack / Save / Damage / Healing / Crit、resistance / Temp HP、Grapple / Shove、0 HP / Death Save、atomic idempotent resolve |
| P4-D — Spells, Conditions, Concentration & Reactions | ⬜ | Spell skeleton / upcast、Character + Monster stat-block casting source、2014 Conditions、Temporary Effects、Concentration、ReactionRequest / Ready、Quick OA 由 DM trigger |
| P4-E — Quick Combat UI, DM Adjudication & AI Tool Surface | ⬜ | Session table Quick Combat UX、enemy secrecy UI、range/cover/AoE/OA adjudication、Combat MCP tools、guide / briefing 雙語接線 |
| P4-F — Full P4 Integration & Closeout | ⬜ | browser / restart / Session-boundary / PostgreSQL / standalone / regression closeout + 真實 ChatGPT Web Combat journey |
adventure_table_e2e,不再視為 daily 資料風險。app.standalone不得反向 import多人層。契約見 規格企劃.md 第三、四、五章與 P2 開發設計方針。app.standalone 不得 import app.main 或 P2+ multiplayer modules。P3每新增 multiplayer module / table / MCP route時都必須同步確認 test_m03_import_boundary.py 與 test_m03d_schema_parity.py 的 forbidden coverage;standalone migration只升 character@head,不能把Web multiplayer schema灌進SQLite。schema_version="1" / schema_status="locked" / export_type="character");legacy M03 unstable 仍可由新版本 import並normalize。Room / Campaign / Seat / Session / P3 runtime identity不得塞進Character JSON。live_character_write_scope() 系列,不能另建AI-specific或table-specific bypass;P3-D把現有Human-only RoomAccessContext入口收斂成Human/AI都能resolve的typed TableActorContext,Human Room authority與AI gameplay scope保持分離。controller_epoch;grant generation、Session fixed DM generation、Participant join generation只做snapshot。每個AI request都必須重驗Seat current grant binding + epoch/generation,歷史0013 / 0014不可改寫。Let AI Control保存的exact handoff_return_access_session_id。同Room member、相同display name、新access session都不是可信同一人;原session遺失時由Owner/DM administrative reassignment恢復Player Seat並原子revoke AI + 前進epoch + audit。zh-TW/en;locale 只影響呈現,不改角色/草稿/P3 canonical gameplay data。細則見 AGENTS.md 與 M02 實作規格。ai_controller_grants row,之後與 Bearer AI Join Token 走同一條 P3-D grant/Seat current binding/epoch 驗證;refresh 同樣重驗,refresh token 未過期不構成授權;OAuth 流程對 Seat/Session/Participant 零寫入;一個 authorization 一個 token family 一張 grant,client_id 不是 Seat 授權識別。指引(GET /mcp/guide、tool description、briefing)只描述桌的用法與守則,Adventure/Campaign/NPC context 仍留 P6。| 要找的資訊 | 正式入口 |
|---|---|
| Agent 開工、修改授權、測試 gate、commit/push 與本機工具規則 | AGENTS.md |
| 當前進度、下一步、Roadmap | 本檔 |
| 產品定位、玩法、權限、UI 行為、第一版明確不做 | 規格企劃.md:先搜尋標題,只讀任務相關章節;不要整份讀 |
| 啟動、開發與測試指令 | README.md |
| 基礎技術選型的討論背景 | 技術棧討論.md:不是現行全專案 architecture spec |
| 已確認但尚未修復的問題 | 已知問題.md |
| U 類測試/開發效率優化契約 | docs/U01/U01-A.md(目前已定義 U01-A) |
| 單機版使用說明 | 繁中/English |
各 P / M Phase 的三份正式文件分工:實作規格=完成後必須為真;開發設計方針=具體實作契約;測試指南=驗收方式。 U 類依 AGENTS.md 使用單一 Subphase 文件。實作/驗證某 Subphase 時,讀該段與必要的共用前言,不整批重讀所有 Phase。
| Phase | 實作規格 | 開發設計方針 | 測試指南 |
|---|---|---|---|
| P0 | 規格 | 設計 | 測試 |
| P1 | 規格 | 設計 | 測試 |
| M01 | 規格 | 設計 | 測試 |
| M02 | 規格 | 設計 | 測試 |
| M03 | 規格 | 設計 | 測試 |
| P2 | 規格 | 設計 | 測試 |
| P3 | 規格 | 設計 | 測試 |
| M04 | 規格 | 設計 | 測試 |
| P4 | 規格 | 設計 | 測試 |
歷史完成過程與驗收證據查各 Phase 目錄的 *_CLOSEOUT.md;M01-B 真人創角 Gate 另見 M01-B_HUMAN_GATE.md。最近已完成產品Phase的整合交付見 P2-F_CLOSEOUT.md;P3 Subphase closeout 為 P3-A、P3-B、P3-C、P3-D、P3-E 與 P3-F;P3 整合交付見 P3-F closeout;M04 為 M04-A_PREFLIGHT、M04-B 與 M04-C。
docs/暫用規則資訊/ 是內容 authoring/review input,不是 runtime 資料來源。正式規則與可調數值住 data/,runtime 不解析 docs/;舊文件/ 為歷史封存,接手時忽略。
開場先完整讀 AGENTS.md、本檔與 git log --oneline -10,再依任務定位正式契約。不要把歷史 closeout 的「當時待辦」當成目前未完成事項,也不要因本檔列出下一步就自行開始 coding。