Repository navigation
Commit 747c8e9
fix(service-settings): move the storage, knowledge and AI warnings into info_banner rows (#23958)
Fixes #23839
Clause-②: no — the bundles fill a slot the spec already declares, and no
setting's key, value, default or save behaviour changes. Measured: the
package's built `dist/index.d.ts` and `dist/index.d.cts` are
byte-identical at the base and at this head.
## Landing gate: keep this PR draft
This PR stays draft until objectstack's `.objectui-sha` (now
`daeb77fc84`) carries objectstack-ai/objectui#12671's banner reader,
because until then the console draws each banner's English literal and
zh-CN, ja-JP and es-ES admins would lose the translated warnings they
read today.
## What changes
Four warnings were sentences inside ordinary strings, each starting with
a hand-typed warning glyph, so the admin read them as one more sentence
of the page subtitle or of a toggle's help. Each one is now an
`info_banner` row with `bannerSeverity: 'warning'`, an `id`, a short
`label` (its title) and `bannerText`. It sits in the section it
concerns, directly under the field it warns about:
| Namespace | Banner `id` | Section, position | Was inside |
|---|---|---|---|
| `storage` | `adapter_switch_warning` | Backend, under the Adapter
select | the namespace `description` |
| `knowledge` | `adapter_switch_warning` | Backend, under the Adapter
select | the namespace `description` |
| `knowledge` | `enforce_rls_warning` | Permissions, under the Enforce
RLS on search toggle | the `enforce_rls` help (`description`) |
| `ai` | `log_prompts_warning` | Observability, under the Log full
prompts toggle | the `log_prompts` help (`description`) |
Each string keeps its non-warning text:
- storage keeps "Backend used for attachments, exports, and user
uploads."
- knowledge keeps "Vector-store backend for RAG / knowledge sources."
and also the sentence after the warning, "The embedder is configured
separately under AI."
- `enforce_rls` keeps "Re-check every hit against the caller's
record-level permissions via IDataEngine."
- `log_prompts` keeps "Include rendered prompts (not just metadata) in
trace rows."
`feature-flags.manifest.ts` is unchanged: its `beta_notice` banner
already had an `id`.
### Translations
In the `en`, `zh-CN`, `ja-JP` and `es-ES` bundles, each warning sentence
left the bundle's `description` / `help` copy and now sits under
`settings.NAMESPACE.banners.BANNER_ID.{title,text}`, the slot PR #23886
declared. The translated sentences are the ones each bundle already
carried, moved without the glyph and not re-translated. Each banner has
a new short title in every locale:
| Banner | en | zh-CN | ja-JP | es-ES |
|---|---|---|---|---|
| `storage.adapter_switch_warning` | Existing files are not migrated |
已有文件不会迁移 | 既存ファイルは移行されません | Los archivos existentes no se migran |
| `knowledge.adapter_switch_warning` | Existing indices are not migrated
| 已有索引不会迁移 | 既存のインデックスは移行されません | Los índices existentes no se migran |
| `knowledge.enforce_rls_warning` | Leave RLS on in production |
生产环境请保持开启 | 本番環境では有効のままにしてください | Mantenlo activado en producción |
| `ai.log_prompts_warning` | Prompts may contain PII | Prompt 可能含有 PII |
PII 漏えいの可能性 | Los prompts pueden contener PII |
| `feature_flags.beta_notice` | Heads up | 注意 | ご注意ください | Atención |
The Feature Flags `beta_notice` banner gained copies in all four
bundles, since the coverage test now requires them.
### Pins
- `settings-translation-coverage.test.ts` covers banners in both
directions. Every `info_banner` `id` needs a `title` and a `text` in
zh-CN, ja-JP and es-ES. A banner with no `id` is reported, because no
locale can address it. No locale (en included) may carry a banner id the
manifest does not declare.
- The same file sweeps every manifest's `description`, `helpText` and
specifier help, and every locale's `description`, group `description`
and key `help`: none may contain the warning glyph. Each sweep also
asserts it read more than 50 strings, so it cannot pass on an empty set.
- `storage.manifest.test.ts`, `knowledge.manifest.test.ts` and
`ai.manifest.test.ts` each pin three things: the exact set of
`info_banner` ids with `bannerSeverity: 'warning'`; that each banner has
a label and a body and sits in its section directly under its field; and
that the glyph appears nowhere in the serialized manifest.
## Evidence (head `c396797fd5`)
- **Package suite:** `pnpm --filter @objectstack/service-settings exec
vitest run --maxWorkers=2` gave `Test Files 47 passed (47)`, `Tests 845
passed (845)`. `pnpm --filter @objectstack/service-settings typecheck`
(`tsc --noEmit`) exited 0, and `--listFiles` shows all four edited test
files in the program.
- **Runtime probe** (one-off, not committed):
`PlatformTranslationDataSchema.safeParse` on each shipped bundle gave
`success=true` for en, zh-CN, ja-JP and es-ES. Every pair of the 5
banners and 4 locales (20 in all) resolved through
`resolveSettingsBannerTitle` / `resolveSettingsBannerText` from the
bundle; none fell back to the manifest literal.
- **Ablations** were run through `scripts/ablation-replace.mjs` in wrap
mode, on the four test files (105 tests), with the tests reading `src`
by relative import, so no `dist` was involved. Each restore was proven:
blob equals HEAD, and `git diff HEAD` was empty.
| Mutation | Red |
|---|---|
| rename the zh-CN storage banner key `adapter_switch_warning` to
`adapter_switch_warnin` | `zh-CN covers settings.storage` (missing
`banner:adapter_switch_warning.title`, `.text`) and `zh-CN carries no
copy for a group, key or banner no manifest declares`
(`storage.banner:adapter_switch_warnin`), 2 failed |
| put the glyph back into the storage manifest `description` | the
storage pin `carries the warning glyph nowhere` and the sweep
(`storage.description`), 2 failed |
| set `log_prompts_warning` to `bannerSeverity: 'info'` | the AI pin
`declares it as a warning-severity info_banner`, 1 failed |
| put the glyph back into the ja-JP `log_prompts` help | `ja-JP carries
the warning glyph in no description or help copy`
(`ai.keys.log_prompts.help`), 1 failed |
- **Declaration closure:** the seven edited source files were put back
to the base in the working tree only, the package was rebuilt, and then
the files were restored to HEAD (blob proof) and rebuilt again.
`dist/index.d.ts` and `dist/index.d.cts` are byte-identical (md5
`68d6b431c4c7fe099f1fe841af3ac690` both sides). Every edited export is
declared with a named type (`SettingsManifest`,
`PlatformTranslationData`, `PlatformTranslationBundle`).
- **Local gates:** `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 63 commands at `c396797fd5`. 62
exited 0. `pnpm check:dual-build-cjs-loads` exited 3 with `PREREQUISITE
NOT MET` (it needs every package's `dist`), so it is NOT MEASURED
locally and is left to CI. `--ran` reconciliation: `63 derived
famil(ies) accounted for — 62 run, 1 NOT-MEASURED`, 0 unrun.
## Acceptance notes
- **The en banner text mirrors the manifest.** For the two knowledge
banners, the `en` text is the manifest's full sentence, because the `en`
bundle's header says it mirrors the manifest literals. The old `en` copy
carried shortened warnings ("Switching adapter does NOT migrate existing
indices."; "Disabling skips the platform's unique safeguard."), so
English admins now read the full sentence the manifest always had. ja-JP
and es-ES had translated the shortened copies, and those moved as they
were.
- **Pre-existing drift, left as found:** the `en` and translated
knowledge descriptions omit "The embedder is configured separately under
AI.", and the `enforce_rls` help in en, ja-JP and es-ES omits "via
IDataEngine". Both differences predate this PR, and only the warning
sentence was removed here.
- **The glyph is gone from the banner text as well;** `bannerSeverity`
is now the only warning marker. At the pin `daeb77fc84`, the console
draws every non-`error` severity in the default Alert variant with an
Info icon, and renders `bannerText` as plain text. Both renderer
findings belong to objectstack-ai/objectui#12610's owner and are not
re-filed here. Until that change lands, these banners look like info
callouts. Each is still its own titled callout under its field.
- `origin/main` advanced to `8f4260fe66` while this ran. None of those
commits touches `packages/services/service-settings` or
`packages/spec/src/system`, so the branch was not merged again before
opening.
---
_Generated by [Claude
Code](https://claude.ai/code/session_018VqJPGA1NDNSCZsnecsChP)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 544b8d7 commit 747c8e9
12 files changed
Lines changed: 287 additions & 51 deletions
File tree
- .changeset
- packages/services/service-settings/src
- manifests
- translations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
240 | 263 | | |
241 | 264 | | |
242 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
233 | 239 | | |
234 | 240 | | |
235 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
60 | 90 | | |
61 | 91 | | |
62 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 45 | + | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
| |||
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| |||
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
116 | | - | |
117 | | - | |
118 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
119 | 128 | | |
120 | 129 | | |
121 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
53 | 76 | | |
54 | 77 | | |
55 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
20 | 16 | | |
21 | 17 | | |
22 | 18 | | |
| |||
31 | 27 | | |
32 | 28 | | |
33 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
219 | 223 | | |
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
258 | 263 | | |
259 | 264 | | |
260 | 265 | | |
| |||
313 | 318 | | |
314 | 319 | | |
315 | 320 | | |
316 | | - | |
| 321 | + | |
317 | 322 | | |
318 | 323 | | |
319 | 324 | | |
| |||
344 | 349 | | |
345 | 350 | | |
346 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
347 | 356 | | |
348 | 357 | | |
349 | 358 | | |
350 | 359 | | |
351 | | - | |
352 | | - | |
353 | | - | |
| 360 | + | |
354 | 361 | | |
355 | 362 | | |
356 | 363 | | |
| |||
386 | 393 | | |
387 | 394 | | |
388 | 395 | | |
389 | | - | |
| 396 | + | |
390 | 397 | | |
391 | 398 | | |
392 | 399 | | |
393 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
394 | 409 | | |
395 | 410 | | |
396 | 411 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
343 | 347 | | |
344 | 348 | | |
345 | 349 | | |
346 | 350 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
| 351 | + | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
382 | 387 | | |
383 | 388 | | |
384 | 389 | | |
| |||
462 | 467 | | |
463 | 468 | | |
464 | 469 | | |
465 | | - | |
| 470 | + | |
466 | 471 | | |
467 | 472 | | |
468 | 473 | | |
| |||
493 | 498 | | |
494 | 499 | | |
495 | 500 | | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
496 | 505 | | |
497 | 506 | | |
498 | 507 | | |
499 | 508 | | |
500 | | - | |
501 | | - | |
502 | | - | |
| 509 | + | |
503 | 510 | | |
504 | 511 | | |
505 | 512 | | |
| |||
535 | 542 | | |
536 | 543 | | |
537 | 544 | | |
538 | | - | |
| 545 | + | |
539 | 546 | | |
540 | 547 | | |
541 | 548 | | |
542 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
543 | 556 | | |
544 | 557 | | |
545 | 558 | | |
0 commit comments