Complete full-stack activation of Traditional Chinese (zh-tw) on top of #3064 and #3065:
- Review and refine 683 app.json entries and 9 common.json entries in web/locales/zh-tw/ for Taiwan Traditional Chinese terminology (fixing OpenCC s2twp artifacts and mainland variants such as 許可權→權限, 賬號/賬戶→帳號/帳戶, 回撥→回呼, 自定義→自訂, 閘道器→閘道, 例項→實例, 只讀→唯讀, 憑據→憑證, 服務端→伺服器端, 配置檔案→設定檔, 地址→位址, 埠→連接埠, 映象→映像/鏡像, and curly quotes→「」) while keeping every key, placeholder, code span, and URL intact.
- Add language.chinese_traditional ("繁體中文") across all 14 web locale catalogs (and portuguese_unchanged_ui.json).
- Register zh-tw in web/i18n/languages.ts (preserving zh-tw/zh-hk/zh-mo/zh-hant before zh), dynamic loader web/i18n/init.ts, and web/lib/datetime.ts (zh-TW).
- Add complete Traditional Chinese Desktop shell copy in apps/desktop/src/i18n.mjs and register zh-tw in apps/desktop/src/main.mjs with zh-tw/zh-hant normalization.
- Wire zh-tw into backend deterministic copy and settings: settings_spec.py, runtime/banner.py, services/i18n.py, book/overview_copy.py, book/export.py, book/language.py, api/routers/quiz_judge.py (+ router_index.json), and zh-hk/zh-mo/zh-hant/繁體中文 handling in interface_languages.py and interface_settings.py (_normalize_response_language).
- Add full-stack regression coverage in tests/i18n/test_traditional_chinese_locale.py, apps/desktop/test/i18n.test.mjs, web/tests/language-preferences.test.ts, web/tests/account-role.test.ts, and tests/book/test_overview_copy.py.
Related to #2933
Related to #684
"4,5 Mio" and "4,5 Mio." were different units and so not comparable,
and the quiz viewer marked the dotless answer wrong. Both ports now
drop a trailing dot from the unit word before comparing.
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
Accounting tasks often state "in TEUR" or "in Mio. EUR" in the question
text, not next to the key, so the stored key is a bare "1.250". An
answer of "1.250.000" is then the same amount in full euros, yet it was
graded a final incorrect at confidence 1. An answer that equals the key
times 1000, 1000^2 or 1000^3 (or the reverse), with no unit or percent
on either side, is now ambiguous, so the judge decides with the question
in view. "1.251.000" for "1.250" stays a final incorrect. Both ports
share the new vectors.
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
"1.250" for a key of "-1.250" (a loss or deduction asked as an amount)
and "42" for a rate key of "0,42" were final incorrect verdicts. Both
may be what the question asked for, so they are now ambiguous, like the
existing "50%" for "50" and "0.5" for "0.5%" cases. Zero keys are not
rescaled.
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
A fraction key compared the answer's rounding instead of its own, so at
an exact half the wrong rounding won: "0,12" was correct for 1/8 and
"0,13" only ambiguous. The key is now rounded to the answer's places.
Keys with fewer than two places took their last written digit as the
precision. A key stored through a float ("12.5" from 12.50) accepted
"12,46", while an integer key ("417", "ca. 417 €") rejected "416,67"
with confidence 1. Such keys are now correct only on equality; a finer
answer that rounds to them is ambiguous and goes to the judge.
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
An ambiguous key such as "12.500 €" was read in the convention the
answer proved, so "12.5" became a final "correct" for what is 12 500 in
German notation (likewise "12.5 TEUR" for "12.500 TEUR"). Only the key's
own notation now fixes how the key is read; the answer may still borrow
the key's convention. An unproven key must match under both readings,
otherwise the result is ambiguous.
Precision follows half-away-from-zero rounding with exact rationals:
"3.48" accepts [3.475, 3.485) instead of a closed interval plus an
epsilon, which also made "1.5e-99" equal to an integer key "0". A key
more precise than the answer's rounding ("3,48" for "3,4833") and a bare
value below 1 for a percent key ("0.5" for "0.5%") are ambiguous instead
of a final verdict.
The web port now uses BigInt rationals like Python's Fraction, and both
ports reject tokens over 30 digits, so the shared vectors cannot drift on
large values. The unused rel_tol/abs_tol parameters are removed.
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
Second review round for numeric_equivalent and its web port:
- Without a proven separator convention, also try cross readings so
"12.500" vs "12,500" is ambiguous rather than a final "incorrect".
- A percent answer that only matches a bare key at x100 ("50%" for
"50") is left undecided, so "0.5%" is no longer accepted for "0.5".
- Apply the percent scale to an answer's decimals for fraction keys
("33.80%" no longer passes for "1/3").
- Never drop a unit word next to a currency ("5 kg" vs "5 €"), accept
letters only in units (no "m²"), and cap denominators at 15 digits.
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
Review follow-ups for numeric_equivalent and its web port:
- Limit exponents to two digits; "1.5e10000000" made Fraction
arithmetic block the event loop for about a minute.
- Treat a separator convention borrowed from the key as a preference,
not a proof: "-12.500" for "-12500.00" is now ambiguous instead of a
final "incorrect", since a comma-decimal learner may mean -12500.
- Accept "50%" for a bare "50" key, and two or more decimals that round
to a fraction key ("0.333" for "1/3").
- Allow at most one trailing unit word; prose ("5 or six"), symbols
("3²"), single letters and magnitude words ("Tausend") are no longer
dropped. Reject repeated signs ("--5").
- Use an absolute epsilon so large integer keys stay exact.
- Align Python and TS on ASCII digits, Unicode spaces and lower().
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
Short answers were fuzzy-matched with SequenceMatcher >= 0.85, so
"1250.60" passed for "1250.50", "-200" for "200" and "x=3, y=4" for
"x=3, y=5", while "1.250,50", "1250,50 €" and "1/8" were rejected for
"1250.50" / "0.125". Mastery's exact_verdict only compared casefolded
strings and left every number to an LLM verdict.
Add numeric_equivalent() to learning/grading.py: locale-aware decimal
and grouping separators with an explicit ambiguity rule, sign, currency,
percent, unit, fraction and scientific notation parsing, tolerance from
the key's written precision, and labelled/positional multi-part
comparison. grade_answer never fuzzy-matches a numeric key, and
exact_verdict returns a final verdict for numeric matches and for
unambiguous numeric mismatches on short questions.
Test vectors live in tests/fixtures/numeric_answers.json so the web port
can share them.
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
Register the verified SearchApi favicon with provenance, complete Italian many plurals and translated counts, and review the Italian/Hungarian language endonyms in Portuguese. Align labeled-stream fixtures with preserved Markdown examples and accepted thinking-tag aliases. Keep PDF layout memoization tied to the effective page ratio.
Honor ACP loadSession capability and empty load results, validate the negotiated version, distinguish bidirectional request IDs, and fail immediately on stdout EOF so bounded teardown can reap the child. 102 tests passed, including real subprocess EOF cleanup; protocol checked against https://agentclientprotocol.com/protocol/v1/session-setup.
Adds AcpBackend to the subagent registry: DeepTutor spawns an ACP-speaking
agent and drives initialize -> session/new|session/load -> session/prompt over
newline-delimited JSON-RPC, mapping session/update notifications onto the
existing text / reasoning / tool events. A new ACP-speaking agent then needs a
config line, not a connector.
Frames are pumped in bounded chunks rather than StreamReader.readline(), which
gives up on any line past 64 KiB and would truncate a whole tool result -- the
same limit process.py already works around for the native JSONL backends.
Elicitations are answered with `decline`, because approving a remote agent's
request for input is not this code's call to make.
Rebuilt on current dev; supersedes #1272.