26 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
4fc0a15bca Merge remote-tracking branch 'origin/dev' into pr-2938
# Conflicts:
#	tests/fixtures/portuguese_unchanged_ui.json
#	web/locales/zh-tw/app.json
2026-12-03 05:24:35 -05:00
Botong
b86f06e906 feat(i18n): refine Traditional Chinese terminology and activate zh-tw across web, desktop, and backend
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
2026-12-03 04:43:27 -05:00
OrdoAbChao7
317cf1e5a2 Merge upstream/dev into feat/quick-model-setup 2026-12-03 01:40:52 +08:00
OrdoAbChao7
9e1144b394 fix: address PR #2938 review blockers, reasoning sync, i18n, and quick setup edge cases 2026-11-28 17:15:46 +08:00
OrdoAbChao7
3a843cd823 fix(i18n): translate quick setup and reasoning keys for Portuguese locale 2026-11-28 16:55:38 +08:00
Benjamin Schwing
0cba402415 fix(learning): ignore the abbreviation dot in unit words
"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>
2026-11-25 00:31:35 +00:00
Benjamin Schwing
8cd5a640c7 fix(learning): leave an exact 1000x unit-scale mismatch to the judge
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>
2026-11-25 00:29:51 +00:00
Benjamin Schwing
cee23a5011 fix(learning): leave sign-only and percent-point mismatches to the judge
"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>
2026-11-24 23:35:39 +00:00
Benjamin Schwing
37bcb6331a fix(learning): settle numeric rounding only where the key can
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>
2026-11-24 23:35:31 +00:00
Benjamin Schwing
05cb49e473 fix(learning): never read a numeric key in the answer's notation
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>
2026-11-24 21:55:19 +00:00
Benjamin Schwing
31dbcf036c fix(learning): keep uncertain numeric verdicts out of final grades
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>
2026-11-24 18:43:14 +00:00
Benjamin Schwing
702b4854d1 fix(learning): harden numeric answer parsing
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>
2026-11-24 18:38:58 +00:00
Benjamin Schwing
50059901b5 fix(learning): grade numeric answers deterministically
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>
2026-11-24 18:27:48 +00:00
Bingxi Zhao (Frank)
fa1edb75a2 fix: reconcile provider branding and locale contracts after PR integration
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.
2026-11-14 23:47:30 +08:00
Bingxi Zhao (Frank)
8b9acde791 Merge PR #2532: feat(subagent): speak ACP as a client so compliant agents plug in
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.
2026-11-14 23:25:46 +08:00
evan188199-tech
903da56f80 fix(i18n): add OAuth form labels to fr/uk and approve the pt loanword (#2585)
Signed-off-by: evan188199-tech <238371241+evan188199-tech@users.noreply.github.com>
2026-11-10 16:28:29 +08:00
ZQR1101
24e26b1b67 feat(subagent): speak ACP as a client so compliant agents plug in
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.
2026-11-09 11:12:57 +08:00
Bingxi Zhao (Frank)
a62e73bc8e Credit post-v1.7.1 contributors and register the Korean language endonym 2026-11-06 02:41:38 +08:00
Bingxi Zhao (Frank)
b611c7a690 Integrate current dev and preserve complete locale coverage 2026-10-31 18:08:16 +08:00
Bingxi Zhao (Frank)
0e84ab77fa Integrate reviewed changes and complete Portuguese translations 2026-10-31 18:04:54 +08:00
Bingxi Zhao (Frank)
3e281ce55b Complete and validate Brazilian Portuguese localization 2026-10-31 17:26:17 +08:00
sriv144
381e89580c Add isolated native memory snapshot evaluation 2026-10-28 15:17:39 +05:30
Bingxi Zhao (Frank)
fc0be68d6f wip: course / partner groups in progress 2026-08-29 22:29:53 +08:00
Codex
8dce8ee545 Fix LightRAG append recovery and fixture tracking 2026-08-28 15:15:48 +00:00
Codex
6d02ff9299 Replace RAG-Anything with native LightRAG pipeline 2026-08-28 15:04:14 +00:00
Bingxi Zhao
0c51fe0c6b test: restore CI baseline contracts (#878)
Restore Ruff formatting, whitespace-tolerant source contracts, and a deterministic CI model catalog.
2026-08-16 22:39:47 +08:00