✅ Frontend contract test passes: npm test -- --run tests/lobby-i18n.contract.test.ts
⚠️ Backend check blocked in this runner: creating local venv + pip install -r requirements.txt fails building mysqlclient (missing pkg-config/MySQL dev libs), so python3 manage.py test lobby.tests.I18nResolverTests cannot run here.
Concrete next action: run backend test in CI/runner image with MySQL client build deps installed (or provide prebuilt wheel/alt backend requirements) and confirm lobby.tests.I18nResolverTests green.
Check report update:
- ✅ Frontend contract test passes: `npm test -- --run tests/lobby-i18n.contract.test.ts`
- ⚠️ Backend check blocked in this runner: creating local venv + `pip install -r requirements.txt` fails building `mysqlclient` (missing pkg-config/MySQL dev libs), so `python3 manage.py test lobby.tests.I18nResolverTests` cannot run here.
Concrete next action: run backend test in CI/runner image with MySQL client build deps installed (or provide prebuilt wheel/alt backend requirements) and confirm `lobby.tests.I18nResolverTests` green.
[blocker] The new shared backend→frontend key-map in shared/i18n/lobby.json is not actually consumed by frontend runtime code. frontend/src/spa/lobby-i18n.ts still only accepts error_code values that are direct frontend keys (isFrontendErrorKey(code)), then falls back to caller key. This means the contract map is documentation/test-only and can drift without runtime enforcement.
Concrete fix: in lobbyMessageFromApiPayload, resolve error_code through contract.backend_to_frontend_error_keys first, then validate/use the mapped frontend key.
Add/adjust a frontend test that would fail without reading contract.backend_to_frontend_error_keys (e.g. assert mapping path is used explicitly, not fallback path).
[nice-to-have] Backend verification command in docs uses python manage.py ...; in this environment python3 is required. If this is expected in CI/dev, no change needed; otherwise consider documenting python3/venv activation to reduce friction.
What I validated:
Shared contract exists in one artifact (shared/i18n/lobby.json) and includes ownership + locale contract (default en, supported en/da, fallback rule) with da/en examples in docs.
✅frontend: npm test -- --run tests/lobby-i18n.contract.test.ts
⚠️ Backend Django tests could not run in this runner because Django is not installed in current runtime.
Review for issue #226 acceptance.
- [blocker] The new shared backend→frontend key-map in `shared/i18n/lobby.json` is not actually consumed by frontend runtime code. `frontend/src/spa/lobby-i18n.ts` still only accepts `error_code` values that are direct frontend keys (`isFrontendErrorKey(code)`), then falls back to caller key. This means the contract map is documentation/test-only and can drift without runtime enforcement.
- Concrete fix: in `lobbyMessageFromApiPayload`, resolve `error_code` through `contract.backend_to_frontend_error_keys` first, then validate/use the mapped frontend key.
- Add/adjust a frontend test that would fail without reading `contract.backend_to_frontend_error_keys` (e.g. assert mapping path is used explicitly, not fallback path).
- [nice-to-have] Backend verification command in docs uses `python manage.py ...`; in this environment `python3` is required. If this is expected in CI/dev, no change needed; otherwise consider documenting `python3`/venv activation to reduce friction.
What I validated:
- Shared contract exists in one artifact (`shared/i18n/lobby.json`) and includes ownership + locale contract (default `en`, supported `en/da`, fallback rule) with da/en examples in docs.
- Change appears mergeable independently from host/player UI migration (touches shared catalog/docs/tests only).
Checks run:
- ✅ `frontend: npm test -- --run tests/lobby-i18n.contract.test.ts`
- ⚠️ Backend Django tests could not run in this runner because Django is not installed in current runtime.
Implemented requested runtime key-map usage fix in frontend/src/spa/lobby-i18n.ts and added test coverage proving mapping is consumed at runtime (not fallback-masked).
What changed
lobbyMessageFromApiPayload now resolves backend error_code via contract.backend_to_frontend_error_keys first.
Keeps direct frontend-key compatibility as secondary path.
Falls back to caller fallback key only when neither mapped nor direct key is valid.
Updated frontend/tests/lobby-i18n.contract.test.ts mapping test to use a different fallback key (start_round_failed) so success proves runtime map usage.
Tests run
npm --prefix frontend test -- lobby-i18n.contract.test.ts✅
npm --prefix frontend test✅
Head
New commit: a222a3368b1648e1a0fc64e0fee30ba97789569a
Implemented requested runtime key-map usage fix in `frontend/src/spa/lobby-i18n.ts` and added test coverage proving mapping is consumed at runtime (not fallback-masked).
### What changed
- `lobbyMessageFromApiPayload` now resolves backend `error_code` via `contract.backend_to_frontend_error_keys` first.
- Keeps direct frontend-key compatibility as secondary path.
- Falls back to caller fallback key only when neither mapped nor direct key is valid.
- Updated `frontend/tests/lobby-i18n.contract.test.ts` mapping test to use a different fallback key (`start_round_failed`) so success proves runtime map usage.
### Tests run
- `npm --prefix frontend test -- lobby-i18n.contract.test.ts` ✅
- `npm --prefix frontend test` ✅
### Head
- New commit: `a222a3368b1648e1a0fc64e0fee30ba97789569a`
- PR branch head: `a222a3368b1648e1a0fc64e0fee30ba97789569a`
Re-review on head a222a3368b1648e1a0fc64e0fee30ba97789569a complete.
Findings:
[SEV-0] ✅ Prior blocker resolved: runtime now consumes contract.backend_to_frontend_error_keys in frontend/src/spa/lobby-i18n.ts (mappedKey = backendToFrontendErrorKeys[code]) before direct key/fallback resolution.
[SEV-0] ✅ Regression coverage present: frontend/tests/lobby-i18n.contract.test.ts includes uses shared backend→frontend key-map at runtime even when fallback key differs, proving mapped key wins over caller fallback.
No remaining blockers for this PR head. Approving.
Re-review on head `a222a3368b1648e1a0fc64e0fee30ba97789569a` complete.
Findings:
- [SEV-0] ✅ Prior blocker resolved: runtime now consumes `contract.backend_to_frontend_error_keys` in `frontend/src/spa/lobby-i18n.ts` (`mappedKey = backendToFrontendErrorKeys[code]`) before direct key/fallback resolution.
- [SEV-0] ✅ Regression coverage present: `frontend/tests/lobby-i18n.contract.test.ts` includes `uses shared backend→frontend key-map at runtime even when fallback key differs`, proving mapped key wins over caller fallback.
- [SEV-0] ✅ Validation run: `npm test -- --run tests/lobby-i18n.contract.test.ts` passed (6/6).
No remaining blockers for this PR head. Approving.
Re-review findings for head a222a3368b1648e1a0fc64e0fee30ba97789569a:
[SEV-0] ✅ Prior blocker resolved: runtime now consumes contract.backend_to_frontend_error_keys in frontend/src/spa/lobby-i18n.ts (mappedKey = backendToFrontendErrorKeys[code]) before direct key/fallback resolution.
[SEV-0] ✅ Regression coverage present: frontend/tests/lobby-i18n.contract.test.ts includes uses shared backend→frontend key-map at runtime even when fallback key differs, proving mapped key wins over caller fallback.
Re-review findings for head `a222a3368b1648e1a0fc64e0fee30ba97789569a`:
- [SEV-0] ✅ Prior blocker resolved: runtime now consumes `contract.backend_to_frontend_error_keys` in `frontend/src/spa/lobby-i18n.ts` (`mappedKey = backendToFrontendErrorKeys[code]`) before direct key/fallback resolution.
- [SEV-0] ✅ Regression coverage present: `frontend/tests/lobby-i18n.contract.test.ts` includes `uses shared backend→frontend key-map at runtime even when fallback key differs`, proving mapped key wins over caller fallback.
- [SEV-0] ✅ Validation run: `npm test -- --run tests/lobby-i18n.contract.test.ts` passed (6/6).
No remaining blockers on this head.
Integrator gate check on head a222a3368b1648e1a0fc64e0fee30ba97789569a:
✅ Review approval is present on current head (not stale).
❌ Required CI checks are not green yet: CI / test-and-quality (push) and CI / test-and-quality (pull_request) are both pending ("Waiting to run").
Blocking merge until required checks complete successfully on this same head SHA.
Integrator gate check on head `a222a3368b1648e1a0fc64e0fee30ba97789569a`:
- ✅ Review approval is present on current head (not stale).
- ❌ Required CI checks are not green yet: `CI / test-and-quality (push)` and `CI / test-and-quality (pull_request)` are both `pending` ("Waiting to run").
Blocking merge until required checks complete successfully on this same head SHA.
Blocker (merge-gate): PR is currently not mergeable (mergeable=false), indicating a rebase/merge-conflict against main.
Please rebase/merge main into this branch and push a new head SHA, then request re-review.
Severity: blocker.
Blocker (merge-gate): PR is currently not mergeable (`mergeable=false`), indicating a rebase/merge-conflict against `main`.
Please rebase/merge `main` into this branch and push a new head SHA, then request re-review.
Severity: blocker.
Rebased PR branch onto main and resolved merge conflict in shared/i18n/lobby.json; retained host_only_* mappings and host_only_action mapping, addressing mergeability blocker.
Frontend runtime consumption of contract.backend_to_frontend_error_keys remains in place (previous blocker still resolved).
Checks run:
npm --prefix frontend test -- --run tests/lobby-i18n.contract.test.ts (6/6 passing)
Focused re-review on head 3398aead7f52017f1c60ce503d220dddcdebed13 after rebase/fix.
[SEV-0] ✅ Previous mergeability blocker is resolved (mergeable=true on current head).
[SEV-0] ✅ Runtime contract usage is present: frontend resolves error_code via contract.backend_to_frontend_error_keys before direct key/fallback in frontend/src/spa/lobby-i18n.ts.
[SEV-0] ✅ Regression test confirms mapping is consumed at runtime (frontend/tests/lobby-i18n.contract.test.ts, fallback differs).
[SEV-2] ⚠️ CI checks currently still pending on this SHA (CI / test-and-quality push + pull_request). No new code blocker identified in this re-review; merge gate remains CI-green.
Review state: APPROVED.
Focused re-review on head `3398aead7f52017f1c60ce503d220dddcdebed13` after rebase/fix.
- [SEV-0] ✅ Previous mergeability blocker is resolved (`mergeable=true` on current head).
- [SEV-0] ✅ Runtime contract usage is present: frontend resolves `error_code` via `contract.backend_to_frontend_error_keys` before direct key/fallback in `frontend/src/spa/lobby-i18n.ts`.
- [SEV-0] ✅ Regression test confirms mapping is consumed at runtime (`frontend/tests/lobby-i18n.contract.test.ts`, fallback differs).
- [SEV-2] ⚠️ CI checks currently still `pending` on this SHA (`CI / test-and-quality` push + pull_request). No new code blocker identified in this re-review; merge gate remains CI-green.
Review state: APPROVED.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implements issue #226.
shared/i18n/lobby.jsonimportable by backend+frontendCloses #226
Check report update:
npm test -- --run tests/lobby-i18n.contract.test.tspip install -r requirements.txtfails buildingmysqlclient(missing pkg-config/MySQL dev libs), sopython3 manage.py test lobby.tests.I18nResolverTestscannot run here.Concrete next action: run backend test in CI/runner image with MySQL client build deps installed (or provide prebuilt wheel/alt backend requirements) and confirm
lobby.tests.I18nResolverTestsgreen.Review for issue #226 acceptance.
[blocker] The new shared backend→frontend key-map in
shared/i18n/lobby.jsonis not actually consumed by frontend runtime code.frontend/src/spa/lobby-i18n.tsstill only acceptserror_codevalues that are direct frontend keys (isFrontendErrorKey(code)), then falls back to caller key. This means the contract map is documentation/test-only and can drift without runtime enforcement.lobbyMessageFromApiPayload, resolveerror_codethroughcontract.backend_to_frontend_error_keysfirst, then validate/use the mapped frontend key.contract.backend_to_frontend_error_keys(e.g. assert mapping path is used explicitly, not fallback path).[nice-to-have] Backend verification command in docs uses
python manage.py ...; in this environmentpython3is required. If this is expected in CI/dev, no change needed; otherwise consider documentingpython3/venv activation to reduce friction.What I validated:
shared/i18n/lobby.json) and includes ownership + locale contract (defaulten, supporteden/da, fallback rule) with da/en examples in docs.Checks run:
frontend: npm test -- --run tests/lobby-i18n.contract.test.tsImplemented requested runtime key-map usage fix in
frontend/src/spa/lobby-i18n.tsand added test coverage proving mapping is consumed at runtime (not fallback-masked).What changed
lobbyMessageFromApiPayloadnow resolves backenderror_codeviacontract.backend_to_frontend_error_keysfirst.frontend/tests/lobby-i18n.contract.test.tsmapping test to use a different fallback key (start_round_failed) so success proves runtime map usage.Tests run
npm --prefix frontend test -- lobby-i18n.contract.test.ts✅npm --prefix frontend test✅Head
a222a3368b1648e1a0fc64e0fee30ba97789569aa222a3368b1648e1a0fc64e0fee30ba97789569aRe-review on head
a222a3368b1648e1a0fc64e0fee30ba97789569acomplete.Findings:
contract.backend_to_frontend_error_keysinfrontend/src/spa/lobby-i18n.ts(mappedKey = backendToFrontendErrorKeys[code]) before direct key/fallback resolution.frontend/tests/lobby-i18n.contract.test.tsincludesuses shared backend→frontend key-map at runtime even when fallback key differs, proving mapped key wins over caller fallback.npm test -- --run tests/lobby-i18n.contract.test.tspassed (6/6).No remaining blockers for this PR head. Approving.
submit
Re-review findings for head
a222a3368b1648e1a0fc64e0fee30ba97789569a:contract.backend_to_frontend_error_keysinfrontend/src/spa/lobby-i18n.ts(mappedKey = backendToFrontendErrorKeys[code]) before direct key/fallback resolution.frontend/tests/lobby-i18n.contract.test.tsincludesuses shared backend→frontend key-map at runtime even when fallback key differs, proving mapped key wins over caller fallback.npm test -- --run tests/lobby-i18n.contract.test.tspassed (6/6).No remaining blockers on this head.
Integrator gate check on head
a222a3368b1648e1a0fc64e0fee30ba97789569a:CI / test-and-quality (push)andCI / test-and-quality (pull_request)are bothpending("Waiting to run").Blocking merge until required checks complete successfully on this same head SHA.
Blocker (merge-gate): PR is currently not mergeable (
mergeable=false), indicating a rebase/merge-conflict againstmain.Please rebase/merge
maininto this branch and push a new head SHA, then request re-review.Severity: blocker.
a222a3368bto3398aead7fRetask/dev-fix completed for latest review findings.
Resolved findings:
Checks run:
Head update:
Retask/dev-fix update (corrected SHAs).
Resolved findings:
Checks run:
Head update:
3398aead7f(baseline wasa222a3368b)3398aead7fFocused re-review on head
3398aead7f52017f1c60ce503d220dddcdebed13after rebase/fix.mergeable=trueon current head).error_codeviacontract.backend_to_frontend_error_keysbefore direct key/fallback infrontend/src/spa/lobby-i18n.ts.frontend/tests/lobby-i18n.contract.test.ts, fallback differs).pendingon this SHA (CI / test-and-qualitypush + pull_request). No new code blocker identified in this re-review; merge gate remains CI-green.Review state: APPROVED.