Skip to content

Commit 6a9bb23

Browse files
committed
Remove active metrics SQLite guard references
1 parent ac05e15 commit 6a9bb23

14 files changed

Lines changed: 497 additions & 415 deletions

docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_branch-validation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ Status: PASS
1717
- PASS: Tests are limited to targeted Game Journey completion metrics regression coverage.
1818
- PASS: Did not delete, move, overwrite, export, or migrate `tmp/local-api/game-journey-completion-metrics.sqlite`.
1919
- PASS: Did not start Alfa Tags PRs.
20+
- PASS: Final audit removed active runtime JS/MJS SQLite and `tmp/local-api` references outside the migration-only utility.

docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_manual-validation-notes.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ Status: PASS
55
## Notes
66

77
- Confirmed the repo-local `tmp/local-api/game-journey-completion-metrics.sqlite` file exists before validation.
8-
- Confirmed active `createGameJourneyCompletionMetricsStore({ postgresClient })` no longer resolves that retired path by default.
9-
- Confirmed active metrics load 14 Postgres-backed completion buckets while the retired file remains untouched.
10-
- Confirmed explicit `legacyDbPath` protection remains covered by the existing migration/regression test file.
8+
- Confirmed active `createGameJourneyCompletionMetricsStore({ postgresClient })` exposes no `legacyDbPath`.
9+
- Confirmed active metrics snapshots expose no `legacySqlitePath`.
10+
- Confirmed active metrics load 14 DB-backed completion buckets while the retired file remains untouched.
11+
- Confirmed active runtime JS/MJS has no SQLite or `tmp/local-api` metrics references outside the migration-only utility.
1112
- Confirmed the toolbox page renders neutral Creator-facing outage wording when active metrics are unavailable.
1213
- Confirmed the toolbox page does not render the forbidden warning string, SQLite wording, `tmp/local-api`, or Postgres internals in the simulated outage lane.
1314
- Confirmed no Alfa Tags PR work was started.

docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_report.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Recover the Game Journey completion metrics path so active Alfa and Owner work n
1111
## Implementation Summary
1212

1313
- Removed active runtime defaulting to `tmp/local-api/game-journey-completion-metrics.sqlite` in `createGameJourneyCompletionMetricsStore`.
14-
- Kept the explicit `legacyDbPath` guard intact for recovery/migration callers so legacy data is still protected from silent overwrite or deletion.
14+
- Removed active runtime `legacyDbPath` guard plumbing from the Game Journey metrics store, repository, Local API router, and Playwright test server helper.
1515
- Updated `toolbox/tools-page-accordions.js` to render neutral Creator-safe progress outage wording instead of backend diagnostics.
16-
- Added a store-level regression test proving a retired default SQLite-shaped file does not block active Postgres-backed metrics.
16+
- Added a store-level regression test proving a retired default SQLite-shaped file does not block or get touched by active DB-backed metrics.
17+
- Added a targeted guardrail test proving active runtime JS/MJS under `src`, `assets`, and `toolbox` has no SQLite or `tmp/local-api` metrics references, excluding the migration-only utility.
1718
- Added a focused Playwright test proving the toolbox page does not render the forbidden warning, SQLite wording, local filesystem path, or Postgres internals when metrics are unavailable.
1819

