Uh oh!
There was an error while loading. Please reload this page.
fix(console): spell the object sample's lookup target reference, and record what still blocks it - #6845
Merged
Conversation
…d record what still blocks it
`apps/console/src/preview-samples.ts`'s `object` sample declared its lookup
target as `reference_to`, which `FieldSchema` refuses BY NAME
(`unrecognized_keys`, with its own did-you-mean pointing at `reference`), and
which the designer never read either — `ObjectFieldInspector` seeds its
Lookup-target box from `def.reference`, so the old spelling rendered that box
empty on the one sample that exists to demonstrate a lookup.
The defect the card is really about is the ledger: the sample is quarantined in
`preview-samples-spec-valid.test.ts` under a reason naming only the array
`fields` shape, so whoever fixed that half would have found the sample still
red with no note. Measured against the installed spec 17.2.0, two blockers
actually remain once the key is fixed, and the reason now names both: the
deliberate array `fields` shape (it covers `readFields()`'s array branch), and
`status.options` as bare strings where the spec wants `{ label, value }`
objects — the latter reported only after the array shape stops
short-circuiting the parse.
Pinned in RETIRED_KEYS so it cannot drift back: for a quarantined sample the
reverse assertion asks only for `length > 0`, which the array-shape defect
satisfies forever, so a re-added retired key would change no test result at
all. Both spellings (`reference_to` and the tombstoned camelCase
`referenceTo`) are pinned.
Dev-only harness plus its test; declared as releasing nothing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRJge11jso9TpXRWFt1Z49
This was referenced Aug 29, 2026
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
os-sam
marked this pull request as ready for review
August 30, 2026 03:17
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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#6647
The
objectpreview sample declared its lookup target asreference_to. The defect the card is really about is the ledger: the sample is quarantined inpreview-samples-spec-valid.test.tsunder a reason naming only the arrayfieldsshape, so whoever fixed that half would have found the sample still red with no note.Premise re-derived, not trusted (spec 17.2.0, installed)
Key isolated from the array-shape defect by using a record-shaped
fields, so only the key varies:fields: { acct: { type:'lookup', label:'Account', reference_to:'account' } }success:false—unrecognized_keysatobjects.0.fields.acct,keys:["reference_to"]referencesuccess:true— value survives asreference: "account", alongside the defaults (deleteBehavior:"set_null", …)Exact refusal message, quoted verbatim:
The premise holds. Note the arrow the spec actually prints is
→, not->.Which of the two acceptable shapes, and why the card's own framing needed correcting
The card offered: re-spell the key and let the reason name only the remaining array-shape defect, or record both defects. Measurement says the first option would now UNDER-state, which is the same defect this card is about — so this PR re-spells the key and records everything that actually remains.
Measured on the real sample (issue counts scoped to
objects):fields+reference_to)objects.0.fieldsinvalid_type"expected record, received array"reference_tooptions, plusunrecognized_keys ["reference_to"]objects.0.fields.status.options.0..2invalid_type"expected object, received string"So the key defect was real and independent — and a third defect the card did not know about sits behind it:
status.optionsare bare strings whereFieldSchemawants{ label, value }objects. Zod short-circuits atobjects.0.fields, so today only the array shape is reported; the other two hid behind it.What the ledger now says vs what is actually still true
The
objectrow now reads: the arrayfieldsshape (deliberate — it coversreadFields()'s array branch) andstatus.optionsas bare strings, "reported only once the array shape stops short-circuiting the parse". The final row of the table above is exactly that claim, measured. Nothing more, nothing less: after the key fix,unrecognized_keysis gone from that list.The array
fieldsshape is untouched, per its own recorded note.The pin, and why a quarantined row needs one
RETIRED_KEYSgains['object','reference_to', …]and its camelCase twinreferenceTo(tombstoned in@object-ui/typeswithspecEquivalent: 'reference', objectui#6041). For a SPEC_CLEAN sample that table is belt-and-braces; for a quarantined one it is the only guard there is — the reverse assertion asks forlength > 0, which the array-shape defect satisfies forever, so a re-added retired key changes no test result at all. That is not hypothetical: it is how this sample carriedreference_tothrough four spec releases.Ablation (fix committed first, then mutated): re-introducing
reference_toin the sample turns exactly one test red —The reverse assertion staying green under the regression is the demonstration: without the new pin, that regression is invisible. Mutation confirmed on disk before the run (
reference:grep 1 to 0,reference_to:grep 0 to 1; blob hash moved59cdad2cto0b46c87f); restore proved after, not assumed — worktree hash back to59cdad2c= the HEAD blob,git diff HEADempty. No rebuild leg applies: the test imports../preview-samplesas a relative source path, so nodistis in the resolution.Also verified
ObjectFieldInspectorseeds its Lookup-target box fromdef.reference, soreference_torendered that box empty on the one sample that exists to demonstrate a lookup. The read door (object-fields-io.ts) strips the camelCasereferenceTobut not the snake_case twin — that is its documented "add it on evidence, not defensively" contract, not a gap.examples/schema-catalog/src/schemas/fields-lookup/*.jsonspellreference_tolegitimately — they are{ type:'form', fields:[…] }UI component schemas, not object metadata documents.Verification (union re-run at
fed9977d, after the final commit)Executed test files named by the verbose reporter:
src/__tests__/preview-samples-spec-valid.test.tsandsrc/__tests__/preview-samples-registry-resolvable.test.ts. Typecheck genuinely covers both edited files —tsc --listFileslists them (they are not excluded), checked because atypecheckthat excludes tests reads clean while measuring nothing.No existing test moved: 85 files / 948 tests, all passing, no edits to any other test.
Changeset — the gate's own verdict decided it
preview-samples.tsis dev-only: its sole importer ispreview-gallery.tsx, served from the standalonepreview-gallery.htmlVite entry, andapps/console/vite.config.tsdeclares norollupOptions.input, so that entry is absent from thedist@object-ui/consolepublishes. Declared with an EMPTY frontmatter; the gate calls that "the explicit exemption and a complete answer to this gate":(The
skip-changesetlabel is deliberately NOT applied — in this repo no workflow reads it.)Out of scope, filed separately
#6844 — the
status.optionsstring form. Not addressed here: re-authoring those options means inventing thevaluecodes the sample should demonstrate, which is a sample-content decision rather than a mechanical re-spelling. It is recorded in the ledger reason in the meantime.Generated by Claude Code