|
| 1 | +# PR_26171_BETA_022-messages-postgres-service-cutover |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +TEAM ownership: BETA. |
| 6 | + |
| 7 | +Branch: `team/BETA/messages`. |
| 8 | + |
| 9 | +Scope completed: |
| 10 | +- Replaced the active Messages Local API persistence service with a Postgres-backed implementation. |
| 11 | +- Routed `/api/messages/*` through `createMessagesPostgresService`. |
| 12 | +- Preserved the existing Local API response envelopes for Messages, categories, emotion profiles, TTS profiles, and segments. |
| 13 | +- Removed the active Messages `node:sqlite`, `DatabaseSync`, `messages.sqlite`, and `GAMEFOUNDRY_MESSAGES_SQLITE_PATH` runtime path. |
| 14 | +- Updated targeted Messages Playwright coverage to use an injected Postgres client stub. |
| 15 | +- Updated active Messages DML/seed documentation from SQLite service wording to Postgres service wording. |
| 16 | + |
| 17 | +Compatibility wrapper: |
| 18 | +- No wrapper was kept. Active imports were migrated to `messages-postgres-service.mjs`, and targeted text checks found no remaining active reference to `messages-sqlite-service`. |
| 19 | + |
| 20 | +Postgres authority: |
| 21 | +- The runtime service uses the existing `createPostgresConnectionClient` path, which reads `GAMEFOUNDRY_DATABASE_URL` for the server-side database connection. |
| 22 | +- Tests inject `createMessagesPostgresClientStub()` to preserve deterministic Local API and Playwright behavior without creating a local SQLite file. |
| 23 | + |
| 24 | +## Validation |
| 25 | + |
| 26 | +Passed: |
| 27 | +- `node --test --test-name-pattern "Messages Local API" tests/dev-runtime/DbSeedIntegrity.test.mjs` |
| 28 | +- `npx playwright test tests/playwright/tools/MessagesTool.spec.mjs --config=codex_playwright_system_chrome.config.cjs --project=playwright` |
| 29 | +- `git diff --check` |
| 30 | +- Targeted stale SQLite dependency check across Messages service, Local API router, affected tests, helper stubs, and active Messages docs. |
| 31 | +- Targeted Postgres wiring check for `GAMEFOUNDRY_DATABASE_URL`, `createPostgresConnectionClient`, and Postgres service references. |
| 32 | + |
| 33 | +Skipped: |
| 34 | +- Full samples smoke: out of scope for this Messages Local API cutover. |
| 35 | +- Broad runtime test suite: out of scope; validation was limited to the affected Messages and Local API surfaces. |
| 36 | + |
| 37 | +## Notes |
| 38 | + |
| 39 | +Playwright V8 coverage reports were refreshed by the targeted Messages Playwright run. Server-side runtime files are listed as advisory warnings because browser V8 coverage does not collect Node-side Local API modules. |
0 commit comments