Seed Demo Guests and their decided Games on local and preview stacks #395

Closed
opened 2026-10-14 09:55:42 +00:00 by root · 4 comments
root commented 2026-10-14 09:55:42 +00:00 (Migrated from gitlab.core-project.space)

Parent

#394

What to build

Local and preview databases hold two Demo Guests and their decided Games. Running pnpm dev seeds the local database right after migrating it. db:seed seeds it again on demand. Every preview deploy seeds its stack after migrate, and fails if the seed fails. The seed refuses to run unless DEVTOOLS_ENABLED is exactly true, so production is never seeded. Demo Guest A owns the full ending matrix; Demo Guest B owns one Game that A can read.

This ticket introduces the DEVTOOLS_ENABLED flag:

  • the API config parses it;
  • the preview compose overlay sets it on the seed service;
  • pnpm env:sync writes it into .env.local.

It also adds the glossary term "Demo Guest" and the ADR recording the runtime per-stack gate.

Seam: API integration, through the RPC on the in-process Postgres; and the deploy verification, for the preview's seed step.

Acceptance criteria

  • A unit test replays every demo Game's line through the engine to exactly its stored ending, winner and draw reason, and checks that story 6's matrix is covered.
  • After the seed runs, Demo Guest A's game.list returns its Games in endedAt order, with the expected results.
  • Demo Guest B's Game reads through game.get, and is absent from A's list.
  • Running the seed twice leaves the same rows.
  • The seed refuses when DEVTOOLS_ENABLED is unset, or set to anything but true, naming the flag.
  • The API's dev script seeds after migrate:dev; db:seed and its dev variant exist; the seed prints the Demo Guests and the next steps.
  • up.sh runs the seed service after migrate on preview stacks only, and a non-zero exit fails the deploy.
  • verify.sh accepts the seed container on previews and checks that it exited cleanly; production stays app, db and migrate only.
  • GLOSSARY.md defines Demo Guest, and a new ADR, listed in the index, records that devtools and demo data are gated at runtime per stack.
## Parent #394 ## What to build Local and preview databases hold two Demo Guests and their decided Games. Running `pnpm dev` seeds the local database right after migrating it. `db:seed` seeds it again on demand. Every preview deploy seeds its stack after `migrate`, and fails if the seed fails. The seed refuses to run unless `DEVTOOLS_ENABLED` is exactly `true`, so production is never seeded. Demo Guest A owns the full ending matrix; Demo Guest B owns one Game that A can read. This ticket introduces the `DEVTOOLS_ENABLED` flag: - the API config parses it; - the preview compose overlay sets it on the `seed` service; - `pnpm env:sync` writes it into `.env.local`. It also adds the glossary term "Demo Guest" and the ADR recording the runtime per-stack gate. Seam: API integration, through the RPC on the in-process Postgres; and the deploy verification, for the preview's seed step. ## Acceptance criteria - [ ] A unit test replays every demo Game's line through the engine to exactly its stored ending, winner and draw reason, and checks that story 6's matrix is covered. - [ ] After the seed runs, Demo Guest A's `game.list` returns its Games in `endedAt` order, with the expected results. - [ ] Demo Guest B's Game reads through `game.get`, and is absent from A's list. - [ ] Running the seed twice leaves the same rows. - [ ] The seed refuses when `DEVTOOLS_ENABLED` is unset, or set to anything but `true`, naming the flag. - [ ] The API's `dev` script seeds after `migrate:dev`; `db:seed` and its dev variant exist; the seed prints the Demo Guests and the next steps. - [ ] `up.sh` runs the `seed` service after `migrate` on preview stacks only, and a non-zero exit fails the deploy. - [ ] `verify.sh` accepts the `seed` container on previews and checks that it exited cleanly; production stays app, db and migrate only. - [ ] `GLOSSARY.md` defines **Demo Guest**, and a new ADR, listed in the index, records that devtools and demo data are gated at runtime per stack.
root commented 2026-10-14 09:55:49 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #396

mentioned in issue #396
root commented 2026-10-14 09:56:02 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #394

marked this issue as related to #394
root commented 2026-10-14 09:56:05 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #396

marked this issue as related to #396
root commented 2026-10-14 10:13:39 +00:00 (Migrated from gitlab.core-project.space)

mentioned in merge request !522

mentioned in merge request !522
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-14 11:15:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
amaurycoudr/chess-project#395
No description provided.