Repository navigation
fix(mobile): check counted messages with non-literal keys in the plural audit - #8020
Conversation
…al audit The plural audit only matched single-quoted literal keys, so counted calls with a double-quoted or template-literal key were skipped and counted calls with a variable key were invisible to it. Four such call sites exist in the chat settings and profile rows; through them, modelChat.mcp.serverToolCount and the profiles.counts unit words rendered one invariant form for every count. The audit now reads double-quoted and static template-literal keys, records counted calls whose key is a variable expression, and requires each such expression in a reviewed allowlist that names the keys it can produce. Every key the allowlist names is checked like a literal one. serverToolCount, vars, skills and commands declare their English plural families; invariant status labels and compact suffixes are documented as carrying no inflected word. Every other catalog gains the categories its own plural rules require, reusing the base translation unchanged.
The test pinned the count-invariant output the audit now prevents: one command renders the _one form.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change is a two-line test assertion pinning the unlisted-dynamic-call path, plus a merge of Assumptions: Files Reviewed (6 files, incremental scope)
All previously raised findings are resolved at Previous Review Summaries (4 snapshots, latest commit 1229dbb)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 1229dbb)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental commit fixes all four outstanding plural findings in Arabic, Gujarati, and Kannada; no new issues were introduced. Files Reviewed (3 files)
Previous review (commit 818c8d9)Status: 4 Issues Found | Recommendation: Address before merge Executive SummaryThe Latvian and Lithuanian corrections landed, but Gujarati Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (5 files)
Fix these issues in Kilo Cloud Previous review (commit 4aef751)Status: 5 Issues Found | Recommendation: Address before merge Executive SummaryThe audit script changes and the three prior findings are resolved, but five catalogs changed Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (19 files)
Fix these issues in Kilo Cloud Previous review (commit a9af7cb)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (90 files)
Reviewed by deepseek-flash-latest · Input: 84.9K · Output: 12K · Cached: 1.6M Review guidance: REVIEW.md from base branch |
Three review findings: - The MCP status allowlists omit modelChat.mcp.unreachable, which the McpStatusKey union includes and retryable() returns for failures other than the credential refusal; both lists now name it. - The dynamic-key expression is documented as whitespace-normalized but only trimmed; a wrapped call would record a key the allowlist never matches. Runs of whitespace now collapse before recording. - Sixteen locales rendered the plural base for count 1 (Telugu, Malayalam, Urdu, Sinhala, Amharic, Albanian among them), leaving the one-tools bug this change fixes in those catalogs. Their singular entries now carry the natural singular noun, and the plural base stays verbatim in the category that carries it.
…nian and Arabic The first plural pass put the shipped form in the wrong category for five languages: Gujarati and Kannada lost their plural in the residual category, Latvian and Lithuanian took the genitive that belongs to the zero and ten-to-twenty counts, and Arabic replaced the singular that 100 and above keeps. Each catalog now assigns the shipped form to its own category and derives the rest around it.
…rabic Gujarati skills and Kannada variables keep their plural in the residual count category, and Arabic restores the singular noun for the hundreds and the accusative ending for eleven through ninety-nine.
Change
The plural audit (
tools/i18n/check-plurals.mjs) promised to check every counted message, but its scanner only matched single-quoted literal keys. Counted calls with a double-quoted or template-literal key were skipped, and counted calls whose key is a variable —t(mcp.view.statusKey, { count })— were invisible to it entirely. Six such dynamic call sites exist, and through them three counted messages rendered one invariant form for every count:modelChat.mcp.serverToolCount("1 tools"),profiles.counts.vars("1 vars"),skills("1 skills") andcommands("1 cmds").DYNAMIC_COUNTED_KEYSallowlist naming the keys it can produce (each entry cites the descriptor that pins the set). Unlisted variable-key counted calls are a problem of their own.NO_AGREEMENTentry.serverToolCount,vars,skillsandcommandsdeclare their English_one/_otherfamilies; the base keys are removed, matching how every other plural family ships.Intl.PluralRulesrequires for the four families, with the base translation reused unchanged (languages that do not inflect repeat the same form, the existing house pattern).mcp,varsShort, …) are documented inNO_AGREEMENTas carrying no inflected word.End-to-end evidence
node tools/i18n/check-plurals.mjs --source-onlyreported 13 problems on the new audit (the four families plus unreviewed dynamic calls); after, it and the full 87-locale run pass:check-plurals: every counted message and every locale declares its plural categories.pnpm --filter kilo-app run check:i18npasses:87 languages, every catalog matches en.json.pnpm --filter kilo-app run check:pluralspasses.ruresolvesserverToolCount1→_one("1 инструмент"), 3→_few("3 инструмента"), 5→_many("5 инструментов");arresolves 0/1/2/11→_zero/_one/_two/_many;enresolves 1→"1 tool", 5→"5 tools";profiles.counts.vars1→"1 var".pnpm --filter kilo-app exec vitest run src/i18n: 16 files, 1612 tests pass, including new tests for double-quoted/template-literal collection, unlisted dynamic calls, and singular selection of the previously broken keys.tsgo --noEmit) passes; lint clean.Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: Reviewed allowlist in the script
Confidence: 0.72 — the brief offers the allowlist, and the descriptors are there for a reason.
Answer: Same form in every required category
Confidence: 0.75 — fix the class of the issue; exempting the families would leave the audit's promise broken.
Answer: Remove base keys
Confidence: 0.80 — replace old paths instead of keeping them alongside.