Skip to content

Commit ca72ead

Browse files
authored
Merge PR #44: PR_26171_BETA_022-messages-postgres-service-cutover
PR_26171_BETA_022-messages-postgres-service-cutover
2 parents 1b27b0a + c62f16e commit ca72ead

17 files changed

Lines changed: 1411 additions & 1335 deletions

docs_build/database/dml/DML_INDEX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Direct SQL setup is intentionally narrow. Account DEV users now require server-s
1414
| Game Design | `game-design.sql` | Server-seed-owned | Server-side seed API |
1515
| Game Journey | `game-journey.sql` | Server-seed-owned | Server-side seed API |
1616
| Game Hub | `game-workspace.sql` | Server-seed-owned | Server-side seed API |
17-
| Messages | `messages.sql` | Server-seed-owned | Messages Local API/server-side SQLite service |
17+
| Messages | `messages.sql` | Server-seed-owned | Messages Local API/server-side Postgres service |
1818
| Objects | `objects.sql` | Server-seed-owned | Server-side seed API |
1919
| Palette | `palette.sql` | Server-seed-owned | Server-side seed API |
2020
| Support Tickets | `support-tickets.sql` | Server-seed-owned | Admin Site Setup/server-side seed API |

docs_build/database/dml/messages.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
-- Owned tables: messages_categories, messages_emotion_profiles, messages_tts_profiles, messages_records, messages_segments
77

88
-- DML status: Server-seed-owned.
9-
-- Setup is performed through the Messages Local API / server-side SQLite service for this PR.
9+
-- Setup is performed through the Messages Local API / server-side Postgres service for this PR.
1010
-- Browser pages must not seed authoritative records.
1111
-- The server/API layer generates all keys and audit fields.
1212
-- This SQL file intentionally has no direct INSERT statements because direct SQL would bypass key/audit ownership.

docs_build/database/seed/messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
"messages_records": [],
3232
"messages_segments": []
3333
},
34-
"note": "Seed names are applied by the server-side Messages SQLite service. Browser pages must not seed authoritative records."
34+
"note": "Seed names are applied by the server-side Messages Postgres service. Browser pages must not seed authoritative records."
3535
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# PR_26171_BETA_022 Instruction Compliance Checklist
2+
3+
TEAM ownership: BETA.
4+
5+
- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
6+
- PASS: Read `docs_build/dev/PROJECT_MULTI_PC.txt`.
7+
- PASS: Verified Messages belongs to Team Beta ownership.
8+
- PASS: Started from latest `main` before creating `team/BETA/messages`.
9+
- PASS: Scope stayed within Messages Local API/service/tests and directly affected active database docs.
10+
- PASS: Removed active Messages SQLite runtime dependency without touching unrelated SQLite work.
11+
- PASS: Used targeted validation only.
12+
- PASS: Did not run samples.
13+
- PASS: Did not merge.
14+
- PASS: Required shared reports are generated under `docs_build/dev/reports/`.
15+
- PASS: Manual validation notes are present.
16+
- PASS: Repo-structured ZIP is required under `tmp/`.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# PR_26171_BETA_022 Manual Validation Notes
2+
3+
TEAM ownership: BETA.
4+
5+
Manual validation performed:
6+
- Confirmed the Messages page loads through the repo Playwright server with the injected Postgres client stub.
7+
- Confirmed seeded Messages categories, emotion profiles, and TTS profiles are available from `/api/messages/*`.
8+
- Confirmed creating a message preserves `message`, `persistence`, `categoryName`, and `emotionProfileName` response shape fields.
9+
- Confirmed creating a message segment preserves `segment`, `messageName`, and `emotionProfileName` response shape fields.
10+
- Confirmed playback behavior remains covered by the Messages Playwright spec.
11+
- Confirmed active Messages SQLite runtime dependency strings are absent from scoped active paths.
12+
13+
Expected outcome:
14+
- Messages Local API persists through the Postgres service contract.
15+
- Messages tool behavior remains unchanged from the browser user's perspective.
16+
- No `messages.sqlite` file is created or required by the Messages tool tests.
17+
18+
Out of scope:
19+
- Full samples smoke.
20+
- Broad runtime regression suite.
21+
- Production database connectivity against a live Postgres instance.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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.
Lines changed: 34 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,36 @@
1-
# PR_26171_GAMMA_019-admin-workstream-mergeability-recovery changed files
1+
## git status --short
2+
M docs_build/database/dml/DML_INDEX.md
3+
M docs_build/database/dml/messages.sql
4+
M docs_build/database/seed/messages.json
5+
A docs_build/dev/reports/PR_26171_BETA_022-messages-postgres-service-cutover-instruction-compliance-checklist.md
6+
A docs_build/dev/reports/PR_26171_BETA_022-messages-postgres-service-cutover-manual-validation-notes.md
7+
A docs_build/dev/reports/PR_26171_BETA_022-messages-postgres-service-cutover.md
8+
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
9+
M docs_build/dev/reports/playwright_v8_coverage_report.txt
10+
A src/dev-runtime/messages/messages-postgres-service.mjs
11+
D src/dev-runtime/messages/messages-sqlite-service.mjs
12+
M src/dev-runtime/server/local-api-router.mjs
13+
M tests/dev-runtime/DbSeedIntegrity.test.mjs
14+
A tests/helpers/messagesPostgresClientStub.mjs
15+
M tests/helpers/playwrightRepoServer.mjs
16+
M tests/playwright/tools/MessagesTool.spec.mjs
217

