Skip to content

Commit 3ad5680

Browse files
claude[bot]claude
andauthored
docs(content): a tree field does not require reference — two pages said it did (#14890)
`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. Claude-Session: https://claude.ai/code/session_017RbbUMnxkUnWhE4j94v8FE Co-authored-by: Claude <noreply@anthropic.com>
1 parent a392dbf commit 3ad5680

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

content/docs/data-modeling/validation-rules.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ section above). See the
539539
| `lookup` | `reference` | Foreign key integrity |
540540
| `user` || Lookup specialized to `sys_user`; `multiple: true` stores an id array |
541541
| `master_detail` | `reference` | Cascade delete, ownership |
542-
| `tree` | `reference` | Self-referencing; no automatic cycle check |
542+
| `tree` | | Self-referencing; no automatic cycle check |
543543
| `image` || Common image MIME types; `multiple` for many |
544544
| `file` || Any file type; `multiple` for many (no field-level upload config) |
545545
| `avatar` || Single image, typically square |

content/docs/deployment/troubleshooting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The custom error map provides "Did you mean?" suggestions for common typos.
7575

7676
### "Required property missing: reference"
7777

78-
**Symptom:** A `lookup`, `master_detail`, or `tree` field fails validation.
78+
**Symptom:** A `lookup` or `master_detail` field fails validation.
7979

8080
**Cause:** Relational fields require a `reference` property pointing to the target object.
8181

0 commit comments

Comments
 (0)