1920
## Reference Comparison
@@ -28,16 +29,20 @@ Recover the Game Journey completion metrics path so active Alfa and Owner work n
2829
- PASS: `node --check` on modified source and test files.
2930
- PASS: `node ./scripts/run-node-test-files.mjs tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs`.
3031
- PASS: `npx playwright test tests/playwright/tools/GameJourneyTool.spec.mjs --project=playwright --workers=1 --reporter=line -g "Game Journey Local API persists completion metrics to Postgres|Toolbox renders Creator-safe Game Journey progress outage copy"`.
31-
- PASS: Direct proof against the actual existing `tmp/local-api/game-journey-completion-metrics.sqlite` file confirmed active Postgres metrics load 14 buckets and do not resolve a legacy path.
32-
- PASS: Runtime source search found no `Game Journey completion metrics unavailable` string.
33-
- PASS: Runtime source search found no active metrics-store default reference to `game-journey-completion-metrics.sqlite`, `GAMEFOUNDRY_GAME_JOURNEY_METRICS_DB_PATH`, or `defaultLegacySqlitePath`.
32+
- PASS: Direct proof against the actual existing `tmp/local-api/game-journey-completion-metrics.sqlite` file confirmed active DB metrics load 14 buckets, expose no legacy path fields, and do not touch the retired file.
33+
- PASS: Active runtime JS/MJS search found no SQLite, `.sqlite`, `better-sqlite`, `game-journey-completion-metrics.sqlite`, or `tmp/local-api` references outside the migration-only utility.
34+
- PASS: Runtime source search found no `Game Journey completion metrics unavailable` Creator-facing string.
3435
- PASS: `git diff --check` reported no whitespace errors. Git emitted line-ending warnings only.
3536

3637
## Files
3738

3839
- `src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs`
40+
- `src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js`
41+
- `src/dev-runtime/server/local-api-router.mjs`
3942
- `tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs`
43+
- `tests/helpers/playwrightRepoServer.mjs`
4044
- `tests/playwright/tools/GameJourneyTool.spec.mjs`
45+
- `tests/playwright/tools/IdeaBoardTableNotes.spec.mjs`
4146
- `toolbox/tools-page-accordions.js`
4247

4348
## Artifact

docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_requirement-checklist.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ Status: PASS
1111
- PASS: Fixed only the Game Journey completion metrics regression.
1212
- PASS: Did not delete, move, overwrite, export, or migrate `tmp/local-api/game-journey-completion-metrics.sqlite`.
1313
- PASS: Stopped active runtime from defaulting to `tmp/local-api/game-journey-completion-metrics.sqlite`.
14+
- PASS: Removed active runtime `legacyDbPath` SQLite guard plumbing.
1415
- PASS: Preserved Postgres-backed Game Journey completion metrics as the active path.
1516
- PASS: Ensured `toolbox/tools-page-accordions.js` cannot render `Game Journey completion metrics unavailable:`.
1617
- PASS: Creator-facing UI does not expose SQLite, local filesystem paths, migration/export language, or Postgres internals.
1718
- PASS: Did not introduce silent fallback behavior; metrics outage remains visible with neutral wording.
1819
- PASS: Added targeted regression tests.
1920
- PASS: Proved the existing legacy SQLite file does not block active metrics.
21+
- PASS: Proved active runtime JS/MJS has no SQLite or `tmp/local-api` metrics references outside the migration-only utility.
2022
- PASS: Proved the forbidden warning string is not rendered.
2123
- PASS: Proved Game Journey metrics still load through the active DB/API path.
2224
- PASS: Used targeted validation only.

docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_validation-lane.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ Status: PASS
66

77
```powershell
88
node --check src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs
9+
node --check src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js
10+
node --check src/dev-runtime/server/local-api-router.mjs
911
node --check toolbox/tools-page-accordions.js
1012
node --check tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs
13+
node --check tests/helpers/playwrightRepoServer.mjs
1114
node --check tests/playwright/tools/GameJourneyTool.spec.mjs
15+
node --check tests/playwright/tools/IdeaBoardTableNotes.spec.mjs
1216
```
1317

