Skip to content

Commit ac05e15

Browse files
committed
Recover game journey metrics runtime path
1 parent 7acacc2 commit ac05e15

11 files changed

Lines changed: 587 additions & 1191 deletions
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PR_26177_OWNER_057-game-journey-metrics-regression-recovery Branch Validation
2+
3+
Status: PASS
4+
5+
## Gate
6+
7+
- PASS: Started on `main`.
8+
- PASS: Fetched origin.
9+
- PASS: Pulled `origin/main` with `--ff-only`.
10+
- PASS: Verified worktree clean before branch creation.
11+
- PASS: Verified `main...origin/main` was `0 0` before branch creation.
12+
- PASS: Created `PR_26177_OWNER_057-game-journey-metrics-regression-recovery` from latest `main`.
13+
14+
## Branch Scope
15+
16+
- PASS: Runtime changes are limited to the Game Journey completion metrics store and toolbox accordion Creator-facing wording.
17+
- PASS: Tests are limited to targeted Game Journey completion metrics regression coverage.
18+
- PASS: Did not delete, move, overwrite, export, or migrate `tmp/local-api/game-journey-completion-metrics.sqlite`.
19+
- PASS: Did not start Alfa Tags PRs.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# PR_26177_OWNER_057-game-journey-metrics-regression-recovery Manual Validation Notes
2+
3+
Status: PASS
4+
5+
## Notes
6+
7+
- 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.
11+
- Confirmed the toolbox page renders neutral Creator-facing outage wording when active metrics are unavailable.
12+
- Confirmed the toolbox page does not render the forbidden warning string, SQLite wording, `tmp/local-api`, or Postgres internals in the simulated outage lane.
13+
- Confirmed no Alfa Tags PR work was started.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# PR_26177_OWNER_057-game-journey-metrics-regression-recovery Report
2+
3+
Status: PASS
4+
Branch: PR_26177_OWNER_057-game-journey-metrics-regression-recovery
5+
Date: 2026-06-26
6+
7+
## Scope
8+
9+
Recover the Game Journey completion metrics path so active Alfa and Owner work no longer surfaces the retired legacy SQLite regression. Preserve Postgres-backed Game Journey completion metrics as the active path and prevent Creator-facing UI from rendering the forbidden `Game Journey completion metrics unavailable:` warning.
10+
11+
## Implementation Summary
12+
13+
- 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.
15+
- 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.
17+
- 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.
18+
19+
## Reference Comparison
20+
21+
- Compared the relevant strings in Bravo, Charlie, and Delta reference branches against current main.
22+
- Those branches contained the same legacy-default metrics store and forbidden toolbox warning strings.
23+
- Their non-error behavior depended on the retired SQLite file not being present at the default path.
24+
- This recovery fixes the active behavior directly so the current repo is not sensitive to that retired file.
25+
26+
## Validation
27+
28+
- PASS: `node --check` on modified source and test files.
29+
- PASS: `node ./scripts/run-node-test-files.mjs tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs`.
30+
- 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`.
34+
- PASS: `git diff --check` reported no whitespace errors. Git emitted line-ending warnings only.
35+
36+
## Files
37+
38+
- `src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs`
39+
- `tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs`
40+
- `tests/playwright/tools/GameJourneyTool.spec.mjs`
41+
- `toolbox/tools-page-accordions.js`
42+
43+
## Artifact
44+
45+
- `tmp/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_delta.zip`
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PR_26177_OWNER_057-game-journey-metrics-regression-recovery Requirement Checklist
2+
3+
Status: PASS
4+
5+
- PASS: Hard stop gate verified current branch was `main` before branch creation.
6+
- PASS: Fetched origin.
7+
- PASS: Pulled `origin/main` with `--ff-only`.
8+
- PASS: Verified worktree clean and `main...origin/main` was `0 0`.
9+
- PASS: Created `PR_26177_OWNER_057-game-journey-metrics-regression-recovery`.
10+
- PASS: Compared Alfa/Owner behavior against Bravo/Charlie/Delta reference states.
11+
- PASS: Fixed only the Game Journey completion metrics regression.
12+
- PASS: Did not delete, move, overwrite, export, or migrate `tmp/local-api/game-journey-completion-metrics.sqlite`.
13+
- PASS: Stopped active runtime from defaulting to `tmp/local-api/game-journey-completion-metrics.sqlite`.
14+
- PASS: Preserved Postgres-backed Game Journey completion metrics as the active path.
15+
- PASS: Ensured `toolbox/tools-page-accordions.js` cannot render `Game Journey completion metrics unavailable:`.
16+
- PASS: Creator-facing UI does not expose SQLite, local filesystem paths, migration/export language, or Postgres internals.
17+
- PASS: Did not introduce silent fallback behavior; metrics outage remains visible with neutral wording.
18+
- PASS: Added targeted regression tests.
19+
- PASS: Proved the existing legacy SQLite file does not block active metrics.
20+
- PASS: Proved the forbidden warning string is not rendered.
21+
- PASS: Proved Game Journey metrics still load through the active DB/API path.
22+
- PASS: Used targeted validation only.
23+
- PASS: Required reports were produced.
24+
- PASS: Repo-structured ZIP was produced under `tmp/`.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# PR_26177_OWNER_057-game-journey-metrics-regression-recovery Validation Lane
2+
3+
Status: PASS
4+
5+
## Commands
6+
7+
```powershell
8+
node --check src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs
9+
node --check toolbox/tools-page-accordions.js
10+
node --check tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs
11+
node --check tests/playwright/tools/GameJourneyTool.spec.mjs
12+
```
13+
14+
Result: PASS
15+
16+
```powershell
17+
node ./scripts/run-node-test-files.mjs tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs
18+
```
19+
20+
Result: PASS, 2 targeted node test files passed
21+
22+
```powershell
23+
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"
24+
```
25+
26+
Result: PASS, 2 passed
27+
28+
```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');})"
30+
```
31+
32+
Result: PASS
33+
34+
```powershell
35+
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
37+
```
38+
39+
Result: PASS, no matches
40+
41+
```powershell
42+
git diff --check
43+
```
44+
45+
Result: PASS, line-ending warnings only
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
docs_build/dev/BUILD_PR.md
2-
docs_build/dev/PLAN_PR.md
3-
docs_build/dev/reports/PR_26177_006-shared-time-foundation.md
4-
docs_build/dev/reports/PR_26177_006-shared-time-foundation_branch-validation.md
5-
docs_build/dev/reports/PR_26177_006-shared-time-foundation_closeout.md
6-
docs_build/dev/reports/PR_26177_006-shared-time-foundation_manual-validation-notes.md
7-
docs_build/dev/reports/PR_26177_006-shared-time-foundation_requirement-checklist.md
8-
docs_build/dev/reports/PR_26177_006-shared-time-foundation_validation-lane.md
1+
docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_branch-validation.md
2+
docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_manual-validation-notes.md
3+
docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_report.md
4+
docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_requirement-checklist.md
5+
docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_validation-lane.md
96
docs_build/dev/reports/codex_changed_files.txt
107
docs_build/dev/reports/codex_review.diff
11-
src/shared/time/time.js
12-
tests/shared/TimeFoundation.test.mjs
8+
src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs
9+
tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs
10+
tests/playwright/tools/GameJourneyTool.spec.mjs
11+
toolbox/tools-page-accordions.js

0 commit comments

Comments
 (0)