Skip to content

Commit 54cda1e

Browse files
committed
gates: ADR-0122 alias form + Iso850 pin; translate the new maskingRule form strings (#8993)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01225pUjnCKWqxcc1PeqKFUq
1 parent 383b27d commit 54cda1e

6 files changed

Lines changed: 44 additions & 5 deletions

File tree

‎packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
8686
label: "Hidden",
8787
helpText: "Hidden from default UI"
8888
},
89+
"fields.maskingRule": {
90+
label: "Masking Rule",
91+
helpText: "Partial masking: preset ('phone', 'id_card', 'bank_account', 'email', 'name') or {\"keepHead\": n, \"keepTail\": m}. Masked unless the caller holds this field's requiredPermissions"
92+
},
8993
"fields.searchable": {
9094
label: "Searchable",
9195
helpText: "Include in full-text search"
@@ -449,6 +453,10 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
449453
sortable: {
450454
label: "Sortable",
451455
helpText: "Allow sorting lists by this field"
456+
},
457+
maskingRule: {
458+
label: "Masking Rule",
459+
helpText: "Partial masking: preset ('phone', 'id_card', 'bank_account', 'email', 'name') or {\"keepHead\": n, \"keepTail\": m}. Masked for callers not holding this field's requiredPermissions"
452460
}
453461
}
454462
},

‎packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export const esESMetadataForms: NonNullable<TranslationData['metadataForms']> =
8686
label: "Oculto",
8787
helpText: "Oculto en la UI predeterminada"
8888
},
89+
"fields.maskingRule": {
90+
label: "Regla de enmascaramiento",
91+
helpText: "Enmascaramiento parcial: preset ('phone', 'id_card', 'bank_account', 'email', 'name') o {\"keepHead\": n, \"keepTail\": m}. Enmascarado salvo que el llamante tenga los requiredPermissions del campo"
92+
},
8993
"fields.searchable": {
9094
label: "Buscable",
9195
helpText: "Incluir en búsqueda de texto completo"
@@ -449,6 +453,10 @@ export const esESMetadataForms: NonNullable<TranslationData['metadataForms']> =
449453
sortable: {
450454
label: "Ordenable",
451455
helpText: "Permite ordenar listas por este campo"
456+
},
457+
maskingRule: {
458+
label: "Regla de enmascaramiento",
459+
helpText: "Enmascaramiento parcial: preset ('phone', 'id_card', 'bank_account', 'email', 'name') o {\"keepHead\": n, \"keepTail\": m}. Enmascarado salvo que el llamante tenga los requiredPermissions del campo"
452460
}
453461
}
454462
},

‎packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export const jaJPMetadataForms: NonNullable<TranslationData['metadataForms']> =
8686
label: "非表示",
8787
helpText: "既定 UI では非表示"
8888
},
89+
"fields.maskingRule": {
90+
label: "マスキングルール",
91+
helpText: "部分マスキング:プリセット('phone'、'id_card'、'bank_account'、'email'、'name')または {\"keepHead\": n, \"keepTail\": m}。フィールドの requiredPermissions を持たない呼び出し元にはマスク値が表示されます"
92+
},
8993
"fields.searchable": {
9094
label: "検索可能",
9195
helpText: "全文検索に含める"
@@ -449,6 +453,10 @@ export const jaJPMetadataForms: NonNullable<TranslationData['metadataForms']> =
449453
sortable: {
450454
label: "並び替え可能",
451455
helpText: "このフィールドでリストの並べ替えを許可"
456+
},
457+
maskingRule: {
458+
label: "マスキングルール",
459+
helpText: "部分マスキング:プリセット('phone'、'id_card'、'bank_account'、'email'、'name')または {\"keepHead\": n, \"keepTail\": m}。フィールドの requiredPermissions を持たない呼び出し元にはマスク値が表示されます"
452460
}
453461
}
454462
},

‎packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
8686
label: "隐藏",
8787
helpText: "在默认界面中隐藏"
8888
},
89+
"fields.maskingRule": {
90+
label: "脱敏规则",
91+
helpText: "部分脱敏:预设('phone'、'id_card'、'bank_account'、'email'、'name')或 {\"keepHead\": n, \"keepTail\": m}。未持有该字段 requiredPermissions 的调用者将看到脱敏值"
92+
},
8993
"fields.searchable": {
9094
label: "可搜索",
9195
helpText: "纳入全文搜索"
@@ -449,6 +453,10 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
449453
sortable: {
450454
label: "可排序",
451455
helpText: "允许按此字段排序"
456+
},
457+
maskingRule: {
458+
label: "脱敏规则",
459+
helpText: "部分脱敏:预设('phone'、'id_card'、'bank_account'、'email'、'name')或 {\"keepHead\": n, \"keepTail\": m}。未持有该字段 requiredPermissions 的调用者将看到脱敏值"
452460
}
453461
}
454462
},

