Skip to content

Commit f1d6b48

Browse files
committed
Plan active SQLite runtime removal
1 parent 1b27b0a commit f1d6b48

7 files changed

Lines changed: 586 additions & 2789 deletions
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
PR_26171_GAMMA_021-sqlite-active-runtime-removal-plan affected files
2+
3+
Fresh-main baseline:
4+
1b27b0a9a3d67821fa586e34d5331567ec6f49b7
5+
6+
Active runtime removal targets:
7+
src/dev-runtime/messages/messages-sqlite-service.mjs
8+
src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs
9+
src/dev-runtime/persistence/mock-db-store.js
10+
11+
Local API removal target:
12+
src/dev-runtime/server/local-api-router.mjs
13+
14+
Direct SQLite test references:
15+
tests/dev-runtime/DbSeedIntegrity.test.mjs
16+
tests/playwright/tools/AdminDbViewer.spec.mjs
17+
tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
18+
tests/playwright/tools/BrowserApiUrlConfig.spec.mjs
19+
tests/playwright/tools/GameJourneyTool.spec.mjs
20+
tests/playwright/tools/LoginSessionMode.spec.mjs
21+
tests/playwright/tools/MessagesTool.spec.mjs
22+
23+
Shared mock-db-store dependency tests:
24+
tests/dev-runtime/AiCreditFoundation.test.mjs
25+
tests/dev-runtime/LegalFoundation.test.mjs
26+
tests/dev-runtime/MarketplaceCategories.test.mjs
27+
tests/dev-runtime/MembershipDataModel.test.mjs
28+
tests/dev-runtime/SupabaseDevAuthTestUserCleanup.test.mjs
29+
tests/dev-runtime/TeamsFoundation.test.mjs
30+
tests/playwright/account/AchievementsPage.spec.mjs
31+
tests/playwright/tools/AdminNotesLocalViewer.spec.mjs
32+
tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs
33+
tests/playwright/tools/AssetToolMockRepository.spec.mjs
34+
tests/playwright/tools/BuildPathProgressSimplification.spec.mjs
35+
tests/playwright/tools/GameHubMockRepository.spec.mjs
36+
tests/playwright/tools/IdeaBoardTableNotes.spec.mjs
37+
tests/playwright/tools/InputMappingV2Tool.spec.mjs
38+
tests/playwright/tools/PaletteToolMockRepository.spec.mjs
39+
tests/playwright/tools/RootToolsFutureState.spec.mjs
40+
tests/playwright/tools/TagsTool.spec.mjs
41+
tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs
42+
tests/playwright/tools/ToolboxRoutePages.spec.mjs
43+
44+
Active docs/data references:
45+
docs_build/dev/PROJECT_INSTRUCTIONS.md
46+
docs_build/database/dml/DML_INDEX.md
47+
docs_build/database/dml/messages.sql
48+
docs_build/database/seed/messages.json
49+
50+
Explicitly excluded archive/reference paths:
51+
docs_build/dev/reports/**
52+
docs_build/pr/**
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# PR_26171_GAMMA_021 Follow-Up PR Sequence
2+
3+
## 1. Messages Database Cutover
4+
5+
Owner: Team Beta
6+
7+
Purpose:
8+
- Replace `src/dev-runtime/messages/messages-sqlite-service.mjs`.
9+
- Keep the Messages Local API contract stable.
10+
- Move message categories, messages, emotion profiles, and TTS profile persistence to Postgres.
11+
- Update `docs_build/database/dml/messages.sql`, `docs_build/database/seed/messages.json`, and Messages tests.
12+
13+
Suggested validation:
14+
- `git diff --check`
15+
- targeted Messages Local API tests
16+
- `tests/playwright/tools/MessagesTool.spec.mjs`
17+
- no samples unless Messages API behavior is consumed by samples
18+
19+
## 2. Game Journey Metrics Database Cutover
20+
21+
Owner: Team Alpha
22+
23+
Purpose:
24+
- Replace `src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs`.
25+
- Preserve current Game Journey completion metrics response shape.
26+
- Use Postgres through `GAMEFOUNDRY_DATABASE_URL`.
27+
- Update Game Journey tests that currently assert SQLite engine metadata.
28+
29+
Suggested validation:
30+
- `git diff --check`
31+
- targeted Game Journey Local API tests
32+
- `tests/playwright/tools/GameJourneyTool.spec.mjs`
33+
- no samples unless Game Journey sample behavior is directly affected
34+
35+
## 3. Shared Dev Database Adapter Cleanup
36+
37+
Owner: Master Control assignment required
38+
39+
Purpose:
40+
- Split shared schema/key constants from `src/dev-runtime/persistence/mock-db-store.js`.
41+
- Remove active Local DB/SQLite adapter wording from session metadata.
42+
- Preserve compatibility for current mock repository imports until owner-assigned tool migrations land.
43+
44+
Suggested validation:
45+
- `git diff --check`
46+
- targeted dev-runtime schema tests
47+
- only affected tool Playwright specs whose fixtures import the changed contract
48+
49+
## 4. Local API SQLite Metadata Removal
50+
51+
Owner: Team Gamma coordination, with Alpha/Beta route owners for implementation details
52+
53+
Purpose:
54+
- Remove SQLite imports and constructor wiring from `src/dev-runtime/server/local-api-router.mjs`.
55+
- Remove SQLite database engine metadata after replacement services are live.
56+
- Keep Admin System Health diagnostics Postgres-only.
57+
58+
Suggested validation:
59+
- `git diff --check`
60+
- targeted Local API startup tests
61+
- targeted Admin System Health validation
62+
- targeted Messages and Game Journey validation
63+
64+
## 5. Final Guard Cleanup And Inventory
65+
66+
Owner: Team Gamma
67+
68+
Purpose:
69+
- Update `scripts/validate-browser-env-agnostic.mjs` technical-debt notes after active SQLite removal.
70+
- Run a fresh inventory.
71+
- Confirm remaining SQLite references are only governance docs or archive/reference reports.
72+
73+
Suggested validation:
74+
- `git diff --check`
75+
- targeted static/script validation
76+
- final SQLite inventory report
77+
- no Playwright unless runtime JavaScript changes
78+
- no samples
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# PR_26171_GAMMA_021 Instruction Compliance Checklist
2+
3+
- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
4+
- PASS: Read `docs_build/dev/PROJECT_MULTI_PC.txt`.
5+
- PASS: PR name includes required TEAM token: `GAMMA`.
6+
- PASS: TEAM ownership matches Gamma governance/diagnostics planning scope.
7+
- PASS: Started from clean `main`.
8+
- PASS: Fast-forwarded `team/GAMMA/admin` to fresh `main` before edits.
9+
- PASS: Scope is report-only planning; no runtime code removed.
10+
- PASS: Archive/reference report history is excluded.
11+
- PASS: Validation scope is docs/static only.
12+
- PASS: Playwright skipped with documented reason.
13+
- PASS: Samples skipped with documented reason.
14+
- PASS: ZIP required under `tmp/`.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PR_26171_GAMMA_021 Manual Validation Notes
2+
3+
## Checks
4+
5+
- PASS: Fresh-main SQLite inventory was reviewed from commit `1b27b0a9a3d67821fa586e34d5331567ec6f49b7`.
6+
- PASS: Active runtime references were classified.
7+
- PASS: Local API references were classified.
8+
- PASS: Direct SQLite test references were identified.
9+
- PASS: Shared `mock-db-store.js` dependency tests were identified separately from literal SQLite hits.
10+
- PASS: Active docs/data references were identified.
11+
- PASS: Archive/reference report history under `docs_build/dev/reports/**` and `docs_build/pr/**` was explicitly excluded from removal.
12+
- PASS: No SQLite code was removed.
13+
- PASS: No archive reports were touched.
14+
- PASS: Playwright and samples were skipped because this is a docs/report-only planning PR.
15+
16+
## Validation Commands
17+
18+
- `git diff --check`
19+
- Targeted text verification for active SQLite classification
20+
- Targeted text verification for archive/reference exclusion
21+
22+
## Notes
23+
24+
The inventory distinguishes the two true `node:sqlite` active runtime services from `mock-db-store.js`, which is shared dev-runtime metadata but still carries active SQLite adapter wording.
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# PR_26171_GAMMA_021-sqlite-active-runtime-removal-plan
2+
3+
## Summary
4+
5+
This report creates a focused removal plan for active SQLite references found on fresh `main` after PR #36 merged.
6+
7+
Fresh-main baseline:
8+
- Branch: `team/GAMMA/admin`
9+
- Fresh main commit used for inventory: `1b27b0a9a3d67821fa586e34d5331567ec6f49b7`
10+
- Inventory command: `rg -i "sqlite|better-sqlite|sqlite3|\\.sqlite|sql\\.js"`
11+
- Raw inventory excluding generated diff noise: 130 files, 358 matching lines
12+
13+
This PR does not remove code, change runtime behavior, touch archive reports, run Playwright, or run samples.
14+
15+
## Active Classification
16+
17+
### Active Runtime
18+
19+
- `src/dev-runtime/messages/messages-sqlite-service.mjs`
20+
- Classification: active runtime
21+
- Current state: uses `node:sqlite`, `DatabaseSync`, `GAMEFOUNDRY_MESSAGES_SQLITE_PATH`, and `tmp/messages/messages.sqlite`.
22+
- Replacement path: replace with a Postgres-backed Messages database service using `GAMEFOUNDRY_DATABASE_URL` and the existing Local API message contracts. Prefer a vendor-neutral active service name such as `messages-database-service.mjs`; if a compatibility wrapper is needed, keep it temporary and log the deprecated name.
23+
24+
- `src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs`
25+
- Classification: active runtime
26+
- Current state: uses `node:sqlite`, `DatabaseSync`, `GAMEFOUNDRY_GAME_JOURNEY_METRICS_DB_PATH`, and `tmp/local-api/game-journey-completion-metrics.sqlite`.
27+
- Replacement path: move completion metrics reads/writes to the authoritative Postgres connection path using `GAMEFOUNDRY_DATABASE_URL`. Keep the current Local API response shape stable while replacing the storage implementation.
28+
29+
- `src/dev-runtime/persistence/mock-db-store.js`
30+
- Classification: active runtime / allowed technical debt
31+
- Current state: shared dev-runtime schema and seed metadata; it does not import `node:sqlite`, but its active session adapter metadata still says `LocalDbAdapter backed by server SQLite storage`.
32+
- Replacement path: split shared schema/seed constants from persistence-provider labeling, then replace Local DB/SQLite-facing adapter copy with a Postgres-backed or neutral dev database adapter description. Preserve existing `MOCK_DB_KEYS` consumers until owner-assigned follow-up PRs migrate each tool surface.
33+
34+
### Local API
35+
36+
- `src/dev-runtime/server/local-api-router.mjs`
37+
- Classification: local API
38+
- Current state: imports `createMessagesSqliteService`, constructs the Messages SQLite service, and returns SQLite database engine metadata for remaining local routes.
39+
- Replacement path: inject the Postgres-backed Messages service and Game Journey metrics service through existing safe Local API contracts. Remove SQLite engine metadata only after the replacement services are available and targeted tests prove the same API response shapes.
40+
41+
### Tests
42+
43+
Direct SQLite tests:
44+
- `tests/playwright/tools/MessagesTool.spec.mjs`
45+
- `tests/playwright/tools/GameJourneyTool.spec.mjs`
46+
- `tests/dev-runtime/DbSeedIntegrity.test.mjs`
47+
- `tests/playwright/tools/LoginSessionMode.spec.mjs`
48+
- `tests/playwright/tools/BrowserApiUrlConfig.spec.mjs`
49+
- `tests/playwright/tools/AdminDbViewer.spec.mjs`
50+
- `tests/playwright/tools/AdminHealthOperationsPage.spec.mjs`
51+
52+
Shared `mock-db-store.js` dependency tests that may need updates when the adapter label or constants split changes:
53+
- `tests/dev-runtime/AiCreditFoundation.test.mjs`
54+
- `tests/dev-runtime/LegalFoundation.test.mjs`
55+
- `tests/dev-runtime/MarketplaceCategories.test.mjs`
56+
- `tests/dev-runtime/MembershipDataModel.test.mjs`
57+
- `tests/dev-runtime/SupabaseDevAuthTestUserCleanup.test.mjs`
58+
- `tests/dev-runtime/TeamsFoundation.test.mjs`
59+
- `tests/playwright/account/AchievementsPage.spec.mjs`
60+
- `tests/playwright/tools/AdminNotesLocalViewer.spec.mjs`
61+
- `tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs`
62+
- `tests/playwright/tools/AssetToolMockRepository.spec.mjs`
63+
- `tests/playwright/tools/BuildPathProgressSimplification.spec.mjs`
64+
- `tests/playwright/tools/GameHubMockRepository.spec.mjs`
65+
- `tests/playwright/tools/IdeaBoardTableNotes.spec.mjs`
66+
- `tests/playwright/tools/InputMappingV2Tool.spec.mjs`
67+
- `tests/playwright/tools/PaletteToolMockRepository.spec.mjs`
68+
- `tests/playwright/tools/RootToolsFutureState.spec.mjs`
69+
- `tests/playwright/tools/TagsTool.spec.mjs`
70+
- `tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs`
71+
- `tests/playwright/tools/ToolboxRoutePages.spec.mjs`
72+
73+
### Docs
74+
75+
- `docs_build/dev/PROJECT_INSTRUCTIONS.md`
76+
- Keep as authoritative deprecation governance.
77+
- `docs_build/database/dml/DML_INDEX.md`
78+
- `docs_build/database/dml/messages.sql`
79+
- `docs_build/database/seed/messages.json`
80+
- Update in the Messages Postgres cutover PR so seed/setup wording no longer references the server-side Messages SQLite service.
81+
82+
### Archive/Reference
83+
84+
Historical report and PR history under these paths is explicitly excluded from removal:
85+
- `docs_build/dev/reports/**`
86+
- `docs_build/pr/**`
87+
88+
Archive/reference history may continue to mention SQLite for traceability. Do not rewrite old reports unless a future governance PR explicitly scopes archival cleanup.
89+
90+
## Required Follow-Up PR Sequence
91+
92+
1. Messages database cutover
93+
- Owner: Team Beta
94+
- Scope: replace `messages-sqlite-service.mjs` with a Postgres-backed Messages service, keep current Local API endpoints stable, migrate message seed/setup docs, and update `MessagesTool.spec.mjs`.
95+
- Validation: targeted Messages Local API and Messages Playwright coverage; no samples unless the changed API contract affects samples.
96+
97+
2. Game Journey completion metrics database cutover
98+
- Owner: Team Alpha
99+
- Scope: replace `game-journey-completion-metrics-store.mjs` with a Postgres-backed metrics store and update Game Journey completion tests.
100+
- Validation: targeted Game Journey Local API and Game Journey Playwright coverage; no full suite unless shared runtime behavior expands.
101+
102+
3. Shared dev database adapter label and schema split
103+
- Owner: Master Control assignment required because `mock-db-store.js` is shared across Alpha/Beta/Gamma surfaces.
104+
- Scope: split schema/key constants from persistence adapter labeling, remove Local DB/SQLite wording from active adapter metadata, and update affected tests by ownership lane.
105+
- Validation: targeted dev-runtime schema tests plus only the tool Playwright lanes whose fixtures import the changed contract.
106+
107+
4. Local API SQLite metadata removal
108+
- Owner: Team Gamma for diagnostics/governance coordination, with Alpha/Beta implementation owners for affected routes.
109+
- Scope: remove SQLite imports, constructor wiring, and database engine metadata from `local-api-router.mjs` after replacement services have landed.
110+
- Validation: targeted Local API startup, Admin System Health diagnostics, Messages, and Game Journey lanes.
111+
112+
5. Guard cleanup and final inventory
113+
- Owner: Team Gamma
114+
- Scope: update `scripts/validate-browser-env-agnostic.mjs` technical-debt notes, rerun the active SQLite inventory, and confirm only governance docs and archive/reference reports remain.
115+
- Validation: `git diff --check`, targeted script/static validation, final inventory report.
116+
117+
## Manual Validation Notes
118+
119+
- Confirmed the plan targets only active runtime, Local API, test, and active docs/data references.
120+
- Confirmed archive/reference report history is excluded.
121+
- Confirmed no code was removed.
122+
- Confirmed no runtime behavior was changed.
123+
- Confirmed Postgres remains the replacement direction.
124+
125+
## Skipped Validation
126+
127+
- Playwright skipped: docs/report-only planning PR.
128+
- Samples skipped: no sample files or sample runtime behavior changed.

0 commit comments

Comments
 (0)