Skip to content

Commit 44ccf94

Browse files
fix(plugin-audit): a milestone row written before its template gained a token reads its stored sentence (#37731)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes #37635 Clause-②: no Metadata-protocol: none Skills-docs: none (no page under `skills/**` describes the stored milestone summary code) ## 维护者速读 - 用户能看到什么变化:应用作者给里程碑摘要模板新加了一个 `{token}` 之后,之前写下的动态记录在中文等翻译语言下不再显示“带空洞”的翻译句,而是显示当时存下的完整英文句。新写的记录不受影响,照常显示翻译。 - 为什么做:#37582 的审核发现,旧行没有新 token 的值,翻译句里那个位置会变成空白,而存下的英文句是完整的。 - 出错会怎样:最坏是某行显示英文原句而不是翻译,不会丢数据,也不会出现空白。 - 要你做什么:无。 ## What changes - **Fallback (item 1)**, `activity-summary-message.ts` + `audit-writers.ts`: - The writer adds `names` to a fired milestone's summary code: every distinct `{token}` name the fired template held, interpolated or not (`milestoneTokenNames`). - The composer renders a translated template only when each token it names either has a stored value or is listed in `names` (it was in the template and its value was empty, so it renders empty as in the stored sentence). Any other token makes `composeActivitySummary` answer `undefined`, so the row keeps its stored sentence, as it already does for a locale with no entry. - `readActivitySummaryMessage` accepts `names` only as a string list, and still reads a code without it. - **One token grammar (item 2, N3)**: `milestoneTokenRe()` moves to `activity-summary-message.ts` and is exported; the writer imports it, and the composer's literal `/\{(\w+)\}/g` is gone. - **Per-read caching (item 3, N4)**, `readerSummaryLocale`: each `(object, field, value)` milestone's answer is computed once per read, and each object's packaged base is read once per read, shared by the translated definition and every milestone answer. - **Stale comments (item 4, N6)**: the `scalarOverridesPackagedBase` jsdoc and the `valueOverridesPackagedBase` jsdoc in `packages/spec/src/system/i18n-resolver.ts` name the five scalars (an object's three, a rule's `message`, a milestone's `summary`) instead of "three scalars" / "its two callers"; the header of `audit-option-label-summary.test.ts` says a reader may now read the milestone composed in its language (#37524), while the stored sentence stays untranslated. - **Changeset**: `@objectstack/plugin-audit` and `@objectstack/spec` patch. Small calls made here (no card): - **How a row tells "empty" from "added later"**: store the template's token names on the row (the card's example). The alternative, a hash or the whole template, carries more and still needs the names to judge a translation. - **A token only the translation names** (not in the authored template) now also keeps the stored sentence. #37582 rendered it empty; a translation with a token the row never had cannot be composed whole either, so one rule covers both. - **Rows written before this change** carry no `names`: they compose only when every token of the translation has a stored value. Such a row with an empty value shows its stored sentence instead of the translation; it never shows a hole. - The cache key is `(object, field, value)`, one level finer than the card's `(object, field)`, because the answer depends on the value; the packaged base is cached per object. ## Why Contract review records 7196337094 and 7197635792 on PR #37582 (accepted deviations and nits, adopted at ACCEPT), carried here per the one-card-per-PR rule. ## Verification Head `48cd3c9dd`: - `packages/plugins/plugin-audit`: `vitest run src/`: 110 files, 1846 tests passed. New cases in `activity-summary-message.test.ts`: red-first for a token added after the row (keeps the stored sentence), an empty listed token renders empty, a translation-only token, a code without `names` (composes when every token has a value, else keeps the stored sentence), one packaged-base read for many rows and two milestones, and `names` validation. `activity-milestone-summary-locale.integration.test.ts` pins the stored `names` and, through the real writer, SQLite driver and read middleware, that a zh-CN reader reads the stored English for a row written before the template gained `{note}`, with the lost row (whose template held `{note}`) still composed as a control. - `tsc --noEmit -p packages/plugins/plugin-audit` and `eslint` on the 5 touched plugin-audit files: exit 0. - `check:changeset-fixed`, `check:test-source-alias`: exit 0. - `node scripts/pm/overlap-check.mjs`: clean (shares `i18n-resolver.ts` with #37422 and #37366, both merge cleanly). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (doc comments only). - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; lint passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched (comments only): no generated artifact depends on them. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent cac93cc commit 44ccf94

7 files changed

Lines changed: 175 additions & 40 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/plugin-audit': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
fix(plugin-audit): a milestone row written before its template gained a token reads its stored sentence, not a translation with a hole
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
A fired milestone's activity row now also stores the names of every `{token}` its template held (`names` in the row's summary code). A reader whose language translates the milestone composes the translation only when each token it names either has the row's stored value or was in the template and empty; a token the app added to the template after the row was written, or one only the translation names, leaves the row's stored sentence in place, which has no hole. A row written before this change carries no names, so it composes only when every token of the translation has a stored value.
12+
13+
Also: the `{token}` pattern has one exported definition (`milestoneTokenRe`, `activity-summary-message.ts`) that the writer and the reader share; a read answers each milestone's translation once and reads each object's packaged base once, instead of once per row; and two `@objectstack/spec` doc comments on `scalarOverridesPackagedBase` now name the five scalars it is asked about.

