From 3811f03de911e1149caede65abc03f164542536a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 11:22:52 +0000 Subject: [PATCH 01/10] wip(spec): Field.showOnCreate with the required pair refused Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude --- packages/spec/liveness/field.json | 6 ++ .../src/data/field-show-on-create.test.ts | 73 +++++++++++++++++++ packages/spec/src/data/field.zod.ts | 32 ++++++++ 3 files changed, 111 insertions(+) create mode 100644 packages/spec/src/data/field-show-on-create.test.ts diff --git a/packages/spec/liveness/field.json b/packages/spec/liveness/field.json index 5f37d85809c..b796789896e 100644 --- a/packages/spec/liveness/field.json +++ b/packages/spec/liveness/field.json @@ -189,6 +189,12 @@ "status": "live", "note": "renderer." }, + "showOnCreate": { + "status": "planned", + "verifiedAt": "2026-11-22", + "evidence": "packages/spec/src/data/field.zod.ts#showOnCreate (the parse refuses `showOnCreate: false` beside `required: true`, at every door that parses a field)", + "note": "PLANNED, contract-first spec half of the card that retires the internal create and edit forms: the key and its parse-time refusal land first, the readers second. The readers are every create surface of the Console (the create dialog, the full-page create, an action-opened create), which leave a `showOnCreate: false` field out; editing, the record page and lists ignore it by contract. Flip to `live` on the commit that lands those readers, citing them." + }, "internal": { "status": "live", "verifiedAt": "2026-08-12", diff --git a/packages/spec/src/data/field-show-on-create.test.ts b/packages/spec/src/data/field-show-on-create.test.ts new file mode 100644 index 00000000000..db8e798f860 --- /dev/null +++ b/packages/spec/src/data/field-show-on-create.test.ts @@ -0,0 +1,73 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * `showOnCreate` — whether a field is asked for when a record is created. + * + * The key is an authorable field key (absent = asked for), and the one pair it + * cannot form is `showOnCreate: false` beside `required: true`: every create + * surface would leave the field out and the write door would refuse every + * insert without it. The refusal is asserted as a full `safeParse` failure + * located at `['showOnCreate']`; every control is a full `safeParse` success, + * never mere absence of `unrecognized_keys`. + */ + +import { describe, expect, it } from 'vitest'; +import { FieldSchema } from './field.zod'; +import { ObjectSchema } from './object.zod'; + +type Issue = { code: string; path: PropertyKey[]; message: string }; + +function showOnCreateIssues(result: { success: boolean; error?: { issues: Issue[] } }): Issue[] { + if (result.success) return []; + return (result.error?.issues ?? []).filter((issue) => issue.path[issue.path.length - 1] === 'showOnCreate'); +} + +describe('Field.showOnCreate', () => { + it('parses on an optional field, switched off or on, and stays absent when not authored', () => { + for (const showOnCreate of [false, true]) { + const parsed = FieldSchema.safeParse({ name: 'notes', type: 'text', showOnCreate }); + expect(parsed.success).toBe(true); + expect(parsed.success && parsed.data.showOnCreate).toBe(showOnCreate); + } + const untouched = FieldSchema.safeParse({ name: 'notes', type: 'text' }); + expect(untouched.success).toBe(true); + expect(untouched.success && 'showOnCreate' in untouched.data).toBe(false); + }); + + it('refuses `showOnCreate: false` on a `required: true` field, at the key, naming both remedies', () => { + const issues = showOnCreateIssues( + FieldSchema.safeParse({ name: 'amount', type: 'number', required: true, showOnCreate: false }), + ); + expect(issues).toHaveLength(1); + expect(issues[0].code).toBe('custom'); + expect(issues[0].message).toMatch(/^`showOnCreate: false` leaves this field off every create surface/); + }); + + it('accepts the controls beside the refused pair', () => { + const controls = [ + { name: 'amount', type: 'number', required: true, showOnCreate: true }, + { name: 'amount', type: 'number', required: true }, + { name: 'amount', type: 'number', required: false, showOnCreate: false }, + // A conditional requirement is a predicate the parse cannot judge: the + // write door still refuses a create born inside it. + { name: 'amount', type: 'number', requiredWhen: "record.stage == 'won'", showOnCreate: false }, + ]; + for (const field of controls) { + expect(FieldSchema.safeParse(field).success, JSON.stringify(field)).toBe(true); + } + }); + + it('refuses the pair through the object door too, located under the field', () => { + const result = ObjectSchema.safeParse({ + name: 'deal', + label: 'Deal', + fields: { + name: { type: 'text', label: 'Name' }, + amount: { type: 'number', label: 'Amount', required: true, showOnCreate: false }, + }, + }); + const issues = showOnCreateIssues(result as never); + expect(issues).toHaveLength(1); + expect(issues[0].path).toEqual(['fields', 'amount', 'showOnCreate']); + }); +}); diff --git a/packages/spec/src/data/field.zod.ts b/packages/spec/src/data/field.zod.ts index ef388203f56..adeb665d7e2 100644 --- a/packages/spec/src/data/field.zod.ts +++ b/packages/spec/src/data/field.zod.ts @@ -2885,6 +2885,23 @@ export const FieldSchema = lazySchema(() => { /** Security & Visibility */ hidden: z.boolean().default(false).describe('Hidden from default UI'), + /** + * Whether the field is asked for when a record is created (ADR-0085 §2: a + * creation-time intent of the field — which fields this business asks for + * when a record is born, not inferable from the schema — that binds every + * create surface and names none of them). Absent, as `true`: the field is + * asked for. `false`: every create surface leaves it out; editing, the + * record page and lists still show it. + * + * A `required: true` field cannot be switched off: the create would be + * refused for the value it never asked for, so the pair is refused here, at + * every door that parses a field (this schema's superRefine). A + * `requiredWhen` field is not refused: its gate is a predicate the parse + * cannot judge, and the write door still refuses a create born inside it. + * `liveness/field.json` carries its row. + */ + showOnCreate: z.boolean().optional().describe('Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty.'), + /** * [#7728] "The declared value is never returned on the generic data path." * @@ -3205,6 +3222,21 @@ export const FieldSchema = lazySchema(() => { }); } } + // `showOnCreate: false` leaves the field off every create surface, and + // `required: true` refuses every insert without it (ADR-0113): together, + // no record of the object could be created from the platform's create + // surfaces. Refused where the author can fix it, at every door that parses + // a field (`defineStack`, `os validate`, the metadata save). + if (field.showOnCreate === false && field.required === true) { + ctx.addIssue({ + code: 'custom', + path: ['showOnCreate'], + message: + '`showOnCreate: false` leaves this field off every create surface, and it is `required: true`, so every ' + + 'create would be refused for a value it never asked for. Keep the field on create (delete ' + + '`showOnCreate`), or drop `required`; a value needed only in some cases can be `requiredWhen` instead.', + }); + } // [#11339] `referenceVia` declares the id half of a polymorphic pointer // pair (ADR-0052 §5) — semantics only a plain `text` column carries. On a // relationship type it contradicts the type's own single static target, and From e166b7516a4df40df932694fd47993aff33d7022 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 11:24:42 +0000 Subject: [PATCH 02/10] wip(spec): showOnCreate refusal names the defaultValue case Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude --- packages/spec/authorable-surface/data.json | 1 + packages/spec/src/data/field-show-on-create.test.ts | 7 +++++++ packages/spec/src/data/field.zod.ts | 9 ++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/spec/authorable-surface/data.json b/packages/spec/authorable-surface/data.json index b6baa09f6dc..4627f4ddb03 100644 --- a/packages/spec/authorable-surface/data.json +++ b/packages/spec/authorable-surface/data.json @@ -377,6 +377,7 @@ "data/Field:scale", "data/Field:searchable", "data/Field:settledWhen", + "data/Field:showOnCreate", "data/Field:sortable", "data/Field:step", "data/Field:storage", diff --git a/packages/spec/src/data/field-show-on-create.test.ts b/packages/spec/src/data/field-show-on-create.test.ts index db8e798f860..8a7a2a6156d 100644 --- a/packages/spec/src/data/field-show-on-create.test.ts +++ b/packages/spec/src/data/field-show-on-create.test.ts @@ -43,6 +43,13 @@ describe('Field.showOnCreate', () => { expect(issues[0].message).toMatch(/^`showOnCreate: false` leaves this field off every create surface/); }); + it('refuses the pair when the field declares a `defaultValue` too', () => { + const issues = showOnCreateIssues( + FieldSchema.safeParse({ name: 'stage', type: 'text', required: true, defaultValue: 'new', showOnCreate: false }), + ); + expect(issues).toHaveLength(1); + }); + it('accepts the controls beside the refused pair', () => { const controls = [ { name: 'amount', type: 'number', required: true, showOnCreate: true }, diff --git a/packages/spec/src/data/field.zod.ts b/packages/spec/src/data/field.zod.ts index adeb665d7e2..aebcfbd3822 100644 --- a/packages/spec/src/data/field.zod.ts +++ b/packages/spec/src/data/field.zod.ts @@ -2900,7 +2900,7 @@ export const FieldSchema = lazySchema(() => { * cannot judge, and the write door still refuses a create born inside it. * `liveness/field.json` carries its row. */ - showOnCreate: z.boolean().optional().describe('Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty.'), + showOnCreate: z.boolean().optional().describe('Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty.'), /** * [#7728] "The declared value is never returned on the generic data path." @@ -3226,7 +3226,9 @@ export const FieldSchema = lazySchema(() => { // `required: true` refuses every insert without it (ADR-0113): together, // no record of the object could be created from the platform's create // surfaces. Refused where the author can fix it, at every door that parses - // a field (`defineStack`, `os validate`, the metadata save). + // a field (`defineStack`, `os validate`, the metadata save). A declared + // `defaultValue` is no exception (the card's item 6 makes none): a default + // is a starting value a create may clear, not a value every create carries. if (field.showOnCreate === false && field.required === true) { ctx.addIssue({ code: 'custom', @@ -3234,7 +3236,8 @@ export const FieldSchema = lazySchema(() => { message: '`showOnCreate: false` leaves this field off every create surface, and it is `required: true`, so every ' + 'create would be refused for a value it never asked for. Keep the field on create (delete ' - + '`showOnCreate`), or drop `required`; a value needed only in some cases can be `requiredWhen` instead.', + + '`showOnCreate`), or drop `required`; a value needed only in some cases can be `requiredWhen` instead. ' + + 'A `defaultValue` does not lift this: a default is a starting value, not a guarantee that the create carries one.', }); } // [#11339] `referenceVia` declares the id half of a polymorphic pointer From 1071fec45230f30f191508f476cf6e0b87facf5e Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 11:29:38 +0000 Subject: [PATCH 03/10] wip(spec): regenerate references and liveness counts for showOnCreate Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude --- content/docs/references/data/field.mdx | 1 + content/docs/references/data/object.mdx | 2 ++ content/docs/references/system/migration.mdx | 2 ++ packages/spec/liveness/state-counts/field.md | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/content/docs/references/data/field.mdx b/content/docs/references/data/field.mdx index cd4a0964fae..f9a1abf84ac 100644 --- a/content/docs/references/data/field.mdx +++ b/content/docs/references/data/field.mdx @@ -115,6 +115,7 @@ const result = CurrencyConfigSchema.parse(data); | **conditionalFormatting** | `{ condition: string \| object; style: Record }[]` | optional | Cell formatting rules for this field — `[{ condition, style }]`, the same rule a list view's `conditionalFormatting` declares. In order, the first rule whose CEL `condition` holds applies its CSS `style` map to THIS FIELD'S CELL wherever the field renders (grid, kanban card, record page, related list, report cell); a list view's row rules style the row, and both may apply. The condition reads `value` (this field's value on the record) and `record` (the row) and no other root, e.g. P`value < 0` with `style: { color: '#b91c1c' }`; `objectstack validate` refuses a condition that does not parse or reads any other root. For presentation only — a semantic state such as a deadline's overdue is declared with `dueLike` / `settledWhen` instead. Display only: nothing on the write path reads it. | | **widget** | `string` | optional | Form widget override — names a registered field component (resolved as `field:`) to render this field instead of the `type` default. Degrades to the `type` renderer when unregistered. e.g. "object-ref", "filter-condition", "recipient-picker". | | **hidden** | `boolean` | optional (default: `false`) | Hidden from default UI | +| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | | **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. | | **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). | diff --git a/content/docs/references/data/object.mdx b/content/docs/references/data/object.mdx index f695bda288c..5ad1942e07b 100644 --- a/content/docs/references/data/object.mdx +++ b/content/docs/references/data/object.mdx @@ -295,6 +295,7 @@ const result = ApiMethod.parse(data); | **conditionalFormatting** | `{ condition: string \| object; style: Record }[]` | optional | Cell formatting rules for this field — `[{ condition, style }]`, the same rule a list view's `conditionalFormatting` declares. In order, the first rule whose CEL `condition` holds applies its CSS `style` map to THIS FIELD'S CELL wherever the field renders (grid, kanban card, record page, related list, report cell); a list view's row rules style the row, and both may apply. The condition reads `value` (this field's value on the record) and `record` (the row) and no other root, e.g. P`value < 0` with `style: { color: '#b91c1c' }`; `objectstack validate` refuses a condition that does not parse or reads any other root. For presentation only — a semantic state such as a deadline's overdue is declared with `dueLike` / `settledWhen` instead. Display only: nothing on the write path reads it. | | **widget** | `string` | optional | Form widget override — names a registered field component (resolved as `field:`) to render this field instead of the `type` default. Degrades to the `type` renderer when unregistered. e.g. "object-ref", "filter-condition", "recipient-picker". | | **hidden** | `boolean` | optional (default: `false`) | Hidden from default UI | +| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | | **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. | | **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). | @@ -686,6 +687,7 @@ const result = ApiMethod.parse(data); | **conditionalFormatting** | `{ condition: string \| object; style: Record }[]` | optional | Cell formatting rules for this field — `[{ condition, style }]`, the same rule a list view's `conditionalFormatting` declares. In order, the first rule whose CEL `condition` holds applies its CSS `style` map to THIS FIELD'S CELL wherever the field renders (grid, kanban card, record page, related list, report cell); a list view's row rules style the row, and both may apply. The condition reads `value` (this field's value on the record) and `record` (the row) and no other root, e.g. P`value < 0` with `style: { color: '#b91c1c' }`; `objectstack validate` refuses a condition that does not parse or reads any other root. For presentation only — a semantic state such as a deadline's overdue is declared with `dueLike` / `settledWhen` instead. Display only: nothing on the write path reads it. | | **widget** | `string` | optional | Form widget override — names a registered field component (resolved as `field:`) to render this field instead of the `type` default. Degrades to the `type` renderer when unregistered. e.g. "object-ref", "filter-condition", "recipient-picker". | | **hidden** | `boolean` | optional (default: `false`) | Hidden from default UI | +| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | | **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. | | **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). | diff --git a/content/docs/references/system/migration.mdx b/content/docs/references/system/migration.mdx index 3827a1a5a5f..785b7d50203 100644 --- a/content/docs/references/system/migration.mdx +++ b/content/docs/references/system/migration.mdx @@ -118,6 +118,7 @@ Add a new field to an existing object | **conditionalFormatting** | `{ condition: string \| object; style: Record }[]` | optional | Cell formatting rules for this field — `[{ condition, style }]`, the same rule a list view's `conditionalFormatting` declares. In order, the first rule whose CEL `condition` holds applies its CSS `style` map to THIS FIELD'S CELL wherever the field renders (grid, kanban card, record page, related list, report cell); a list view's row rules style the row, and both may apply. The condition reads `value` (this field's value on the record) and `record` (the row) and no other root, e.g. P`value < 0` with `style: { color: '#b91c1c' }`; `objectstack validate` refuses a condition that does not parse or reads any other root. For presentation only — a semantic state such as a deadline's overdue is declared with `dueLike` / `settledWhen` instead. Display only: nothing on the write path reads it. | | **widget** | `string` | optional | Form widget override — names a registered field component (resolved as `field:`) to render this field instead of the `type` default. Degrades to the `type` renderer when unregistered. e.g. "object-ref", "filter-condition", "recipient-picker". | | **hidden** | `boolean` | optional (default: `false`) | Hidden from default UI | +| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | | **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. | | **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). | @@ -556,6 +557,7 @@ Add a new field to an existing object | **conditionalFormatting** | `{ condition: string \| object; style: Record }[]` | optional | Cell formatting rules for this field — `[{ condition, style }]`, the same rule a list view's `conditionalFormatting` declares. In order, the first rule whose CEL `condition` holds applies its CSS `style` map to THIS FIELD'S CELL wherever the field renders (grid, kanban card, record page, related list, report cell); a list view's row rules style the row, and both may apply. The condition reads `value` (this field's value on the record) and `record` (the row) and no other root, e.g. P`value < 0` with `style: { color: '#b91c1c' }`; `objectstack validate` refuses a condition that does not parse or reads any other root. For presentation only — a semantic state such as a deadline's overdue is declared with `dueLike` / `settledWhen` instead. Display only: nothing on the write path reads it. | | **widget** | `string` | optional | Form widget override — names a registered field component (resolved as `field:`) to render this field instead of the `type` default. Degrades to the `type` renderer when unregistered. e.g. "object-ref", "filter-condition", "recipient-picker". | | **hidden** | `boolean` | optional (default: `false`) | Hidden from default UI | +| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | | **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. | | **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). | diff --git a/packages/spec/liveness/state-counts/field.md b/packages/spec/liveness/state-counts/field.md index 6c873b26ab5..b59b5382bba 100644 --- a/packages/spec/liveness/state-counts/field.md +++ b/packages/spec/liveness/state-counts/field.md @@ -12,4 +12,4 @@ committed anywhere: `check:liveness` sums the shards when it reads them. | Type | live | exp | elsewhere | dead | planned | classified | |---|---|---|---|---|---|---| -| `field` | 107 | 0 | 0 | 1 | 5 | 113 | +| `field` | 107 | 0 | 0 | 1 | 6 | 114 | From d315273cec8793fd60939eb84446c506718926b5 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 11:30:12 +0000 Subject: [PATCH 04/10] wip: changeset for showOnCreate Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude --- .changeset/36425-field-show-on-create.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .changeset/36425-field-show-on-create.md diff --git a/.changeset/36425-field-show-on-create.md b/.changeset/36425-field-show-on-create.md new file mode 100644 index 00000000000..a543f43eeed --- /dev/null +++ b/.changeset/36425-field-show-on-create.md @@ -0,0 +1,14 @@ +--- +'@objectstack/spec': minor +--- + +feat(spec): a field can say it is not asked for when a record is created (`showOnCreate`) + +Clause-②: yes (widening) +Metadata-protocol: added +Skills-docs: follow-up owed — skills/objectstack-ui/SKILL.md and skills/objectstack-ui/rules/list-views.md teach internal create and edit forms; the teaching changes with the create surfaces that read this key + +`FieldSchema` gains `showOnCreate`, an optional boolean. Absent or `true`, the field is asked for when a record is created, as today. `false` says the business does not ask for it at creation: every create surface (the create dialog, the full-page create, an action-opened create) leaves it out, while editing, the record page and lists keep showing it, so the value is filled in after the record exists. + +- The one pair refused is `showOnCreate: false` on a `required: true` field, at the field's `showOnCreate` key, at every door that parses a field (`defineStack`, `os validate`, the metadata save): no create could carry the value it never asked for. The message names both fixes (keep the field on create, or drop `required`). A declared `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, since its gate is a predicate the parse cannot judge; the write door still refuses a create born inside it. +- No create surface reads the key yet: it is `planned` in the liveness ledger, and the Console's create surfaces read it in the change that follows. Nothing that parses today is refused, and no parsed field's output changes (the key has no default). From 197434e99892c47512a9c91e84e243fa8fcc97e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 11:41:44 +0000 Subject: [PATCH 05/10] wip(spec): record showOnCreate as not yet offered by the field form Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude --- .../src/system/metadata-form-zod-reconciliation.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/spec/src/system/metadata-form-zod-reconciliation.test.ts b/packages/spec/src/system/metadata-form-zod-reconciliation.test.ts index 05f264f1572..893f75f7ae5 100644 --- a/packages/spec/src/system/metadata-form-zod-reconciliation.test.ts +++ b/packages/spec/src/system/metadata-form-zod-reconciliation.test.ts @@ -728,6 +728,13 @@ const LEDGER: ReadonlyArray = [ key: 'externalId', why: "graded `dead` (`liveness/field.json`): no upsert, import or seed matches on a field's `externalId`, so a control would invite an author to rely on a flag nothing reads, and `os lint` then warns on the value the form offered. The schema still parses the key, so a stored value stays valid. A seed dataset names its match field in its own `externalId`, an import mapping in its `upsertKey`", }, + { + kind: 'omit', + type: 'field', + path: ROOT_PATH, + key: 'showOnCreate', + why: "graded `planned` (`liveness/field.json`): no create surface reads it yet, so a switch offered now would be honoured nowhere (declared = enforced = shown). The row is offered, and this entry deleted, in the change that lands the create surfaces' readers", + }, // Measured, and deliberately NOT recorded: seven `view` keys with no // liveness verdict at any coordinate. `liveness/view.json` cannot hold them: From 2eaa2bc989c70d5640fd2e373a5ce540d0e59ba5 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 12:29:15 +0000 Subject: [PATCH 06/10] fix(spec): showOnCreate refusal gives the card's reason, skills follow-up names its card Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude --- .changeset/36425-field-show-on-create.md | 4 +-- .../src/data/field-show-on-create.test.ts | 7 ++-- packages/spec/src/data/field.zod.ts | 32 ++++++++++--------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.changeset/36425-field-show-on-create.md b/.changeset/36425-field-show-on-create.md index a543f43eeed..d0564d004ef 100644 --- a/.changeset/36425-field-show-on-create.md +++ b/.changeset/36425-field-show-on-create.md @@ -6,9 +6,9 @@ feat(spec): a field can say it is not asked for when a record is created (`showO Clause-②: yes (widening) Metadata-protocol: added -Skills-docs: follow-up owed — skills/objectstack-ui/SKILL.md and skills/objectstack-ui/rules/list-views.md teach internal create and edit forms; the teaching changes with the create surfaces that read this key +Skills-docs: follow-up #36455 `FieldSchema` gains `showOnCreate`, an optional boolean. Absent or `true`, the field is asked for when a record is created, as today. `false` says the business does not ask for it at creation: every create surface (the create dialog, the full-page create, an action-opened create) leaves it out, while editing, the record page and lists keep showing it, so the value is filled in after the record exists. -- The one pair refused is `showOnCreate: false` on a `required: true` field, at the field's `showOnCreate` key, at every door that parses a field (`defineStack`, `os validate`, the metadata save): no create could carry the value it never asked for. The message names both fixes (keep the field on create, or drop `required`). A declared `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, since its gate is a predicate the parse cannot judge; the write door still refuses a create born inside it. +- The one pair refused is `showOnCreate: false` on a `required: true` field, at the field's `showOnCreate` key, at every door that parses a field (`defineStack`, `os validate`, the metadata save): a required field is always asked for when a record is created, so the person creating it sees every value the record must have. The message names both fixes (keep the field on create, or drop `required`). A declared `defaultValue` makes no exception: the field is still asked for, with its default filled in. A `requiredWhen` field is accepted, since its gate is a predicate the parse cannot judge; the write door still refuses a create born inside it. - No create surface reads the key yet: it is `planned` in the liveness ledger, and the Console's create surfaces read it in the change that follows. Nothing that parses today is refused, and no parsed field's output changes (the key has no default). diff --git a/packages/spec/src/data/field-show-on-create.test.ts b/packages/spec/src/data/field-show-on-create.test.ts index 8a7a2a6156d..2bbcd690e05 100644 --- a/packages/spec/src/data/field-show-on-create.test.ts +++ b/packages/spec/src/data/field-show-on-create.test.ts @@ -4,9 +4,8 @@ * `showOnCreate` — whether a field is asked for when a record is created. * * The key is an authorable field key (absent = asked for), and the one pair it - * cannot form is `showOnCreate: false` beside `required: true`: every create - * surface would leave the field out and the write door would refuse every - * insert without it. The refusal is asserted as a full `safeParse` failure + * cannot form is `showOnCreate: false` beside `required: true`: a required + * field is always asked for on create, with or without a `defaultValue`. The refusal is asserted as a full `safeParse` failure * located at `['showOnCreate']`; every control is a full `safeParse` success, * never mere absence of `unrecognized_keys`. */ @@ -40,7 +39,7 @@ describe('Field.showOnCreate', () => { ); expect(issues).toHaveLength(1); expect(issues[0].code).toBe('custom'); - expect(issues[0].message).toMatch(/^`showOnCreate: false` leaves this field off every create surface/); + expect(issues[0].message).toMatch(/^`showOnCreate: false` would leave this field off every create surface/); }); it('refuses the pair when the field declares a `defaultValue` too', () => { diff --git a/packages/spec/src/data/field.zod.ts b/packages/spec/src/data/field.zod.ts index aebcfbd3822..ca1c64d9eaa 100644 --- a/packages/spec/src/data/field.zod.ts +++ b/packages/spec/src/data/field.zod.ts @@ -2893,14 +2893,15 @@ export const FieldSchema = lazySchema(() => { * asked for. `false`: every create surface leaves it out; editing, the * record page and lists still show it. * - * A `required: true` field cannot be switched off: the create would be - * refused for the value it never asked for, so the pair is refused here, at - * every door that parses a field (this schema's superRefine). A + * A `required: true` field cannot be switched off: a required field is + * always asked for on create, with or without a `defaultValue`, so the pair + * is refused here, at every door that parses a field (this schema's + * superRefine). A * `requiredWhen` field is not refused: its gate is a predicate the parse * cannot judge, and the write door still refuses a create born inside it. * `liveness/field.json` carries its row. */ - showOnCreate: z.boolean().optional().describe('Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty.'), + showOnCreate: z.boolean().optional().describe('Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, with or without a `defaultValue`: a required field is always asked for on create. Keep the field on create, or drop `required`. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty.'), /** * [#7728] "The declared value is never returned on the generic data path." @@ -3222,22 +3223,23 @@ export const FieldSchema = lazySchema(() => { }); } } - // `showOnCreate: false` leaves the field off every create surface, and - // `required: true` refuses every insert without it (ADR-0113): together, - // no record of the object could be created from the platform's create - // surfaces. Refused where the author can fix it, at every door that parses - // a field (`defineStack`, `os validate`, the metadata save). A declared - // `defaultValue` is no exception (the card's item 6 makes none): a default - // is a starting value a create may clear, not a value every create carries. + // A required field is always asked for when a record is created: the + // person creating the record sees every value the record must have, so + // `showOnCreate: false` beside `required: true` is refused (#36425 item 6, + // which makes no exception). That holds with a `defaultValue` too, which + // the insert would resolve: the field is still asked for, its default + // filled in. Refused where the author can fix it, at every door that + // parses a field (`defineStack`, `os validate`, the metadata save). if (field.showOnCreate === false && field.required === true) { ctx.addIssue({ code: 'custom', path: ['showOnCreate'], message: - '`showOnCreate: false` leaves this field off every create surface, and it is `required: true`, so every ' - + 'create would be refused for a value it never asked for. Keep the field on create (delete ' - + '`showOnCreate`), or drop `required`; a value needed only in some cases can be `requiredWhen` instead. ' - + 'A `defaultValue` does not lift this: a default is a starting value, not a guarantee that the create carries one.', + '`showOnCreate: false` would leave this field off every create surface, and it is `required: true`: a ' + + 'required field is always asked for when a record is created, so the person creating it sees every value ' + + 'the record must have. Keep the field on create (delete `showOnCreate`), or drop `required`; a value ' + + 'needed only in some cases can be `requiredWhen` instead. A `defaultValue` makes no exception: the field ' + + 'is still asked for, with its default filled in.', }); } // [#11339] `referenceVia` declares the id half of a polymorphic pointer From 1c0012aa42503e05b4be55d62133b8ebff51f664 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 12:32:09 +0000 Subject: [PATCH 07/10] fix(spec): regenerate references for the showOnCreate describe Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude --- content/docs/references/data/field.mdx | 2 +- content/docs/references/data/object.mdx | 4 ++-- content/docs/references/system/migration.mdx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/content/docs/references/data/field.mdx b/content/docs/references/data/field.mdx index f9a1abf84ac..2a8e0bcb4a0 100644 --- a/content/docs/references/data/field.mdx +++ b/content/docs/references/data/field.mdx @@ -115,7 +115,7 @@ const result = CurrencyConfigSchema.parse(data); | **conditionalFormatting** | `{ condition: string \| object; style: Record }[]` | optional | Cell formatting rules for this field — `[{ condition, style }]`, the same rule a list view's `conditionalFormatting` declares. In order, the first rule whose CEL `condition` holds applies its CSS `style` map to THIS FIELD'S CELL wherever the field renders (grid, kanban card, record page, related list, report cell); a list view's row rules style the row, and both may apply. The condition reads `value` (this field's value on the record) and `record` (the row) and no other root, e.g. P`value < 0` with `style: { color: '#b91c1c' }`; `objectstack validate` refuses a condition that does not parse or reads any other root. For presentation only — a semantic state such as a deadline's overdue is declared with `dueLike` / `settledWhen` instead. Display only: nothing on the write path reads it. | | **widget** | `string` | optional | Form widget override — names a registered field component (resolved as `field:`) to render this field instead of the `type` default. Degrades to the `type` renderer when unregistered. e.g. "object-ref", "filter-condition", "recipient-picker". | | **hidden** | `boolean` | optional (default: `false`) | Hidden from default UI | -| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | +| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, with or without a `defaultValue`: a required field is always asked for on create. Keep the field on create, or drop `required`. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | | **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. | | **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). | diff --git a/content/docs/references/data/object.mdx b/content/docs/references/data/object.mdx index 5ad1942e07b..37aea1488e0 100644 --- a/content/docs/references/data/object.mdx +++ b/content/docs/references/data/object.mdx @@ -295,7 +295,7 @@ const result = ApiMethod.parse(data); | **conditionalFormatting** | `{ condition: string \| object; style: Record }[]` | optional | Cell formatting rules for this field — `[{ condition, style }]`, the same rule a list view's `conditionalFormatting` declares. In order, the first rule whose CEL `condition` holds applies its CSS `style` map to THIS FIELD'S CELL wherever the field renders (grid, kanban card, record page, related list, report cell); a list view's row rules style the row, and both may apply. The condition reads `value` (this field's value on the record) and `record` (the row) and no other root, e.g. P`value < 0` with `style: { color: '#b91c1c' }`; `objectstack validate` refuses a condition that does not parse or reads any other root. For presentation only — a semantic state such as a deadline's overdue is declared with `dueLike` / `settledWhen` instead. Display only: nothing on the write path reads it. | | **widget** | `string` | optional | Form widget override — names a registered field component (resolved as `field:`) to render this field instead of the `type` default. Degrades to the `type` renderer when unregistered. e.g. "object-ref", "filter-condition", "recipient-picker". | | **hidden** | `boolean` | optional (default: `false`) | Hidden from default UI | -| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | +| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, with or without a `defaultValue`: a required field is always asked for on create. Keep the field on create, or drop `required`. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | | **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. | | **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). | @@ -687,7 +687,7 @@ const result = ApiMethod.parse(data); | **conditionalFormatting** | `{ condition: string \| object; style: Record }[]` | optional | Cell formatting rules for this field — `[{ condition, style }]`, the same rule a list view's `conditionalFormatting` declares. In order, the first rule whose CEL `condition` holds applies its CSS `style` map to THIS FIELD'S CELL wherever the field renders (grid, kanban card, record page, related list, report cell); a list view's row rules style the row, and both may apply. The condition reads `value` (this field's value on the record) and `record` (the row) and no other root, e.g. P`value < 0` with `style: { color: '#b91c1c' }`; `objectstack validate` refuses a condition that does not parse or reads any other root. For presentation only — a semantic state such as a deadline's overdue is declared with `dueLike` / `settledWhen` instead. Display only: nothing on the write path reads it. | | **widget** | `string` | optional | Form widget override — names a registered field component (resolved as `field:`) to render this field instead of the `type` default. Degrades to the `type` renderer when unregistered. e.g. "object-ref", "filter-condition", "recipient-picker". | | **hidden** | `boolean` | optional (default: `false`) | Hidden from default UI | -| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | +| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, with or without a `defaultValue`: a required field is always asked for on create. Keep the field on create, or drop `required`. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | | **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. | | **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). | diff --git a/content/docs/references/system/migration.mdx b/content/docs/references/system/migration.mdx index 785b7d50203..19c087dbc29 100644 --- a/content/docs/references/system/migration.mdx +++ b/content/docs/references/system/migration.mdx @@ -118,7 +118,7 @@ Add a new field to an existing object | **conditionalFormatting** | `{ condition: string \| object; style: Record }[]` | optional | Cell formatting rules for this field — `[{ condition, style }]`, the same rule a list view's `conditionalFormatting` declares. In order, the first rule whose CEL `condition` holds applies its CSS `style` map to THIS FIELD'S CELL wherever the field renders (grid, kanban card, record page, related list, report cell); a list view's row rules style the row, and both may apply. The condition reads `value` (this field's value on the record) and `record` (the row) and no other root, e.g. P`value < 0` with `style: { color: '#b91c1c' }`; `objectstack validate` refuses a condition that does not parse or reads any other root. For presentation only — a semantic state such as a deadline's overdue is declared with `dueLike` / `settledWhen` instead. Display only: nothing on the write path reads it. | | **widget** | `string` | optional | Form widget override — names a registered field component (resolved as `field:`) to render this field instead of the `type` default. Degrades to the `type` renderer when unregistered. e.g. "object-ref", "filter-condition", "recipient-picker". | | **hidden** | `boolean` | optional (default: `false`) | Hidden from default UI | -| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | +| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, with or without a `defaultValue`: a required field is always asked for on create. Keep the field on create, or drop `required`. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | | **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. | | **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). | @@ -557,7 +557,7 @@ Add a new field to an existing object | **conditionalFormatting** | `{ condition: string \| object; style: Record }[]` | optional | Cell formatting rules for this field — `[{ condition, style }]`, the same rule a list view's `conditionalFormatting` declares. In order, the first rule whose CEL `condition` holds applies its CSS `style` map to THIS FIELD'S CELL wherever the field renders (grid, kanban card, record page, related list, report cell); a list view's row rules style the row, and both may apply. The condition reads `value` (this field's value on the record) and `record` (the row) and no other root, e.g. P`value < 0` with `style: { color: '#b91c1c' }`; `objectstack validate` refuses a condition that does not parse or reads any other root. For presentation only — a semantic state such as a deadline's overdue is declared with `dueLike` / `settledWhen` instead. Display only: nothing on the write path reads it. | | **widget** | `string` | optional | Form widget override — names a registered field component (resolved as `field:`) to render this field instead of the `type` default. Degrades to the `type` renderer when unregistered. e.g. "object-ref", "filter-condition", "recipient-picker". | | **hidden** | `boolean` | optional (default: `false`) | Hidden from default UI | -| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, whose create would then be refused for a value it was never asked for: keep the field on create, or drop `required`; a `defaultValue` does not lift the refusal. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | +| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, with or without a `defaultValue`: a required field is always asked for on create. Keep the field on create, or drop `required`. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. | | **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. | | **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). | From e89912afdfa2b1e9e812f2a0049f9fcb6b7841f7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 12:58:57 +0000 Subject: [PATCH 08/10] test(metadata-protocol): field serves 85 top-level properties with showOnCreate Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude --- .../src/protocol.meta-types-degenerate-derivation.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts b/packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts index 85a8a7ca810..d1125f946bc 100644 --- a/packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts +++ b/packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts @@ -399,8 +399,10 @@ describe('#17501 — /meta/types serves a real schema for `action`, and moves no // that a text field holds a unit code (ADR-0158 U4, Open item 8). // [#35985] `object` 50 → 51: `color`, the palette name the console draws // the object's icon tile in. + // [#36425] `field` 84 → 85: `showOnCreate`, whether a field is asked for + // when a record is created. const CARD_PROPERTY_COUNTS: Record = { - agent: 24, app: 24, dashboard: 21, dataset: 17, field: 84, flow: 24, + agent: 24, app: 24, dashboard: 21, dataset: 17, field: 85, flow: 24, hook: 24, object: 51, page: 28, position: 14, report: 24, skill: 17, tool: 14, }; From b86db2be460ae3c2d4393353c71117324c549f6d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 13:03:52 +0000 Subject: [PATCH 09/10] test(driver-sql,metadata-core): classify the showOnCreate field key The DDL never reads it (presentation), and FLS keeps it: a boolean facet that names no field. Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude --- packages/drivers/driver-sql/src/builtin-column-collision.ts | 1 + packages/metadata-core/src/object-schema-fls-references.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/packages/drivers/driver-sql/src/builtin-column-collision.ts b/packages/drivers/driver-sql/src/builtin-column-collision.ts index 9f968c4e022..d6c234b06b0 100644 --- a/packages/drivers/driver-sql/src/builtin-column-collision.ts +++ b/packages/drivers/driver-sql/src/builtin-column-collision.ts @@ -117,6 +117,7 @@ export const FIELD_KEY_STORAGE_CLASS: Readonly> = group: 'presentation', widget: 'presentation', hidden: 'presentation', + showOnCreate: 'presentation', // whether a create surface asks for the field; the DDL never reads it internal: 'presentation', readonly: 'presentation', visibleWhen: 'presentation', diff --git a/packages/metadata-core/src/object-schema-fls-references.ts b/packages/metadata-core/src/object-schema-fls-references.ts index 6cd4b804ab4..6d4cac2f6df 100644 --- a/packages/metadata-core/src/object-schema-fls-references.ts +++ b/packages/metadata-core/src/object-schema-fls-references.ts @@ -630,6 +630,9 @@ export const FIELD_REFERENCE_POSITIONS: Readonly> = { // the way `unitConfig.unitField` does. unitConfig: keep, group: keep, widget: keep, hidden: keep, internal: keep, readonly: keep, + // A boolean facet: whether a create surface asks for this field (#36425); + // it names no field. + showOnCreate: keep, requiredPermissions: keep, maskingRule: keep, ackPlaintextMasking: keep, system: keep, sortable: keep, inlineHelpText: keep, placeholder: keep, externalId: keep, // A boolean facet of this date field: it declares the field a deadline From d8b82f70d50a48747586e5281279e091ce9c9331 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 13:50:03 +0000 Subject: [PATCH 10/10] chore(changeset): patch entries for driver-sql and metadata-core Both packages' every-field-key ledgers now classify showOnCreate, which changes their shipped source. Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude --- .changeset/36425-field-show-on-create.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.changeset/36425-field-show-on-create.md b/.changeset/36425-field-show-on-create.md index d0564d004ef..d03f81768e2 100644 --- a/.changeset/36425-field-show-on-create.md +++ b/.changeset/36425-field-show-on-create.md @@ -1,5 +1,7 @@ --- '@objectstack/spec': minor +'@objectstack/driver-sql': patch +'@objectstack/metadata-core': patch --- feat(spec): a field can say it is not asked for when a record is created (`showOnCreate`) @@ -12,3 +14,4 @@ Skills-docs: follow-up #36455 - The one pair refused is `showOnCreate: false` on a `required: true` field, at the field's `showOnCreate` key, at every door that parses a field (`defineStack`, `os validate`, the metadata save): a required field is always asked for when a record is created, so the person creating it sees every value the record must have. The message names both fixes (keep the field on create, or drop `required`). A declared `defaultValue` makes no exception: the field is still asked for, with its default filled in. A `requiredWhen` field is accepted, since its gate is a predicate the parse cannot judge; the write door still refuses a create born inside it. - No create surface reads the key yet: it is `planned` in the liveness ledger, and the Console's create surfaces read it in the change that follows. Nothing that parses today is refused, and no parsed field's output changes (the key has no default). +- `@objectstack/driver-sql` and `@objectstack/metadata-core` classify the new key in their every-field-key ledgers: `FIELD_KEY_STORAGE_CLASS` marks `showOnCreate` `presentation` (the DDL never reads it), and `FIELD_REFERENCE_POSITIONS` keeps it, since it is a boolean that names no field. Neither changes what it does with any field.