Skip to content

Commit 520199c

Browse files
committed
Merge PR_26177_OWNER_057-game-journey-metrics-regression-recovery
# Conflicts: # docs_build/dev/reports/codex_changed_files.txt # docs_build/dev/reports/codex_review.diff
2 parents ce0fc8b + 6a9bb23 commit 520199c

15 files changed

Lines changed: 750 additions & 440 deletions
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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.
20+
- PASS: Final audit removed active runtime JS/MJS SQLite and `tmp/local-api` references outside the migration-only utility.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 })` 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.
12+
- Confirmed the toolbox page renders neutral Creator-facing outage wording when active metrics are unavailable.
13+
- Confirmed the toolbox page does not render the forbidden warning string, SQLite wording, `tmp/local-api`, or Postgres internals in the simulated outage lane.
14+
- Confirmed no Alfa Tags PR work was started.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
- Removed active runtime `legacyDbPath` guard plumbing from the Game Journey metrics store, repository, Local API router, and Playwright test server helper.
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 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.
18+
- 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.
19+
20+
## Reference Comparison
21+
22+
- Compared the relevant strings in Bravo, Charlie, and Delta reference branches against current main.
23+
- Those branches contained the same legacy-default metrics store and forbidden toolbox warning strings.
24+
- Their non-error behavior depended on the retired SQLite file not being present at the default path.
25+
- This recovery fixes the active behavior directly so the current repo is not sensitive to that retired file.
26+
27+
## Validation
28+
29+
- PASS: `node --check` on modified source and test files.
30+
- PASS: `node ./scripts/run-node-test-files.mjs tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs`.
31+
- 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"`.
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.
35+
- PASS: `git diff --check` reported no whitespace errors. Git emitted line-ending warnings only.
36+
37+
## Files
38+
39+
- `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`
42+
- `tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs`
43+
- `tests/helpers/playwrightRepoServer.mjs`
44+
- `tests/playwright/tools/GameJourneyTool.spec.mjs`
45+
- `tests/playwright/tools/IdeaBoardTableNotes.spec.mjs`
46+
- `toolbox/tools-page-accordions.js`
47+
48+
## Artifact
49+
50+
- `tmp/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_delta.zip`
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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: Removed active runtime `legacyDbPath` SQLite guard plumbing.
15+
- PASS: Preserved Postgres-backed Game Journey completion metrics as the active path.
16+
- PASS: Ensured `toolbox/tools-page-accordions.js` cannot render `Game Journey completion metrics unavailable:`.
17+
- PASS: Creator-facing UI does not expose SQLite, local filesystem paths, migration/export language, or Postgres internals.
18+
- PASS: Did not introduce silent fallback behavior; metrics outage remains visible with neutral wording.
19+
- PASS: Added targeted regression tests.
20+
- 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.
22+
- PASS: Proved the forbidden warning string is not rendered.
23+
- PASS: Proved Game Journey metrics still load through the active DB/API path.
24+
- PASS: Used targeted validation only.
25+
- PASS: Required reports were produced.
26+
- PASS: Repo-structured ZIP was produced under `tmp/`.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js
10+
node --check src/dev-runtime/server/local-api-router.mjs
11+
node --check toolbox/tools-page-accordions.js
12+
node --check tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs
13+
node --check tests/helpers/playwrightRepoServer.mjs
14+
node --check tests/playwright/tools/GameJourneyTool.spec.mjs
15+
node --check tests/playwright/tools/IdeaBoardTableNotes.spec.mjs
16+
```
17+
18+
Result: PASS
19+
20+
```powershell
21+
node ./scripts/run-node-test-files.mjs tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs
22+
```
23+
24+
Result: PASS, 2 targeted node test files passed. Includes active runtime JS/MJS SQLite reference guardrail.
25+
26+
```powershell
27+
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"
28+
```
29+
30+
Result: PASS, 2 passed
31+
32+
```powershell
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');})"
34+
```
35+
36+
Result: PASS
37+
38+
```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"
40+
rg -n "Game Journey completion metrics unavailable" src assets toolbox --glob "!**/*.map"
41+
```
42+
43+
Result: PASS, no matches
44+
45+
```powershell
46+
git diff --check
47+
```
48+
49+
Result: PASS, line-ending warnings only
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
docs_build/dev/reports/codex_changed_files.txt
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
6+
docs_build/dev/reports/codex_changed_files.txt
27
docs_build/dev/reports/codex_review.diff
3-
docs_build/dev/reports/PR_26177_CHARLIE_008-environment-management-complete.md
4-
docs_build/dev/reports/PR_26177_CHARLIE_008-environment-management-complete_branch-validation.md
5-
docs_build/dev/reports/PR_26177_CHARLIE_008-environment-management-complete_manual-validation-notes.md
6-
docs_build/dev/reports/PR_26177_CHARLIE_008-environment-management-complete_requirements-checklist.md
7-
docs_build/dev/reports/PR_26177_CHARLIE_008-environment-management-complete_validation-lane.md
8+
src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs
9+
src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js
810
src/dev-runtime/server/local-api-router.mjs
9-
tests/dev-runtime/AdminHealthOperations.test.mjs
10-
tests/dev-runtime/PublicEnvironmentConfig.test.mjs
11-
tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
12-
tests/playwright/tools/EnvironmentBannerCoverage.spec.mjs
11+
tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs
12+
tests/helpers/playwrightRepoServer.mjs
13+
tests/playwright/tools/GameJourneyTool.spec.mjs
14+
tests/playwright/tools/IdeaBoardTableNotes.spec.mjs

0 commit comments

Comments
 (0)