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
fix(lint): remove the primaryField phantom key from both title-face rules (#6326)
`primaryField` is declared nowhere in `packages/spec`. Measured on the
17.0.0-rc.5 dist, `ObjectSchema.safeParse` returns
`unrecognized_keys: ['primaryField']` and `ObjectSchema.create()` throws,
while the same shape with `nameField` parses clean. The key was therefore
never a declarable authoring surface, yet three consumers treated it as a
legal title face.
Per the maintainer ruling on #6326 (remove, do not declare — `nameField` is
ADR-0079's canonical title pointer and a second parallel pointer contradicts
Prime Directive #7), this drops it at every consumer, with zero change to
`packages/spec`:
- `data-model-rules.ts`: `object/missing-name-field` loses the
`!!obj.primaryField` disjunct.
- `validate-semantic-roles.ts`: rule (d)'s title-resolution chain narrows to
`[nameField, displayNameField]`.
- `skills/objectstack-data/SKILL.md`: the rule row now names only surfaces an
author can actually declare. This was the live half — the skill doc is what
an AI author reads, and it advertised a key `ObjectSchema.create()` rejects.
Test disposition, per the three-way fixture triage:
- `packages/cli/test/data-model-rules.test.ts` "accepts an object with a name
field or primaryField": REPLACED WHOLESALE. Its `primaryField` assertion was
vacuous twice over — the fixture is one the schema rejects, and its `code`
field is itself in NAME_LIKE_FIELDS, so the name-like limb accepted the
object regardless and the assertion stayed green with the limb deleted. It
never pinned the limb. The surviving half (a name-like field is a title
face) is kept; the replacement pins the `nameField` limb on an isolated
fixture (`invoice_number`) that no other limb can rescue.
- The `(c)` case is re-pinned as an exact reported set rather than the absence
of a string, so it fails in both directions.
- A new pin in `validate-semantic-roles.test.ts` covers the chain removal,
which previously had no test at all, paired with a positive `nameField`
assertion so neither half can pass vacuously.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BDmDsu2575gDxeMCxXhDE3
Copy file name to clipboardExpand all lines: skills/objectstack-data/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -998,7 +998,7 @@ Data-model rules (in addition to naming/label/i18n):
998
998
|`relationship/association-inline-edit`| warning | an association (comment/audit/activity) marked `inlineEdit` (clutters the parent form — use a detail-page related list) |
999
999
|`rollup/missing-summary`| suggestion | a parent of numeric master_detail children with no roll-up `summary`|
1000
1000
|`field/select-missing-options`| warning | a `select`/`multiselect`/`radio` with no `options` (or options source) |
1001
-
|`object/missing-name-field`| suggestion | an object with no name/title field or `primaryField`|
1001
+
|`object/missing-name-field`| suggestion | an object with no `nameField` (ADR-0079's canonical title pointer) and no name-like field (`name`/`title`/`subject`/`label`/`full_name`/`display_name`/`code`)|
1002
1002
1003
1003
These same rules are the **rubric for AI-generated metadata** — a generation is
1004
1004
"good" exactly when it is schema-valid and lint-clean:
0 commit comments