Restore reproducible isolated UI fixtures

This commit is contained in:
2026-10-07 20:08:02 -04:00
parent 70185eb98c
commit 5b3e8cb1a3
6 changed files with 632 additions and 1 deletions
+48
View File
@@ -26,6 +26,54 @@ separate database when testing enrollment. HTTP login is for local development;
production agent transport requires HTTPS. See [authentication](../guides/authentication.md)
for access and recovery details.
## Synthetic UI preview
Create a disposable fixture without connecting game hosts:
```sh
fixture_parent=$(mktemp -d "${TMPDIR:-/tmp}/ec-ui.XXXXXX")
npm run seed:fixture -- --db "$fixture_parent/preview/cherry.db" --watch
```
The command prints the generated paths. Leave that terminal open to refresh
synthetic observations every 15 seconds. In a second terminal, load the printed
environment file and start the controller on localhost:
```sh
source /absolute/path/printed/above/preview.env
npm run dev -- --host 127.0.0.1 --port 3000
```
Open `http://127.0.0.1:3000/login`. The private `fixture.json` next to the database
contains the `demo` account's generated password. It is not printed in command
output. To run a fixed snapshot instead of a live feeder, use a fresh directory
and replace `--watch` with `--now 2026-10-07T12:00:00Z`. Domain data is deterministic
for that timestamp; account credentials are always generated separately. Old
snapshots naturally show stale observations when viewed against today's clock.
The fixture contains 3 hosts, 12 canonical Black Ops I/II servers, and 500 match
records: 494 historical and 6 live. It includes solo through four-player squads,
unknown starting counts, enough players and matches to exercise pagination,
rosters, seven days of utilization and capacity samples, and retained Activity
from campaigns, betas, host operations, maintenance, recovery, and autoscaling.
The fleet has 6 live matches, 2 empty lobbies, a preparing server, and 3 problems:
a stopped server, a server not responding, and a server on the offline host.
Script and config downloads contain harmless synthetic text.
`--db` must be an absolute path in a **new directory** whose parent exists. The
seeder refuses existing directories, databases, sidecars and symlinks, and never
uses an inherited `DB_PATH`. It runs the application's database migrations with
isolated paths, without starting the web server or workers. A failed seed removes
only its newly reserved directory. Completed fixtures remain after Ctrl+C.
The preview controller runs its usual local workers. Automatic maintenance and
autoscaling are paused; all seeded operations are terminal. Hostnames, runtime
images, library IDs and credentials are synthetic, so there are no runnable game
files or authenticated agents. Use this environment only for local UI review.
The feeder checks the fixture marker and restores only its known observations,
including the deliberately offline host. Stop both terminals when finished and
remove the generated fixture directory.
## Checks and builds
```sh