Pair every API suite verification with a build
apps/api runs ts-jest with isolatedModules: true, which skips cross-file type checking. Task 3 proved the gap concretely: the suite reported 233/234 green while npm run build reported 21 real errors across 6 files. Every full-suite step now runs test && build, with a Global Constraints note explaining why the build half is not redundant. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- **The API test suite does NOT type-check — always pair it with a build.** `apps/api` runs Jest via `ts-jest` with `isolatedModules: true` (`apps/api/tsconfig.json:7`), which transpiles each file in isolation and skips cross-file type checking entirely. A fully green `npm run test --workspace=@ashen-realms/api` therefore proves nothing about whether the project compiles: when Task 3 removed `Character.level` and friends, the suite reported 233/234 while `npm run build` reported 21 real errors across 6 files. Every full-suite verification step in this plan is written as `npm run test ... && npm run build ...` for this reason — do not drop the build half, and do not treat a green suite alone as a passing gate. (The web side needs no equivalent: Angular's `ng test` builder compiles the whole application bundle before running any spec, so its suite failing on a type error is expected behavior.)
|
||||
|
||||
- Renown range is 1–15 for this vertical slice; `RENOWN_BASE_STATS` (design §5) is the sole source of `baseHp`/`baseAttack` once a milestone changes renown (R2).
|
||||
- Reputation rank thresholds (design §6): 0 Stranger, 100 Tolerated, 250 Known, 500 Recognized, 800 Trusted, 1200 Esteemed.
|
||||
- Normal monster kills never grant Renown directly (spec §2.2, §5) and never grant XP (XP is fully removed, not renamed).
|
||||
@@ -569,7 +571,7 @@ Expected: PASS (8 tests)
|
||||
|
||||
- [ ] **Step 5: Run the full API suite to confirm nothing else broke**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
Expected: This WILL currently fail elsewhere (entities in Task 3 haven't changed yet, so nothing references this migration's new tables/columns) — a clean migration file with no consumers cannot break other tests. Confirm the failure count matches the pre-existing baseline (0 new failures attributable to this migration file).
|
||||
|
||||
- [ ] **Step 6: Commit**
|
||||
@@ -979,7 +981,7 @@ Expected: PASS (9 tests)
|
||||
|
||||
- [ ] **Step 9: Run the full API suite**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
Expected: FAIL — many existing files reference `Character.level`/`.experience`, `ItemDefinition.requiredLevel`, `ItemType.WEAPON`/`.ARMOR`/`.MATERIAL`, and `CombatReward.experienceGranted`/`CombatRewardDto.experience`. This is expected: Tasks 6–10 fix every one of these call sites. Confirm the failures are all `TS2xxx`/property-mismatch errors in files this plan's later tasks touch (`equipment.service.ts`, `combat-reward.service.ts`, `characters.service.ts`, seed files, and their specs) — not in files unrelated to this slice.
|
||||
|
||||
- [ ] **Step 10: Commit**
|
||||
@@ -1442,7 +1444,7 @@ import { RenownModule } from './renown/renown.module';
|
||||
|
||||
- [ ] **Step 8: Run the full API suite**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
Expected: The same pre-existing failures from Task 3's Step 9 remain (nothing in this task touches those files); no new failures.
|
||||
|
||||
- [ ] **Step 9: Commit**
|
||||
@@ -1979,7 +1981,7 @@ Expected: PASS (1 test)
|
||||
|
||||
- [ ] **Step 10: Run the full API suite**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
Expected: Same pre-existing failures from Task 3; no new failures.
|
||||
|
||||
- [ ] **Step 11: Commit**
|
||||
@@ -2609,7 +2611,7 @@ Expected: PASS (3 tests)
|
||||
|
||||
- [ ] **Step 10: Run the full API suite**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
Expected: Same pre-existing failures from Task 3; no new failures.
|
||||
|
||||
- [ ] **Step 11: Commit**
|
||||
@@ -2717,7 +2719,7 @@ Expected: PASS (all tests in this file, no `experience` references remain)
|
||||
|
||||
- [ ] **Step 4: Run the full API suite**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
Expected: Fewer failures than before (this file's contribution to the Task 3 baseline is now resolved); remaining failures are in files Tasks 8–10 fix.
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -2822,7 +2824,7 @@ Expected: PASS
|
||||
|
||||
- [ ] **Step 5: Run the full API suite**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
Expected: Fewer remaining failures; the equipment module's contribution to the Task 3 baseline is resolved.
|
||||
|
||||
- [ ] **Step 6: Commit**
|
||||
@@ -3129,7 +3131,7 @@ Expected: PASS
|
||||
|
||||
- [ ] **Step 9: Run the full API suite**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
Expected: Fewer remaining failures. Any file this task didn't touch that still fails (e.g. `hunting.service.spec.ts`'s `character()`/`monsterDefinition()` fixtures) is Task 10's job.
|
||||
|
||||
- [ ] **Step 10: Commit**
|
||||
@@ -3176,7 +3178,7 @@ This is a sweep task: the exact file list cannot be fully enumerated in advance
|
||||
|
||||
- [ ] **Step 1: Run the full API suite and collect every remaining failure**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
|
||||
Read every failure. Each one falls into exactly one of these categories:
|
||||
|
||||
@@ -3194,7 +3196,7 @@ Apply the rule from Step 1 to every file the suite flags. Do not guess ahead of
|
||||
|
||||
- [ ] **Step 3: Run the full API suite until it is completely green**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
Expected: PASS, zero failures, across all suites.
|
||||
|
||||
- [ ] **Step 4: Grep-verify no residual references remain**
|
||||
@@ -3250,7 +3252,7 @@ Expected: PASS
|
||||
|
||||
- [ ] **Step 4: Run the full API suite**
|
||||
|
||||
Run: `npm run test --workspace=@ashen-realms/api`
|
||||
Run: `npm run test --workspace=@ashen-realms/api && npm run build --workspace=@ashen-realms/api`
|
||||
Expected: PASS, fully green (this is the last API-side task; the suite should have zero failures now).
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
|
||||
Reference in New Issue
Block a user