From b8eec518476b7e98656df8eaee70a628758a29f6 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 18:44:49 +0000 Subject: [PATCH 1/5] feat(lint): the metadata save door advises on a translation key nothing declares The runtime publish gate now dispatches validateTranslationReferences on a translation write, reading the written item at the door: only the families the per-write snapshot carries are judged (objects, their fields, validation rules and milestones, permission sets), at warning, so an orphan key is an advisory on the save answer and never a refusal. Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude --- .../lint/src/authoring-rule-wiring.test.ts | 3 +- packages/lint/src/authoring-rules.ts | 13 ++- .../lint/src/reference-integrity-suite.ts | 26 ++++- .../runtime-gate.datasource-writes.test.ts | 11 +- .../runtime-gate.inert-type-writes.test.ts | 7 +- packages/lint/src/runtime-gate.test.ts | 6 +- packages/lint/src/runtime-gate.ts | 12 ++ .../src/validate-translation-references.ts | 109 +++++++++++++++++- 8 files changed, 171 insertions(+), 16 deletions(-) diff --git a/packages/lint/src/authoring-rule-wiring.test.ts b/packages/lint/src/authoring-rule-wiring.test.ts index 66674ab5861..26f87e48073 100644 --- a/packages/lint/src/authoring-rule-wiring.test.ts +++ b/packages/lint/src/authoring-rule-wiring.test.ts @@ -456,7 +456,8 @@ describe('authoring-rule registry wiring (#4409)', () => { expect(runtimeAuthoringRulesFor('flow').map((r) => r.name)).toContain('validateApprovalApprovers'); expect(runtimeAuthoringRulesFor('flow').map((r) => r.name)).toContain('validateStackExpressions'); // A type nobody gated returns nothing rather than everything. - expect(runtimeAuthoringRulesFor('translation')).toEqual([]); + // (`doc`: `translation` held this place until #38623 crossed it.) + expect(runtimeAuthoringRulesFor('doc')).toEqual([]); }); // ── #7220: a rule FAMILY crosses this wall together, or not at all ── diff --git a/packages/lint/src/authoring-rules.ts b/packages/lint/src/authoring-rules.ts index 7f72959de0a..663f139db18 100644 --- a/packages/lint/src/authoring-rules.ts +++ b/packages/lint/src/authoring-rules.ts @@ -1445,8 +1445,19 @@ export const AUTHORING_RULES: readonly AuthoringRule[] = [ // (`sortable: false`, a `formula`, and since #30093 a field the object // does not have, as `page-field-unknown`) is refused at publish rather // than at its first fetch. Every other member keeps its declaration. + // [#38623] `translation` joins, NARROW by the same mechanism and ADVISORY + // by the member's own save-door reading: a translation write reaches + // exactly `validateTranslationReferences`, which at this door judges only + // the families the snapshot carries (objects, their fields, validation + // rules and milestones, permission sets) and reports at `warning`, so an + // orphan key is an advisory on the save answer and never a 422 — a + // published item naming a key an upgrade removed still loads and saves. + // This is the `translation` reading the ADR-0049 group B line deferred the + // wiring to (measured: 85 phantom orphans on the showcase bundle with the + // rule unrestricted, 0 of 287 keys restricted). Apps and their navigation + // stay unjudged at this door: the snapshot carries no apps. surfaces: CLI_AND_RUNTIME, - runtimeTypes: ['flow', 'view', 'object', 'dataset', 'report', 'page', 'action'], + runtimeTypes: ['flow', 'view', 'object', 'dataset', 'report', 'page', 'action', 'translation'], run: (stack, ctx) => validateReferenceIntegrity(stack, ctx), }, // ADR-0078 / #5068 — the SDUI component-props gate. `PageComponent.properties` diff --git a/packages/lint/src/reference-integrity-suite.ts b/packages/lint/src/reference-integrity-suite.ts index 0954d55f274..45c2ae3789f 100644 --- a/packages/lint/src/reference-integrity-suite.ts +++ b/packages/lint/src/reference-integrity-suite.ts @@ -707,7 +707,31 @@ export const REFERENCE_INTEGRITY_RULES: readonly ReferenceIntegrityRule[] = [ // maintainer ruling of 2026-08-12 makes THIS the mandatory companion, so the // prune is never silent to the author who wrote the row. { name: 'validateNavObjectServability', run: validateNavObjectServability }, - { name: 'validateTranslationReferences', run: validateTranslationReferences }, + // [#38623] `runtimeTypes` gains `translation`: a translation item saved over + // the metadata API (Studio, REST `/meta`, an MCP/AI author) was published + // `valid` while `os validate` refused the same orphan key. At that door the + // rule takes its save-door reading (`atSaveDoor`, read off + // `ctx.runtimeWriteType` as the members above read `wholeCollection`): it + // judges only the families the per-write snapshot carries — `objects.` + // (not under a package closure), its `fields` (with inline `options`), + // `_validations`, `_milestones`, and `permissions.` — and reports at + // `warning`, so the finding is an advisory on the save answer and never a + // 422. Every other family (apps and their navigation among them) resolves + // into a collection no snapshot carries and is not judged at the door. + // MEASURED before crossing on `examples/app-showcase`'s bundle at the door's + // own snapshot: the unrestricted rule reports 85 orphans the whole stack does + // not; the judged families report 0 of 287 keys, as on the whole stack. + { + name: 'validateTranslationReferences', + runtimeTypes: ['flow', 'translation'], + run: (stack, ctx) => + validateTranslationReferences( + stack, + ctx?.runtimeWriteType === 'translation' + ? { atSaveDoor: true, objectsNarrowed: ctx.packageScope !== undefined } + : {}, + ), + }, // The same family from the other end (#5417). Its sibling above asks "does // this bundle key resolve?"; this one asks "is there a key at all?" — a form // section authored with a `label` and no `name` renders a heading that diff --git a/packages/lint/src/runtime-gate.datasource-writes.test.ts b/packages/lint/src/runtime-gate.datasource-writes.test.ts index b53ddf278a9..382e8ddc584 100644 --- a/packages/lint/src/runtime-gate.datasource-writes.test.ts +++ b/packages/lint/src/runtime-gate.datasource-writes.test.ts @@ -358,11 +358,12 @@ describe('#19568 — DARK: what this crossing did NOT widen', () => { }); it('the types still awaiting their own readings are untouched', () => { - // The standing ungated controls: group B reads `translation` / `tool` - // first, group D retires `doc` / `external_catalog`, and `skill` stays - // outside the door by design (ruling `5791822697` on #19527), for the - // reason this file tested itself against. - expect(runtimeAuthoringRulesFor('translation')).toEqual([]); + // The standing ungated controls: group B reads `tool` first (`translation` + // crossed on its own reading, #38623, and `capability`, a runtime-creatable + // type no rule gates, holds its place here), group D retires `doc` / + // `external_catalog`, and `skill` stays outside the door by design (ruling + // `5791822697` on #19527), for the reason this file tested itself against. + expect(runtimeAuthoringRulesFor('capability')).toEqual([]); expect(runtimeAuthoringRulesFor('tool')).toEqual([]); expect(runtimeAuthoringRulesFor('doc')).toEqual([]); expect(runtimeAuthoringRulesFor('external_catalog')).toEqual([]); diff --git a/packages/lint/src/runtime-gate.inert-type-writes.test.ts b/packages/lint/src/runtime-gate.inert-type-writes.test.ts index 9c77a4a7fb6..8238d00e2a6 100644 --- a/packages/lint/src/runtime-gate.inert-type-writes.test.ts +++ b/packages/lint/src/runtime-gate.inert-type-writes.test.ts @@ -1035,9 +1035,10 @@ describe('#19542 — DARK: what the five crossings did NOT widen', () => { }); it('crossing these five widened no OTHER type s roster', () => { - // The card is six metadata types, five of them wired. `translation` is the standing - // ungated control — its own ruling group (B) reads first. - expect(runtimeAuthoringRulesFor('translation')).toEqual([]); + // The card is six metadata types, five of them wired. `translation` stood here as + // the standing ungated control until its own group B reading crossed it (#38623); + // the control is now `capability`, a runtime-creatable type no rule gates. + expect(runtimeAuthoringRulesFor('capability')).toEqual([]); expect(runtimeAuthoringRulesFor('doc')).toEqual([]); expect(runtimeAuthoringRulesFor('external_catalog')).toEqual([]); expect(runtimeAuthoringRulesFor('tool')).toEqual([]); diff --git a/packages/lint/src/runtime-gate.test.ts b/packages/lint/src/runtime-gate.test.ts index 8dd64e52e9a..d651f0995ae 100644 --- a/packages/lint/src/runtime-gate.test.ts +++ b/packages/lint/src/runtime-gate.test.ts @@ -182,7 +182,8 @@ describe('runtime publish gate (#4463)', () => { // ── Dispatch ───────────────────────────────────────────────────────── it('runs nothing for a metadata type no rule gates', () => { - const result = runRuntimeAuthoringRules({ type: 'translation', item: { name: 'x' } }); + // `doc`: `translation` held this place until #38623 crossed it. + const result = runRuntimeAuthoringRules({ type: 'doc', item: { name: 'x' } }); expect(result.rulesRun).toEqual([]); expect(result.errors).toEqual([]); }); @@ -224,7 +225,8 @@ describe('runtime publish gate (#4463)', () => { }; it('returns null for an unmapped type or a non-object body', () => { - expect(buildRuntimeWriteSnapshots({ type: 'translation', item: { name: 'x' }, context })).toBeNull(); + // `doc` is unmapped; `translation` held this place until #38623 mapped it. + expect(buildRuntimeWriteSnapshots({ type: 'doc', item: { name: 'x' }, context })).toBeNull(); expect(buildRuntimeWriteSnapshots({ type: 'flow', item: 'not-an-object', context })).toBeNull(); }); diff --git a/packages/lint/src/runtime-gate.ts b/packages/lint/src/runtime-gate.ts index 5706700cc16..9114d594fb3 100644 --- a/packages/lint/src/runtime-gate.ts +++ b/packages/lint/src/runtime-gate.ts @@ -322,6 +322,18 @@ const TYPE_TO_STACK_KEY: Readonly> = { // snapshot carries, and nothing into a sibling source. Unlike the // `ai_context` row, its errors refuse the publish (the rule is gating). knowledge_source: 'knowledgeSources', + // [#38623] `translation` — `allowRuntimeCreate: true`, so Studio, REST + // `/meta` and an MCP/AI author save translation items at runtime, and until + // this row such an item naming a key nothing declares was published `valid` + // while `os validate` refused it. ⛔ NOT a mapping ahead of its rule: + // `validateTranslationReferences` crosses with this row and opens on + // `stack.translations`. The written ITEM (one bundle entry plus its + // `locale`) lands there as the sole member, and the rule's save-door reading + // reads it as an item rather than a locale-keyed bundle. Not a context row: + // the rule resolves the item's keys into `objects` and `permissions`, which + // every snapshot already carries, and judges only the families those answer + // (apps and navigation are not judged here; see that reading). + translation: 'translations', }; /** diff --git a/packages/lint/src/validate-translation-references.ts b/packages/lint/src/validate-translation-references.ts index b1538552acd..4a5709d9f84 100644 --- a/packages/lint/src/validate-translation-references.ts +++ b/packages/lint/src/validate-translation-references.ts @@ -262,6 +262,41 @@ * errors, on the per-package leg exactly as on the union one. See * {@link contributedNavItemsByApp} and the object-extension note above * {@link artifactProvidedRecords} for the fold facts each rests on, and this rule's test file for the lit controls. + * + * ── At the metadata save door (#38623) ─────────────────────────────────── + * + * A `translation` item saved over the metadata API (Studio, REST `/meta`, an + * MCP/AI author) reaches this rule through the runtime publish gate, which + * hands it a per-write snapshot: the written item as `translations[0]`, beside + * the live `objects` / `permissions` / `books` / `datasets` and nothing else + * (`RuntimeStackContext`). {@link TranslationReferenceOptions.atSaveDoor} is + * that reading, and it changes three things: + * + * 1. **The entry is an ITEM, not a bundle.** `TranslationItemSchema` is one + * bundle entry plus its `locale`, so the entry is read as + * `{ [item.locale]: item }` and its paths carry no locale segment + * (`translations[0].objects..fields.`). An entry with no `locale` + * is judged as nothing, never as a bundle. + * 2. **Only the families the snapshot can answer are judged**: + * `objects.` (and only when the gate did NOT narrow `objects` to a + * package closure: the i18n layer is process-wide, so a translation may + * name an object outside the written package's closure), + * `objects..fields.` with its `options` (only for a field that + * declares them inline: a picklist-bound field's served options are not in + * the snapshot), `._validations`, `._milestones` and `permissions.`. + * Every other family resolves into a collection the snapshot does not + * carry — views, pages, forms, stack-level actions, apps and their + * navigation (platform contributions included), dashboards, flows, hooks, + * picklists, positions, reports, mappings, books (whose implicit + * per-package book is named by a package id the snapshot never sees) — + * and is skipped wholly. Measured on `examples/app-showcase`'s bundle: + * the full rule on that snapshot reports 85 orphans the whole stack does + * not; the judged families report 0 of 287 keys. ⛔ Never widen this set + * without carrying the collection the family resolves into. + * 3. **Every finding is a `warning`.** The door reports it on the save and + * publish answer (`advisories`) and never refuses: a published item that + * names a key an upgrade removed must still load and save. `os validate` + * keeps `error` for the same key. */ import { AUDIENCE_ANCHOR_POSITIONS, expandViewContainer } from '@objectstack/spec'; @@ -371,6 +406,56 @@ export interface TranslationRefFinding { hint: string; } +/** How the rule reads the stack it is handed. */ +export interface TranslationReferenceOptions { + /** + * `true` at the runtime publish door (`AuthoringRuleContext.runtimeWriteType` + * is `translation`): `translations[]` holds the written ITEM, only the + * families the per-write snapshot can answer are judged, and every finding + * is a `warning` (see the module's "At the metadata save door" note). + * Absent or `false` (the CLI commands), the whole rule runs at its own + * severities. + */ + atSaveDoor?: boolean; + /** + * `true` when the gate narrowed `objects` to the written package's closure + * (`AuthoringRuleContext.packageScope` stated). An object name the snapshot + * does not carry may then exist outside the closure, so it is not judged. + * Read only with {@link atSaveDoor}. + */ + objectsNarrowed?: boolean; +} + +/** [#38623] The groups the save door judges; see the module's save-door note. */ +const DOOR_JUDGED_GROUPS: ReadonlySet = new Set(['objects', 'permissions']); +/** [#38623] The sub-keys of `objects.` the save door judges. */ +const DOOR_JUDGED_OBJECT_KEYS: ReadonlySet = new Set(['fields', '_validations', '_milestones']); + +/** + * [#38623] One locale's data reduced to the families the save door judges: + * `objects..(fields | _validations | _milestones)` and `permissions`. + * Every other group and object sub-key is dropped, so no rung below reads it. + */ +function doorJudgedSubset(data: AnyRec): AnyRec { + const out: AnyRec = {}; + for (const group of DOOR_JUDGED_GROUPS) { + if (!(group in data)) continue; + if (group !== 'objects') { + out[group] = data[group]; + continue; + } + const objects: AnyRec = {}; + for (const [objectName, node] of Object.entries(asRecord(data.objects))) { + if (!isRec(node)) continue; + const kept: AnyRec = {}; + for (const key of DOOR_JUDGED_OBJECT_KEYS) if (key in node) kept[key] = node[key]; + objects[objectName] = kept; + } + out.objects = objects; + } + return out; +} + type AnyRec = Record; function isRec(v: unknown): v is AnyRec { @@ -1972,9 +2057,13 @@ function localePath(bundleIndex: number, locale: string): string { * Validate every reference a translation bundle makes against the metadata it * claims to translate. Returns findings (empty = clean). */ -export function validateTranslationReferences(stack: AnyRec): TranslationRefFinding[] { +export function validateTranslationReferences( + stack: AnyRec, + options: TranslationReferenceOptions = {}, +): TranslationRefFinding[] { const findings: TranslationRefFinding[] = []; if (!isRec(stack)) return findings; + const atSaveDoor = options.atSaveDoor === true; const bundles = Array.isArray(stack.translations) ? stack.translations : []; if (bundles.length === 0) return findings; @@ -2002,9 +2091,14 @@ export function validateTranslationReferences(stack: AnyRec): TranslationRefFind const bundle = bundles[bi]; if (!isRec(bundle)) continue; - for (const [locale, rawData] of Object.entries(bundle)) { + // [#38623] At the save door the entry is one ITEM (its own `locale`), and + // only the families the snapshot answers survive into the walk below. + const localeEntries: Array<[string, unknown]> = atSaveDoor + ? (typeof bundle.locale === 'string' ? [[bundle.locale, doorJudgedSubset(bundle)]] : []) + : Object.entries(bundle); + for (const [locale, rawData] of localeEntries) { if (!isRec(rawData)) continue; - const base = localePath(bi, locale); + const base = atSaveDoor ? `translations[${bi}]` : localePath(bi, locale); const inLocale = `locale "${locale}"`; // ── objects..… ────────────────────────────────────────────── @@ -2014,6 +2108,9 @@ export function validateTranslationReferences(stack: AnyRec): TranslationRefFind const facts = universe.objects.get(objectName); if (!facts) { + // [#38623] Under a package closure the snapshot's objects are that + // closure, and a translation may name an object outside it. + if (atSaveDoor && options.objectsNarrowed === true) continue; // Not this stack's object. Platform objects are translated by their // owning package but a stack may override them, so a registered // platform name is legitimate — and unreadable from here, which is @@ -2066,6 +2163,9 @@ export function validateTranslationReferences(stack: AnyRec): TranslationRefFind continue; } if (!isRec(rawField)) continue; + // [#38623] A field with no inline options may be picklist-bound, and + // its served options are not in the door's snapshot. + if (atSaveDoor && !readOptions(field)) continue; checkOptionKeys(findings, { optionMap: rawField.options, field, @@ -2908,6 +3008,9 @@ export function validateTranslationReferences(stack: AnyRec): TranslationRefFind } } + // [#38623] The save door advises and never refuses: an item naming a key an + // upgrade removed must still load and save. + if (atSaveDoor) return findings.map((f) => (f.severity === 'warning' ? f : { ...f, severity: 'warning' })); return findings; } From 66c22be8a3d6539f61f9f38c6efe4784a58b0c8f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 19:03:19 +0000 Subject: [PATCH 2/5] test(lint): pin the translation save door; add the changeset Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude --- .changeset/38623-translation-target-door.md | 14 ++ .../lint/src/reference-integrity-suite.ts | 18 +- ...time-gate.translation-writes-38623.test.ts | 144 +++++++++++ .../src/validate-translation-references.ts | 38 +-- ...ocol.translation-target-door-38623.test.ts | 223 ++++++++++++++++++ 5 files changed, 407 insertions(+), 30 deletions(-) create mode 100644 .changeset/38623-translation-target-door.md create mode 100644 packages/lint/src/runtime-gate.translation-writes-38623.test.ts create mode 100644 packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts diff --git a/.changeset/38623-translation-target-door.md b/.changeset/38623-translation-target-door.md new file mode 100644 index 00000000000..56713d91cf2 --- /dev/null +++ b/.changeset/38623-translation-target-door.md @@ -0,0 +1,14 @@ +--- +'@objectstack/lint': patch +--- + +feat(lint): the metadata save door advises on a translation key nothing declares + +Clause-②: no +Metadata-protocol: none + +A `translation` item saved or published over the metadata API (Studio, REST `/meta`, an MCP or AI author) that names a key nothing declares now gets a `translation-target-unknown` advisory on the save and publish answer (`advisories`, severity `warning`). Before this, no rule ran on a `translation` write: the item was accepted as valid while `os validate` refused the same key. + +The door never refuses such a write. A published item that names a key an upgrade removed still loads and saves, and `os validate` keeps reporting it at `error`. + +The door judges only the families its per-write snapshot carries: `objects.NAME` (not when the write's package closure narrowed the objects), `objects.NAME.fields.FIELD` and the field's inline `options`, `objects.NAME._validations.RULE`, `objects.NAME._milestones.FIELD.VALUE`, and `permissions.NAME`. Every other family is not judged at the door, because the snapshot carries no collection to resolve it against. That covers apps and their navigation (platform-contributed items included), views, sections, tabs, related lists, actions, dashboards, forms, pages, picklists, positions, reports, mappings, books, flows and hooks. `os validate` still judges all of them. diff --git a/packages/lint/src/reference-integrity-suite.ts b/packages/lint/src/reference-integrity-suite.ts index 45c2ae3789f..f2e397375de 100644 --- a/packages/lint/src/reference-integrity-suite.ts +++ b/packages/lint/src/reference-integrity-suite.ts @@ -710,8 +710,8 @@ export const REFERENCE_INTEGRITY_RULES: readonly ReferenceIntegrityRule[] = [ // [#38623] `runtimeTypes` gains `translation`: a translation item saved over // the metadata API (Studio, REST `/meta`, an MCP/AI author) was published // `valid` while `os validate` refused the same orphan key. At that door the - // rule takes its save-door reading (`atSaveDoor`, read off - // `ctx.runtimeWriteType` as the members above read `wholeCollection`): it + // rule takes its save-door reading off `ctx.runtimeWriteType`, the signal + // the members above read for `wholeCollection`: it // judges only the families the per-write snapshot carries — `objects.` // (not under a package closure), its `fields` (with inline `options`), // `_validations`, `_milestones`, and `permissions.` — and reports at @@ -721,17 +721,9 @@ export const REFERENCE_INTEGRITY_RULES: readonly ReferenceIntegrityRule[] = [ // MEASURED before crossing on `examples/app-showcase`'s bundle at the door's // own snapshot: the unrestricted rule reports 85 orphans the whole stack does // not; the judged families report 0 of 287 keys, as on the whole stack. - { - name: 'validateTranslationReferences', - runtimeTypes: ['flow', 'translation'], - run: (stack, ctx) => - validateTranslationReferences( - stack, - ctx?.runtimeWriteType === 'translation' - ? { atSaveDoor: true, objectsNarrowed: ctx.packageScope !== undefined } - : {}, - ), - }, + // The member hands its run context straight through: the rule reads + // `runtimeWriteType` and `packageScope` off it (`TranslationReferenceOptions`). + { name: 'validateTranslationReferences', runtimeTypes: ['flow', 'translation'], run: validateTranslationReferences }, // The same family from the other end (#5417). Its sibling above asks "does // this bundle key resolve?"; this one asks "is there a key at all?" — a form // section authored with a `label` and no `name` renders a heading that diff --git a/packages/lint/src/runtime-gate.translation-writes-38623.test.ts b/packages/lint/src/runtime-gate.translation-writes-38623.test.ts new file mode 100644 index 00000000000..dff4ef568e0 --- /dev/null +++ b/packages/lint/src/runtime-gate.translation-writes-38623.test.ts @@ -0,0 +1,144 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * #38623 — a `translation` write at the runtime publish gate. + * + * A translation item saved over the metadata API naming a key nothing declares + * was published `valid`, because no rule ran on a `translation` write, while + * `os validate` refused the same key (`translation-target-unknown`). The gate + * now dispatches `validateTranslationReferences` on that write, in its + * save-door reading: only the families the per-write snapshot carries are + * judged, and every finding is a `warning`, so it rides `advisories` and never + * `errors` (a published item naming a key an upgrade removed must still load + * and save). + * + * These pins go through the gate's own entry (`runRuntimeAuthoringRules`), the + * function the metadata door calls, never a mirror of its snapshot. + */ +import { describe, expect, it } from 'vitest'; + +import { + runRuntimeAuthoringRules, + runtimeAuthoringRulesFor, + stackKeyForType, +} from './runtime-gate.js'; +import { REFERENCE_INTEGRITY_RULES } from './reference-integrity-suite.js'; +import { validateTranslationReferences, TRANSLATION_TARGET_UNKNOWN } from './validate-translation-references.js'; + +const OBJECTS = [ + { + name: 'crm_lead', + fields: { + name: { type: 'text' }, + stage: { type: 'select', options: [{ value: 'new', label: 'New' }, { value: 'won', label: 'Won' }] }, + region: { type: 'select', picklist: 'regions' }, + }, + validations: [{ name: 'name_required', type: 'script', condition: 'true', message: 'Name is required' }], + }, +]; +const PERMISSIONS = [{ name: 'sales_rep', label: 'Sales Rep' }]; +const CONTEXT = { objects: OBJECTS, permissions: PERMISSIONS, books: [], datasets: [] }; + +const item = (over: Record) => ({ name: 'zh_cn', locale: 'zh-CN', ...over }); + +const publish = (body: unknown, extra: Record = {}) => + runRuntimeAuthoringRules({ type: 'translation', item: body, context: CONTEXT, ...extra }); + +const rulesOf = (fs: Array<{ rule: string }>) => fs.map((f) => f.rule); + +describe('a translation write reaches the translation rule at the door (#38623)', () => { + it('the write type dispatches the suite, and the suite dispatches exactly the translation member', () => { + expect(stackKeyForType('translation')).toBe('translations'); + expect(runtimeAuthoringRulesFor('translation').map((r) => r.name)).toEqual(['validateReferenceIntegrity']); + const members = REFERENCE_INTEGRITY_RULES + .filter((m) => (m.runtimeTypes ?? ['flow']).includes('translation')) + .map((m) => m.name); + expect(members).toEqual(['validateTranslationReferences']); + }); + + it('⭐ LIT — a removed field key answers with the advisory, never an error', () => { + const result = publish(item({ objects: { crm_lead: { fields: { zzz_removed: { label: '旧字段' } } } } })); + expect(result.errors).toEqual([]); + expect(rulesOf(result.advisories)).toEqual([TRANSLATION_TARGET_UNKNOWN]); + expect(result.advisories[0]!.severity).toBe('warning'); + expect(result.advisories[0]!.path).toBe('translations[0].objects.crm_lead.fields.zzz_removed'); + expect(result.rulesRun).toEqual(['validateReferenceIntegrity']); + }); + + it('⭐ LIT — an object, a validation rule and a milestone nothing declares are advised too', () => { + const result = publish(item({ + objects: { + crm_gone: { label: '旧对象' }, + crm_lead: { _validations: { zzz_rule: { message: 'x' } }, _milestones: { stage: { won: 'x' } } }, + }, + })); + expect(result.errors).toEqual([]); + expect(result.advisories.map((f) => f.path).sort()).toEqual([ + 'translations[0].objects.crm_gone', + 'translations[0].objects.crm_lead._milestones.stage.won', + 'translations[0].objects.crm_lead._validations.zzz_rule', + ]); + }); + + it('⭐ LIT — a permission-set orphan answers with the advisory', () => { + const result = publish(item({ permissions: { zzz_gone_set: { label: '旧权限集' } } })); + expect(result.errors).toEqual([]); + expect(result.advisories.map((f) => [f.rule, f.path])).toEqual([ + [TRANSLATION_TARGET_UNKNOWN, 'translations[0].permissions.zzz_gone_set'], + ]); + }); + + it('DARK — live keys answer with none', () => { + const result = publish(item({ + objects: { + crm_lead: { + label: '线索', + fields: { name: { label: '名称' }, stage: { label: '阶段', options: { new: '新建', won: '赢单' } } }, + _validations: { name_required: { message: '名称必填' } }, + }, + }, + permissions: { sales_rep: { label: '销售' } }, + })); + expect(result.errors).toEqual([]); + expect(result.advisories).toEqual([]); + }); + + it('DARK — families the snapshot does not carry are not judged at the door', () => { + // Apps and their navigation, views, sections, global actions, positions: + // each resolves into a collection no per-write snapshot carries, so a key + // there is never guessed unknown here (`os validate` still judges it). + const result = publish(item({ + apps: { studio: { navigation: { nav_zzz_gone: { label: 'x' } } } }, + globalActions: { zzz_action: { label: 'x' } }, + positions: { zzz_position: { label: 'x' } }, + objects: { crm_lead: { _views: { zzz_view: { label: 'x' } }, _sections: { zzz_section: { label: 'x' } } } }, + })); + expect(result.errors).toEqual([]); + expect(result.advisories).toEqual([]); + }); + + it('DARK — a picklist-bound field\'s option keys are not judged (its served options are not in the snapshot)', () => { + const result = publish(item({ objects: { crm_lead: { fields: { region: { options: { emea: '欧洲' } } } } } })); + expect(result.advisories).toEqual([]); + }); + + it('DARK — under a package closure an object the snapshot lacks is not judged; its fields still are', () => { + const scope = { packageId: 'com.acme.crm', dependencies: [] }; + const result = publish( + item({ objects: { crm_other_pkg: { label: 'x' }, crm_lead: { fields: { zzz_removed: { label: 'x' } } } } }), + { packageScope: scope, context: { ...CONTEXT, objects: OBJECTS.map((o) => ({ ...o, _packageId: 'com.acme.crm' })) } }, + ); + expect(result.errors).toEqual([]); + expect(result.advisories.map((f) => f.path)).toEqual(['translations[0].objects.crm_lead.fields.zzz_removed']); + }); + + it('the CLI reading of the same key is unchanged: a bundle, at error', () => { + const findings = validateTranslationReferences({ + objects: OBJECTS, + translations: [{ 'zh-CN': { objects: { crm_lead: { fields: { zzz_removed: { label: 'x' } } } } } }], + }); + expect(findings.map((f) => [f.severity, f.path])).toEqual([ + ['error', 'translations[0]["zh-CN"].objects.crm_lead.fields.zzz_removed'], + ]); + }); +}); diff --git a/packages/lint/src/validate-translation-references.ts b/packages/lint/src/validate-translation-references.ts index 4a5709d9f84..59fea1c9d8b 100644 --- a/packages/lint/src/validate-translation-references.ts +++ b/packages/lint/src/validate-translation-references.ts @@ -269,8 +269,8 @@ * MCP/AI author) reaches this rule through the runtime publish gate, which * hands it a per-write snapshot: the written item as `translations[0]`, beside * the live `objects` / `permissions` / `books` / `datasets` and nothing else - * (`RuntimeStackContext`). {@link TranslationReferenceOptions.atSaveDoor} is - * that reading, and it changes three things: + * (`RuntimeStackContext`). {@link TranslationReferenceOptions.runtimeWriteType} + * `translation` is that reading, and it changes three things: * * 1. **The entry is an ITEM, not a bundle.** `TranslationItemSchema` is one * bundle entry plus its `locale`, so the entry is read as @@ -406,24 +406,28 @@ export interface TranslationRefFinding { hint: string; } -/** How the rule reads the stack it is handed. */ +/** + * How the rule reads the stack it is handed — the two + * `ReferenceIntegrityRunOptions` fields it reads, so the suite hands its run + * context straight through. + */ export interface TranslationReferenceOptions { /** - * `true` at the runtime publish door (`AuthoringRuleContext.runtimeWriteType` - * is `translation`): `translations[]` holds the written ITEM, only the - * families the per-write snapshot can answer are judged, and every finding - * is a `warning` (see the module's "At the metadata save door" note). - * Absent or `false` (the CLI commands), the whole rule runs at its own - * severities. + * The write type the runtime publish gate is judging + * (`AuthoringRuleContext.runtimeWriteType`). `translation` is the save-door + * reading: `translations[]` holds the written ITEM, only the families the + * per-write snapshot can answer are judged, and every finding is a `warning` + * (see the module's "At the metadata save door" note). Any other value, or + * absent (the CLI commands), runs the whole rule at its own severities. */ - atSaveDoor?: boolean; + runtimeWriteType?: string; /** - * `true` when the gate narrowed `objects` to the written package's closure - * (`AuthoringRuleContext.packageScope` stated). An object name the snapshot - * does not carry may then exist outside the closure, so it is not judged. - * Read only with {@link atSaveDoor}. + * The closure the gate narrowed `objects` to, stated exactly when it did + * (`AuthoringRuleContext.packageScope`). Present at the save door, an object + * name the snapshot does not carry may exist outside the closure, so it is + * not judged. Read only on a `translation` write. */ - objectsNarrowed?: boolean; + packageScope?: unknown; } /** [#38623] The groups the save door judges; see the module's save-door note. */ @@ -2063,7 +2067,7 @@ export function validateTranslationReferences( ): TranslationRefFinding[] { const findings: TranslationRefFinding[] = []; if (!isRec(stack)) return findings; - const atSaveDoor = options.atSaveDoor === true; + const atSaveDoor = options.runtimeWriteType === 'translation'; const bundles = Array.isArray(stack.translations) ? stack.translations : []; if (bundles.length === 0) return findings; @@ -2110,7 +2114,7 @@ export function validateTranslationReferences( if (!facts) { // [#38623] Under a package closure the snapshot's objects are that // closure, and a translation may name an object outside it. - if (atSaveDoor && options.objectsNarrowed === true) continue; + if (atSaveDoor && options.packageScope !== undefined) continue; // Not this stack's object. Platform objects are translated by their // owning package but a stack may override them, so a registered // platform name is legitimate — and unreadable from here, which is diff --git a/packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts b/packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts new file mode 100644 index 00000000000..90193692599 --- /dev/null +++ b/packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts @@ -0,0 +1,223 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * #38623 — the metadata save door reports a translation key nothing declares. + * + * Before: `saveMetaItem` of a `translation` item naming a removed field + * answered `success` with no word at all — no rule ran on a `translation` + * write — while `os validate` refused the same key + * (`translation-target-unknown`). Studio, REST `/meta` and an MCP/AI author + * were told nothing. + * + * After: the same save answers with the finding on its `advisories`, at + * `warning`. It is never a 422: a published item naming a key an upgrade + * removed must still load and save. Only the families the gate's snapshot + * carries are judged (objects, their fields, validation rules and milestones, + * permission sets); the lint-side pins in + * `@objectstack/lint`'s `runtime-gate.translation-writes-38623.test.ts` name + * the rest. + * + * Harness: the real repository write path over a stub engine — the shape of + * `protocol.runtime-authoring-gate.test.ts`, because a gate INSIDE + * `saveMetaItem` cannot be tested against a harness that mocks it. + */ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { + assertEngineDeleteDispatch, + assertEngineFindOnePredicate, + assertEngineUpdateDispatch, +} from '@objectstack/metadata-core'; +// The protocol module reaches a dynamic `import('@objectstack/lint')` (metadata diagnostics): pay its load at collection. +import '@objectstack/lint'; +import { ObjectStackProtocolImplementation } from './protocol.js'; +import { NO_PACKAGE_SCOPED_READS } from './no-package-scoped-reads.testkit.js'; + +interface Row { + id: string; + type: string; + name: string; + organization_id: string | null; + state: string; + metadata: string; +} + +const keyOf = (w: Record) => + `${w.type}|${w.name}|${w.organization_id ?? '__env__'}|${w.state ?? 'active'}`; + +const whereValueMatches = (actual: unknown, want: unknown): boolean => + want !== null && typeof want === 'object' && Array.isArray((want as { $in?: unknown }).$in) + ? (want as { $in: unknown[] }).$in.includes(actual) + : actual === want; + +/** The live universe the door resolves translation keys against. */ +const LIVE_OBJECTS = [ + { + name: 'crm_lead', + fields: { + name: { type: 'text' }, + stage: { type: 'select', options: [{ value: 'new', label: 'New' }, { value: 'won', label: 'Won' }] }, + }, + validations: [{ name: 'name_required', type: 'script', condition: 'true', message: 'Name is required' }], + }, +]; +const LIVE_PERMISSION_SETS = [{ name: 'sales_rep', label: 'Sales Rep', objects: {} }]; + +function makeProtocol() { + // Keyed BY TABLE: one flat map would answer a `sys_metadata` read with the + // history and commit journals' rows (see `protocol.runtime-authoring-gate.test.ts`). + const tables = new Map>(); + const tableOf = (table: string): Map => { + let t = tables.get(table); + if (!t) tables.set(table, (t = new Map())); + return t; + }; + let nextId = 0; + const findRow = (table: string, w: Record): { key: string; row: Row } | null => { + for (const [k, r] of tableOf(table)) { + if (w.id !== undefined) { + if (r.id === w.id) return { key: k, row: r }; + continue; + } + if (w.type !== undefined && !whereValueMatches(r.type, w.type)) continue; + if (w.name !== undefined && r.name !== w.name) continue; + if (w.organization_id !== undefined && r.organization_id !== w.organization_id) continue; + if (w.state !== undefined && r.state !== w.state) continue; + return { key: k, row: r }; + } + return null; + }; + const engine: any = { + async findOne(table: string, opts: { where: Record }) { + assertEngineFindOnePredicate(table, opts); + return findRow(table, opts.where)?.row ?? null; + }, + async find(table: string, opts: { where: Record }) { + return Array.from(tableOf(table).values()).filter((r) => { + if (opts.where.type && !whereValueMatches(r.type, opts.where.type)) return false; + if (opts.where.name !== undefined && r.name !== opts.where.name) return false; + if (opts.where.organization_id !== undefined && r.organization_id !== opts.where.organization_id) return false; + if (opts.where.state && r.state !== opts.where.state) return false; + return true; + }); + }, + async insert(table: string, data: Record) { + nextId += 1; + const row = { id: `r_${nextId}`, ...(data as any) } as Row; + tableOf(table).set(keyOf(data), row); + return { id: row.id }; + }, + async update(table: string, data: Record, opts: { where: Record }) { + assertEngineUpdateDispatch(data, opts); + const found = findRow(table, opts.where); + if (!found) return { id: null }; + tableOf(table).set(found.key, { ...found.row, ...(data as any) }); + return { id: found.row.id }; + }, + async delete(table: string, opts: { where: Record }) { + assertEngineDeleteDispatch(opts); + const found = findRow(table, opts.where); + if (!found) return { deleted: 0 }; + tableOf(table).delete(found.key); + return { deleted: 1 }; + }, + async syncObjectSchema() { + return true; + }, + registry: { + ...NO_PACKAGE_SCOPED_READS, + registerItem: () => {}, + registerObject: () => {}, + listItems: (type: string) => + type === 'object' ? LIVE_OBJECTS : type === 'permission' ? LIVE_PERMISSION_SETS : [], + getItem: () => undefined, + getPackage: () => undefined, + }, + }; + const protocol = new ObjectStackProtocolImplementation(engine, () => new Map(), 'env_test'); + const activeTranslations = () => + Array.from(tableOf('sys_metadata').values()).filter((r) => r.type === 'translation' && r.state === 'active'); + return { protocol: protocol as any, activeTranslations }; +} + +const translation = (name: string, groups: Record) => ({ name, locale: 'zh-CN', ...groups }); + +const saveTranslation = (protocol: any, name: string, groups: Record, extra: Record = {}) => + protocol.saveMetaItem({ type: 'translation', name, item: translation(name, groups), ...extra }); + +const REMOVED_FIELD = { objects: { crm_lead: { fields: { zzz_removed: { label: '旧字段' } } } } }; +const LIVE_KEYS = { + objects: { + crm_lead: { + label: '线索', + fields: { name: { label: '名称' }, stage: { options: { new: '新建', won: '赢单' } } }, + _validations: { name_required: { message: '名称必填' } }, + }, + }, + permissions: { sales_rep: { label: '销售' } }, +}; + +const advisoryPaths = (result: any) => + (result.advisories ?? []) + .filter((a: any) => a.rule === 'translation-target-unknown') + .map((a: any) => a.path); + +describe('the metadata save door advises on a translation key nothing declares (#38623)', () => { + let warn: ReturnType; + beforeEach(() => { + warn = vi.spyOn(console, 'warn').mockImplementation(() => {}); + }); + afterEach(() => { + warn.mockRestore(); + }); + + it('⭐ LIT — an active save naming a removed field succeeds and answers with the advisory', async () => { + const { protocol, activeTranslations } = makeProtocol(); + const result = await saveTranslation(protocol, 'zh_cn', REMOVED_FIELD); + + expect(result.success).toBe(true); + expect(advisoryPaths(result)).toEqual(['translations[0].objects.crm_lead.fields.zzz_removed']); + const advisory = result.advisories.find((a: any) => a.rule === 'translation-target-unknown'); + expect(advisory.where).toContain('zzz_removed'); + // Never a refusal: the item landed. + expect(activeTranslations().map((r) => r.name)).toEqual(['zh_cn']); + }); + + it('⭐ LIT — publishing a draft naming a removed field answers with the advisory', async () => { + const { protocol, activeTranslations } = makeProtocol(); + const draft = await saveTranslation(protocol, 'zh_cn', REMOVED_FIELD, { mode: 'draft' }); + // D1: a draft is never gated, so its save says nothing about the key. + expect(advisoryPaths(draft)).toEqual([]); + + const published = await protocol.publishMetaItem({ type: 'translation', name: 'zh_cn' }); + expect(published.success).toBe(true); + expect(advisoryPaths(published)).toEqual(['translations[0].objects.crm_lead.fields.zzz_removed']); + expect(activeTranslations().map((r) => r.name)).toEqual(['zh_cn']); + }); + + it('⭐ LIT — a permission-set orphan answers with the advisory', async () => { + const { protocol } = makeProtocol(); + const result = await saveTranslation(protocol, 'zh_cn', { permissions: { zzz_gone_set: { label: '旧权限集' } } }); + expect(result.success).toBe(true); + expect(advisoryPaths(result)).toEqual(['translations[0].permissions.zzz_gone_set']); + }); + + it('DARK — a save of live keys answers with none', async () => { + const { protocol } = makeProtocol(); + const result = await saveTranslation(protocol, 'zh_cn', LIVE_KEYS); + expect(result.success).toBe(true); + expect(result.advisories ?? []).toEqual([]); + }); + + it('DARK — an already-published orphan does not block, or ride on, an unrelated write', async () => { + const { protocol, activeTranslations } = makeProtocol(); + const first = await saveTranslation(protocol, 'zh_cn', REMOVED_FIELD); + expect(advisoryPaths(first)).toHaveLength(1); + + // Another translation item, all live: the stored orphan is not in its + // snapshot (only the written item is), so it is neither refused nor told. + const second = await saveTranslation(protocol, 'zh_cn_extra', LIVE_KEYS); + expect(second.success).toBe(true); + expect(second.advisories ?? []).toEqual([]); + expect(activeTranslations().map((r) => r.name).sort()).toEqual(['zh_cn', 'zh_cn_extra']); + }); +}); From 266bea7921e5c8646bfc6dc19d186da94f1fbc5f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 20:07:42 +0000 Subject: [PATCH 3/5] test(metadata-protocol): the door pin's find double honours every where key and the limit Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude --- ...protocol.translation-target-door-38623.test.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts b/packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts index 90193692599..429216b3792 100644 --- a/packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts +++ b/packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts @@ -91,14 +91,13 @@ function makeProtocol() { assertEngineFindOnePredicate(table, opts); return findRow(table, opts.where)?.row ?? null; }, - async find(table: string, opts: { where: Record }) { - return Array.from(tableOf(table).values()).filter((r) => { - if (opts.where.type && !whereValueMatches(r.type, opts.where.type)) return false; - if (opts.where.name !== undefined && r.name !== opts.where.name) return false; - if (opts.where.organization_id !== undefined && r.organization_id !== opts.where.organization_id) return false; - if (opts.where.state && r.state !== opts.where.state) return false; - return true; - }); + async find(table: string, opts: { where: Record; limit?: number }) { + // Every `where` key is honoured (equality, or the by-name read's `$in`). + const rows = Array.from(tableOf(table).values()).filter((r) => + Object.entries(opts.where ?? {}).every(([key, want]) => + want === undefined || whereValueMatches((r as unknown as Record)[key], want))); + // The caller's bound, applied after the filter, by presence. + return typeof opts?.limit === 'number' ? rows.slice(0, opts.limit) : rows; }, async insert(table: string, data: Record) { nextId += 1; From 8775b0684ddc2475bda88b8cc97932f3b04c5a07 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 20:38:48 +0000 Subject: [PATCH 4/5] chore(engine-double-contract): record the translation door pin's three engine doubles Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude --- scripts/engine-double-contract.pinned.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/engine-double-contract.pinned.json b/scripts/engine-double-contract.pinned.json index 59522064a98..10771f756bf 100644 --- a/scripts/engine-double-contract.pinned.json +++ b/scripts/engine-double-contract.pinned.json @@ -2361,6 +2361,21 @@ "verb": "update", "pinned": 1 }, + { + "file": "packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts", + "verb": "delete", + "pinned": 1 + }, + { + "file": "packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts", + "verb": "findOne", + "pinned": 1 + }, + { + "file": "packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts", + "verb": "update", + "pinned": 1 + }, { "file": "packages/metadata-protocol/src/protocol.unknown-datasource-refusal.test.ts", "verb": "delete", From 9b075e6069b223c2c39b15ecce991e07d6235006 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 20:51:37 +0000 Subject: [PATCH 5/5] docs(validating-metadata): the reference-integrity row runs on translation writes, advisory only Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude --- content/docs/deployment/validating-metadata.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/deployment/validating-metadata.mdx b/content/docs/deployment/validating-metadata.mdx index 71244eff42d..a2e3963bbab 100644 --- a/content/docs/deployment/validating-metadata.mdx +++ b/content/docs/deployment/validating-metadata.mdx @@ -507,7 +507,7 @@ orthogonal to both, and no cell here can carry it; it is written out in | Ordering comparands naming a date-range preset — `last_30_days` in a `>=` position (#8793) | ✓ | ✓ | ✓ | ✓ᵈᵛᵒᵖᶠʳ | | Empty filter combinators — `$and: []`, `$or: []`, `$not: {}` (#5330) | ✓ | ✓ | ✓ | ✓ᶠʳ | | Object & action name references (#3583) — and the object a seed dataset, a flow `get_record` / `create_record` / `update_record` / `delete_record` / object-form `screen` node or a standalone action is bound to (`object-reference-unknown`, #35143); a flow node's miss is a warning on the CLI, where a declared dependency may define the object, and an error at the publish door; at the publish door a seed over an unknown object is the save door's own refusal (#34864) | ✓ | ✓ | ✓ | ✓ᶠᵈᵗᵃᶜ | -| Reference integrity — flow node writes, template paths, read-only writes (#3583); at the publish door each write type runs only the members that declare it, and the flow members run on `flow` alone (#9313) | ✓ | ✓ | ✓ | ✓ᶠᵛᵒᵈᵗʳᵖᵃᶜ | +| Reference integrity — flow node writes, template paths, read-only writes (#3583); at the publish door each write type runs only the members that declare it, and the flow members run on `flow` alone (#9313); a `translation` write runs only the translation-key member, advisory only and never a 422, on the families the per-write snapshot carries (objects, their fields and inline options, validation rules, milestones, permission sets; apps and navigation are not judged) (#38623) | ✓ | ✓ | ✓ | ✓ᶠᵛᵒᵈᵗʳᵖᵃᶜᵗ | | List-view field members — a list view's `sort` (a `sortable: false` field, a `formula`, an unknown name: `sort-field-unsortable`), its `searchableFields` (`searchable-field-unknown`) and its field references, columns, filter keys, grouping and the board bindings (`list-view-field-unknown`); a filter key on a `formula` field, which the engine refuses to filter by (`list-view-filter-field-virtual`, #35143), and, advisory, a board grouped by a field with no fixed set of lanes (`list-view-kanban-group-field-uncategorical`, #35143); the row merges three members, so its codes follow no one rule's order, and the `page` door runs the sort member only (#9313, #15495, #30095) | ✓ | ✓ | ✓ | ✓ᶠᵛᵒᵖ | | Page-component field bindings (#3583) | ✓ | ✓ | ✓ | ✓ᶠ | | React page block field bindings — §10 (#4340) | ✓ | ✓ | ✓ | ✓ᶠ | @@ -566,12 +566,12 @@ orthogonal to both, and no cell here can carry it; it is written out in writes that rule inspects: `✓ᶠ` `flow`, `✓ᵛ` `view`, `✓ᵈ` `dashboard`, `✓ᵒ` `object`, `✓ᵖ` `page`, `✓ˢ` `seed`, `✓ᵇ` `book`, `✓ᵖᵉ` `permission`, `✓ᵖᵒ` `position`, `✓ᵃ` `app`, `✓ᵉ` `email_template`, `✓ᵈᵗ` `dataset`, `✓ʳ` `report`, -`✓ᵃᶜ` `action`, `✓ʰ` `hook`, `✓ᵐ` `mapping`, `✓ᵈˢ` `datasource`, `✓ᶜ` `connector`, `✓ᵒˣ` `object_extension`** — the two +`✓ᵃᶜ` `action`, `✓ʰ` `hook`, `✓ᵐ` `mapping`, `✓ᵈˢ` `datasource`, `✓ᶜ` `connector`, `✓ᵒˣ` `object_extension`, `✓ᵗ` `translation`** — the two `ᵖ`-initial pairs carry a second letter because `page` already holds `ᵖ` on its own, `dataset` and `datasource` carry `ᵈᵗ` and `ᵈˢ` because `dashboard` holds `ᵈ`, `action` carries `ᵃᶜ` because `app` holds `ᵃ`, and `object_extension` carries `ᵒˣ` because `object` holds `ᵒ`, while `connector` takes the bare `ᶜ`. Read the codes **longest-first**: `ᵖᵒ` is `position`, never `page` followed by `object`, `ᵖᵉ` is `permission`, never `page` followed by -`email_template`, `ᵈᵗ` is `dataset`, `ᵈˢ` is `datasource`, `ᵃᶜ` is `action` and `ᵒˣ` is `object_extension`. +`email_template`, `ᵈᵗ` is `dataset`, `ᵈˢ` is `datasource`, `ᵃᶜ` is `action`, `ᵒˣ` is `object_extension`, and a bare `ᵗ` is `translation` — `ᵈᵗ` is still `dataset`, never `dashboard` followed by `translation`. A row whose rules are members of the reference-integrity suite reads the members' own `runtimeTypes` in `packages/lint/src/reference-integrity-suite.ts`, and a member that declares none runs on `flow` writes only (the suite's frozen