Skip to content

Commit 10f2b24

Browse files
committed
docs(skills): name the injected owner_id as the record owner in ui, query and automation examples
The ui list-view, action and dashboard examples, the query expand example and the automation notify recipients used assigned_to / assignee as the owner beside the injected owner_id, contradicting objectstack-data's record-owner rule. Point them at owner_id, link the "mine" filter to the objectstack-data rule once, and update the evals that answered the owner with assigned_to / assignee. Views eval 2's reference answer no longer contains its own must_not_contain literal. Claude-Session: https://claude.ai/code/session_01FEkQ5m9ZMjU7EYnzJH8T6s Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6ff3eee commit 10f2b24

8 files changed

Lines changed: 30 additions & 20 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
skills(objectstack-ui, query, automation): examples name the injected `owner_id` as the record owner, not an `assigned_to` / `assignee` field
6+
7+
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.
8+
9+
Clause-②: no
10+
Metadata-protocol: none

‎skills/objectstack-automation/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ a `{token}` in one is refused.
112112
```ts
113113
import type { FlowNode } from '@objectstack/spec/automation';
114114
const notify: FlowNode = { id: 'tell_owner', type: 'notify', label: 'Notify Owner', config: {
115-
recipients: { dialect: 'cel', source: 'record.assignee' }, // REQUIRED — id, list, or envelope; a CSV is ONE id.
115+
recipients: { dialect: 'cel', source: 'record.owner_id' }, // REQUIRED — id, list, or envelope; a CSV is ONE id.
116116
// 4th form `{ emailField: 'applicant_email' }`: an `email` field of the trigger record, for a non-user —
117117
// then `channels: 'email'` alone. An envelope must yield USER ids: an address no user holds fails the node
118118
title: 'Done: {{ record.title }}', // inline; XOR `template` (RAW, localizable)

‎skills/objectstack-query/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ key in `fields`** — the relation is carried by that column:
287287
import type { IDataEngine } from '@objectstack/spec/contracts';
288288
declare const engine: IDataEngine;
289289
const tasks = await engine.find('task', {
290-
fields: ['title', 'status', 'assignee', 'project'], // the FK columns stay
290+
fields: ['title', 'status', 'owner_id', 'project'], // the FK columns stay
291291
expand: {
292-
assignee: { object: 'user', fields: ['name', 'email'] },
292+
owner_id: { object: 'user', fields: ['name', 'email'] },
293293
project: {
294294
object: 'project',
295295
fields: ['name'],

‎skills/objectstack-query/evals/filters-pagination-search.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
{
3535
"id": 4,
3636
"prompt": "Search tasks by keyword across the title and the parent project's name, and show each task's assignee name and email.",
37-
"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.",
37+
"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.",
3838
"files": [],
3939
"assertions": {
40-
"must_contain": ["searchFields", "expand", "fields", "stored"],
40+
"must_contain": ["searchFields", "expand", "fields", "stored", "owner_id"],
4141
"must_not_contain": ["'project_id.name'", "fuzzy:"]
4242
}
4343
},

‎skills/objectstack-ui/evals/views-apps-actions-pages.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
{
55
"id": 1,
66
"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.",
7-
"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.",
7+
"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.",
88
"files": [],
99
"assertions": {
10-
"must_contain": ["defineView", "provider: 'object'", "listViews", "groupByField", "link: true", "{current_user_id}"],
11-
"must_not_contain": ["groupBy:", "conditionalRequired:"]
10+
"must_contain": ["defineView", "provider: 'object'", "listViews", "groupByField", "link: true", "{current_user_id}", "owner_id"],
11+
"must_not_contain": ["groupBy:", "conditionalRequired:", "'assigned_to'"]
1212
}
1313
},
1414
{
1515
"id": 2,
1616
"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.",
17-
"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 })`.",
17+
"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 })`.",
1818
"files": [],
1919
"assertions": {
2020
"must_contain": ["App.create", "navigation", "objectName", "viewName", "filters", "approvals:inbox", "requiresService", "requiredPermissions"],
@@ -114,11 +114,11 @@
114114
{
115115
"id": 12,
116116
"prompt": "On `task`, add an 'Attention' list for the signed-in user: their tasks that are open or urgent, in one list.",
117-
"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.",
117+
"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.",
118118
"files": [],
119119
"assertions": {
120-
"must_contain": ["listViews", "or: [", "{current_user_id}"],
121-
"must_not_contain": ["$or:", "logic:", "conditions:", "anyOf:"]
120+
"must_contain": ["listViews", "or: [", "{current_user_id}", "owner_id"],
121+
"must_not_contain": ["$or:", "logic:", "conditions:", "anyOf:", "'assigned_to'"]
122122
}
123123
},
124124
{

‎skills/objectstack-ui/rules/actions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const ReassignLeadAction = defineAction({
4141
locations: ['record_header', 'list_item'],
4242
disabled: P`record.status == "converted"`,
4343
disabledReason: 'A converted lead is reassigned from its opportunity.',
44-
params: [{ field: 'assigned_to', required: true }],
44+
params: [{ field: 'owner_id', required: true }],
4545
submitText: 'Reassign',
4646
undoable: true,
4747
successMessage: 'Lead {{ record.name }} reassigned.',

‎skills/objectstack-ui/rules/dashboards.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ import type { DashboardWidget } from '@objectstack/spec/ui';
266266
const widgets: DashboardWidget[] = [
267267
// Metric — WoW delta
268268
{ id: 'done_this_week', type: 'metric', dataset: 'crm_task_metrics', values: ['task_count'],
269-
filter: { assignee: '{current_user_id}', status: 'done',
269+
filter: { owner_id: '{current_user_id}', status: 'done',
270270
completed_at: { $gte: '{week_start}' } },
271271
compareTo: { kind: 'previousPeriod' } },
272272

‎skills/objectstack-ui/rules/list-views.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ data: { provider: 'value', items: [...] }
5050

5151
```typescript
5252
// Simple — field names only
53-
columns: ['subject', 'status', 'priority', 'assigned_to', 'due_date']
53+
columns: ['subject', 'status', 'priority', 'owner_id', 'due_date']
5454

5555
// Enhanced — full control
5656
columns: [
5757
{ field: 'subject', link: true, width: 300 },
5858
{ field: 'status', width: 120, align: 'center' },
5959
{ field: 'priority' },
60-
{ field: 'assigned_to', label: 'Owner' },
60+
{ field: 'owner_id' },
6161
{
6262
field: 'due_date',
6363
summary: 'min', // plain enum value, not an object
@@ -98,7 +98,7 @@ filter: [
9898
{ field: 'status', operator: 'equals', value: 'open' },
9999
{ field: 'priority', operator: 'equals', value: 'urgent' },
100100
] },
101-
{ field: 'assigned_to', operator: 'equals', value: '{current_user_id}' }, // … AND mine ({current_user_id} = the signed-in user)
101+
{ field: 'owner_id', operator: 'equals', value: '{current_user_id}' }, // … AND mine: the record owner (objectstack-data § Relationship Patterns)
102102
]
103103
```
104104

@@ -262,12 +262,12 @@ import type { ListView } from '@objectstack/spec/ui';
262262
const board: ListView = {
263263
type: 'kanban',
264264
data: { provider: 'object', object: 'project_task' },
265-
columns: ['title', 'assignee', 'priority'],
265+
columns: ['title', 'owner_id', 'priority'],
266266
kanban: {
267267
groupByField: 'status', // a select field — one lane per option
268268
lanes: ['todo', 'in_progress', 'review'],
269269
summarizeField: 'estimate_hours', // optional — summed at the top of each column
270-
columns: ['title', 'assignee', 'priority'], // fields shown on each card
270+
columns: ['title', 'owner_id', 'priority'], // fields shown on each card
271271
},
272272
sort: [{ field: 'priority', order: 'desc' }],
273273
};
@@ -318,7 +318,7 @@ import type { ListView } from '@objectstack/spec/ui';
318318
const timeline: ListView = {
319319
type: 'gantt',
320320
data: { provider: 'object', object: 'project_task' },
321-
columns: ['name', 'assigned_to', 'status'], // left-pane tree columns
321+
columns: ['name', 'owner_id', 'status'], // left-pane tree columns
322322
gantt: {
323323
startDateField: 'start_date', // task bar start
324324
endDateField: 'end_date', // task bar end

0 commit comments

Comments
 (0)