Skip to content

Commit fef3216

Browse files
claude[bot]claude
andauthored
skills(objectstack-data): the tree rows state the landed reference contract (#16187)
`refuseForeignTreeReference` (packages/spec/src/data/object.zod.ts) makes a `tree` field's `reference` optional and, when written, equal to the declaring object's own name — the `extend` target on an extension. Any other object is refused at parse with one issue at `fields.<field>.reference`. The published skill still listed `reference` as a bare key prop, so a client agent reading it had no way to know either half of the rule. Two rows, no new section: - `rules/field-types.md` — the Relational table's `tree` row now states optional-and-self-only and that a foreign object is refused at parse. - `rules/relationships.md` — the `tree` row's bare "Optional" cell now says what is optional and contrasts the refusal with the `master_detail` row's lint-warned cell in the same column. The token ratchet left `field-types.md` 27 bytes under its ceiling, so the row is paid for inside the same file: the Media section's "no per-field attachment config" note restated the top-of-file blockquote, which already refuses `fileAttachmentConfig` by name, above every table. That file now shrinks. The `Hierarchical: tree (Self-Reference)` example is unchanged — it already writes the object's own name (`reference: 'category'` on `category`). Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox Co-authored-by: Claude <noreply@anthropic.com>
1 parent 51f080b commit fef3216

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

skills/objectstack-data/rules/field-types.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ options: [
8888
|:-----|:------------|:-----------|
8989
| `lookup` | Reference another object (independent) | `reference`, `lookupFilters`, `multiple`, `deleteBehavior` |
9090
| `master_detail` | Parent–child with lifecycle control | `reference`, `deleteBehavior` (`cascade`/`restrict``set_null` is refused) |
91-
| `tree` | Hierarchical self-reference | `reference` |
91+
| `tree` | Hierarchical self-reference | `reference` — optional; when written, this object's own name (any other object is refused at parse) |
9292
| `user` | Person picker — a lookup specialized to `sys_user` (assignee, watchers). Stored identically to `lookup` | `multiple` (collaborators), `defaultValue: 'current_user'` |
9393

9494
> **`multiple: true` lookup ≠ junction object.** A multi-value lookup is stored
@@ -106,9 +106,6 @@ options: [
106106
| `video` | Video files ||
107107
| `audio` | Audio files ||
108108

109-
There is no per-field attachment config (size limits, allowed types, storage) —
110-
storage concerns live outside the field schema.
111-
112109
## Embedded (JSON sub-objects)
113110

114111
Stored as JSON on the parent row — no separate table / FK:

skills/objectstack-data/rules/relationships.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Guide for modeling relationships between objects using `lookup`, `master_detail`
88
|:-----|:----------|:---------|:--------|:---------|:---------|
99
| `lookup` | Independent | Optional by default | Independent | Supported via `summary` | "Related to" |
1010
| `master_detail` | Coupled (cascade delete) | Forced only under `controlled_by_parent`; else lint-warned | Inherits parent | Supported via `summary` | "Owned by" |
11-
| `tree` | Self-reference | Optional | N/A | Not available | Hierarchical |
11+
| `tree` | Self-reference | Optional — and so is `reference`, which when written must name this object itself; any other object is refused at parse, not lint-warned | N/A | Not available | Hierarchical |
1212

1313
## When to Use lookup vs master_detail
1414

0 commit comments

Comments
 (0)