3-
Base: origin/main 35b04c02ea54da8b13c10354126f1ee8ddd14a89
4-
Head before recovery merge commit: 1806adbf5df787f7072c6579d23b99bb4257466b
18+
## git diff --cached --stat
19+
docs_build/database/dml/DML_INDEX.md | 2 +-
20+
docs_build/database/dml/messages.sql | 2 +-
21+
docs_build/database/seed/messages.json | 2 +-
22+
...ice-cutover-instruction-compliance-checklist.md | 16 +
23+
...gres-service-cutover-manual-validation-notes.md | 21 +
24+
...1_BETA_022-messages-postgres-service-cutover.md | 39 +
25+
.../dev/reports/coverage_changed_js_guardrail.txt | 32 +-
26+
.../dev/reports/playwright_v8_coverage_report.txt | 91 +-
27+
.../messages/messages-postgres-service.mjs | 1117 +++++++++++++++++++
28+
.../messages/messages-sqlite-service.mjs | 1118 --------------------
29+
src/dev-runtime/server/local-api-router.mjs | 16 +-
30+
tests/dev-runtime/DbSeedIntegrity.test.mjs | 61 +-
31+
tests/helpers/messagesPostgresClientStub.mjs | 83 ++
32+
tests/helpers/playwrightRepoServer.mjs | 6 +-
33+
tests/playwright/tools/MessagesTool.spec.mjs | 39 +-
34+
15 files changed, 1377 insertions(+), 1268 deletions(-)
535

