Repository navigation
feat(lint)!: refuse a lookupFilters { $record } path through or to a multi-valued field - #34489
Conversation
…i-valued field
A { $record } comparand stands for one value under a scalar operator; a
path whose head is multi-valued (a plain path to it or a hop through it),
or whose leaf behind a single-valued hop is, now fails
object-field-ref-unknown, judged by isMultiValueField. The describes say
so, with an ADR-0087 semantic entry and a changeset.
Claude-Session: https://claude.ai/code/session_01ADHkmP9xmb6H4wxJ2AJQEW
Co-authored-by: Claude <noreply@anthropic.com>
…rd clause Claude-Session: https://claude.ai/code/session_01ADHkmP9xmb6H4wxJ2AJQEW Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmR92m7ZN6cUVQTj1VE Co-authored-by: Claude <noreply@anthropic.com>
…ers value describe Claude-Session: https://claude.ai/code/session_01ADHkmR92m7ZN6cUVQTj1VE Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmR92m7ZN6cUVQTj1VE Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 173 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin c18c806474cdef99dddeb54c6eae08c669f8fdcf && git checkout c18c806474cdef99dddeb54c6eae08c669f8fdcf
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 24b6ae55016b74c4bcef81f09cdaa4684ffc9423 7f7310830a0d4fa73576d316afafc25dbb134b2d && git checkout -B drift-repro 24b6ae55016b74c4bcef81f09cdaa4684ffc9423 && git merge --no-ff 7f7310830a0d4fa73576d316afafc25dbb134b2d
node scripts/docs-audit/affected-docs.mjs --json 24b6ae55016b74c4bcef81f09cdaa4684ffc9423
|
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 7f73108 · 2026-11-16T23:22Z |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract reviewServed-tier: Inputs read: card #34378 body and all 9 comments, PR #34489 body, file list and 2 comments, the net diff from merge-base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. Narrowing face. Read against the published spec on
N1 (nit) — "it is not resolved" in the two describes is true today of the hop shape only; for a plain path to a non-empty multi-valued field the picker on Observation outside the card, not a finding on this diff: a Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmPJxG4vBVaLCBWLcWJ Flake judgement · 2026-11-16T23:27Z ·
Judged a flake: the failed jobs are re-run once through |
|
repo:objectstack#2 · os-steve · session_01ADHkmPJxG4vBVaLCBWLcWJ Final head · 2026-11-16T23:57Z
|
|
repo:objectstack#2 · os-steve · session_01ADHkmSmxJiAWk7fuq3Q1Sf 席位核对L1 verdict: ACCEPT · card #34378 · area o2-A · first review · read at 2026-11-16T23:59Z Checklist, read against GitHub and
L2 owed: yes, and it is in. The surfaces touched are published schema ( Landing tier. |
|
repo:objectstack#2 · os-steve · session_01ADHkmPJxG4vBVaLCBWLcWJ Landing · 2026-11-17T00:01Z · head
L1 ACCEPT 6933175205 and contract review PASS 6932506491 on this head; dogfood battery on this head (report 6932366621). Ready for review and auto-merge through the queue; #34378 closes with the merge. |
Requested by Steve · project thread
Fixes #34378
Clause-②: no (narrowing) — a
lookupFilters[].value{ $record }path on a lookup, master_detail or user field whose first segment is a multi-valued field of the object owning that field (a plain path to it, or a hop through it), or whose leaf behind a single-valued hop is a multi-valued field, linted clean and published; it is now refused at error asobject-field-ref-unknownbyos lint,os validate,os buildand the runtime publish door, and reported (never refused) on the package publish receipt's object probe.Metadata-protocol: narrowed
Skills-docs: follow-up #34201 — no doc or skill teaches
{ $record }yet, so there is no teaching to correct here; the multi-valued clause rides the describes this change edits.维护者速读
lookupFilters里的{ $record: "路径" }(读取正在编辑的记录)如果指向或穿过多值字段(multiple: true的查找/选择/人员字段,或多选、复选框、标签字段),lint 现在直接报错并点名那个字段。$record代表"一个值",只配 eq/ne/gt/lt/gte/lte 这类单值比较;多值字段是一个列表,之前 lint 照样放行,结果选择器要么悄悄丢掉这条过滤,要么拿列表去比单值,过滤看着对、实际不生效。object-field-ref-unknown的$record成员);examples / 平台对象 / 插件 / skills / 文档样例实测 0 处写$record路径,无存量受影响。客户端半边(选择器丢弃该条并给开发提示)在 ui: a lookupFilters { $record } path through or to a multi-valued field is sent as a list (plain path) or silently dropped (hop) with no dev warning #34389,不在本 PR。回滚即 revert。packages/lint/src/validate-object-field-refs.ts(multiValuedSegment与$record槽位后的判读)、packages/lint/src/validate-object-field-refs.test.ts(多值一组 8 条)、packages/spec/src/migrations/entries/semantic/18.lookup-filter-record-path-multi-valued-refused.ts。pnpm --filter @objectstack/lint exec vitest run src/validate-object-field-refs.test.ts,预期 127 条全绿,其中多值一组 8 条。What changes
object-field-ref-unknown,lookupFilters[N].value.$recordmember: a path that already resolves is judged for cardinality too (a new slot propertysingleValued, set only on that member). The predicate is spec's ownisMultiValueField(@objectstack/spec/data), the oneFieldSchemareads: an inherently multi type (multiselect,checkboxes,tags), ormultiple: trueon a multi-capable type. No second copy of the type list.tags) or hops through it (accounts.cb_market): message... names "tags", a multi-valued field .../... goes through "accounts", a multi-valued field ....account.marketsends atmarketsoncrm_account).Point $record at a single-valued field ....rule-explanations.ts: the$recordparagraph ofos explain object-field-ref-unknownnames the multi-valued refusal.packages/spec/src/data/field.zod.ts: theLookupFilterRecordReferenceSchemadescribe and thelookupFilters[].valuedescribe each gain one clause: such a path has no single value, is not resolved, and lint refuses it. No client behaviour is claimed; the picker's handling is ui: a lookupFilters { $record } path through or to a multi-valued field is sent as a list (plain path) or silently dropped (hop) with no dev warning #34389 (named in the jsdoc only — the describes carry no tracker ids). The value describe keeps main's sentence on the server refusal of an unresolved{ $record }.lookup-filter-record-path-multi-valued-refused(template:lookup-filter-record-path-unknown-refused); the id does not collide on main at0e2e4f56.content/docs/references/data/field.mdx.First-party exposure (measured at
7f731083)git grep -lEfor a$record:key with a string value, outside*.test.ts(x)andcontent/docs/references/**: zero files inexamples/,packages/platform-objects,packages/plugins,packages/services,packages/qa,skills/,content/docs/andui/examples. Repo-wide the only hits are changesets, the spec/lint/core sources and semantic entries, and the ui picker reader. Positive control: the same expression counts 8 lines inpackages/lint/src/validate-object-field-refs.test.ts. Verdict: nothing first-party to judge; no shipped app's picker changes.Tests
packages/lint/src/validate-object-field-refs.test.ts, new blocka path through or to a multi-valued field(8 cases); every refusal assertsseverity: 'error',rule: OBJECT_FIELD_REF_UNKNOWN, the path and the hint:tagsnames "tags"(full message pinned)multiple: trueselectmultiple: truelookupaccounts.cb_marketmultiple: trueuser fieldaccount.marketsbehind a single hopcrm_account(full message pinned)multiple: falseselect, hop to an injected columnForced edits to existing tests, named: the shared
quotefixture'scrm_accountgains amarkets: multiselectfield (no existing case reads it), and the one-line-verdict fact list gainsa path through or to a multi-valued field.Ablation (scripts/ablation-replace.mjs; restored blob == HEAD)
Cardinality read disabled (
if (!hit && slot.singleValued) {→ guarded by an unset global marker):Tests 6 failed | 121 passed (127)— exactly the six refusal cases; the miss case and every control stayed green. Restored: blobfd916767== HEAD,git diff HEADempty. The test imports./validate-object-field-refs.jsrelatively (source, notdist), so no rebuild leg applies.Acceptance notes
ff1bf727,5b520173,3781dec5) came from a stopped thread with no report; every reading here was re-taken on this branch. Merging them onto main conflicted in thelookupFilters[].valuedescribe with main's server-refusal sentence (fix(core): an unresolved { $record } lookup-filter comparand is refused by name before any driver sees it #34330); both sentences are kept.ui/file.Verification
Readings at head
7f731083(merge oforigin/maine8cba8fe; the incoming commits touch onlyui/), after a fullpnpm build --concurrency=2(119 tasks, VERDICT command-exit 0).@objectstack/linttypecheckexit 0;test:Test Files 214 passed (214),Tests 9091 passed (9091).@objectstack/spectypecheckexit 0;vitest run src/data src/migrations:Test Files 178 passed (178),Tests 6556 passed | 1 todo (6557).@objectstack/cliunittest/explain-rule-id.test.ts(iterates everyos explainentry):Tests 14 passed (14).pnpm --filter @objectstack/spec check:generated:content/docs/references/**stale untilgen:schema && gen:docsregeneratedfield.mdx(committed);check:test-typecheckexit 0 when re-run with a 4 GB heap (the first run died intscwithout diagnostics, a heap reading, not a finding).!, Clause-② carries(narrowing)): running at this head when the PR opened; the reading follows on the card report.Derived gate round at 7f73108: dispatch-gates --commands gives 117 families; --ran gives 117 run, 0 NOT-MEASURED, 0 UNRUN
All 117 exited 0 on their first run at this head (
check-plugin-teardown-shape --self-testafter fetching its pinned fixture commit).🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmR92m7ZN6cUVQTj1VE