docs: mark M4 BUG-5 done, move M6 undo to TODO backlog
REWORK_PLAN: M4 → ✅ (slot-array + DRY core, 500 rounds clean). M6 undo
moved to TODO (feature work, not infra). M5 docker: nginx → Caddy
(simpler WS config). Milestone numbering clarified.
TODO: BUG-5 → FIXED. Added FEAT-M6 (transactional undo from plan),
BUG-10 (deact+reactivate double-act, distinct from BUG-5), BUG-11
(FE Combat.scenario pre-existing crash). Pipeline updated.
This commit is contained in:
+18
-21
@@ -121,8 +121,9 @@ Each milestone = independently mergeable PR upstream (unless marked ❌).
|
||||
| 3 | characterization tests lock current behavior | yes |
|
||||
| 4 | resolve initiative rotation corruption (BUG-5) | yes |
|
||||
| 5 | docker compose in-house | smoke |
|
||||
| 6 | undo rework (tx events) | unit |
|
||||
| 6 | _moved to TODO backlog (feature work)_ | - |
|
||||
| 7 | playwright multi-window e2e (deferred) | e2e |
|
||||
| 8 | (future) public exposure | - |
|
||||
|
||||
### Milestone 0 — Repo + branch setup ✅
|
||||
- Fresh branch off `main` (not `dsr-rework`). Name: `rework-backend`.
|
||||
@@ -159,33 +160,29 @@ Each milestone = independently mergeable PR upstream (unless marked ❌).
|
||||
- **Exit criteria:** characterization suite green. Baseline locked. ✅ DONE.
|
||||
- **Upstream-PRable:** ✅ if kept storage-agnostic (tests target turn logic shape).
|
||||
|
||||
### Milestone 4 — Resolve initiative rotation corruption (BUG-5)
|
||||
- **Real bug.** Mid-round add/revive corrupts rotation.
|
||||
- 13 dupes / 100 rounds (deterministic seeded test).
|
||||
- Root cause: `computeTurnOrderAfterAddition` appends id to turnOrderIds
|
||||
end. Round wrap re-sorts by initiative. `currentTurnParticipantId`
|
||||
pointer stale → nextTurn revisits.
|
||||
- RED test locked: `shared/tests/turn.combat.test.js`.
|
||||
- Detail in `TODO.md` BUG-5.
|
||||
- **Exit criteria:** RED green. Rotation invariant holds across
|
||||
add/remove/revive.
|
||||
### Milestone 4 — Resolve initiative rotation corruption (BUG-5) ✅
|
||||
- **Fixed** (commit `494327f`).
|
||||
- Slot-array turn order model + DRY advance core (`nextActiveAfter`).
|
||||
Both `nextTurn` + `computeTurnOrderAfterRemoval` delegate → one advance
|
||||
path, no drift.
|
||||
- 500-round replay: 0 skips, 0 double-acts.
|
||||
- Tests: `turn.skip.test.js`, `turn.dry.test.js` (advance parity lock).
|
||||
- **Upstream-PRable:** ✅ bug fix.
|
||||
|
||||
### Milestone 5 — Docker compose
|
||||
- `docker-compose.yml`:
|
||||
- `backend` service (Node + sqlite volume)
|
||||
- `nginx` service (static frontend + reverse proxy + http basic auth)
|
||||
- `frontend` service (static build served via **Caddy**)
|
||||
- Caddy reverse-proxies `/api` + `/ws` → backend, auto WS upgrade, HTTP basic auth
|
||||
- Caddy chosen over nginx: simpler config, native WS, one file `Caddyfile`.
|
||||
- Profiles: `firebase` (frontend only, current behavior) vs `backend` (full stack).
|
||||
- Run: OrbStack local now; remote docker context later.
|
||||
- **Exit criteria:** `docker compose up` runs full stack in-house.
|
||||
- **Upstream-PRable:** ❌ divergence.
|
||||
|
||||
### Milestone 6 — Undo rework
|
||||
- Events table: every mutating action writes `(type, payload, undo_payload, undone, ts)`.
|
||||
- Undo = apply `undo_payload` in same SQLite tx, flip `undone`. Transactional, no stale clobber.
|
||||
- Replaces current fragile `/logs` snapshot-write undo.
|
||||
- Migration: keep old undo working for existing entries until cleared; new format for new entries.
|
||||
- **Exit criteria:** undo works transactionally; interleaved undos don't corrupt.
|
||||
- **Upstream-PRable:** ⚠️ partial. Turn-logic-level undo = ✅. Backend events table = ❌.
|
||||
### Milestone 6 — Undo rework — _MOVED to TODO backlog_
|
||||
- Moved: feature work (transactional undo), not infra. Lives in `TODO.md` now.
|
||||
- Scope: events table `(type, payload, undo_payload, undone, ts)`; undo = apply undo_payload in tx.
|
||||
|
||||
### Milestone 7 — Playwright E2E (deferred)
|
||||
- Multi-window E2E: DM view + display + player view in separate browser contexts against running backend.
|
||||
@@ -234,7 +231,7 @@ Each milestone = independently mergeable PR upstream (unless marked ❌).
|
||||
| 3 characterization tests | ✅ | if storage-agnostic |
|
||||
| 4 BUG-5 rotation fix | ✅ | bug fix |
|
||||
| 5 docker compose | ❌ | divergence |
|
||||
| 6 undo rework | ⚠️ partial | turn-logic-level ✅, events table ❌ |
|
||||
| 6 undo (moved to TODO) | - | - |
|
||||
| 7 playwright | ✅ | if test infra shared |
|
||||
|
||||
Default `STORAGE=firebase` + `AUTH_MODE=none` (unset) = upstream sees literally zero change.
|
||||
@@ -264,4 +261,4 @@ Default `STORAGE=firebase` + `AUTH_MODE=none` (unset) = upstream sees literally
|
||||
- Backend live: port 4001, db `./data/tracker.sqlite`
|
||||
- Frontend: port 3999 with `REACT_APP_STORAGE=ws`
|
||||
- Test suite: ~160 tests (shared + server + FE). Bugs tracked in `TODO.md`.
|
||||
- Next milestones: M5 docker-compose, M6 undo rework.
|
||||
- Next milestones: M5 docker-compose. Undo moved to TODO backlog.
|
||||
|
||||
Reference in New Issue
Block a user