From 0249dda86acac57ba79167155b4f7e814d93672c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 00:11:33 +0000 Subject: [PATCH 1/2] =?UTF-8?q?docs(skills):=20an=20owner,=20assignee=20or?= =?UTF-8?q?=20=E8=B4=9F=E8=B4=A3=E4=BA=BA=20in=20a=20request=20is=20the=20?= =?UTF-8?q?injected=20owner=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit objectstack-data's Record owner row now covers a request's assignee, 负责人 or 处理人, and names the visible injected columns a separate handler field must not share a label with. The Quick-Start Template drops its assigned_to user field, field-types.md stops naming assignee as a user-field example, and eval 18 asks for a ticket app with a 负责人. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5ocBJgBm6Bz2yqoibS --- .changeset/33506-skills-owner-id-for-assignee.md | 10 ++++++++++ skills/objectstack-data/SKILL.md | 12 +++++------- skills/objectstack-data/evals/README.md | 2 +- .../evals/objects-fields-relationships.json | 16 ++++++++++++++++ .../references/examples-objects.md | 2 +- skills/objectstack-data/rules/field-types.md | 2 +- 6 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 .changeset/33506-skills-owner-id-for-assignee.md diff --git a/.changeset/33506-skills-owner-id-for-assignee.md b/.changeset/33506-skills-owner-id-for-assignee.md new file mode 100644 index 00000000000..d8eecb18e35 --- /dev/null +++ b/.changeset/33506-skills-owner-id-for-assignee.md @@ -0,0 +1,10 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): an owner, assignee or 负责人 in a request is the injected `owner_id`, never a second same-label field + +Clause-②: no +Metadata-protocol: none + +objectstack-data teaches that a request's owner, assignee, 负责人 or 处理人 is the platform's injected `owner_id`, not a second person field beside it. A handler the request names apart from the owner is a `user` field that grants no access, with a label no other visible field carries, the injected `owner_id` (Owner, 负责人), `created_by`, `updated_by`, `created_at` and `updated_at` included. To pay for the text inside the file's token ceiling, SKILL.md drops a ruling date, two ADR asides and a sentence restating its heading. The Quick-Start Template's support case no longer declares an `assigned_to` user field, and a new eval asks for a ticket app with a 负责人. diff --git a/skills/objectstack-data/SKILL.md b/skills/objectstack-data/SKILL.md index 47b9bd81592..e0607d19328 100644 --- a/skills/objectstack-data/SKILL.md +++ b/skills/objectstack-data/SKILL.md @@ -66,7 +66,7 @@ database table and exposes automatic CRUD APIs. |:---------|:-------|:-----------|:------------| | `name` | string | `snake_case` | Immutable machine identifier (`/^[a-z_][a-z0-9_]*$/`) | | `fields` | map | keys in `snake_case` | Field definitions | -| `sharingModel` | enum | one of the four below | Org-wide default record visibility (OWD). Zod marks it optional, but **a publish with no authored `sharingModel` is refused** with the 422 lint envelope `security-owd-unset` — absence is not a decision (maintainer ruling 2026-08-13). Author it on every object | +| `sharingModel` | enum | one of the four below | Org-wide default record visibility (OWD). Zod marks it optional, but **a publish with no authored `sharingModel` is refused** with the 422 lint envelope `security-owd-unset` — absence is not a decision. Author it on every object | **`sharingModel` — the four canonical values** (ADR-0090 D4; legacy aliases removed). A *custom* object that omits it resolves to `private` at runtime, but @@ -106,8 +106,6 @@ all (Relationship Patterns below). ### Object Capabilities (`enable`) -Toggle system behaviours per object: - | Flag | Default | Purpose | |:-----|:--------|:--------| | `trackHistory` | `false` | Field-level audit trail | @@ -123,7 +121,7 @@ Toggle system behaviours per object: ## Search Fields (`searchableFields`) -`searchableFields` on the object is the canonical set `$search` scans (ADR-0061). +`searchableFields` on the object is the canonical set `$search` scans. Leave it unset and search auto-defaults to the `nameField` plus the object's short-text and enum columns (`text` / `email` / `phone` / `url` / `autonumber` / `textarea` / `markdown` / `select`) plus every field marked `searchable: true`, @@ -253,7 +251,7 @@ schema, and the **database column wins at write time**: | rename a field | `renamedFrom: ['old_key']` on the new key: the sync carries the column's values | | declared index removed, or its columns changed | `os migrate apply` (`--allow-destructive` when it drops, or rebuilds as `UNIQUE`) | -**`required` is not the `NOT NULL` dial (ADR-0113).** `required` is the +**`required` is not the `NOT NULL` dial.** `required` is the **write contract** — the engine refuses an insert that omits the value — and it implies nothing about the column. The physical constraint is a separate explicit opt-in, `storage: { notNull: true }`, and it is what drift detection compares @@ -292,7 +290,7 @@ picker; `formula` takes CEL in `expression` (`F\`...\`` from `@objectstack/spec` accepted" (terms, a confirmation) is a `validations[]` rule, not `required`. The default also lands seeded or imported rows that omit the column on a real `false` instead of a null that only looks unchecked. -- A person on the record (assignee, approver, reviewer) is `type: 'user'` with +- A person on the record (approver, reviewer) is `type: 'user'` with no `reference`, and optional unless the request says otherwise — the platform already stamps the owner and `created_by`. - A dynamic default (`defaultValue: 'current_user'`, `'NOW()'`, a CEL envelope) @@ -311,7 +309,7 @@ picker; `formula` takes CEL in `expression` (`F\`...\`` from `@objectstack/spec` | Hierarchical | `tree` field (self-reference) | | Record status / lifecycle | a `select` on the business object (plus a `state_machine` validation) — never a separate status / stage / step table | | Approval, review, routing, audit trail | not objects: an approval is a flow node (**objectstack-automation**) and its trail is platform history; model only the people it references (approver, reviewer), as `user` fields beside the owner | -| Record owner | the platform's `owner_id` (`ownership: 'user'`, the default) — never a hand-added "owner" / "person in charge" lookup, a second owner that owner-scoped visibility and "My records" views never read; `ownership: 'none'` only for a shared catalog or a pure junction table | +| Record owner | the platform's `owner_id` (`ownership: 'user'`, the default), also when the request says assignee, 负责人 or 处理人 — never a hand-added owner field, a second owner that owner-scoped visibility and "My records" views never read. A handler the request names apart from the owner is a `user` field that grants no access, with a label no other visible field carries, injected ones included: `owner_id` (Owner, 负责人), `created_by` (创建人), `updated_by` (更新人), `created_at` (创建时间), `updated_at` (更新时间). `ownership: 'none'` only for a shared catalog or a pure junction table | > **`multiple: true` lookup ≠ junction object.** A multi-value lookup > (`{ type: 'lookup', reference: 'x', multiple: true }`) is stored and read as an diff --git a/skills/objectstack-data/evals/README.md b/skills/objectstack-data/evals/README.md index 5baff576d2e..061cbc218da 100644 --- a/skills/objectstack-data/evals/README.md +++ b/skills/objectstack-data/evals/README.md @@ -6,7 +6,7 @@ JSON fixtures in the objectui shape (`skill_name`, `evals[]`: `prompt`, - `objects-fields-relationships.json` — naming, field types (`secret` vs `password`), relationships (junction vs multi-value lookup, `deleteBehavior`, on a `user` field too), validation (`state_machine`, unique **index**), - conditional field rules. + conditional field rules, the record owner (负责人 is `owner_id`). - `hooks-security-seeds-datasources.json` — search mirrors via hooks, permission-set scopes, external datasources, seeds (`externalId`, CEL dynamic values). diff --git a/skills/objectstack-data/evals/objects-fields-relationships.json b/skills/objectstack-data/evals/objects-fields-relationships.json index 4979d485ec9..113272b801d 100644 --- a/skills/objectstack-data/evals/objects-fields-relationships.json +++ b/skills/objectstack-data/evals/objects-fields-relationships.json @@ -308,6 +308,22 @@ "sharing: { writeRequiresMasterRead" ] } + }, + { + "id": 18, + "prompt": "帮我搭一个工单管理应用:`ticket` 对象有标题、状态(新建 / 处理中 / 已解决)、优先级,以及负责人,负责人可以改派给别的同事。", + "expected_output": "The 负责人 is the platform's injected `owner_id` (`ownership: 'user'`, the default; label Owner / 负责人): reassigning the ticket writes `owner_id`, which also drives owner-scoped visibility and \"My records\" views. The `ticket` object declares no `assignee` / `assigned_to` / owner field of its own and no second visible field labelled 负责人; only a handler the request names apart from the owner would be a `user` field, with a label no other visible field carries (system fields `created_by` 创建人 and `updated_by` 更新人 included), granting no access.", + "files": [], + "assertions": { + "must_contain": [ + "owner_id" + ], + "must_not_contain": [ + "assignee:", + "assigned_to:", + "label: '负责人'" + ] + } } ] } diff --git a/skills/objectstack-data/references/examples-objects.md b/skills/objectstack-data/references/examples-objects.md index 3488518ccb0..635bc70d5dc 100644 --- a/skills/objectstack-data/references/examples-objects.md +++ b/skills/objectstack-data/references/examples-objects.md @@ -85,7 +85,7 @@ export default ObjectSchema.create({ ]}, account: { type: 'lookup', reference: 'account', required: true }, contact: { type: 'lookup', reference: 'contact' }, - assigned_to: { type: 'user' }, + // assignee: the injected owner_id due_date: { type: 'datetime' }, }, validations: [ diff --git a/skills/objectstack-data/rules/field-types.md b/skills/objectstack-data/rules/field-types.md index dba9c6f6e7f..7f55fb47809 100644 --- a/skills/objectstack-data/rules/field-types.md +++ b/skills/objectstack-data/rules/field-types.md @@ -93,7 +93,7 @@ options: [ | `lookup` | Reference another object (independent) | `reference`, `lookupFilters`, `multiple`, `deleteBehavior`, `lookupAutofill` | | `master_detail` | Parent–child with lifecycle control | `reference`, `deleteBehavior` (`cascade`/`restrict` — `set_null` is refused), `lookupAutofill` | | `tree` | Hierarchical self-reference | `reference` — optional; when written, this object's own name (any other object is refused at parse) | -| `user` | Person picker — a lookup specialized to `sys_user` (assignee, watchers). Stored identically to `lookup` | `multiple` (collaborators), `defaultValue: 'current_user'`, `deleteBehavior` (no default; declared, as on `lookup`: relationships.md → Delete Behaviors) | +| `user` | Person picker — a lookup specialized to `sys_user` (reviewer, watchers). Stored identically to `lookup` | `multiple` (collaborators), `defaultValue: 'current_user'`, `deleteBehavior` (no default; declared, as on `lookup`: relationships.md → Delete Behaviors) | **`lookupAutofill: [{ target, source, overwrite? }]`** (single-value `lookup` / `master_detail`): a pick copies the picked record's `source` into this object's From a2d3008d8b87a23dbcd0aa8fcb11295335eb6c35 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 05:09:38 +0000 Subject: [PATCH 2/2] docs(skills): pay objectstack-data SKILL.md's ratchet again after the merge main's aiReadable row spent the headroom this branch had used; drop two more ADR asides, the ObjectExtensionSchema and PermissionSetSchema pointers (references/_index.md carries object.zod.ts and permission.zod.ts), the BASE_FIELD_DISPLAY_WHITELIST constant name and the validation.md link the Quick Reference list already gives. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5ocBJgBm6Bz2yqoibS --- .changeset/33506-skills-owner-id-for-assignee.md | 2 +- skills/objectstack-data/SKILL.md | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.changeset/33506-skills-owner-id-for-assignee.md b/.changeset/33506-skills-owner-id-for-assignee.md index d8eecb18e35..8d564b6aa4c 100644 --- a/.changeset/33506-skills-owner-id-for-assignee.md +++ b/.changeset/33506-skills-owner-id-for-assignee.md @@ -7,4 +7,4 @@ docs(skills): an owner, assignee or 负责人 in a request is the injected `owne Clause-②: no Metadata-protocol: none -objectstack-data teaches that a request's owner, assignee, 负责人 or 处理人 is the platform's injected `owner_id`, not a second person field beside it. A handler the request names apart from the owner is a `user` field that grants no access, with a label no other visible field carries, the injected `owner_id` (Owner, 负责人), `created_by`, `updated_by`, `created_at` and `updated_at` included. To pay for the text inside the file's token ceiling, SKILL.md drops a ruling date, two ADR asides and a sentence restating its heading. The Quick-Start Template's support case no longer declares an `assigned_to` user field, and a new eval asks for a ticket app with a 负责人. +objectstack-data teaches that a request's owner, assignee, 负责人 or 处理人 is the platform's injected `owner_id`, not a second person field beside it. A handler the request names apart from the owner is a `user` field that grants no access, with a label no other visible field carries, the injected `owner_id` (Owner, 负责人), `created_by`, `updated_by`, `created_at` and `updated_at` included. To pay for the text inside the file's token ceiling, SKILL.md drops a ruling date, four ADR asides, two zod pointers that `references/_index.md` already carries, an internal constant name, a sentence restating its heading and a link the Quick Reference list already gives. The Quick-Start Template's support case no longer declares an `assigned_to` user field, and a new eval asks for a ticket app with a 负责人. diff --git a/skills/objectstack-data/SKILL.md b/skills/objectstack-data/SKILL.md index e60f1af6f7e..a72b1df275c 100644 --- a/skills/objectstack-data/SKILL.md +++ b/skills/objectstack-data/SKILL.md @@ -337,9 +337,7 @@ one: `draft` / `pending` / `new`), never a terminal one; keys and values are option `value`s, never labels. > **There is NO `unique` validation type** — uniqueness is a unique **index** -> with its scope (ADR-0120; [rules/validation.md § Uniqueness](./rules/validation.md#uniqueness--use-unique-indexes)). - -See [rules/validation.md](./rules/validation.md) for all types and examples. +> with its scope ([rules/validation.md § Uniqueness](./rules/validation.md#uniqueness--use-unique-indexes)). ### Index Patterns @@ -370,13 +368,12 @@ To add fields/validations/indexes to an object you do not own, author `200`, range `0–999`); an extension can add but never remove, except that a new `label` without `pluralLabel` clears the base plural unless a tenant authored it (set both). ⛔ Not the same key as object-level `ownership` (the record-ownership enum -`'user' | 'business_unit' | 'org' | 'none'`). Schema: -`node_modules/@objectstack/spec/src/data/object.zod.ts` (`ObjectExtensionSchema`). +`'user' | 'business_unit' | 'org' | 'none'`). **Relabel a field the owner declares with `fieldPatches` — never by redeclaring it in `fields`**, which takes the field over whole and cuts it off from the -owner's upgrades. A patch carries display keys only -(`BASE_FIELD_DISPLAY_WHITELIST`): `label`, `description`, `inlineHelpText`, +owner's upgrades. A patch carries display keys only: +`label`, `description`, `inlineHelpText`, `placeholder`, and an option's `label` keyed by its stored `value`; the type, values and rules stay the owner's. A key the tenant edited keeps the tenant's text; between two extensions the higher `priority` wins. A patch naming a field @@ -384,7 +381,7 @@ or option value the target lacks is refused at install and by `os validate`, and a `picklist`-bound field's options are never patchable. Example: `defineObjectExtension({ extend: 'crm_account', fieldPatches: { industry: { label: 'Sector' }, type: { options: { customer: { label: 'Client' } } } } })`. -**An object an installed package ships** (ADR-0146 D10) is extended from the +**An object an installed package ships** is extended from the base's paired `.custom` package (`hotcrm.custom`; **objectstack-platform** § Customizing an installed package), never replaced: it takes no `overrides` declaration. Every field the pair adds ends in `__c` (`region__c`). The suffix is @@ -414,7 +411,7 @@ hand-writing an RLS policy (ADR-0057 D1): `own` (default) · `own_and_reports` only `own` and `org` work in open source — the hierarchy-relative three need the paid `@objectstack/security-enterprise` plugin, **fail closed to `own`** without it, and `defineStack` errors unless the grant declares -`requires: ['hierarchy-security']`. Schema: `PermissionSetSchema.objects.*`. +`requires: ['hierarchy-security']`. ### Ownership queues — park a record for a team to claim