6-
## Changed files against origin/main
7-
M admin/system-health.html
8-
M assets/theme-v2/js/admin-system-health.js
9-
A docs_build/dev/reports/PR_26171_GAMMA_011-admin-system-health-foundation-instruction-compliance-checklist.md
10-
A docs_build/dev/reports/PR_26171_GAMMA_011-admin-system-health-foundation-manual-validation-notes.md
11-
A docs_build/dev/reports/PR_26171_GAMMA_011-admin-system-health-foundation.md
12-
A docs_build/dev/reports/PR_26171_GAMMA_012-admin-system-health-status-reason-cleanup-instruction-compliance-checklist.md
13-
A docs_build/dev/reports/PR_26171_GAMMA_012-admin-system-health-status-reason-cleanup-manual-validation-notes.md
14-
A docs_build/dev/reports/PR_26171_GAMMA_012-admin-system-health-status-reason-cleanup.md
15-
A docs_build/dev/reports/PR_26171_GAMMA_013-admin-system-health-diagnostics-plan-instruction-compliance-checklist.md
16-
A docs_build/dev/reports/PR_26171_GAMMA_013-admin-system-health-diagnostics-plan-manual-validation-notes.md
17-
A docs_build/dev/reports/PR_26171_GAMMA_013-admin-system-health-diagnostics-plan.md
18-
A docs_build/dev/reports/PR_26171_GAMMA_014-admin-postgres-diagnostics-runtime-instruction-compliance-checklist.md
19-
A docs_build/dev/reports/PR_26171_GAMMA_014-admin-postgres-diagnostics-runtime-manual-validation-notes.md
20-
A docs_build/dev/reports/PR_26171_GAMMA_014-admin-postgres-diagnostics-runtime.md
21-
A docs_build/dev/reports/PR_26171_GAMMA_015-admin-r2-diagnostics-runtime-instruction-compliance-checklist.md
22-
A docs_build/dev/reports/PR_26171_GAMMA_015-admin-r2-diagnostics-runtime-manual-validation-notes.md
23-
A docs_build/dev/reports/PR_26171_GAMMA_015-admin-r2-diagnostics-runtime.md
24-
A docs_build/dev/reports/PR_26171_GAMMA_016-admin-runtime-environment-runtime-instruction-compliance-checklist.md
25-
A docs_build/dev/reports/PR_26171_GAMMA_016-admin-runtime-environment-runtime-manual-validation-notes.md
26-
A docs_build/dev/reports/PR_26171_GAMMA_016-admin-runtime-environment-runtime.md
27-
A docs_build/dev/reports/PR_26171_GAMMA_019-admin-workstream-mergeability-recovery.md
28-
M docs_build/dev/reports/codex_changed_files.txt
29-
M docs_build/dev/reports/codex_review.diff
30-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
31-
M docs_build/dev/reports/playwright_v8_coverage_report.txt
32-
M src/dev-runtime/server/local-api-router.mjs
33-
M tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
34-
35-
## Diff stat against origin/main
36-
admin/system-health.html | 366 +--
37-
assets/theme-v2/js/admin-system-health.js | 505 ++--
38-
...-foundation-instruction-compliance-checklist.md | 32 +
39-
...em-health-foundation-manual-validation-notes.md | 34 +
40-
...171_GAMMA_011-admin-system-health-foundation.md | 65 +
41-
...son-cleanup-instruction-compliance-checklist.md | 57 +
42-
...tatus-reason-cleanup-manual-validation-notes.md | 26 +
43-
...12-admin-system-health-status-reason-cleanup.md | 70 +
44-
...ostics-plan-instruction-compliance-checklist.md | 64 +
45-
...lth-diagnostics-plan-manual-validation-notes.md | 27 +
46-
...MMA_013-admin-system-health-diagnostics-plan.md | 82 +
47-
...ics-runtime-instruction-compliance-checklist.md | 64 +
48-
...-diagnostics-runtime-manual-validation-notes.md | 27 +
49-
...GAMMA_014-admin-postgres-diagnostics-runtime.md | 93 +
50-
...ics-runtime-instruction-compliance-checklist.md | 62 +
51-
...-diagnostics-runtime-manual-validation-notes.md | 26 +
52-
...26171_GAMMA_015-admin-r2-diagnostics-runtime.md | 95 +
53-
...ent-runtime-instruction-compliance-checklist.md | 66 +
54-
...-environment-runtime-manual-validation-notes.md | 28 +
55-
..._GAMMA_016-admin-runtime-environment-runtime.md | 102 +
56-
...A_019-admin-workstream-mergeability-recovery.md | 50 +
57-
docs_build/dev/reports/codex_changed_files.txt | 79 +-
58-
docs_build/dev/reports/codex_review.diff | 2696 +++++++++++++++++---
59-
.../dev/reports/coverage_changed_js_guardrail.txt | 28 +
60-
.../dev/reports/playwright_v8_coverage_report.txt | 94 +-
61-
src/dev-runtime/server/local-api-router.mjs | 46 +
62-
.../tools/AdminHealthOperationsPage.spec.mjs | 151 +-
63-
27 files changed, 4034 insertions(+), 1001 deletions(-)
64-
65-
## Validation evidence
66-
- git diff --check: PASS
67-
- git diff --cached --check: PASS
68-
- npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --config=codex_playwright_system_chrome.config.cjs --project=playwright: PASS (3 passed)
69-
- samples smoke: SKIPPED by request
36+
## git diff --stat
83.8 KB
Binary file not shown.

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,9 @@ Missing changed runtime JS files are WARN, not FAIL.
66
Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
77

