Repository navigation
feat(fields): lookup picker resolves { $record } lookupFilters values and sends orEmpty - #34253
Conversation
…lues from the record being edited and sends orEmpty Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3 Co-authored-by: Claude <noreply@anthropic.com>
… $record } and orEmpty Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3 Co-authored-by: Claude <noreply@anthropic.com>
…ad, orEmpty and the form's hop-object stamp Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3 Co-authored-by: Claude <noreply@anthropic.com>
…alues and orEmpty Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 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 b32dc22272e606389d93f0ec98294c47771745a8 && git checkout b32dc22272e606389d93f0ec98294c47771745a8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2c96e0dfc9297ba791c8acb6484ebe678dfd7d12 866523ae733c6337d578bb4847516261affd821b && git checkout -B drift-repro 2c96e0dfc9297ba791c8acb6484ebe678dfd7d12 && git merge --no-ff 866523ae733c6337d578bb4847516261affd821b
node scripts/docs-audit/affected-docs.mjs --json 2c96e0dfc9297ba791c8acb6484ebe678dfd7d12
|
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer quota limit, 2026-11-16T02:39Z) · head 34d869b The quota limit is the maintainer's order of 2026-11-15T21:53Z (no fable for contract review). Scope of the contract face:
|
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi Contract-review-hold: session_01ADHkmSzhXR4yUAgwq1bQRi · head 34d869b · the seat is sending one more change before review: review#2: please hold off on this head; a new request follows. |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 34d869b · 2026-11-16T02:40Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Withdrawn: my contract-review claim on head 34d869b (comment 6905793675). The lane posted Contract-review-hold on this head first (comment 6905789546). The subagent was stopped and its work discarded. I will review again when the lane knocks with the new head. |
…orm says a record is being edited
A record form stamps withRecordBeingEdited on a lookup whose lookupFilters
read { $record }; the picker resolves the references only on that stamp.
Every other host, such as a bulk action dialog handing the widget its
sibling parameters, leaves every { $record } entry out.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3
…e picker resolves on Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3
…reads off the field channel recordBeingEdited is stamped by ObjectForm and buildSectionFields and never authored, so it is a RUNTIME-ONLY ledger row, not a FormFieldSchema key. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer quota limit, 2026-11-16T04:28Z) · head 0b8ad7e The quota limit is the maintainer's order of 2026-11-15T21:53Z (no fable for contract review). This replaces the hold on head 34d869b. Contract face (unchanged from the first handoff):
|
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 0b8ad7e · 2026-11-16T04:29Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T04:37Z. First review of this head; claim: comment 6907355140; lane request 6907342354 on mailbox #33873. Independence: implemented in an os-steve project thread, dispatched by domain:ui#2 (os-steve); reviewed by os-tesla, who neither dispatched nor implemented it. Read against merge base ① Derived judgments
② Semver level
CI on this head at read time: 69 check-runs, 27 success, 11 skipped, 31 in progress, 0 failed. Green so far include Check Changeset, Spec property liveness, Lint & Repo Gates, Build Docs and Governed Surface Queue Guard. Still running: Test UI (16 shards), Test Core (8 shards), Type Check UI, Type Check workspace and consumer gates, Lint UI, Build Core, Build & E2E UI, Live E2E UI. This verdict does not depend on them. ③ Boundary flags
④ Design judgment
M1 (must-fix) — The describes now promise resolution on surfaces where the picker drops the entry. With the S1 (should-fix) — A hop whose value cannot be read is treated as empty, and the contract lists only empty values. The docblock and describe enumerate null, unset, an empty string and an unset hop lookup. The resolver also leaves the entry out when the hop row or its field does not come back, when the host names no object for the hop, and when the host has no single-row reader. The dev-mode warning covers two of those and none of them in production. Add the case to the describe's empty-value sentence ("or cannot be read"), and consider saying something once when a read fails. S2 (should-fix) — "Runtime-only" is held by the authoring validators and by convention, not pinned at the hosts it protects. The census ledgers the key correctly and I found no document shape that carries it to a host without a record. But the pin for the unstamped side renders S3 (should-fix, a follow-up card is acceptable) — The sentence "A { $record } that reaches a server unresolved is refused, never read as null" now stands in a describe with no PLANNED marker beside it, and in the ledger note this PR rewrote, while the refusal is unmeasured for either position a reference can take in a filter. Measure it (one server-side pin per position) or file the carrier card and cite it from the ledger note. N1 (nit) — N2 (nit) — Implementing files. Apart from M1 and S1, the code agrees with the contract it implements: the path grammar read is the spec's (a field, or one hop); an expanded related row collapses to its id; the query keys on the resolved values, so a referenced field re-queries and an unrelated one does not; candidate queries and both Level-2 pickers are held while a hop read is pending; Prior ids: none on this PR (first review). Carried from PR #34078: N6 closed, N8 unchanged by design. Implemented-by: VERDICT: FAIL |
…nd that an unreadable value is left out Record forms (auto layout, modal, drawer, tabbed, wizard) resolve the reference; every other picker host leaves the entry out. A value that cannot be read is left out like an empty one. The liveness row cites the server refusal's carrier and is re-verified. Reference pages regenerated. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3
…{ $record } lookup filter out
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3
…tamp onto its widget
bulkParamToField forwarded every unenumerated param key, so a bulk param
that wrote recordBeingEdited itself opted its lookup into { $record }
resolution against the sibling params. The key is dropped; paramToField
already builds the field from enumerated keys. Both dialog pins gain the
case.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3
…he spec's referenceTargetOf A hop through a user field carries no reference: its target is fixed by the type. The stamp now asks the same arbiter the object linter's $record rule asks, so such a hop resolves. The census ledger row names what holds the runtime-only invariant and where the loose form-field shape is tracked. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer quota limit, 2026-11-16T09:59Z) · head 866523a The quota limit is the maintainer's order of 2026-11-15T21:53Z (no fable for contract review). Delta from FAIL 6911356996 (review#1, head 503e015); report r4 = comment 6913229157 on #34197. review#1 or review#2, whichever seat takes it.
|
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi Contract-review-handoff: review#1 — CONTRACT_REVIEW_TIER unavailable (maintainer quota limit, 2026-11-16T10:32Z) · head 866523a This re-addresses handoff 6913244819 (the same head and the same r4 delta) to review#1. review#2's mailbox #33873 has been closed since 2026-11-16T07:39Z, so that knock reached no one. The quota limit is the maintainer's order of 2026-11-15T21:53Z (no fable for contract review). This is the delta from review#1's own FAIL 6911356996 at 503e015. CI on 866523a: success 60 · skipped 11 · 1 cancelled (the PR-body guards run, superseded) · no failures. |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head 866523a · 2026-11-16T10:35Z |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract reviewServed-tier: Full review of this head against merge base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
The M1 fix holds.
S2 (should-fix) — A path that reads a multi-valued field has no declared answer; a follow-up is acceptable.
N3 (nit) — Implementing files, otherwise. The code agrees with the contract sentence by sentence, as at the previous head.
Earlier findings (record 6911356996). M1: closed. New at this head: S2, N3. Implemented-by: VERDICT: PASS |
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi 维护者速读
席位意见解析要由宿主主动开启(只有记录表单才打标记),这样就从根上堵住了在批量或参数对话框里拿错记录的值去过滤。读不到时去掉条目,也符合 describe 里「需要保存时强制的规则也要放在服务端」的分工。跳一次的目标对象与 linter 共用 席位核对 — ACCEPT · domain:ui#2 · head 866523a · 2026-11-16T10:43Z |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43852335079 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi Merge-queue triage — re-queue once · head 866523a · 2026-11-16T11:18Z Queue build 43852335079 failed one test, in Test Core (3/8):
So the seat re-queues once on the same head. If the same test fails again, it goes to the server lane as a card instead of a second re-queue. |
Requested by Steve · project thread
Fixes #34197
Clause-②: no
Metadata-protocol: none
维护者速读
lookupFilters里的{ $record: 'quote_date' }/{ $record: 'account.cb_market' },用正在编辑的那条记录的值替换后再查候选;orEmpty: true发成「比较 或 该列为空」。只有记录表单会给字段打上「正在编辑一条记录」的标记(并写明跳一层的查找指向哪个对象),选择器只在有这个标记时才解析;批量操作、参数对话框等其它宿主一律丢弃这类条目。{ $record }或orEmpty的查找字段;普通字面过滤和dependsOn的查询逐字节不变(有对照测试)。回滚即还原本 PR。ui/packages/fields/src/widgets/lookupRecordReference.ts(解析与跳一层读取)、LookupField.tsx中queryLookupFilters一段、RecordPickerDialog.tsx的lookupFiltersToRecord(orEmpty 与未解析引用的丢弃)。pnpm --dir ui exec vitest run packages/fields/src/widgets/LookupField.recordReference-34197.test.tsx packages/plugin-form/src/__tests__/lookupRecordHop-34197.test.tsx,应见 14 条全部通过。What changes
The resolver —
ui/packages/fields/src/widgets/lookupRecordReference.ts(new, the one reader of the spec'sLookupFilterRecordReferenceSchema):resolveLookupFilters(filters, record, hopRows)puts the value a{ $record }path names in place of the reference. A path is a field of the record being edited, or one lookup hop (account.cb_market).'', an empty list, an unset hop lookup) is left out, the rule an unsetdependsOnparent follows (seat ruling 6900252552 §1).useRecordHopRowsreads each hop's target row once per id,$selecting only the hop fields, unless the record already holds the row expanded with that field. It reportspendinguntil the read lands. Answers are keyed by object, id and fields.withRecordBeingEdited(def, fields)stamps, on a lookup whose filters read{ $record }, the host's statement that a single record is being edited here:recordBeingEdited: { hopObjects: { account: 'account' } }, naming the object each hop's lookup references. A hop's object is the spec'sreferenceTargetOf(rework r4, review#1 M1), the arbiter the object linter's$recordrule also asks, so a hop through auserfield, whose target the type fixes with noreferencewritten, resolves like one through alookup. It is the same hand-off shape asfollowedParentObject/formObject: a widget receives one field, not the object it is drawn for. Exported from@object-ui/fields. ⛔ A field without the stamp resolves no{ $record }: every such entry is left out, whatever values its host passes.findOne) is left out, with one dev-modeconsole.warnper path naming the remedy.LookupField — on a stamped field the edited record is the host's
dependentValues; on any other it is an empty record, so every{ $record }entry drops.queryLookupFiltersis the resolved list, keyed on its JSON so it moves only when a resolved value moves. It feeds the quick-select popover, the recents rail, the table picker and PeoplePicker. Filters that read no record pass through as the authored array, so literal entries keep their exact previous identity and bytes. While a hop read is pending, the popover query and recents fetch are held, and the Level-2 pickers are held shut, so the first query goes out once, with the value in it. The referenced fields are not added todependsOnand gate nothing.lookupFiltersToRecord(RecordPickerDialog):orEmpty: trueon eq/ne/gt/lt/gte/lte becomes{ $or: [condition, { column: { $null: true } }] }, one member of a$andlist, so several such entries each keep their alternative.{ $record }is left out: an unresolved reference never reaches the wire.lookupFiltersprops of RecordPickerDialog and PeoplePicker are typed by reference to the spec row (NonNullable<Field['lookupFilters']>[number]), which declaresorEmpty.Record forms —
ObjectForm(auto layout) andbuildSectionFields(authored sections, used by Modal/Drawer/Tabbed forms) wrap the field they hand the widget inwithRecordBeingEdited, beside the existingwithFollowedParentObject/withFormObjectstamps. These are the only callers: every record form (Modal / Drawer / Tabbed / Wizard and the auto layout) goes through one of the two builders.Action dialogs —
bulkParamToField(plugin-grid) never carriesrecordBeingEditedfrom a bulk param onto its widget: it used to forward every unenumerated param key (...extra), so a bulk param that wrote the key itself opted its lookup into resolution against the sibling params (rework r3).paramToField(app-shell), the single-record dialog's twin, builds the widget field from enumerated keys and never carried it.Field-channel census —
ui/examples/schema-catalog/test/form-field-channel-census-12130.test.tsxgains one ledger row,recordBeingEdited, read byfields/src/widgets/lookupRecordReference.ts. It is RUNTIME-ONLY: stamped byObjectFormandbuildSectionFields, and ledgered, not declared onFormFieldSchema. The row names what holds the invariant: the two builders and the closed spec shapes (the publishedcustomFieldsmember and action params refuse the key). objectui's looseFormFieldSchema, which can author it on an inline form field, is tracked by #34344 (review#1 S1). This fixes the Test UI (13/16) red on34d869b8, where the old keyrecordHopObjectswas read and neither declared nor ledgered.Spec —
packages/spec/src/data/field.zod.ts, describes only:value,orEmptyandlookupFiltersdescribes lose[PLANNED — not enforced]and say what the picker sends.lookupFiltersandvaluedescribes and the docblock name where{ $record }resolves — record forms only (the auto layout, modal, drawer, tabbed and wizard forms) — and say every other picker host leaves the entry out: inline edit on a record page, a record page's header or related list, an action's parameter dialog, and a bulk action over selected rows.lookupFiltersdescribe the "every other picker host" half follows the record-form half directly. The changeset's empty-value bullet adds "or cannot be read" (N2).lookupFilters(measured:ui/packages/plugin-list/srchas nolookupFiltersread; its lookup chips useLookupValuePicker).LookupFilterRecordReferenceSchemadocblock.content/docs/references/**regenerated (check:generated --fix→gen:docs). ThelookupFiltersrow ofliveness/field.jsonnow cites the readers in place of the dated "declared ahead" sentence, names the record forms, says the server's refusal of an unresolved$recordis not measured and cites its carrier server: resolveFilterTokens refuses an unresolved { $record } lookup-filter value by name #34199, and is re-verified (verifiedAt2026-11-16).Surfaces that read
lookupFilters, and what each gets:{ $record }ObjectForm) — stampedModalForm/DrawerForm/TabbedForm/WizardFormand the other section builders, viabuildSectionFields) — stampedGridFieldline-item lookup columns, list filter panellookupFiltersTests
New pins. Ablation: each was mutated on disk through
scripts/ablation-replace.mjs, ran red, and was restored to the HEAD blob (git diff HEADempty).{ $record }field value is sent in placeLookupField.recordReference-34197.test.tsxundefined→ 1 redorEmptysends the$ornull match{ $record }entry out, even when its values hold one of that name (the bulk action dialog's shape); no hop readwithRecordBeingEditedstamps nothing → 9 red (every stamped pin, both form pins)dependsOnquery exactly as beforeObjectFormstamps the field; the hop value reaches the queryplugin-form/.../lookupRecordHop-34197.test.tsxuserfield held as an id: the form namessys_user, the picker reads the hop ($select: ['id','region']) and sends its valuereferencealone → 1 redBulkActionDialog: a lookup param whose filters read{ $record: 'quote_date' }beside a siblingquote_dateparam holding a value leaves the entry out; the literal entry beside it is sentplugin-grid/src/__tests__/bulkActionDialogRecordReference-34197.test.tsxActionParamDialog, same shapeapp-shell/src/views/ActionParamDialog.recordReference-34197.test.tsxrecordBeingEditeditself still leaves the entry out and sends no sibling valuebulkActionDialogRecordReference-34197.test.tsxbulkParamToFielddrop removed → 1 redActionParamDialog.recordReference-34197.test.tsxparamToFieldforwards the key → 1 redrecordBeingEditedand it is ledgeredform-field-channel-census-12130.test.tsxunexpected: recordBeingEdited ← …lookupRecordReference.ts)The first attempt at A7–A9 was a no-op:
ablation-replacerefused it because the replacement text already occurred in the file. They were re-run with a delete and a distinct replacement, and those runs are the ones reported. A1–A9 were measured on34d869b8; A10, A11, A8r, A9r and A12 on the r1 head; A13 on the r2 head; A14 and A15 on the r3 head; A16 on the r4 head, each red and restored to the HEAD blob.Suite and type-check readings
pnpm --dir ui exec vitest run packages/fields/ packages/plugin-form/plus the two dialog pin files and the census on the r2 head: Test Files 543 passed | 1 skipped (544), Tests 7248 passed | 8 skipped (7256). Earlier rounds: 7211 (r1), 7209 (r0).pnpm --dir ui exec vitest run examples/schema-catalog/test/form-field-channel-census-12130.test.tsx: 35 passed.pnpm --filter @object-ui/fields --filter @object-ui/plugin-form run type-check: both pass (plugin-form afterpnpm --filter @object-ui/fields build).pnpm --filter @objectstack/spec check:generated:check:docsstale →--fixregeneratedgen:docs, re-check green.check:test-typecheckpasses withNODE_OPTIONS=--max-old-space-size=4096; without it, tsc ran out of heap on this shared box.Acceptance notes
{ $record }resolution is opt-in by the host.BulkActionDialoghands a lookup param the dialog's own parameter values (cascadeProps, objectui#8755) and stamps nothing, so it now leaves every{ $record }entry out, as ruling 6900252552 §1 reads ("a bulk-action bar … leaves every{ $record }entry out").ui/packages/plugin-grid/**is not touched. The signal is the field-definition stamprecordBeingEdited(withRecordBeingEdited). The alternative considered was aLookupFieldprop,recordBeingEdited, passed by the form renderer. It was not taken because a record form hands the widget a field definition, not props, and the existing hand-offs (followedParentObject,formObject) ride the definition.{ $record }entry out too. Since r2 the describes say so in as many words (review#2 M1, remedy a; the seat ruled no further hosts opt in on this card).looseObjectandbulkParamToFieldspread unenumerated keys, so a bulk param that wroterecordBeingEditedopted itself in (measured before the fix: the query carried the sibling's value). The spec'sBulkActionParamSchemais astrictObjectand refuses the key at authoring.bulkParamToFieldnow drops the key;BulkActionDialog.tsxis not touched.$record(ruling §3, review#2 S3) is not built or measured here. Its carrier is server: resolveFilterTokens refuses an unresolved { $record } lookup-filter value by name #34199, cited from the liveness note.content/docs/data-modeling/fields.mdxandrelationships.mdxdo not yet teach{ $record }/orEmpty. The Skills-docs follow-up the card names carries that teaching.Verification
Head
866523ae(rework r4, with main35c9a305merged in). Gates were derived bynode scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon this head, run locally and reconciled with--ran. Every CI family is read from this PR's check-runs.dispatch-gates --ran: 115 derived, 115 run, 0 NOT-MEASURED, 0 UNRUN. Every gate exited 0 on the first pass.pnpm install --frozen-lockfile --offlineafter the merge;turbo run build --filter='./packages/**';turbo run buildof the dependencies of@object-ui/plugin-gridand@object-ui/plugin-form.@object-ui/fields,@object-ui/plugin-formand@object-ui/plugin-grid: pass.vitest run packages/fields/ packages/plugin-form/ packages/plugin-grid/, plus theActionParamDialogpin file and the field-channel census. Test Files 826 passed | 1 skipped (827), Tests 9721 passed | 8 skipped (9729).34d869b8,0b8ad7e7,0179f341,503e0152), each of which read 115/115.NODE_OPTIONS=--max-old-space-size=4096.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmTKRu1t68jcJGgRYi3