Skip to content

Commit 971ec20

Browse files
committed
docs(settings): drop JSON examples from the lifecycle map help text
Ten translation packs and the English manifest copy no longer teach the three keys as hand-written JSON. config-resolution.mdx states how an env override for a map key is judged. Changeset added. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2fBJ6xsLWJsnNJGMMx
1 parent ae153a5 commit 971ec20

14 files changed

Lines changed: 73 additions & 31 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/service-settings': patch
4+
'@objectstack/objectql': patch
5+
---
6+
7+
feat(spec): a `map` settings specifier for keyed rows; the data lifecycle retention overrides, row quotas and per-class quota defaults use it, and both settings doors judge them
8+
9+
Clause-②: yes (widening) — `SpecifierType` gains a member; the save and env doors also start refusing malformed values for the three keys (a narrowing on values that never took effect, named in the PR's BREAKING note)
10+
Metadata-protocol: added — a package author can now declare a `map` specifier in a settings manifest (a new accepted value of `SpecifierType`)
11+
12+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is removed, renamed or re-shaped: `SpecifierType` gains `map` and `Specifier` gains the optional `keyColumn` and `columns`. The three lifecycle keys keep their stored shape, their env variable names and their cascade. What narrows is the set of values the settings doors accept for those three keys: a stored value is runtime state in `sys_setting` / `sys_platform_setting` and an `OS_LIFECYCLE_*` override is a deployment's environment, so there is nothing for a migration to rewrite, and every refused value is one the sweep never applied. -->
13+
14+
**New: the `map` specifier** (`@objectstack/spec`, ADR-0007 as amended 2026-11-08). A setting whose value is keyed rows declares `type: 'map'` with a `keyColumn` (its header) and `columns` (`{ name, label, kind }`, `kind` is `duration` or `positive_integer`). One value column stores `Record<key, value>`; several store `Record<key, { [column]: value }>`. The keys a map admits are served at run time by an option source the settings service registers for the key, never listed in the manifest. `json` stays for raw config.
15+
16+
**`lifecycle.retention_overrides`, `lifecycle.quotas` and `lifecycle.quota_defaults` are `map` specifiers** (`@objectstack/objectql`). Stored values, `OS_LIFECYCLE_*` names and the env, global, organization cascade are unchanged, and the sweep reads the same shapes. Their keys are served from the running system: the objects that declare a lifecycle class other than `record` for the first two, the lifecycle classes other than `record` for `quota_defaults`.
17+
18+
**BREAKING** accept-set narrowing at the settings doors (`@objectstack/service-settings`), for those three keys only.
19+
20+
- **Before.** `PUT /api/settings/lifecycle` and `OS_LIFECYCLE_*` accepted any object under them: a misspelt object (`sys_audit_logs`), a quota written as text (`"1e6"`) or zero, a window written as `30 days`, a column misspelt (`max_age`). Each was stored, answered "saved", and the sweep silently applied nothing for it.
21+
- **Now.** The save door refuses such a value with `400 SETTINGS_VALIDATION` and one field error for the key, which names the entry and the expected form: `invalid_option` for a key the running system does not have, `invalid_shape` for a cell that is not a duration such as `7y` or a whole number above 0, `unknown_field` for a property no column declares, `invalid_type` for a value that is not an object (JSON text included). The env door rejects such an override with one `error` line, and the key resolves from the next layer of the cascade. A value already stored is not judged until a save touches its key.
22+
- **Who moves.** Nobody whose values took effect. A script or a deployment that wrote one of the refused values was configuring nothing; the refusal now says so. Durations take `h`, `d`, `w` or `y` (`90d`, `7y`), quotas a whole number above 0, and keys are the object names (or classes) the refusal lists.
23+
24+
**The remedy.** Send keys the deployment has and cells in their column's form: `{ "quotas": { "sys_audit_log": 1000000 } }`, `{ "retention_overrides": { "sys_job_run": { "maxAge": "90d" } } }`; for an override, `OS_LIFECYCLE_QUOTAS='{"sys_audit_log":1000000}'`.
25+
26+
**The console.** Until its `map` control lands (a separate change), Setup → Data Lifecycle draws these three keys as an unsupported specifier type; env overrides and the API are unaffected.

‎content/docs/protocol/kernel/config-resolution.mdx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,18 @@ The exception is a `json` specifier, which persists a JSON object or array
267267
cascade. The save door refuses the same values for a `json` key with an
268268
`invalid_type` field error, so a client sends the parsed value, never its text.
269269

270+
A `map` specifier (keyed rows, such as `lifecycle.quotas`) is judged further,
271+
at both doors alike: its JSON text must parse to an object whose every key the
272+
setting admits (the running system serves the admissible keys, for example the
273+
objects that declare a lifecycle) and whose every value is of its column's kind,
274+
such as a duration like `7y` or a whole number above 0. An override that is not
275+
is not in force, with one `error` line naming the entry and the form expected:
276+
277+
```bash
278+
OS_LIFECYCLE_QUOTAS='{"sys_audit_log": 1000000}'
279+
OS_LIFECYCLE_RETENTION_OVERRIDES='{"sys_job_run": {"maxAge": "90d"}}'
280+
```
281+
270282
**What is stored beneath a pin is listed by the namespace read.** An override in
271283
force answers `source: 'env'`, `locked: true`, and `get()` / `getMany()` build
272284
that answer from the env alone, without reading the store. `getNamespace()` — the

‎packages/objectql/src/lifecycle/lifecycle-key-options.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('ObjectQLPlugin registers the three key sources before the lifecycle ma
117117
}],
118118
});
119119
},
120-
} as any);
120+
});
121121
await kernel.bootstrap();
122122