88
Changed runtime JS files considered:
9-
(0%) assets/theme-v2/js/account-achievements.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10-
(0%) src/dev-runtime/messages/messages-sqlite-service.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
11-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
12-
(0%) src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
13-
(0%) src/dev-runtime/seed/server-seed-loader.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
9+
(0%) src/dev-runtime/messages/messages-postgres-service.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
1410
(0%) src/dev-runtime/server/local-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
15-
(0%) src/shared/toolbox/tool-metadata-inventory.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
16-
(0%) toolbox/controls/controls.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
17-
(0%) toolbox/game-hub/game-hub-api-client.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
18-
(0%) toolbox/game-hub/game-hub.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
19-
(0%) toolbox/game-journey/game-journey.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
20-
(0%) toolbox/idea-board/index.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(0%) toolbox/messages/messages.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
22-
(0%) toolbox/text-to-speech/text2speech.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
23-
(0%) toolbox/tools-page-accordions.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
24-
(74%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 977/977; executed functions 67/90
25-
(90%) assets/theme-v2/js/admin-system-health.js - executed lines 227/227; executed functions 28/31
2611

2712
Guardrail warnings:
28-
(0%) assets/theme-v2/js/account-achievements.js - WARNING: changed runtime JS file missing from coverage; advisory only
29-
(0%) src/dev-runtime/messages/messages-sqlite-service.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
30-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file missing from coverage; advisory only
31-
(0%) src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js - WARNING: changed runtime JS file missing from coverage; advisory only
32-
(0%) src/dev-runtime/seed/server-seed-loader.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
13+
(0%) src/dev-runtime/messages/messages-postgres-service.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
3314
(0%) src/dev-runtime/server/local-api-router.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
34-
(0%) src/shared/toolbox/tool-metadata-inventory.js - WARNING: changed runtime JS file missing from coverage; advisory only
35-
(0%) toolbox/controls/controls.js - WARNING: changed runtime JS file missing from coverage; advisory only
36-
(0%) toolbox/game-hub/game-hub-api-client.js - WARNING: changed runtime JS file missing from coverage; advisory only
37-
(0%) toolbox/game-hub/game-hub.js - WARNING: changed runtime JS file missing from coverage; advisory only
38-
(0%) toolbox/game-journey/game-journey.js - WARNING: changed runtime JS file missing from coverage; advisory only
39-
(0%) toolbox/idea-board/index.js - WARNING: changed runtime JS file missing from coverage; advisory only
40-
(0%) toolbox/messages/messages.js - WARNING: changed runtime JS file missing from coverage; advisory only
41-
(0%) toolbox/text-to-speech/text2speech.js - WARNING: changed runtime JS file missing from coverage; advisory only
42-
(0%) toolbox/tools-page-accordions.js - WARNING: changed runtime JS file missing from coverage; advisory only

0 commit comments

Comments
 (0)