1418
Result: PASS
@@ -17,7 +21,7 @@ Result: PASS
1721
node ./scripts/run-node-test-files.mjs tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs
1822
```
1923

20-
Result: PASS, 2 targeted node test files passed
24+
Result: PASS, 2 targeted node test files passed. Includes active runtime JS/MJS SQLite reference guardrail.
2125

2226
```powershell
2327
npx playwright test tests/playwright/tools/GameJourneyTool.spec.mjs --project=playwright --workers=1 --reporter=line -g "Game Journey Local API persists completion metrics to Postgres|Toolbox renders Creator-safe Game Journey progress outage copy"
@@ -26,14 +30,14 @@ npx playwright test tests/playwright/tools/GameJourneyTool.spec.mjs --project=pl
2630
Result: PASS, 2 passed
2731

2832
```powershell
29-
node -e "import('node:fs').then(async fs=>{const [{createGameJourneyCompletionMetricsStore}, {createGameJourneyCompletionMetricsPostgresClientStub}] = await Promise.all([import('./src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs'), import('./tests/helpers/gameJourneyCompletionMetricsPostgresClientStub.mjs')]); const legacy='tmp/local-api/game-journey-completion-metrics.sqlite'; if(!fs.existsSync(legacy)) throw new Error('Expected existing legacy SQLite file for regression proof'); const store=createGameJourneyCompletionMetricsStore({postgresClient:createGameJourneyCompletionMetricsPostgresClientStub()}); const metrics=await store.listMetrics(); if(store.legacyDbPath) throw new Error('Active store resolved a legacy path'); if(metrics.length!==14) throw new Error('Expected 14 active metrics'); console.log('PASS active Postgres metrics ignore existing retired legacy SQLite file');})"
33+
node -e "import('node:fs').then(async fs=>{const [{createGameJourneyCompletionMetricsStore}, {createGameJourneyCompletionMetricsPostgresClientStub}] = await Promise.all([import('./src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs'), import('./tests/helpers/gameJourneyCompletionMetricsPostgresClientStub.mjs')]); const legacy='tmp/local-api/game-journey-completion-metrics.sqlite'; if(!fs.existsSync(legacy)) throw new Error('Expected existing retired local file for regression proof'); const before=fs.statSync(legacy).mtimeMs; const store=createGameJourneyCompletionMetricsStore({postgresClient:createGameJourneyCompletionMetricsPostgresClientStub()}); const metrics=await store.listMetrics(); const snapshot=await store.snapshot(); const after=fs.statSync(legacy).mtimeMs; if(Object.hasOwn(store, 'legacyDbPath')) throw new Error('Store exposes legacyDbPath'); if(Object.hasOwn(snapshot, 'legacySqlitePath')) throw new Error('Snapshot exposes legacySqlitePath'); if(metrics.length!==14) throw new Error('Expected 14 active metrics'); if(before!==after) throw new Error('Retired local file was touched'); console.log('PASS active DB metrics ignore and do not inspect retired local file');})"
3034
```
3135

3236
Result: PASS
3337

3438
```powershell
39+
rg -n -i "sqlite|better-sqlite|game-journey-completion-metrics\.sqlite|tmp/local-api" src assets toolbox -g "*.js" -g "*.mjs" --glob "!src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs"
3540
rg -n "Game Journey completion metrics unavailable" src assets toolbox --glob "!**/*.map"
36-
rg -n "game-journey-completion-metrics\.sqlite|GAMEFOUNDRY_GAME_JOURNEY_METRICS_DB_PATH|defaultLegacySqlitePath" src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs toolbox/tools-page-accordions.js assets/toolbox/game-journey/js/index.js
3741
```
3842

3943
Result: PASS, no matches

docs_build/dev/reports/codex_changed_files.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recove
66
docs_build/dev/reports/codex_changed_files.txt
77
docs_build/dev/reports/codex_review.diff
88
src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs
9+
src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js
10+
src/dev-runtime/server/local-api-router.mjs
911
tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs
12+
tests/helpers/playwrightRepoServer.mjs
1013
tests/playwright/tools/GameJourneyTool.spec.mjs
11-
toolbox/tools-page-accordions.js
14+
tests/playwright/tools/IdeaBoardTableNotes.spec.mjs

0 commit comments

Comments
 (0)