Reseed the running verify instance in place on rerun#1817

merged3
main
verify-fast/d3-reseed
opened29d agobyNNick
View on GitHubGitHub import enabledPR last imported 20d ago

Rerunning up.sh tore down vite and Postgres and started both again, so a second look at a change paid the whole start.

Now a rerun in the same mode empties the tables with TRUNCATE and seeds again while vite keeps running. TRUNCATE keeps vite's pooled connections valid, whereas DROP DATABASE makes the next page a 500. The Config Store's migration ledger (config_migration) is kept, so its migrations do not run twice. A running uptime seed is stopped before its signal is cleared.

--fresh, a different mode (BILLING, FAKE_SERVERS), a changed up.sh, a dead fake Hosted DNS, a different port, new dependencies or real Servers still restart everything. up.sh writes the env file, so .verify/run/mode records a hash of it. vite reads the env file and loads the SDK once, and the worker runs the bundle it started with.

Evidence

Interleaved rounds on the same host, each round running main's scripts, then this stack with --fresh (the same full start), then a rerun. Time is from up.sh start to the signed-in /cloud and production page answering.

roundbefore (main)after, full startafter, rerun
1117.4 s (load 21)37.3 s (load 25)30.3 s (load 25)
2123.0 s (load 22)39.0 s (load 26)31.4 s (load 22)
3118.3 s (load 27)65.8 s (load 23)35.1 s (load 27)
median118.3 s39.0 s31.4 s

The round 3 full start is an outlier I did not trace. On a quieter host (load 6) reruns took 25.1, 26.0 and 26.2 s.

A traced rerun shows where the time goes: TRUNCATE 0.5 s, migrate 1.3 s, and seed.ts 36 s at load 28. The seed loads AppRuntime through vite's ssrLoadModule in its own process. Research measured that load at about 5 s on a quieter host, and the rest is the seed's Config Store writes, which this PR leaves alone. The signed-in page answers in under a second after the seed.

After a rerun, doctor.sh reports every check ok and the uptime seed finishes a few seconds later. A rerun after a run that died before the uptime seed (no pid file) also reseeds cleanly.

Restart triggers, checked by vite's pid across reruns on one instance:

  • A plain rerun printed reseeding the running instance, kept vite's pid (228802), and doctor.sh exited 0 with every check ok.
  • After I killed the fake Hosted DNS the instance had started, the rerun started fresh with a new vite (200738 to 211305) and a new Hosted DNS.
  • After appending a blank line to up.sh, the rerun started fresh with a new vite (211305 to 221297) and a new hash in mode.

Checks

10 successful ยท 7 skipped
All checks passed
e30a3b6
Synced from GitHub

Review in Change Stack โ†’

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

โš™๏ธ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5008b1da-8da8-4c90-b5a0-5c8fea761a94
๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between adf9cdf1df814b305c4723d1283f253f8192e6d3 and ddc2fb0a82d1f9afdd6426d19d8136446cbf9ee4.

๐Ÿ“’ Files selected for processing: 2
  • .agents/skills/verify-dashboard/SKILL.md
  • dashboard/scripts/verify/up.sh
ascii
1 _______________________________________________________________________
2< ๐Ÿ’• You had me at 'Hello, World!', but I'm staying for the bug fixes. ๐Ÿ’• >
3 -----------------------------------------------------------------------
4 \
5 \ \
6 \ /\
7 ( )
8 .( o ).
โœจ Finishing Touches
๐Ÿ“ Generate docstrings
  • Commit to this branch
  • Create a new PR
๐Ÿงช Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix ยท Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Synced from GitHub

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
๐Ÿ“ Code Reviewโœ… Completed 2026-10-14T00:24:52.890569Zddc2fb0Draft marked ready
โ„น๏ธ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with ๐Ÿ‘€ while any review is running, comments if it has suggestions, and reacts with ๐Ÿ‘ once all reviews finish with no findings.

Added 3 commits

  • Restart the verify instance when up.sh changed or hosted DNS died011fae0
  • Name every restart trigger of the verify rerune30a3b6
  • Reseed the running verify instance in place on rerune3f84be
Cchatgpt-codex-connectorBotreviewed ยท 3 inline threads29d ago
Synced from GitHub

๐Ÿ’ก Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ddc2fb0a82

โ„น๏ธ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with ๐Ÿ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

