Skip to content

fix(server): cross-platform direct-execution guard in seed script (P3.10) - #46

Merged
franciszver merged 2 commits into
mainfrom
fix/p3-10-seed-guard
Jul 24, 2026
Merged

fix(server): cross-platform direct-execution guard in seed script (P3.10)#46
franciszver merged 2 commits into
mainfrom
fix/p3-10-seed-guard

Conversation

@franciszver

Copy link
Copy Markdown
Owner

Closes #45

What

seed.js guarded direct execution with a naive file://${process.argv[1]} string compare that never matches on Windows — node prisma/seed.js exited 0 silently without seeding. Found live during the P3.8 cutover (migrations applied; demo-user login then 401'd). Now uses the pathToFileURL pattern already in src/index.js.

Red-first

Functional red test: spawn node prisma/seed.js with a bogus DATABASE_URL → broken code exits 0 silently (red); fixed code exits non-zero with a Prisma connection error (green — proves the guard fires and the seed actually runs).

Verification

Server suite 20 files / 220 tests. Gates: simplify ✓ / security ✓ (no behavior beyond guard) / deep-review ✓ (both the source-pattern and functional checks).

🤖 Generated with Claude Code

https://claude.ai/code/session_01VVPszGbfxNrVLm5diaCsFr

franciszver and others added 2 commits July 24, 2026 04:43
Co-Authored-By: Claude Code (Haiku) <noreply@anthropic.com>
Co-Authored-By: Claude Code (Haiku) <noreply@anthropic.com>
@franciszver
franciszver merged commit 393ec73 into main Jul 24, 2026
2 checks passed
@franciszver
franciszver deleted the fix/p3-10-seed-guard branch July 24, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P3.10: seed.js run-guard fails silently on Windows

1 participant