Skip to content

Commit b89c05d

Browse files
committed
docs(skills): a virtual formula field stays out of the search auto-default; the skills change carries its changeset
Contract review on the first head: the three new sentences said a field marked `searchable: true` joins the auto-default "of any type except `secret` / `password` / `vector`", but `admittedBySearchableFlag` also keeps out a virtual field (`formula`, no stored column). Each sentence now names it, and the list-views allowed-set table no longer contradicts its own refusal table: the declared row reads "any stored field type", so the refusal row drops its restated "(nothing stored to scan)". Paid in place by same-file restatement cuts: objectstack-data drops "no traversal" from the `?search=apollo` line (the section's opening says the search axis does not resolve traversal) and the `// ← the mirror` code comment (the block's first comment names the mirror); list-views as above. A `skills/**` change publishes `@objectstack/skills`, so it carries a patch changeset instead of the skip-changeset label. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAjjRmCZgXRP1FNQS2n
1 parent c5f8165 commit b89c05d

4 files changed

Lines changed: 19 additions & 7 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): with no `searchableFields` declared, a field marked `searchable: true` joins the default search set
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Before.** `objectstack-data`, `objectstack-query` and the `objectstack-ui` list-views rule taught the record-search auto-default as type-only: the name field plus the text-like and `select` columns. A field marked `searchable: true` was described as doing nothing, and a `$searchFields` override naming one as refused.
11+
- **Now.** Each says what the platform resolves: with no `searchableFields` declared, the set `search` scans, and the set a `$searchFields` override may name, is the type-based default plus every field marked `searchable: true`, of any type except `secret`, `password`, `vector` or a virtual `formula`. Each also says what does not change: `searchable: false`, the default, never removes a field the type default scans, and declaring `searchableFields` chooses the set. The enum half of the type default is spelled `select` alone, as the resolver has it.
12+
- No schema, key or behaviour changes.

‎skills/objectstack-data/SKILL.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Toggle system behaviours per object:
115115
Leave it unset and search auto-defaults to the `nameField` plus the object's
116116
short-text and enum columns (`text` / `email` / `phone` / `url` / `autonumber` /
117117
`textarea` / `markdown` / `select`) plus every field marked `searchable: true`,
118-
of any type except `secret` / `password` / `vector`. `searchable: false`, the
118+
of any type except `secret` / `password` / `vector` or a virtual `formula`. `searchable: false`, the
119119
default, never removes a field the type default scans; declare
120120
`searchableFields` to choose the set. Views may narrow it, never widen it.
121121

@@ -139,14 +139,14 @@ declare *that* field searchable. A task list searched by project name:
139139
fields: {
140140
name: { type: 'text', required: true },
141141
project_id: { type: 'lookup', reference: 'project' },
142-
project_name: { type: 'text', label: 'Project Name' }, // ← the mirror
142+
project_name: { type: 'text', label: 'Project Name' },
143143
},
144144
searchableFields: ['name', 'project_name'],
145145
}
146146
```
147147

148148
`?search=apollo` expands to `name $contains 'apollo' OR project_name $contains
149-
'apollo'` — one single-table scan, every driver, no traversal.
149+
'apollo'` — one single-table scan, every driver.
150150

151151
❌ **Never mirror onto a `formula` field.** It is *virtual* (no column to scan)
152152
and CEL reads only this record's own fields, so it cannot hold the related title;

‎skills/objectstack-query/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ protocol normalizes `$searchFields` onto it, and the object form
318318

319319
Omit it to search the object's declared `searchableFields` (or, with none
320320
declared, an auto-default: name/title + short-text fields, plus every field
321-
marked `searchable: true` of any type except `secret` / `password` / `vector`),
321+
marked `searchable: true` of any type except `secret` / `password` / `vector` or a virtual `formula`),
322322
resolved server-side. It can only **narrow** that set, never widen it: over the
323323
REST/protocol ingress a name outside it is `400 INVALID_FIELD`, not a silent
324324
fall-back to a full scan. `searchable: false`, the default, never removes a

‎skills/objectstack-ui/rules/list-views.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ export const CaseViews = defineView({
185185

186186
| The object … | The allowed set is |
187187
|:-------------|:-------------------|
188-
| declares `searchableFields` | **that list, verbatim** — whatever the field types are |
189-
| declares nothing | the auto-default: the name field + the text-like columns (`text` / `email` / `phone` / `url` / `autonumber` / `textarea` / `markdown` / `select`) + every field marked `searchable: true`, of any type except `secret` / `password` / `vector` |
188+
| declares `searchableFields` | **that list, verbatim** — any stored field type |
189+
| declares nothing | the auto-default: the name field + the text-like columns (`text` / `email` / `phone` / `url` / `autonumber` / `textarea` / `markdown` / `select`) + every field marked `searchable: true`, of any type except `secret` / `password` / `vector` or a virtual `formula` |
190190

191191
`searchable: false`, the default, removes nothing the type default scans; declare `searchableFields` to choose the set.
192192

@@ -205,7 +205,7 @@ the whole search box, for every user and every term: no result at all.
205205
| key omitted | clean | scans the object's full allowed set |
206206
| `searchableFields: []` | clean | **identical to omitting it** — empty is *absent*, so it scans MORE than `["subject"]` would |
207207
| a renamed / mistyped column, or a dotted path (`account_id.name`) | `searchable-field-unknown` | `400 INVALID_FIELD` |
208-
| a real column outside the allowed set, or a virtual `formula` column (nothing stored to scan) | `searchable-field-unsearchable` | `400 INVALID_FIELD` |
208+
| a real column outside the allowed set, or a virtual `formula` column | `searchable-field-unsearchable` | `400 INVALID_FIELD` |
209209

210210
Both diagnostics are **errors**, not warnings — `os validate` fails the build.
211211

0 commit comments

Comments
 (0)