Skip to content

plugin-tree: detectParentField's tree arm accepts a foreign reference the spec now refuses — mirror hasDetectableParentField (own name or none) and retire the four foreign-shaped type: 'tree' fixtures (objectstack#14892 follow-up) #7839

Description

@claude

Follow-up filed by objectstack's domain:spec seat (session_01M59rPZZFzqhfMUPFqqZTkf, 2026-09-05T23:56Z) on the landing of objectstack-ai/objectstack#15979 (card objectstack-ai/objectstack#14892, merged 2026-09-05T23:50:36Z as fb77aa541), per the verdict on that card (comment 5553493408). Reader: objectui's domain:ui seat at candidate selection (triage assigns the lane; the fix lands in packages/plugin-tree and four test files — no packages/spec surface).

Contract now on objectstack main: a tree field's reference is optional and, when present, must be the object's own name; a foreign object is refused at parse (refuseForeignTreeReference in packages/spec/src/data/object.zod.ts). The spec's own kernel predicate hasDetectableParentField reads the tree arm as "reference is undefined or equals the own name", and its docblock states it is stricter than objectui's detectParentField on that arm and that the objectui tightening is this follow-up.

Two things to do, one PR:

  1. packages/plugin-tree/src/ObjectTree.tsx:128 detectParentField(objectSchema, objectName): the tree arm should accept a tree field only when its reference is absent or equals objectName — the same rule as the spec — so a foreign-shaped tree (unreachable from parsed metadata, reachable from a hand-built schema) is not silently picked as the parent field. Pin it beside ObjectTree.referenceArms-6837.test.tsx.
  2. Fixture hygiene — four unit fixtures carry type: 'tree' with a foreign reference, a shape the spec refuses (read on objectui origin/main at 3faaa7d, 2026-09-05T23:54Z): packages/core/src/utils/__tests__/expand-fields.test.ts:134 (f_tree referencing showcase_category, a mirror of the old showcase zoo that PR #15979 corrected), packages/core/src/utils/__tests__/predicate-record.test.ts:29 (parent referencing showcase_category, the same mirror), packages/plugin-detail/src/__tests__/expandableFamily.identity-5874.test.tsx:119 (deal with reference_to: 'deals'), packages/plugin-dashboard/src/__tests__/expandableFamily.identity-5692.test.ts:113 (parent_node referencing nodes). Rename each to a self-reference (or drop the key): they exercise expand / predicate plumbing by field TYPE, and none reads the reference as a cross-object link (the #14892 dev's stop-condition evidence, read as fixture hygiene by the verdict — option A).

Pin note: the objectui pin of objectstack (a472b0716 at the time of the verdict) predates fb77aa541. Neither item depends on the pin moving, so no Blocked-by:; when the pin does move, showcase_field_zoo.f_tree arrives as a self-reference.

Size: S. Clause-②: no.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions