From 5df44f13425670a2a6170be661aaa7484d95c2d3 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Sep 2026 07:43:17 +0000 Subject: [PATCH] =?UTF-8?q?docs(content):=20a=20`tree`=20field=20does=20no?= =?UTF-8?q?t=20require=20`reference`=20=E2=80=94=20two=20pages=20said=20it?= =?UTF-8?q?=20did?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `reference` is required for `lookup` and `master_detail` only. Three surfaces already agree on that and two docs pages disagreed with all three: - `packages/spec/src/data/field.zod.ts:1064-1065` (the `reference` docblock) names `lookup` and `master_detail` as the types the superRefine enforces it for. - `packages/spec/src/data/field.zod.ts:1073` (`.describe()`) says "Target object name (snake_case) for lookup/master_detail fields". - `packages/lint/src/data-model-rules.ts:103` — `RELATIONSHIP_TYPES = new Set(['lookup', 'master_detail'])`, consumed at :499 and :577 by `relationship/missing-reference`. `tree` is not in the set. A reference-less `tree` is a shape the spec's own tests construct and assert defined behaviour for — `field-value.test.ts:69` (`referenceTargetOf` returns undefined) and `filter-dotted-head.test.ts:31` (still classified `relation`) — so no gate rejects one and none should: the docs were asserting a requirement nothing enforces. A default-self-reference reading is falsified too, by `examples/app-showcase/src/data/objects/field-zoo.object.ts:108`, where a `tree` field points at `showcase_category` rather than at its own object. Two cells, both stating the same claim: - `content/docs/deployment/troubleshooting.mdx:78` drops `tree` from the symptom line. The Cause line at :80 stays true for the two remaining types. - `content/docs/data-modeling/validation-rules.mdx:542` — the "Quick Validation Summary" table's second column is `Required Props` (:517), and the `tree` row listed `reference` there. It becomes an em dash, matching the `user` row beside it, which is likewise a reference-carrying type with no required prop. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_017RbbUMnxkUnWhE4j94v8FE --- content/docs/data-modeling/validation-rules.mdx | 2 +- content/docs/deployment/troubleshooting.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/data-modeling/validation-rules.mdx b/content/docs/data-modeling/validation-rules.mdx index 28af424f20..6cf27395dd 100644 --- a/content/docs/data-modeling/validation-rules.mdx +++ b/content/docs/data-modeling/validation-rules.mdx @@ -539,7 +539,7 @@ section above). See the | `lookup` | `reference` | Foreign key integrity | | `user` | — | Lookup specialized to `sys_user`; `multiple: true` stores an id array | | `master_detail` | `reference` | Cascade delete, ownership | -| `tree` | `reference` | Self-referencing; no automatic cycle check | +| `tree` | — | Self-referencing; no automatic cycle check | | `image` | — | Common image MIME types; `multiple` for many | | `file` | — | Any file type; `multiple` for many (no field-level upload config) | | `avatar` | — | Single image, typically square | diff --git a/content/docs/deployment/troubleshooting.mdx b/content/docs/deployment/troubleshooting.mdx index db62e4fe3b..3ebadfc246 100644 --- a/content/docs/deployment/troubleshooting.mdx +++ b/content/docs/deployment/troubleshooting.mdx @@ -75,7 +75,7 @@ The custom error map provides "Did you mean?" suggestions for common typos. ### "Required property missing: reference" -**Symptom:** A `lookup`, `master_detail`, or `tree` field fails validation. +**Symptom:** A `lookup` or `master_detail` field fails validation. **Cause:** Relational fields require a `reference` property pointing to the target object.