‎packages/plugins/plugin-audit/src/activity-milestone-summary-locale.integration.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ describe('activity milestone summary — rendered in the reader\'s language (#37
156156
field: 'stage',
157157
value: 'won',
158158
tokens: { name: { text: 'Acme' }, stage: { text: 'Won', option: 'won' } },
159+
names: ['name', 'stage'],
159160
});
160161
const served = await rowOf('won', reader('zh-CN'));
161162
expect(JSON.parse(served!.metadata)).not.toHaveProperty('summary_message');
@@ -167,4 +168,16 @@ describe('activity milestone summary — rendered in the reader\'s language (#37
167168
expect(hidden).toBeDefined();
168169
expect(hidden).not.toHaveProperty('summary');
169170
});
171+
172+
// Last: it changes the app's pack for the rest of the file.
173+
it('[#37635] a row written before its template gained a token reads its stored sentence, not a hole', async () => {
174+
// The app adds `{note}` to the won milestone, with its translation. The
175+
// won row was written before: it holds no value for `note`.
176+
kernel.getService<II18nService>('i18n').loadTranslations('zh-CN', {
177+
objects: { [DEAL]: { _milestones: { stage: { won: { summary: '商机赢单:{name}({stage}),备注:{note}' } } } } },
178+
});
179+
expect((await rowOf('won', reader('zh-CN')))?.summary).toBe('Deal won: Acme (Won)');
180+
// CONTROL: the lost row's template held `{note}` when it was written, so it still composes.
181+
expect((await rowOf('lost', reader('zh-CN')))?.summary).toBe('商机输单:Acme,budget cut');
182+
});
170183
});

‎packages/plugins/plugin-audit/src/activity-summary-message.test.ts‎

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,18 +389,58 @@ describe('composeActivitySummary — a fired milestone (#37524)', () => {
389389
field: 'stage',
390390
value: 'won',
391391
tokens: { name: { text: 'Acme' }, stage: { text: 'Won', option: 'won' } },
392+
names: ['name', 'stage'],
392393
};
393-
function milestoneI18n() {
394+
function milestoneI18n(summary = '赢单:{name}({stage})') {
394395
const i18n = makeI18n();
395396
i18n.loadTranslations('zh-CN', {
396-
objects: { biz_deal: { _milestones: { stage: { won: { summary: '赢单:{name}({stage}){extra}' } } } } },
397+
objects: { biz_deal: { _milestones: { stage: { won: { summary } } } } },
397398
});
398399
return i18n;
399400
}
401+
const zhLocale = (summary?: string) =>
402+
readerSummaryLocale(milestoneI18n(summary), 'zh-CN', (n) => MILESTONE_DEFS[n] ?? null)!;
400403

401-
it('composes the translated template, a select token by the reader\'s option label, an unstored token empty', () => {
402-
const locale = readerSummaryLocale(milestoneI18n(), 'zh-CN', (n) => MILESTONE_DEFS[n] ?? null)!;
403-
expect(composeActivitySummary(WON, locale)).toBe('赢单:Acme(赢单)');
404+
it('composes the translated template, a select token by the reader\'s option label', () => {
405+
expect(composeActivitySummary(WON, zhLocale())).toBe('赢单:Acme(赢单)');
406+
});
407+
408+
it('[#37635] a token the fired template held whose value was empty renders empty, as in the stored sentence', () => {
409+
// Written from `Deal won: {name} ({stage}) {note}` with `note` empty: the
410+
// stored sentence has an empty there too, so the translation may.
411+
const emptyNote: ActivitySummaryMessage = { ...WON, names: ['name', 'stage', 'note'] };
412+
expect(composeActivitySummary(emptyNote, zhLocale('赢单:{name}({stage}){note}'))).toBe('赢单:Acme(赢单)');
413+
});
414+
415+
it('[#37635] red first: a token the template gained after the row was written keeps the stored sentence', () => {
416+
// The app added `{note}` to the template (and its translation) after this
417+
// row was written from `Deal won: {name} ({stage})`: the row has no value
418+
// for it, and its stored sentence is whole, so the reader reads that.
419+
expect(composeActivitySummary(WON, zhLocale('赢单:{name}({stage}),备注:{note}'))).toBeUndefined();
420+
});
421+
422+
it('[#37635] a token only the translation names keeps the stored sentence', () => {
423+
expect(composeActivitySummary(WON, zhLocale('赢单:{name}({stage}){extra}'))).toBeUndefined();
424+
});
425+
426+
it('[#37635] a row written before token names were stored composes only when every token has a value', () => {
427+
const { names: _names, ...legacy } = WON;
428+
expect(composeActivitySummary(legacy as ActivitySummaryMessage, zhLocale())).toBe('赢单:Acme(赢单)');
429+
expect(composeActivitySummary(legacy as ActivitySummaryMessage, zhLocale('赢单:{name}({stage}){note}'))).toBeUndefined();
430+
});
431+
432+
it('[#37635] answers each milestone once per read: one packaged-base read per object for many rows', () => {
433+
let packagedReads = 0;
434+
const packaged = (n: string) => {
435+
packagedReads += 1;
436+
return MILESTONE_DEFS[n];
437+
};
438+
const locale = readerSummaryLocale(milestoneI18n(), 'zh-CN', (n) => MILESTONE_DEFS[n] ?? null, packaged)!;
439+
for (let i = 0; i < 5; i++) expect(composeActivitySummary(WON, locale)).toBe('赢单:Acme(赢单)');
440+
expect(packagedReads).toBe(1);
441+
// A different milestone of the same object is its own answer, from the same base.
442+
expect(composeActivitySummary({ ...WON, value: 'lost' }, locale)).toBeUndefined();
443+
expect(packagedReads).toBe(1);
404444
});
405445

406446
it('composes nothing — the stored sentence stands — for a locale with no entry, and on the writer\'s locale', () => {
@@ -428,5 +468,9 @@ describe('composeActivitySummary — a fired milestone (#37524)', () => {
428468
expect(readActivitySummaryMessage(WON)).toEqual(WON);
429469
expect(readActivitySummaryMessage({ ...WON, tokens: { name: 'Acme' } })).toBeNull();
430470
expect(readActivitySummaryMessage({ ...WON, value: 1 })).toBeNull();
471+
expect(readActivitySummaryMessage({ ...WON, names: 'name' })).toBeNull();
472+
expect(readActivitySummaryMessage({ ...WON, names: ['name', 1] })).toBeNull();
473+
const { names: _names, ...legacy } = WON;
474+
expect(readActivitySummaryMessage(legacy)).toEqual(legacy);
431475
});
432476
});

‎packages/plugins/plugin-audit/src/activity-summary-message.ts‎

Lines changed: 82 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ export type ActivitySummaryMessage =
141141
value: string;
142142
/** Each `{token}` the authored template interpolated, by token name. */
143143
tokens: Record<string, ActivitySummaryValue>;
144+
/**
145+
* [#37635] Every `{token}` name the fired template held when the row was
146+
* written, interpolated or not ({@link milestoneTokenNames}). It is what
147+
* tells a token whose value was empty (listed, no entry in `tokens`)
148+
* from one the template gained after the row was written (not listed),
149+
* which this row has no value for: a translation naming such a token
150+
* cannot be composed whole, so the row keeps its stored sentence. A row
151+
* written before #37635 carries no list, so no token missing from
152+
* `tokens` can be told empty, and it keeps its stored sentence whenever
153+
* its translation names one.
154+
*/
155+
names?: string[];
144156
};
145157

146158
/** One language a summary is composed in. */
@@ -164,6 +176,24 @@ export interface ActivitySummaryLocale {
164176
milestoneSummary?(objectName: string, field: string, value: string): string | undefined;
165177
}
166178

179+
/**
180+
* [#7290] The `{token}` pattern of an `activityMilestones` summary template —
181+
* the ONE definition: the writer plans its reads and renders the stored
182+
* sentence with it, and a reader composes a translated template with it.
183+
*
184+
* A FRESH instance per call, deliberately: a module-level `/g` regex carries
185+
* `lastIndex` between callers, and a fired milestone reads this more than
186+
* once. One definition, no shared cursor.
187+
*/
188+
export function milestoneTokenRe(): RegExp {
189+
return /\{(\w+)\}/g;
190+
}
191+
192+
/** [#37635] The distinct `{token}` names of `template`, in the order they first appear. */
193+
export function milestoneTokenNames(template: string): string[] {
194+
return [...new Set(Array.from(template.matchAll(milestoneTokenRe()), (match) => match[1]))];
195+
}
196+
167197
/** Interpolate one `{{param}}` template, the shared convention (`createMemoryI18n`, FileI18nAdapter). */
168198
function interpolate(template: string, params: Record<string, unknown> = {}): string {
169199
return template.replace(/\{\{(\w+)\}\}/g, (_, name: string) => String(params[name] ?? `{{${name}}}`));
@@ -295,14 +325,23 @@ export function composeActivitySummary(
295325
const template = locale.milestoneSummary?.(message.object, message.field, message.value);
296326
if (template === undefined) return undefined;
297327
const fields = locale.getObjectDef(message.object)?.fields;
298-
// The authored template's tokens are the ones with a stored value; a
299-
// token the translation adds, or one whose value was empty, renders
300-
// empty, as an empty value does in the authored sentence.
301-
return template.replace(/\{(\w+)\}/g, (_match: string, token: string) => {
328+
// The tokens with a stored value render it. A token the fired template
329+
// held whose value was empty renders empty, as it does in the stored
330+
// sentence. [#37635] Any other token (one the template gained after
331+
// the row was written, or one only the translation names) has no value
332+
// this row could give it, so the row keeps its stored sentence rather
333+
// than show a hole where that sentence has none.
334+
const written = new Set(message.names ?? []);
335+
let whole = true;
336+
const text = template.replace(milestoneTokenRe(), (_match: string, token: string) => {
302337
const value = Object.prototype.hasOwnProperty.call(message.tokens, token) ? message.tokens[token] : undefined;
303-
if (!value) return '';
338+
if (!value) {
339+
if (!written.has(token)) whole = false;
340+
return '';
341+
}
304342
return value.option !== undefined ? (optionLabelOn(fields?.[token], value.option) ?? value.text) : value.text;
305343
});
344+
return whole ? text : undefined;
306345
}
307346
}
308347
}
@@ -336,7 +375,8 @@ export function readActivitySummaryMessage(value: unknown): ActivitySummaryMessa
336375
return typeof value.field === 'string' &&
337376
typeof value.value === 'string' &&
338377
isRecord(tokens) &&
339-
Object.values(tokens).every(isValue)
378+
Object.values(tokens).every(isValue) &&
379+
(value.names === undefined || isStringList(value.names))
340380
? (value as ActivitySummaryMessage)
341381
: null;
342382
}
@@ -450,6 +490,17 @@ export function readerSummaryLocale(
450490
const locale = negotiatedLocale(service, requested);
451491
let translation: { value: ReturnType<typeof labelTranslationOf> } | undefined;
452492
const definitions = new Map<string, any>();
493+
// [#37635] One answer per milestone for the read: a feed page holds many
494+
// rows of the same milestone, and each answer walks the authored and the
495+
// packaged definitions.
496+
const milestoneTemplates = new Map<string, string | undefined>();
497+
// The packaged base, read once per object for the read: the translated
498+
// definition and every milestone answer ask it.
499+
const packagedBases = new Map<string, unknown>();
500+
const packagedBaseOf = (objectName: string): unknown => {
501+
if (!packagedBases.has(objectName)) packagedBases.set(objectName, getPackagedObjectBase?.(objectName));
502+
return packagedBases.get(objectName);
503+
};
453504
const translatedObjectDef = (objectName: string): any => {
454505
if (definitions.has(objectName)) return definitions.get(objectName);
455506
const def = getObjectDef(objectName);
@@ -458,7 +509,7 @@ export function readerSummaryLocale(
458509
try {
459510
translation ??= { value: labelTranslationOf(service, locale) };
460511
if (translation.value) {
461-
const packagedBase = getPackagedObjectBase?.(objectName);
512+
const packagedBase = packagedBaseOf(objectName);
462513
served = translateObject({ ...def, name: objectName }, translation.value.bundle, {
463514
...translation.value.options,
464515
...(packagedBase && typeof packagedBase === 'object' ? { packagedBase } : {}),
@@ -485,21 +536,35 @@ export function readerSummaryLocale(
485536
locale,
486537
getObjectDef: translatedObjectDef,
487538
milestoneSummary: (objectName, field, value) => {
539+
// NUL cannot occur in an object, field or value name, so the key is unambiguous.
540+
const cacheKey = `${objectName}\u0000${field}\u0000${value}`;
541+
if (milestoneTemplates.has(cacheKey)) return milestoneTemplates.get(cacheKey);
542+
let template: string | undefined;
488543
try {
489544
translation ??= { value: labelTranslationOf(service, locale) };
490-
if (!translation.value) return undefined;
491-
// ADR-0029 D9.2a: a tenant's rewording of a packaged milestone is
492-
// authored data and keeps its words, judged as a validation message
493-
// is — the served milestone against the packaged one of the same pair,
494-
// through the resolver's one predicate (never a copy of it).
495-
const served = milestoneOn(getObjectDef(objectName), field, value);
496-
const packaged = milestoneOn(getPackagedObjectBase?.(objectName), field, value);
497-
if (scalarOverridesPackagedBase(packaged, 'summary', served?.summary)) return undefined;
498-
return resolveObjectMilestoneSummary(translation.value.bundle, objectName, field, value, translation.value.options);
545+
if (translation.value) {
546+
// ADR-0029 D9.2a: a tenant's rewording of a packaged milestone is
547+
// authored data and keeps its words, judged as a validation message
548+
// is — the served milestone against the packaged one of the same pair,
549+
// through the resolver's one predicate (never a copy of it).
550+
const served = milestoneOn(getObjectDef(objectName), field, value);
551+
const packaged = milestoneOn(packagedBaseOf(objectName), field, value);
552+
if (!scalarOverridesPackagedBase(packaged, 'summary', served?.summary)) {
553+
template = resolveObjectMilestoneSummary(
554+
translation.value.bundle,
555+
objectName,
556+
field,
557+
value,
558+
translation.value.options,
559+
);
560+
}
561+
}
499562
} catch {
500563
// A misbehaving i18n service must not fail the read: the stored text stands.
501-
return undefined;
564+
template = undefined;
502565
}
566+
milestoneTemplates.set(cacheKey, template);
567+
return template;
503568
},
504569
};
505570
}

‎packages/plugins/plugin-audit/src/audit-option-label-summary.test.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@
2525
* fully localized — verb template, object label, and since #7230 the field
2626
* label. The authored option value was the one untranslated token left in
2727
* it, so translating it makes the string uniformly localized. **Localized.**
28-
* - `renderMilestoneSummary` (#7290) interpolates tokens into an author-written
29-
* sentence that has no bundle key and is deliberately NOT translated (#7290
30-
* called that a contract decision and left it). #7290's own change — a
31-
* reference id → the record's title — is locale-INDEPENDENT data, the same
28+
* - `renderMilestoneSummary` (#7290) interpolates tokens into the author-written
29+
* sentence the row STORES. #7290 left that sentence untranslated as a
30+
* contract decision; since #37524 a reader whose language translates the
31+
* milestone (`objects.<o>._milestones.<field>.<value>.summary`) reads it
32+
* composed from the row's code instead, and the stored sentence itself is
33+
* still rendered untranslated, which is what this file pins. #7290's own
34+
* change — a reference id → the record's title — is locale-INDEPENDENT data, the same
3235
* string in every locale, which is why it could be added to an untranslated
3336
* sentence. An option label is locale-DEPENDENT rendering: reading the bundle
3437
* there would guarantee a split sentence (`Deal moved to 已赢单`) in exactly

‎packages/plugins/plugin-audit/src/audit-writers.ts‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ import {
116116
ACTIVITY_SUMMARY_MESSAGE_KEY,
117117
composeStoredSummary,
118118
englishBooleanWord,
119+
milestoneTokenNames,
120+
milestoneTokenRe,
119121
withEnglishMessages,
120122
type ActivitySummaryFieldChange,
121123
type ActivitySummaryLocale,
@@ -1242,17 +1244,6 @@ function renderChangedFieldsSummary(
12421244
return null;
12431245
}
12441246

1245-
/**
1246-
* [#7290] The `{token}` pattern of an `activityMilestones` summary template.
1247-
*
1248-
* A FRESH instance per call, deliberately: a module-level `/g` regex carries
1249-
* `lastIndex` between callers, and this one is read twice per fired milestone
1250-
* (once to plan the reads, once to render). One definition, no shared cursor.
1251-
*/
1252-
function milestoneTokenRe(): RegExp {
1253-
return /\{(\w+)\}/g;
1254-
}
1255-
12561247
/**
12571248
* ADR-0052 §5b.2 — declarative semantic milestones. If a watched field
12581249
* transitioned INTO a configured `value` on this update (before ≠ value, after =
@@ -2705,6 +2696,9 @@ export function installAuditWriters(
27052696
field: milestone.field,
27062697
value: milestone.value,
27072698
tokens: rendered.tokens,
2699+
// [#37635] Every token the fired template held, so a reader can tell
2700+
// an empty one from one the template gains later.
2701+
names: milestoneTokenNames(milestone.template),
27082702
};
27092703
if (milestone.type) activityType = milestone.type;
27102704
// [#22771] `type` stays what the declaration names; the row says it is

‎packages/spec/src/system/i18n-resolver.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4937,8 +4937,10 @@ function builtinSystemFieldLabel(
49374937
}
49384938

49394939
/**
4940-
* [#8284] Whether one of an object document's three scalars has been
4941-
* EXPLICITLY set — i.e. it no longer carries the value the package shipped.
4940+
* [#8284] Whether a document scalar has been EXPLICITLY set — i.e. it no
4941+
* longer carries the value the package shipped. The scalars asked about are an
4942+
* object's three (`label`, `pluralLabel`, `description`), a validation rule's
4943+
* `message` and an activity milestone's `summary` (each section below).
49424944
*
49434945
* This is comparison-based provenance, and it is the whole mechanism: no flag
49444946
* is carried through the fold, nothing is stamped on the document, and the
@@ -5004,7 +5006,8 @@ export function scalarOverridesPackagedBase(
50045006
/**
50055007
* [#20680] The ONE comparison behind {@link scalarOverridesPackagedBase},
50065008
* keyed by any attribute name — the exported predicate's key union names the
5007-
* object scalars its two callers ask about, and the dashboard translator
5009+
* scalars its callers ask about (an object's three, a validation rule's
5010+
* `message`, an activity milestone's `summary`), and the dashboard translator
50085011
* ({@link translateDashboard}) asks the same question of `title`, which that
50095012
* union does not carry; the view translator ({@link translateView}, #20731)
50105013
* asks it of a bulk-action def's `confirmText`, its params' `help`, a form

0 commit comments

Comments
 (0)