|
| 1 | +# PR_26158_035 Local API URL Guidance Report |
| 2 | + |
| 3 | +## Executive Summary |
| 4 | + |
| 5 | +Updated the static-only login disabled state to tell users exactly how to start and open the API-backed local login server: |
| 6 | + |
| 7 | +`npm run dev:local-api` |
| 8 | + |
| 9 | +`http://127.0.0.1:5501/login.html` |
| 10 | + |
| 11 | +Local Mem and Local DB remain disabled from static-only `127.0.0.1:5500`, and API-backed Local Mem / Local DB behavior is preserved when opened from the correct server URL. |
| 12 | + |
| 13 | +## Implementation |
| 14 | + |
| 15 | +| Area | Change | Evidence | |
| 16 | +| --- | --- | --- | |
| 17 | +| Repo script | Added `dev:local-api` as the repo-owned API-backed local server command. | `package.json` | |
| 18 | +| Local API server entrypoint | Added a small local server wrapper using the existing mock API router and static repo file serving at fixed port `5501`. | `src/dev-runtime/server/local-api-server.mjs`; `scripts/start-local-api-server.mjs` | |
| 19 | +| Login page disabled guidance | Updated the visible static-only disabled message with the exact command and URL. | `login.html`; `assets/theme-v2/js/login-session.js` | |
| 20 | +| Shared static/protected-page diagnostic | Updated the shared static login diagnostic to the same exact command and URL. | `assets/theme-v2/js/gamefoundry-partials.js` | |
| 21 | +| Static Playwright | Added assertions for the exact command and URL in both visible disabled-message locations. | `tests/playwright/tools/StaticOnlyLoginApiRequired.spec.mjs` | |
| 22 | + |
| 23 | +## Server Command Discovery |
| 24 | + |
| 25 | +| Finding | Result | |
| 26 | +| --- | --- | |
| 27 | +| Pre-existing fixed local API-backed login npm script | No fixed user-facing script/port existed before this PR; existing Playwright helpers used ephemeral ports. | |
| 28 | +| Exact repo script established by this PR | `npm run dev:local-api` | |
| 29 | +| Exact API-backed login URL established by this PR | `http://127.0.0.1:5501/login.html` | |
| 30 | +| Server probe | PASS; `/login.html` and `/api/session/current` both returned HTTP 200 from `127.0.0.1:5501`. | |
| 31 | + |
| 32 | +## Requirement Checklist |
| 33 | + |
| 34 | +| Requirement | Evidence | Status | |
| 35 | +| --- | --- | --- | |
| 36 | +| Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` first. | Read before implementation and validation. | PASS | |
| 37 | +| Update static-only login disabled message to include exact local API-backed server start command and URL from repo scripts. | Message now includes `npm run dev:local-api` and `http://127.0.0.1:5501/login.html`; `package.json` owns the command. | PASS | |
| 38 | +| Discover actual npm script and port used by the local API-backed server. | Found no fixed repo script/port; added `dev:local-api` using port `5501` and validated it by server probe. | PASS | |
| 39 | +| Keep Local Mem and Local DB disabled on static-only 5500. | Static Playwright verifies Local Mem and Local DB buttons are disabled and unselected. | PASS | |
| 40 | +| Preserve API-backed Local Mem and Local DB behavior when opened from the correct server URL. | `LoginSessionMode.spec.mjs` passed 5/5. | PASS | |
| 41 | +| Do not add fallback behavior. | Static-only lane verifies no `/api/session/current` or `/api/session/` requests are made and login modes remain unusable from 5500. | PASS | |
| 42 | +| Run changed-file syntax checks. | `node --check` passed for changed JS/MJS/spec files; `package.json` parsed successfully. | PASS | |
| 43 | +| Run LoginSessionMode Playwright with API-backed server running. | `npx playwright test tests/playwright/tools/LoginSessionMode.spec.mjs` passed 5/5. | PASS | |
| 44 | +| Run static-only login Playwright proving disabled buttons and exact guidance are visible. | `npx playwright test tests/playwright/tools/StaticOnlyLoginApiRequired.spec.mjs` passed 1/1 and verifies command/URL text. | PASS | |
| 45 | +| Required reports and review artifacts generated. | This report, `testing_lane_execution_report.md`, V8 coverage report, review diff, changed files, and ZIP artifact generated for PR closeout. | PASS | |
| 46 | + |
| 47 | +## Validation Commands |
| 48 | + |
| 49 | +| Command | Result | |
| 50 | +| --- | --- | |
| 51 | +| `node --check assets/theme-v2/js/login-session.js` | PASS | |
| 52 | +| `node --check assets/theme-v2/js/gamefoundry-partials.js` | PASS | |
| 53 | +| `node --check tests/playwright/tools/StaticOnlyLoginApiRequired.spec.mjs` | PASS | |
| 54 | +| `node --check scripts/start-local-api-server.mjs` | PASS | |
| 55 | +| `node --check src/dev-runtime/server/local-api-server.mjs` | PASS | |
| 56 | +| `node -e "JSON.parse(require('fs').readFileSync('package.json','utf8')); console.log('package.json OK')"` | PASS | |
| 57 | +| Inline `startLocalApiServer` probe for `http://127.0.0.1:5501/login.html` and `/api/session/current` | PASS, both 200 | |
| 58 | +| `npx playwright test tests/playwright/tools/LoginSessionMode.spec.mjs` | PASS, 5/5 | |
| 59 | +| `npx playwright test tests/playwright/tools/StaticOnlyLoginApiRequired.spec.mjs` | PASS, 1/1 | |
| 60 | +| `git diff --check` | PASS, with Git line-ending warnings only | |
| 61 | + |
| 62 | +## Skipped Lanes |
| 63 | + |
| 64 | +| Lane | Decision | Reason | |
| 65 | +| --- | --- | --- | |
| 66 | +| ToolboxRoutePages Playwright | SKIP | No toolbox route/page rendering files were changed. | |
| 67 | +| AdminDbViewer Playwright | SKIP | Admin DB Viewer behavior and DB adapter rendering were not changed. | |
| 68 | +| ProjectJourneyTool Playwright | SKIP | Project Journey files and persistence paths were not changed. | |
| 69 | +| Full samples smoke | SKIP | No samples, sample loader, or shared sample framework changed. | |
| 70 | + |
| 71 | +## Notes |
| 72 | + |
| 73 | +- No CSS was added. |
| 74 | +- No fallback login behavior was added. |
| 75 | +- Existing SQLite experimental warnings and seed-only audit diagnostics appeared during API-backed validation; they were existing runtime diagnostics and did not affect the PR requirement results. |
0 commit comments