Commit f7ffbd6
fix(objectql): the validation-message bridge negotiates the locale through the one rule every other consumer uses (#16087)
* fix(objectql): the validation-message bridge negotiates the locale through the one rule every other consumer uses
`ExecutionContext.locale` is the `Accept-Language` header's first tag verbatim
— `preferredLocaleFromHeader` reports what was ASKED FOR and expands nothing,
deliberately. The engine handed that tag straight to `II18nService.t()`, making
the write-path message bridge the one consumer that never negotiated: a served
adapter resolves a locale exactly and then falls to its declared fallback
(`FileI18nAdapter.t()` is `resolveFromLocale(key, locale)` then
`resolveFromLocale(key, fallbackLocale)`), so a bare `zh` missed a `zh-CN`
bundle and the caller read an English refusal — on the same response whose
dataset, view and object labels were Chinese, because those go through
`pickData` and `pickData` negotiates.
`validationMessageContext` now resolves the requested tag against what the
bridged service reports it holds (`getLocales()`), using
`@objectstack/spec`'s `resolveBundleLocale` — the SAME rule `pickData` runs for
every document translator. The rule is not re-implemented here: the translators
ask it about a bundle's keys, this asks it about the service's locales.
Passes the tag through untouched when there is nothing to negotiate against —
no service, no `getLocales`, an empty/non-array/throwing answer, or no match.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
* test(objectql): measure the refusal envelope across locales; changeset
The four-row table now also reads the MACHINE-READABLE half of the envelope
for every header: same `code`, same `field`, same refusal, and a satisfying
record still accepted in every locale. That turns "no request is newly
accepted or rejected" from an assertion into a measurement.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
* docs(permissions): re-anchor the system-context census after the engine.ts line shift
Pure line rot from this branch's insertion into `packages/objectql/src/engine.ts`,
repaired by the gate's own `node scripts/check-system-context-census.mjs --fix`.
Line-number anchors only; no prose, no row, no behaviour.
Control: with `engine.ts` swapped to the merge base and every other file left at
this head, `check-system-context-census` exits 0 — so the shift is the sole cause.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
* docs(permissions): regenerate the system-context census from the merged tree
`content/docs/permissions/system-context.mdx` is an os-regen artifact: the merge
driver resolved it with exit 0 while silently keeping one side, so it is
regenerated from the merged tree with the repo's own tooling
(`pnpm gen:system-context-census`) rather than hand-reconciled.
Blast radius measured against `origin/main` rather than assumed: 65 rows before
and 65 after, and every changed line is the same line with a different
`packages/objectql/src/engine.ts` line number — no row dropped, no prose moved.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
* docs(permissions): re-anchor the system-context census on the merged tree
The merge with `origin/main` brought `share-link-service.ts` line moves into
the census while this branch's `engine.ts` change had moved fifteen anchors of
its own. `content/docs/permissions/system-context.mdx` is routed to the
`os-regen` merge driver precisely because a text merge of the two cannot be
right; regenerated from the merged tree, both sides' anchors are present.
`check:system-context-census` verdict on the result: OK — 105 elevation read
sites in 19 packages across 44 files, all anchored; 140 anchors resolve, 27
declared non-read.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c1d274d commit f7ffbd6
4 files changed
Lines changed: 376 additions & 15 deletions
File tree
- .changeset
- content/docs/permissions
- packages/objectql/src
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
| 182 | + | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
0 commit comments