diff --git a/.changeset/33560-skills-owner-id-not-assigned-to.md b/.changeset/33560-skills-owner-id-not-assigned-to.md new file mode 100644 index 00000000000..9ad42b495b8 --- /dev/null +++ b/.changeset/33560-skills-owner-id-not-assigned-to.md @@ -0,0 +1,10 @@ +--- +'@objectstack/skills': patch +--- + +skills(objectstack-ui, query, automation): examples name the injected `owner_id` as the record owner, not an `assigned_to` / `assignee` field + +objectstack-data teaches that a request's owner, assignee, 负责人 or 处理人 is the platform's injected `owner_id`. The other skills still taught a separate `assigned_to` / `assignee` field as the owner, so an agent loading both got conflicting teaching. Now the objectstack-ui list-view columns, the "mine" filter, the kanban and gantt columns, the reassign action's param and the dashboard metric filter use `owner_id`. The column that relabelled `assigned_to` as "Owner" is gone. The "mine" filter links to objectstack-data § Relationship Patterns. The objectstack-query `expand` example and the objectstack-automation `notify` recipients do the same. Evals: objectstack-ui views evals 1 and 12 and objectstack-query eval 4 now expect `owner_id`. Views eval 2's reference answer no longer spells the `requiresObject` literal its own assertion forbids. + +Clause-②: no +Metadata-protocol: none diff --git a/skills/objectstack-automation/SKILL.md b/skills/objectstack-automation/SKILL.md index 381c4b03cf3..4c52bed3479 100644 --- a/skills/objectstack-automation/SKILL.md +++ b/skills/objectstack-automation/SKILL.md @@ -112,7 +112,7 @@ a `{token}` in one is refused. ```ts import type { FlowNode } from '@objectstack/spec/automation'; const notify: FlowNode = { id: 'tell_owner', type: 'notify', label: 'Notify Owner', config: { - recipients: { dialect: 'cel', source: 'record.assignee' }, // REQUIRED — id, list, or envelope; a CSV is ONE id. + recipients: { dialect: 'cel', source: 'record.owner_id' }, // REQUIRED — id, list, or envelope; a CSV is ONE id. // 4th form `{ emailField: 'applicant_email' }`: an `email` field of the trigger record, for a non-user — // then `channels: 'email'` alone. An envelope must yield USER ids: an address no user holds fails the node title: 'Done: {{ record.title }}', // inline; XOR `template` (RAW, localizable) diff --git a/skills/objectstack-query/SKILL.md b/skills/objectstack-query/SKILL.md index 574961745a7..28b4444809b 100644 --- a/skills/objectstack-query/SKILL.md +++ b/skills/objectstack-query/SKILL.md @@ -287,9 +287,9 @@ key in `fields`** — the relation is carried by that column: import type { IDataEngine } from '@objectstack/spec/contracts'; declare const engine: IDataEngine; const tasks = await engine.find('task', { - fields: ['title', 'status', 'assignee', 'project'], // the FK columns stay + fields: ['title', 'status', 'owner_id', 'project'], // the FK columns stay expand: { - assignee: { object: 'user', fields: ['name', 'email'] }, + owner_id: { object: 'user', fields: ['name', 'email'] }, project: { object: 'project', fields: ['name'], diff --git a/skills/objectstack-query/evals/filters-pagination-search.json b/skills/objectstack-query/evals/filters-pagination-search.json index 906cc705971..4dc22835528 100644 --- a/skills/objectstack-query/evals/filters-pagination-search.json +++ b/skills/objectstack-query/evals/filters-pagination-search.json @@ -34,10 +34,10 @@ { "id": 4, "prompt": "Search tasks by keyword across the title and the parent project's name, and show each task's assignee name and email.", - "expected_output": "`engine.find('task', { search: 'term', searchFields: ['title', 'project_name'], fields: ['title', 'status', 'assignee'], expand: { assignee: { object: 'user', fields: ['name', 'email'] } } })`: `search` never traverses, so the project name is a stored mirror field on `task` (objectstack-data), never a dotted `project_id.name`; the projection keeps the `assignee` FK column or `expand` resolves nothing. No `fuzzy` / `boost` / `highlight` knobs — validated then ignored.", + "expected_output": "`engine.find('task', { search: 'term', searchFields: ['title', 'project_name'], fields: ['title', 'status', 'owner_id'], expand: { owner_id: { object: 'user', fields: ['name', 'email'] } } })`: `search` never traverses, so the project name is a stored mirror field on `task` (objectstack-data), never a dotted `project_id.name`; the assignee is the record owner `owner_id`, and the projection keeps that FK column or `expand` resolves nothing. No `fuzzy` / `boost` / `highlight` knobs — validated then ignored.", "files": [], "assertions": { - "must_contain": ["searchFields", "expand", "fields", "stored"], + "must_contain": ["searchFields", "expand", "fields", "stored", "owner_id"], "must_not_contain": ["'project_id.name'", "fuzzy:"] } }, diff --git a/skills/objectstack-ui/evals/views-apps-actions-pages.json b/skills/objectstack-ui/evals/views-apps-actions-pages.json index 9dc8244668b..0e376f30712 100644 --- a/skills/objectstack-ui/evals/views-apps-actions-pages.json +++ b/skills/objectstack-ui/evals/views-apps-actions-pages.json @@ -4,17 +4,17 @@ { "id": 1, "prompt": "Create `src/views/support-case.view.ts`: a default grid (subject linking to the record, status, priority, owner, due date), a 'My Open Cases' list, a kanban by status, and a simple edit form.", - "expected_output": "One `defineView({ list, form, listViews })` container — never a bare flat view object. `data: { provider: 'object', object: 'support_case' }`, `columns` with `link: true` on `subject`, a `listViews.my_open` entry with `filter` triples (`{ field: 'assigned_to', operator: 'equals', value: '{current_user_id}' }`), a kanban entry with the required top-level `columns` plus `kanban: { groupByField: 'status' }` (no top-level `groupBy`), and `form` with `type: 'simple'` and `sections` referencing a declared field group.", + "expected_output": "One `defineView({ list, form, listViews })` container — never a bare flat view object. `data: { provider: 'object', object: 'support_case' }`, `columns` with `link: true` on `subject`, the owner column is the injected `owner_id` (never an `assigned_to` field), a `listViews.my_open` entry with `filter` triples (`{ field: 'owner_id', operator: 'equals', value: '{current_user_id}' }`), a kanban entry with the required top-level `columns` plus `kanban: { groupByField: 'status' }` (no top-level `groupBy`), and `form` with `type: 'simple'` and `sections` referencing a declared field group.", "files": [], "assertions": { - "must_contain": ["defineView", "provider: 'object'", "listViews", "groupByField", "link: true", "{current_user_id}"], - "must_not_contain": ["groupBy:", "conditionalRequired:"] + "must_contain": ["defineView", "provider: 'object'", "listViews", "groupByField", "link: true", "{current_user_id}", "owner_id"], + "must_not_contain": ["groupBy:", "conditionalRequired:", "'assigned_to'"] } }, { "id": 2, "prompt": "Build `src/apps/crm.app.ts`: a Sales group with Leads, Opportunities, the pipeline kanban, a 'My open deals' entry and the sales dashboard; an Approvals group that only shows when approvals are installed; and a second app for the support team, who work the same objects.", - "expected_output": "`App.create({...})` with a `navigation` tree of `group` items: `type: 'object'` entries with `objectName`, a `viewName: 'pipeline_kanban'` shortcut, a bare `filters: { owner_id: '{current_user_id}', status: 'open' }` slice for 'My open deals' (no view authored for a one-off), `type: 'dashboard'` with `dashboardName`, and the approvals inbox as `type: 'component', componentRef: 'approvals:inbox'` gated by `requiresService: 'approvals'` (never `requiresObject: 'sys_approval_request'`: that object read answers 404 to an approver until a request involves them). At most one app per package, so not a second `App.create` here: the support team shares this product and its objects, so it is a `requiredPermissions`-gated group inside the app. (A support product with objects of its own would carry its app in its own `type: 'module'` package of the suite.) Registered under `defineStack({ apps })`.", + "expected_output": "`App.create({...})` with a `navigation` tree of `group` items: `type: 'object'` entries with `objectName`, a `viewName: 'pipeline_kanban'` shortcut, a bare `filters: { owner_id: '{current_user_id}', status: 'open' }` slice for 'My open deals' (no view authored for a one-off), `type: 'dashboard'` with `dashboardName`, and the approvals inbox as `type: 'component', componentRef: 'approvals:inbox'` gated by `requiresService: 'approvals'` (never a `requiresObject` gate on `sys_approval_request`: that object read answers 404 to an approver until a request involves them). At most one app per package, so not a second `App.create` here: the support team shares this product and its objects, so it is a `requiredPermissions`-gated group inside the app. (A support product with objects of its own would carry its app in its own `type: 'module'` package of the suite.) Registered under `defineStack({ apps })`.", "files": [], "assertions": { "must_contain": ["App.create", "navigation", "objectName", "viewName", "filters", "approvals:inbox", "requiresService", "requiredPermissions"], @@ -114,11 +114,11 @@ { "id": 12, "prompt": "On `task`, add an 'Attention' list for the signed-in user: their tasks that are open or urgent, in one list.", - "expected_output": "One `listViews.attention` entry, not two views. Its `filter` is a list whose elements all match: one any-of group `{ or: [{ field: 'status', operator: 'equals', value: 'open' }, { field: 'priority', operator: 'equals', value: 'urgent' }] }` beside the rule `{ field: 'assigned_to', operator: 'equals', value: '{current_user_id}' }`. Flat rules only inside the group; no `$or`, `logic` / `conditions` or `anyOf` key.", + "expected_output": "One `listViews.attention` entry, not two views. Its `filter` is a list whose elements all match: one any-of group `{ or: [{ field: 'status', operator: 'equals', value: 'open' }, { field: 'priority', operator: 'equals', value: 'urgent' }] }` beside the rule `{ field: 'owner_id', operator: 'equals', value: '{current_user_id}' }` (the record owner, never an `assigned_to` field). Flat rules only inside the group; no `$or`, `logic` / `conditions` or `anyOf` key.", "files": [], "assertions": { - "must_contain": ["listViews", "or: [", "{current_user_id}"], - "must_not_contain": ["$or:", "logic:", "conditions:", "anyOf:"] + "must_contain": ["listViews", "or: [", "{current_user_id}", "owner_id"], + "must_not_contain": ["$or:", "logic:", "conditions:", "anyOf:", "'assigned_to'"] } }, { diff --git a/skills/objectstack-ui/rules/actions.md b/skills/objectstack-ui/rules/actions.md index 576df6549e3..6f9ae070fc2 100644 --- a/skills/objectstack-ui/rules/actions.md +++ b/skills/objectstack-ui/rules/actions.md @@ -41,7 +41,7 @@ export const ReassignLeadAction = defineAction({ locations: ['record_header', 'list_item'], disabled: P`record.status == "converted"`, disabledReason: 'A converted lead is reassigned from its opportunity.', - params: [{ field: 'assigned_to', required: true }], + params: [{ field: 'owner_id', required: true }], submitText: 'Reassign', undoable: true, successMessage: 'Lead {{ record.name }} reassigned.', diff --git a/skills/objectstack-ui/rules/dashboards.md b/skills/objectstack-ui/rules/dashboards.md index c36ac2391fd..1b98ed26e58 100644 --- a/skills/objectstack-ui/rules/dashboards.md +++ b/skills/objectstack-ui/rules/dashboards.md @@ -266,7 +266,7 @@ import type { DashboardWidget } from '@objectstack/spec/ui'; const widgets: DashboardWidget[] = [ // Metric — WoW delta { id: 'done_this_week', type: 'metric', dataset: 'crm_task_metrics', values: ['task_count'], - filter: { assignee: '{current_user_id}', status: 'done', + filter: { owner_id: '{current_user_id}', status: 'done', completed_at: { $gte: '{week_start}' } }, compareTo: { kind: 'previousPeriod' } }, diff --git a/skills/objectstack-ui/rules/list-views.md b/skills/objectstack-ui/rules/list-views.md index c0e41531d4d..5357aeb80ed 100644 --- a/skills/objectstack-ui/rules/list-views.md +++ b/skills/objectstack-ui/rules/list-views.md @@ -50,14 +50,14 @@ data: { provider: 'value', items: [...] } ```typescript // Simple — field names only -columns: ['subject', 'status', 'priority', 'assigned_to', 'due_date'] +columns: ['subject', 'status', 'priority', 'owner_id', 'due_date'] // Enhanced — full control columns: [ { field: 'subject', link: true, width: 300 }, { field: 'status', width: 120, align: 'center' }, { field: 'priority' }, - { field: 'assigned_to', label: 'Owner' }, + { field: 'owner_id' }, { field: 'due_date', summary: 'min', // plain enum value, not an object @@ -98,7 +98,7 @@ filter: [ { field: 'status', operator: 'equals', value: 'open' }, { field: 'priority', operator: 'equals', value: 'urgent' }, ] }, - { field: 'assigned_to', operator: 'equals', value: '{current_user_id}' }, // … AND mine ({current_user_id} = the signed-in user) + { field: 'owner_id', operator: 'equals', value: '{current_user_id}' }, // … AND mine: the record owner (objectstack-data § Relationship Patterns) ] ``` @@ -262,12 +262,12 @@ import type { ListView } from '@objectstack/spec/ui'; const board: ListView = { type: 'kanban', data: { provider: 'object', object: 'project_task' }, - columns: ['title', 'assignee', 'priority'], + columns: ['title', 'owner_id', 'priority'], kanban: { groupByField: 'status', // a select field — one lane per option lanes: ['todo', 'in_progress', 'review'], summarizeField: 'estimate_hours', // optional — summed at the top of each column - columns: ['title', 'assignee', 'priority'], // fields shown on each card + columns: ['title', 'owner_id', 'priority'], // fields shown on each card }, sort: [{ field: 'priority', order: 'desc' }], }; @@ -318,7 +318,7 @@ import type { ListView } from '@objectstack/spec/ui'; const timeline: ListView = { type: 'gantt', data: { provider: 'object', object: 'project_task' }, - columns: ['name', 'assigned_to', 'status'], // left-pane tree columns + columns: ['name', 'owner_id', 'status'], // left-pane tree columns gantt: { startDateField: 'start_date', // task bar start endDateField: 'end_date', // task bar end