Observation-class finding from #6897 (docs correction to content/docs/ui/views.mdx). Recorded, not claimed — filed unassigned, finding only, no pm:queue. Nothing a user hits today; no behaviour differs in either direction.
Fact (origin/main @ 6968885ef)
packages/spec/src/data/search-fields.ts → autoDefaultFields filters the auto-default searchable set with a negative guard followed by a positive allow-list:
if (SEARCH_AUTO_EXCLUDED_FIELDS.has(f)) return false;
// …
if (SEARCH_AUTO_EXCLUDED_TYPES.has(t)) return false; // line 72
return SEARCHABLE_TEXTUAL_TYPES.has(t) || SEARCHABLE_ENUM_TYPES.has(t);
The two sets are disjoint, so line 72 can never change the outcome:
SEARCH_AUTO_EXCLUDED_TYPES = json, object, grid, image, file, avatar, vector, location, geometry, secret, password, encrypted, boolean, lookup, master_detail
SEARCHABLE_TEXTUAL_TYPES = text, email, phone, url, autonumber, textarea, markdown
SEARCHABLE_ENUM_TYPES = select, status
Any type in the first set falls through the positive test as false anyway — identically to a type in none of the three sets (number, date, …). Delete line 72 and the resolved set is unchanged for every input.
What this is NOT
Why record it anyway
An unreachable-effect branch inside a live function reads as load-bearing to the next author: someone adding a new field type to SEARCHABLE_TEXTUAL_TYPES may reasonably believe they must also keep it out of SEARCH_AUTO_EXCLUDED_TYPES, when in fact only the positive list decides. That is the same shape as #6318 (retire the unreachable visibility-alias-deprecated rule) — code that cannot fire but still instructs readers.
Two defensible dispositions, and the choice is a judgment call for triage, not something to guess:
- Retire the line. Smallest diff; makes the positive allow-list visibly the single decider.
- Keep it and say so. Add one comment line stating it is redundant-by-construction defence-in-depth against a future edit that turns the positive test into a broader one — and, if kept, a pin asserting the two sets stay disjoint, so the redundancy is a checked fact rather than a coincidence.
I lean (1) for the same reason #6318 was accepted: a guard that cannot fire teaches a rule that does not exist. But this is genuinely cosmetic and it is correct for triage to close it as won't-fix.
Refs: #6897, #6675, #6318, ADR-0061, ADR-0049.
Generated by Claude Code
Observation-class finding from #6897 (docs correction to
content/docs/ui/views.mdx). Recorded, not claimed — filed unassigned,findingonly, nopm:queue. Nothing a user hits today; no behaviour differs in either direction.Fact (origin/main @
6968885ef)packages/spec/src/data/search-fields.ts→autoDefaultFieldsfilters the auto-default searchable set with a negative guard followed by a positive allow-list:The two sets are disjoint, so line 72 can never change the outcome:
SEARCH_AUTO_EXCLUDED_TYPES= json, object, grid, image, file, avatar, vector, location, geometry, secret, password, encrypted, boolean, lookup, master_detailSEARCHABLE_TEXTUAL_TYPES= text, email, phone, url, autonumber, textarea, markdownSEARCHABLE_ENUM_TYPES= select, statusAny type in the first set falls through the positive test as
falseanyway — identically to a type in none of the three sets (number,date, …). Delete line 72 and the resolved set is unchanged for every input.What this is NOT
SEARCH_AUTO_EXCLUDED_TYPEShas a live consumer atpackages/objectql/src/search-filter.ts:46, so this is not an ADR-0049 enforce-or-remove case for the export itself — only the one guard line insideautoDefaultFieldsis inert.searchFields/groupBy/aggregations指向不存在的字段时被静默降级(#4226 收口后剩下的三条轴) #4254 ingress gate produces are built fromsource(declaredvsauto) and the type lists directly, not from this branch, so the wording is unaffected too.declaredbranch. That branch filters by existence only and never consults any type list — deliberately (see the module note inpackages/lint/src/validate-searchable-fields.ts), and that is exactly what content/docs/ui/views.mdx states a lookup in a view's searchableFields is always refused — measured, it is accepted whenever the object declares it #6897 corrects the docs to say.Why record it anyway
An unreachable-effect branch inside a live function reads as load-bearing to the next author: someone adding a new field type to
SEARCHABLE_TEXTUAL_TYPESmay reasonably believe they must also keep it out ofSEARCH_AUTO_EXCLUDED_TYPES, when in fact only the positive list decides. That is the same shape as #6318 (retire the unreachablevisibility-alias-deprecatedrule) — code that cannot fire but still instructs readers.Two defensible dispositions, and the choice is a judgment call for triage, not something to guess:
I lean (1) for the same reason #6318 was accepted: a guard that cannot fire teaches a rule that does not exist. But this is genuinely cosmetic and it is correct for triage to close it as won't-fix.
Refs: #6897, #6675, #6318, ADR-0061, ADR-0049.
Generated by Claude Code