Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/19403-action-body-panel-en-echo-decisions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@objectstack/platform-objects": patch
---

The `action` metadata-form panel no longer prints English field names and tooltips to a Chinese, Japanese or Spanish author: six keys — twelve string leaves — were decided leaf by leaf and rendered in `zh-CN`, `ja-JP` and `es-ES` (#19403).

The five children of the `body` composite (`Language`, `Source`, `Capabilities`, `Timeout Ms`, `Memory Mb`) and the `Ai` exposure block read their English source in all three locales, `helpText` included. An en-echo is not automatically a defect, so each leaf carries a recorded reason in `action-body-panel-echo-decisions.test.ts` rather than a bulk rewrite — and four of the six keys had an **authored twin at the same schema key**: `hookForm` and `actionForm` declare the same composite over `HookBodySchema`, rendered on the hook panel and echoing here, byte-identical in `en`. `memoryMb` echoes on both panels, so that row records that it has no twin evidence and composes from the sibling key instead.

- **Machine tokens stay English, checked at the schema before a word was rendered.** `body.language.helpText` names `expression` and `js` — the two `z.literal` discriminators of `HookBodySchema`. `body.capabilities.helpText` names `api.read`, `api.write`, `crypto.uuid` and `log` — four of the five `HookBodyCapability` enum members. `ai.helpText` names `ai.exposed=true` and `ai.description`, the two canonical keys of `ActionAiSchema`, a `strictObject` that declares five aliases of `exposed`. Rendering any of them would tell an author in their own language to write a value the schema refuses. All kept, alongside `import`, `ctx` and the schema bounds `256` and `40`.
- **Values only.** No key was added or removed: each translated bundle changes 12 values, the full flattened key sets are identical on all four bundles (893 keys, 0 added, 0 removed), and `en` is untouched. Regenerated with `pnpm i18n:extract`, which dropped the 12 provenance rows per locale that recorded these leaves as unauthored extractor fills and added none.
- **The panel is now pinned by a derived population**, and a new cross-panel assertion holds the five shared `HookBodySchema` children to ONE rendering across both forms that declare them — a disagreement no single-panel pin can see, because it lives between two derivations.

Measured on the metadata-form catalogs: label keys echoing in all three locales fall **29 → 23** while the genuinely-translated control rises **509 → 515** (`zh-CN`) and **493 → 499** (`ja-JP`, `es-ES`), same population, same run.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1239,24 +1239,24 @@ export const esESMetadataForms: NonNullable<TranslationData['metadataForms']> =
helpText: "Una expresión L1 o un body JS L2 en sandbox"
},
"body.language": {
label: "Language",
helpText: "expression = pure formula; js = sandboxed JavaScript"
label: "Idioma",
helpText: "expression = fórmula pura; js = JavaScript en sandbox"
},
"body.source": {
label: "Source",
helpText: "Function body source — no top-level imports"
label: "Código fuente",
helpText: "Código fuente del body de la función — sin imports de nivel superior"
},
"body.capabilities": {
label: "Capabilities",
helpText: "Allowed ctx APIs (api.read, api.write, crypto.uuid, log, …)"
label: "Capacidades",
helpText: "API ctx permitidas (api.read, api.write, crypto.uuid, log, …)"
},
"body.timeoutMs": {
label: "Timeout Ms",
helpText: "Per-invocation timeout (ms)"
label: "Tiempo de espera (ms)",
helpText: "Tiempo de espera por invocación (ms)"
},
"body.memoryMb": {
label: "Memory Mb",
helpText: "Per-invocation memory cap (MB, max 256)"
label: "Memoria (MB)",
helpText: "Límite de memoria por invocación (MB, máx. 256)"
},
params: {
label: "Parámetros",
Expand Down Expand Up @@ -1345,8 +1345,8 @@ export const esESMetadataForms: NonNullable<TranslationData['metadataForms']> =
helpText: "Expresión CEL: desactivar cuando la condición sea true"
},
ai: {
label: "Ai",
helpText: "AI exposure (opt-in): set ai.exposed=true and write ai.description (≥40 chars) to make this callable by agents."
label: "Exposición a IA",
helpText: "Exposición a IA (voluntaria): establece ai.exposed=true y escribe ai.description (≥40 caracteres) para que los agentes puedan llamarla."
},
recordIdParam: {
label: "Parámetro de ID de registro",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@
*/

export const esESGeneratedSourceHashes: Readonly<Record<string, string>> = {
"metadataForms.action.fields.ai.helpText": "e8c9a5009eb96ef6",
"metadataForms.action.fields.ai.label": "17ad12a926c9f22d",
"metadataForms.action.fields.body.capabilities.helpText": "2db3f83342bd3fa1",
"metadataForms.action.fields.body.capabilities.label": "0b59005e10add41f",
"metadataForms.action.fields.body.language.helpText": "b0ad78a396675964",
"metadataForms.action.fields.body.language.label": "012664c233fc15b0",
"metadataForms.action.fields.body.memoryMb.helpText": "f53c826ce3c94ad9",
"metadataForms.action.fields.body.memoryMb.label": "a1e1612eff7f82ea",
"metadataForms.action.fields.body.source.helpText": "3a066e75948ec72c",
"metadataForms.action.fields.body.source.label": "8fe786e8e29c8cec",
"metadataForms.action.fields.body.timeoutMs.helpText": "47042e57f537d281",
"metadataForms.action.fields.body.timeoutMs.label": "2b887c62238d3532",
"metadataForms.api.description": "62421e8039e013f5",
"metadataForms.api.label": "589af3fe4aab4af5",
"metadataForms.book.description": "45e72c8c74617530",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1239,24 +1239,24 @@ export const jaJPMetadataForms: NonNullable<TranslationData['metadataForms']> =
helpText: "L1 式または L2 サンドボックス JS body"
},
"body.language": {
label: "Language",
helpText: "expression = pure formula; js = sandboxed JavaScript"
label: "言語",
helpText: "expression = 純粋な数式; js = サンドボックス化 JavaScript"
},
"body.source": {
label: "Source",
helpText: "Function body source — no top-level imports"
label: "ソース",
helpText: "関数 body ソース — トップレベル import 不可"
},
"body.capabilities": {
label: "Capabilities",
helpText: "Allowed ctx APIs (api.read, api.write, crypto.uuid, log, …)"
label: "機能",
helpText: "許可する ctx API(api.read, api.write, crypto.uuid, log, …)"
},
"body.timeoutMs": {
label: "Timeout Ms",
helpText: "Per-invocation timeout (ms)"
label: "タイムアウト(ms)",
helpText: "呼び出しごとのタイムアウト(ms)"
},
"body.memoryMb": {
label: "Memory Mb",
helpText: "Per-invocation memory cap (MB, max 256)"
label: "メモリ(MB)",
helpText: "呼び出しごとのメモリ上限(MB、最大 256)"
},
params: {
label: "パラメーター",
Expand Down Expand Up @@ -1345,8 +1345,8 @@ export const jaJPMetadataForms: NonNullable<TranslationData['metadataForms']> =
helpText: "CEL 式: 条件が true の場合に無効化"
},
ai: {
label: "Ai",
helpText: "AI exposure (opt-in): set ai.exposed=true and write ai.description (≥40 chars) to make this callable by agents."
label: "AI 公開",
helpText: "AI 公開(オプトイン): ai.exposed=true を設定し、ai.description(≥40 文字)を記述すると、エージェントから呼び出せるようになります。"
},
recordIdParam: {
label: "レコード ID パラメーター",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@
*/

export const jaJPGeneratedSourceHashes: Readonly<Record<string, string>> = {
"metadataForms.action.fields.ai.helpText": "e8c9a5009eb96ef6",
"metadataForms.action.fields.ai.label": "17ad12a926c9f22d",
"metadataForms.action.fields.body.capabilities.helpText": "2db3f83342bd3fa1",
"metadataForms.action.fields.body.capabilities.label": "0b59005e10add41f",
"metadataForms.action.fields.body.language.helpText": "b0ad78a396675964",
"metadataForms.action.fields.body.language.label": "012664c233fc15b0",
"metadataForms.action.fields.body.memoryMb.helpText": "f53c826ce3c94ad9",
"metadataForms.action.fields.body.memoryMb.label": "a1e1612eff7f82ea",
"metadataForms.action.fields.body.source.helpText": "3a066e75948ec72c",
"metadataForms.action.fields.body.source.label": "8fe786e8e29c8cec",
"metadataForms.action.fields.body.timeoutMs.helpText": "47042e57f537d281",
"metadataForms.action.fields.body.timeoutMs.label": "2b887c62238d3532",
"metadataForms.api.description": "62421e8039e013f5",
"metadataForms.api.label": "589af3fe4aab4af5",
"metadataForms.book.description": "45e72c8c74617530",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1239,24 +1239,24 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
helpText: "L1 表达式或 L2 沙箱 JS 体"
},
"body.language": {
label: "Language",
helpText: "expression = pure formula; js = sandboxed JavaScript"
label: "语言",
helpText: "expression = 纯公式;js = 沙箱 JavaScript"
},
"body.source": {
label: "Source",
helpText: "Function body source — no top-level imports"
label: "源码",
helpText: "函数体源码——禁止顶层 import"
},
"body.capabilities": {
label: "Capabilities",
helpText: "Allowed ctx APIs (api.read, api.write, crypto.uuid, log, …)"
label: "功能",
helpText: "可用的 ctx API(api.read、api.write、crypto.uuid、log 等)"
},
"body.timeoutMs": {
label: "Timeout Ms",
helpText: "Per-invocation timeout (ms)"
label: "超时(毫秒)",
helpText: "单次调用超时时间(毫秒)"
},
"body.memoryMb": {
label: "Memory Mb",
helpText: "Per-invocation memory cap (MB, max 256)"
label: "内存(MB)",
helpText: "单次调用内存上限(MB,最大 256)"
},
params: {
label: "参数",
Expand Down Expand Up @@ -1345,8 +1345,8 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
helpText: "CEL 表达式:满足条件时禁用"
},
ai: {
label: "Ai",
helpText: "AI exposure (opt-in): set ai.exposed=true and write ai.description (≥40 chars) to make this callable by agents."
label: "AI 暴露",
helpText: "AI 暴露(需显式开启):设置 ai.exposed=true 并填写 ai.description(≥40 个字符),此操作即可被代理调用。"
},
recordIdParam: {
label: "记录 ID 参数",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@
*/

export const zhCNGeneratedSourceHashes: Readonly<Record<string, string>> = {
"metadataForms.action.fields.ai.helpText": "e8c9a5009eb96ef6",
"metadataForms.action.fields.ai.label": "17ad12a926c9f22d",
"metadataForms.action.fields.body.capabilities.helpText": "2db3f83342bd3fa1",
"metadataForms.action.fields.body.capabilities.label": "0b59005e10add41f",
"metadataForms.action.fields.body.language.helpText": "b0ad78a396675964",
"metadataForms.action.fields.body.language.label": "012664c233fc15b0",
"metadataForms.action.fields.body.memoryMb.helpText": "f53c826ce3c94ad9",
"metadataForms.action.fields.body.memoryMb.label": "a1e1612eff7f82ea",
"metadataForms.action.fields.body.source.helpText": "3a066e75948ec72c",
"metadataForms.action.fields.body.source.label": "8fe786e8e29c8cec",
"metadataForms.action.fields.body.timeoutMs.helpText": "47042e57f537d281",
"metadataForms.action.fields.body.timeoutMs.label": "2b887c62238d3532",
"metadataForms.api.description": "62421e8039e013f5",
"metadataForms.api.label": "589af3fe4aab4af5",
"metadataForms.book.description": "45e72c8c74617530",
Expand Down
Loading