123123
expect(calls).toEqual([

‎packages/services/service-settings/src/settings-map-shape-30208.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ describe('[#30208] the save door judges a lifecycle map', () => {
127127
const recordClass = await save({ quota_defaults: { record: 10 } });
128128
const misspelt = await save({ quota_defaults: { telemtry: 10 } });
129129

130+
// adr0112-ok: D6 — a field-addressed FieldErrorCode in a settings validation answer
130131
expect((recordClass.body.error.details.fields as Fields)[0]).toMatchObject({ code: 'invalid_option', constraint: { entry: 'record' } });
131132
expect((misspelt.body.error.details.fields as Fields)[0].message).toBe(
132133
"Per-class quota defaults: 'telemtry' is not a key this setting admits. Allowed: audit, telemetry, transient, event.",
@@ -161,6 +162,7 @@ describe('[#30208] the save door judges a lifecycle map', () => {
161162
expect((text.body.error.details.fields as Fields)[0].message).toBe(
162163
"Row quotas: 'sys_audit_log' must be a whole number greater than 0, such as 1000000, not a string of 3 characters.",
163164
);
165+
// adr0112-ok: D6 — a field-addressed FieldErrorCode in a settings validation answer
164166
expect((zero.body.error.details.fields as Fields)[0]).toMatchObject({ code: 'invalid_shape', constraint: { kind: 'positive_integer' } });
165167
expect((fraction.body.error.details.fields as Fields)[0].code).toBe('invalid_shape');
166168
});
@@ -172,10 +174,12 @@ describe('[#30208] the save door judges a lifecycle map', () => {
172174
const empty = await save({ retention_overrides: { sys_job_run: {} } });
173175

174176
expect((typo.body.error.details.fields as Fields)[0]).toMatchObject({
177+
// adr0112-ok: D6 — a field-addressed FieldErrorCode in a settings validation answer
175178
code: 'unknown_field',
176179
constraint: { entry: 'sys_job_run', column: 'max_age' },
177180
message: "Retention overrides: 'sys_job_run' has a property 'max_age' this setting does not declare. Allowed: maxAge, expireAfter.",
178181
});
182+
// adr0112-ok: D6 — a field-addressed FieldErrorCode in a settings validation answer
179183
expect((empty.body.error.details.fields as Fields)[0]).toMatchObject({ code: 'invalid_shape', constraint: { entry: 'sys_job_run' } });
180184
});
181185

‎packages/services/service-settings/src/translations/ar.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,15 +699,15 @@ export const ar: PlatformTranslationData = {
699699
},
700700
retention_overrides: {
701701
label: 'تجاوزات الاحتفاظ',
702-
help: 'تجاوزات النافذة لكل كائن: { "<object>": { "maxAge": "1y", "expireAfter": "30d" } }. تستخدم المدد h/d/w/y. تُضبط لكل مؤسسة، فتحتفظ المؤسسة الخاضعة للتنظيم بسنوات بينما تحتفظ مؤسسة التطوير بأيام. يُتجاهَل التجاوز الأقصر من الحد الأدنى الذي تحتاجه ميزة في المنصة (مثل نافذة كشف التكرار في قائمة انتظار المهام) ويُسجَّل خطأً، وتظل النافذة الافتراضية سارية.',
702+
help: 'تجاوزات النافذة لكل كائن. تستخدم المدد h/d/w/y. تُضبط لكل مؤسسة، فتحتفظ المؤسسة الخاضعة للتنظيم بسنوات بينما تحتفظ مؤسسة التطوير بأيام. يُتجاهَل التجاوز الأقصر من الحد الأدنى الذي تحتاجه ميزة في المنصة (مثل نافذة كشف التكرار في قائمة انتظار المهام) ويُسجَّل خطأً، وتظل النافذة الافتراضية سارية.',
703703
},
704704
quotas: {
705705
label: 'حصص الصفوف',
706-
help: 'الحد الأقصى لعدد الصفوف لكل كائن: { "<object>": 1000000 }. يؤدي التجاوز إلى تنبيه حوكمة — ولا تحذف الحصص أبدًا ما يتجاوز السياسة المعلنة.',
706+
help: 'الحد الأقصى لعدد الصفوف لكل كائن. يؤدي التجاوز إلى تنبيه حوكمة — ولا تحذف الحصص أبدًا ما يتجاوز السياسة المعلنة.',
707707
},
708708
quota_defaults: {
709709
label: 'الحصص الافتراضية حسب الفئة',
710-
help: 'حصص احتياطية حسب فئة دورة الحياة: { "telemetry": 1000000, "transient": 500000, "event": 100000, "audit": 5000000 }.',
710+
help: 'حصص احتياطية حسب فئة دورة الحياة (telemetry, transient, event, audit).',
711711
},
712712
growth_alert_rows: {
713713
label: 'حد تنبيه النمو (صفوف لكل جولة)',

‎packages/services/service-settings/src/translations/de.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,15 +744,15 @@ export const de: PlatformTranslationData = {
744744
},
745745
retention_overrides: {
746746
label: 'Aufbewahrungs-Überschreibungen',
747-
help: 'Fensterüberschreibungen pro Objekt: { "<object>": { "maxAge": "1y", "expireAfter": "30d" } }. Dauern verwenden h/d/w/y. Pro Organisation gesetzt, sodass eine regulierte Organisation Jahre aufbewahren kann, eine Entwicklungsorganisation nur Tage. Eine Überschreibung, die kürzer ist als das Minimum, das eine Plattformfunktion braucht (etwa das Duplikaterkennungsfenster der Job-Warteschlange), wird ignoriert und als Fehler protokolliert; das Standardfenster gilt weiter.',
747+
help: 'Fensterüberschreibungen pro Objekt. Dauern verwenden h/d/w/y. Pro Organisation gesetzt, sodass eine regulierte Organisation Jahre aufbewahren kann, eine Entwicklungsorganisation nur Tage. Eine Überschreibung, die kürzer ist als das Minimum, das eine Plattformfunktion braucht (etwa das Duplikaterkennungsfenster der Job-Warteschlange), wird ignoriert und als Fehler protokolliert; das Standardfenster gilt weiter.',
748748
},
749749
quotas: {
750750
label: 'Zeilenkontingente',
751-
help: 'Maximale Zeilenanzahl pro Objekt: { "<object>": 1000000 }. Eine Überschreitung löst eine Governance-Warnung aus — Kontingente löschen nie über die deklarierte Richtlinie hinaus.',
751+
help: 'Maximale Zeilenanzahl pro Objekt. Eine Überschreitung löst eine Governance-Warnung aus — Kontingente löschen nie über die deklarierte Richtlinie hinaus.',
752752
},
753753
quota_defaults: {
754754
label: 'Standardkontingente pro Klasse',
755-
help: 'Ersatzkontingente nach Lebenszyklusklasse: { "telemetry": 1000000, "transient": 500000, "event": 100000, "audit": 5000000 }.',
755+
help: 'Ersatzkontingente nach Lebenszyklusklasse (telemetry, transient, event, audit).',
756756
},
757757
growth_alert_rows: {
758758
label: 'Wachstums-Warnschwelle (Zeilen pro Durchlauf)',

‎packages/services/service-settings/src/translations/es-ES.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,18 +593,18 @@ export const esES: PlatformTranslationData = {
593593
},
594594
retention_overrides: {
595595
label: 'Sustituciones de retención',
596-
help: 'Sustituciones de la ventana por objeto: { "<object>": { "maxAge": "1y", "expireAfter": "30d" } }. Las duraciones usan h/d/w/y. '
596+
help: 'Sustituciones de la ventana por objeto. Las duraciones usan h/d/w/y. '
597597
+ 'Se define por organización, de modo que una organización regulada puede conservar años y una de desarrollo, días. '
598598
+ 'Una sustitución más corta que el mínimo que necesita una función de la plataforma (por ejemplo, la ventana de detección de duplicados de la cola de trabajos) '
599599
+ 'se ignora y se registra como error, y se sigue aplicando la ventana predeterminada.',
600600
},
601601
quotas: {
602602
label: 'Cuotas de filas',
603-
help: 'Número máximo de filas por objeto: { "<object>": 1000000 }. Superarlo genera una alerta de gobernanza: las cuotas nunca eliminan más allá de la política declarada.',
603+
help: 'Número máximo de filas por objeto. Superarlo genera una alerta de gobernanza: las cuotas nunca eliminan más allá de la política declarada.',
604604
},
605605
quota_defaults: {
606606
label: 'Cuotas predeterminadas por clase',
607-
help: 'Cuotas de respaldo por clase de ciclo de vida: { "telemetry": 1000000, "transient": 500000, "event": 100000, "audit": 5000000 }.',
607+
help: 'Cuotas de respaldo por clase de ciclo de vida (telemetry, transient, event, audit).',
608608
},
609609
growth_alert_rows: {
610610
label: 'Umbral de alerta de crecimiento (filas por barrido)',

‎packages/services/service-settings/src/translations/fr.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,15 +753,15 @@ export const fr: PlatformTranslationData = {
753753
},
754754
retention_overrides: {
755755
label: 'Surcharges de rétention',
756-
help: 'Surcharges de fenêtre par objet : { "<object>": { "maxAge": "1y", "expireAfter": "30d" } }. Les durées utilisent h/d/w/y. Définies par organisation : une organisation réglementée peut conserver des années, une organisation de développement quelques jours. Une surcharge plus courte que le minimum requis par une fonction de la plateforme (par exemple la fenêtre de détection des doublons de la file de tâches) est ignorée et journalisée comme erreur, et la fenêtre par défaut continue de s’appliquer.',
756+
help: 'Surcharges de fenêtre par objet. Les durées utilisent h/d/w/y. Définies par organisation : une organisation réglementée peut conserver des années, une organisation de développement quelques jours. Une surcharge plus courte que le minimum requis par une fonction de la plateforme (par exemple la fenêtre de détection des doublons de la file de tâches) est ignorée et journalisée comme erreur, et la fenêtre par défaut continue de s’appliquer.',
757757
},
758758
quotas: {
759759
label: 'Quotas de lignes',
760-
help: 'Nombre maximal de lignes par objet : { "<object>": 1000000 }. Un dépassement déclenche une alerte de gouvernance — les quotas ne suppriment jamais au-delà de la politique déclarée.',
760+
help: 'Nombre maximal de lignes par objet. Un dépassement déclenche une alerte de gouvernance — les quotas ne suppriment jamais au-delà de la politique déclarée.',
761761
},
762762
quota_defaults: {
763763
label: 'Quotas par défaut par classe',
764-
help: 'Quotas de repli par classe de cycle de vie : { "telemetry": 1000000, "transient": 500000, "event": 100000, "audit": 5000000 }.',
764+
help: 'Quotas de repli par classe de cycle de vie (telemetry, transient, event, audit).',
765765
},
766766
growth_alert_rows: {
767767
label: 'Seuil d’alerte de croissance (lignes par passage)',

‎packages/services/service-settings/src/translations/ja-JP.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,17 +591,17 @@ export const jaJP: PlatformTranslationData = {
591591
},
592592
retention_overrides: {
593593
label: '保持期間の上書き',
594-
help: 'オブジェクトごとの保持ウィンドウの上書き:{ "<object>": { "maxAge": "1y", "expireAfter": "30d" } }。期間は h/d/w/y で指定します。'
594+
help: 'オブジェクトごとの保持ウィンドウの上書き。期間は h/d/w/y で指定します。'
595595
+ '組織ごとに設定するため、規制対象の組織は数年、開発用の組織は数日だけ保持できます。'
596596
+ 'プラットフォーム機能が必要とする最小期間(例:ジョブキューの重複検出ウィンドウ)より短い上書きは無視されてエラーとして記録され、既定のウィンドウが引き続き適用されます。',
597597
},
598598
quotas: {
599599
label: '行数クォータ',
600-
help: 'オブジェクトごとの最大行数:{ "<object>": 1000000 }。超過するとガバナンスアラートが発生します。クォータが宣言済みのポリシーを超えて削除することはありません。',
600+
help: 'オブジェクトごとの最大行数。超過するとガバナンスアラートが発生します。クォータが宣言済みのポリシーを超えて削除することはありません。',
601601
},
602602
quota_defaults: {
603603
label: 'クラス別の既定クォータ',
604-
help: 'ライフサイクルクラスごとのフォールバッククォータ:{ "telemetry": 1000000, "transient": 500000, "event": 100000, "audit": 5000000 }。',
604+
help: 'ライフサイクルクラスごとのフォールバッククォータ(telemetry、transient、event、audit)。',
605605
},
606606
growth_alert_rows: {
607607
label: '増加アラートのしきい値(クリーンアップ 1 回あたりの行数)',

‎packages/services/service-settings/src/translations/ko.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,15 +559,15 @@ export const ko: PlatformTranslationData = {
559559
},
560560
retention_overrides: {
561561
label: '보존 기간 재정의',
562-
help: '객체별 보존 기간 재정의입니다: { "<object>": { "maxAge": "1y", "expireAfter": "30d" } }. 기간 단위는 h/d/w/y입니다. 조직별로 설정하므로 규제 대상 조직은 수년, 개발용 조직은 며칠만 보관할 수 있습니다. 플랫폼 기능에 필요한 최소 기간(예: 작업 대기열의 중복 감지 기간)보다 짧은 재정의는 무시되고 오류로 기록되며, 기본 기간이 계속 적용됩니다.',
562+
help: '객체별 보존 기간 재정의입니다. 기간 단위는 h/d/w/y입니다. 조직별로 설정하므로 규제 대상 조직은 수년, 개발용 조직은 며칠만 보관할 수 있습니다. 플랫폼 기능에 필요한 최소 기간(예: 작업 대기열의 중복 감지 기간)보다 짧은 재정의는 무시되고 오류로 기록되며, 기본 기간이 계속 적용됩니다.',
563563
},
564564
quotas: {
565565
label: '행 할당량',
566-
help: '객체별 최대 행 수입니다: { "<object>": 1000000 }. 초과하면 거버넌스 알림이 발생하며, 할당량은 선언된 정책을 넘어 데이터를 삭제하지 않습니다.',
566+
help: '객체별 최대 행 수입니다. 초과하면 거버넌스 알림이 발생하며, 할당량은 선언된 정책을 넘어 데이터를 삭제하지 않습니다.',
567567
},
568568
quota_defaults: {
569569
label: '클래스별 기본 할당량',
570-
help: '수명 주기 클래스별 대체 할당량입니다: { "telemetry": 1000000, "transient": 500000, "event": 100000, "audit": 5000000 }.',
570+
help: '수명 주기 클래스별 대체 할당량입니다 (telemetry, transient, event, audit).',
571571
},
572572
growth_alert_rows: {
573573
label: '증가 알림 임계값(정리당 행 수)',

0 commit comments

Comments
 (0)