feat(lint): 视图 searchableFields 按运行时同一套判定做构建期校验 —— lookup 笔误在 validate 期就报错,而非运行时 400 (#4830) - #4844
Merged
baozhoutao merged 1 commit intoAug 3, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
baozhoutao
marked this pull request as ready for review
August 3, 2026 10:03
baozhoutao
deleted the
claude/issue-4830-searchablefields-type-validation
branch
August 3, 2026 10:13
…e 期就报错,而非运行时 400 (#4830) 视图级 searchableFields 会被客户端逐字回显为 $searchFields,#4254 入口闸按 resolveSearchFieldResolution 判定后整条查询 400 INVALID_FIELD;此前 compile/validate 只查存在性,类型笔误全绿放行。 新规则 searchable-field-unsearchable(error):对象内建 listViews、defineView 的 list/listViews、react <ListView> 四个 narrowing 面,直接消费运行时同一个 resolveSearchFieldResolution(@objectstack/spec/data),不复制类型清单, declared = enforced。对象自身 canonical 集合维持只查存在性(运行时按存在过滤、 不按类型过滤,构建期拒绝会误伤运行时接受的元数据,ADR-0072 D1)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4830
问题
视图 searchableFields 声明了不可搜索类型字段(如 lookup)时,compile/validate 全绿,但 Console 工具栏搜索把声明逐字回显为
$searchFields,#4254 入口闸按对象的可搜索集合判定后整条查询 400 INVALID_FIELD——任何角色敲第一个字符即整列表翻车,纯声明层笔误三道关全放行。修复(issue 方案 1,declared = enforced)
新增 lint 规则
searchable-field-unsearchable(error 级),对四个视图级 narrowing 面(对象内建 listViews、defineView 的 list/listViews、react 页面 ListView searchableFields)按运行时同一个resolveSearchFieldResolution(@objectstack/spec/data)做构建期判定,单一事实源、不复制类型清单。测试
packages/lint:970 个测试全过(新增 9 个:issue 复现用例、declared 源越界、hidden、系统列 declared 存在性 stub 一致性、canonical 不查类型等),
tsc --noEmit干净。跨对象路径的能力缺口另拆 #4840(未指派)。
🤖 Generated with Claude Code