Repository navigation
fix(fields): a lookupAutofill written on a standalone form node's field is not run - #37090
Conversation
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…nd the grid column Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…lookupAutofill Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…t the field meta Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 and the narrowing-face L2 · area a4-U · 2026-11-24T22:13Z
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ Contract reviewServed-tier: Inputs read: card #36923 (body and all 8 comments, ruling 7138010812, addendum 7145912427), PR #37090 (body, its one comment, 6 files, net diff ① Derived judgmentsEvery surface whose accept set, behaviour or type moves, and whether the PR names it:
S1 (should-fix) — the widget-level narrowing is not stated where a host author reads it. ② Semver level
S2 (should-fix) — the marker's justification does not say what it rests on. It argues "the consumer is code calling it, not metadata an upgrade could rewrite", which is true, and stays silent on the body's own FROM, TO and ③ Boundary flags
④ Design judgmentAgainst the ruling (7138010812) and the code:
Attempts to break it, and what each found:
N1 (nit) — the whole feature now rests on module identity. N2 (nit) — the N3 (nit) — the stamped map is now frozen and the no-target return is a copy. Neither is in the TO line. No in-tree caller writes to the map or compares the return to its argument. N4 (nit) — the production guard is Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
… names the widget narrowing and what its marker rests on Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for delta L1 + L2 (round 2) · area a4-U · 2026-11-25T02:21Z
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ Contract reviewServed-tier: Delta review of the record at What the delta is: one merge commit The merge: its tree ① Derived judgmentsS1: closed. Read at this head:
The banner against the code:
Whether the delta or the merge moved anything further:
② Semver levelUnchanged and still right:
S2: closed. The marker is still #37136 is the follow-up card for that gap: "ADR-0087 disposition vocabulary: no fact-based category for a breaking behaviour narrowing of a published runtime function", filed by the zone, sourced to S2, with the five closed categories walked and PR #37090 as the measured case. One fact the zone's comment does not carry: triage closed it as not planned four minutes after it was filed (2026-11-24T22:29Z, p3 first-touch standard: no user-visible defect, too large for the weekly sweep; "the next ADR-0087 amendment can take it as one row"). The marker's sentence stays true, since the card is the record of the gap. S2 asked for the card and the wording, and both exist; whether the gap is worked is triage's call and is not reopened here. Passed to L1 as a fact, not a finding.
③ Boundary flags
④ Design judgmentThe design is the one the prior record judged; no line of it moved. The widget gate, the issued-only read and the always-stamp are the same blobs after the merge as before it, apart from the comment hunk in N5 (nit) — two things the new banner leaves unsaid. It speaks of a pick only, while the same gate also stops the opening fill of a create form's opening value on an unstamped host ( No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
…e field map the stamp needs Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ Contract reviewServed-tier: Delta review of the record at What the delta is: one commit The merge: its tree The PR's net diff: unchanged except for the changeset. The seven other files hold the same blob at ① Derived judgmentsN5: closed. The banner at this head, sentence by sentence:
Both things N5 named are now said: the opening fill, and the field map the stamp needs with what happens without one. The PR body's "Breaking" section carries the same three lines. Whether the delta moved anything further:
② Semver levelUnchanged and still right: ③ Boundary flags
④ Design judgmentThe design is the one the first record judged; no line of it moved in this delta. No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for hand-off (round 3) · area a4-U · 2026-11-25T03:30Z
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 维护者速读
Hand-off · 2026-11-25T03:33Z · @os-zhuang — PR #37090 (card #36923) is ready for your approval. It is a declared narrowing ( |
Fixes #36923
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — every page that teaches
lookupAutofillteaches it as a key on the object's lookup field, read by the record form and the line-item grid, and none teaches it on a standalone form node, so nothing it says became false (git grep -i lookupAutofill over skills/ and content/docs/ at 47d5f69: skills/objectstack-data/rules/field-types.md and relationships.md, skills/objectstack-ui/rules/actions.md and one eval in views-apps-actions-pages.json; content/docs/data-modeling/fields.mdx, the generated references, and two release pages)Ruling-ref: 7138010812 on #36923, the maintainer, verbatim: 「同意 拒收(推荐)」
维护者速读
What changes
Per the ruling on #36923 (comment 7138010812): a
lookupAutofillwritten by hand on a field of a standaloneformnode is not run. The pick still sets the lookup, but it copies nothing into other fields. Record forms and line-item grid columns keep the behaviour #36918 shipped, the cross-currency rule included.LookupFieldruns the declared pairs only on a lookup that carries the record form's stamp (withLookupAutofillTargets, applied bystampRecordFormFieldsingateFormFields, the one step every record-form layout draws its fields through). No new public export, prop or context, and no new dependency edge.WeakSetwhen it is issued, which is the patternwithRecordBeingEditedalready uses. AlookupAutofillTargetskey written as data on a loose form field is not a stamp.globalThis.process?.env?.NODE_ENV !== 'production', the spellinglookupRecordReference.tsalready ships) warns once per field, names the field, and says where the key is honoured.lookupAutofillnow says the key is honoured only in record forms and grid columns. The spec describe (FieldSchema.lookupAutofill, "Read wherever this field is picked: the record form, and a line-item grid column over it") already says this, sopackages/specis not touched.lookupAutofillhas 0 non-test hits underexamples/andui/examples/at 6c1dfb3. The first dev report on the card measured HotCRM: 0type: 'form'nodes.Breaking: two published surfaces narrow
The seat ruled on 2026-11-24 that this is a narrowing. The changeset carries two BREAKING banners and the ADR-0087 disposition
not-required (no-migration-prescription).The widest one is the
lookup/master_detailwidget (LookupField) handedonAutofill.onAutofill(and noonSelectRecord) and the field carriedlookupAutofillpairs.withLookupAutofillTargetsissues, which the record form applies to every field it draws. A host that handsonAutofillwithout that stamp sets the lookup and fills nothing, on a pick and on the opening fill alike. A standaloneformnode is one such host.withLookupAutofillTargets(field, objectFields)before handing it to the widget, passing the object's field map as the record form does. With no map the stamp names no target, so the pick copies without the cross-currency rule, which is the copy this change stops. Or declarelookupAutofillon the object field and draw the object's record form.FieldWidgetProps.onAutofill(widgets/types.ts) now names the stamp. The same sentence inplugin-grid'srelationalMetaKeys.tslookupAutofillnote is corrected too.readLookupAutofillTargetsis a published export of@object-ui/fields(re-exported throughexport *). It no longer returns a target map it used to return.readLookupAutofillTargets(field)returned any non-array object found under the field'slookupAutofillTargetskey.withLookupAutofillTargetsstamped, which is what the record form does. A same-name key written by hand readsundefined.withLookupAutofillTargetsnow also stamps a lookup whose pairs name no field of the map it is given, with an empty map. The map is frozen, and a field with pairs always comes back as a copy.withLookupAutofillTargets, as the record form does. If you need the raw value, readfield.lookupAutofillTargetsdirectly.What the marker rests on. The changeset body carries a code-level prescription: the FROM, TO and Fix lines, written without an arrow. So the gate admits
no-migration-prescriptionon a detector miss, not on a checked fact. No fact-based category covers a runtime function whose behaviour narrows:runtime-interface-onlyreads exported types, andruntime-export-retiredreads an export that is gone. The vocabulary gap is #37136. The marker's own reason says this.Fix round 1
CI
Test UI (2/16)was red at 6c1dfb3 because of this PR.relationalMetaCopySet.derivation.test.tsfound that LookupField's dev warning readnameoff the field meta, a read thatRELATIONAL_META_READ_SETdoes not classify forlookup-editor. The warning now takes the field name from the props or the form entry (props.name || lookupField?.name), which is the same read the trigger's test id already makes. So the table needs no new row and the derivation test is unchanged.Fix round 2
origin/mainmerged in at 952484e (37 commits; clean). Scoped re-checks followed: the seven @objectstack builds,@objectstack/spec check:generated(spec moved on main), and type-check and tests forfields,plugin-form,plugin-gridand the schema catalog.fieldsandplugin-gridalso moved on main.FieldWidgetProps.onAutofillnames the stamp, the changeset adds a BREAKING banner forLookupFieldwithonAutofill, and therelationalMetaKeys.tsnote is corrected.Tests
New file
ui/packages/plugin-form/src/__tests__/lookupAutofillStandaloneForm-36923.test.tsx, 8 cases:formnode: a pick copies nothing, and the dev warning fires once, naming the field, across two picks; a production build copies nothing and warns nothing; a hand-writtenlookupAutofillTargetsdoes not opt the field in;ObjectForm): a USD quote fills the price and description with no note and no warning; a EUR quote fills the description and withholds the price with the note;GridField,planLookupAutofillpath): a cell pick fills the declared target.Ablations at 47d5f69 (vitest resolves @object-ui/* to src through the ui alias map, so no dist leg)
Each was run through
node scripts/ablation-replace.mjsunder the verify lock. The mutation is verified on disk (anchor count 1 to 0, blob changed) and the restore is verified (blob equal to HEAD,git diff HEADempty). After all three,git diff HEADis empty.autofillPairs = declaredPairs): 3 failed, 5 passed. The three standalone pins fail withexpected '100' to be ''(twice) andexpected 'A widget' to be ''. The record-form, grid and unit pins stay green. Blob 1b68e764, restored to 01485cad.readLookupAutofillTargets: 2 failed, 6 passed. The forged-stamp pin fails withexpected '100' to be '', and the data-key unit pin fails withexpected {} to be undefined. Restored to 83b9b5ba.expected undefined to deeply equal {}. Restored to 83b9b5ba.Acceptance notes
lookupAutofillTargetson a lookup whose pairs name no field of the map. It used to leave such a lookup unstamped. The empty map carries no currency context, so the copy and the opening-fill timing are unchanged there.readLookupAutofillTargets(exported) now answers only for a stampwithLookupAutofillTargetsissued. Its only in-tree reader isLookupField.withLookupAutofillTargetsnow freezes the map it stamps, and a field with pairs always comes back as a copy, even with no target. No in-tree caller writes to the map or compares the return to its argument.WeakSet. If a page ever loads two instances of@object-ui/fields(it ships bothdist/index.jsanddist/index.cjs), a stamp issued by one is no stamp to theLookupFieldof the other. Record-form autofill would then stop, with only the development warning to say so.withRecordBeingEditedalready carries the same exposure on main, so this is a recorded cost, not a new class.defineblock ('process.env': {},process.platform,process.version), was run on a probe entry. An app build rewritesglobalThis.process?.env?.NODE_ENVthe same way it rewritesprocess.env.NODE_ENV:--mode productionfolds both to the production branch, and--mode developmentfolds both to the development branch. So the warning is dead code in the console's production bundle, and the spelling stays aslookupRecordReference.tsships it. A library-mode build rewrites neither spelling, which leaves both to the consuming app's bundler.recordFormStamp.tsheader said a standalone node's lookup "copies as it always did". That comment was made false by this change, so it is corrected.Verification
Read first, by risk:
ui/packages/fields/src/widgets/LookupField.tsx, thedeclaredPairs/autofillTargets/currencyTargetshunk: the gate, plus the currency context kept off for an empty stamp.ui/packages/fields/src/widgets/lookupAutofill.ts,withLookupAutofillTargets/readLookupAutofillTargets: always stamp, issued-only read.ui/packages/plugin-form/src/recordFormStamp.ts: header only.Two-minute check:
cd ui && pnpm exec vitest run packages/plugin-form/src/__tests__/lookupAutofillStandaloneForm-36923.test.tsx. Expected result: 8 passed.Local readings at 47d5f69
dispatch-gates --commandsderived 38, and all 38 exit 0.check:type-check-debtwas rerun under the verify lock, exit 0, after its first run missed the lock.--ranreconciles them: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.check:adr-0087-registrationexit 0 ([BREAKING+clause-②-narrowing] not-required (no-migration-prescription)),check-empty-changesetexit 0,check-changeset-no-majorexit 0.@objectstack/spec check:generated(spec moved on main): exit 0. The seven @objectstack builds, run as Test UI runs them: exit 0.turbo run type-checkon @object-ui/fields, @object-ui/plugin-form, @object-ui/plugin-grid and @object-ui/example-schema-catalog: 72/72 successful.packages/fields/: 329 files passed, 1 skipped; 5016 tests passed, 7 skipped.packages/plugin-form/ examples/schema-catalog/: 291 files passed; 5227 tests passed, 1 skipped.packages/plugin-grid/: 312 files and 2769 tests passed.pnpm --dir ui exec vitest run scripts/: 172 files passed, 2 skipped.pnpm --filter @objectstack/dogfood testunder the lock, after its closure build, gave VERDICT command-exit 0. Test Files: 487 passed, 3 skipped. Tests: 4128 passed, 68 skipped. No failures.Generated by Claude Code