fix(01-03): align Foundry path with pf2e-8.0.3 layout

- Foundry pf2e v8 nests pf2e packs under packs/pf2e/ (v7 had packs/classes/ directly)
- Update FOUNDRY_CLASSES_DIR path to packs/pf2e/classes/
- Document v8 layout in SEED-README and update failure-mode path string
- Pitfall #5 mitigation: comment in seed script explains version-specific path

Worked-example verification (Wizard end-to-end):
- 320 ClassProgression rows seeded (16 classes x 20 levels)
- Wizard L1..L19 carry ARCANE spell-slot increments + L1 has 5 cantrips
- Wizard L1 has choiceType=school, choiceOptionsRef=wizard-school
- 1 ClassFeatureOption row for wizard-school (battle-magic / School of Battle Magic)
- Idempotent on re-run: 0 created, 320 updated, 0 errors
This commit is contained in:
2026-04-27 14:53:46 +02:00
parent e85f790458
commit ce214ab70c
2 changed files with 19 additions and 2 deletions

View File

@@ -28,7 +28,17 @@ import { CLASS_FEATURE_OPTIONS } from './data/class-feature-options';
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL });
const prisma = new PrismaClient({ adapter });
const FOUNDRY_CLASSES_DIR = path.join(__dirname, 'data', 'foundry-pf2e', 'packs', 'classes');
// Foundry pf2e v8 nests packs under a system subdirectory: `packs/pf2e/classes/`.
// (RESEARCH §Pitfall 5: Foundry pf2e data shape may shift across major versions.
// In v7 this was `packs/classes/`. SEED-README pins us to pf2e-8.0.3.)
const FOUNDRY_CLASSES_DIR = path.join(
__dirname,
'data',
'foundry-pf2e',
'packs',
'pf2e',
'classes',
);
// The 16 D-16 classes. Filename in Foundry = lowercase classname.
const D16_CLASS_NAMES = [