You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 57faf5d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(service-settings): translate Data Lifecycle settings; AI & Knowledge help in business words (#28139)
domain:server#4 · os-elon-musk · session_016WV4d1Np3hU7RQnA13YZcL
Fixes#28064Fixes#28069
## What changes
### #28064: the Data Lifecycle settings page is translated
- `settings.lifecycle` is added to the zh-CN, ja-JP and es-ES files of
`settingsBuiltinTranslations`
(`packages/services/service-settings/src/translations/`). It covers the
title, the description, and each key's label and help (`enabled`,
`retention_overrides`, `quotas`, `quota_defaults`, `growth_alert_rows`).
- The titles match the Setup sidebar entry (`数据生命周期` / `データライフサイクル` /
`Ciclo de vida de los datos`).
- The field terms follow the object lifecycle forms already shipped (保留期
/ 保持期間 / retención, 生命周期类别 / ライフサイクルクラス / clase de ciclo de vida).
- JSON examples inside the help stay as written.
- `en` keeps falling back to the manifest literals, as it does for
`sms`.
- **The coverage test declares the lifecycle namespace instead of
refusing it.** `settings-translation-coverage.test.ts` now checks every
manifest whose copy this bundle carries: the bundled manifests plus a
named list of *hosted* platform manifests.
- A hosted manifest is one that another package registers into the same
hub and that ships no bundle of its own. Today the list holds objectql's
`lifecycleSettingsManifest`.
- A hosted manifest gets the same full coverage check as a bundled one,
and its namespace counts as declared for the no-undeclared-copy check.
- A new test pins that the list contains `lifecycle` and that no
namespace is declared twice.
- **The parity pin loses its exception.** `setup-nav-hub-parity.test.ts`
drops `HUB_UNTRANSLATED`. Its per-locale test is now "every hub page
carries a translated title", so the sidebar-vs-hub label comparison also
runs for Data Lifecycle.
- The `translations/index.ts` docblock names the hosted namespace.
### #28069: AI & Embedder and Knowledge help is in business words
This applies the treatment #28063 gave Authentication / Feature Flags /
Mail. The manifest literals (the English fallback) and the en / zh-CN /
ja-JP / es-ES packs change together:
- **API keys and gateway model.** The OpenAI / Anthropic / Google API
keys and the gateway model read "used instead of the key (model) set in
the server configuration". Before, they read "Forwarded as
`OPENAI_API_KEY`" (and `ANTHROPIC_API_KEY`,
`GOOGLE_GENERATIVE_AI_API_KEY`, `AI_GATEWAY_MODEL`). The settings
manifest has no per-field docs-link slot, so, as in #28063, the env var
names leave the help entirely. They stay in the code comment beside the
Reset action and in the deployment docs.
- **Record traces** says it keeps a record of each AI request and its
response, so a conversation can be inspected and replayed. It no longer
names `sys_ai_trace`.
- **Batch size** is "chunks sent to the embedding provider in one
request". It no longer says `embed()`.
- **Knowledge help:**
- Indexing defaults: "a value set on a knowledge source itself wins over
these defaults" (no `KnowledgeSource.adapterConfig`).
- Over-fetch multiplier is described by its effect (no `topK ×
overFetch`, no "JS-side").
- The RAGFlow default dataset says "knowledge source".
- The Turso group no longer says "tenant's primary libSQL connection".
- Enforce RLS on search no longer names `IDataEngine` (manifest and
zh-CN).
- Code spans around model examples (`provider/model`, `openai/gpt-4o`,
`default`) become plain text or quotes. The examples stay, because they
are what the administrator types.
- `settings-help-business-words.pin.test.ts` now sweeps `ai` and
`knowledge` as well as `auth`, `feature_flags` and `mail`. It adds teeth
cases for the strings #28069 was filed for, plus a negative case showing
that model examples are not flagged.
No key, default, option or validation changes in either part.
`packages/objectql` is untouched. There are two `patch` changesets for
`@objectstack/service-settings`.
## Why
**#28064:** Setup → All Settings → Data Lifecycle read English under
zh-CN, ja-JP and es-ES: the card title, its description and every field.
Every other settings page and the sidebar entry for this page were
translated.
- The page comes from objectql's `lifecycleSettingsManifest`, and no
bundle carried `settings.lifecycle.*`.
- The built-in settings bundle is where every other settings page's copy
lives, but its coverage test refused any namespace that no bundled
manifest declares.
- This PR widens that rule by naming the manifest, not by adding a bare
exception.
**#28069:** the help under AI & Embedder and Knowledge read like code
comments in all four languages. It named env vars, the trace object, a
code call and a config path that an administrator can neither see nor
change from this page. Triage ruled that the help says what the setting
does in business words. It is the remainder of #27521 row 2, whose other
pages #28063 fixed.
## Verification
All readings are against the worktree at `origin/main` `8cb8c7f4` plus
the two commits (`273efdc1`, `b4c0a258`).
| Check | Before | After |
|:--|:--|:--|
| `setup-nav-hub-parity.test.ts` with the exception list emptied | **3
failed** / 6 passed (9): zh-CN, ja-JP, es-ES each `expected [
'lifecycle' ] to deeply equal []` | 9 / 9 passed |
| `settings-translation-coverage.test.ts`, new test with the lifecycle
entries removed | n/a | **3 failed** / 41 passed (44):
`zh-CN/ja-JP/es-ES covers settings.lifecycle` |
| Old coverage test with the new lifecycle entries | **3 failed** / 37
passed (40): undeclared `namespace:lifecycle` | n/a (rule replaced) |
| `settings-help-business-words.pin.test.ts` sweeping `ai` and
`knowledge`, against the old help | **10 failed** / 20 passed (30): the
manifest and all four packs, for both namespaces, e.g.
`ai.keys.openai_api_key.help → env var or error code: OPENAI_API_KEY`,
`ai.trace_enabled.description → … sys_ai_trace`,
`knowledge.indexing.description → camelCase code identifier:
adapterConfig` | 30 / 30 passed |
| `@objectstack/service-settings` `pnpm test` | n/a | 65 files, 1076 /
1076 passed |
| `@objectstack/service-settings` `pnpm typecheck` | n/a | exit 0 |
| eslint on the changed `.ts` files | n/a | exit 0 |
| `check:adr-0087-registration`, `check:changeset-fixed`,
`check:empty-changeset`, `check:doc-authoring`,
`check:cross-package-test-inputs` | n/a | all exit 0 |
| `check-commit-card-trailers --range origin/main..HEAD` | n/a | exit 0
(2 commits) |
No test outside `service-settings` pinned the old AI or Knowledge help:
`git grep` for each replaced phrase finds only released `CHANGELOG.md`
entries.
## 维护者速读
- **改了什么**:
- #28064:在内置设置翻译包的 zh-CN / ja-JP / es-ES
中补上「数据生命周期」页(`settings.lifecycle`)的标题、描述和 5 个字段的 label 与 help。覆盖测试把
objectql 的 `lifecycleSettingsManifest` 列为“托管清单”,纳入同一覆盖规则。对齐测试删除
`HUB_UNTRANSLATED`。
- #28069:「AI
与嵌入」和「知识库」的帮助文字改成业务用语(清单与四个语言包同步),不再出现环境变量名、`sys_ai_trace`、`embed()`、`KnowledgeSource.adapterConfig`、`topK
× overFetch`。业务用语钉子测试扩展到这两个命名空间。
- **为什么改**:
- 数据生命周期页在三种语言下全是英文,侧栏条目却已翻译,两边不一致。
- AI 与知识库的帮助像代码注释,管理员看不懂,也无法在这里改动。分诊裁定按 #28063 的做法改成业务用语。
- **风险与回滚**:低。只改翻译数据、帮助文字和测试,没有改键名、默认值或校验,也没动 objectql。每张卡对应一个提交,可以分别
revert。
- **先看**:
- `settings-translation-coverage.test.ts` 的 `hostedManifests`(规则是否合理)。
- `manifests/ai.manifest.ts` 中 API Key 的新说法「用于代替服务器配置中设定的密钥」。
- `settings-help-business-words.pin.test.ts` 新增的命名空间与 teeth 用例。
- **亲手验证**:`pnpm --filter @objectstack/service-settings
test`。或者把控制台切到中文、日文或西班牙文,打开 设置 → 数据生命周期 / AI / 知识库,看标题与帮助。
- **需要你做的**:
- 分诊原话是把环境变量名移到“面向开发者”的一行,但 #28063
的钉子测试禁止帮助中出现任何环境变量名,清单也没有逐字段的文档链接位,所以这里按 #28063 的做法整句去掉。请确认这样可以接受。
- 确认把托管清单的译文放在 service-settings 包里可以接受。
Clause-②: no
Metadata-protocol: none
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_016WV4d1Np3hU7RQnA13YZcL
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(i18n): the Data Lifecycle settings page reads in the admin's language
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
Setup → All Settings → Data Lifecycle read English under Chinese (zh-CN), Japanese (ja-JP) and Spanish (es-ES): the hub card's title and description and every field on the page, while every other settings page and the Setup sidebar entry for this page were translated. The page now reads in those languages too: its title, description, and each field's label and help (Enforce lifecycle policies, Retention overrides, Row quotas, Per-class quota defaults, Growth alert threshold). The hub card and the sidebar entry now carry the same name in every shipped locale.
11
+
12
+
Nothing to do: the translations ship in the built-in settings bundle and load with the settings service, as the other pages' do. The JSON examples inside the help text stay as written, since they are the values you type.
fix(service-settings): AI & Embedder and Knowledge help is in business words
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
On Setup → Settings → AI & Embedder and Knowledge, the help under several fields read like code comments, in every language: "Forwarded as OPENAI_API_KEY", traces saved "to sys_ai_trace", "Chunks per embed() call", "Per-source values on KnowledgeSource.adapterConfig take precedence", "topK × overFetch". The help now says what each setting does:
11
+
12
+
- A provider API key or the gateway model is "used instead of the one set in the server configuration".
13
+
- Record traces keeps a record of each AI request and its response, so a conversation can be inspected and replayed.
14
+
- Batch size is the number of chunks sent to the embedding provider in one request.
15
+
- Indexing defaults: a value set on a knowledge source itself wins over these defaults.
16
+
- Over-fetch multiplier: search fetches this many times the requested number of results, so enough are left after filtering.
17
+
18
+
The English, Chinese, Japanese and Spanish text changed together. No setting, default or accepted value changed, and model examples such as openai/gpt-4o stay as written because they are what you type.
description: 'Internal `topK * overFetch` candidates fetched so JS-side metadata filtering still has rows to return.',
115
+
description: 'Search fetches this many times the requested number of results, so enough are left to return after they are filtered by document details.',
0 commit comments