Skip to content

Commit 647a1c1

Browse files
committed
docs(lint): say a page sort naming an unknown field is an error refused at the page door
validating-metadata.mdx section 5 no longer lists a related list's sort as an advisory page-binding check, and the two code notes on the page crossing now say it also answers existence and provenance. Claude-Session: https://claude.ai/code/session_01Utp6CYvKbGaAgjBLQdkwPB Co-authored-by: Claude <noreply@anthropic.com>
1 parent df13535 commit 647a1c1

4 files changed

Lines changed: 18 additions & 5 deletions

File tree

‎.changeset/30093-page-sort-unknown-field.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fix(lint)!: a stored page sort naming a field its object lacks is refused by `os
66

77
Clause-②: no (narrowing) — an unknown sort field on a page slot moves from silent or warning to error: `os validate` / `os build` / `os lint` and the `page` publish door refuse a page sort they accepted before.
88
Metadata-protocol: narrowed
9-
Skills-docs: none — `skills/**` and `content/docs/**` teach no page sort that names a field the object lacks, and nothing there describes an unknown page sort as a warning; the verdict and its fix line name the field, the object and the nearest declared field.
9+
Skills-docs: updated here — content/docs/deployment/validating-metadata.mdx
1010

1111
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed or renamed: every page sort slot keeps its shape and meaning, and the build and the page publish door now give an unknown field there the verdict a list view sort already gets. A refused name never sorted anything (the list door answered every read 400 INVALID_SORT), so there is no rewrite that keeps what the author meant; the author names a real field, and the refusal says which. -->
1212

‎content/docs/deployment/validating-metadata.mdx‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,20 @@ component silently skips it and the page renders one item short.
163163

164164
Which object a component binds follows `dataSource.object` → `properties.object`
165165
→ the page's `object`, so a multi-object page is checked per element rather than
166-
against one page-wide guess. A `record:related_list`'s `columns`/`sort`/`filter`
166+
against one page-wide guess. A `record:related_list`'s `columns`/`filter`
167167
resolve against its **related** object (`objectName`), and its add-picker against
168168
its own. Advisory, like form-layout field references — every consumer degrades
169169
rather than failing. The same descriptor table drives the react page surface
170170
(§10), so a component is described once and checked wherever it is authored.
171171

172+
A page **sort** is the exception, because no consumer degrades it: the list door
173+
answers an unknown sort field `400 INVALID_SORT` on every load. So every stored
174+
page sort (an element's `dataSource.sort`, a related list's `sort` and
175+
`parentDataSource.sort`, a list block's own `sort`, `interfaceConfig.sort`, an app
176+
page's `record.sort`) naming a field the bound object lacks is a
177+
`page-field-unknown` **error**, and the page publish door refuses the save with
178+
`422 INVALID_METADATA`.
179+
172180
Skipped, to keep false positives at zero: relationship paths (`account.name`,
173181
resolved by the query engine), registry-injected system fields (`created_at`,
174182
`owner_id`, …), components bound to an object another package defines, and

‎packages/lint/src/authoring-rules.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,8 +1252,9 @@ export const AUTHORING_RULES: readonly AuthoringRule[] = [
12521252
// [#30023] `page` joins, NARROW by the same mechanism: a page write reaches
12531253
// exactly `validateSortableFields`, the one member that declares `page`,
12541254
// so a stored page sort naming a field the list door refuses
1255-
// (`sortable: false`, a `formula`) is refused at publish rather than at
1256-
// its first fetch. Every other member keeps its declaration.
1255+
// (`sortable: false`, a `formula`, and since #30093 a field the object
1256+
// does not have, as `page-field-unknown`) is refused at publish rather
1257+
// than at its first fetch. Every other member keeps its declaration.
12571258
surfaces: CLI_AND_RUNTIME,
12581259
runtimeTypes: ['flow', 'view', 'object', 'dataset', 'report', 'page'],
12591260
run: (stack, ctx) => validateReferenceIntegrity(stack, ctx),

‎packages/lint/src/reference-integrity-suite.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,11 @@ export const REFERENCE_INTEGRITY_RULES: readonly ReferenceIntegrityRule[] = [
286286
// [#30023] `page` joins: since the projection's `author-declared` verdict
287287
// the member also walks every stored PAGE sort (element `dataSource.sort`, a
288288
// block's own `sort`, `interfaceConfig.sort`, `record.sort`) and judges it
289-
// by the sortability projection alone. It resolves only against
289+
// by the sortability projection. [#30093] It also asks each page sort
290+
// existence (`page-field-unknown`, `error`) and provenance
291+
// (`page-field-unprovisioned`, `warning`), which `validatePageFieldBindings`
292+
// no longer reads, so the page door refuses an unknown page sort field too.
293+
// It resolves only against
290294
// `stack.objects`, which the per-write page snapshot carries, so it has no
291295
// missing-collection false-positive channel — the #9313 reason, one write
292296
// type over. It is the only member that declares `page`, so a page write

0 commit comments

Comments
 (0)