diff --git a/DECISIONS.md b/DECISIONS.md index db78733..f98ff76 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -1782,3 +1782,7 @@ Implementation decisions not spelled out in `memory-bank/implementation-plan.md` ## CR-023 recorded (Shop Time Counts as Rest) - **Numbering:** received as "CR-021 — Shop Time Counts as Rest" for "Phase 21"; stored as **CR-023**, built as **Phase 23** (its 21.n = 23.n), since CR-021 (Independent Pilots) and CR-022 (Welcome Screens) exist. Its decision CR-021.D1 is **0.5.135**. Its references: CR-006 → CR-009, CR-011 → CR-014, CR-019 → CR-021; CR-004 is unchanged. + +## Step 23.1 + +- **The content test compares in game hours**, as the CR asks: shop time is set in real minutes and rest in game hours, so the shop time is multiplied by the time compression first. diff --git a/memory-bank/progress.md b/memory-bank/progress.md index 723f09d..d04c113 100644 --- a/memory-bank/progress.md +++ b/memory-bank/progress.md @@ -510,7 +510,7 @@ Spec: `memory-bank/change-requests/CR-022-welcome-screens.md` (received as "CR-0 Spec: `memory-bank/change-requests/CR-023-shop-time-rest.md` (received as "CR-021 … Phase 21"). New decision recorded as plan §0.5.135. -- [ ] Step 23.1 — Content test +- [x] **Step 23.1 — Content test.** Every upgrade level's shop time, in game hours (real minutes × time compression), is at least `restGameHours`: today 10, 20 and 30 game hours against a 10-hour rest. Test: `packages/content/test/upgrades.test.ts`. - [ ] Step 23.2 — Sim and engine: duty reset on upgrade completion - [ ] Step 23.3 — Client: status line - [ ] Step 23.4 — Regression diff --git a/packages/content/test/upgrades.test.ts b/packages/content/test/upgrades.test.ts index 264e7cd..07f1dad 100644 --- a/packages/content/test/upgrades.test.ts +++ b/packages/content/test/upgrades.test.ts @@ -81,3 +81,14 @@ describe("ship upgrades content (CR-009)", () => { ); }); }); + +describe("shop time counts as rest (Step 23.1, decision 0.5.135)", () => { + it("keeps every upgrade level in the shop for at least a full rest, in game hours", () => { + const { upgradeLevels, timeCompression, restGameHours } = gameConfig; + for (const level of upgradeLevels) { + // Real minutes × compression = game minutes. + const shopGameHours = (level.shopRealMinutes * timeCompression) / 60; + expect(shopGameHours).toBeGreaterThanOrEqual(restGameHours); + } + }); +});