From ff1bf727d292520c0b2575ce8fafce01feb27316 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 12:02:53 +0000 Subject: [PATCH 1/3] feat(lint)!: refuse a lookupFilters $record path through or to a multi-valued field A { $record } comparand stands for one value under a scalar operator; a path whose head is multi-valued (a plain path to it or a hop through it), or whose leaf behind a single-valued hop is, now fails object-field-ref-unknown, judged by isMultiValueField. The describes say so, with an ADR-0087 semantic entry and a changeset. Claude-Session: https://claude.ai/code/session_01ADHkmP9xmb6H4wxJ2AJQEW Co-authored-by: Claude --- ...-lookup-filter-record-path-multi-valued.md | 18 +++++ packages/lint/src/rule-explanations.ts | 5 +- .../src/validate-object-field-refs.test.ts | 75 +++++++++++++++++++ .../lint/src/validate-object-field-refs.ts | 66 +++++++++++++++- packages/spec/src/data/field.zod.ts | 14 +++- ...filter-record-path-multi-valued-refused.ts | 42 +++++++++++ 6 files changed, 215 insertions(+), 5 deletions(-) create mode 100644 .changeset/34378-lookup-filter-record-path-multi-valued.md create mode 100644 packages/spec/src/migrations/entries/semantic/18.lookup-filter-record-path-multi-valued-refused.ts diff --git a/.changeset/34378-lookup-filter-record-path-multi-valued.md b/.changeset/34378-lookup-filter-record-path-multi-valued.md new file mode 100644 index 00000000000..6f879737d19 --- /dev/null +++ b/.changeset/34378-lookup-filter-record-path-multi-valued.md @@ -0,0 +1,18 @@ +--- +'@objectstack/lint': minor +'@objectstack/spec': minor +--- + +feat(lint)!: a `lookupFilters` `{ $record: "path" }` path through or to a multi-valued field is refused + +Clause-②: no (narrowing) — a `lookupFilters[].value` `{ $record }` path on a lookup, master_detail or user field whose first segment is a multi-valued field of the object owning that field (a plain path to it, or a hop through it), or whose leaf behind a single-valued hop is a multi-valued field, linted clean and published; it is now refused at error as `object-field-ref-unknown` by `os lint`, `os validate`, `os build` and the runtime publish door, and reported (never refused) on the package publish receipt's object probe. +Metadata-protocol: narrowed +Skills-docs: follow-up #34201 — no doc or skill teaches `{ $record }` yet, so there is no teaching to correct here; the multi-valued clause rides the describes this change edits. + + + +**BREAKING** only for a `{ $record }` path that reads a list. A `{ $record }` comparand stands for ONE value of the record being edited and pairs only with `eq`, `ne`, `gt`, `lt`, `gte` or `lte`, but the path check judged only that each segment names a field, so `{ $record: "accounts.cb_market" }` through a `multiple: true` lookup, or `{ $record: "tags" }`, linted clean. A hop through a multi-valued lookup reaches no single row, so the entry was left out without a word; a plain path to a multi-valued field put a list where one value goes. `object-field-ref-unknown` now refuses the path at the multi-valued field and names it. Multi-valued means `isMultiValueField`: a field flagged `multiple: true`, or a `multiselect`, `checkboxes` or `tags` field. A registry-injected column and a leaf on an object outside the stack are not judged. Measured first-party exposure: zero — no example app, platform object, skill or docs sample writes a `$record` path. + +**FROM → TO.** FROM `{ $record: "accounts.cb_market" }` (a hop through a `multiple: true` lookup), `{ $record: "tags" }` or `{ $record: "account.markets" }` (a multi-valued leaf) TO a path that ends at, and hops through, single-valued fields only. + +**Fix:** copy the value you mean onto a single-valued field of the record being edited (or of the record one single-valued hop away) and reference that. The semantic entry `lookup-filter-record-path-multi-valued-refused` carries the same notice into the upgrade guide and `os migrate meta`. `os explain object-field-ref-unknown` lists the position. diff --git a/packages/lint/src/rule-explanations.ts b/packages/lint/src/rule-explanations.ts index 5c6dcde9ef2..2c102985272 100644 --- a/packages/lint/src/rule-explanations.ts +++ b/packages/lint/src/rule-explanations.ts @@ -4490,7 +4490,10 @@ const OBJECT_FIELD_REF_UNKNOWN_EXPLANATION: RuleExplanation = { 'an entry out while the value is empty, so a path the record does not have would drop the filter ' + 'without a word. A miss names the segment: an unknown head, ' + 'a hop through a field that is not a relationship, a leaf the referenced object lacks, or a ' + - 'second hop. A `$record` nested inside a literal value is not a reference and is not judged.', + 'second hop. A path that names real fields is refused too when it reads a list: a path through or ' + + 'to a multi-valued field (one flagged `multiple: true`, or a `multiselect`, `checkboxes` or `tags` ' + + 'field), or a multi-valued leaf behind one hop, because the comparand is one ' + + 'value under a scalar operator. A `$record` nested inside a literal value is not a reference and is not judged.', 'A summary field\'s `summaryOperations.filter` is judged against the CHILD object ' + '`summaryOperations.object` names: the engine ANDs it with the parent-FK match and runs it as the ' + 'query on that child, so every key (inside `$and` / `$or` / `$not` groups) is a field of the child. ' + diff --git a/packages/lint/src/validate-object-field-refs.test.ts b/packages/lint/src/validate-object-field-refs.test.ts index be22cb298a2..29c3bfa3961 100644 --- a/packages/lint/src/validate-object-field-refs.test.ts +++ b/packages/lint/src/validate-object-field-refs.test.ts @@ -731,6 +731,7 @@ describe('validateObjectFieldRefs — lookupFilters[].value.$record (the RECORD name: { type: 'text' }, cb_market: { type: 'select' }, parent: { type: 'lookup', reference: 'crm_account' }, + markets: { type: 'multiselect' }, }, }, { @@ -855,6 +856,79 @@ describe('validateObjectFieldRefs — lookupFilters[].value.$record (the RECORD })); expect(findings.map((f) => f.path)).toEqual(['objects[0].fields.approver.lookupFilters[0].value.$record']); }); + + // [#34378] A path that names real fields can still read a LIST. The + // comparand is one value under a scalar operator, so a multi-valued head + // (a plain path to it, or a hop through it) or a multi-valued leaf behind a + // single-valued hop is refused — by `isMultiValueField`, `FieldSchema`'s own + // predicate: an inherently multi type, or `multiple: true` on a + // multi-capable one. + describe('a path through or to a multi-valued field (#34378)', () => { + const multi = { + tags: { type: 'tags' }, + regions: { type: 'select', multiple: true }, + stage: { type: 'select', multiple: false }, + accounts: { type: 'lookup', reference: 'crm_account', multiple: true }, + partners: { type: 'lookup', reference: 'elsewhere_partner', multiple: true }, + watchers: { type: 'user', multiple: true }, + }; + const refused = (path: string) => { + const findings = validateObjectFieldRefs(quote([entry(path)], multi)); + expect(findings.map((f) => f.path)).toEqual([at(0)]); + expect(findings[0]).toMatchObject({ severity: 'error', rule: OBJECT_FIELD_REF_UNKNOWN }); + expect(findings[0]!.hint).toContain('Point `$record` at a single-valued field'); + return findings[0]!.message; + }; + + it('REFUSES a plain path to an inherently multi-valued field (`tags`)', () => { + expect(refused('tags')).toBe( + 'fields.price_book.lookupFilters[0].value.$record "tags" names "tags", a multi-valued field on object ' + + '"sales_quote"; a $record comparand is one value under a scalar operator.', + ); + }); + + it('REFUSES a plain path to a `multiple: true` select', () => { + expect(refused('regions')).toContain('names "regions", a multi-valued field on object "sales_quote"'); + }); + + it('REFUSES a hop through a `multiple: true` lookup, at the hop', () => { + expect(refused('accounts.cb_market')).toBe( + 'fields.price_book.lookupFilters[0].value.$record "accounts.cb_market" goes through "accounts", a ' + + 'multi-valued field on object "sales_quote"; a $record comparand is one value under a scalar operator.', + ); + }); + + it('REFUSES a hop through a `multiple: true` user field, its target unjudged past the hop', () => { + expect(refused('watchers.department')).toContain('goes through "watchers", a multi-valued field'); + }); + + it('REFUSES a hop through a multi-valued lookup to an object outside the stack: the head is this object\'s', () => { + expect(refused('partners.anything')).toContain('goes through "partners", a multi-valued field'); + }); + + it('REFUSES a multi-valued leaf behind a single-valued hop, naming the leaf and its object', () => { + expect(refused('account.markets')).toBe( + 'fields.price_book.lookupFilters[0].value.$record "account.markets" ends at "markets", a multi-valued ' + + 'field on object "crm_account"; a $record comparand is one value under a scalar operator.', + ); + }); + + it('reports a misspelt leaf behind a multi-valued hop once, as the miss', () => { + const findings = validateObjectFieldRefs(quote([entry('accounts.cb_markt')], multi)); + expect(findings.map((f) => f.path)).toEqual([at(0)]); + expect(findings[0]!.message).toContain('"accounts.cb_markt" is not a field on object "crm_account"'); + }); + + it('passes single-valued paths: a plain field, a single lookup, a hop, a `multiple: false` select', () => { + expect(validateObjectFieldRefs(quote([ + { field: 'valid_from', operator: 'lte', value: { $record: 'quote_date' } }, + entry('account', 'cb_market'), + entry('account.cb_market'), + entry('stage'), + entry('account.created_at', 'valid_to'), + ], multi))).toEqual([]); + }); + }); }); describe('validateObjectFieldRefs — summaryOperations.filter (addresses the CHILD object, #31224)', () => { @@ -1184,6 +1258,7 @@ describe('[#22161] one-line verdicts — object-field-ref-unknown', () => { '`lookupColumns` and `lookupFilters[].field` against the REFERENCED object', '`lookupFilters[].value.$record`', 'at most one relationship hop', + 'a path through or to a multi-valued field', '`lookup`, `master_detail` and `user`', 'reported once, there', 'read verbatim', diff --git a/packages/lint/src/validate-object-field-refs.ts b/packages/lint/src/validate-object-field-refs.ts index 9ebcf010481..fd916767122 100644 --- a/packages/lint/src/validate-object-field-refs.ts +++ b/packages/lint/src/validate-object-field-refs.ts @@ -113,7 +113,14 @@ * types alone, the picker being its only reader. A path of two hops is * refused at the second hop on the raw `os lint` path the parse has not * seen; a hop's leaf on an object outside this stack stays unjudged, as - * every cross-package name in this family does. A `{ $record }` nested + * every cross-package name in this family does. A path through or to a + * MULTI-VALUED field (#34378) — a hop through a `multiple: true` lookup + * (`accounts.cb_market`), a plain path to one (`tags`), or a leaf that is + * one behind a single-valued hop — is refused too: the comparand is ONE + * value under a scalar operator, and a list has no such value. The + * predicate is `isMultiValueField` (`@objectstack/spec/data`), the one + * `FieldSchema` reads. A registry-injected column, and a leaf on an object + * outside this stack, stay unjudged. A `{ $record }` nested * deeper inside a literal (`value: { any: { $record: 'x' } }`) is an * opaque literal to the parse, and this rule does not name it either: no * reader resolves that shape, nothing first-party writes it, and the @@ -286,9 +293,10 @@ import { recordsOf, resolveFieldPath, type FieldPathVerdict, + type GraphField, type ObjectGraph, } from './object-graph.js'; -import { classifyDottedFilterHead, isVirtualSearchField } from '@objectstack/spec/data'; +import { classifyDottedFilterHead, isMultiValueField, isVirtualSearchField } from '@objectstack/spec/data'; /** * A field-name list entry — object-level, or on one of the object's fields — @@ -478,6 +486,18 @@ interface FieldNameSlot { * different objects. */ ownFinding?: boolean; + /** + * [#34378] `true` when the path must read ONE value: its first segment and, + * behind a hop, its leaf may not be multi-valued (`isMultiValueField`). A + * path whose head is multi-valued is refused whether it ends there or hops + * through it, at the head; a multi-valued leaf behind a single-valued hop is + * refused at the leaf. Judged only on a path the family's resolution did + * not already refuse, and only on AUTHORED fields: a registry-injected + * column, or a leaf on an object outside the stack, stays unjudged. + */ + singleValued?: boolean; + /** [#34378] The hint when {@link singleValued} refuses a path. */ + singleValuedPrescription?: string; } function nameOf(v: unknown): string | undefined { @@ -551,10 +571,14 @@ const FIELD_NAME_SLOTS: readonly FieldNameSlot[] = [ pickerOnly: true, maxHops: 1, ownFinding: true, + singleValued: true, read: readRecordReference, prescription: 'Fix the path — `$record` reads the record being edited: a field of this object, or one ' + 'relationship field of it and then a field of the object it references (`account.cb_market`).', + singleValuedPrescription: + 'Point `$record` at a single-valued field: a multi-valued field holds a list, and no scalar comparison ' + + 'takes one. Copy the value you mean onto a single-valued field and reference that.', }, { key: 'dependsOn', @@ -675,6 +699,29 @@ export function validateObjectFieldRefs(stack: AnyRec): ObjectFieldRefFinding[] findings.push({ severity: 'error', rule: OBJECT_FIELD_REF_UNKNOWN, where: at.where, path: at.path, message, hint }); }; + /** + * [#34378] Where a path that resolved stops reading ONE value: its AUTHORED + * first segment on `objectName` when that is multi-valued (a plain path to + * it, or a hop through it), else — behind a single-valued hop — its + * authored leaf when that is. `undefined` = single-valued, or not + * judgeable here (a registry-injected column, an object outside the stack). + */ + const multiValuedSegment = ( + objectName: string, + segments: readonly string[], + ): { how: string; field: string; object: string } | undefined => { + const isMulti = (m: GraphField | undefined): boolean => + typeof m?.type === 'string' && isMultiValueField({ type: m.type, multiple: m.multiple === true }); + const head = graph.get(objectName)?.fields.get(segments[0]!); + if (isMulti(head)) { + return { how: segments.length > 1 ? 'goes through' : 'names', field: segments[0]!, object: objectName }; + } + if (segments.length < 2) return undefined; + const verdict = resolveFieldPath(graph, objectName, segments.join('.')); + if (verdict?.kind !== 'ok' || verdict.injected || !isMulti(verdict.meta)) return undefined; + return { how: 'ends at', field: verdict.field, object: verdict.object }; + }; + /** The declared slice of `name` on `objectName` — authored, else registry-injected. */ const fieldOf = (objectName: string, name: string) => { const o = graph.get(objectName); @@ -975,6 +1022,21 @@ export function validateObjectFieldRefs(stack: AnyRec): ObjectFieldRefFinding[] prescription: slot.prescription, }); if (hit && !slot.ownFinding) reported.add(`${at}=${read.name}`); + + // [#34378] A path that names real fields can still read a LIST: a + // multi-valued head, or a multi-valued leaf behind one hop. The + // comparand is one value under a scalar operator, so it is refused. + if (!hit && slot.singleValued) { + const multi = multiValuedSegment(against, segments); + if (multi) { + refuseKey( + { where, path }, + `${subject} "${read.name}" ${multi.how} "${multi.field}", a multi-valued field on object ` + + `"${multi.object}"; a $record comparand is one value under a scalar operator.`, + slot.singleValuedPrescription ?? slot.prescription, + ); + } + } }); } diff --git a/packages/spec/src/data/field.zod.ts b/packages/spec/src/data/field.zod.ts index d52a8651c37..a8b068df3e8 100644 --- a/packages/spec/src/data/field.zod.ts +++ b/packages/spec/src/data/field.zod.ts @@ -1315,6 +1315,12 @@ const LOOKUP_FILTER_RECORD_PATH_RE = /^[a-z_][a-z0-9_]*(?:\.[a-z_][a-z0-9_]*)?$/ * - **Path.** A field of the edited record (`quote_date`), or ONE lookup hop * from it (`account.cb_market`: the `account` lookup on the edited record, * then `cb_market` on the account it points at). Two hops are refused. + * [#34378] A path through or to a MULTI-VALUED field (`isMultiValueField`: + * one flagged `multiple: true`, or a multiselect, checkboxes or tags field) + * has no single value — `accounts.cb_market` through a `multiple: true` + * lookup, `tags`, or `account.markets` ending at one — so it is not resolved, + * and `os lint` refuses it (`object-field-ref-unknown`). The picker's + * handling of such a path is #34389. * - **Operator.** Only the six scalar comparisons * ({@link LOOKUP_FILTER_SCALAR_COMPARISONS}), and the reference is the whole * value: never a member of an `in` / `notIn` list. @@ -1361,7 +1367,9 @@ export const LookupFilterRecordReferenceSchema = lazySchema(() => strictObject({ }).describe('Path of the value on the record being edited: a field name (`quote_date`) or one lookup hop (`account.cb_market`) — at most one dot.'), })).describe( 'A lookupFilters comparand read from the record being edited: { $record: "field" } or { $record: "lookup_field.field" } (at most one lookup hop). ' - + 'The picker replaces it with that value before querying; unlike { $field }, which names a column of the candidate row.', + + 'The picker replaces it with that value before querying; unlike { $field }, which names a column of the candidate row. ' + + 'A path through or to a multi-valued field (one flagged `multiple: true`, or a multiselect, checkboxes or tags field) ' + + 'has no single value: it is not resolved, and lint refuses it (`object-field-ref-unknown`).', ); export type LookupFilterRecordReference = z.input; @@ -2262,7 +2270,9 @@ export const FieldSchema = lazySchema(() => { + '{ $now: true, addDays } comparand for a date relative to today, or a { $record: "path" } reference to the ' + 'record being edited — a field of it, or one lookup hop ("account.cb_market"); a { $record } value pairs ' + 'only with eq, ne, gt, lt, gte or lte. In a record form, whatever its layout, the picker sends the referenced ' - + 'value in place of the reference; every other picker host leaves the entry out.', + + 'value in place of the reference; every other picker host leaves the entry out. A { $record } path through or ' + + 'to a multi-valued field (one flagged `multiple: true`, or a multiselect, checkboxes or tags field) has no ' + + 'single value: it is not resolved, and lint refuses it (`object-field-ref-unknown`).', ), orEmpty: z.boolean().optional().describe( 'TRUE: the entry also matches a candidate whose column is null — "valid from the quote date, or with no ' diff --git a/packages/spec/src/migrations/entries/semantic/18.lookup-filter-record-path-multi-valued-refused.ts b/packages/spec/src/migrations/entries/semantic/18.lookup-filter-record-path-multi-valued-refused.ts new file mode 100644 index 00000000000..0eee5108282 --- /dev/null +++ b/packages/spec/src/migrations/entries/semantic/18.lookup-filter-record-path-multi-valued-refused.ts @@ -0,0 +1,42 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import type { SemanticMigration } from '../../types.js'; + +// #34378 — a `lookupFilters[].value` `{ $record: 'path' }` path must read ONE +// value of the record being edited: a path through or to a multi-valued field +// (`isMultiValueField`) is refused as `object-field-ref-unknown`, beside the +// unknown-path refusal of #34200 (`lookup-filter-record-path-unknown-refused`). +// Measured first-party exposure at this change: zero — no example app, +// platform object, skill or docs sample writes a `$record` path. Not converted: +// which single value a multi-valued path meant is the author's judgement. +export const entry: SemanticMigration = { + id: 'lookup-filter-record-path-multi-valued-refused', + surface: + 'objects[].fields..lookupFilters[].value.$record of a lookup, master_detail or user field, on an object saved ' + + 'or published through the metadata doors (PUT /api/v1/meta/object/NAME, POST /api/v1/packages/PKG/publish-drafts, ' + + 'the per-item publish and the restore doors) or loaded by os validate / os build / os lint: a path whose first ' + + 'segment is a multi-valued field of the object that owns the picker field (a plain path to it, or a hop through ' + + 'it), or whose leaf behind a single-valued hop is a multi-valued field of the object that hop references — ' + + 'multi-valued being a field flagged multiple: true, or a multiselect, checkboxes or tags field', + replacement: + 'A { $record } path reads ONE value of the record being edited: a single-valued field of the object that owns the ' + + 'picker field ("quote_date"), or one single-valued relationship field of it followed by a single-valued field of ' + + 'the object it references ("account.cb_market"). To filter by a value a multi-valued field holds, copy the value ' + + 'you mean onto a single-valued field and reference that. Refused at error as `object-field-ref-unknown` ' + + '(422 INVALID_METADATA at the doors).', + reason: + 'The { $record } comparand stands for one value and pairs only with the six scalar comparisons, but a path through ' + + 'or to a multi-valued field names a list, and the path check judged existence only, so it parsed and linted ' + + 'clean. A hop through a multiple: true lookup reaches no single row, so the picker finds no value and leaves the ' + + 'entry out without a word; a plain path to a multi-valued field hands the picker a list as the comparand of a ' + + 'scalar operator, which no declared reading answers. Either way the filter does not do what it reads as. The ' + + 'predicate is isMultiValueField, the one FieldSchema reads. No first-party stack (example apps, platform objects, ' + + 'skills, docs samples) writes a $record path today. A registry-injected column and a leaf on an object outside ' + + 'the stack are not judged. There is no mechanical rewrite: which single value the author meant is a judgement ' + + 'about the data.', + acceptanceCriteria: + 'Load every object (`os validate` or `os build`): no `object-field-ref-unknown` finding at ' + + 'fields.NAME.lookupFilters[N].value.$record that names a multi-valued field. PUT ' + + '/api/v1/meta/object/NAME?mode=draft&package=PKG with each such path pointing at a single-valued field (or one ' + + 'single-valued hop to a single-valued field) answers 200, and POST /api/v1/packages/PKG/publish-drafts publishes it.', +}; From 5b520173ae49e2d58a82339eb70ba2f19f790de6 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 12:08:53 +0000 Subject: [PATCH 2/3] docs(spec): regenerate the field reference for the multi-valued $record clause Claude-Session: https://claude.ai/code/session_01ADHkmP9xmb6H4wxJ2AJQEW Co-authored-by: Claude --- content/docs/references/data/field.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/references/data/field.mdx b/content/docs/references/data/field.mdx index 88817c90f0d..bae5909a854 100644 --- a/content/docs/references/data/field.mdx +++ b/content/docs/references/data/field.mdx @@ -242,7 +242,7 @@ const result = CurrencyConfigSchema.parse(data); | :--- | :--- | :--- | :--- | | **field** | `string` | ✅ | | | **operator** | `Enum<'eq' \| 'ne' \| 'gt' \| 'lt' \| 'gte' \| 'lte' \| 'contains' \| 'in' \| 'notIn'>` | ✅ | | -| **value** | `any` | ✅ | The comparand: a literal (an array for `in` / `notIn`), a date placeholder such as `{today}` or a `{ $now: true, addDays }` comparand for a date relative to today, or a `{ $record: "path" }` reference to the record being edited — a field of it, or one lookup hop ("account.cb_market"); a `{ $record }` value pairs only with eq, ne, gt, lt, gte or lte. In a record form, whatever its layout, the picker sends the referenced value in place of the reference; every other picker host leaves the entry out. | +| **value** | `any` | ✅ | The comparand: a literal (an array for `in` / `notIn`), a date placeholder such as `{today}` or a `{ $now: true, addDays }` comparand for a date relative to today, or a `{ $record: "path" }` reference to the record being edited — a field of it, or one lookup hop ("account.cb_market"); a `{ $record }` value pairs only with eq, ne, gt, lt, gte or lte. In a record form, whatever its layout, the picker sends the referenced value in place of the reference; every other picker host leaves the entry out. A `{ $record }` path through or to a multi-valued field (one flagged `multiple: true`, or a multiselect, checkboxes or tags field) has no single value: it is not resolved, and lint refuses it (`object-field-ref-unknown`). | | **orEmpty** | `boolean` | optional | TRUE: the entry also matches a candidate whose column is null — "valid from the quote date, or with no start date". Only with eq, ne, gt, lt, gte or lte. The picker sends the comparison or a null match on the same column. | ### Nested Shape: `Field.lookupAutofill[number]` @@ -437,7 +437,7 @@ Allowed Values: `phone`, `id_card`, `bank_account`, `email`, `name` ## LookupFilterRecordReference -A lookupFilters comparand read from the record being edited: `{ $record: "field" }` or `{ $record: "lookup_field.field" }` (at most one lookup hop). The picker replaces it with that value before querying; unlike `{ $field }`, which names a column of the candidate row. +A lookupFilters comparand read from the record being edited: `{ $record: "field" }` or `{ $record: "lookup_field.field" }` (at most one lookup hop). The picker replaces it with that value before querying; unlike `{ $field }`, which names a column of the candidate row. A path through or to a multi-valued field (one flagged `multiple: true`, or a multiselect, checkboxes or tags field) has no single value: it is not resolved, and lint refuses it (`object-field-ref-unknown`). ### Properties From cdcb553991e592fd521a29420d1852e40a495965 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 22:13:50 +0000 Subject: [PATCH 3/3] docs(spec): regenerate the field reference over the merged lookupFilters value describe Claude-Session: https://claude.ai/code/session_01ADHkmR92m7ZN6cUVQTj1VE Co-authored-by: Claude --- content/docs/references/data/field.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/references/data/field.mdx b/content/docs/references/data/field.mdx index 18f6f0d956b..612a0af3b69 100644 --- a/content/docs/references/data/field.mdx +++ b/content/docs/references/data/field.mdx @@ -242,7 +242,7 @@ const result = CurrencyConfigSchema.parse(data); | :--- | :--- | :--- | :--- | | **field** | `string` | ✅ | | | **operator** | `Enum<'eq' \| 'ne' \| 'gt' \| 'lt' \| 'gte' \| 'lte' \| 'contains' \| 'in' \| 'notIn'>` | ✅ | | -| **value** | `any` | ✅ | The comparand: a literal (an array for `in` / `notIn`), a date placeholder such as `{today}` or a `{ $now: true, addDays }` comparand for a date relative to today, or a `{ $record: "path" }` reference to the record being edited — a field of it, or one lookup hop ("account.cb_market"); a `{ $record }` value pairs only with eq, ne, gt, lt, gte or lte. In a record form, whatever its layout, the picker sends the referenced value in place of the reference; every other picker host leaves the entry out. A `{ $record }` that reaches a server unresolved is refused (INVALID_FILTER), never read as null. | +| **value** | `any` | ✅ | The comparand: a literal (an array for `in` / `notIn`), a date placeholder such as `{today}` or a `{ $now: true, addDays }` comparand for a date relative to today, or a `{ $record: "path" }` reference to the record being edited — a field of it, or one lookup hop ("account.cb_market"); a `{ $record }` value pairs only with eq, ne, gt, lt, gte or lte. In a record form, whatever its layout, the picker sends the referenced value in place of the reference; every other picker host leaves the entry out. A `{ $record }` path through or to a multi-valued field (one flagged `multiple: true`, or a multiselect, checkboxes or tags field) has no single value: it is not resolved, and lint refuses it (`object-field-ref-unknown`). A `{ $record }` that reaches a server unresolved is refused (INVALID_FILTER), never read as null. | | **orEmpty** | `boolean` | optional | TRUE: the entry also matches a candidate whose column is null — "valid from the quote date, or with no start date". Only with eq, ne, gt, lt, gte or lte. The picker sends the comparison or a null match on the same column. | ### Nested Shape: `Field.lookupAutofill[number]` @@ -437,7 +437,7 @@ Allowed Values: `phone`, `id_card`, `bank_account`, `email`, `name` ## LookupFilterRecordReference -A lookupFilters comparand read from the record being edited: `{ $record: "field" }` or `{ $record: "lookup_field.field" }` (at most one lookup hop). The picker replaces it with that value before querying; unlike `{ $field }`, which names a column of the candidate row. +A lookupFilters comparand read from the record being edited: `{ $record: "field" }` or `{ $record: "lookup_field.field" }` (at most one lookup hop). The picker replaces it with that value before querying; unlike `{ $field }`, which names a column of the candidate row. A path through or to a multi-valued field (one flagged `multiple: true`, or a multiselect, checkboxes or tags field) has no single value: it is not resolved, and lint refuses it (`object-field-ref-unknown`). ### Properties