Skip to content

Commit f0848a5

Browse files
committed
test(lint): reword three searchable-fields test comments to the no-clause reading
The json/lookup comments in validate-searchable-fields.test.ts still said a declared json column is a `$contains` scan over the stored JSON text that CAN match. Reworded to match the module docblock: a json column is admitted but contributes no clause; a single lookup becomes an `$icontains` over the stored foreign key; flagging either would reject metadata the runtime accepts (ADR-0072 D1). Comments only: no assertion, fixture or test name moves. Claude-Session: https://claude.ai/code/session_01JQwxbY5V8enQpRc6k9NscP Co-authored-by: Claude <noreply@anthropic.com>
1 parent a123ca3 commit f0848a5

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

‎packages/lint/src/validate-searchable-fields.test.ts‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,12 @@ describe('validateSearchableFields — what it deliberately does not flag', () =
216216
});
217217

218218
it('does not flag a field that exists but is an odd search target', () => {
219-
// An explicit `searchableFields` is authoritative — the engine scans
219+
// An explicit `searchableFields` is authoritative — the runtime admits
220220
// exactly what it names — so declaring a json column is a choice, not
221-
// drift. This rule answers existence only.
221+
// drift. It is admitted but contributes no clause to the `$search`
222+
// expansion (its declared type can never hold a string). This rule
223+
// answers existence only: flagging it would reject metadata the runtime
224+
// accepts (ADR-0072 D1).
222225
const findings = validateSearchableFields({
223226
objects: [
224227
{
@@ -536,9 +539,11 @@ describe('validateSearchableFields — list views that narrow the set', () => {
536539

537540
it('passes a view entry of odd type once the object declares it searchable', () => {
538541
// The runtime's declared branch filters by EXISTENCE, never by type: a
539-
// json/lookup column declared on the OBJECT is honored by the engine and
540-
// admitted by the gate, so the view echoing it must stay green — flagging
541-
// it would reject metadata the runtime accepts.
542+
// json/lookup column declared on the OBJECT is admitted to the resolved
543+
// set and by the gate (a json column contributes no clause to the
544+
// `$search` expansion; a single lookup becomes an `$icontains` over the
545+
// stored foreign key), so the view echoing it must stay green — flagging
546+
// it would reject metadata the runtime accepts (ADR-0072 D1).
542547
const findings = validateSearchableFields({
543548
objects: [
544549
{
@@ -962,11 +967,13 @@ describe('[#6674] validateSearchableFields — a virtual formula entry', () => {
962967

963968
it('CONTROL — a json or lookup entry on the OBJECT\'s own set stays clean', () => {
964969
// The carve-out #4830 wrote down, deliberately preserved: the runtime's
965-
// declared branch executes those (a `$contains` over the stored JSON text /
966-
// the stored foreign key). Narrow and rarely useful, but a scan that CAN
967-
// match — flagging it would reject metadata the runtime accepts (ADR-0072
968-
// D1). If this control ever goes red, #6674 has quietly become "the declared
969-
// branch is type-filtered", which it is not.
970+
// declared branch admits those. A json column contributes no clause to the
971+
// `$search` expansion (its declared type can never hold a string); a single
972+
// lookup becomes an `$icontains` over the stored foreign key, narrow and
973+
// rarely useful but a scan that CAN match. Either way, flagging it would
974+
// reject metadata the runtime accepts (ADR-0072 D1). If this control ever
975+
// goes red, #6674 has quietly become "the declared branch is
976+
// type-filtered", which it is not.
970977
expect(
971978
validateSearchableFields({
972979
objects: [

0 commit comments

Comments
 (0)