dashboard/scripts/verify/up.shlines 55โ€“57Outdated ยท ddc2fb0Open thread
โ€ฆโ€ฆ@@ -13,73 +14,111 @@ dash=$(cd "$(dirname "$0")/../.." && pwd)
54+ # Store's migration ledger stays, as drizzle's does in its own schema, so neither reapplies its migrations.
55+ docker exec "$name" psql -q -v ON_ERROR_STOP=1 -U postgres -d ployz_cloud -c "DO \$\$ BEGIN EXECUTE (SELECT
56+ 'TRUNCATE ' || string_agg(format('%I.%I', schemaname, tablename), ', ') || ' RESTART IDENTITY CASCADE'
57+ FROM pg_tables WHERE schemaname = 'public' AND tablename <> 'config_migration'); END \$\$" > "$run/truncate.log" 2>&1 || { cat "$run/truncate.log" >&2; exit 1; }
Cchatgpt-codex-connectorBoton lines 55โ€“5729d ago

P1 Badge Force open clients to reconnect after reseeding

When a browser tab remains open across a plain rerun, this truncation recreates the user, session, and organization with new UUIDs while Vite and the existing SSE connection remain alive. handleOrgChangesRequest authorizes that stream only once, and orgChangeEvents continues polling the old organization ID; its heartbeats prevent liveStream from reconnecting, so the TanStack collections can keep showing pre-rerun edits instead of the new seed. Force a client reconnect/full refetch, or preserve the identifiers and publish the deletions, before reporting the reseed ready.

AGENTS.md reference: dashboard/AGENTS.md:L3-L3

Useful? React with ๐Ÿ‘ย / ๐Ÿ‘Ž.

dashboard/scripts/verify/up.shlines 33โ€“37Outdated ยท ddc2fb0Open thread
โ€ฆโ€ฆ@@ -13,73 +14,111 @@ dash=$(cd "$(dirname "$0")/../.." && pwd)
34+ && [ "$(cat "$run/mode" 2>/dev/null)" = "$mode" ] && kill -0 "$(cat "$run/vite.pid" 2>/dev/null)" 2>/dev/null \
35+ && kill -0 "$(cat "$run/hosted-dns.pid" 2>/dev/null)" 2>/dev/null \
36+ && [ "$(docker inspect -f '{{.State.Running}}' "$name" 2>/dev/null)" = true ] \
37+ && { [ -z "${1:-}" ] || [ "$1" = "$(sed -n 's/^PORT=//p' "$run/env")" ]; }; then
Cchatgpt-codex-connectorBoton lines 33โ€“3729d ago

P2 Badge Restart when an applied Drizzle migration changes

When an already-applied file under dashboard/drizzle/ is edited or replaced between plain reruns, none of these reuse predicates changes. Because the in-place path preserves Drizzle's migration ledger, the later migrate command skips that file and leaves the running database on the old schema while the current application and seed use the edited schema; the former full restart applied it to a new database. Include the migration contents in the reuse key or force a fresh database when they change.

Useful? React with ๐Ÿ‘ย / ๐Ÿ‘Ž.

dashboard/scripts/verify/up.shline 195Outdated ยท ddc2fb0Open thread
โ€ฆโ€ฆ@@ -152,6 +192,7 @@ while [ "$SECONDS" -lt "$deadline" ]; do
152192 [ -n "$where" ] && break; sleep 0.5
153193done
154194case "$where" in */cloud/$org*) ;; *) echo "up.sh: session check failed: /cloud -> '$where' (see $run/vite.log)" >&2; exit 1 ;; esac
195+if [ -f "$run/idle.pid" ]; then kill -TERM -- "-$(cat "$run/idle.pid")" 2>/dev/null || true; rm -f "$run/idle.pid"; fi
Cchatgpt-codex-connectorBoton line 19529d ago

P2 Badge Stop the idle watchdog before starting the reseed

If up.sh is invoked without a connected browser shortly before the existing idle deadline, the old idle.sh remains active throughout truncation, migration, and the potentially lengthy seed. It can reach its timeout and execute down.sh, deleting the container and run directory underneath this invocation; stopping it here only after the signed-in check is too late. Terminate or reset the watchdog at the beginning of the reuse path.

Useful? React with ๐Ÿ‘ย / ๐Ÿ‘Ž.