Repository navigation
docs(lint): dashboard-filter-binding-unknown explanation counts a globalFilters entry named dateRange as declared - #29525
Conversation
…alFilters entry called dateRange as a declared filter The explanation said a dateRange binding on a dashboard without dateRange is always reported. The rule reads every globalFilters entry's name as declared, so a globalFilters entry named dateRange makes the binding valid. Correct the sentence and the two docblocks, and pin the accepted case with a test. Claude-Session: https://claude.ai/code/session_01JQwxbaAMsVe1WU74CypjTZ Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check
What this run could not see
Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
domain:spec#5 · os-warren · session_01JQwxbWR3K3h7i1ytwycVg1 维护者速读
席位核对ACCEPT ·
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 41498916863 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Warren · project thread
Fixes #29382
Clause-②: no
Metadata-protocol: none
维护者速读
os explain dashboard-filter-binding-unknown的一句说明,和validate-widget-bindings.ts里两段注释;规则代码不变,新增一个测试。dateRange的仪表盘上,dateRange绑定一律报错」;实测规则接受名为dateRange的globalFilters条目,说明与行为不符。packages/lint/src/rule-explanations.ts(第 407–410 行那句)、packages/lint/src/validate-widget-bindings.test.ts(新测试)。pnpm --filter @objectstack/lint exec vitest run src/validate-widget-bindings.test.ts -t dashboard-filter-binding-unknown,预期 13 个用例全绿。What changes
packages/lint/src/rule-explanations.ts, ruledashboard-filter-binding-unknownonly: the third paragraph said "AdateRangekey on a dashboard that declares nodateRangeis reported the same way". It now says adateRangekey is reported only when the dashboard declares neitherdateRangenor aglobalFiltersentry nameddateRange, because either one is a declared filter under that name.packages/lint/src/validate-widget-bindings.ts: the rule family docblock and theDASHBOARD_FILTER_BINDING_UNKNOWNdocblock say the same. No code line changed.packages/lint/src/validate-widget-bindings.test.ts: one new case in thedashboard-filter-binding-unknownblock. The dashboard has nodateRange, aglobalFiltersentry{ name: 'dateRange', field: 'signed_at', type: 'date' }, and a widget withfilterBindings: { dateRange: false }. It expects zero findings..changeset/29382-filter-binding-daterange-prose.md: a patch for@objectstack/lint, because the explanation text ships in itsdist/.Why
The card asked for a measurement first. The rule takes its declared names from
dashboardFilterDefs, which adds everyglobalFiltersentry under itsname. So aglobalFiltersentry nameddateRangeis declared even when the dashboard has nodateRange. The new test measured it onorigin/main94d3e25 before any prose edit: the case passed with zero findings. The rule accepts the binding, so this PR takes the prose-only arm and leaves the rule body alone. The runtime agrees: objectuiresolveDashboardFilterDefs(ui/packages/core/src/utils/dashboard-filters.ts) builds the same name set.Tests
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-widget-bindings.test.ts -t 'dashboard-filter-binding-unknown':Tests 13 passed | 178 skipped (191), lock VERDICT command-exit 0.Acceptance notes
packages/spec/src/ui/dashboard.zod.tsstill saysdateRangeis "reserved for the built-in dashboard date range" (theglobalFilters[].nameTSDoc) and "(dateRange only when declared)" (thefilterBindingsdescribe). Both are on the spec side that open PR fix(spec)!: refuse a dashboard globalFilters entry keyed dateRange beside a declared dateRange #29370 owns, which keeps aglobalFiltersentry nameddateRangeaccepted on a dashboard withoutdateRange. They are outside this card's file surface. carrier: PR fix(spec)!: refuse a dashboard globalFilters entry keyed dateRange beside a declared dateRange #29370.dateRangekey still reads "DeclaredateRangeon the dashboard, or delete thedateRangeentry." It is reached only when neither declaration exists, so it is accurate; it does not mention theglobalFiltersspelling. Not changed, because the claim limits the rule body to the false-positive arm.Verification
All readings are on head
abff9a05(b6d1ad0eplus a merge oforigin/main86d36e9).Package tests and typecheck
pnpm --filter @objectstack/lint test:Test Files 190 passed (190),Tests 7858 passed (7858), lock VERDICT command-exit 0.pnpm --filter @objectstack/lint typecheck: lock VERDICT command-exit 0.Derived gates (dispatch-gates --commands, 58 families)
pnpm check:dual-build-cjs-loads: exit 3, PREREQUISITE NOT MET (it needs every package'sdist/). NOT MEASURED locally; CI'sLint & Repo Gatesruns it on a full build.dispatch-gates --ran: "58 derived famil(ies) accounted for, 57 run, 1 NOT-MEASURED".node scripts/check-nul-bytes.mjs: exit 0.Repo-wide
pnpm lintand every other CI family: read from this PR's check-runs.Human Minimum
packages/specholds no runtime logic. (no spec change)pnpm lintpasses. (repo-wide lint is CI's run)main, one pull request.packages/spectouched: not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Branch
claude/project-thread-xi96xfis the card thread's platform-assigned branch, as the Claim records. Written bydomain:spec#5 · os-warren · session_01JQwxbaAMsVe1WU74CypjTZ.Generated by Claude Code