You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
positive control — { type:'lookup', reference_to:'company' }
success: false, unrecognized_keys
The control proves the harness really refuses things, so the three trues are real acceptances and not a dead parse.
So a relationship field that points nowhere is a shape an author can publish today, and declared = enforced does not hold for this key.
Why it is worth closing
A lookup with no target is not actionable downstream. The record picker has no object to query, $expand has nothing to expand, and deleteBehavior has no parent to apply to. Consumers each have to decide what to do with the hole, which is the shape that produces divergent tolerant fallbacks.
AI-authored metadata is the population most exposed. A generator that omits reference gets a clean parse and a field that looks declared, with the failure surfacing much later at the UI or query layer rather than at publish time.
Options, not a recommendation to adopt as-is
A superRefine on FieldSchema requiring a non-empty reference when type is lookup or master_detail — matches the prose, and is the declared = enforced answer. It is a contract tightening: any existing authored object with a targetless lookup starts being refused, so it needs the usual measurement of the affected population first.
Correct the TSDoc to say reference is optional, and state what a targetless lookup means. Cheaper, but keeps a key whose absence nothing checks.
Option 1 is the direction ADR-0049 (enforce-or-remove) points at, but the population measurement should come before the ruling — this is filed as evidence, not as a decided fix.
Measured while implementing #13222 part (2). Filed unassigned by a
domain:enginedev seat; not a blocker for that card.The gap
FieldSchema's own TSDoc forreferencesays, atpackages/spec/src/data/field.zod.ts:1001-1003:The schema does not enforce it. Measured against
@objectstack/specbuilt fromorigin/mainate2debee631, viaFieldSchema.safeParse:{ name:'company_id', type:'lookup', reference:'company' }{ name:'company_id', type:'lookup' }— noreference{ name:'company_id', type:'lookup', reference:'' }{ name:'p', type:'master_detail', reference:'company' }{ type:'lookup', reference_to:'company' }unrecognized_keysThe control proves the harness really refuses things, so the three
trues are real acceptances and not a dead parse.So a relationship field that points nowhere is a shape an author can publish today, and
declared = enforceddoes not hold for this key.Why it is worth closing
$expandhas nothing to expand, anddeleteBehaviorhas no parent to apply to. Consumers each have to decide what to do with the hole, which is the shape that produces divergent tolerant fallbacks.reference_to— a key the spec REFUSES — so no authored lookup field has ever been indexed on MongoDB #13222 part (2), driver-mongodb buildsidx_FIELD_lookupfor alookupcarryingreferenceand declines when it is absent or empty — a correct call, but it means the unenforced key now silently decides whether an index exists.referencegets a clean parse and a field that looks declared, with the failure surfacing much later at the UI or query layer rather than at publish time.Options, not a recommendation to adopt as-is
FieldSchemarequiring a non-emptyreferencewhentypeislookupormaster_detail— matches the prose, and is thedeclared = enforcedanswer. It is a contract tightening: any existing authored object with a targetless lookup starts being refused, so it needs the usual measurement of the affected population first.referenceis optional, and state what a targetless lookup means. Cheaper, but keeps a key whose absence nothing checks.Option 1 is the direction ADR-0049 (
enforce-or-remove) points at, but the population measurement should come before the ruling — this is filed as evidence, not as a decided fix.Reproduce
Related
#13222 (where this was measured) · ADR-0049 enforce-or-remove
Generated by Claude Code