Skip to content

Commit abc4b83

Browse files
os-billclaude
andauthored
docs(spec): search-fields docblock says $icontains, the operator the engine emits (#17572)
* docs(spec): search-fields docblock says $icontains, the operator the engine emits The module docblock claimed `expandSearchToFilter` expands a `$search` term into an `$or` of `$contains` clauses. It has compiled to `$icontains` since #7641; `packages/objectql/src/search-filter.ts:23` carries the ruling and both return paths of `fieldClausesForTerm` (:109, :111) emit `$icontains`. The distinction matters to a reader of this module because `$contains` is contractually case-SENSITIVE (#4706 Q2 = A): anyone who built an ingress gate, a test or a driver against the old sentence built one STRICTER than the platform — a false refusal, not a leak. That is now stated in one clause. The sibling INGRESS sentence two lines below was measured and is unchanged. Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH Co-authored-by: Claude <noreply@anthropic.com> * chore(changeset): declare the search-fields docblock correction as a spec patch `@objectstack/spec`'s published `files[]` ships `dist`, and this TSDoc is emitted into `dist/data/index.d.ts` and `dist/data/index.d.mts` -- measured on the built artifact, so published content moves and `skip-changeset` is not available. Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ef18030 commit abc4b83

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
`search-fields.ts`'s module docblock says `$search` expands to an `$or` of `$icontains`, the operator the engine actually emits
6+
7+
The docblock's ENGINE bullet claimed `@objectstack/objectql`'s
8+
`expandSearchToFilter` expands a `$search` term into an `$or` of **`$contains`**
9+
clauses. It has compiled to `$icontains` since objectstack#7641:
10+
`packages/objectql/src/search-filter.ts:23` carries the ruling verbatim — *"The
11+
case-insensitive operator is `$icontains`, NOT `$contains`. `$contains` is
12+
contractually case-SENSITIVE (#4706 Q2 = A)"* — and both return paths of
13+
`fieldClausesForTerm` (`:109`, `:111`) emit `$icontains`.
14+
15+
**Why the distinction is worth a clause rather than a word swap.** `$contains`
16+
is contractually case-SENSITIVE, so a reader who trusted the old sentence built
17+
an ingress gate, a test or a driver **stricter** than the platform is — a false
18+
refusal, not a leak. The corrected bullet now says that in one clause, so the
19+
next reader of this module does not have to reconstruct it from two other
20+
packages.
21+
22+
⛔ No behaviour changes. This is a module docblock; the engine has been right
23+
since #7641 and no accept set, authorable key or published behaviour moves.
24+
25+
**This is shipped, which is why it carries a changeset rather than
26+
`skip-changeset`.** `@objectstack/spec`'s published `files[]` ships `dist`, and
27+
this TSDoc is emitted into `dist/data/index.d.ts` and `dist/data/index.d.mts`
28+
measured on the built artifact, with the old spelling absent from all 216 built
29+
files afterwards and the docblock's own neighbouring sentence present at 2 as
30+
the lit control. `src/data/search-fields.ts` is not a `.zod.ts`, so it is not
31+
shipped as source; the emitted declarations are the whole of its published
32+
reach, and they change.
33+
34+
The sibling INGRESS sentence two lines below — `@objectstack/metadata-protocol`
35+
`findData` refusing a `$searchFields` override the resolved set does not admit
36+
(#4254) — was measured on the same tip and is unchanged: `findData` still calls
37+
`assertSearchFieldsAreSearchable`, which resolves through this module's own
38+
`resolveSearchFieldResolution` rather than re-implementing the rule.

packages/spec/src/data/search-fields.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
* ONE resolution shared by the two layers that must agree on it:
77
*
88
* - the ENGINE (`@objectstack/objectql` `expandSearchToFilter`), which expands
9-
* a `$search` term into a `$or` of `$contains` clauses over exactly this set;
9+
* a `$search` term into a `$or` of `$icontains` clauses over exactly this set
10+
* — `$icontains` since #7641, NOT `$contains`, which is contractually
11+
* case-SENSITIVE (#4706 Q2 = A): a gate, test or driver written to the old
12+
* sentence is STRICTER than the platform — a false refusal, not a leak;
1013
* - the INGRESS gate (`@objectstack/metadata-protocol` `findData`), which
1114
* refuses a `$searchFields` override naming a field this set does not admit
1215
* (#4254), instead of letting the engine drop it silently.

0 commit comments

Comments
 (0)