docs: canonical database architecture doc, major discovery on staging (#154)
While verifying Section 5 (Production Architecture), a routine staging deploy failed at the migration step. Investigation found staging has been running on a real AWS RDS instance (musehub-staging-db, created 2026-04-05, the same day as the original IAM users) this entire time - not self-hosted Postgres as every doc in this project claimed. The Docker Postgres container everyone assumed was staging's database has been stopped for 2 months with real accumulated data, diverged from RDS.
Investigated the divergence directly rather than assuming: RDS has 28 repos/8 identities/11555 commits, the stopped container has 35 repos/2 identities/2116 commits. 33 of the container's 35 repos are disposable benchmark artifacts from a single 2026-05-13 test run; the only 3 real repos already exist in RDS with their own newer history. Nothing unique is trapped in the stopped container.
Root cause: deploy/secrets.sh only ever knew about DB_PASSWORD, never DATABASE_URL - when it regenerated staging's .env for #156, it silently dropped the RDS connection string. Only didn't break immediately because the already-running container doesn't re-read .env after startup.
Created docs/database-architecture.md as the canonical, secret-free source of truth for DB architecture across all three environments, with a 4-phase plan to standardize on RDS for both staging and production (decided with Gabriel) rather than the self-hosted pattern production currently uses.
Also includes an earlier, unrelated fix: deploy.sh used 'docker rm -f' to stop the old blue/green slot, which sends SIGKILL immediately and never gave the app's lifespan shutdown handler (closes the DB pool, stops the Playwright browser) a chance to run. Changed to 'docker stop --time 15' first so in-flight requests and graceful shutdown actually happen.
Semantic Changes
11 symbols
Files Changed
+1
~1
1061 in snapshot
0 comments
muse hub commit comment sha256:9e73bdc9c63fc86b74f90db1ae47676596d7fcd6e006ace35a1f228dfabfc77d --body "your comment"
No comments yet. Be the first to start the discussion.