‎packages/spec/src/data/field.zod.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,8 @@ export const FieldMaskingKeepSchema = lazySchema(() => strictObject({
534534
keepTail: z.number().int().min(0).describe('Number of trailing characters to leave readable'),
535535
}));
536536

537-
/** @see FieldMaskingKeepSchema */
538-
export type FieldMaskingKeep = z.infer<typeof FieldMaskingKeepSchema>;
537+
/** @see FieldMaskingKeepSchema (ADR-0122: bare alias = the AUTHOR state; input and parsed coincide here — no transform, no defaults) */
538+
export type FieldMaskingKeep = z.input<typeof FieldMaskingKeepSchema>;
539539

540540
/**
541541
* A field's declared partial-masking rule — a named preset or the

‎packages/spec/src/type-alias-convention.pin.test.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ import type * as M167 from './ui/view.zod.js';
264264
import type * as M170 from './ui/component.zod.js';
265265

266266
// ---------------------------------------------------------------------------
267-
// 836 isomorphic aliases: `z.input` === `z.infer`, so no `XParsed` is declared.
267+
// 837 isomorphic aliases: `z.input` === `z.infer`, so no `XParsed` is declared.
268268
//
269269
// That number is machine-checked, not hand-kept. The runtime companion at the
270270
// bottom of this file recomputes the pin count from the source and asserts that
@@ -756,6 +756,9 @@ export type Iso338 = Assert<Eq< z.input< typeof M66.FieldType >, z.infer< typeof
756756
export type Iso339 = Assert<Eq< z.input< typeof M66.LocationCoordinatesSchema >, z.infer< typeof M66.LocationCoordinatesSchema > >>;
757757
export type Iso340 = Assert<Eq< z.input< typeof M66.AddressSchema >, z.infer< typeof M66.AddressSchema > >>;
758758
export type Iso341 = Assert<Eq< z.input< typeof M66.CurrencyValueSchema >, z.infer< typeof M66.CurrencyValueSchema > >>;
759+
// #8993 partial masking: keepHead/keepTail are plain optional-free ints — no
760+
// transform, no defaults, so input === infer and the bare alias needs no Parsed.
761+
export type Iso850 = Assert<Eq< z.input< typeof M66.FieldMaskingKeepSchema >, z.infer< typeof M66.FieldMaskingKeepSchema > >>;
759762

760763
// data/filter.zod.ts
761764
export type Iso342 = Assert<Eq< z.input< typeof M67.FieldReferenceSchema >, z.infer< typeof M67.FieldReferenceSchema > >>;
@@ -1651,7 +1654,7 @@ describe('ADR-0122 type-alias convention', () => {
16511654
// this title and the section header above the pin list — are now asserted
16521655
// against the recomputed count below, so neither can go stale without a red
16531656
// test naming it.
1654-
it('still declares all 836 isomorphic pins', () => {
1657+
it('still declares all 837 isomorphic pins', () => {
16551658
// The truth of each pin is proved by tsc, not here — an `Assert<Eq<...>>`
16561659
// that stops holding is a compile error with the alias named. What tsc
16571660
// cannot notice is a pin that was DELETED: removing the assertion removes
@@ -1879,9 +1882,13 @@ describe('ADR-0122 type-alias convention', () => {
18791882
// `Iso847`-`Iso849`. `RecordAlertProps` is deliberately unpinned: its
18801883
// `visible` carries `ExpressionInputSchema`, whose bare-string arm
18811884
// transforms to the canonical envelope, so input ≠ infer by construction.
1885+
//
1886+
// 836 -> 837 is #8993 — partial masking's `FieldMaskingKeepSchema`
1887+
// ({keepHead, keepTail}, both plain non-negative ints, no defaults, no
1888+
// transform), pinned as `Iso850`.
18821889
const self = readFileSync(fileURLToPath(import.meta.url), 'utf8');
18831890
const pins = self.match(/^export type Iso\d+ = Assert</gm) ?? [];
1884-
expect(pins).toHaveLength(836);
1891+
expect(pins).toHaveLength(837);
18851892

18861893
// The count is stated in PROSE twice as well — this case's title and the
18871894
// section header above the pin list — and until #6605 nothing read either

0 commit comments

Comments
 (0)